localspl: Have GetPrinterDriverDirectory create the driver directory.

This is needed so that during wineprefix creation, winspool.drv can succeed in printer initialisation.
This commit is contained in:
Huw Davies 2012-06-14 15:31:38 +01:00 committed by Alexandre Julliard
parent bf263a347d
commit 69164eac3e
1 changed files with 9 additions and 3 deletions

View File

@ -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;