If the call is blocking, get a stack dump and see where it's
blocking. You can also put jnidispatch.dll in your PATH, which will
prevent JNA from unpacking the one in the jna.jar file (which might
trigger virus checkers and such).
I'd recommend trying the code on a different system, to eliminate
system configuration issues from the equation.
On Jun 3, 2009, at 11:10 AM, lemmel lemmel wrote:
// documentation available at
// http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx
int SHGetSpecialFolderPathA(Pointer hwndOwner,
byte[] lpszPath,
int csidl,
int fCreate);
int SHGetFolderPathA(Pointer hwndOwner,
int nFolder,
Pointer hToken,
int dwFlags,
byte[] pszPath);
public static void main(String[] args) {
byte buffer[] = new byte[3072];
Shell32 shell32 = Shell32.INSTANCE;
// I already tried
// with a buffer filled with 0
for(int i = 0; i < 3072; i++)
buffer[i] = 65;
if (Platform.isWindows()) {
int retour =
shell32.SHGetSpecialFolderPathA(Pointer.NULL,
buffer,
16, 0);
System.out.println("value : "+Native.toString(buffer));
}
}