setupx.dll16: Fix error handling in VCP_VirtnodeCreate. (RETRY)

Gerald Pfeifer gerald at pfeifer.com
Sun May 16 15:53:20 CDT 2010


This was not applied and I also did not see any feedback (and even
checked the list archives) so I am resending it.

Gerald

---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To: wine-patches at winehq.org
Date: Thu, 6 May 2010 00:10:00
Subject: setupx.dll16: Fix error handling in VCP_VirtnodeCreate.

Something definitely is not right with the code as it is right now,
and the below is my attempt to clean up the error handling (instead
of always returning OK and ignore the result of VCP_Callback).

If this is not quite right, expert help is very welcome. :-)

Gerald

---
 dlls/setupx.dll16/virtcopy.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/setupx.dll16/virtcopy.c b/dlls/setupx.dll16/virtcopy.c
index a15f1a1..d9cdf54 100644
--- a/dlls/setupx.dll16/virtcopy.c
+++ b/dlls/setupx.dll16/virtcopy.c
@@ -211,7 +211,7 @@ static RETERR16 VCP_VirtnodeCreate(const VCPFILESPEC *vfsSrc, const VCPFILESPEC
 {
     HANDLE heap;
     LPVIRTNODE lpvn;
-    RETERR16 cbres;
+    RETERR16 res;
 
     while (vn_last < vn_num)
     {
@@ -248,11 +248,15 @@ static RETERR16 VCP_VirtnodeCreate(const VCPFILESPEC *vfsSrc, const VCPFILESPEC
 
     lpvn->vhstrDstFinalName = 0xffff; /* FIXME: what is this ? */
 
-    cbres = VCP_Callback(lpvn, VCPM_NODECREATE, 0, 0, VCP_MsgRef);
+    res = VCP_Callback(lpvn, VCPM_NODECREATE, 0, 0, VCP_MsgRef);
+    if( res != OK )
+        goto End;
+
     lpvn->fl |= VFNL_CREATED;
-    cbres = VCP_Callback(lpvn, VCPM_NODEACCEPT, 0, 0, VCP_MsgRef);
+    res = VCP_Callback(lpvn, VCPM_NODEACCEPT, 0, 0, VCP_MsgRef);
 
-    return OK;
+End:
+    return res;
 }
 
 /***********************************************************************
-- 
1.6.6.2



More information about the wine-patches mailing list