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

Bug: BluetoothFindFirstDevice return value differs from MSDN doc #1507

Closed
levigross opened this issue Mar 22, 2023 · 10 comments
Closed

Bug: BluetoothFindFirstDevice return value differs from MSDN doc #1507

levigross opened this issue Mar 22, 2023 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@levigross
Copy link

Which crate is this about?

windows

Crate version

0.46.0

Summary

Hello,

Sorry if this isn't an issue and I just don't understand the windows API (thanks in advance for your patience and help)

The function BluetoothFindFirstDevice is declared as:

pub unsafe fn BluetoothFindFirstDevice( pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi: *mut BLUETOOTH_DEVICE_INFO ) -> isize

Source: https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Devices/Bluetooth/fn.BluetoothFindFirstDevice.html

In MSDN it is listed as:

HBLUETOOTH_DEVICE_FIND BluetoothFindFirstDevice(
  const BLUETOOTH_DEVICE_SEARCH_PARAMS *pbtsp,
  BLUETOOTH_DEVICE_INFO                *pbtdi
);

https://learn.microsoft.com/en-us/windows/win32/api/bluetoothapis/nf-bluetoothapis-bluetoothfindfirstdevice

I think this is a bug, because that function should return HBLUETOOTH_DEVICE_FIND

Toolchain version/configuration

rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\user.rustup

stable-x86_64-pc-windows-msvc (default)
rustc 1.68.0 (2c8cc3432 2023-03-06)

Reproducible example

No response

Crate manifest

No response

Expected behavior

BluetoothFindFirstDevice returns HBLUETOOTH_DEVICE_FIND

Actual behavior

BluetoothFindFirstDevice returns isize

Additional comments

No response

@levigross levigross added the bug Something isn't working label Mar 22, 2023
@levigross levigross changed the title Bug: Bug: BluetoothFindFirstDevice return value differs from MSDN doc Mar 22, 2023
@kennykerr
Copy link
Contributor

Looks like the metadata is missing the handle type mapping. Will transfer to the Win32 metadata repo for resolution.

@kennykerr kennykerr transferred this issue from microsoft/windows-rs Mar 22, 2023
@mikebattista mikebattista self-assigned this Mar 22, 2023
@levigross
Copy link
Author

Wow! Thanks for the amazing and fast turn around!!

Final question: when will this be released into the windows rust crate?

@kennykerr
Copy link
Contributor

I can ingest it into the windows-rs repo as soon as there's another release of the Win32 metadata.

@levigross
Copy link
Author

@kennykerr I really hope I am not bothering you. I really appreciate your hard work and don't want to be a nuisance.

I believe that there was another release of win32metadata: https://github.com/microsoft/win32metadata/releases/tag/v47.0.26-preview . As I only see preview releases I am wondering if this release qualifies.

Thanks!

@kennykerr
Copy link
Contributor

No worries, I tried picking up that release but there were a few regressions that prevented me from upgrading. I've requested another release as the issues I uncovered have been resolved.

cc @mikebattista

@mikebattista
Copy link
Contributor

Which regressions? There's only 1 change really since v47 and that was an updated fix to an API that was already broken.

@kennykerr
Copy link
Contributor

I think the outstanding fix was #1509.

@mikebattista
Copy link
Contributor

Right but weren't those APIs broken before the partial fix?

@kennykerr
Copy link
Contributor

@levigross ok, was able to ingest the latest version here: microsoft/windows-rs#2400

@levigross
Copy link
Author

Thanks 😊

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