NdisMCreateLog (NDIS 5.1) 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.
NdisMCreateLog allocates and opens a log file in which a miniport driver can write data to be displayed by a driver-dedicated Win32 application.
Syntax
NDIS_STATUS NdisMCreateLog(
_In_ NDIS_HANDLE MiniportAdapterHandle,
_In_ UINT Size,
_Out_ PNDIS_HANDLE LogHandle
);
Parameters
MiniportAdapterHandle [in]
Specifies the handle input to MiniportInitialize.Size [in]
Specifies how many bytes to allocate for the log file. NDIS creates a temporary file that is not stored on disk.LogHandle [out]
Pointer to a caller-supplied variable in which this function returns a handle to the log file. This handle is a required parameter to the Ndis..Log functions that the miniport driver calls subsequently.
Return value
NdisMCreateLog can return one of the following:
Return code | Description |
---|---|
NDIS_STATUS_SUCCESS | The miniport driver can use the handle returned at LogHandle to write data to the NDIS-allocated log file. |
NDIS_STATUS_RESOURCES | A log file of the specified size could not be allocated. |
NDIS_STATUS_FAILURE | The driver already called NdisMCreateLog successfully. |
Remarks
A miniport driver can call the NdisM..Log functions to provide any information the driver writer chooses. Whatever the miniport driver 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 driver has written to the log file. For example, an under-development miniport driver 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 driver 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.
Requirements
Target platform |
Universal |
Version |
See NdisMCreateLog. |
Header |
Ndis.h (include Ndis.h) |
Library |
Ndis.lib |
IRQL |
PASSIVE_LEVEL |
See also