I use JNA 4.3.0, but use of Mpr lib should be the same in the latest.
The following function:
WNetUseConnection(HWND hwndOwner, NETRESOURCE lpNETRESOURCE, String lpPassword, String lpUserID, int dwFlags, PointerByReference lpAccessName, IntByReference lpBufferSize, IntByReference lpResult);
has PointerByReference type used for parameter lpAccessName, but it seems to me it should be char[].
MSDN WNetUseConnection() has it as LPSTR lpAccessName
In my implementation only char[] works, while PointerByReference does not (getValue().getString(0)). I guess there could be some way to dance around the returned PointerByReference to get the string out of it, but I haven't found it.
I use JNA 4.3.0, but use of Mpr lib should be the same in the latest.
The following function:
WNetUseConnection(HWND hwndOwner, NETRESOURCE lpNETRESOURCE, String lpPassword, String lpUserID, int dwFlags, PointerByReference lpAccessName, IntByReference lpBufferSize, IntByReference lpResult);has
PointerByReferencetype used for parameterlpAccessName, but it seems to me it should bechar[].MSDN WNetUseConnection() has it as
LPSTR lpAccessNameIn my implementation only char[] works, while PointerByReference does not (getValue().getString(0)). I guess there could be some way to dance around the returned PointerByReference to get the string out of it, but I haven't found it.