remote Win32.{GetLastError,GetErrorMessage}, handled in jni code now

This commit is contained in:
Doug MacEachern 2005-06-26 22:11:04 +00:00
parent 57b2a03436
commit 25398b10bf
2 changed files with 0 additions and 30 deletions

View File

@ -36,29 +36,6 @@ void win32_throw_last_error(JNIEnv *env)
win32_throw_exception(env, msg);
}
JNIEXPORT jint SIGAR_JNI(win32_Win32_GetLastError)
(JNIEnv *env, jclass cls)
{
return GetLastError();
}
JNIEXPORT jstring SIGAR_JNI(win32_Win32_GetErrorMessage)
(JNIEnv *env, jclass cls, jint error)
{
LPTSTR msg;
jstring str;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|
FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPTSTR)&msg, 0, NULL);
str = JENV->NewString(env, (const jchar *)msg, lstrlen(msg));
LocalFree(msg);
return str;
}
#ifdef __cplusplus
}
#endif

View File

@ -5,8 +5,6 @@ import net.hyperic.sigar.SigarException;
abstract class Win32 {
static int SUCCESS = 0;
static {
try {
Sigar.load();
@ -14,9 +12,4 @@ abstract class Win32 {
}
}
static native String GetErrorMessage(int error);
static native int GetLastError();
}