DWORD NameLength;
HRESULT Result;
+ Log("====>");
+
Success = GetNetLuid(Address, &NetLuid);
if (!Success)
goto fail1;
goto fail8;
}
- Log("%s", *Name);
-
done:
+ Log("%s", (*Name == NULL) ? "[NONE]" : *Name);
+
+ Log("<====");
+
return TRUE;
fail8:
goto fail3;
}
- Log("Checking %s", *SubKeyName);
-
if (Match(Key, *SubKeyName, Argument))
goto done;
}
return FALSE;
}
+typedef struct _DEVICE_WALK {
+ PTCHAR Driver;
+ PTCHAR Device;
+ PTCHAR Instance;
+} DEVICE_WALK, *PDEVICE_WALK;
+
static BOOLEAN
IsInstance(
- IN HKEY Key,
- IN PTCHAR SubKeyName,
- IN PVOID Argument
+ IN HKEY Key,
+ IN PTCHAR SubKeyName,
+ IN PVOID Argument
)
{
- PTCHAR Name = Argument;
- HKEY SubKey;
- HRESULT Error;
- DWORD MaxValueLength;
- DWORD DriverLength;
- PTCHAR Driver;
- DWORD Type;
+ PDEVICE_WALK Walk = Argument;
+ HKEY SubKey;
+ HRESULT Error;
+ DWORD MaxValueLength;
+ DWORD DriverLength;
+ PTCHAR Driver;
+ DWORD Type;
+
+ Log("====> (%s)", SubKeyName);
Error = RegOpenKeyEx(Key,
SubKeyName,
goto fail5;
}
- if (strncmp(Driver, Name, DriverLength) != 0) {
+ if (strncmp(Driver, Walk->Driver, DriverLength) != 0) {
SetLastError(ERROR_FILE_NOT_FOUND);
goto fail6;
}
free(Driver);
+ Log("<====");
+
return TRUE;
fail6:
return FALSE;
}
-typedef struct _DEVICE_WALK {
- PTCHAR Driver;
- PTCHAR Device;
- PTCHAR Instance;
-} DEVICE_WALK, *PDEVICE_WALK;
-
static BOOLEAN
IsDevice(
IN HKEY Key,
HRESULT Error;
HKEY SubKey;
+ Log("====> (%s)", SubKeyName);
+
Error = RegOpenKeyEx(Key,
SubKeyName,
0,
if (!WalkSubKeys(SubKey,
IsInstance,
- Walk->Driver,
+ Walk,
&Walk->Instance)) {
SetLastError(ERROR_FILE_NOT_FOUND);
goto fail2;
}
+ Log("<====");
+
return TRUE;
fail2:
if (!FindAliasSoftwareKeyName(Address, &SoftwareKeyName))
goto fail1;
+ *Name = NULL;
+
+ if (SoftwareKeyName == NULL)
+ goto done;
+
Walk.Driver = SoftwareKeyName;
Success = OpenEnumKey("PCI", &PciKey);
free(SoftwareKeyName);
- Log("%s", *Name);
+done:
+ Log("%s", (*Name == NULL) ? "[NONE]" : *Name);
Log("<====");