ReactOS  0.4.15-dev-2352-g3fa57b8
mxum.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxUm.h
8 
9 Abstract:
10 
11  This file includes standard NT headers and
12  user mode versions of mode agnostic headers
13 
14  It also contains definitions pulled out from wdm.h
15 
16 Author:
17 
18 
19 
20 Revision History:
21 
22 
23 
24 --*/
25 
26 #pragma once
27 
28 #ifndef UMDF_USING_NTSTATUS
29 #define UMDF_USING_NTSTATUS
30 #endif
31 
32 #include <windows.h>
33 #include <devpropdef.h>
34 #include <winioctl.h>
35 
36 
37 
38 
39 #ifdef UMDF_INFRASTRUCTURE
40 #ifndef WUDF_KERNEL
41 typedef PVOID PIRP;
42 typedef PVOID PIO_REMOVE_LOCK;
43 #endif
44 #endif
45 
46 #include "wdmdefs.h"
47 
48 #define FX_PLUGPLAY_REGKEY_DEVICEMAP 0x8
49 
50 //
51 // Define the callback function to be supplied by a user-mode user of MxTimer
52 // It has the extra parameters Reserved1, Reserved2 and Reserved3 to make it
53 // look like the KDEFERRED_ROUTINE that used as the callback function for the
54 // kernel mode version of MxTimer. The user-mode user of MxTimer should not
55 // use these ReservedX parameters.
56 //
57 
58 typedef
59 VOID
65  );
66 
67 typedef PVOID PEX_TIMER;
68 
69 typedef
70 VOID
74  );
75 
78 
79 //
80 // Forward defines
81 //
82 struct IFxMessageDispatch;
83 struct IUnknown;
84 struct IWudfIrp;
85 struct IWudfIoIrp;
86 struct IWudfFile;
87 struct IWDFObject;
88 struct IObjectCleanup;
89 struct IWudfDeviceStack;
90 struct IWudfDeviceStack2;
91 struct IWudfTargetCallbackDeviceChange;
92 struct IWudfIoDispatcher;
93 struct IWudfRemoteDispatcher;
94 struct IWudfDevice;
95 struct IWudfDevice2;
96 struct IWudfHost;
97 struct IWudfHost2;
98 
99 //
100 // typedefs
101 //
102 typedef IWudfDevice * MdDeviceObject;
103 typedef IWudfIrp* MdIrp;
105 typedef PVOID MxThread;
106 typedef PVOID MdEThread;
107 typedef PWUDF_IO_REMOVE_LOCK MdRemoveLock;
109 
117 typedef enum _WDF_DEVICE_IO_BUFFER_RETRIEVAL WDF_DEVICE_IO_BUFFER_RETRIEVAL;
118 typedef enum RdWmiPowerAction;
120 typedef enum _WDF_EVENT_TYPE WDF_EVENT_TYPE;
121 typedef enum _WDF_FILE_INFORMATION_CLASS WDF_FILE_INFORMATION_CLASS;
123 
124 typedef
125 NTSTATUS
128  __in MdIrp Irp,
130  );
131 
133 
134 typedef
135 VOID
138  __in MdIrp Irp
139  );
140 
144 
145 //
146 // From wdm.h
147 //
148 
149 typedef
150 __drv_functionClass(REQUEST_POWER_COMPLETE)
152 VOID
153 REQUEST_POWER_COMPLETE (
159  );
160 
161 typedef REQUEST_POWER_COMPLETE *PREQUEST_POWER_COMPLETE;
162 typedef REQUEST_POWER_COMPLETE MdRequestPowerCompleteType, *MdRequestPowerComplete;
163 
166 
167 //
168 // Driver object's basic interface.
169 //
170 typedef
171 NTSTATUS
175  _In_ IWudfDeviceStack * DevStack,
176  _In_ LPCWSTR KernelDeviceName,
177  _In_opt_ HKEY hPdoKey,
178  _In_ LPCWSTR pwszServiceName,
179  _In_ LPCWSTR pwszDevInstanceID,
180  _In_ ULONG ulDriverID
181  );
182 
184 
185 typedef
186 VOID
188  _In_ IWudfDevice * DeviceObject,
189  _In_ IWudfIrp * Irp,
191  );
192 
194 
195 typedef
196 VOID
199  );
200 
202 
203 
204 
205 
206 #ifdef UMDF_INFRASTRUCTURE
207 #ifndef WUDF_KERNEL
208 typedef CCHAR KPROCESSOR_MODE;
209 typedef PVOID PMDL;
210 typedef
212 _Function_class_(ALLOCATE_FUNCTION)
213 PVOID
214 ALLOCATE_FUNCTION (
217  _In_ ULONG Tag
218  );
219 typedef ALLOCATE_FUNCTION *PALLOCATE_FUNCTION;
220 typedef
222 _Function_class_(FREE_FUNCTION)
223 VOID
224 FREE_FUNCTION (
226  );
227 typedef FREE_FUNCTION *PFREE_FUNCTION;
228 #endif
229 #endif
230 
231 //===============================================================================
232 #include <limits.h>
233 #include <driverspecs.h>
234 
235 #include "ErrToStatus.h"
236 
237 #include "MxDriverObjectUm.h"
238 #include "MxDeviceObjectUm.h"
239 #include "MxFileObjectUm.h"
240 #include "MxGeneralUm.h"
241 #include "MxLockUm.h"
242 #include "MxPagedLockUm.h"
243 #include "MxEventUm.h"
244 #include "MxMemoryUm.h"
245 #include "MxTimerUm.h"
246 #include "MxWorkItemUm.h"
WUDF_IO_COMPLETION_ROUTINE * PWUDF_IO_COMPLETION_ROUTINE
Definition: mxum.h:132
VOID WUDF_DRIVER_CANCEL(__in MdDeviceObject DeviceObject, __in MdIrp Irp)
Definition: mxum.h:136
_WDF_INTERRUPT_POLICY
Definition: wdfinterrupt.h:56
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
enum _WDF_FILE_INFORMATION_CLASS WDF_FILE_INFORMATION_CLASS
Definition: mxum.h:121
#define __in_opt
Definition: dbghelp.h:38
struct _WDF_REQUEST_PARAMETERS * PWDF_REQUEST_PARAMETERS
Definition: mxum.h:119
LONG NTSTATUS
Definition: precomp.h:26
REQUEST_POWER_COMPLETE MdRequestPowerCompleteType
Definition: mxum.h:162
TIMER_CALLBACK_ROUTINE * MdDeferredRoutine
Definition: mxum.h:76
typedef __drv_functionClass(REQUEST_POWER_COMPLETE) __drv_sameIRQL VOID REQUEST_POWER_COMPLETE(__in MdDeviceObject DeviceObject
NTSTATUS DRIVER_ADD_DEVICE_UM(_In_ PDRIVER_OBJECT_UM DriverObject, _In_ PVOID Context, _In_ IWudfDeviceStack *DevStack, _In_ LPCWSTR KernelDeviceName, _In_opt_ HKEY hPdoKey, _In_ LPCWSTR pwszServiceName, _In_ LPCWSTR pwszDevInstanceID, _In_ ULONG ulDriverID)
Definition: mxum.h:172
PVOID PMDL
Definition: usb.h:39
#define _In_opt_
Definition: no_sal2.h:212
REQUEST_POWER_COMPLETE * MdRequestPowerComplete
Definition: mxum.h:162
PVOID MdEThread
Definition: mxum.h:106
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
Definition: mxum.h:112
_In_ PIRP Irp
Definition: csq.h:116
PWUDF_IO_REMOVE_LOCK MdRemoveLock
Definition: mxum.h:107
struct _EX_TIMER * PEX_TIMER
Definition: extypes.h:291
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1697
REQUEST_POWER_COMPLETE * PREQUEST_POWER_COMPLETE
Definition: mxum.h:161
_WDF_DEVICE_IO_TYPE
Definition: wdfdevice.h:449
IWudfIrp * MdIrp
Definition: mxum.h:103
#define _IRQL_requires_same_
Definition: driverspecs.h:215
WUDF_DRIVER_CANCEL * MdCancelRoutine
Definition: mxum.h:143
Definition: bufpool.h:45
const char * LPCSTR
Definition: xmlstorage.h:183
Definition: bcd.h:202
WUDF_DRIVER_CANCEL * PWUDF_DRIVER_CANCEL
Definition: mxum.h:141
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
enum _WDF_INTERRUPT_POLICY WDF_INTERRUPT_POLICY
Definition: mxum.h:114
TIMER_CALLBACK_ROUTINE MdDeferredRoutineType
Definition: mxum.h:76
#define __drv_sameIRQL
Definition: driverspecs.h:307
IWudfDevice * MdDeviceObject
Definition: mxum.h:97
struct _STACK_DEVICE_CAPABILITIES * PSTACK_DEVICE_CAPABILITIES
Definition: mxum.h:110
enum _WDF_EVENT_TYPE WDF_EVENT_TYPE
Definition: mxum.h:120
char CCHAR
Definition: typedefs.h:51
INT POOL_TYPE
Definition: typedefs.h:78
enum _WDF_DEVICE_IO_BUFFER_RETRIEVAL WDF_DEVICE_IO_BUFFER_RETRIEVAL
Definition: mxum.h:117
PVOID MxThread
Definition: mxum.h:105
_WDF_INTERRUPT_PRIORITY
Definition: wdfinterrupt.h:65
struct _DRIVER_OBJECT_UM * PDRIVER_OBJECT_UM
Definition: mxum.h:165
struct _IRP * PIRP
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID TIMER_CALLBACK_ROUTINE(__in PKDPC Reserved1, __in_opt PVOID Context, __in_opt PVOID Reserved2, __in_opt PVOID Reserved3)
Definition: mxum.h:60
VOID TIMER_CALLBACK_ROUTINE_EX(__in PEX_TIMER Reserved1, __in_opt PVOID Context)
Definition: mxum.h:71
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: ketypes.h:687
#define _Function_class_(n)
Definition: no_sal2.h:398
WUDF_DRIVER_CANCEL MdCancelRoutineType
Definition: mxum.h:143
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
TIMER_CALLBACK_ROUTINE_EX * MdExtCallback
Definition: mxum.h:77
_WDF_REQUEST_TYPE
Definition: wdfdevice.h:502
#define _In_
Definition: no_sal2.h:158
ULONG_PTR SIZE_T
Definition: typedefs.h:80
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
Definition: mxum.h:164
WDF_FILE_INFORMATION_CLASS * PWDF_FILE_INFORMATION_CLASS
Definition: mxum.h:122
DRIVER_ADD_DEVICE_UM * PFN_DRIVER_ADD_DEVICE_UM
Definition: mxum.h:183
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3032
TIMER_CALLBACK_ROUTINE_EX MdExtCallbackType
Definition: mxum.h:77
struct _WDF_INTERRUPT_INFO * PWDF_INTERRUPT_INFO
Definition: mxum.h:113
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1035
DRIVER_UNLOAD_UM * PFN_DRIVER_UNLOAD_UM
Definition: mxum.h:201
Definition: bcd.h:201
#define __drv_freesMem(kind)
Definition: driverspecs.h:254
enum _WDF_INTERRUPT_PRIORITY WDF_INTERRUPT_PRIORITY
Definition: mxum.h:115
WUDF_IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: mxum.h:142
struct _WDF_OBJECT_ATTRIBUTES * PWDF_OBJECT_ATTRIBUTES
Definition: mxum.h:116
struct _IO_REMOVE_LOCK * PIO_REMOVE_LOCK
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:155
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS WUDF_IO_COMPLETION_ROUTINE(__in MdDeviceObject DeviceObject, __in MdIrp Irp, __in PVOID Context)
Definition: mxum.h:126
unsigned long long UINT64
PVOID MdInterrupt
Definition: mxum.h:108
LPCSTR MxFuncName
Definition: mxum.h:104
#define __in
Definition: dbghelp.h:35
DRIVER_DISPATCH_UM * PFN_DRIVER_DISPATCH_UM
Definition: mxum.h:193
UINT64 WUDF_INTERFACE_CONTEXT
Definition: mxum.h:111
VOID DRIVER_UNLOAD_UM(_In_ PDRIVER_OBJECT_UM DriverObject)
Definition: mxum.h:197
PVOID PEX_TIMER
Definition: mxum.h:67
VOID DRIVER_DISPATCH_UM(_In_ IWudfDevice *DeviceObject, _In_ IWudfIrp *Irp, _In_opt_ IUnknown *Context)
Definition: mxum.h:187