Mike McCormack : msi: Fail if we can't write out a temporary file.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 13 06:38:32 CST 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Mon Nov 13 16:35:09 2006 +0900

msi: Fail if we can't write out a temporary file.

---

 dlls/msi/custom.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 841e463..18a8304 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -528,11 +528,13 @@ static UINT HANDLE_CustomType1(MSIPACKAG
                                LPCWSTR target, const INT type, LPCWSTR action)
 {
     WCHAR tmp_file[MAX_PATH];
-    UINT rc = ERROR_SUCCESS;
+    UINT r = ERROR_SUCCESS;
     BOOL finished = FALSE;
     HANDLE ThreadHandle;
 
-    store_binary_to_temp(package, source, tmp_file);
+    r = store_binary_to_temp(package, source, tmp_file);
+    if (r != ERROR_SUCCESS)
+        return r;
 
     TRACE("Calling function %s from %s\n",debugstr_w(target),
           debugstr_w(tmp_file));
@@ -541,18 +543,18 @@ static UINT HANDLE_CustomType1(MSIPACKAG
     {
         static const WCHAR dot[]={'.',0};
         strcatW(tmp_file,dot);
-    } 
+    }
 
     ThreadHandle = do_msidbCustomActionTypeDll( package, tmp_file, target );
 
-    rc = process_handle(package, type, ThreadHandle, NULL, action, &finished );
+    r = process_handle(package, type, ThreadHandle, NULL, action, &finished );
 
     if (!finished)
         track_tempfile(package, tmp_file, tmp_file);
     else
         DeleteFileW(tmp_file);
 
-    return rc;
+    return r;
 }
 
 static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, 
@@ -566,12 +568,14 @@ static UINT HANDLE_CustomType2(MSIPACKAG
     WCHAR *deformated;
     WCHAR *cmd;
     static const WCHAR spc[] = {' ',0};
-    UINT prc = ERROR_SUCCESS;
+    UINT r = ERROR_SUCCESS;
     BOOL finished = FALSE;
 
     memset(&si,0,sizeof(STARTUPINFOW));
 
-    store_binary_to_temp(package, source, tmp_file);
+    r = store_binary_to_temp(package, source, tmp_file);
+    if (r != ERROR_SUCCESS)
+        return r;
 
     deformat_string(package,target,&deformated);
 
@@ -579,7 +583,7 @@ static UINT HANDLE_CustomType2(MSIPACKAG
 
     if (deformated)
         len += strlenW(deformated);
-   
+
     cmd = msi_alloc(sizeof(WCHAR)*len);
 
     strcpyW(cmd,tmp_file);
@@ -605,15 +609,15 @@ static UINT HANDLE_CustomType2(MSIPACKAG
     }
     msi_free(cmd);
 
-    prc = process_handle(package, type, info.hThread, info.hProcess, action, 
+    r = process_handle(package, type, info.hThread, info.hProcess, action,
                           &finished);
 
     if (!finished)
         track_tempfile(package, tmp_file, tmp_file);
     else
         DeleteFileW(tmp_file);
-    
-    return prc;
+
+    return r;
 }
 
 static UINT HANDLE_CustomType17(MSIPACKAGE *package, LPCWSTR source,




More information about the wine-cvs mailing list