Skip to content
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

PFAX_ROUTING_INSTALLATION_CALLBACKW should take PWSTR instead of PCWSTR #1843

Closed
fnetz opened this issue Feb 4, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@fnetz
Copy link

fnetz commented Feb 4, 2024

Summary

The last four parameters are "out" LPWSTR parameters according to the API doc, and probably shouldn't be PCWSTR.

This seems Rust specific, for example the Python and Beef libraries do use PWSTR.

Crate manifest

[dependencies]
windows = { version = "0.52.0", features = ["Win32_Foundation", "Win32_Devices_Fax"] }

Crate code

extern "system" fn register_callback(
    fax_handle: HANDLE,
    context: *mut c_void,
    method_name_out: PCWSTR,
    friendly_name_out: PCWSTR,
    function_name_out: PCWSTR,
    guid_out: PCWSTR,
) -> BOOL {
    // The callback is supposed to write to method_name_out, etc.
}

FaxRegisterRoutingExtensionW(handle, extension_name, friendly_name, image_name, Some(register_callback), context);
@fnetz fnetz added the bug Something isn't working label Feb 4, 2024
@kennykerr
Copy link
Contributor

Looks like these are in/out parameters but the Win32 metadata is indicating they are in-only.

typedef BOOL
(CALLBACK *PFAX_ROUTING_INSTALLATION_CALLBACKW)(
    IN HANDLE FaxHandle,
    IN LPVOID Context,
    IN OUT LPWSTR MethodName,
    IN OUT LPWSTR FriendlyName,
    IN OUT LPWSTR FunctionName,
    IN OUT LPWSTR Guid
    );

Will transfer for consideration.

@kennykerr kennykerr transferred this issue from microsoft/windows-rs Feb 4, 2024
@mikebattista mikebattista self-assigned this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants