Re: NDIS IM & NdisMDeregisterDevice



2 Thomas F. Divine:


"""Thomas F. Divine писал(а):
"""

You can create an asynchronous "notification" IOCTL that the application
calls. The driver would pend the IRP for this IOCTL indefinitely. Basically
until some event occurs that requires the driver to notify the app. When
such an event occurs the driver would complete the IRP providing the detains


ok, i can do this.

1. My app open handle on my device ( I get them by calling
NdisMRegisterDevice at DriverEntry )
2. My app send special IRP and handler return STATUS_PENDING. So my app
can wait on it to find out when it should close handle.

First question: Driver may be uninstalled between 1 and 2. And I get
the same? Suppose it was not uninstalled.

3. User decide to uninstall my driver ( at long last!!! )
4. My driver get serial call to MiniportHalt routine. At the last call
it do some final action: complete special IRP ( 2 ) and call
NdisMDeregsiterDevice.
5. DriverUnload routine is called???

Second question: I think after completing special IRP i should wait for
all handel is closed in fact ( I can count IRP_MJ_CLOSE ). After that I
can call NdisMDeregsiterDevice and suppose DriverUnload will be called.
But is it safty waiting in system worker thread for long time? IMHO it
can block all network communication if app is in deadlock state for
example.

PS: One thing I cannot understand: why DriverUnload cannot be called
without NdisMDeregsiterDevice? It is the root of all my problems :).

.



Relevant Pages

  • Re: How to send URB and IRP to user mode application?
    ... same query since the 2 IOCTLs do not necessary need to be pended at the same ... sure that only one of them may complete IRP. ... we cannot even restart our app. ... When your driver ...
    (microsoft.public.development.device.drivers)
  • Re: How to send URB and IRP to user mode application?
    ... When your driver ... receives IOCTL1, it signals event1, marks IRP as pending, and returns ... App gets the ... raised, you will never enter the polling loop, in the first place). ...
    (microsoft.public.development.device.drivers)
  • Re: A Driver Unload Question
    ... Yes, the IRP gets cancelled by the driver, the app resumes and closes the ... >> device object that the user mode app targets. ...
    (microsoft.public.development.device.drivers)
  • Re: [USB] Why MJ_READ polling influences Interrupt pipe transfer
    ... the driver does not care. ... buffer, put the irp into an IoCSQ. ... block in the app, not the driver. ...
    (microsoft.public.development.device.drivers)
  • Re: drive present detection?
    ... the free space of all online drives. ... If the underlying device driver determines that the media has not ... changed, the driver should complete the IRP, returning the IoStatus ...
    (microsoft.public.win32.programmer.kernel)

Loading