Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54112
-- v6: bluetoothapis: Add BluetoothUnregisterAuthentication stub. bluetoothapis: Add BluetoothRegisterForAuthenticationEx stub. include/bluetoothapis: Add BluetoothRegisterForAuthenticationEx prototype. bthprops.cpl: Move implementations to bluetoothapis and import them.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/bluetoothapis/Makefile.in | 3 +++ dlls/bluetoothapis/bluetoothapis.spec | 14 +++++++------- dlls/{bthprops.cpl => bluetoothapis}/main.c | 4 ++-- dlls/bthprops.cpl/Makefile.in | 6 ++---- dlls/bthprops.cpl/bthprops.cpl.spec | 14 +++++++------- dlls/irprops.cpl/Makefile.in | 3 ++- dlls/irprops.cpl/irprops.cpl.spec | 14 +++++++------- 7 files changed, 30 insertions(+), 28 deletions(-) rename dlls/{bthprops.cpl => bluetoothapis}/main.c (97%)
diff --git a/dlls/bluetoothapis/Makefile.in b/dlls/bluetoothapis/Makefile.in index 51b2871d81d..6c6a8215864 100644 --- a/dlls/bluetoothapis/Makefile.in +++ b/dlls/bluetoothapis/Makefile.in @@ -1,3 +1,6 @@ MODULE = bluetoothapis.dll
EXTRADLLFLAGS = -Wb,--prefer-native + +C_SRCS = \ + main.c diff --git a/dlls/bluetoothapis/bluetoothapis.spec b/dlls/bluetoothapis/bluetoothapis.spec index 39354b8c9a8..421934f6a71 100644 --- a/dlls/bluetoothapis/bluetoothapis.spec +++ b/dlls/bluetoothapis/bluetoothapis.spec @@ -7,28 +7,28 @@ @ stub BluetoothEnumerateLocalServices @ stub BluetoothFindBrowseGroupClose @ stub BluetoothFindClassIdClose -@ stub BluetoothFindDeviceClose +@ stdcall BluetoothFindDeviceClose(ptr) @ stub BluetoothFindFirstBrowseGroup @ stub BluetoothFindFirstClassId -@ stub BluetoothFindFirstDevice +@ stdcall BluetoothFindFirstDevice(ptr ptr) @ stub BluetoothFindFirstProfileDescriptor @ stub BluetoothFindFirstProtocolDescriptorStack @ stub BluetoothFindFirstProtocolEntry -@ stub BluetoothFindFirstRadio +@ stdcall BluetoothFindFirstRadio(ptr ptr) @ stub BluetoothFindFirstService @ stub BluetoothFindFirstServiceEx @ stub BluetoothFindNextBrowseGroup @ stub BluetoothFindNextClassId -@ stub BluetoothFindNextDevice +@ stdcall BluetoothFindNextDevice(ptr ptr) @ stub BluetoothFindNextProfileDescriptor @ stub BluetoothFindNextProtocolDescriptorStack @ stub BluetoothFindNextProtocolEntry -@ stub BluetoothFindNextRadio +@ stdcall BluetoothFindNextRadio(ptr ptr) @ stub BluetoothFindNextService @ stub BluetoothFindProfileDescriptorClose @ stub BluetoothFindProtocolDescriptorStackClose @ stub BluetoothFindProtocolEntryClose -@ stub BluetoothFindRadioClose +@ stdcall BluetoothFindRadioClose(ptr) @ stub BluetoothFindServiceClose @ stub BluetoothGATTAbortReliableWrite @ stub BluetoothGATTBeginReliableWrite @@ -45,7 +45,7 @@ @ stub BluetoothGATTUnregisterEvent @ stub BluetoothGetDeviceInfo @ stub BluetoothGetLocalServiceInfo -@ stub BluetoothGetRadioInfo +@ stdcall BluetoothGetRadioInfo(ptr ptr) @ stub BluetoothGetServicePnpInstance @ stub BluetoothIsConnectable @ stub BluetoothIsDiscoverable diff --git a/dlls/bthprops.cpl/main.c b/dlls/bluetoothapis/main.c similarity index 97% rename from dlls/bthprops.cpl/main.c rename to dlls/bluetoothapis/main.c index 2dcb18458b7..49a731b8522 100644 --- a/dlls/bthprops.cpl/main.c +++ b/dlls/bluetoothapis/main.c @@ -1,5 +1,5 @@ /* - * Bluetooth properties control panel + * Bluetooth APIs * * Copyright 2016 Austin English * @@ -27,7 +27,7 @@ #include "bthsdpdef.h" #include "bluetoothapis.h"
-WINE_DEFAULT_DEBUG_CHANNEL(bthpropscpl); +WINE_DEFAULT_DEBUG_CHANNEL(bluetoothapis);
/********************************************************************* * BluetoothFindFirstDevice diff --git a/dlls/bthprops.cpl/Makefile.in b/dlls/bthprops.cpl/Makefile.in index 41dc9dfdb98..e1a3936fde9 100644 --- a/dlls/bthprops.cpl/Makefile.in +++ b/dlls/bthprops.cpl/Makefile.in @@ -1,4 +1,2 @@ -MODULE = bthprops.cpl - -C_SRCS = \ - main.c +MODULE = bthprops.cpl +IMPORTS = bluetoothapis diff --git a/dlls/bthprops.cpl/bthprops.cpl.spec b/dlls/bthprops.cpl/bthprops.cpl.spec index 30b5bfa0040..ac9c2994337 100644 --- a/dlls/bthprops.cpl/bthprops.cpl.spec +++ b/dlls/bthprops.cpl/bthprops.cpl.spec @@ -11,31 +11,31 @@ @ stub BluetoothEnumerateInstalledServicesEx @ stub BluetoothFindBrowseGroupClose @ stub BluetoothFindClassIdClose -@ stdcall BluetoothFindDeviceClose(ptr) +@ stdcall -import BluetoothFindDeviceClose(ptr) @ stub BluetoothFindFirstBrowseGroup @ stub BluetoothFindFirstClassId -@ stdcall BluetoothFindFirstDevice(ptr ptr) +@ stdcall -import BluetoothFindFirstDevice(ptr ptr) @ stub BluetoothFindFirstProfileDescriptor @ stub BluetoothFindFirstProtocolDescriptorStack @ stub BluetoothFindFirstProtocolEntry -@ stdcall BluetoothFindFirstRadio(ptr ptr) +@ stdcall -import BluetoothFindFirstRadio(ptr ptr) @ stub BluetoothFindFirstService @ stub BluetoothFindFirstServiceEx @ stub BluetoothFindNextBrowseGroup @ stub BluetoothFindNextClassId -@ stdcall BluetoothFindNextDevice(ptr ptr) +@ stdcall -import BluetoothFindNextDevice(ptr ptr) @ stub BluetoothFindNextProfileDescriptor @ stub BluetoothFindNextProtocolDescriptorStack @ stub BluetoothFindNextProtocolEntry -@ stdcall BluetoothFindNextRadio(ptr ptr) +@ stdcall -import BluetoothFindNextRadio(ptr ptr) @ stub BluetoothFindNextService @ stub BluetoothFindProfileDescriptorClose @ stub BluetoothFindProtocolDescriptorStackClose @ stub BluetoothFindProtocolEntryClose -@ stdcall BluetoothFindRadioClose(ptr) +@ stdcall -import BluetoothFindRadioClose(ptr) @ stub BluetoothFindServiceClose @ stub BluetoothGetDeviceInfo -@ stdcall BluetoothGetRadioInfo(ptr ptr) +@ stdcall -import BluetoothGetRadioInfo(ptr ptr) @ stub BluetoothIsConnectable @ stub BluetoothIsDiscoverable @ stub BluetoothIsVersionAvailable diff --git a/dlls/irprops.cpl/Makefile.in b/dlls/irprops.cpl/Makefile.in index 7270ca32b83..89f72d17b0c 100644 --- a/dlls/irprops.cpl/Makefile.in +++ b/dlls/irprops.cpl/Makefile.in @@ -1 +1,2 @@ -MODULE = irprops.cpl +MODULE = irprops.cpl +IMPORTS = bluetoothapis diff --git a/dlls/irprops.cpl/irprops.cpl.spec b/dlls/irprops.cpl/irprops.cpl.spec index 252410f589f..8ca19fc9631 100644 --- a/dlls/irprops.cpl/irprops.cpl.spec +++ b/dlls/irprops.cpl/irprops.cpl.spec @@ -8,30 +8,30 @@ @ stub BluetoothEnumerateInstalledServices @ stub BluetoothFindBrowseGroupClose @ stub BluetoothFindClassIdClose -@ stdcall BluetoothFindDeviceClose(ptr) bthprops.cpl.BluetoothFindDeviceClose +@ stdcall -import BluetoothFindDeviceClose(ptr) @ stub BluetoothFindFirstBrowseGroup @ stub BluetoothFindFirstClassId -@ stdcall BluetoothFindFirstDevice(ptr ptr) bthprops.cpl.BluetoothFindFirstDevice +@ stdcall -import BluetoothFindFirstDevice(ptr ptr) @ stub BluetoothFindFirstProfileDescriptor @ stub BluetoothFindFirstProtocolDescriptorStack @ stub BluetoothFindFirstProtocolEntry -@ stdcall BluetoothFindFirstRadio(ptr ptr) bthprops.cpl.BluetoothFindFirstRadio +@ stdcall -import BluetoothFindFirstRadio(ptr ptr) @ stub BluetoothFindFirstService @ stub BluetoothFindNextBrowseGroup @ stub BluetoothFindNextClassId -@ stdcall BluetoothFindNextDevice(ptr ptr) bthprops.cpl.BluetoothFindNextDevice +@ stdcall -import BluetoothFindNextDevice(ptr ptr) @ stub BluetoothFindNextProfileDescriptor @ stub BluetoothFindNextProtocolDescriptorStack @ stub BluetoothFindNextProtocolEntry -@ stdcall BluetoothFindNextRadio(ptr ptr) bthprops.cpl.BluetoothFindNextRadio +@ stdcall -import BluetoothFindNextRadio(ptr ptr) @ stub BluetoothFindNextService @ stub BluetoothFindProfileDescriptorClose @ stub BluetoothFindProtocolDescriptorStackClose @ stub BluetoothFindProtocolEntryClose -@ stdcall BluetoothFindRadioClose(ptr) bthprops.cpl.BluetoothFindRadioClose +@ stdcall -import BluetoothFindRadioClose(ptr) @ stub BluetoothFindServiceClose @ stub BluetoothGetDeviceInfo -@ stdcall BluetoothGetRadioInfo(ptr ptr) bthprops.cpl.BluetoothGetRadioInfo +@ stdcall -import BluetoothGetRadioInfo(ptr ptr) @ stub BluetoothIsConnectable @ stub BluetoothIsDiscoverable @ stub BluetoothMapClassOfDeviceToImageIndex
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/bluetoothapis.h | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
diff --git a/include/bluetoothapis.h b/include/bluetoothapis.h index fd90b731bf9..1942513fab3 100644 --- a/include/bluetoothapis.h +++ b/include/bluetoothapis.h @@ -110,6 +110,49 @@ typedef struct _BLUETOOTH_SELECT_DEVICE_PARAMS {
typedef BOOL (WINAPI *PFN_AUTHENTICATION_CALLBACK)(void *, PBLUETOOTH_DEVICE_INFO);
+#define BLUETOOTH_DEVICE_INFO BLUETOOTH_DEVICE_INFO_STRUCT + +typedef BLUETOOTH_DEVICE_INFO *PBLUETOOTH_DEVICE_INFO; + +typedef enum _BLUETOOTH_AUTHENTICATION_METHOD { + BLUETOOTH_AUTHENTICATION_METHOD_LEGACY = 0x1, + BLUETOOTH_AUTHENTICATION_METHOD_OOB, + BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY_NOTIFICATION, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY, +} BLUETOOTH_AUTHENTICATION_METHOD, *PBLUETOOTH_AUTHENTICATION_METHOD; + +typedef enum _BLUETOOTH_IO_CAPABILITY { + BLUETOOTH_IO_CAPABILITY_DISPLAYONLY = 0x00, + BLUETOOTH_IO_CAPABILITY_DISPLAYYESNO = 0x01, + BLUETOOTH_IO_CAPABILITY_KEYBOARDONLY = 0x02, + BLUETOOTH_IO_CAPABILITY_NOINPUTNOOUTPUT = 0x03, + BLUETOOTH_IO_CAPABILITY_UNDEFINED = 0xff, +} BLUETOOTH_IO_CAPABILITY; + +typedef enum _BLUETOOTH_AUTHENTICATION_REQUIREMENTS{ + BLUETOOTH_MITM_ProtectionNotRequired = 0, + BLUETOOTH_MITM_ProtectionRequired = 0x1, + BLUETOOTH_MITM_ProtectionNotRequiredBonding = 0x2, + BLUETOOTH_MITM_ProtectionRequiredBonding = 0x3, + BLUETOOTH_MITM_ProtectionNotRequiredGeneralBonding = 0x4, + BLUETOOTH_MITM_ProtectionRequiredGeneralBonding = 0x5, + BLUETOOTH_MITM_ProtectionNotDefined = 0xff, +} BLUETOOTH_AUTHENTICATION_REQUIREMENTS; + +typedef struct _BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS { + BLUETOOTH_DEVICE_INFO deviceInfo; + BLUETOOTH_AUTHENTICATION_METHOD authenticationMethod; + BLUETOOTH_IO_CAPABILITY ioCapability; + BLUETOOTH_AUTHENTICATION_REQUIREMENTS authenticationRequirements; + union{ + ULONG Numeric_Value; + ULONG Passkey; + }; +} BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, *PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS; + +typedef BOOL (CALLBACK *PFN_AUTHENTICATION_CALLBACK_EX)(void *, BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS *); + typedef struct _SDP_ELEMENT_DATA { SDP_TYPE type; SDP_SPECIFICTYPE specificType; @@ -183,6 +226,7 @@ DWORD WINAPI BluetoothGetRadioInfo(HANDLE, PBLUETOOTH_RADIO_INFO); BOOL WINAPI BluetoothIsConnectable(HANDLE); BOOL WINAPI BluetoothIsDiscoverable(HANDLE); DWORD WINAPI BluetoothRegisterForAuthentication(BLUETOOTH_DEVICE_INFO *, HBLUETOOTH_AUTHENTICATION_REGISTRATION *, PFN_AUTHENTICATION_CALLBACK, void *); +DWORD WINAPI BluetoothRegisterForAuthenticationEx(const BLUETOOTH_DEVICE_INFO *, HBLUETOOTH_AUTHENTICATION_REGISTRATION *, PFN_AUTHENTICATION_CALLBACK_EX, void *); DWORD WINAPI BluetoothRemoveDevice(BLUETOOTH_ADDRESS *); #define BluetoothEnumAttributes BluetoothSdpEnumAttributes BOOL WINAPI BluetoothSdpEnumAttributes(BYTE *, ULONG, PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK, void *);
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54112 --- dlls/bluetoothapis/bluetoothapis.spec | 2 +- dlls/bluetoothapis/main.c | 10 ++++++++++ dlls/bthprops.cpl/bthprops.cpl.spec | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/bluetoothapis/bluetoothapis.spec b/dlls/bluetoothapis/bluetoothapis.spec index 421934f6a71..f6fc3142d76 100644 --- a/dlls/bluetoothapis/bluetoothapis.spec +++ b/dlls/bluetoothapis/bluetoothapis.spec @@ -51,7 +51,7 @@ @ stub BluetoothIsDiscoverable @ stub BluetoothIsVersionAvailable @ stub BluetoothRegisterForAuthentication -@ stub BluetoothRegisterForAuthenticationEx +@ stdcall BluetoothRegisterForAuthenticationEx(ptr ptr ptr ptr) @ stub BluetoothRemoveDevice @ stub BluetoothSdpEnumAttributes @ stub BluetoothSdpGetAttributeValue diff --git a/dlls/bluetoothapis/main.c b/dlls/bluetoothapis/main.c index 49a731b8522..f16357559e4 100644 --- a/dlls/bluetoothapis/main.c +++ b/dlls/bluetoothapis/main.c @@ -99,3 +99,13 @@ BOOL WINAPI BluetoothFindNextDevice(HBLUETOOTH_DEVICE_FIND find, BLUETOOTH_DEVIC SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/********************************************************************* + * BluetoothRegisterForAuthenticationEx + */ +DWORD WINAPI BluetoothRegisterForAuthenticationEx(const BLUETOOTH_DEVICE_INFO *info, HBLUETOOTH_AUTHENTICATION_REGISTRATION *out, + PFN_AUTHENTICATION_CALLBACK_EX callback, void *param) +{ + FIXME("(%p, %p, %p, %p): stub!\n", info, out, callback, param); + return ERROR_CALL_NOT_IMPLEMENTED; +} diff --git a/dlls/bthprops.cpl/bthprops.cpl.spec b/dlls/bthprops.cpl/bthprops.cpl.spec index ac9c2994337..3a5d9ef622c 100644 --- a/dlls/bthprops.cpl/bthprops.cpl.spec +++ b/dlls/bthprops.cpl/bthprops.cpl.spec @@ -42,7 +42,7 @@ @ stub BluetoothMapClassOfDeviceToImageIndex @ stub BluetoothMapClassOfDeviceToString @ stub BluetoothRegisterForAuthentication -@ stub BluetoothRegisterForAuthenticationEx +@ stdcall -import BluetoothRegisterForAuthenticationEx(ptr ptr ptr ptr) @ stub BluetoothRemoveDevice @ stub BluetoothSdpEnumAttributes @ stub BluetoothSdpGetAttributeValue
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/bluetoothapis/bluetoothapis.spec | 2 +- dlls/bluetoothapis/main.c | 10 ++++++++++ dlls/bthprops.cpl/bthprops.cpl.spec | 2 +- dlls/irprops.cpl/irprops.cpl.spec | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/bluetoothapis/bluetoothapis.spec b/dlls/bluetoothapis/bluetoothapis.spec index f6fc3142d76..625dffb8254 100644 --- a/dlls/bluetoothapis/bluetoothapis.spec +++ b/dlls/bluetoothapis/bluetoothapis.spec @@ -63,7 +63,7 @@ @ stub BluetoothSetLocalServiceInfo @ stub BluetoothSetServiceState @ stub BluetoothSetServiceStateEx -@ stub BluetoothUnregisterAuthentication +@ stdcall BluetoothUnregisterAuthentication(long) @ stub BluetoothUpdateDeviceRecord @ stub BthpCheckForUnsupportedGuid @ stub BthpCleanupBRDeviceNode diff --git a/dlls/bluetoothapis/main.c b/dlls/bluetoothapis/main.c index f16357559e4..5d9087a9a47 100644 --- a/dlls/bluetoothapis/main.c +++ b/dlls/bluetoothapis/main.c @@ -109,3 +109,13 @@ DWORD WINAPI BluetoothRegisterForAuthenticationEx(const BLUETOOTH_DEVICE_INFO *i FIXME("(%p, %p, %p, %p): stub!\n", info, out, callback, param); return ERROR_CALL_NOT_IMPLEMENTED; } + +/********************************************************************* + * BluetoothUnregisterAuthentication + */ +BOOL WINAPI BluetoothUnregisterAuthentication(HBLUETOOTH_AUTHENTICATION_REGISTRATION handle) +{ + FIXME("(%p): stub!\n", handle); + if (!handle) SetLastError(ERROR_INVALID_HANDLE); + return FALSE; +} diff --git a/dlls/bthprops.cpl/bthprops.cpl.spec b/dlls/bthprops.cpl/bthprops.cpl.spec index 3a5d9ef622c..1698344581e 100644 --- a/dlls/bthprops.cpl/bthprops.cpl.spec +++ b/dlls/bthprops.cpl/bthprops.cpl.spec @@ -55,7 +55,7 @@ @ stub BluetoothSendAuthenticationResponseEx @ stub BluetoothSetLocalServiceInfo @ stub BluetoothSetServiceState -@ stub BluetoothUnregisterAuthentication +@ stdcall -import BluetoothUnregisterAuthentication(long) @ stub BluetoothUpdateDeviceRecord @ stub BthpEnableAllServices @ stub BthpFindPnpInfo diff --git a/dlls/irprops.cpl/irprops.cpl.spec b/dlls/irprops.cpl/irprops.cpl.spec index 8ca19fc9631..b2bdf3c3b2a 100644 --- a/dlls/irprops.cpl/irprops.cpl.spec +++ b/dlls/irprops.cpl/irprops.cpl.spec @@ -47,6 +47,6 @@ @ stub BluetoothSelectDevicesFree @ stub BluetoothSendAuthenticationResponse @ stub BluetoothSetServiceState -@ stub BluetoothUnregisterAuthentication +@ stdcall -import BluetoothUnregisterAuthentication(long) @ stub BluetoothUpdateDeviceRecord #@ stub CPlApplet
On Fri Feb 17 12:48:28 2023 +0000, Huw Davies wrote:
This will break `bthprops.cpl` (and `irprops.cpl`) after this commit - they need to be kept working after every commit.
I added the import commits separately for clearer documentation. Just curious why this matters? It's not breaking tests. I guess it's to allow for clean reverts in the future?
Huw Davies (@huw) commented about dlls/bluetoothapis/Makefile.in:
MODULE = bluetoothapis.dll
```suggestion:-0+0 IMPORTLIB = bluetoothapis ```
Not sure how this is building successfully otherwise.