ReactOS 0.4.15-dev-7934-g1dc8d80
mxgeneralkm.cpp
Go to the documentation of this file.
1//
2// Copyright (C) Microsoft. All rights reserved.
3//
4#include "mx.h"
5
9 __in PCSTR DebugMessage,
10 ...
11 )
12{
13#if DBG
14
15#define TEMP_BUFFER_SIZE 1024
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
50VOID
52 VOID
53 )
54{
55 //
56 // Global initialization for kernel-mode primitives
57 //
58}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
LONG NTSTATUS
Definition: precomp.h:26
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition: mxgeneralkm.cpp:7
Definition: list.h:37
#define __in
Definition: dbghelp.h:35
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define __drv_formatString(kind)
Definition: driverspecs.h:271
#define printf
Definition: freeldr.h:97
#define DbgPrint
Definition: hal.h:12
#define TEMP_BUFFER_SIZE
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTRSAFEAPI RtlStringCbVPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
Definition: ntstrsafe.h:1034
#define list
Definition: rosglue.h:35
Definition: ps.c:97
const char * PCSTR
Definition: typedefs.h:52
char CHAR
Definition: xmlstorage.h:175