wow64win: Add the infrastructure for wrapping the win32u syscall table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
33e99ce5f7
commit
18c512089e
|
@ -1,4 +1,5 @@
|
|||
MODULE = win32u.dll
|
||||
IMPORTLIB = win32u
|
||||
IMPORTS = ntdll winecrt0
|
||||
EXTRALIBS = -Wl,--subsystem,unixlib
|
||||
|
||||
|
|
|
@ -1 +1,7 @@
|
|||
MODULE = wow64win.dll
|
||||
IMPORTS = win32u ntdll winecrt0
|
||||
|
||||
EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f200000
|
||||
|
||||
C_SRCS = \
|
||||
syscall.c
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* WoW64 syscall wrapping
|
||||
*
|
||||
* Copyright 2021 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "ntstatus.h"
|
||||
#define WIN32_NO_STATUS
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnt.h"
|
||||
#include "winternl.h"
|
||||
#include "wow64win_private.h"
|
||||
|
||||
extern BOOL WINAPI NtGdiFlush(void);
|
||||
|
||||
NTSTATUS WINAPI wow64_NtGdiFlush( UINT *args )
|
||||
{
|
||||
return NtGdiFlush();
|
||||
}
|
||||
|
||||
static void * const win32_syscalls[] =
|
||||
{
|
||||
#define SYSCALL_ENTRY(func) wow64_ ## func,
|
||||
ALL_WIN32_SYSCALLS
|
||||
#undef SYSCALL_ENTRY
|
||||
};
|
||||
|
||||
static const char * const win32_syscall_names[] =
|
||||
{
|
||||
#define SYSCALL_ENTRY(func) #func,
|
||||
ALL_WIN32_SYSCALLS
|
||||
#undef SYSCALL_ENTRY
|
||||
};
|
||||
|
||||
SYSTEM_SERVICE_TABLE sdwhwin32 =
|
||||
{
|
||||
(ULONG_PTR *)win32_syscalls,
|
||||
(ULONG_PTR *)win32_syscall_names,
|
||||
ARRAY_SIZE(win32_syscalls),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
|
||||
return TRUE;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* WoW64 USER32 syscall definitions
|
||||
*
|
||||
* Copyright 2021 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __WOW64WIN_SYSCALL_H
|
||||
#define __WOW64WIN_SYSCALL_H
|
||||
|
||||
#define ALL_WIN32_SYSCALLS \
|
||||
SYSCALL_ENTRY( NtGdiFlush )
|
||||
|
||||
#endif /* __WOW64WIN_SYSCALL_H */
|
|
@ -1,2 +1,2 @@
|
|||
#@ extern sdwhcon
|
||||
#@ extern sdwhwin32
|
||||
@ extern sdwhwin32
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* WoW64 private definitions
|
||||
*
|
||||
* Copyright 2021 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __WOW64WIN_PRIVATE_H
|
||||
#define __WOW64WIN_PRIVATE_H
|
||||
|
||||
#include "syscall.h"
|
||||
|
||||
#define SYSCALL_ENTRY(func) extern NTSTATUS WINAPI wow64_ ## func( UINT *args ) DECLSPEC_HIDDEN;
|
||||
ALL_WIN32_SYSCALLS
|
||||
#undef SYSCALL_ENTRY
|
||||
|
||||
#endif /* __WOW64WIN_PRIVATE_H */
|
Loading…
Reference in New Issue