mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:06:17 +00:00
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9
Licensed under MIT
This commit is contained in:
parent
545df81502
commit
8a978a179f
475 changed files with 285099 additions and 0 deletions
58
sdk/lib/drivers/wdf/shared/primitives/km/mxgeneralkm.cpp
Normal file
58
sdk/lib/drivers/wdf/shared/primitives/km/mxgeneralkm.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
#include "Mx.h"
|
||||
|
||||
VOID
|
||||
Mx::MxDbgPrint(
|
||||
__drv_formatString(printf)
|
||||
__in PCSTR DebugMessage,
|
||||
...
|
||||
)
|
||||
{
|
||||
#if DBG
|
||||
|
||||
#define TEMP_BUFFER_SIZE 1024
|
||||
va_list list;
|
||||
CHAR debugMessageBuffer[TEMP_BUFFER_SIZE];
|
||||
NTSTATUS status;
|
||||
|
||||
va_start(list, DebugMessage);
|
||||
|
||||
if (DebugMessage) {
|
||||
|
||||
//
|
||||
// Using new safe string functions instead of _vsnprintf.
|
||||
// This function takes care of NULL terminating if the message
|
||||
// is longer than the buffer.
|
||||
//
|
||||
status = RtlStringCbVPrintfA( debugMessageBuffer,
|
||||
sizeof(debugMessageBuffer),
|
||||
DebugMessage,
|
||||
list );
|
||||
if(!NT_SUCCESS(status)) {
|
||||
|
||||
DbgPrint ("WDF DbgPrint: Unable to expand: %s", DebugMessage);
|
||||
}
|
||||
else {
|
||||
DbgPrint("%s", debugMessageBuffer);
|
||||
}
|
||||
}
|
||||
va_end(list);
|
||||
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(DebugMessage);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
Mx::MxGlobalInit(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Global initialization for kernel-mode primitives
|
||||
//
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue