次の方法で共有


MiniportSynchronizeISR callback function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

The MiniportSynchronizeISR function is required if any NIC driver function that runs at an IRQL lower than DIRQL and shares resources with that driver's MiniportISR or MiniportDisableInterrupt function.

Syntax

BOOLEAN MiniportSynchronizeISR(
  _In_ PVOID SynchronizeContext
);

Parameters

  • SynchronizeContext [in]
    Pointer to a context area supplied when the NIC driver's MiniportXxx or internal function called NdisMSynchronizeWithInterrupt. Usually, this input parameter is a pointer to a set of shared resources at an offset within the NIC-specific MiniportAdapterContext area passed to other MiniportXxx functions.

Return value

MiniportSynchronizeISR returns a Boolean value with a driver-determined meaning that is propagated to the caller of NdisMSynchronizeWithInterrupt.

Remarks

If any NIC driver function shares resources, such as device registers, with the driver's MiniportISR or MiniportDisableInterrupt function, the driver function that runs, by default, at less than DIRQL cannot access those resources directly. If it attempted to access such shared resources directly, the lower priority function might be preempted by execution of MiniportISR or MiniportDisableInterrupt, which could change state out from under the lower priority driver function.

To synchronize access to such shared resources with MiniportISR or MiniportDisableInterrupt, lower priority driver functions must call NdisMSynchronizeWithInterrupt to have the driver's MiniportSynchronizeISR function access those shared resources at DIRQL. Calling NdisMSynchronizeWithInterrupt prevents race conditions and deadlocks in such a NIC driver, particularly in SMP machines.

Any lower priority driver functions that share resources among themselves (but not with any function that runs at DIRQL) should use a spin lock to protect those shared resources.

MiniportSynchronizeISR runs at the DIRQL assigned when the driver's MiniportInitialize function called NdisMRegisterInterrupt. Like any driver function that runs at DIRQL, MiniportSynchronizeISR should return control as quickly as possible, and it can call only those NdisXxx functions that are safe to call at any IRQL.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use MiniportSynchronizeInterrupt instead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

See Remarks section

See also

MiniportDisableInterrupt

MiniportInitialize

MiniportISR

NdisAllocateSpinLock

NdisMRegisterInterrupt

NdisMSynchronizeWithInterrupt

NdisRawReadPortBufferUchar

NdisRawReadPortBufferUlong

NdisRawReadPortBufferUshort

NdisRawReadPortUchar

NdisRawReadPortUlong

NdisRawReadPortUshort

NdisRawWritePortBufferUchar

NdisRawWritePortBufferUlong

NdisRawWritePortBufferUshort

NdisRawWritePortUchar

NdisRawWritePortUlong

NdisRawWritePortUshort

NdisReadRegisterUchar

NdisReadRegisterUlong

NdisReadRegisterUshort

NdisWriteRegisterUchar

NdisWriteRegisterUlong

NdisWriteRegisterUshort

 

 

Send comments about this topic to Microsoft