setupx.dll16: Handle the error case for VCPM_VSTATWRITE in vcpUICallbackProc16. (RESEND)

Gerald Pfeifer gerald at pfeifer.com
Sat Sep 4 17:46:06 CDT 2010


Just realized I did not see a response to this patch.  Based on
feedback I received for a different patch, I looked at this patch
again and believe it indeed is easier.

 1. We only set, but never used cbres, so removing it loses nothing.
 2. With this patch we now set the return value to VCPN_FAIL in this
    case.  However, this is not the only case in vcpUICallbackProc16;
    for example, in another case in this function we pass the return
    value of VCP_UI_CopyStart and that returns VCPN_FAIL all over the
    place.

If there is concrete guidance on how I should adjust this patch, I will
of course make changes.

Gerald

---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To: wine-patches at winehq.org
Date: Sat, 22 May 2010 19:25:20
Subject: setupx.dll16: Handle the error case for VCPM_VSTATWRITE in
    vcpUICallbackProc16.

This is an easier one, I believe, since we already return values
different from VCPN_OK in two cases here, so callers already need
to be prepared.

(If you want to be more cautious in terms of minimizing change,
just removing cbres would be a smaller fix.)

Gerald
---
 dlls/setupx.dll16/virtcopy.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/setupx.dll16/virtcopy.c b/dlls/setupx.dll16/virtcopy.c
index d9cdf54..81ff0c2 100644
--- a/dlls/setupx.dll16/virtcopy.c
+++ b/dlls/setupx.dll16/virtcopy.c
@@ -674,7 +674,7 @@ RETERR16 WINAPI vcpUICallbackProc16(LPVOID lpvObj, UINT16 uMsg, WPARAM wParam,
 					LPARAM lParam, LPARAM lParamRef)
 {
     static int count = 0;
-    RETERR16 res = VCPN_OK, cbres;
+    RETERR16 res = VCPN_OK;
 
     if (count < 5)
         FIXME("(%p, %04x, %04lx, %08lx, %08lx) - semi-stub\n",
@@ -704,7 +704,9 @@ RETERR16 WINAPI vcpUICallbackProc16(LPVOID lpvObj, UINT16 uMsg, WPARAM wParam,
 	case VCPM_VSTATREAD:
 	    break;
 	case VCPM_VSTATWRITE:
-	    cbres = VCP_Callback(&vcp_status, VCPM_DISKPREPINFO, 0, 0, VCP_MsgRef);
+	    if( ! VCP_Callback(&vcp_status, VCPM_DISKPREPINFO, 0, 0,
+	                       VCP_MsgRef) )
+		res = VCPN_FAIL;
 	    break;
 	case VCPM_VSTATCLOSEEND:
 	    RegCloseKey(hKeyFiles);
-- 
1.6.6.2



More information about the wine-patches mailing list