Huw Davies : localspl: Have GetPrinterDriverDirectory create the driver directory.
Alexandre Julliard
julliard at winehq.org
Thu Jun 14 15:31:30 CDT 2012
Module: wine
Branch: master
Commit: 69164eac3e50caf82863a401bba8497412993675
URL: http://source.winehq.org/git/wine.git/?a=commit;h=69164eac3e50caf82863a401bba8497412993675
Author: Huw Davies <huw at codeweavers.com>
Date: Thu Jun 14 15:31:38 2012 +0100
localspl: Have GetPrinterDriverDirectory create the driver directory.
This is needed so that during wineprefix creation, winspool.drv can succeed in printer initialisation.
---
dlls/localspl/provider.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
index 4a6e2d2..0c12a0e 100644
--- a/dlls/localspl/provider.c
+++ b/dlls/localspl/provider.c
@@ -140,7 +140,8 @@ static const WCHAR printersW[] = {'S','y','s','t','e','m','\\',
'C','o','n','t','r','o','l','\\',
'P','r','i','n','t','\\',
'P','r','i','n','t','e','r','s',0};
-static const WCHAR spooldriversW[] = {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\',0};
+static const WCHAR spoolW[] = {'\\','s','p','o','o','l',0};
+static const WCHAR driversW[] = {'\\','d','r','i','v','e','r','s','\\',0};
static const WCHAR spoolprtprocsW[] = {'\\','s','p','o','o','l','\\','p','r','t','p','r','o','c','s','\\',0};
static const WCHAR version0_regpathW[] = {'\\','V','e','r','s','i','o','n','-','0',0};
static const WCHAR version0_subdirW[] = {'\\','0',0};
@@ -1077,7 +1078,8 @@ static BOOL WINAPI fpGetPrinterDriverDirectory(LPWSTR pName, LPWSTR pEnvironment
/* GetSystemDirectoryW returns number of WCHAR including the '\0' */
needed = GetSystemDirectoryW(NULL, 0);
/* add the Size for the Subdirectories */
- needed += lstrlenW(spooldriversW);
+ needed += lstrlenW(spoolW);
+ needed += lstrlenW(driversW);
needed += lstrlenW(env->subdir);
needed *= sizeof(WCHAR); /* return-value is size in Bytes */
@@ -1096,8 +1098,12 @@ static BOOL WINAPI fpGetPrinterDriverDirectory(LPWSTR pName, LPWSTR pEnvironment
GetSystemDirectoryW( dir, cbBuf / sizeof(WCHAR) );
/* add the Subdirectories */
- lstrcatW( dir, spooldriversW );
+ lstrcatW( dir, spoolW );
+ CreateDirectoryW( dir, NULL );
+ lstrcatW( dir, driversW );
+ CreateDirectoryW( dir, NULL );
lstrcatW( dir, env->subdir );
+ CreateDirectoryW( dir, NULL );
TRACE( "=> %s\n", debugstr_w( dir ) );
return TRUE;
More information about the wine-cvs
mailing list