8 messages in net.java.dev.jna.usersRe: [jna-users] call to a native Win3...
FromSent OnAttachments
lemmel lemmelJun 3, 2009 8:09 am 
Timothy WallJun 3, 2009 9:02 am 
lemmel lemmelJun 4, 2009 2:10 am 
Timothy WallJun 4, 2009 3:30 am 
lemmel lemmelJun 4, 2009 6:04 am 
lemmel lemmelJun 5, 2009 1:34 am 
lemmel lemmelJun 5, 2009 1:55 am 
lemmelJun 8, 2009 6:26 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] call to a native Win32 function behave randomlyActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jun 3, 2009 9:02:29 am
List:net.java.dev.jna.users

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)); } }