An updated C# port of X-Ways X-Tensions API.
jp-slackspace / x-tension-c-sharp Goto Github PK
View Code? Open in Web Editor NEWAn updated C# port of X-Ways X-Tensions API.
License: GNU General Public License v3.0
An updated C# port of X-Ways X-Tensions API.
License: GNU General Public License v3.0
Hello,
Although this works as described, the API has been since updated and can now return the item category, e.g 'Picture', 'Audio/video' and the file format consistency by combining the buffer length with some flags:
API documentation:
nBufferLenAndFlags contains the length of the buffer that lpTypeDescr points to in the lower word, measured in characters, and in v18.9 and later may be optionally combined with one of the below flags.
0x20000000: receive a textual description of the file type instead (e.g. “JPEG” or “Dynamic-Link Library”)
0x40000000: receive a textual designation of the category that the file type belongs to instead (e.g. “Pictures” or “Programs”)
0x80000000: receive type status as usual in the lowest byte, but file format consistency in the second-lowest byte (0=unknown, 1=OK, 2=irregular), v19.3 and later
Hi JP,
I'm having an issue with the GetHashValue function which does not appear to be providing me with the item hash. Is this because the Buffer should be filled with an initial value?
X-ways API: "The buffer should be prepared and its start filled with a single DWORD value of 0x00000001. In v18.0 SR-12, v18.1 SR-7, v18.2 SR-5, v18.3 SR-4 and later versions you may fill the buffer with a DWORD 0x00000002 to request the secondary hash value of a file instead of the primary hash value"
I'm running v19.3.
Thanks
Dan
public static string GetHashValue(int itemId)
{
// Fail if item Id less than 0 provided.
if (itemId < 0)
throw new ArgumentException("Invalid item Id provided.");
string Hash;
IntPtr Buffer = Marshal.AllocHGlobal(_volumeNameBufferLength);
ImportedMethods.XWF_GetHashValue(itemId, Buffer);
Hash = Marshal.PtrToStringUni(Buffer);
Marshal.FreeHGlobal(Buffer);
return Hash;
}
Hello,
According to the X-ways documentation the DLL should be unloaded when its finished, however DLLs compiled from this don't appear to. This prevents recompiling without the need to restart X-ways.
Also as a result when it is run again in x-ways without restarting, Private Static variables are still set from the first use. For example if a timecode is set in the first use, the timecode will be the same when next run.
To ensure that this is not due to any changes I have made I have tested the compiled DLL found in in this repository. This DLL cannot be deleted after first use as it is 'still in use', without closing x-ways first.
Thanks!
PS. thanks for resolving the other issue so quickly. This repository is incredibly useful.
Per xtaylord:
"in the GetFullPath method in HelperMethods, I don't think you need the initial line:
sb.Insert(0, GetItemName);
as this seems to cause the item name to be duplicated within the path"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.