1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-19 07:21:20 +03:00

import KernelEx-4.0-Final

This commit is contained in:
UzixLS
2018-11-03 16:20:02 +03:00
parent 339353cce8
commit 30df122aba
339 changed files with 11011 additions and 1945 deletions

19
core/debug.cpp Executable file → Normal file
View File

@ -19,32 +19,20 @@
*
*/
#include "debug.h"
#include <stdio.h>
#include <stdarg.h>
#include <windows.h>
#define BUFLEN 256
#include "debug.h"
extern "C"
int vsnprintf(char *buffer, size_t n, const char *format, va_list ap);
void dbgvprintf(const char* format, void* _argp)
{
char msg[BUFLEN];
char msg[DEBUGMSG_MAXLEN];
va_list argp = (va_list) _argp;
HANDLE console_out = GetStdHandle(STD_OUTPUT_HANDLE);
int cnt = vsnprintf(msg, sizeof(msg), format, argp);
if (console_out == INVALID_HANDLE_VALUE)
{
OutputDebugString(msg);
}
else
{
DWORD dummy;
WriteFile(console_out, msg, cnt < 0 ? BUFLEN - 1 : cnt, &dummy, NULL);
}
OutputDebugString(msg);
}
void dbgprintf(const char* format, ...)
@ -54,3 +42,4 @@ void dbgprintf(const char* format, ...)
dbgvprintf(format, argp);
va_end(argp);
}