When I call the "SetVolumeMountPoint" function in Kernel32.dll, I get the following error: Error code = 1008: An attempt was made to reference a token that does not exist. I get this error from any function I call in Kernel32.dll. However, I can call other Win32 functions from sample code I've seen without a problem. Any ideas? (I've included a code snippet here.)
call WINAPI "SetVolumeMountPointA" using by reference RestoreDrive, by reference VolumeGUID returning dwErrorCode end-call
if dwErrorCode = zero raise new Win32Exception end-if
catch obj-exception as type Win32Exception set str to FatalErrMsg & "HResult = " & obj-exception::HResult::ToString() & ", error code = " & obj-exception::NativeErrorCode::ToString() & ": " & obj-exception::Message
display str
------------------------------
Dennis Strahan
Principal Software Engineer
Self Registered
Raleigh NC US
------------------------------