Mikołaj Zalewski : kernel32: Return error code if WOWCallback16Ex of a real-mode function failed.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 15 04:34:20 CDT 2007


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

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Tue Aug 14 11:47:56 2007 -0700

kernel32: Return error code if WOWCallback16Ex of a real-mode function failed.

---

 dlls/kernel32/wowthunk.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/wowthunk.c b/dlls/kernel32/wowthunk.c
index 4f714ab..2ccfddf 100644
--- a/dlls/kernel32/wowthunk.c
+++ b/dlls/kernel32/wowthunk.c
@@ -23,6 +23,7 @@
 
 #include <assert.h>
 #include <stdarg.h>
+#include <errno.h>
 
 #include "wine/winbase16.h"
 #include "windef.h"
@@ -587,9 +588,19 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
         {
             EXCEPTION_REGISTRATION_RECORD frame;
             frame.Handler = vm86_handler;
+            errno = 0;
             __wine_push_frame( &frame );
             __wine_enter_vm86( context );
             __wine_pop_frame( &frame );
+            if (errno != 0)  /* enter_vm86 will fall with ENOSYS on x64 kernels */
+            {
+                ERR("__wine_enter_vm86 failed (errno=%d)\n", errno);
+                if (errno == ENOSYS)
+                    SetLastError(ERROR_NOT_SUPPORTED);
+                else
+                    SetLastError(ERROR_GEN_FAILURE);
+                return FALSE;
+            }
         }
         else
         {




More information about the wine-cvs mailing list