ReactOS
0.4.16-dev-197-g92996da
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
7
Mx::MxDbgPrint
(
8
__drv_formatString
(
printf
)
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
];
18
NTSTATUS
status
;
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
51
Mx::MxGlobalInit
(
52
VOID
53
)
54
{
55
//
56
// Global initialization for kernel-mode primitives
57
//
58
}
va_list
char * va_list
Definition:
acmsvcex.h:78
va_end
#define va_end(ap)
Definition:
acmsvcex.h:90
va_start
#define va_start(ap, A)
Definition:
acmsvcex.h:91
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
Mx::MxGlobalInit
static VOID MxGlobalInit(VOID)
Definition:
mxgeneralkm.cpp:51
Mx::MxDbgPrint
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition:
mxgeneralkm.cpp:7
list
Definition:
list.h:37
__in
#define __in
Definition:
dbghelp.h:35
NT_SUCCESS
#define NT_SUCCESS(StatCode)
Definition:
apphelp.c:33
__drv_formatString
#define __drv_formatString(kind)
Definition:
driverspecs.h:271
printf
#define printf
Definition:
freeldr.h:97
DbgPrint
#define DbgPrint
Definition:
hal.h:12
void
Definition:
nsiface.idl:2307
mx.h
TEMP_BUFFER_SIZE
#define TEMP_BUFFER_SIZE
UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(P)
Definition:
ntbasedef.h:317
RtlStringCbVPrintfA
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
list
#define list
Definition:
rosglue.h:35
status
Definition:
ps.c:97
PCSTR
const char * PCSTR
Definition:
typedefs.h:52
CHAR
char CHAR
Definition:
xmlstorage.h:175
sdk
lib
drivers
wdf
shared
primitives
km
mxgeneralkm.cpp
Generated on Wed Oct 30 2024 06:13:27 for ReactOS by
1.9.6