use sigar_strerror

This commit is contained in:
Doug MacEachern 2008-03-26 20:42:16 +00:00
parent 5d440dcc14
commit 603b0d548f
1 changed files with 4 additions and 10 deletions

View File

@ -21,6 +21,8 @@
#include <pdh.h> #include <pdh.h>
#include <pdhmsg.h> #include <pdhmsg.h>
#include "sigar.h"
#include "sigar_private.h"
#include "win32bindings.h" #include "win32bindings.h"
#include "javasigar.h" #include "javasigar.h"
@ -47,16 +49,8 @@ void win32_throw_error(JNIEnv *env, LONG err)
{ {
char msg[8192]; char msg[8192];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | win32_throw_exception(env,
FORMAT_MESSAGE_IGNORE_INSERTS, sigar_strerror_get(err, msg, sizeof(msg)));
NULL,
err,
0, /* default language */
(LPTSTR)msg,
(DWORD)sizeof(msg),
NULL);
win32_throw_exception(env, msg);
} }
#ifdef __cplusplus #ifdef __cplusplus