Re: WdfControlDeviceInitSetShutdownNotification



why is shutdown a special case? why wouuldn't you just do it on device unload as well?

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"hammerli22" <hammerli22@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:C046FCBA-5F18-4567-8D1A-E5A0112CC559@xxxxxxxxxxxxxxxx
Hi Eliyas,

I tried using EvtDeviceD0Exit but my driver gets called when it is unloaded,
like when I am updating the driver. Is there no other to way get called back
only when
the operating system is shuting down only or is there a way to tell if the
system
is going down while i am running in EvtDeviceD0Exit so that I can ttell the
difference between the os really going down versus just being just unloaded.

thanks
Mel


"Eliyas Yakub [MSFT]" wrote:

You cannot use the DeviceInit passed to the AddDevice. This function is
meant for non plug-n-play devices. If you are writing a legacy (NT4.0)
driver then you allocate a control-deviceinit structure and use that to
register shutdown notification. For pnp-device, you don't need to use this
function. You can use EvtDeviceD0Exit - device power state
WdfPowerDeviceD3Final - to get the notification.

-Eliyas

"hammerli22" <hammerli22@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D6667A0D-37C8-47F4-B235-C38678047EE8@xxxxxxxxxxxxxxxx
> Hello,
>
> I'm trying to register my driver to recieve shut down notification when
> the
> user
> shuts the system down. I found this API for my WDF driver
>
> WdfControlDeviceInitSetShutdownNotification
>
> The question I have is do i need to create a new Device_Init structure
> using
> WdfControlDeviceInitAllocate. or can i just use the DeviceInit pass to > me
> from DeviceAdd ?
>
> Thanks
> Mel
>

.



Relevant Pages

  • Re: Dynamic linking to ksecdd on Windows Server 2008
    ... if you staticly link against ksecdd, it will not unload as long as our driver is loaded. ... Please do not send e-mail directly to this alias. ... How do I make sure ksecdd won't be unloaded in the middle? ... The driver imports a function from ksecdd.sys. ...
    (microsoft.public.development.device.drivers)
  • Re: DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS
    ... Please do not send e-mail directly to this alias. ... This driver failed to cancel lookaside lists, DPCs, worker threads, or other ... such items before unload. ... my driver doesn't contain DPCs and worker threads. ...
    (microsoft.public.development.device.drivers)
  • Re: Memory Leak Filter Drivers?
    ... enable driver verifier on your driver and then have it unload. ... Please do not send e-mail directly to this alias. ... newsgroup purposes only. ...
    (microsoft.public.development.device.drivers)
  • Re: Keyboard filter driver for the multimedia and power keys on a usb keyboard.
    ... Please do not send e-mail directly to this alias. ... My driver sees calls to DriverEntry followed immediately by ... > get an unload. ... > I even tried using a sample filter driver, a very basic one that just ...
    (microsoft.public.development.device.drivers)
  • Sound, dual soundcards, second attempt (better I hope)
    ... PCI: PCI BIOS revision 2.10 entry at 0xfdb01, ... Journalled Block Device driver loaded ... usb.c: new USB bus registered, ... alias char-major-10-175 agpgart ...
    (comp.os.linux)

Loading