Commit 18c51208 authored by Alexandre Julliard's avatar Alexandre Julliard

wow64win: Add the infrastructure for wrapping the win32u syscall table.

parent 33e99ce5
MODULE = win32u.dll
IMPORTLIB = win32u
IMPORTS = ntdll winecrt0
EXTRALIBS = -Wl,--subsystem,unixlib
......
MODULE = wow64win.dll
IMPORTS = win32u ntdll winecrt0
EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f200000
C_SRCS = \
syscall.c
/*
* 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;
}
/*
* 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 */
#@ extern sdwhcon
#@ extern sdwhwin32
@ extern sdwhwin32
/*
* 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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment