ReactOS 0.4.15-dev-7897-g78dc504
misc.c File Reference
#include "ndissys.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Classes

struct  _NDIS_HANDLE_OBJECT
 

Typedefs

typedef struct _NDIS_HANDLE_OBJECT NDIS_HANDLE_OBJECT
 
typedef struct _NDIS_HANDLE_OBJECTPNDIS_HANDLE_OBJECT
 

Functions

VOID EXPORT NdisInterlockedAddUlong (IN PULONG Addend, IN ULONG Increment, IN PNDIS_SPIN_LOCK SpinLock)
 
VOID EXPORT NdisInterlockedAddLargeInteger (IN PLARGE_INTEGER Addend, IN LARGE_INTEGER Increment, IN PNDIS_SPIN_LOCK SpinLock)
 
LONG EXPORT NdisCompareAnsiString (IN PNDIS_ANSI_STRING String1, IN PNDIS_ANSI_STRING String2, BOOLEAN CaseInSensitive)
 
LONG EXPORT NdisCompareUnicodeString (IN PNDIS_STRING String1, IN PNDIS_STRING String2, IN BOOLEAN CaseInSensitive)
 
PLIST_ENTRY EXPORT NdisInterlockedInsertHeadList (IN PLIST_ENTRY ListHead, IN PLIST_ENTRY ListEntry, IN PNDIS_SPIN_LOCK SpinLock)
 
PLIST_ENTRY EXPORT NdisInterlockedInsertTailList (IN PLIST_ENTRY ListHead, IN PLIST_ENTRY ListEntry, IN PNDIS_SPIN_LOCK SpinLock)
 
PLIST_ENTRY EXPORT NdisInterlockedRemoveHeadList (IN PLIST_ENTRY ListHead, IN PNDIS_SPIN_LOCK SpinLock)
 
FORCEINLINE PNDIS_HANDLE_OBJECT NDIS_HANDLE_TO_POBJECT (NDIS_HANDLE handle)
 
FORCEINLINE NDIS_HANDLE NDIS_POBJECT_TO_HANDLE (PNDIS_HANDLE_OBJECT obj)
 
VOID EXPORT NdisMapFile (OUT PNDIS_STATUS Status, OUT PVOID *MappedBuffer, IN NDIS_HANDLE FileHandle)
 
VOID EXPORT NdisUnmapFile (IN NDIS_HANDLE FileHandle)
 
VOID EXPORT NdisCloseFile (IN NDIS_HANDLE FileHandle)
 
VOID EXPORT NdisOpenFile (OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE FileHandle, OUT PUINT FileLength, IN PNDIS_STRING FileName, IN NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress)
 
CCHAR EXPORT NdisSystemProcessorCount (VOID)
 
VOID EXPORT NdisGetCurrentProcessorCounts (OUT PULONG pIdleCount, OUT PULONG pKernelAndUser, OUT PULONG pIndex)
 
VOID EXPORT NdisGetSystemUpTime (OUT PULONG pSystemUpTime)
 
LONG EXPORT NdisInterlockedDecrement (IN PLONG Addend)
 
LONG EXPORT NdisInterlockedIncrement (IN PLONG Addend)
 
PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPopEntrySList (IN PSLIST_HEADER ListHead, IN PKSPIN_LOCK Lock)
 
PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPushEntrySList (IN PSLIST_HEADER ListHead, IN PSINGLE_LIST_ENTRY ListEntry, IN PKSPIN_LOCK Lock)
 
VOID NTAPI ndisProcWorkItemHandler (PVOID pContext)
 
NDIS_STATUS EXPORT NdisScheduleWorkItem (IN PNDIS_WORK_ITEM pWorkItem)
 
VOID EXPORT NdisGetCurrentProcessorCpuUsage (PULONG pCpuUsage)
 
ULONG EXPORT NdisGetSharedDataAlignment (VOID)
 
UINT EXPORT NdisGetVersion (VOID)
 
UCHAR EXPORT NdisGeneratePartialCancelId (VOID)
 

Variables

LONG CancelId
 
static const WCHAR NDIS_FILE_FOLDER [] = L"\\SystemRoot\\System32\\Drivers\\"
 

Typedef Documentation

◆ NDIS_HANDLE_OBJECT

◆ PNDIS_HANDLE_OBJECT

Function Documentation

◆ NDIS_HANDLE_TO_POBJECT()

FORCEINLINE PNDIS_HANDLE_OBJECT NDIS_HANDLE_TO_POBJECT ( NDIS_HANDLE  handle)

