EldoS | Feel safer!

Software components for data protection, secure storage and transfer

ReparseFileNameRule behavior with DeviceIoControl

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
Posted: 07/06/2015 18:17:46
by umair sadiq (Basic support level)
Joined: 01/23/2015
Posts: 7

I want to ask if DeviceIoControl works correctly with ReparseFileNameRule
1. I have a ReparseFileNameRule that redirects C:\foo to D:\foo.
2. I send two commands, a CreateFile for C:\foo with FILE_FLAG_OPEN_REPARSE_POINT followed by DeviceIoControl with FSCTL_GET_REPARSE_POINT using the handle returned by CreateFile.
3. The DeviceIOControl returns NOT_A_REPARSE_POINT.

To my understanding:
C:\foo is a ReparsePoint (because I added a ReparseFileNameRule C:\foo -> D:\foo)
D:\foo is a directory and not a ReparsePoint.

CreateFile(C:\foo,FILE_FLAG_OPEN_REPARSE_POINT)+DeviceIoControl should open the ReparsePoint
CreateFile(D:\foo,FILE_FLAG_OPEN_REPARSE_POINT)+DeviceIoControl should return ERROR_NOT_A_REPARSE_POINT

CreateFile(C:\foo,FILE_FLAG_OPEN_REPARSE_POINT)+DeviceIoControl returns NOT_A_REPARSE_POINT as the call gets redirected.

Is this expected behaviour or is there a workaround to handle DeviceIOControl correctly?

The code for CreateFile and DeviceIoControl message is as follows:

      handle = CreateFile(

      const DWORD size = REPARSE_GUID_DATA_BUFFER_HEADER_SIZE + 1024*1024;
      char buf[size];
      DWORD bytes_read;
      BOOL result = DeviceIoControl(
Posted: 07/06/2015 18:31:08
by Vladimir Cherniga (EldoS Corp.)

Reparse file name rule doesn't create reparse point, thus it doesn't support DeviceIoControl requests. Reparse file name uses reparse mechanism implemented in Windows and allow to dynamically change target file name in open/create request. Set/Get/Delete reparse point is not supported. Only file name redirection.
Posted: 07/07/2015 22:32:27
by umair sadiq (Basic support level)
Joined: 01/23/2015
Posts: 7

I see. All right, thank you for the clarification.



Topic viewed 4167 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!