ReactOS  0.4.15-dev-2704-gd5265b0
mxgeneralum.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxGeneralUm.cpp
8 
9 Abstract:
10 
11  Implementation of MxGeneralUm functions.
12 
13 Author:
14 
15 
16 
17 Revision History:
18 
19 
20 
21 --*/
22 
23 #include "Mx.h"
24 
25 #include <strsafe.h>
26 
27 #include "fxmin.hpp"
28 
29 extern "C" IUMDFPlatform *g_IUMDFPlatform;
30 
31 VOID
34  __in PCSTR DebugMessage,
35  ...
36  )
37 {
38 #if DBG
39 
40 #define TEMP_BUFFER_SIZE 1024
41  va_list list;
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 
74 VOID
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 
94 VOID
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 
105 VOID
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 
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
HRESULT hr
Definition: shlfolder.c:183
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
char CHAR
Definition: xmlstorage.h:175
uint32_t ULONG_PTR
Definition: typedefs.h:65
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
Definition: mxgeneralkm.h:502
#define va_end(ap)
Definition: acmsvcex.h:90
if SUCCEEDED(hr)
#define __drv_formatString(kind)
Definition: driverspecs.h:253
char * va_list
Definition: acmsvcex.h:78
#define TEMP_BUFFER_SIZE
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
LONG HRESULT
Definition: typedefs.h:79
va_start(ap, x)
#define _Inout_
Definition: no_sal2.h:162
STRSAFEAPI StringCbVPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat, va_list argList)
Definition: strsafe.h:502
Definition: _list.h:228
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition: mxgeneralkm.cpp:7
#define _In_
Definition: no_sal2.h:158
#define list
Definition: rosglue.h:35
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
unsigned int ULONG
Definition: retypes.h:1
#define UNREACHABLE
const char * PCSTR
Definition: typedefs.h:52
#define __in
Definition: dbghelp.h:35
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
IUMDFPlatform * g_IUMDFPlatform
Definition: mxgeneralum.cpp:29
#define printf
Definition: config.h:203