include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / win32u / syscall.c
blobc03118821d9f95b81acd00c2dbd03a091cd374dc
1 /*
2 * Unix interface for Win32 syscalls
4 * Copyright (C) 2021 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #if 0
22 #pragma makedep unix
23 #endif
25 #include <stdarg.h>
27 #include "ntstatus.h"
28 #define WIN32_NO_STATUS
29 #include "windef.h"
30 #include "winnt.h"
31 #include "ntgdi_private.h"
32 #include "ntuser_private.h"
33 #include "ntuser.h"
34 #include "wine/unixlib.h"
35 #include "win32syscalls.h"
37 ULONG_PTR zero_bits = 0;
39 static ULONG_PTR syscalls[] =
41 #define SYSCALL_ENTRY(id,name,args) (ULONG_PTR)name,
42 #ifdef _WIN64
43 ALL_SYSCALLS64
44 #else
45 ALL_SYSCALLS32
46 #endif
47 #undef SYSCALL_ENTRY
50 static BYTE arguments[ARRAY_SIZE(syscalls)] =
52 #define SYSCALL_ENTRY(id,name,args) args,
53 #ifdef _WIN64
54 ALL_SYSCALLS64
55 #else
56 ALL_SYSCALLS32
57 #endif
58 #undef SYSCALL_ENTRY
61 static NTSTATUS init( void *args )
63 #ifdef _WIN64
64 if (NtCurrentTeb()->WowTebOffset)
66 SYSTEM_BASIC_INFORMATION info;
68 NtQuerySystemInformation(SystemEmulationBasicInformation, &info, sizeof(info), NULL);
69 zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff;
71 #endif
72 KeAddSystemServiceTable( syscalls, NULL, ARRAY_SIZE(syscalls), arguments, 1 );
73 return STATUS_SUCCESS;
76 const unixlib_entry_t __wine_unix_call_funcs[] =
78 init,