From 674bb9a4d57649193d491c03f892550eb0cd34db Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 30 Apr 2009 09:36:01 -0500 Subject: [PATCH] remove error_message from windows vm --- vm/os-windows.c | 34 ---------------------------------- vm/os-windows.h | 4 ---- 2 files changed, 38 deletions(-) diff --git a/vm/os-windows.c b/vm/os-windows.c index 2abc04cb3b..c917cd804d 100755 --- a/vm/os-windows.c +++ b/vm/os-windows.c @@ -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) diff --git a/vm/os-windows.h b/vm/os-windows.h index 36d350f50d..95d41ca9a2 100755 --- a/vm/os-windows.h +++ b/vm/os-windows.h @@ -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);