mirror of
https://gitlab.com/Monsterovich/lanemu.git
synced 2024-07-07 06:01:16 +02:00
Use full comparison when searching for a tap driver
This commit is contained in:
parent
fdc2532aee
commit
6101c61988
|
@ -31,9 +31,9 @@
|
|||
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
||||
#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
||||
#ifdef USE_TAPV9
|
||||
#define TAP_COMPONENT_ID_PREFIX "root\\tap0901"
|
||||
#define TAP_COMPONENT_ID "root\\tap0901"
|
||||
#else
|
||||
#define TAP_COMPONENT_ID_PREFIX "tap"
|
||||
#define TAP_COMPONENT_ID "tapoas"
|
||||
#endif
|
||||
|
||||
#define USERMODEDEVICEDIR "\\\\.\\Global\\"
|
||||
|
@ -98,8 +98,7 @@ int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceN
|
|||
|
||||
len = sizeof(componentId);
|
||||
status = RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len);
|
||||
if (status == ERROR_SUCCESS &&
|
||||
strncmp(componentId, TAP_COMPONENT_ID_PREFIX, strlen(TAP_COMPONENT_ID_PREFIX)) == 0) {
|
||||
if (status == ERROR_SUCCESS && strcmp(componentId, TAP_COMPONENT_ID) == 0) {
|
||||
if (skip < 1) {
|
||||
len = deviceIDLen;
|
||||
RegQueryValueEx(key, "NetCfgInstanceId", NULL, NULL, deviceID, &len);
|
||||
|
|
Loading…
Reference in a new issue