ReactOS  0.4.15-dev-3163-gf17c2c0
mxgeneralkm.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) Microsoft. All rights reserved.
3 //
4 #include "mx.h"
5 
6 VOID
9  __in PCSTR DebugMessage,
10  ...
11  )
12 {
13 #if DBG
14 
15 #define TEMP_BUFFER_SIZE 1024
16  va_list list;
17  CHAR debugMessageBuffer[TEMP_BUFFER_SIZE];
19 
20  va_start(list, DebugMessage);
21 
22  if (DebugMessage) {
23 
24  //
25  // Using new safe string functions instead of _vsnprintf.
26  // This function takes care of NULL terminating if the message
27  // is longer than the buffer.
28  //
29  status = RtlStringCbVPrintfA( debugMessageBuffer,
30  sizeof(debugMessageBuffer),
31  DebugMessage,
32  list );
33  if(!NT_SUCCESS(status)) {
34 
35  DbgPrint ("WDF DbgPrint: Unable to expand: %s", DebugMessage);
36  }
37  else {
38  DbgPrint("%s", debugMessageBuffer);
39  }
40  }
41  va_end(list);
42 
43 #else
44  UNREFERENCED_PARAMETER(DebugMessage);
45 #endif
46  return;
47 }
48 
49 
50 VOID
52  VOID
53  )
54 {
55  //
56  // Global initialization for kernel-mode primitives
57  //
58 }
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
#define DbgPrint
Definition: hal.h:12
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
#define va_end(ap)
Definition: acmsvcex.h:90
#define __drv_formatString(kind)
Definition: driverspecs.h:270
NTSTATUS RtlStringCbVPrintfA(char *pszDest, size_t cbDest, const char *pszFormat, va_list argList)
char * va_list
Definition: acmsvcex.h:78
#define TEMP_BUFFER_SIZE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
va_start(ap, x)
Definition: _list.h:228
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition: mxgeneralkm.cpp:7
#define list
Definition: rosglue.h:35
const char * PCSTR
Definition: typedefs.h:52
#define __in
Definition: dbghelp.h:35
static SERVICE_STATUS status
Definition: service.c:31
#define printf
Definition: config.h:203
Definition: ps.c:97