From 1767989bd18686357b99040c6d8a2d1cc41d9562 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 13 Nov 2006 16:35:09 +0900 Subject: [PATCH] msi: Fail if we can't write out a temporary file. --- dlls/msi/custom.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index 841e4632d48..18a830413ae 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -528,11 +528,13 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, 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(MSIPACKAGE *package, LPCWSTR source, { 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(MSIPACKAGE *package, LPCWSTR source, 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(MSIPACKAGE *package, LPCWSTR source, if (deformated) len += strlenW(deformated); - + cmd = msi_alloc(sizeof(WCHAR)*len); strcpyW(cmd,tmp_file); @@ -605,15 +609,15 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, } 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,