ReactOS 0.4.16-dev-2491-g3dc6630
main.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <winreg.h>
#include "wine/debug.h"
#include "bthsdpdef.h"
#include "bluetoothapis.h"
#include "setupapi.h"
#include "initguid.h"
#include "bthdef.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  bluetooth_find_radio_handle
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (bluetoothapis)
 
HBLUETOOTH_DEVICE_FIND WINAPI BluetoothFindFirstDevice (BLUETOOTH_DEVICE_SEARCH_PARAMS *params, BLUETOOTH_DEVICE_INFO *info)
 
HBLUETOOTH_RADIO_FIND WINAPI BluetoothFindFirstRadio (BLUETOOTH_FIND_RADIO_PARAMS *params, HANDLE *radio)
 
BOOL WINAPI BluetoothFindRadioClose (HBLUETOOTH_RADIO_FIND find_handle)
 
BOOL WINAPI BluetoothFindDeviceClose (HBLUETOOTH_DEVICE_FIND find)
 
BOOL WINAPI BluetoothFindNextRadio (HBLUETOOTH_RADIO_FIND find_handle, HANDLE *radio)
 
DWORD WINAPI BluetoothGetRadioInfo (HANDLE radio, PBLUETOOTH_RADIO_INFO info)
 
BOOL WINAPI BluetoothFindNextDevice (HBLUETOOTH_DEVICE_FIND find, BLUETOOTH_DEVICE_INFO *info)
 
DWORD WINAPI BluetoothRegisterForAuthenticationEx (const BLUETOOTH_DEVICE_INFO *info, HBLUETOOTH_AUTHENTICATION_REGISTRATION *out, PFN_AUTHENTICATION_CALLBACK_EX callback, void *param)
 
BOOL WINAPI BluetoothUnregisterAuthentication (HBLUETOOTH_AUTHENTICATION_REGISTRATION handle)
 

Function Documentation

◆ BluetoothFindDeviceClose()

BOOL WINAPI BluetoothFindDeviceClose ( HBLUETOOTH_DEVICE_FIND  find)

Definition at line 126 of file main.c.

127{
128 FIXME("(%p): stub!\n", find);
130 return FALSE;
131}
#define FIXME(fmt,...)
Definition: precomp.h:53
static TAGID TAGID find
Definition: db.cpp:156
#define FALSE
Definition: types.h:117
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752

◆ BluetoothFindFirstDevice()

HBLUETOOTH_DEVICE_FIND WINAPI BluetoothFindFirstDevice ( BLUETOOTH_DEVICE_SEARCH_PARAMS params,
BLUETOOTH_DEVICE_INFO info 
)

Definition at line 47 of file main.c.

49{
50 FIXME("(%p %p): stub!\n", params, info);
52 return NULL;
53}
#define NULL
Definition: types.h:112
GLenum const GLfloat * params
Definition: glext.h:5645

◆ BluetoothFindFirstRadio()

HBLUETOOTH_RADIO_FIND WINAPI BluetoothFindFirstRadio ( BLUETOOTH_FIND_RADIO_PARAMS params,
HANDLE radio 
)

Definition at line 58 of file main.c.

