Hi All,
Can anyone help me on such a strange question?
I wrote a encrypted virtual disk driver to mount files as disk volumes.
Some DeviceIoctl function is wrote to execute special task such as password verification and nullification.
To get the device handle I use CreateFile function.
HANDLE Device = CreateFile(
VolumeName,
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING,
NULL
);
But I encounter a problem, In Windows 2000, everything is ok. In XP, when the volume is formated into NTFS, it’s ok, but when the volume is formated into FAT, FAT32, there is problem.
I mount a file using a deviceIoctl function and verify the password for it, then I nullify the authentication, then I verify password again for it, from this point(to get device handle to execute password verification through DeviceIoctl), the CreateFile function failed, GetLastError return 1(ERROR_INVALID_FUNCTION).
Who can tell me why?