I have experienced a strange bug. When I am trying to delete an symbolic link to the device object in the DriverUnload function, the IoDeleteSymbolicLink fails with the STATUS_OBJECT_NAME_NOT_FOUND status code. However, the symbolic link being deleting exists. I can assure that with the objdir.exe utility. Moreover, when I am deleting another symbolic link in the same DriverUnload function it is deleted without any problem.
Trying to delete the undeleted link when the driver is being loaded again completes perfectly.
The only difference between the successfully deleted and failed links is that the first one and the device object it references were created within the DriverEntry whereas the failed link was created in the function dispatching the IRP_MJ_DEVICE_CONTROL IRPs.
Certainly, I have been doubly checking that the name of the symbolic link passed to the IoCreateSymbolicLink and the IoDeleteSymbolicLink function is the same. Also I delete the link before the device object. Thus, I have no more idea what I am doing wrong. I am going to investigate this issue with the debugger tomorrow.
Trying to delete the undeleted link when the driver is being loaded again completes perfectly.
The only difference between the successfully deleted and failed links is that the first one and the device object it references were created within the DriverEntry whereas the failed link was created in the function dispatching the IRP_MJ_DEVICE_CONTROL IRPs.
Certainly, I have been doubly checking that the name of the symbolic link passed to the IoCreateSymbolicLink and the IoDeleteSymbolicLink function is the same. Also I delete the link before the device object. Thus, I have no more idea what I am doing wrong. I am going to investigate this issue with the debugger tomorrow.
No comments:
Post a Comment