diff options
author | Roel Spilker <r.spilker@gmail.com> | 2009-07-23 23:17:59 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2009-07-23 23:17:59 +0200 |
commit | 5835344277d10d069d792c59d67e41313d589d68 (patch) | |
tree | 73ef2f20d81c485cbde73eacb3c28513398a8943 /winsrc | |
parent | f4bcabbe1a8a35028e18726168b56d10dc812787 (diff) | |
download | lombok-5835344277d10d069d792c59d67e41313d589d68.tar.gz lombok-5835344277d10d069d792c59d67e41313d589d68.tar.bz2 lombok-5835344277d10d069d792c59d67e41313d589d68.zip |
Rewrote the "find hard disks on windows" to use a dll instead. The reasons:
A) FSUTIL is internationalized, so on non-english installs, we can't figure out if a disk is fixed.
B) I trust this better than fsutil for user control access (a.k.a. popups from hell) on vista.
C) fsutil.exe is in C:\windows\system32 so pretty sure it would be there, but there's always a chance it's not in the PATH, or otherwise not accessible.
Diffstat (limited to 'winsrc')
-rw-r--r-- | winsrc/.gitignore | 2 | ||||
-rw-r--r-- | winsrc/lombok_installer_WindowsDriveInfo.c | 29 | ||||
-rw-r--r-- | winsrc/lombok_installer_WindowsDriveInfo.h | 29 |
3 files changed, 60 insertions, 0 deletions
diff --git a/winsrc/.gitignore b/winsrc/.gitignore new file mode 100644 index 00000000..7d929cba --- /dev/null +++ b/winsrc/.gitignore @@ -0,0 +1,2 @@ +lombok_installer_WindowsDriveInfo.o +WindowsDriveInfo.dll diff --git a/winsrc/lombok_installer_WindowsDriveInfo.c b/winsrc/lombok_installer_WindowsDriveInfo.c new file mode 100644 index 00000000..5bccd047 --- /dev/null +++ b/winsrc/lombok_installer_WindowsDriveInfo.c @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +#include <windows.h> +#include <stdio.h> +#include <winbase.h> +#include "lombok_installer_WindowsDriveInfo.h" + +/* + * Class: lombok_installer_WindowsDriveInfo + * Method: getLogicalDrives0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_lombok_installer_WindowsDriveInfo_getLogicalDrives0 + (JNIEnv *env, jobject obj) { + return GetLogicalDrives(); +} + +/* + * Class: lombok_installer_WindowsDriveInfo + * Method: getDriveType + * Signature: (Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_lombok_installer_WindowsDriveInfo_getDriveType + (JNIEnv *env, jobject obj, jstring drive) { + const char *str= (*env)->GetStringUTFChars(env, drive, 0); + DWORD val = GetDriveTypeA(str); + (*env)->ReleaseStringUTFChars(env, drive, str); + return val; +} diff --git a/winsrc/lombok_installer_WindowsDriveInfo.h b/winsrc/lombok_installer_WindowsDriveInfo.h new file mode 100644 index 00000000..3f6c28ff --- /dev/null +++ b/winsrc/lombok_installer_WindowsDriveInfo.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class lombok_installer_WindowsDriveInfo */ + +#ifndef _Included_lombok_installer_WindowsDriveInfo +#define _Included_lombok_installer_WindowsDriveInfo +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: lombok_installer_WindowsDriveInfo + * Method: getLogicalDrives0 + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_lombok_installer_WindowsDriveInfo_getLogicalDrives0 + (JNIEnv *, jobject); + +/* + * Class: lombok_installer_WindowsDriveInfo + * Method: getDriveType + * Signature: (Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_lombok_installer_WindowsDriveInfo_getDriveType + (JNIEnv *, jobject, jstring); + +#ifdef __cplusplus +} +#endif +#endif |