How can we parse
RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&000f\\9&3408FE52&0&646E6C00E02E_C00000000\\Device Parameters", 0, KEY_QUERY_VALUE, &hKey) )
so that we can use it for each GUID (traversing available guid to DeviceParameters )
SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\[GUID1...x]\\[Somenumber]\\DeviceParameters
Currently i am able to do it for single hard coded GUID value but GUID may differ machine to machine so i want to make it dynamic GUID parsing.
LPCTSTR const lpValueName = L"PortName";
HKEY hKey = NULL;
if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&000f\\9&3408FE52&0&646E6C00E02E_C00000000\\Device Parameters", 0, KEY_QUERY_VALUE, &hKey) )
return 1;
DWORD dwDataType = 0;
LPBYTE lpValue = NULL;
RegQueryValueEx( hKey,
lpValueName,
0,
&dwDataType,
lpValue,
&dwSize);
lpValue = (LPBYTE)malloc(dwSize);
int lRet = RegQueryValueEx(hKey,
lpValueName,
0,
&dwDataType,
lpValue,
&dwSize);
RegCloseKey(hKey);
Thanks in advance :)