static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
+ static const WCHAR user_printers_reg_key[] = { 'S','o','f','t','w','a','r','e','\\',
+ 'M','i','c','r','o','s','o','f','t','\\',
+ 'W','i','n','d','o','w','s',' ','N','T','\\',
+ 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
+ 'D','e','v','i','c','e','s',0};
static const WCHAR empty_strW[] = { 0 };
WCHAR *p;
+ HKEY hKey;
/* display is a special case */
if (!strcmpiW( device, displayW ) ||
return TRUE;
}
- size = GetProfileStringW(devicesW, device, empty_strW, driver, size);
- if(!size) {
+ if (!RegOpenKeyExW(HKEY_CURRENT_USER, user_printers_reg_key, 0, KEY_READ, &hKey)
+ && !RegQueryValueExW(hKey, device, NULL, NULL, (LPBYTE) driver, &size))
+ {
+ TRACE("Get value from registry\n");
+ RegCloseKey(hKey);
+ }
+ else if (!GetProfileStringW(devicesW, device, empty_strW, driver, size))
+ {
WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
return FALSE;
}