Re: Driver unload

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




What is RxDriverEntry()? Are you linking against a library?

On Jan 18, 3:16 pm, Josef <Jo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi.
My DriverEntry function does create a symlink though it does not call
IoCreateDevice directly, only through RxDriverEntry. Does that have any
effect on the unload function?
P.S. I set the unload function pointer correctly.

"Vetzak" wrote:
On Jan 17, 5:49 pm, Josef <Jo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,
I did read a great deal of it,
and still I can't find an answer why my unload function does not get called.
When I load the driver, the device object has 3 references.
How and why can I dereference them?
Asaf.

"Vetzak" wrote:
On 17 jan, 13:08, Josef <Jo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,
How do I create a device object? Isn't it created by the RDBSS when I call
RxDriverEntry?
Thank you!

"Vetzak" wrote:
On Jan 13, 5:51 pm, Josef <Jo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

I'm writing a network mini-redirector.
I've managed to load and start the driver but I cannot unload it.
When I call ControlService with SERVICE_CONTROL_STOP the call returns
success, but the unload function I wrote in the driver isn't called. I
initialized the pointer to the unload function in DriverEntry by setting the
DriverUnload member of the driver object.

Thank you!

This stuff is highly undocumented. I had the same problem. I found out
that the kernel-mode service should create at least one device object
and a user-mode symlink to that device object; then the service can be
stopped and unloaded.

You may consider reading the WDM documentation first. All of it.

Uh? Let's start from scratch.

Remind that a kernel-mode service is an old-style NT 4 driver. There's
no PnP, no AddDevice or anything. The DriverEntry() sets up resources
(like device objects etc.), DriverUnload() cleans up.

When the driver is loaded in memory, there's nothing but a driver
object. The system calls the DriverEntry() function and passes a
pointer to the driver object. The DriverEntry() function writes the
Unload() address in the driver object, and creates one or more device
objects and symlinks (see: IoCreateDevice(), IoCreateSymbolicLink()).

.



Relevant Pages

  • Re: [PATCH] Intel Management Engine Interface
    ... new file mode 100644 ... * Number of queue lists used by this driver ... * @dev: Device object for our driver ...
    (Linux-Kernel)
  • Re: Driver unload
    ... and still I can't find an answer why my unload function does not get called. ... the device object has 3 references. ... I've managed to load and start the driver but I cannot unload it. ...
    (microsoft.public.development.device.drivers)
  • Bug Check 0x7B: INACCESSIBLE_BOOT_DEVICE with /nolowmem.
    ... We are planning to test our DMA based driver under 64-Bit environment. ... on x86 systems the boot.ini file must be edited or on ARC ... is the actual length of the Unicode string, ... If the argument is a pointer to a device object, then the format of the first ...
    (microsoft.public.development.device.drivers)
  • Re: Infamous BSOD Stop 7B Error
    ... SATA drives should work with XPe. ... Debugger and got some more info. ... Driver Library which requires the user to do a custom install. ... If the argument is a pointer to a device object, ...
    (microsoft.public.windowsxp.embedded)
  • Infamous BSOD Stop 7B Error
    ... relentless to boot from an AHCI enabled drive. ... Debugger and got some more info. ... Driver Library which requires the user to do a custom install. ... If the argument is a pointer to a device object, ...
    (microsoft.public.windowsxp.embedded)