ReactOS 0.4.15-dev-8135-g1bc6c90
mxgeneralum.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxGeneralUm.h
8
9Abstract:
10
11 User mode implementation for general OS
12 functions defined in MxGeneral.h
13
14Author:
15
16
17
18Revision History:
19
20
21
22--*/
23
24#pragma once
25
26#define MAKE_MX_FUNC_NAME(x) x
27
28
29
30
31
32
33
34
35#define REMOVE_LOCK_RELEASE_TIMEOUT_IN_SECONDS 45
36
40 __inout PTP_WAIT Wait,
41 __in TP_WAIT_RESULT WaitResult
42 );
43
45
46typedef
50 );
51
53
55
56typedef
57VOID
62 );
63
65
66//
67// Define PnP notification event categories
68//
69
76
77#include "MxGeneral.h"
78
79__inline
82 )
83{
84 return TRUE;
85}
86
87__inline
90 )
91{
92 return FALSE;
93}
94
95__inline
98 )
99{
100 //
101 // We can't use GetCurrentThread as it returns a pseudo handle
102 // which would have same numeric value for different threads
103 // We could use DuplicateHandle to get real handle but that has the
104 // following problems:
105 // 1) It returns different handle values for the same thread
106 // if called again without closing handle.
107 // 2) Makes the caller call CloseHandle making it inconvenient to
108 // call this function just to get an identifier for the thread
109 // 3) More expensive than GetCurrentThreadId
110 //
111 // Since framework uses the thread only for comparison, logging
112 // purposes GetCurrentThreadId works well.
113 // It is cast to PVOID to match the pointer type PKTHREAD otherwise
114 // trace functions complain of data type mismatch
115 //
116
117 return (PVOID) ::GetCurrentThreadId();
118}
119
120__inline
123 )
124{
125 //
126 // See comments in MxGetCurrentThread.
127 //
128 return (PVOID) MxGetCurrentThread();
129}
130
131__inline
135 )
136{
137 #pragma prefast(suppress:__WARNING_USINGTERMINATETHREAD, "TerminateThread is the intent.");
140 return WinErrorToNtStatus(err);
141 }
142 return STATUS_SUCCESS;
143}
144
145__inline
146KIRQL
148 )
149{
150 return PASSIVE_LEVEL;
151}
152
153__inline
154VOID
155#pragma prefast(suppress:__WARNING_UNMATCHED_DECL_ANNO, "Can't apply kernel mode annotations.");
156Mx::MxRaiseIrql(
159 )
160{
163
164 DO_NOTHING();
165}
166
167__inline
168VOID
169#pragma prefast(suppress:__WARNING_UNMATCHED_DECL_ANNO, "Can't apply kernel mode annotations.");
170Mx::MxLowerIrql(
172 )
173{
175
176 DO_NOTHING();
177}
178
179__inline
180VOID
182 __out PLARGE_INTEGER TickCount
183 )
184{
185 TickCount->QuadPart = GetTickCount();
186}
187
188__inline
189ULONG
191 )
192{
193 //
194 // The way to get absolute time is TickCount * TimeIncrement.
195 // In UM, TickCount is expressed in miliseconds, so this
196 // conversion ensures that absolute time is expressed
197 // in 100ns units as it is in KM.
198 //
199 return 1000 * 10;
200}
201
202__inline
203VOID
205 )
206{
207 DebugBreak();
208}
209
210__inline
211VOID
214 )
215{
216 if (!Condition)
217 {
218
219
220
221 DebugBreak();
222 }
223}
224
225__inline
226VOID
230 )
231{
233
234 if (!Condition)
235 {
236
237
238
239 DebugBreak();
240 }
241}
242
243__inline
244VOID
245#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "Can't apply kernel mode annotations.");
246Mx::MxEnterCriticalRegion(
247 )
248{
249
250
251
252
253
254 // DO_NOTHING();
255}
256
257__inline
258VOID
259#pragma prefast(suppress:__WARNING_UNMATCHED_DEFN, "Can't apply kernel mode annotations.");
260Mx::MxLeaveCriticalRegion(
261 )
262{
263
264
265
266
267
268 // DO_NOTHING();
269}
270
271__inline
272VOID
274 __in KPROCESSOR_MODE WaitMode,
277 )
278{
279 UNREFERENCED_PARAMETER(WaitMode);
280 ASSERTMSG("Interval must be relative\n", Interval->QuadPart <= 0);
281
282 LARGE_INTEGER intervalMillisecond;
283
284 //
285 // This function uses KeDelayExecutionThread's contract, where relative
286 // intervals are negative numbers expressed in 100ns units. We must
287 // flip the sign and convert to ms units before calling SleepEx.
288 //
289 intervalMillisecond.QuadPart = -1 * Interval->QuadPart;
290 intervalMillisecond.QuadPart /= 10 * 1000;
291
292 SleepEx((DWORD)intervalMillisecond.QuadPart, Alertable);
293}
294
295__inline
296PVOID
299 )
300/*++
301Description:
302
303 This function is meant to be called only by mode agnostic code
304 System routine is assumed to be in ntdll.dll.
305
306 This is because system routines (Rtl*) that can be used both
307 in kernel mode as well as user mode reside in ntdll.dll.
308 Kernel32.dll contains the user mode only Win32 API.
309
310Arguments:
311
312 MxFuncName FuncName -
313
314Return Value:
315
316 NTSTATUS Status code.
317--*/
318{
319 HMODULE hMod;
320
321 hMod = GetModuleHandleW(L"ntdll.dll");
322
323 return GetProcAddress(hMod, FuncName);
324}
325
326__inline
327VOID
330 )
331{
333
334
335
336
337
338
339 // DO_NOTHING();
340}
341
342__inline
343VOID
346 )
347{
349
350
351
352
353
354
355 // DO_NOTHING();
356}
357
358__inline
359VOID
365 )
366{
370
371 ZeroMemory(Lock, sizeof(*Lock));
372 Lock->IoCount = 1;
373 Lock->Removed = FALSE;
374 Lock->RemoveEvent = NULL;
375 Lock->ReleaseRemLockAndWaitStatus = (DWORD)-1;
376}
377
378__inline
381 __in MdRemoveLock RemoveLock,
383 )
384{
386 LONG lockValue;
388
389 lockValue = InterlockedIncrement(&RemoveLock->IoCount);
390
391 ASSERT(lockValue > 0);
392
393 if (! RemoveLock->Removed) {
394 return STATUS_SUCCESS;
395 }
396 else {
397 if (0 == InterlockedDecrement(&RemoveLock->IoCount)) {
398 if (! SetEvent(RemoveLock->RemoveEvent)) {
400 0, 0, 0, 0);
401 }
402 }
404 }
405
406 return status;
407}
408
409__inline
410VOID
412 __in MdRemoveLock RemoveLock,
414 )
415{
417 LONG lockValue;
418
419 lockValue = InterlockedDecrement(&RemoveLock->IoCount);
420
421 ASSERT(0 <= lockValue);
422
423 if (0 == lockValue) {
424 ASSERT (RemoveLock->Removed);
425
426 //
427 // The device needs to be removed. Signal the remove event
428 // that it's safe to go ahead.
429 //
430 if (! SetEvent(RemoveLock->RemoveEvent)) {
432 0, 0, 0, 0);
433 }
434 }
435}
436
437__inline
438VOID
440 __in MdRemoveLock RemoveLock,
442 )
443{
445 LONG ioCount;
446 DWORD retVal = ERROR_SUCCESS;
447
448 RemoveLock->Removed = TRUE;
449
450 ioCount = InterlockedDecrement (&RemoveLock->IoCount);
451 ASSERT(0 < ioCount);
452
453 if (0 < InterlockedDecrement (&RemoveLock->IoCount)) {
454 retVal = WaitForSingleObject(RemoveLock->RemoveEvent,
456 ASSERT(retVal == WAIT_OBJECT_0);
457 }
458
459 // This only serves as a debugging aid.
460 RemoveLock->ReleaseRemLockAndWaitStatus = retVal;
461}
462
463__inline
466 VOID
467 )
468{
469
470
471
472
473 //
474 // Thread stack is not so scarce in UM so return TRUE always
475 //
476 return TRUE;
477}
478
479__inline
480VOID
481#pragma prefast(suppress:__WARNING_UNMATCHED_DECL_ANNO, "Can't apply kernel mode annotations.");
482Mx::ReleaseCancelSpinLock(
484 )
485{
487
488 //
489 // UMDF Host doesn't have cancel spinlock equivalent concept so do nothing.
490 //
491 DO_NOTHING();
492}
493
494__inline
497 __out PCALLBACK_OBJECT *CallbackObject,
501 )
502{
503 UNREFERENCED_PARAMETER(CallbackObject);
507
508 return STATUS_UNSUCCESSFUL;
509}
510
511__inline
512PVOID
514 __in PCALLBACK_OBJECT CallbackObject,
517 )
518{
519 UNREFERENCED_PARAMETER(CallbackObject);
522
523 ASSERTMSG("Not implemented for UMDF\n", FALSE);
524
525 return NULL;
526}
527
528__inline
529VOID
531 __in PVOID CbRegistration
532 )
533{
534 UNREFERENCED_PARAMETER(CbRegistration);
535
536 ASSERTMSG("Not implemented for UMDF\n", FALSE);
537}
538
539__inline
540VOID
543 )
544{
546
547 ASSERTMSG("Not implemented for UMDF\n", FALSE);
548}
549
550__inline
551PVOID
555 )
556{
559
560 ASSERTMSG("Not implemented for UMDF\n", FALSE);
561
562 return NULL;
563}
564
565__inline
566VOID
569 )
570{
572
573 ASSERTMSG("Not implemented for UMDF\n", FALSE);
574}
575
576__inline
577PVOID
581 )
582{
585
586 ASSERTMSG("Not implemented for UMDF\n", FALSE);
587
588 return NULL;
589}
590
591__inline
596 _In_ ULONG DriverObjectExtensionSize,
597 // When successful, this always allocates already-aliased memory.
598 _Post_ _At_(*DriverObjectExtension, _When_(return==0,
600 _When_(return == 0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize))
601 PVOID *DriverObjectExtension
602 )
603{
606 UNREFERENCED_PARAMETER(DriverObjectExtensionSize);
607 UNREFERENCED_PARAMETER(DriverObjectExtension);
608
609 ASSERTMSG("Not implemented for UMDF\n", FALSE);
610
611 return STATUS_UNSUCCESSFUL;
612}
613
614__inline
618 )
619{
621
622 ASSERTMSG("Not implemented for UMDF\n", FALSE);
623
624 return NULL;
625}
626
627__inline
628VOID
631 )
632{
634
635 ASSERTMSG("Not implemented for UMDF\n", FALSE);
636}
637
638__inline
639VOID
642 )
643{
645}
646
647__inline
648VOID
651 )
652{
654
655 ASSERTMSG("Not implemented for UMDF\n", FALSE);
656}
657
658__inline
659VOID
662 _In_opt_ PALLOCATE_FUNCTION Allocate,
663 _In_opt_ PFREE_FUNCTION Free,
666 _In_ ULONG Tag,
668 )
669{
670
678
679 //ASSERTMSG("Not implemented for UMDF\n", FALSE);
680
681}
682
683__inline
684VOID
687 _In_opt_ PALLOCATE_FUNCTION Allocate,
688 _In_opt_ PFREE_FUNCTION Free,
691 _In_ ULONG Tag,
693 )
694{
695
703
704 //ASSERTMSG("Not implemented for UMDF\n", FALSE);
705
706}
707
708__inline
709VOID
712 )
713{
715
716
717
718
719 //
720 // Host's device stack object holds the only reference to the host devices.
721 // The infrastructure controls the device object's lifetime.
722 //
723 DO_NOTHING();
724}
725
726__inline
730 _In_ ULONG DeviceExtensionSize,
735 _In_ PCUNICODE_STRING DefaultSDDLString,
738 )
739{
741 UNREFERENCED_PARAMETER(DeviceExtensionSize);
746 UNREFERENCED_PARAMETER(DefaultSDDLString);
749
750 ASSERTMSG("Not implemented for UMDF\n", FALSE);
751
752 return STATUS_SUCCESS;
753}
754
755__inline
760 )
761{
762
765
766 ASSERTMSG("Not implemented for UMDF\n", FALSE);
767
768 return NULL;
769}
770
771__inline
775 _In_ ULONG DeviceExtensionSize,
781 )
782{
784 UNREFERENCED_PARAMETER(DeviceExtensionSize);
790
791 ASSERTMSG("Not implemented for UMDF\n", FALSE);
792
793 return STATUS_SUCCESS;
794
795}
796
797__inline
802 )
803{
806
807 ASSERTMSG("Not implemented for UMDF\n", FALSE);
808
810}
811
812__inline
813VOID
815 )
816{
817 //
818 // Not supported for UMDF
819 //
820}
821
822__inline
828 )
829{
833
834 ASSERTMSG("Not implemented for UMDF\n", FALSE);
835
837}
838
839__inline
844 )
845{
848
849 ASSERTMSG("Not implemented for UMDF\n", FALSE);
850
852}
853
854
855__inline
862 )
863{
868
869 ASSERTMSG("Not implemented for UMDF\n", FALSE);
870
872}
873
874__inline
878 )
879
880{
882
883 ASSERTMSG("Not implemented for UMDF\n", FALSE);
884
886}
887
888__inline
889VOID
892 _In_ PVOID BaseVa,
894 )
895{
899
900 ASSERTMSG("Not implemented for UMDF\n", FALSE);
901
902}
903
904__inline
905PVOID
908 )
909{
911
912 ASSERTMSG("Not implemented for UMDF\n", FALSE);
913
914 return NULL;
915}
916
917__inline
918VOID
920 _In_ PMDL SourceMdl,
924 )
925{
926 UNREFERENCED_PARAMETER(SourceMdl);
930
931 ASSERTMSG("Not implemented for UMDF\n", FALSE);
932}
933
934__inline
935VOID
937 _Out_ PLARGE_INTEGER CurrentTime
938 )
939{
940 UNREFERENCED_PARAMETER(CurrentTime);
941
942 ASSERTMSG("Not implemented for UMDF\n", FALSE);
943}
944
945__inline
954 )
955{
962
963 ASSERTMSG("Not implemented for UMDF\n", FALSE);
964
966}
967
968__inline
974 _Out_opt_ PVOID KeyValueInformation,
977)
978{
982 UNREFERENCED_PARAMETER(KeyValueInformation);
985
986 ASSERTMSG("Not implemented for UMDF\n", FALSE);
987
989}
990
991__inline
995 )
996{
998
999 ASSERTMSG("Not implemented for UMDF\n", FALSE);
1000
1002}
1003
1004__inline
1013 )
1014{
1021
1022 ASSERTMSG("Not implemented for UMDF\n", FALSE);
1023
1025}
1026
1027__inline
1031 )
1032{
1034
1035 return STATUS_SUCCESS;
1036}
1037
1038__inline
1039KIRQL
1042 )
1043{
1045
1046 ASSERTMSG("Not implemented for UMDF\n", FALSE);
1047 return PASSIVE_LEVEL;
1048}
1049
1050__inline
1051VOID
1055 )
1056{
1059
1060 ASSERTMSG("Not implemented for UMDF\n", FALSE);
1061}
1062
1063__inline
1064BOOLEAN
1069)
1070{
1074
1075 ASSERTMSG("Not implemented for UMDF\n", FALSE);
1076 return FALSE;
1077}
1078
unsigned char BOOLEAN
Type
Definition: Type.h:7
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
@ Create
Definition: registry.c:563
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
static __inline VOID MxInitializePagedLookasideList(_Out_ PPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
Definition: mxgeneralkm.h:472
static __inline VOID MxBuildPartialMdl(_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
Definition: mxgeneralkm.h:663
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
Definition: mxgeneralkm.h:116
static __inline VOID MxDeletePagedLookasideList(_In_ PPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:442
static __inline KIRQL MxAcquireInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt)
Definition: mxgeneralkm.h:767
static __inline NTSTATUS MxDeleteKey(_In_ HANDLE KeyHandle)
Definition: mxgeneralkm.h:634
static __inline VOID MxDbgBreakPoint()
Definition: mxgeneralkm.h:157
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:288
static __inline PVOID MxGetDriverObjectExtension(__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
Definition: mxgeneralkm.h:385
static __inline NTSTATUS MxReferenceObjectByHandle(__in HANDLE Handle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_TYPE ObjectType, __in KPROCESSOR_MODE AccessMode, __out PVOID *Object, __out_opt POBJECT_HANDLE_INFORMATION HandleInformation)
Definition: mxgeneralkm.h:728
static __inline VOID MxReleaseInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
Definition: mxgeneralkm.h:776
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
Definition: mxgeneralkm.h:268
static __inline VOID MxAssertMsg(__in LPSTR Message, __in BOOLEAN Condition)
Definition: mxgeneralkm.h:176
__out __deref __drv_savesIRQL PKIRQL OldIrql
Definition: mxgeneral.h:98
static __inline NTSTATUS MxRegisterDeviceInterface(_In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ const GUID *InterfaceClassGuid, _In_opt_ PUNICODE_STRING ReferenceString, _Out_ PUNICODE_STRING SymbolicLinkName)
Definition: mxgeneralkm.h:619
static __inline NTSTATUS MxSetValueKey(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_opt_ ULONG TitleIndex, _In_ ULONG Type, _In_opt_ PVOID Data, _In_ ULONG DataSize)
Definition: mxgeneralkm.h:688
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
Definition: mxgeneralkm.h:226
static __inline VOID MxInitializeRemoveLock(__in MdRemoveLock Lock, __in ULONG AllocateTag, __in ULONG MaxLockedMinutes, __in ULONG HighWatermark)
Definition: mxgeneralkm.h:256
static __inline MdEThread GetCurrentEThread()
Definition: mxgeneralkm.h:69
static __inline MdDeviceObject MxGetAttachedDeviceReference(__in MdDeviceObject DriverObject)
Definition: mxgeneralkm.h:415
static __inline VOID MxUnlockPages(__in PMDL Mdl)
Definition: mxgeneralkm.h:357
static NTSTATUS MxTerminateCurrentThread(__in NTSTATUS Status)
Definition: mxgeneralkm.h:77
static __inline PVOID MxGetMdlVirtualAddress(_In_ PMDL Mdl)
Definition: mxgeneralkm.h:654
static __inline BOOLEAN MxHasEnoughRemainingThreadStack(VOID)
Definition: mxgeneralkm.h:298
static __inline VOID MxDeleteSymbolicLink(__in PUNICODE_STRING Link)
Definition: mxgeneralkm.h:424
static __inline VOID UnregisterCallback(__in PVOID CbRegistration)
Definition: mxgeneralkm.h:348
static __inline NTSTATUS MxCreateDevice(_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _Out_ MdDeviceObject *DeviceObject)
Definition: mxgeneralkm.h:557
static __inline NTSTATUS MxCreateDeviceSecure(_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _In_ PCUNICODE_STRING DefaultSDDLString, _In_opt_ LPCGUID DeviceClassGuid, _Out_ MdDeviceObject *DeviceObject)
Definition: mxgeneralkm.h:521
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
static __inline NTSTATUS MxQueryValueKey(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, _Out_opt_ PVOID KeyValueInformation, _In_ ULONG Length, _Out_ PULONG ResultLength)
Definition: mxgeneralkm.h:708
static __inline NTSTATUS MxOpenKey(_Out_ PHANDLE KeyHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
Definition: mxgeneralkm.h:597
static __inline NTSTATUS CreateCallback(__out PCALLBACK_OBJECT *CallbackObject, __in POBJECT_ATTRIBUTES ObjectAttributes, __in BOOLEAN Create, __in BOOLEAN AllowMultipleCallbacks)
Definition: mxgeneralkm.h:318
static __inline NTSTATUS MxUnRegisterPlugPlayNotification(__in __drv_freesMem(Pool) PVOID NotificationEntry)
Definition: mxgeneralkm.h:748
static __inline VOID MxFlushQueuedDpcs()
Definition: mxgeneralkm.h:589
static __inline BOOLEAN IsKM()
Definition: mxgeneralkm.h:53
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
static __inline VOID MxDeleteNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:433
static __inline NTSTATUS MxCreateSymbolicLink(_In_ PUNICODE_STRING SymbolicLinkName, _In_ PUNICODE_STRING DeviceName)
Definition: mxgeneralkm.h:579
static __inline BOOLEAN MxInsertQueueDpc(__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
Definition: mxgeneralkm.h:786
static __inline VOID MxDeleteDevice(_In_ MdDeviceObject Device)
Definition: mxgeneralkm.h:493
static __inline NTSTATUS MxAllocateDriverObjectExtension(_In_ MdDriverObject DriverObject, _In_ PVOID ClientIdentificationAddress, _In_ ULONG DriverObjectExtensionSize, _Post_ _At_(*DriverObjectExtension, _When_(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) _Post_notnull_)) _When_(return==0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize)) PVOID *DriverObjectExtension)
Definition: mxgeneralkm.h:396
static __inline VOID MxQuerySystemTime(_Out_ PLARGE_INTEGER CurrentTime)
Definition: mxgeneralkm.h:679
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
static __inline ULONG MxQueryTimeIncrement()
Definition: mxgeneralkm.h:125
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
static __inline VOID MxInitializeNPagedLookasideList(_Out_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
Definition: mxgeneralkm.h:451
static __inline BOOLEAN IsUM()
Definition: mxgeneralkm.h:45
static __inline VOID MxBuildMdlForNonPagedPool(__inout PMDL Mdl)
Definition: mxgeneralkm.h:376
static __inline NTSTATUS MxClose(__in HANDLE Handle)
Definition: mxgeneralkm.h:758
static __inline PVOID RegisterCallback(__in PCALLBACK_OBJECT CallbackObject, __in MdCallbackFunction CallbackFunction, __in PVOID CallbackContext)
Definition: mxgeneralkm.h:334
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
static DECLSPEC_NORETURN VOID MxBugCheckEx(__in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
Definition: mxgeneralkm.h:133
static __inline VOID MxDelayExecutionThread(__in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in PLARGE_INTEGER Interval)
Definition: mxgeneralkm.h:209
static __inline MdDeviceObject MxAttachDeviceToDeviceStack(_In_ MdDeviceObject SourceDevice, _In_ MdDeviceObject TargetDevice)
Definition: mxgeneralkm.h:511
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
Definition: mxgeneralkm.h:608
static __inline VOID MxInitializeMdl(_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
Definition: mxgeneralkm.h:643
Definition: bufpool.h:50
_In_ PVOID Argument2
Definition: classpnp.h:721
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
_Out_ PKIRQL Irql
Definition: csq.h:179
#define __out_opt
Definition: dbghelp.h:65
#define __inout_opt
Definition: dbghelp.h:53
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DEVICE_TYPE
Definition: guid.c:10
#define CloseHandle
Definition: compat.h:739
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
static const WCHAR Message[]
Definition: register.c:74
LONG MaxLockedMinutes
Definition: lock.c:35
#define __drv_freesMem(kind)
Definition: driverspecs.h:272
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:257
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
NTSTATUS WinErrorToNtStatus(__in ULONG WinError)
Definition: errtostatus.cpp:60
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
Definition: fltkernel.h:2554
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
static LPWSTR ClientIdentificationAddress
Definition: hidclass.c:16
macro IMPORT Name endm macro EXPORT Name global &Name endm macro TEXTAREA section rx align endm macro DATAAREA section rw endm macro RODATAAREA section rw endm macro NESTED_ENTRY Name FuncName equ &Name PrologName equ &Name &_Prolog FuncEndName equ &Name &_end global &FuncName align func &FuncName & FuncName
Definition: kxarm.h:221
DeviceType
Definition: mmdrv.h:42
#define ASSERT(a)
Definition: mode.c:44
ObjectType
Definition: metafile.c:81
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:131
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _Post_notnull_
Definition: ms_sal.h:701
#define _Post_
Definition: ms_sal.h:620
#define _At_(target, annos)
Definition: ms_sal.h:244
#define _Out_
Definition: ms_sal.h:345
#define _When_(expr, annos)
Definition: ms_sal.h:254
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define WDF_VIOLATION
Definition: mx.h:37
#define DO_NOTHING()
Definition: mxgeneral.h:32
CALLBACK_FUNCTION * MdCallbackFunction
Definition: mxgeneralkm.h:35
LPCWSTR MxFuncName
Definition: mxgeneralkm.h:27
THREADPOOL_WAIT_CALLBACK * MdInterruptServiceRoutine
Definition: mxgeneralum.h:44
enum _IO_NOTIFICATION_EVENT_CATEGORY IO_NOTIFICATION_EVENT_CATEGORY
THREADPOOL_WAIT_CALLBACK MdInterruptServiceRoutineType
Definition: mxgeneralum.h:44
struct _CALLBACK_OBJECT * PCALLBACK_OBJECT
Definition: mxgeneralum.h:54
CALLBACK_FUNCTION * MdCallbackFunction
Definition: mxgeneralum.h:64
InterruptSynchronizeRoutine MdInterruptSynchronizeRoutineType
Definition: mxgeneralum.h:52
VOID CALLBACK_FUNCTION(__in PVOID CallbackContext, __in_opt PVOID Argument1, __in_opt PVOID Argument2)
Definition: mxgeneralum.h:58
BOOLEAN InterruptSynchronizeRoutine(__in PVOID SynchronizeContext)
Definition: mxgeneralum.h:48
@ EventCategoryTargetDeviceChange
Definition: mxgeneralum.h:74
@ EventCategoryDeviceInterfaceChange
Definition: mxgeneralum.h:73
@ EventCategoryHardwareProfileChange
Definition: mxgeneralum.h:72
@ EventCategoryReserved
Definition: mxgeneralum.h:71
#define REMOVE_LOCK_RELEASE_TIMEOUT_IN_SECONDS
Definition: mxgeneralum.h:35
VOID THREADPOOL_WAIT_CALLBACK(__inout PTP_CALLBACK_INSTANCE Instance, __inout_opt PVOID Context, __inout PTP_WAIT Wait, __in TP_WAIT_RESULT WaitResult)
Definition: mxgeneralum.h:37
CALLBACK_FUNCTION MdCallbackFunctionType
Definition: mxgeneralum.h:64
InterruptSynchronizeRoutine * MdInterruptSynchronizeRoutine
Definition: mxgeneralum.h:52
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
Definition: cmfuncs.h:94
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:453
DWORD Interval
Definition: netstat.c:30
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS
Definition: reg.c:135
#define DWORD
Definition: nt_native.h:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN ULONG IN UCHAR Condition
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_DELETE_PENDING
Definition: ntstatus.h:322
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define err(...)
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: ketypes.h:699
Definition: ps.c:97
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:802
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
uint32_t * PULONG
Definition: typedefs.h:59
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3630
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3739
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
Definition: wdfdevice.h:3336
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2775
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:655
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:379
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
void WINAPI DebugBreak(void)
#define WAIT_OBJECT_0
Definition: winbase.h:406
#define HRESULT_FROM_NT(x)
Definition: winerror.h:94
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
Definition: winnt_old.h:4453
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:60
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:696
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:750
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:1034
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:690
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:691
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
_Inout_ PMDL TargetMdl
Definition: iofuncs.h:730
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
Definition: iofuncs.h:1069
_In_ ULONG AllocateTag
Definition: iofuncs.h:1067
_IO_NOTIFICATION_EVENT_CATEGORY
Definition: iotypes.h:1223
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
_In_ PKSYNCHRONIZE_ROUTINE _In_opt_ __drv_aliasesMem PVOID SynchronizeContext
Definition: kefuncs.h:525
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:688
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:689
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:44
char * LPSTR
Definition: xmlstorage.h:182