winspool: (EnumPorts #1) Read Driver from registry

Detlef Riekenberg wine.dev at web.de
Fri Nov 3 17:26:20 CST 2006


"localspl.dll" reached a state that allow us to use the
implemented Functions from other dlls.

After this set of Patches, "winspool.drv,EnumPortsW/A" is implemented 
(with tests) and use all installed Printmonitors.

Visible results for the Propsheet-Page "Ports" in printui.dll (native):
(13kb): http://www.myimg.de/?img=portsinprintuid05.png

"AddPort", "ConfigurePort" and "DeletePort" for winspool.drv 
are also "Ready to send" and gave us an working "Ports"-Page for

rundll32.exe printui.dll,PrintUIEntry /s


The Ports for the CUPS/LPR-Printers are not visible yet, because
they where never created. ("LoadSystemPrinters()" uses only AddPrinter)
This issue will be fixed, when the CUPS/LPR-Handling is moving 
to "localspl.dll"



Changelog:
 winspool: (EnumPorts #1) Read Driver from registry


-- 
 
By by ... Detlef

-------------- next part --------------
>From 3fd2453f6af3bdfb9d5903048624c17edcff29c2 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Fri, 3 Nov 2006 22:37:10 +0100
Subject: [PATCH] winspool: (EnumPorts #1) Read Driver from registry
---
 dlls/winspool.drv/info.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index ced6498..1c2ac1b 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -915,6 +915,18 @@ static monitor_t * monitor_load(LPWSTR n
             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);
-- 
1.4.1



More information about the wine-patches mailing list