remove error_message from windows vm

db4
Doug Coleman 2009-04-30 09:36:01 -05:00
parent 08b7ec67c6
commit 674bb9a4d5
2 changed files with 0 additions and 38 deletions

View File

@ -1,39 +1,5 @@
#include "master.h"
F_STRING *get_error_message(void)
{
DWORD id = GetLastError();
F_CHAR *msg = error_message(id);
F_STRING *string = from_u16_string(msg);
LocalFree(msg);
return string;
}
/* You must LocalFree() the return value! */
F_CHAR *error_message(DWORD id)
{
F_CHAR *buffer;
int index;
DWORD ret = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
id,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)(void *) &buffer,
0, NULL);
if(ret == 0)
return error_message(GetLastError());
/* strip whitespace from end */
index = wcslen(buffer) - 1;
while(index >= 0 && isspace(buffer[index]))
buffer[index--] = 0;
return buffer;
}
HMODULE hFactorDll;
void init_ffi(void)

View File

@ -42,10 +42,6 @@ typedef wchar_t F_CHAR;
/* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
#define EPOCH_OFFSET 0x019db1ded53e8000LL
F_STRING *get_error_message(void);
DLLEXPORT F_CHAR *error_message(DWORD id);
void windows_error(void);
void init_ffi(void);
void ffi_dlopen(F_DLL *dll);
void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol);