NDIS-Supplied Support Functions (NDIS 5.1)
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.
NdisXxx functions are divided into classes. The following topics describe these classes of functions and how they support miniport driver operations:
Memory Functions
Queuing Functions
System Information Functions
Logging Functions
String Functions
File Functions
Address Functions
Variable Functions
Register Functions
WorkItem Functions
Memory Functions (NDIS 5.1)
- NdisAllocateMemoryWithTag
Allocates resident (nonpaged) system-space memory. The caller supplies a tag that can be used to track the driver's memory allocation.
- NdisEqualMemory
Compares a specified number of characters in one block of memory with the same number of characters in a second block of memory.
- NdisFillMemory
Fills a caller-supplied buffer with the given character.
- NdisFreeMemory
Releases a block of memory previously allocated with NdisAllocateMemoryWithTag.
- NdisMoveMemory
Copies a specified number of bytes from one caller-supplied location to another.
- NdisZeroMemory
Fills a block of memory with zeros.
- NdisInitializeNPagedLookasideList
Initializes a lookaside list. After a successful initialization, nonpaged fixed-size blocks can be allocated from, and freed to, the lookaside list.
- NdisAllocateFromNPagedLookasideList
Removes the first entry from the given lookaside list head. If the lookaside list is empty, an entry is allocated from nonpaged pool.
- NdisDeleteNPagedLookasideList
Removes a nonpaged lookaside list from the system.
- NdisFreeToNPagedLookasideList
Returns an entry to the given lookaside list.
Queuing Functions (NDIS 5.1)
- NdisInitializeListHead
Initializes the head of a sequenced, doubly linked list.
- NdisInterlockedInsertHeadList
Inserts an entry, usually a packet, at the head of a doubly linked list so that access to the list is synchronized in a multiprocessor-safe way.
- NdisInterlockedInsertTailList
Inserts an entry, usually a packet, at the tail of a doubly linked list so that access to the list is synchronized in a multiprocessor-safe way.
- NdisInterlockedRemoveHeadList
Removes an entry, usually a packet, from the head of a doubly linked list so that access to the list is synchronized in a multiprocessor-safe way.
- NdisInterlockedPopEntrySList
Removes the first entry from a sequenced, singly linked list.
- NdisInterlockedPushEntrySList
Inserts an entry at the head of a sequenced, singly linked list.
- NdisQueryDepthSList
Returns the current number of entries in a given sequenced, singly linked list.
System Information Functions (NDIS 5.1)
- NdisSystemProcessorCount
Determines whether its caller is running on a uniprocessor or multiprocessor machine. An NDIS driver might call this function during initialization before allocating resources.
- NdisGetCurrentProcessorCounts
Returns counts for the current processor that a driver can use to determine CPU utilization for a particular time interval.
- NdisGetCurrentProcessorCpuUsage
Returns a value representing how busy the current processor is as a percentage.
- NdisGetCurrentSystemTime
Returns the current system time, suitable for setting timestamps.
- NdisGetSystemUpTime
Returns the number of milliseconds that have elapsed since the system was booted.
Logging Functions (NDIS 5.1)
- NdisMCreateLog
Allocates and opens a log file in which a miniport driver can write data to be displayed by a driver-dedicated Win32 application.
- NdisMWriteLogData
Transfers driver-supplied information into the log file for consumption and display by a driver-dedicated Win32 application.
- NdisMFlushLog
Clears the log file.
- NdisMCloseLog
Releases resources that were used for logging.
- NdisWriteErrorLogEntry
Writes an entry to the system I/O error log file.
String Functions (NDIS 5.1)
- NdisAnsiStringToUnicodeString
Converts a given counted ANSI string into a counted Unicode string.
- NdisEqualString
Compares two strings, in the OS-default character set, to determine whether they are equal.
- NdisEqualUnicodeString
Compares two Unicode strings and returns a value indicating whether they are equal.
- NdisFreeString
Releases storage that was allocated for a buffered string.
- NdisInitAnsiString
Initializes a counted ANSI string.
- NdisInitializeString
Allocates storage for and initializes a counted string in the system-default character set.
- NdisInitUnicodeString
Initializes a counted Unicode string.
- NdisPrintString
Displays a given string on the debugging window.
- NdisUnicodeStringToAnsiString
Converts a given counted Unicode string into a counted ANSI string.
- NdisUpcaseUnicodeString
Converts a copy of a given Unicode string to upper case and returns the converted string.
File Functions (NDIS 5.1)
- NdisOpenFile
Returns a handle for an opened file.
- NdisMapFile
Maps an already open file into a caller-accessible buffer if the file is unmapped.
- NdisUnmapFile
Releases a virtual address mapping of a file that was set up with NdisMapFile.
- NdisCloseFile
Releases a handle returned by NdisOpenFile and frees the memory allocated to hold the file contents when it was opened.
Address Functions (NDIS 5.1)
- NdisGetPhysicalAddressHigh
Returns the high-order part of a given physical address.
- NdisGetPhysicalAddressLow
Returns the low-order part of a given physical address.
- NdisSetPhysicalAddressHigh
Sets the high-order part of a given physical address to a given value.
- NdisSetPhysicalAddressLow
Sets the low-order part of a given physical address to a given value.
- NDIS_PHYSICAL_ADDRESS_CONST
Initializes a static constant of type physical address.
Variable Functions (NDIS 5.1)
- NdisRetrieveUlong
Retrieves a ULONG value from the source address, avoiding alignment faults.
- NdisStoreUlong
Stores a ULONG value at a particular address, avoiding alignment faults.
- NdisInterlockedAddUlong
Adds an unsigned long value to a given unsigned integer as an atomic operation, using a caller-supplied spin lock to synchronize access to the integer variable.
- NdisInterlockedDecrement
Decrements a caller-supplied variable of type LONG as an atomic operation.
- NdisInterlockedIncrement
Increments a caller-supplied variable as an atomic operation.
Register Functions (NDIS 5.1)
- NdisReadRegisterUchar
Reads a UCHAR from a memory-mapped device register.
- NdisReadRegisterUlong
Reads a ULONG from a memory-mapped device register.
- NdisReadRegisterUshort
Reads a USHORT from a memory-mapped device register.
- NdisWriteRegisterUchar
Writes a UCHAR to a memory-mapped device register.
- NdisWriteRegisterUlong
Writes a ULONG to a memory-mapped device register.
- NdisWriteRegisterUshort
Writes a USHORT to a memory-mapped device register.
WorkItem Functions (NDIS 5.1)
- NdisInitializeWorkItem
Initializes a work-queue item with a caller-supplied context and callback routine to be queued for execution when a system worker thread is given control.
- NdisScheduleWorkItem
Inserts a given work item into a queue. A system worker thread removes the item and gives control to the callback function that the driver previously supplied to NdisInitializeWorkItem.