NDIS_STATUS
NdisMCreateLog(
IN NDIS_HANDLE MiniportAdapterHandle,
IN UINT Size,
OUT PNDIS_HANDLE LogHandle
);
NdisMCreateLog allocates and opens a log file in which a NIC miniport can write data to be displayed by a driver-dedicated Win32 application.
NdisMCreateLog can return one of the following:
A NIC miniport can call the NdisM..Log functions to provide any information the driver writer chooses. Whatever the miniport logs can be displayed by a driver-dedicated Win32 application. Such an application calls the Win32 function DeviceIoControl with IOCTL_NDIS_GET_LOG_DATA periodically to retrieve whatever the miniport has written to the log file. For example, an under-development miniport might write test data to be displayed by its corresponding application.
If NdisMCreateLog returns NDIS_STATUS_RESOURCES, the driver can adjust the original Size down and try calling this function again. However, a miniport cannot call NdisMCreateLog to create more than one log file after a call succeeds.
Whatever size of log file is allocated, subsequent calls to NdisMWriteLogData store data in this file, which is treated as a circular buffer. That is, a sequence of calls to NdisMWriteLogData eventually overwrites the data originally written to the log file.
Callers of NdisMCreateLog run at IRQL PASSIVE_LEVEL.
MiniportInitialize, NdisMCloseLog, NdisMFlushLog, NdisMWriteLogData