How to unload if driver load function fails

Hi,

What is the correct unload procedure if the code in the DriverEntry
function fails ? Currently, I just call the DriverObject->DriverUnload
function, but somewhere somehow Windows thinks that my driver is still active.

If I manually load the driver using “net start DRIVER” and the code fails
then I would expect my driver to be disabled. But if I execute “net stop
DRIVER” then the result code is “The requested pause or stop is not valid
for this service.”, instead of the error message “The DRIVER service is not
started.”

Does anybody has a clue ?

With kind regards,

Bartjan Wattel


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> What is the correct unload procedure if the code in the DriverEntry

function fails ? Currently, I just call the DriverObject->DriverUnload

Do not do this. Clean up everything and return the error NTSTATUS from
DriverEntry.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com