次の方法で共有


MiniportShutdownEx (Compact 2013)

3/26/2014

NDIS calls a miniport driver's MiniportShutdownEx function when the system is shut down.

Syntax

VOID MiniportShutdownEx(
    NDIS_HANDLE  MiniportAdapterContext,
    NDIS_SHUTDOWN_ACTION  ShutdownAction
);

Parameters

  • MiniportAdapterContext
    [in] A handle to a context area that the miniport driver allocated in its MiniportInitializeEx function. The driver uses this context area to maintain state information for a miniport adapter.
  • ShutdownAction
    [in] The reason why NDIS called the shutdown function. The following values are valid:

    • NdisShutdownPowerOff
      Indicates that NDIS called MiniportShutdownEx because the system is powering down.
    • NdisShutdownBugCheck
      Indicates that NDIS called MiniportShutdownEx because of a system error.

Return Value

None.

Remarks

A driver specifies the MiniportShutdownEx entry point when it calls the NdisMRegisterMiniportDriver function.

MiniportShutdownEx restores the miniport adapter to a known initial state (the state before NDIS called the miniport driver’s MiniportInitializeEx function for the miniport adapter). This makes sure that the miniport adapter is in a known state and ready to be reinitialized when the device is restarted after a system shutdown occurs for any reason, including an unrecoverable system error.

MiniportShutdownEx can read or write to I/O ports, memory-mapped device I/O space, or bus-specific configuration space by calling the NdisMGetBusData or NdisMSetBusData function to disable a DMA engine, disable interrupts, or reset the hardware to a known state so that the hardware can be restarted safely.

If NDIS calls MiniportShutdownEx because of an unrecoverable error, the ShutdownAction parameter is set to NdisShutdownBugCheck and MiniportShutdownEx is running at a high IRQL. In this case, the miniport driver must not call any NdisXxx functions except the functions that can be called at any IRQL.

If NDIS calls MiniportShutdownEx because of a user-initiated shutdown, MiniportShutdownEx runs at IRQL = PASSIVE_LEVEL and the miniport driver can call other NdisXxx functions.

See Also

Reference

NDIS Miniport Driver Functions
MiniportInitializeEx
NdisMGetBusData
NdisMSetBusData
NdisMRegisterMiniportDriver