I am trying to call CreateFile()
on a symbolic link that is listed in WinObj under the GLOBAL??
namespace.
In WinObj, the name is:
\GLOBAL??\BTHENUM#{00001801-0000-1000-8000-00805f9b34fb}_VID&00010075_PID&0100#7&39ffa139&0&F0F56456EDD3_C00000000#{00001801-0000-1000-8000-00805f9b34fb}
where Type
is SymbolicLink and Symbolic Link Target
is \Device\00000275.
In the C++ code, pTCHARDevicePath_in
is:
\\?\BTHENUM#{00001801-0000-1000-8000-00805f9b34fb}_VID&00010075_PID&0100#7&39ffa139&0&F0F56456EDD3_C00000000#{00001801-0000-1000-8000-00805f9b34fb}
The C++ code is:
HANDLE l_HANDLE = CreateFile(
pTCHARDevicePath_in,
GENERIC_READ, // | GENERIC_WRITE,
FILE_SHARE_READ, // | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING, // OPEN_EXISTING,
0, // FILE_FLAG_OVERLAPPED,
NULL);
The call to CreateFile()
fails, and GetLastError()
returns 32, which is ERROR_NOT_SUPPORTED
('The request is not supported'), and l_HANDLE
is set to INVALID_HANDLE_VALUE
.
This code is to access a Bluetooth device (an Android phone), which is connected and paired to the Windows 10 computer where the code above is running.
I am trying to get the HANDLE
to the symbolic link above to be able to call the Win32 Bluetooth APIs, where each Bluetooth function requires a 'Handle to the service', which is supposed to come from the CreateFile()
that is failing.
I know this is a Device Interface. This code is running in user-mode (not kernel-mode), however.
The 1801 is a Bluetooth UUID for the 'Generic Attribute' BlueTooth service on the remote device (Android).
I need to use Win32 APIs (and not WinRT APIs) for this code.