Hi,
I need help in understanding the behaviour.
I have a driver which exports a file as a disk to user. The file is a
network file, it is mounted properly.
I have problem while unmounting. The code is not written by me, its written
by some one long time ago. works well on Win2K, and NT.
The driver creates a system thread and impersonates the logonuser. The
system thread works well with writes before i initiate an unmount.
As soon as i initiate an unmount, the write(ZwWriteFile) from the system
thread returns STATUS_INVALID_HANDLE. This sytem thread is the impersonated
thread. What is going on in the system is following.
- User initiates unmount.
- Driver receives the request.
- Driver tries to open the Drive to get the file object, the unmount is
done in the driver. The driver needs the file object to send fctl IOCTLS to
lockā¦ For this it uses ZwCreateFile - ZwCreateFile causes to write something to $Log file on NTFS volume on
this drive, which is exported by my driver. - Driver tries to write to the network file and these writes fail with
STATUS_INVALID_HANDLE.
I break into debugger after the ZwWriteFile failed, and if i do !handle on
the handle value, the handle looks good.
I ran FileMon, and see the request going to redirector and returning
STATUS_INVALID_HANDLE.
The OS i have problems on is Win XP SP0.
Please some one give me a hint on whats going wrong on XP thats works fine
on Win2k and NT.
-Srin.