NdisMWriteLogData

NDIS_STATUS
   NdisMWriteLogData(
       IN NDIS_HANDLE LogHandle,
       IN PVOID LogBuffer,
       IN UINT LogBufferSize
       );

NdisMWriteLogData transfers driver-supplied information into the log file for consumption and display by a driver-dedicated Win32 application.

Parameters

LogHandle

Specifies the handle returned by NdisMCreateLog.

LogBuffer

Points to a driver-allocated buffer containing the information to be written.

LogBufferSize

Specifies how many bytes of data to copy into the log file.

Return Value

NdisMWriteLogData can return one of the following:

NDIS_STATUS_SUCCESS

The driver-supplied data at LogBuffer has been copied into the log file.

NDIS_STATUS_FAILURE

The given LogBufferSize is too large, that is, larger than the log file itself.

Comments

If the driver-dedicated application has an outstanding request for log file data, NdisMWriteLogData satisfies that request as soon as it has copied the driver-supplied information into the log file.

The miniport can supply a LogBuffer pointer to a location on the kernel stack if it is currently running at IRQL DISPATCH_LEVEL. Otherwise, LogBuffer must access a buffer that the driver allocated from nonpaged pool.

The driver must release any spin lock it is holding before calling NdisMWriteLogData.

An NDIS intermediate driver cannot call NdisMWriteLogData from any of its ProtocolXxx functions. Such a driver must call NdisIMSwitchToMiniport and make this call from a miniport context. If NdisIMSwitchToMiniport returns FALSE, the driver must call NdisIMQueueMiniportCallback so that its driver-supplied MiniportCallback function can call NdisMWriteLogData.

Callers of NdisMWriteLogData can be running at IRQL <= DISPATCH_LEVEL.

See Also

NdisAllocateMemory, NdisIMQueueMiniportCallback, NdisIMSwitchToMiniport, NdisMCloseLog, NdisMCreateLog, NdisMFlushLog, NdisReleaseSpinLock