Looking to dll import from vssapi.dll
,
Looking at the GetSnapshotDeviceName
function, and DLL export viewer gives me:
protected: long __cdecl CVssWriter::GetSnapshotDeviceName(unsigned short const * __ptr64,unsigned short const * __ptr64 * __ptr64)const __ptr64
protected: long __cdecl CVssJetWriter::GetSnapshotDeviceName(unsigned short const * __ptr64,unsigned short const * __ptr64 * __ptr64)const __ptr64
Assuming I want the first one, how do I declare the dll import, for instance:
[DllImport("vssapi.dll", EntryPoint = "CVssWriter::GetSnapshotDeviceName", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
private static extern uint GetSnapshotDeviceName(string wszOriginalVolume, out string ppwszSnapshotDevice);
[With or without the ExactSpelling] always gives me the
Unable to find an entry point named 'CVssWriter::GetSnapshotDeviceName' in DLL 'vssapi.dll
error. Variations on the colons (removing etc), and reversing the names (as the decorated version) gave me no joy either.
I know it can work using the decorated name or the ordinal, but I'd like the code to be reasonably portable (decls being compiler dependent, and nothing I've ever seen says ordinals will stay the same in updates either).
Yeah I already know with this dll it won't port to pre Vista ... that I can live with.
Also heard about AlphaVSS
too - but for what I need would be like using an aircraft carrier to go fishing on a lake (- and did they really need to make it so ungainly to use?)