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

This commit is contained in:
Mikołaj Zalewski 2007-08-14 11:47:56 -07:00 committed by Alexandre Julliard
parent 380f184986
commit 7e79b5656e
1 changed files with 11 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "windef.h" #include "windef.h"
@ -587,9 +588,19 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
{ {
EXCEPTION_REGISTRATION_RECORD frame; EXCEPTION_REGISTRATION_RECORD frame;
frame.Handler = vm86_handler; frame.Handler = vm86_handler;
errno = 0;
__wine_push_frame( &frame ); __wine_push_frame( &frame );
__wine_enter_vm86( context ); __wine_enter_vm86( context );
__wine_pop_frame( &frame ); __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 else
{ {