Click to See Complete Forum and Search --> : Incorrect Function error while enumerating MFT


csona
January 18th, 2012, 05:29 AM
I have a C# application which enumerates USN data to get MFT records for getting a list of files on a volume. It uses DeviceIoControl function with various control codes to achieve the same.

It works on almost all of the machines so far except one where it fails by raising Win32exception Incorrect Function while calling DeviceIoControl with control code FSCTL_ENUM_USN_DATA. This error translates to win32 error code 1, ERROR_INVALID_FUNCTION. As per MSDN documentation for this control code, the file system on the specified volume does not support this control code.

However the change journal exists on this volume and controls codes like FSCTL_CREATE_USN_JOURNAL or FSCTL_QUERY_USN_JOURNAL do not raise any such erros. Is it somehow possible to make file system accept this control code by updating the device driver or anything?

Any help would be greatly appreciated.

Regards, CDS