Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=10106 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index de0dd4e4554..4c8f657f50b 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -565,6 +565,7 @@ HKLM,%CurrentVersionNT%\FontSubstitutes,,16 HKLM,%CurrentVersionNT%\Gre_Initialize,,16 HKLM,%CurrentVersionNT%\Hotfix\Q246009,"Installed",,"1" HKLM,%CurrentVersionNT%\Image File Execution Options,,16 +HKLM,%CurrentVersionNT%\IniFileMapping\win.ini\windows,"CursorBlinkRate",,"USR:Control Panel\Desktop" HKLM,%CurrentVersionNT%\LanguagePack,,16 HKLM,%CurrentVersionNT%\NetworkCards,,16 HKLM,%CurrentVersionNT%\OpenGLDrivers,,16
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 4c8f657f50b..23b91af4805 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -565,6 +565,7 @@ HKLM,%CurrentVersionNT%\FontSubstitutes,,16 HKLM,%CurrentVersionNT%\Gre_Initialize,,16 HKLM,%CurrentVersionNT%\Hotfix\Q246009,"Installed",,"1" HKLM,%CurrentVersionNT%\Image File Execution Options,,16 +HKLM,%CurrentVersionNT%\IniFileMapping\win.ini\windows,,,"USR:Software\Microsoft\Windows NT\CurrentVersion\Windows" HKLM,%CurrentVersionNT%\IniFileMapping\win.ini\windows,"CursorBlinkRate",,"USR:Control Panel\Desktop" HKLM,%CurrentVersionNT%\LanguagePack,,16 HKLM,%CurrentVersionNT%\NetworkCards,,16
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winspool.drv/info.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 1a8d572f43d..d46fefc461d 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -555,30 +555,19 @@ static DWORD WINSPOOL_GetOpenedPrinterRegKey(HANDLE hPrinter, HKEY *phkey) return open_printer_reg_key( name, phkey ); }
-static void -WINSPOOL_SetDefaultPrinter(const char *devname, const char *name, BOOL force) { - char qbuf[200]; +static void set_default_printer(const char *devname, const char *name) +{ + char *buf = HeapAlloc(GetProcessHeap(), 0, strlen(name)+strlen(devname)+strlen(",WINEPS.DRV,LPR:")+1); + HKEY hkey;
- /* If forcing, or no profile string entry for device yet, set the entry - * - * The always change entry if not WINEPS yet is discussable. - */ - if (force || - !GetProfileStringA("windows","device","*",qbuf,sizeof(qbuf)) || - !strcmp(qbuf,"*") || - !strstr(qbuf,"WINEPS.DRV") - ) { - char *buf = HeapAlloc(GetProcessHeap(),0,strlen(name)+strlen(devname)+strlen(",WINEPS.DRV,LPR:")+1); - HKEY hkey; - - sprintf(buf,"%s,WINEPS.DRV,LPR:%s",devname,name); - WriteProfileStringA("windows","device",buf); - if(RegCreateKeyW(HKEY_CURRENT_USER, user_default_reg_key, &hkey) == ERROR_SUCCESS) { - RegSetValueExA(hkey, "Device", 0, REG_SZ, (LPBYTE)buf, strlen(buf) + 1); - RegCloseKey(hkey); - } - HeapFree(GetProcessHeap(),0,buf); + sprintf(buf, "%s,WINEPS.DRV,LPR:%s", devname, name); + WriteProfileStringA("windows","device", buf); + if (!RegCreateKeyW(HKEY_CURRENT_USER, user_default_reg_key, &hkey)) + { + RegSetValueExA(hkey, "Device", 0, REG_SZ, (BYTE *)buf, strlen(buf) + 1); + RegCloseKey(hkey); } + HeapFree(GetProcessHeap(), 0, buf); }
static BOOL add_printer_driver(const WCHAR *name, WCHAR *ppd) @@ -1273,7 +1262,7 @@ static BOOL PRINTCAP_ParseEntry( const char *pent, BOOL isfirst ) }
if (isfirst || set_default) - WINSPOOL_SetDefaultPrinter(devname,name,TRUE); + set_default_printer(devname, name);
end: if (hkeyPrinters) RegCloseKey( hkeyPrinters );
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winspool.drv/info.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index d46fefc461d..07398966e7b 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -561,7 +561,6 @@ static void set_default_printer(const char *devname, const char *name) HKEY hkey;
sprintf(buf, "%s,WINEPS.DRV,LPR:%s", devname, name); - WriteProfileStringA("windows","device", buf); if (!RegCreateKeyW(HKEY_CURRENT_USER, user_default_reg_key, &hkey)) { RegSetValueExA(hkey, "Device", 0, REG_SZ, (BYTE *)buf, strlen(buf) + 1); @@ -3445,7 +3444,6 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
if (GetDefaultPrinterW( def, &size ) && !strcmpW( def, lpNameW )) { - WriteProfileStringW( windowsW, deviceW, NULL ); if (!RegCreateKeyW( HKEY_CURRENT_USER, user_default_reg_key, &hkey )) { RegDeleteValueW( hkey, deviceW ); @@ -6078,20 +6076,12 @@ BOOL WINAPI SetDefaultPrinterW(LPCWSTR pszPrinter) size = ((MAX_PATH * 2) + 2) * sizeof(WCHAR); /* driver,port and a 0 */ lres = RegQueryValueExW(hreg, pszPrinter, NULL, NULL, (LPBYTE) (&buffer[namelen]), &size); if (!lres) { - TRACE("set device to %s\n", debugstr_w(buffer)); + HKEY hdev;
- if (!WriteProfileStringW(windowsW, deviceW, buffer)) { - TRACE("failed to set the device entry: %d\n", GetLastError()); - lres = ERROR_INVALID_PRINTER_NAME; - } - - /* remove the next section, when INIFileMapping is implemented */ + if (!RegCreateKeyW(HKEY_CURRENT_USER, user_default_reg_key, &hdev)) { - HKEY hdev; - if (!RegCreateKeyW(HKEY_CURRENT_USER, user_default_reg_key, &hdev)) { - RegSetValueExW(hdev, deviceW, 0, REG_SZ, (LPBYTE)buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR)); - RegCloseKey(hdev); - } + RegSetValueExW(hdev, deviceW, 0, REG_SZ, (BYTE *)buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR)); + RegCloseKey(hdev); } } else
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- loader/wine.inf.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 23b91af4805..65b224c37fd 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -565,6 +565,7 @@ HKLM,%CurrentVersionNT%\FontSubstitutes,,16 HKLM,%CurrentVersionNT%\Gre_Initialize,,16 HKLM,%CurrentVersionNT%\Hotfix\Q246009,"Installed",,"1" HKLM,%CurrentVersionNT%\Image File Execution Options,,16 +HKLM,%CurrentVersionNT%\IniFileMapping\win.ini,"devices",,"USR:Software\Microsoft\Windows NT\CurrentVersion\Devices" HKLM,%CurrentVersionNT%\IniFileMapping\win.ini\windows,,,"USR:Software\Microsoft\Windows NT\CurrentVersion\Windows" HKLM,%CurrentVersionNT%\IniFileMapping\win.ini\windows,"CursorBlinkRate",,"USR:Control Panel\Desktop" HKLM,%CurrentVersionNT%\LanguagePack,,16
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winspool.drv/info.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 07398966e7b..f9c10f3de1a 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -270,7 +270,6 @@ static const WCHAR txTimeoutW[] = {'t','x','T','i','m','e','o','u','t',0}; static const WCHAR UntilTimeW[] = {'U','n','t','i','l','T','i','m','e',0}; static WCHAR WinPrintW[] = {'W','i','n','P','r','i','n','t',0}; static const WCHAR deviceW[] = {'d','e','v','i','c','e',0}; -static const WCHAR devicesW[] = {'d','e','v','i','c','e','s',0}; static const WCHAR windowsW[] = {'w','i','n','d','o','w','s',0}; static WCHAR rawW[] = {'R','A','W',0}; static WCHAR driver_9x[] = {'w','i','n','e','p','s','1','6','.','d','r','v',0}; @@ -3165,7 +3164,6 @@ static void set_devices_and_printerports(PRINTER_INFO_2W *pi) lstrcatW(devline, pi->pPortName);
TRACE("using %s\n", debugstr_w(devline)); - WriteProfileStringW(devicesW, pi->pPrinterName, devline); if (!RegCreateKeyW(HKEY_CURRENT_USER, user_printers_reg_key, &hkey)) { RegSetValueExW(hkey, pi->pPrinterName, 0, REG_SZ, (LPBYTE)devline, (lstrlenW(devline) + 1) * sizeof(WCHAR)); @@ -3429,7 +3427,6 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter) RegDeleteTreeW(hkeyPrinters, lpNameW); RegCloseKey(hkeyPrinters); } - WriteProfileStringW(devicesW, lpNameW, NULL); WriteProfileStringW(PrinterPortsW, lpNameW, NULL);
if(RegCreateKeyW(HKEY_CURRENT_USER, user_printers_reg_key, &hkey) == ERROR_SUCCESS) {
Signed-off-by: Huw Davies huw@codeweavers.com