Skip to content

Conversation

@eranl
Copy link
Contributor

@eranl eranl commented Oct 18, 2025

This is a partial mapping of WlanApi.h.

Copy link
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I made a first pass. Please have a look at the inline comments.

}

int WlanOpenHandle(int dwClientVersion, Pointer pReserved, IntByReference pdwNegotiatedVersion,
PointerByReference phClientHandle);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PointerByReference phClientHandle);
HANDLEByReference phClientHandle);

Comment on lines +37 to +40
@Override
protected List<String> getFieldOrder() {
return Arrays.asList("dwNumberOfItems", "dwIndex", "InterfaceInfo");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,188 @@
package com.sun.jna.platform.win32;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license header is missing (see for example

/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* The contents of this file is dual-licensed under 2
* alternative Open Source/Free licenses: LGPL 2.1 or later and
* Apache License 2.0. (starting with JNA version 4.0.0).
*
* You can freely decide which license you want to apply to
* the project.
*
* You may obtain a copy of the LGPL License at:
*
* http://www.gnu.org/licenses/licenses.html
*
* A copy is also included in the downloadable source code package
* containing JNA, in file "LGPL2.1".
*
* You may obtain a copy of the Apache License at:
*
* http://www.apache.org/licenses/
*
* A copy is also included in the downloadable source code package
* containing JNA, in file "AL2.0".
*/
)

class WLAN_INTERFACE_INFO extends Structure {
public GUID InterfaceGuid;
public char[] strInterfaceDescription = new char[WLAN_MAX_NAME_LENGTH];
public int isState; // WLAN_INTERFACE_STATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this javadoc, then people might see this in IDE help. I.e.:

        /**
         * See {@link WLAN_INTERFACE_STATE} for possible values
         */
        public int isState;

This applies to other similar constructs in here.

return Arrays.asList("dwNumberOfItems", "dwIndex", "InterfaceInfo");
}

public void read() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing @Override

public int wlanConnectionMode; // WLAN_CONNECTION_MODE
public char[] strProfileName = new char[WLAN_MAX_NAME_LENGTH];
public WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes;
// Other fields omitted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break hard, if there is ever a use in an array or embedded inside another structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it acceptable to just add a warning about this in the doc, or should I complete these structures?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If necessary I can live with a warning, on the other hand here is a single field missing which is admittedly a structure itself, but that is also not that big.

Comment on lines +134 to +143
class HANDLE extends WinNT.HANDLE {
public HANDLE() {
}

public HANDLE(Pointer p) {
super(p);
}
}

class GUID extends Guid.GUID {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These redefinitions are not necessary and should not be here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants