Alexandre Julliard : comctl32: Create the manifest directory if needed ( spotted by Dan Kegel).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 20 07:42:43 CDT 2007


Module: wine
Branch: master
Commit: 4bac1e959dc6a88192abb11ea2aa9cdee1a79b56
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4bac1e959dc6a88192abb11ea2aa9cdee1a79b56

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Aug 20 12:46:37 2007 +0200

comctl32: Create the manifest directory if needed (spotted by Dan Kegel).

---

 dlls/comctl32/commctrl.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index ea42db8..0f8ad19 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -145,7 +145,8 @@ static const WCHAR strCC32SubclassInfo[] = {
 
 static BOOL create_manifest( BOOL install )
 {
-    static const WCHAR dirW[] = {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s','\\',0};
+    static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s',0};
+    static const WCHAR manifestsW[] = {'\\','m','a','n','i','f','e','s','t','s','\\',0};
 
     DWORD len, written;
     WCHAR *buffer;
@@ -154,10 +155,14 @@ static BOOL create_manifest( BOOL install )
 
     len = MultiByteToWideChar( CP_UTF8, 0, manifest_filename, sizeof(manifest_filename), NULL, 0 );
     len += GetWindowsDirectoryW( NULL, 0 );
-    len = len * sizeof(WCHAR) + sizeof(dirW);
-    if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE;
+    len += lstrlenW(winsxsW);
+    len += lstrlenW(manifestsW);
+    if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return FALSE;
     GetWindowsDirectoryW( buffer, len );
-    lstrcatW( buffer, dirW );
+    lstrcatW( buffer, winsxsW );
+    CreateDirectoryW( buffer, NULL );
+    lstrcatW( buffer, manifestsW );
+    CreateDirectoryW( buffer, NULL );
     MultiByteToWideChar( CP_UTF8, 0, manifest_filename, sizeof(manifest_filename),
                          buffer + lstrlenW(buffer), len );
     if (install)




More information about the wine-cvs mailing list