2 * Win32u kernel interface
4 * Copyright 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
24 #define WIN32_NO_STATUS
28 #include "wine/unixlib.h"
30 extern void *__wine_syscall_dispatcher DECLSPEC_HIDDEN
;
32 static unixlib_handle_t win32u_handle
;
34 void __cdecl
__wine_spec_unimplemented_stub( const char *module
, const char *function
)
36 EXCEPTION_RECORD record
;
38 record
.ExceptionCode
= EXCEPTION_WINE_STUB
;
39 record
.ExceptionFlags
= EH_NONCONTINUABLE
;
40 record
.ExceptionRecord
= NULL
;
41 record
.ExceptionAddress
= __wine_spec_unimplemented_stub
;
42 record
.NumberParameters
= 2;
43 record
.ExceptionInformation
[0] = (ULONG_PTR
)module
;
44 record
.ExceptionInformation
[1] = (ULONG_PTR
)function
;
45 for (;;) RtlRaiseException( &record
);
48 BOOL WINAPI
DllMain( HINSTANCE inst
, DWORD reason
, void *reserved
)
52 case DLL_PROCESS_ATTACH
:
53 LdrDisableThreadCalloutsForDll( inst
);
54 if (__wine_syscall_dispatcher
) break; /* already set through Wow64Transition */
55 if (!NtQueryVirtualMemory( GetCurrentProcess(), inst
, MemoryWineUnixFuncs
,
56 &win32u_handle
, sizeof(win32u_handle
), NULL
))
57 __wine_unix_call( win32u_handle
, 0, &__wine_syscall_dispatcher
);