Commit 0bd336a5 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

winspool: EnumPorts: Read driver from registry.

parent 54fd8b3d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment