Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.0 KiB

//*************************************************************
//
// Debugging functions
//
// Microsoft Confidential
// Copyright (c) Microsoft Corporation 1995
// All rights reserved
//
//*************************************************************
#include "pch.h"
VOID
_DebugMsg (
UINT mask,
PCSTR Format,
...
)
{
va_list args;
DWORD Error;
WCHAR Output[2048];
PWSTR UnicodeFormat;
UINT Size;
Error = GetLastError();
va_start (args, Format);
Size = (lstrlenA (Format) + 1) * sizeof (WCHAR);
UnicodeFormat = LocalAlloc (LPTR, Size);
if (!UnicodeFormat) {
SetLastError (Error);
return;
}
MultiByteToWideChar (CP_ACP, 0, Format, -1, UnicodeFormat, Size/sizeof(WCHAR));
_vsnwprintf (Output, sizeof(Output) - 3, UnicodeFormat, args);
lstrcatW (Output, L"\r\n");
OutputDebugStringW (Output);
if (mask == DM_ASSERT) {
DebugBreak();
}
va_end (args);
LocalFree (UnicodeFormat);
SetLastError (Error);
}