How to read the reparse data for C:\Documents and Settings

  • Thread starter Thread starter Cacadril2
  • Start date Start date
C

Cacadril2

Guest
Hello,
I am trying to write a C (or C++) program that walks a file tree and notes all symlinks and "mount point" reparse points.

In order to test the code I am using this: note that "C:\Documents and Settings" is a reparse point:

HANDLE hnd = CreateFileW(
L"C:\\Documents and Settings",
GENERIC_READ,
FILE_SHARE_READ,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS|FILE_FLAG_OPEN_REPARSE_POINT,
NULL);

DeviceIoControl(
hnd,
FSCTL_GET_REPARSE_POINT,
NULL, 0,
&buffer, sizeof(buffer), &bytesreturned,
NULL);


but the CreateFile() call fails with "The specified system semaphore name was not found."

I am running the code "as administrator", and I first enable the Backup privilege. (Besides, omitting the backup-semantics flag makes no difference.) The thing is a reparse point, the reparse tag is IO_REPARSE_TAG_MOUNT_POINT

How should I do this?


Enrique Perez-Terron

Continue reading...
 
Back
Top