Definition at line 130 of file misc.c.

131{
133}

Referenced by NdisCloseFile().

◆ NDIS_POBJECT_TO_HANDLE()

FORCEINLINE NDIS_HANDLE NDIS_POBJECT_TO_HANDLE ( PNDIS_HANDLE_OBJECT  obj)

Definition at line 137 of file misc.c.

138{
139 return (NDIS_HANDLE)obj;
140}

Referenced by NdisOpenFile().

◆ NdisCloseFile()

VOID EXPORT NdisCloseFile ( IN NDIS_HANDLE  FileHandle)

Definition at line 193 of file misc.c.

195{
196 PNDIS_HANDLE_OBJECT FileHandleObject;
197
199
200 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
201
202 ASSERT ( FileHandle );
203
204 FileHandleObject = NDIS_HANDLE_TO_POBJECT(FileHandle);
205
206 ASSERT ( FileHandleObject->FileHandle );
207
208 if ( FileHandleObject->Mapped )
210
211 ZwClose ( FileHandleObject->FileHandle );
212
213 memset ( FileHandleObject, 0, sizeof(NDIS_HANDLE_OBJECT) );
214
215 ExFreePool ( FileHandleObject );
216}
#define MAX_TRACE
Definition: debug.h:16
#define ASSERT_IRQL(x)
Definition: debug.h:42
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
FORCEINLINE PNDIS_HANDLE_OBJECT NDIS_HANDLE_TO_POBJECT(NDIS_HANDLE handle)
Definition: misc.c:130
VOID EXPORT NdisUnmapFile(IN NDIS_HANDLE FileHandle)
Definition: misc.c:178
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define memset(x, y, z)
Definition: compat.h:39
HANDLE FileHandle
Definition: misc.c:122
BOOLEAN Mapped
Definition: misc.c:123

◆ NdisCompareAnsiString()

LONG EXPORT NdisCompareAnsiString ( IN PNDIS_ANSI_STRING  String1,
IN PNDIS_ANSI_STRING  String2,
BOOLEAN  CaseInSensitive 
)

Definition at line 49 of file misc.c.

53{
54 /* This one needs to be verified also. See the
55 * comment in NdisInterlockedAddLargeInteger
56 */
57
59}
_In_ const STRING * String2
Definition: rtlfuncs.h:2357
_In_ const STRING _In_ BOOLEAN CaseInSensitive
Definition: rtlfuncs.h:2390
NTSYSAPI LONG NTAPI RtlCompareString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)

◆ NdisCompareUnicodeString()

LONG EXPORT NdisCompareUnicodeString ( IN PNDIS_STRING  String1,
IN PNDIS_STRING  String2,
IN BOOLEAN  CaseInSensitive 
)

Definition at line 66 of file misc.c.

70{
71 /* This one needs to be verified also. See the
72 * comment in NdisInterlockedAddLargeInteger
73 */
74
76}
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31

◆ NdisGeneratePartialCancelId()

UCHAR EXPORT NdisGeneratePartialCancelId ( VOID  )

Definition at line 526 of file misc.c.

527{
528 UCHAR PartialCancelId;
529
530 PartialCancelId = (UCHAR)InterlockedIncrement(&CancelId);
531
532 NDIS_DbgPrint(MAX_TRACE, ("Cancel ID %u\n", PartialCancelId));
533
534 return PartialCancelId;
535}
#define InterlockedIncrement
Definition: armddk.h:53
LONG CancelId
Definition: main.c:23
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ NdisGetCurrentProcessorCounts()

VOID EXPORT NdisGetCurrentProcessorCounts ( OUT PULONG  pIdleCount,
OUT PULONG  pKernelAndUser,
OUT PULONG  pIndex 
)

Definition at line 336 of file misc.c.

346{
347 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
348
350}
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4565
_Out_ PULONG pKernelAndUser
Definition: ndis.h:4564
VOID NTAPI ExGetCurrentProcessorCounts(PULONG IdleTime, PULONG KernelAndUserTime, PULONG ProcessorNumber)
Definition: sysinfo.c:345
uint32_t * PULONG
Definition: typedefs.h:59

◆ NdisGetCurrentProcessorCpuUsage()

VOID EXPORT NdisGetCurrentProcessorCpuUsage ( PULONG  pCpuUsage)

Definition at line 484 of file misc.c.

491{
492 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
493
495}
VOID NTAPI ExGetCurrentProcessorCpuUsage(PULONG CpuUsage)
Definition: sysinfo.c:324

◆ NdisGetSharedDataAlignment()

ULONG EXPORT NdisGetSharedDataAlignment ( VOID  )

Definition at line 502 of file misc.c.

503{
504 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
505
507}
ULONG NTAPI KeGetRecommendedSharedDataAlignment(VOID)
Definition: cpu.c:675

Referenced by DcInitialize(), and MiniportInitialize().

◆ NdisGetSystemUpTime()

VOID EXPORT NdisGetSystemUpTime ( OUT PULONG  pSystemUpTime)

Definition at line 358 of file misc.c.

359{
361 LARGE_INTEGER TickCount;
362
363 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
364
365 /* Get the increment and current tick count */
367 KeQueryTickCount(&TickCount);
368
369 /* Convert to milliseconds and return */
370 TickCount.QuadPart *= Increment;
371 TickCount.QuadPart /= (10 * 1000);
372 *pSystemUpTime = TickCount.LowPart;
373}
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:46
ULONG NTAPI KeQueryTimeIncrement(VOID)
Definition: clock.c:153
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
uint32_t ULONG
Definition: typedefs.h:59
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106

◆ NdisGetVersion()

UINT EXPORT NdisGetVersion ( VOID  )

Definition at line 514 of file misc.c.

515{
516 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
517
518 return NDIS_VERSION;
519}
#define NDIS_VERSION
Definition: ndissys.h:27

◆ NdisInterlockedAddLargeInteger()

VOID EXPORT NdisInterlockedAddLargeInteger ( IN PLARGE_INTEGER  Addend,
IN LARGE_INTEGER  Increment,
IN PNDIS_SPIN_LOCK  SpinLock 
)

Definition at line 30 of file misc.c.

34{
35 /* This needs to be verified. The documentation
36 * seems to be missing but it is exported by
37 * NDIS 5.1 so I'm implementing it like the other
38 * interlocked routines
39 */
40
42}
IN OUT PLONG Addend
Definition: CrNtStubs.h:25
LARGE_INTEGER NTAPI ExInterlockedAddLargeInteger(IN OUT PLARGE_INTEGER Addend, IN LARGE_INTEGER Increment, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:62
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228

◆ NdisInterlockedAddUlong()

VOID EXPORT NdisInterlockedAddUlong ( IN PULONG  Addend,
IN ULONG  Increment,
IN PNDIS_SPIN_LOCK  SpinLock 
)

Definition at line 17 of file misc.c.

21{
23}
ULONG NTAPI ExInterlockedAddUlong(IN OUT PULONG Addend, IN ULONG Increment, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:88

◆ NdisInterlockedDecrement()

LONG EXPORT NdisInterlockedDecrement ( IN PLONG  Addend)

Definition at line 381 of file misc.c.

389{
390 return InterlockedDecrement ( Addend );
391}
#define InterlockedDecrement
Definition: armddk.h:52

◆ NdisInterlockedIncrement()

LONG EXPORT NdisInterlockedIncrement ( IN PLONG  Addend)

Definition at line 400 of file misc.c.

408{
409 return InterlockedIncrement ( Addend );
410}

◆ NdisInterlockedInsertHeadList()

PLIST_ENTRY EXPORT NdisInterlockedInsertHeadList ( IN PLIST_ENTRY  ListHead,
IN PLIST_ENTRY  ListEntry,
IN PNDIS_SPIN_LOCK  SpinLock 
)

Definition at line 84 of file misc.c.

88{
89 return ExInterlockedInsertHeadList ( ListHead, ListEntry, &SpinLock->SpinLock );
90}
PLIST_ENTRY NTAPI ExInterlockedInsertHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:114

◆ NdisInterlockedInsertTailList()

PLIST_ENTRY EXPORT NdisInterlockedInsertTailList ( IN PLIST_ENTRY  ListHead,
IN PLIST_ENTRY  ListEntry,
IN PNDIS_SPIN_LOCK  SpinLock 
)

Definition at line 98 of file misc.c.

102{
103 return ExInterlockedInsertTailList ( ListHead, ListEntry, &SpinLock->SpinLock );
104}
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140

◆ NdisInterlockedPopEntrySList()

PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPopEntrySList ( IN PSLIST_HEADER  ListHead,
IN PKSPIN_LOCK  Lock 
)

Definition at line 419 of file misc.c.

428{
430}
Definition: ntbasedef.h:628
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define ExInterlockedPopEntrySList(SListHead, Lock)
Definition: exfuncs.h:166

◆ NdisInterlockedPushEntrySList()

PSINGLE_LIST_ENTRY EXPORT NdisInterlockedPushEntrySList ( IN PSLIST_HEADER  ListHead,
IN PSINGLE_LIST_ENTRY  ListEntry,
IN PKSPIN_LOCK  Lock 
)

Definition at line 439 of file misc.c.

449{
450 return (PSINGLE_LIST_ENTRY)ExInterlockedPushEntrySList ( ListHead, (PSLIST_ENTRY)ListEntry, Lock );
451}
#define ExInterlockedPushEntrySList(SListHead, SListEntry, Lock)
Definition: exfuncs.h:163
#define PSLIST_ENTRY
Definition: rtltypes.h:134

◆ NdisInterlockedRemoveHeadList()

PLIST_ENTRY EXPORT NdisInterlockedRemoveHeadList ( IN PLIST_ENTRY  ListHead,
IN PNDIS_SPIN_LOCK  SpinLock 
)

Definition at line 113 of file misc.c.

116{
117 return ExInterlockedRemoveHeadList ( ListHead, &SpinLock->SpinLock );
118}
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:166

◆ NdisMapFile()

VOID EXPORT NdisMapFile ( OUT PNDIS_STATUS  Status,
OUT PVOID MappedBuffer,
IN NDIS_HANDLE  FileHandle 
)

Definition at line 149 of file misc.c.

153{
155
156 NDIS_DbgPrint(MAX_TRACE, ("called: FileHandle 0x%x\n", FileHandle));
157
158 if (HandleObject->Mapped)
159 {
160 /* If a file already mapped we will return an error code */
161 NDIS_DbgPrint(MIN_TRACE, ("File already mapped\n"));
163 return;
164 }
165
166 HandleObject->Mapped = TRUE;
167 *MappedBuffer = HandleObject->MapBuffer;
168
169 /* Set returned status */
171}
#define MIN_TRACE
Definition: debug.h:14
#define TRUE
Definition: types.h:120
struct _NDIS_HANDLE_OBJECT * PNDIS_HANDLE_OBJECT
Status
Definition: gdiplustypes.h:25
#define NDIS_STATUS_ALREADY_MAPPED
Definition: ndis.h:494
_Out_ PVOID * MappedBuffer
Definition: ndis.h:3245
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID MapBuffer
Definition: misc.c:125

◆ NdisOpenFile()

VOID EXPORT NdisOpenFile ( OUT PNDIS_STATUS  Status,
OUT PNDIS_HANDLE  FileHandle,
OUT PUINT  FileLength,
IN PNDIS_STRING  FileName,
IN NDIS_PHYSICAL_ADDRESS  HighestAcceptableAddress 
)

Definition at line 224 of file misc.c.

230{
231 NDIS_STRING FullFileName;
233 PNDIS_HANDLE_OBJECT FileHandleObject = NULL;
235
237
238 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
239
240 ASSERT ( Status && FileName );
241
243 FullFileName.Buffer = NULL;
244
245 FullFileName.Length = sizeof(NDIS_FILE_FOLDER) - sizeof(UNICODE_NULL);
246 FullFileName.MaximumLength = FileName->MaximumLength + FullFileName.Length;
247 FullFileName.Buffer = ExAllocatePool ( NonPagedPool, FullFileName.MaximumLength );
248
249 if ( !FullFileName.Buffer )
250 {
251 NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
253 goto cleanup;
254 }
255
256 FileHandleObject = ExAllocatePool ( NonPagedPool, sizeof(NDIS_HANDLE_OBJECT) );
257 if ( !FileHandleObject )
258 {
259 NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
261 goto cleanup;
262 }
263 memset ( FileHandleObject, 0, sizeof(NDIS_HANDLE_OBJECT) );
264
265 memmove ( FullFileName.Buffer, NDIS_FILE_FOLDER, FullFileName.Length );
266 *Status = RtlAppendUnicodeStringToString ( &FullFileName, FileName );
267 if ( !NT_SUCCESS(*Status) )
268 {
269 NDIS_DbgPrint(MIN_TRACE, ("RtlAppendUnicodeStringToString failed (%x)\n", *Status));
271 goto cleanup;
272 }
273
275 &FullFileName,
277 NULL,
278 NULL );
279
280 *Status = ZwCreateFile (
281 &FileHandleObject->FileHandle,
285 NULL, // PLARGE_INTEGER AllocationSize
286 0, // ULONG FileAttributes
287 FILE_SHARE_READ, // ULONG ShareAccess
288 FILE_OPEN, // ULONG CreateDisposition
289 FILE_SYNCHRONOUS_IO_NONALERT, // ULONG CreateOptions
290 0, // PVOID EaBuffer
291 0 ); // ULONG EaLength
292
293 if ( !NT_SUCCESS(*Status) )
294 {
295 NDIS_DbgPrint(MIN_TRACE, ("ZwCreateFile failed (%x) Name %wZ\n", *Status, FileName));
297 }
298
299cleanup:
300 if ( FullFileName.Buffer != NULL )
301 {
302 ExFreePool ( FullFileName.Buffer );
303 FullFileName.Buffer = NULL;
304 }
305 if ( !NT_SUCCESS(*Status) )
306 {
307 if( FileHandleObject ) {
308 ExFreePool ( FileHandleObject );
309 FileHandleObject = NULL;
310 }
311 *FileHandle = NULL;
312 }
313 else
314 *FileHandle = NDIS_POBJECT_TO_HANDLE(FileHandleObject);
315
316 return;
317}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define FILE_SHARE_READ
Definition: compat.h:136
static void cleanup(void)
Definition: main.c:1335
static const WCHAR NDIS_FILE_FOLDER[]
Definition: misc.c:142
FORCEINLINE NDIS_HANDLE NDIS_POBJECT_TO_HANDLE(PNDIS_HANDLE_OBJECT obj)
Definition: misc.c:137
#define NonPagedPool
Definition: env_spec_w32.h:307
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define SYNCHRONIZE
Definition: nt_native.h:61
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define UNICODE_NULL
USHORT MaximumLength
Definition: env_spec_w32.h:370

◆ ndisProcWorkItemHandler()

VOID NTAPI ndisProcWorkItemHandler ( PVOID  pContext)

Definition at line 456 of file misc.c.

457{
458 PNDIS_WORK_ITEM pNdisItem = (PNDIS_WORK_ITEM)pContext;
459
460 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
461
462 pNdisItem->Routine(pNdisItem, pNdisItem->Context);
463}
struct _NDIS_WORK_ITEM * PNDIS_WORK_ITEM
PVOID Context
Definition: ndis.h:2318
NDIS_PROC Routine
Definition: ndis.h:2319

Referenced by NdisScheduleWorkItem().

◆ NdisScheduleWorkItem()

NDIS_STATUS EXPORT NdisScheduleWorkItem ( IN PNDIS_WORK_ITEM  pWorkItem)

Definition at line 467 of file misc.c.

469{
470 PWORK_QUEUE_ITEM pntWorkItem = (PWORK_QUEUE_ITEM)pWorkItem->WrapperReserved;
471
472 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
473
474 ExInitializeWorkItem(pntWorkItem, ndisProcWorkItemHandler, pWorkItem);
475 ExQueueWorkItem(pntWorkItem, DelayedWorkQueue);
476 return NDIS_STATUS_SUCCESS;
477}
VOID NTAPI ndisProcWorkItemHandler(PVOID pContext)
Definition: misc.c:456
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
@ DelayedWorkQueue
Definition: extypes.h:190
struct _WORK_QUEUE_ITEM * PWORK_QUEUE_ITEM

Referenced by DcCheckForHang(), DcHandleSystemError(), DcReset(), DcSetPower(), DcTestPacket(), MiniportReset(), NvNetSetPower(), ParaNdis5_Reset(), and ParaNdis_OnSetPower().

◆ NdisSystemProcessorCount()

CCHAR EXPORT NdisSystemProcessorCount ( VOID  )

Definition at line 324 of file misc.c.

326{
327 return KeNumberProcessors;
328}
CCHAR KeNumberProcessors
Definition: krnlinit.c:35

◆ NdisUnmapFile()

VOID EXPORT NdisUnmapFile ( IN NDIS_HANDLE  FileHandle)

Definition at line 178 of file misc.c.

180{
182
183 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
184
185 HandleObject->Mapped = FALSE;
186}
#define FALSE
Definition: types.h:117

Referenced by NdisCloseFile().

Variable Documentation

◆ CancelId

◆ NDIS_FILE_FOLDER

const WCHAR NDIS_FILE_FOLDER[] = L"\\SystemRoot\\System32\\Drivers\\"
static

Definition at line 142 of file misc.c.

Referenced by NdisOpenFile().