winspool: EnumPorts: Read driver from registry.

This commit is contained in:
Detlef Riekenberg 2006-11-04 00:26:20 +01:00 committed by Alexandre Julliard
parent 54fd8b3d14
commit 0bd336a573
1 changed files with 12 additions and 0 deletions

View File

@ -915,6 +915,18 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname)
lstrcpyW(regroot, MonitorsW);
lstrcatW(regroot, name);
/* Get the Driver from the Registry */
if (driver == NULL) {
HKEY hroot;
DWORD namesize;
if (RegOpenKeyW(HKEY_LOCAL_MACHINE, regroot, &hroot) == ERROR_SUCCESS) {
if (RegQueryValueExW(hroot, DriverW, NULL, NULL, NULL,
&namesize) == ERROR_SUCCESS) {
driver = HeapAlloc(GetProcessHeap(), 0, namesize);
RegQueryValueExW(hroot, DriverW, NULL, NULL, (LPBYTE) driver, &namesize) ;
}
RegCloseKey(hroot);
}
}
}
pm->name = strdupW(name);