ReactOS 0.4.15-dev-7953-g1f49173
mxgeneralum.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxGeneralUm.cpp
8
9Abstract:
10
11 Implementation of MxGeneralUm functions.
12
13Author:
14
15
16
17Revision History:
18
19
20
21--*/
22
23#include "Mx.h"
24
25#include <strsafe.h>
26
27#include "fxmin.hpp"
28
29extern "C" IUMDFPlatform *g_IUMDFPlatform;
30
31VOID
34 __in PCSTR DebugMessage,
35 ...
36 )
37{
38#if DBG
39
40#define TEMP_BUFFER_SIZE 1024
42 CHAR debugMessageBuffer[TEMP_BUFFER_SIZE];
43 HRESULT hr;
44
45 va_start(list, DebugMessage);
46
47 if (DebugMessage) {
48
49 //
50 // Using new safe string functions instead of _vsnprintf.
51 // This function takes care of NULL terminating if the message
52 // is longer than the buffer.
53 //
54 hr = StringCbVPrintfA( debugMessageBuffer,
55 sizeof(debugMessageBuffer),
56 DebugMessage,
57 list );
58 if(!SUCCEEDED(hr)) {
59 OutputDebugStringA("WDF DbgPrint: Unable to expand: ");
60 OutputDebugStringA(DebugMessage);
61 }
62 else {
63 OutputDebugStringA(debugMessageBuffer);
64 }
65 }
66 va_end(list);
67
68#else
69 UNREFERENCED_PARAMETER(DebugMessage);
70#endif
71 return;
72}
73
74VOID
76 _In_ ULONG BugCheckCode,
77 _In_ ULONG_PTR BugCheckParameter1,
78 _In_ ULONG_PTR BugCheckParameter2,
79 _In_ ULONG_PTR BugCheckParameter3,
80 _In_ ULONG_PTR BugCheckParameter4
81)
82{
83
84 UNREFERENCED_PARAMETER(BugCheckParameter1);
85 UNREFERENCED_PARAMETER(BugCheckParameter2);
86 UNREFERENCED_PARAMETER(BugCheckParameter3);
87 UNREFERENCED_PARAMETER(BugCheckParameter4);
88
89 FX_VERIFY(DRIVER(BadAction, BugCheckCode), TRAPMSG("UMDF verification "
90 "faults should not call this code path"));
92}
93
94VOID
96 VOID
97 )
98{
99 //
100 // Currently just a placeholder. If there is any global initialization
101 // needed for the user-mode primitives, it can be done here.
102 //
103}
104
105VOID
108 )
109{
110
111
112
113
114
115 HRESULT hrDetachDev =
116 Device->GetDeviceStackInterface()->DetachDevice(Device);
117
118
119
120
121
122 UNREFERENCED_PARAMETER(hrDetachDev);
123}
124
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
Definition: mxgeneralkm.h:502
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 VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition: mxgeneralkm.cpp:7
Definition: list.h:37
#define __in
Definition: dbghelp.h:35
#define __drv_formatString(kind)
Definition: driverspecs.h:271
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
#define printf
Definition: freeldr.h:97
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
IUMDFPlatform * g_IUMDFPlatform
Definition: mxgeneralum.cpp:29
#define TEMP_BUFFER_SIZE
#define UNREACHABLE
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define list
Definition: rosglue.h:35
HRESULT hr
Definition: shlfolder.c:183
STRSAFEAPI StringCbVPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat, va_list argList)
Definition: strsafe.h:502
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
char CHAR
Definition: xmlstorage.h:175