Skip to content

Wrong parameter type in Mpr WNetUseConnection #1010

@nsprljan

Description

@nsprljan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions