StorPortSynchronizeAccess routine

The StorPortSynchronizeAccess routine provides synchronized access to a miniport driver's device extension.


STORPORT_API BOOLEAN StorPortSynchronizeAccess(
  _In_     PVOID                     HwDeviceExtension,
  _In_     PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
  _In_opt_ PVOID                     Context


HwDeviceExtension [in]

A pointer to the hardware device extension. This is a per HBA storage area that the port driver allocates and initializes on behalf of the miniport driver. Miniport drivers usually store HBA-specific information in this extension, such as the state of the HBA and the mapped access ranges for the HBA. This area is available to the miniport driver immediately after the miniport driver calls StorPortInitialize. The port driver frees this memory when it removes the device.

SynchronizedAccessRoutine [in]

Pointer to a caller-supplied routine whose execution is to be synchronized with the execution of the ISR associated with the interrupt objects. For a prototype of this routine, see the Remarks section later in this topic.

Context [in, optional]

Pointer to a context area to be passed to the caller-supplied callback routine when it is called.

Return value

The return value from SynchronizedAccessRoutine.


Miniport drivers that operate in full-duplex mode, and that access information that is shared between their HwStorStartIo routine and interrupt-service routine, must use this routine to access the shared data in a synchronized manner.

The miniport driver passes a callback routine to StorPortSynchronizeAccess, and StorPortSynchronizeAccess calls it after guaranteeing exclusive access to sensitive data structures. The miniport driver's callback routine must conform to the following prototype:

  IN PVOID HwDeviceExtension,
 IN PVOID Context

where HwDeviceExtension is a pointer to the hardware device extension, and Context is just a pointer to the same context information that the caller supplied when calling StorPortSynchronizeAccess.

For more information, see Synchronized Access within Unsynchronized Miniport Driver Routines.

For more information about synchronization routines, see KeSynchronizeExecution.


Target platform



Storport.h (include Storport.h)



See also




Send comments about this topic to Microsoft