flat assembler
Message board for the users of flat assembler.

Index > Windows > driverentry/driverunload jobs

Thread Post new topic Reply to topic

Joined: 21 May 2010
Posts: 287
b1528932 31 May 2010, 13:20
what should i do in those functions?
i use DriverEntry only to setup dispatch, unload, and AddDevice.
Should i do anything else?
What about unload routine?
should i do any cleanup there, or just depend on PnP?

if i depend on pnp, i have no guarantee that PnP dispatch function will be called before system unload driver, by NtUnloadDriver for example. And my driver would leak resources.

so should my unload routine do any sort of cleanup, or not?

and how should i handle cancelation? i understand irp queue and i know how to manage it manually (setting context flag 'IsCalceled' and checking if irp is already communicationg with hardware/check for this flag when removing it from queue). Ive found tons of information about this, and i dont understand a bit from it. Its just soo complicated that i give up.
What is IRP->Cancel used for? When is IRP->CancelRoutine called?
what should i do? how cancel safe queue apply to that?

this driver stuff reallyis complicated more that it should be.
Post 31 May 2010, 13:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.