ReactOS 0.4.15-dev-8344-g0574987
mxum.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxUm.h
8
9Abstract:
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
16Author:
17
18
19
20Revision 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
41typedef PVOID PIRP;
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
58typedef
59VOID
65 );
66
68
69typedef
70VOID
74 );
75
78
79//
80// Forward defines
81//
82struct IFxMessageDispatch;
83struct IUnknown;
84struct IWudfIrp;
85struct IWudfIoIrp;
86struct IWudfFile;
87struct IWDFObject;
88struct IObjectCleanup;
89struct IWudfDeviceStack;
90struct IWudfDeviceStack2;
91struct IWudfTargetCallbackDeviceChange;
92struct IWudfIoDispatcher;
93struct IWudfRemoteDispatcher;
94struct IWudfDevice;
95struct IWudfDevice2;
96struct IWudfHost;
97struct IWudfHost2;
98
99//
100// typedefs
101//
102typedef IWudfDevice * MdDeviceObject;
103typedef IWudfIrp* MdIrp;
107typedef PWUDF_IO_REMOVE_LOCK MdRemoveLock;
109
117typedef enum _WDF_DEVICE_IO_BUFFER_RETRIEVAL WDF_DEVICE_IO_BUFFER_RETRIEVAL;
118typedef enum RdWmiPowerAction;
120typedef enum _WDF_EVENT_TYPE WDF_EVENT_TYPE;
121typedef enum _WDF_FILE_INFORMATION_CLASS WDF_FILE_INFORMATION_CLASS;
123
124typedef
128 __in MdIrp Irp,
130 );
131
133
134typedef
135VOID
139 );
140
144
145//
146// From wdm.h
147//
148
149typedef
150__drv_functionClass(REQUEST_POWER_COMPLETE)
152VOID
153REQUEST_POWER_COMPLETE (
159 );
160
161typedef REQUEST_POWER_COMPLETE *PREQUEST_POWER_COMPLETE;
162typedef REQUEST_POWER_COMPLETE MdRequestPowerCompleteType, *MdRequestPowerComplete;
163
166
167//
168// Driver object's basic interface.
169//
170typedef
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
185typedef
186VOID
188 _In_ IWudfDevice * DeviceObject,
189 _In_ IWudfIrp * Irp,
191 );
192
194
195typedef
196VOID
199 );
200
202
203
204
205
206#ifdef UMDF_INFRASTRUCTURE
207#ifndef WUDF_KERNEL
208typedef CCHAR KPROCESSOR_MODE;
209typedef PVOID PMDL;
210typedef
212_Function_class_(ALLOCATE_FUNCTION)
213PVOID
214ALLOCATE_FUNCTION (
218 );
219typedef ALLOCATE_FUNCTION *PALLOCATE_FUNCTION;
220typedef
222_Function_class_(FREE_FUNCTION)
223VOID
224FREE_FUNCTION (
226 );
227typedef 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"
struct _IRP * PIRP
unsigned long long UINT64
LONG NTSTATUS
Definition: precomp.h:26
@ Reserved2
Definition: bcd.h:202
@ Reserved1
Definition: bcd.h:201
Definition: bufpool.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define _IRQL_requires_same_
Definition: driverspecs.h:232
#define __drv_freesMem(kind)
Definition: driverspecs.h:272
#define __drv_functionClass(x)
Definition: driverspecs.h:274
#define __drv_sameIRQL
Definition: driverspecs.h:325
#define _Function_class_(x)
Definition: ms_sal.h:2946
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
enum _WDF_FILE_INFORMATION_CLASS WDF_FILE_INFORMATION_CLASS
Definition: mxum.h:121
WDF_FILE_INFORMATION_CLASS * PWDF_FILE_INFORMATION_CLASS
Definition: mxum.h:122
PWUDF_IO_REMOVE_LOCK MdRemoveLock
Definition: mxum.h:107
WUDF_DRIVER_CANCEL * PWUDF_DRIVER_CANCEL
Definition: mxum.h:141
PVOID MdInterrupt
Definition: mxum.h:108
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
Definition: mxum.h:112
IWudfIrp * MdIrp
Definition: mxum.h:103
REQUEST_POWER_COMPLETE * PREQUEST_POWER_COMPLETE
Definition: mxum.h:161
DRIVER_ADD_DEVICE_UM * PFN_DRIVER_ADD_DEVICE_UM
Definition: mxum.h:183
struct _STACK_DEVICE_CAPABILITIES * PSTACK_DEVICE_CAPABILITIES
Definition: mxum.h:110
enum _WDF_INTERRUPT_PRIORITY WDF_INTERRUPT_PRIORITY
Definition: mxum.h:115
IWudfDevice * MdDeviceObject
Definition: mxum.h:102
VOID TIMER_CALLBACK_ROUTINE_EX(__in PEX_TIMER Reserved1, __in_opt PVOID Context)
Definition: mxum.h:71
DRIVER_DISPATCH_UM * PFN_DRIVER_DISPATCH_UM
Definition: mxum.h:193
NTSTATUS WUDF_IO_COMPLETION_ROUTINE(__in MdDeviceObject DeviceObject, __in MdIrp Irp, __in PVOID Context)
Definition: mxum.h:126
struct _DRIVER_OBJECT_UM * PDRIVER_OBJECT_UM
Definition: mxum.h:165
WUDF_DRIVER_CANCEL * MdCancelRoutine
Definition: mxum.h:143
REQUEST_POWER_COMPLETE MdRequestPowerCompleteType
Definition: mxum.h:162
struct _WDF_REQUEST_PARAMETERS * PWDF_REQUEST_PARAMETERS
Definition: mxum.h:119
TIMER_CALLBACK_ROUTINE_EX MdExtCallbackType
Definition: mxum.h:77
enum _WDF_INTERRUPT_POLICY WDF_INTERRUPT_POLICY
Definition: mxum.h:114
PVOID PEX_TIMER
Definition: mxum.h:67
struct _WDF_OBJECT_ATTRIBUTES * PWDF_OBJECT_ATTRIBUTES
Definition: mxum.h:116
TIMER_CALLBACK_ROUTINE_EX * MdExtCallback
Definition: mxum.h:77
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
LPCSTR MxFuncName
Definition: mxum.h:104
WUDF_IO_COMPLETION_ROUTINE * PWUDF_IO_COMPLETION_ROUTINE
Definition: mxum.h:132
DRIVER_UNLOAD_UM * PFN_DRIVER_UNLOAD_UM
Definition: mxum.h:201
TIMER_CALLBACK_ROUTINE * MdDeferredRoutine
Definition: mxum.h:76
VOID TIMER_CALLBACK_ROUTINE(__in PKDPC Reserved1, __in_opt PVOID Context, __in_opt PVOID Reserved2, __in_opt PVOID Reserved3)
Definition: mxum.h:60
REQUEST_POWER_COMPLETE * MdRequestPowerComplete
Definition: mxum.h:162
enum _WDF_DEVICE_IO_BUFFER_RETRIEVAL WDF_DEVICE_IO_BUFFER_RETRIEVAL
Definition: mxum.h:117
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
Definition: mxum.h:164
VOID DRIVER_DISPATCH_UM(_In_ IWudfDevice *DeviceObject, _In_ IWudfIrp *Irp, _In_opt_ IUnknown *Context)
Definition: mxum.h:187
VOID WUDF_DRIVER_CANCEL(__in MdDeviceObject DeviceObject, __in MdIrp Irp)
Definition: mxum.h:136
PVOID MxThread
Definition: mxum.h:105
WUDF_IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: mxum.h:142
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
UINT64 WUDF_INTERFACE_CONTEXT
Definition: mxum.h:111
enum _WDF_EVENT_TYPE WDF_EVENT_TYPE
Definition: mxum.h:120
struct _WDF_INTERRUPT_INFO * PWDF_INTERRUPT_INFO
Definition: mxum.h:113
WUDF_DRIVER_CANCEL MdCancelRoutineType
Definition: mxum.h:143
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
PVOID MdEThread
Definition: mxum.h:106
VOID DRIVER_UNLOAD_UM(_In_ PDRIVER_OBJECT_UM DriverObject)
Definition: mxum.h:197
TIMER_CALLBACK_ROUTINE MdDeferredRoutineType
Definition: mxum.h:76
@ Reserved3
Definition: sacdrv.h:1471
Definition: ketypes.h:699
INT POOL_TYPE
Definition: typedefs.h:78
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
char CCHAR
Definition: typedefs.h:51
PVOID PMDL
Definition: usb.h:39
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_WDF_REQUEST_TYPE
Definition: wdfdevice.h:502
_WDF_DEVICE_IO_TYPE
Definition: wdfdevice.h:449
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3034
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_WDF_INTERRUPT_PRIORITY
Definition: wdfinterrupt.h:65
_WDF_INTERRUPT_POLICY
Definition: wdfinterrupt.h:56
struct _EX_TIMER * PEX_TIMER
Definition: extypes.h:291
struct _IO_REMOVE_LOCK * PIO_REMOVE_LOCK
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char UCHAR
Definition: xmlstorage.h:181
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185