[winspool 1/6] Move WINSPOOL_OpenDriverReg higher so it can be used without prototype earlier.

Jeremy White jwhite at codeweavers.com
Wed Dec 23 14:20:31 CST 2009


---
 dlls/winspool.drv/info.c |   64 +++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 4993a78..312150c 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -382,6 +382,38 @@ WINSPOOL_SetDefaultPrinter(const char *devname, const char *name, BOOL force) {
     }
 }
 
+/*****************************************************************************
+ *          WINSPOOL_OpenDriverReg [internal]
+ *
+ * opens the registry for the printer drivers depending on the given input
+ * variable pEnvironment
+ *
+ * RETURNS:
+ *    the opened hkey on success
+ *    NULL on error
+ */
+static HKEY WINSPOOL_OpenDriverReg( LPCVOID pEnvironment)
+{
+    HKEY  retval = NULL;
+    LPWSTR buffer;
+    const printenv_t * env;
+
+    TRACE("(%s)\n", debugstr_w(pEnvironment));
+
+    env = validate_envW(pEnvironment);
+    if (!env) return NULL;
+
+    buffer = HeapAlloc( GetProcessHeap(), 0,
+                (strlenW(DriversW) + strlenW(env->envname) +
+                 strlenW(env->versionregpath) + 1) * sizeof(WCHAR));
+    if(buffer) {
+        wsprintfW(buffer, DriversW, env->envname, env->versionregpath);
+        RegCreateKeyW(HKEY_LOCAL_MACHINE, buffer, &retval);
+        HeapFree(GetProcessHeap(), 0, buffer);
+    }
+    return retval;
+}
+
 static BOOL add_printer_driver(const char *name)
 {
     DRIVER_INFO_3A di3a;
@@ -2409,38 +2441,6 @@ BOOL WINAPI GetPrintProcessorDirectoryW(LPWSTR server, LPWSTR env,
 }
 
 /*****************************************************************************
- *          WINSPOOL_OpenDriverReg [internal]
- *
- * opens the registry for the printer drivers depending on the given input
- * variable pEnvironment
- *
- * RETURNS:
- *    the opened hkey on success
- *    NULL on error
- */
-static HKEY WINSPOOL_OpenDriverReg( LPCVOID pEnvironment)
-{   
-    HKEY  retval = NULL;
-    LPWSTR buffer;
-    const printenv_t * env;
-
-    TRACE("(%s)\n", debugstr_w(pEnvironment));
-
-    env = validate_envW(pEnvironment);
-    if (!env) return NULL;
-
-    buffer = HeapAlloc( GetProcessHeap(), 0,
-                (strlenW(DriversW) + strlenW(env->envname) + 
-                 strlenW(env->versionregpath) + 1) * sizeof(WCHAR));
-    if(buffer) {
-        wsprintfW(buffer, DriversW, env->envname, env->versionregpath);
-        RegCreateKeyW(HKEY_LOCAL_MACHINE, buffer, &retval);
-        HeapFree(GetProcessHeap(), 0, buffer);
-    }
-    return retval;
-}
-
-/*****************************************************************************
  *          AddPrinterW  [WINSPOOL.@]
  */
 HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)



More information about the wine-patches mailing list