Skip to content

Commit

Permalink
Updating old broken MSDNlinks for DRIVER_DISPATCH callback variations
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmacmichael committed Dec 7, 2018
1 parent d9548a5 commit 1ecb45b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion wdk-ddi-src/content/_kernel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Here are the required and optional routines that you must implement in your driv

- [DriverEntry](../wdm/nc-wdm-driver_initialize.md)
- [AddDevice](https://msdn.microsoft.com/library/windows/hardware/ff540521)
- [DispatchXxx (routines beginning with "Dispatch" such as DispatchCreate)](https://msdn.microsoft.com/library/windows/hardware/ff543233)
- [DispatchXxx (routines beginning with "Dispatch" such as DispatchCreate)](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch)
- [DriverUnload](https://msdn.microsoft.com/library/windows/hardware/ff564886)

The other routines are optional, but you may need to implement them depending on your driver type and the location of your driver in the device stack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The <i>EvtSpbTargetDisconnect</i> function is called synchronously from the cont

If the SPB controller driver has allocated I/O requests and sent them to the next-lower driver in the I/O-request chain for the target device, the <i>EvtSpbTargetDisconnect</i> function should cancel these requests before it returns.

A client driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff543233">DispatchCleanup</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff559951">CreateProcessNotifyEx</a> callback routines can be called at any time after the <i>EvtSpbTargetDisconnect</i> callback returns. When the client driver's process exits, its <i>CreateProcessNotifyEx</i> routine is called just before the last thread to exit the process is destroyed.
A client driver's <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchCleanup</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff559951">CreateProcessNotifyEx</a> callback routines can be called at any time after the <i>EvtSpbTargetDisconnect</i> callback returns. When the client driver's process exits, its <i>CreateProcessNotifyEx</i> routine is called just before the last thread to exit the process is destroyed.

To register an <i>EvtSpbTargetDisconnect</i> callback function, call the <a href="https://msdn.microsoft.com/library/windows/hardware/hh450919">SpbDeviceInitialize</a> method.

Expand Down
4 changes: 2 additions & 2 deletions wdk-ddi-src/content/wdm/nc-wdm-driver_dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A driver's <i>DispatchCreate</i> routine should be named <i>Xxx</i>DispatchCreat
<a href="https://msdn.microsoft.com/library/windows/hardware/ff548630">IRP_MJ_CREATE</a> or <a href="https://msdn.microsoft.com/library/windows/hardware/ff550720">IRP_MJ_CLOSE</a>
</td>
<td>
A driver can provide a single <i>DispatchCreateClose</i> routine instead of separate <a href="https://msdn.microsoft.com/library/windows/hardware/ff543266">DispatchCreate</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff543255">DispatchClose</a> routines.
A driver can provide a single <i>DispatchCreateClose</i> routine instead of separate <a href="https://msdn.microsoft.com/library/windows/hardware/ff543266">DispatchCreate</a> and <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchClose</a> routines.

A driver's <i>DispatchCreateClose</i> routine should be named <b><i>Xxx</i>DispatchCreateClose</b>, where <i>Xxx</i> is a driver-specific prefix. The driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff552644">DriverEntry</a> routine must store the <i>DispatchCreateClose</i> routine's address in <i>DriverObject</i>-&gt;<b>MajorFunction</b>[IRP_MJ_CREATE] and in <i>DriverObject</i>-&gt;<b>MajorFunction</b>[IRP_MJ_CLOSE].

Expand Down Expand Up @@ -197,7 +197,7 @@ A driver's <i>DispatchRead</i> routine should be named <b><i>Xxx</i>DispatchRead
<a href="https://msdn.microsoft.com/library/windows/hardware/ff549327">IRP_MJ_READ</a> or <a href="https://msdn.microsoft.com/library/windows/hardware/ff550819">IRP_MJ_WRITE</a>
</td>
<td>
A driver can provide a single <i>DispatchReadWrite</i> routine instead of separate <a href="https://msdn.microsoft.com/library/windows/hardware/ff543376">DispatchRead</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff544034">DispatchWrite</a> routines.
A driver can provide a single <i>DispatchReadWrite</i> routine instead of separate <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchRead</a> and <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchWrite</a> routines.

A driver's <i>DispatchReadWrite</i> routine should be named <b><i>Xxx</i>DispatchReadWrite</b>, where <i>Xxx</i> is a driver-specific prefix. The driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff552644">DriverEntry</a> routine must store the <i>DispatchReadWrite</i> routine's address in <i>DriverObject</i>-&gt;<b>MajorFunction</b>[<b>IRP_MJ_READ</b>] and in <i>DriverObject</i>-&gt;<b>MajorFunction</b>[<b>IRP_MJ_WRITE</b>].

Expand Down
2 changes: 1 addition & 1 deletion wdk-ddi-src/content/wdm/nf-wdm-ioattachdevice.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Note that for file system drivers and drivers in the storage stack, <b>IoAttachD
This routine sets the <b>AlignmentRequirement</b> in <i>SourceDevice</i> to the value in the next-lower device object and sets the <b>StackSize</b> to the value in the next-lower object plus one.

<div class="alert"><b>Warning</b>  <i>AttachedDevice</i>
must point to a global memory location, such as the driver's device extension. <b>IoAttachDevice</b> opens the file object for the target device, updates <i>AttachedDevice</i>, performs the attach, and then closes the file object. Thus, the source device receives the <a href="https://msdn.microsoft.com/library/windows/hardware/ff548608">IRP_MJ_CLEANUP</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff550720">IRP_MJ_CLOSE</a> requests for the file object before <b>IoAttachDevice</b> returns. The driver must forward these requests to the target device, and <i>AttachedDevice</i> must be a memory location accessible to the driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff543233">DispatchCleanup</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff543255">DispatchClose</a> routines.</div>
must point to a global memory location, such as the driver's device extension. <b>IoAttachDevice</b> opens the file object for the target device, updates <i>AttachedDevice</i>, performs the attach, and then closes the file object. Thus, the source device receives the <a href="https://msdn.microsoft.com/library/windows/hardware/ff548608">IRP_MJ_CLEANUP</a> and <a href="https://msdn.microsoft.com/library/windows/hardware/ff550720">IRP_MJ_CLOSE</a> requests for the file object before <b>IoAttachDevice</b> returns. The driver must forward these requests to the target device, and <i>AttachedDevice</i> must be a memory location accessible to the driver's <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchCleanup</a> and <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchClose</a> routines.</div>
<div> </div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The <b>IoRegisterLastChanceShutdownNotification</b> routine registers a driver t

### -param DeviceObject [in]

Pointer to the device object of the device for which the driver requests shutdown notification. The system passes this pointer to the driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a> routine.
Pointer to the device object of the device for which the driver requests shutdown notification. The system passes this pointer to the driver's <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a> routine.


## -returns
Expand All @@ -73,7 +73,7 @@ Pointer to the device object of the device for which the driver requests shutdow



The <b>IoRegisterLastChanceShutdownNotification</b> routine registers the driver to receive an <a href="https://msdn.microsoft.com/library/windows/hardware/ff549423">IRP_MJ_SHUTDOWN</a> IRP for the specified device when the system shuts down. The driver receives one such IRP for each device it registers to receive notification for. Drivers handle <b>IRP_MJ_SHUTDOWN</b> IRPs within their <a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a> routines.
The <b>IoRegisterLastChanceShutdownNotification</b> routine registers the driver to receive an <a href="https://msdn.microsoft.com/library/windows/hardware/ff549423">IRP_MJ_SHUTDOWN</a> IRP for the specified device when the system shuts down. The driver receives one such IRP for each device it registers to receive notification for. Drivers handle <b>IRP_MJ_SHUTDOWN</b> IRPs within their <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a> routines.

For any device that is registered with this routine, the system sends the <b>IRP_MJ_SHUTDOWN</b> IRP after all file systems are flushed. Only one driver in a device stack should register to receive shutdown notification, by calling either <a href="https://msdn.microsoft.com/library/windows/hardware/ff549541">IoRegisterShutdownNotification</a> or <b>IoRegisterLastChanceShutdownNotification</b>.

Expand Down Expand Up @@ -107,7 +107,7 @@ The registered <i>DispatchShutdown</i> routine is called before the power manage



<a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a>
<a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a>



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The <b>IoRegisterShutdownNotification</b> routine registers the driver to receiv

### -param DeviceObject [in]

Pointer to the device object of the device for which the driver requests shutdown notification. The system passes this pointer to the driver's <a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a> routine.
Pointer to the device object of the device for which the driver requests shutdown notification. The system passes this pointer to the driver's <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a> routine.


## -returns
Expand All @@ -73,7 +73,7 @@ Pointer to the device object of the device for which the driver requests shutdow



The <b>IoRegisterShutdownNotification</b> routine registers the driver to receive an <a href="https://msdn.microsoft.com/library/windows/hardware/ff549423">IRP_MJ_SHUTDOWN</a> IRP for the specified device when the system shuts down. The driver receives one such IRP for each device it registers to receive notification for. Drivers handle <b>IRP_MJ_SHUTDOWN</b> IRPs within their <a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a> routines.
The <b>IoRegisterShutdownNotification</b> routine registers the driver to receive an <a href="https://msdn.microsoft.com/library/windows/hardware/ff549423">IRP_MJ_SHUTDOWN</a> IRP for the specified device when the system shuts down. The driver receives one such IRP for each device it registers to receive notification for. Drivers handle <b>IRP_MJ_SHUTDOWN</b> IRPs within their <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a> routines.

If the driver ceases to require shutdown notification for the device, use <a href="https://msdn.microsoft.com/library/windows/hardware/ff550409">IoUnregisterShutdownNotification</a> to remove the driver from the shutdown notification queue.

Expand All @@ -95,7 +95,7 @@ A PnP driver might register a shutdown routine to perform certain tasks before s



<a href="https://msdn.microsoft.com/library/windows/hardware/ff543405">DispatchShutdown</a>
<a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchShutdown</a>



Expand Down
4 changes: 2 additions & 2 deletions wdk-ddi-src/content/wdm/nf-wdm-ioreleaseremovelockandwait.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The I/O system only uses this parameter on checked builds.

A driver typically calls this routine in its dispatch code for an <a href="https://msdn.microsoft.com/library/windows/hardware/ff551738">IRP_MN_REMOVE_DEVICE</a> request. To allow queued I/O requests to complete, each driver should call <b>IoReleaseRemoveLockAndWait</b> <i>after</i> it passes the remove IRP to the next-lower driver, and <i>before</i> it releases memory, calls <a href="https://msdn.microsoft.com/library/windows/hardware/ff549087">IoDetachDevice</a>, or calls <a href="https://msdn.microsoft.com/library/windows/hardware/ff549083">IoDeleteDevice</a>. The <b>IoReleaseRemoveLockAndWait</b> routine waits for the bus driver to cancel any IRPs that might be outstanding (for example, an <a href="https://msdn.microsoft.com/library/windows/hardware/ff551766">IRP_MN_WAIT_WAKE</a> IRP).

A driver must acquire the remove lock before calling <b>IoReleaseRemoveLockAndWait</b>. Typically, a driver calls <a href="https://msdn.microsoft.com/library/windows/hardware/ff548204">IoAcquireRemoveLock</a> early in its <a href="https://msdn.microsoft.com/library/windows/hardware/ff543341">DispatchPnp</a> routine, before the switch statement. As a result, the lock is acquired for each PnP operation, including the acquisition that is required before calling <b>IoReleaseRemoveLockAndWait</b> in the code that handles <b>IRP_MN_REMOVE_DEVICE</b>.
A driver must acquire the remove lock before calling <b>IoReleaseRemoveLockAndWait</b>. Typically, a driver calls <a href="https://msdn.microsoft.com/library/windows/hardware/ff548204">IoAcquireRemoveLock</a> early in its <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchPnp</a> routine, before the switch statement. As a result, the lock is acquired for each PnP operation, including the acquisition that is required before calling <b>IoReleaseRemoveLockAndWait</b> in the code that handles <b>IRP_MN_REMOVE_DEVICE</b>.

To release a lock from code other than the <b>IRP_MN_REMOVE_DEVICE</b> dispatch code, use <a href="https://msdn.microsoft.com/library/windows/hardware/ff549560">IoReleaseRemoveLock</a>.

Expand All @@ -95,7 +95,7 @@ For more information, see <a href="https://msdn.microsoft.com/library/windows/ha



<a href="https://msdn.microsoft.com/library/windows/hardware/ff543341">DispatchPnp</a>
<a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/content/wdm/nc-wdm-driver_dispatch">DispatchPnp</a>



Expand Down

0 comments on commit 1ecb45b

Please sign in to comment.