-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Regression #668
Comments
Further investigation reveals its just the structure members. I can keep the function signatures as String. |
You should be able to have the default w32 type mapping handle those, maybe On Wednesday, June 1, 2016, Adam Marcionek [email protected] wrote:
|
Bingo. I moved the definition of NETRESOURCE out of Winnetwk.java and into Mpr.Java where the instance uses W32APIOptions.DEFAULT_OPTIONS, changed the structures back to String and it works now. There is no INSTANCE in Winnetwk becasue its not a DLL and so Native.loadLibrary wouldn't make sense. Is this the fix or is there another way to keep those in Winnetwk since that is JNA best practice? I'm happy to move those structures into the relevant DLL files if so. Update: Also, if I go ahead and make this change, should I only move the structures that are at issue or all of them? E.g. NETRESOURCE is the only one I would move. Same is true for SHARE_INFO_* structures in LMShare, I would move them to NetApi32. |
Winnetwk definitions follow the typemapper set by the "w32.ascii" property, following the convention demonstrated/used in W32APIOptions.DEFAULT. The definitions in LMShare are defined as pure UNICODE. Closes: java-native-access#668
My analysis: by default java string is mapped to char_, but the Win32 functions expect wchar_ (always or depending on calling style selected by w32.ascii). When a struct field is declared as WString the mapping is fixed to wchar* and it works (as long as the unicode variants of functions are invoced). The PR is not yet complete - I'll have to look through the over files touched by #541, to adjust all structures, affected in the same way. |
Winnetwk definitions follow the typemapper set by the "w32.ascii" property, following the convention demonstrated/used in W32APIOptions.DEFAULT. The definitions in LMShare are defined as pure UNICODE. Closes: java-native-access#668
Winnetwk definitions follow the typemapper set by the "w32.ascii" property, following the convention demonstrated/used in W32APIOptions.DEFAULT. The definitions in LMShare are defined as pure UNICODE. Closes: java-native-access#668
Winnetwk definitions follow the typemapper set by the "w32.ascii" property, following the convention demonstrated/used in W32APIOptions.DEFAULT. The definitions in LMShare are defined as pure UNICODE. Closes: java-native-access#668
Prepared next RC.
java-native-access#668) … a queue to make debugging leaks easier Motivation: We should touch our messages when we take over ownership, this allows easier debugging of buffer leaks. Modifications: Let's add touch call before enqueue into internal datastructure Result: Easier to debug buffer leaks
Testing the latest tip of master and found some issues with a few of the platform related functions. Specifically, there were a number of functions I added back in November in #532. All of the MPR functions and some of the security functions aren't working. I noticed they were modified in #541. Likely the cause is the change to String from WString. So I changed a few of the structs back to WString and retested all of MPR with success.
Testing this on Windows 10 and Server 2012 R2.
The text was updated successfully, but these errors were encountered: