setupx.dll16: Fix error handling in VCP_VirtnodeCreate.

Gerald Pfeifer gerald at pfeifer.com
Wed May 5 17:10:00 CDT 2010


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