|
@ -14,11 +14,11 @@ static char *process_title = NULL; |
|
|
|
|
|
|
|
|
// Does the about the same as perror(), but for windows api functions
|
|
|
// Does the about the same as perror(), but for windows api functions
|
|
|
static void _winapi_perror(const char* prefix = NULL) { |
|
|
static void _winapi_perror(const char* prefix = NULL) { |
|
|
DWORD errno = GetLastError(); |
|
|
DWORD errorno = GetLastError(); |
|
|
char *errmsg; |
|
|
char *errmsg; |
|
|
|
|
|
|
|
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
|
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
|
|
NULL, errno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL); |
|
|
NULL, errorno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL); |
|
|
|
|
|
|
|
|
// FormatMessage messages include a newline character
|
|
|
// FormatMessage messages include a newline character
|
|
|
|
|
|
|
|
|