59{
61 HANDLE device_ret;
62 DWORD err;
63
64 TRACE( "(%p, %p)\n", params, radio );
65
66 if (!params)
67 {
69 return NULL;
70 }
71 if (params->dwSize != sizeof( *params ))
72 {
74 return NULL;
75 }
76 if (!(find = calloc( 1, sizeof( *find ) )))
77 {
79 return NULL;
80 }
81
82 find->devinfo = SetupDiGetClassDevsW( &GUID_BTHPORT_DEVICE_INTERFACE, NULL, NULL,
84 if (find->devinfo == INVALID_HANDLE_VALUE)
85 {
86 free( find );
87 return NULL;
88 }
89
90 if (BluetoothFindNextRadio( find, &device_ret ))
91 {
92 *radio = device_ret;
93 return find;
94 }
95
96 err = GetLastError();
99 return NULL;
100}
#define free
Definition: debug_ros.c:5
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
BOOL WINAPI BluetoothFindRadioClose(HBLUETOOTH_RADIO_FIND find_handle)
Definition: main.c:105
BOOL WINAPI BluetoothFindNextRadio(HBLUETOOTH_RADIO_FIND find_handle, HANDLE *radio)
Definition: main.c:136
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
unsigned long DWORD
Definition: ntddk_ex.h:95
#define err(...)
#define calloc
Definition: rosglue.h:14
#define DIGCF_DEVICEINTERFACE
Definition: setupapi.h:175
#define DIGCF_PRESENT
Definition: setupapi.h:172
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_REVISION_MISMATCH
Definition: winerror.h:1133

◆ BluetoothFindNextDevice()

BOOL WINAPI BluetoothFindNextDevice ( HBLUETOOTH_DEVICE_FIND  find,
BLUETOOTH_DEVICE_INFO info 
)

Definition at line 189 of file main.c.

190{
191 FIXME("(%p, %p): stub!\n", find, info);
193 return FALSE;
194}

◆ BluetoothFindNextRadio()

BOOL WINAPI BluetoothFindNextRadio ( HBLUETOOTH_RADIO_FIND  find_handle,
HANDLE radio 
)

Definition at line 136 of file main.c.

137{
138 char buffer[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W) + MAX_PATH * sizeof( WCHAR )];
141 SP_DEVICE_INTERFACE_DATA iface_data;
142 HANDLE device_ret;
143 BOOL found;
144
145 TRACE( "(%p, %p)\n", find_handle, radio );
146
147 if (!find_handle)
148 {
150 return FALSE;
151 }
152
153 iface_detail->cbSize = sizeof( *iface_detail );
154 iface_data.cbSize = sizeof( iface_data );
155 found = FALSE;
156 while (SetupDiEnumDeviceInterfaces( find->devinfo, NULL, &GUID_BTHPORT_DEVICE_INTERFACE, find->idx++,
157 &iface_data ))
158 {
159 if (!SetupDiGetDeviceInterfaceDetailW( find->devinfo, &iface_data, iface_detail, sizeof( buffer ), NULL,
160 NULL ))
161 continue;
162 device_ret = CreateFileW( iface_detail->DevicePath, GENERIC_READ | GENERIC_WRITE,
164 if (device_ret != INVALID_HANDLE_VALUE)
165 {
166 found = TRUE;
167 break;
168 }
169 }
170
171 if (found)
172 *radio = device_ret;
173
174 return found;
175}
#define TRUE
Definition: types.h:120
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define CreateFileW
Definition: compat.h:741
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:2780
BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:3011
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint buffer
Definition: glext.h:5915
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA_W
WCHAR DevicePath[ANYSIZE_ARRAY]
Definition: setupapi.h:856
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by BluetoothFindFirstRadio().

◆ BluetoothFindRadioClose()

BOOL WINAPI BluetoothFindRadioClose ( HBLUETOOTH_RADIO_FIND  find_handle)

Definition at line 105 of file main.c.

106{
108
109 TRACE( "(%p)\n", find_handle );
110
111 if (!find_handle)
112 {
114 return FALSE;
115 }
116
118 free( find );
120 return TRUE;
121}
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893

Referenced by BluetoothFindFirstRadio().

◆ BluetoothGetRadioInfo()

DWORD WINAPI BluetoothGetRadioInfo ( HANDLE  radio,
PBLUETOOTH_RADIO_INFO  info 
)

Definition at line 180 of file main.c.

181{
182 FIXME("(%p, %p): stub!\n", radio, info);
184}

◆ BluetoothRegisterForAuthenticationEx()

DWORD WINAPI BluetoothRegisterForAuthenticationEx ( const BLUETOOTH_DEVICE_INFO info,
HBLUETOOTH_AUTHENTICATION_REGISTRATION out,
PFN_AUTHENTICATION_CALLBACK_EX  callback,
void param 
)

Definition at line 199 of file main.c.

201{
202 FIXME("(%p, %p, %p, %p): stub!\n", info, out, callback, param);
204}
GLfloat param
Definition: glext.h:5796
static IPrintDialogCallback callback
Definition: printdlg.c:326
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

◆ BluetoothUnregisterAuthentication()

BOOL WINAPI BluetoothUnregisterAuthentication ( HBLUETOOTH_AUTHENTICATION_REGISTRATION  handle)

Definition at line 209 of file main.c.

210{
211 FIXME("(%p): stub!\n", handle);
213 return FALSE;
214}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( bluetoothapis  )