Module: wine Branch: master Commit: 81cba2af81c96632014b62d7a6b88f3d86c272af URL: https://gitlab.winehq.org/wine/wine/-/commit/81cba2af81c96632014b62d7a6b88f3...
Author: Alexandre Julliard julliard@winehq.org Date: Sat Nov 12 17:03:27 2022 +0100
include: Disable some inline kernelbase functions when building Unix libraries.
---
include/winbase.h | 9 ++++++++- include/winternl.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/winbase.h b/include/winbase.h index 7c0d8afd36c..71b5d4569cd 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2950,7 +2950,14 @@ extern char * CDECL wine_get_unix_file_name( LPCWSTR dos ); extern WCHAR * CDECL wine_get_dos_file_name( LPCSTR str );
-#ifdef __WINESRC__ +#ifdef WINE_UNIX_LIB + +#define GetCurrentProcess() NtCurrentProcess() +#define GetCurrentThread() NtCurrentThread() +#define GetCurrentProcessId() HandleToULong(NtCurrentTeb()->ClientId.UniqueProcess) +#define GetCurrentThreadId() HandleToULong(NtCurrentTeb()->ClientId.UniqueThread) + +#elif defined(__WINESRC__)
static FORCEINLINE HANDLE WINAPI GetCurrentProcess(void) { diff --git a/include/winternl.h b/include/winternl.h index 54c8903c534..3a62ff0b268 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4712,7 +4712,8 @@ NTSYSAPI NTSTATUS WINAPI wine_unix_to_nt_file_name( const char *name, WCHAR *buf (p)->SecurityQualityOfService = NULL; \ } while (0)
-#define NtCurrentProcess() ((HANDLE)-1) +#define NtCurrentProcess() ((HANDLE)~(ULONG_PTR)0) +#define NtCurrentThread() ((HANDLE)~(ULONG_PTR)1)
#define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length)) #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))