diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index dcf4ce8d52c..9893181ae80 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -3141,7 +3141,7 @@ BOOL WINAPI IsWow64Process(HANDLE hProcess, PBOOL Wow64Process) #undef GetCurrentProcess HANDLE WINAPI GetCurrentProcess(void) { - return (HANDLE)0xffffffff; + return (HANDLE)~(ULONG_PTR)0; } /*********************************************************************** diff --git a/dlls/kernel32/thread.c b/dlls/kernel32/thread.c index b5a37081f48..b08494371fe 100644 --- a/dlls/kernel32/thread.c +++ b/dlls/kernel32/thread.c @@ -557,7 +557,7 @@ VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT boost ) #undef GetCurrentThread HANDLE WINAPI GetCurrentThread(void) { - return (HANDLE)0xfffffffe; + return (HANDLE)~(ULONG_PTR)1; } diff --git a/include/winbase.h b/include/winbase.h index 714a6700f4c..6b19a4b2d0e 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -309,16 +309,16 @@ typedef struct _PROCESS_HEAP_ENTRY #define PROCESS_HEAP_ENTRY_MOVEABLE 0x0010 #define PROCESS_HEAP_ENTRY_DDESHARE 0x0020 -#define INVALID_HANDLE_VALUE ((HANDLE)~0UL) -#define INVALID_FILE_SIZE ((DWORD)~0UL) -#define INVALID_SET_FILE_POINTER ((DWORD)~0UL) -#define INVALID_FILE_ATTRIBUTES ((DWORD)~0UL) +#define INVALID_HANDLE_VALUE ((HANDLE)~(ULONG_PTR)0) +#define INVALID_FILE_SIZE (~0u) +#define INVALID_SET_FILE_POINTER (~0u) +#define INVALID_FILE_ATTRIBUTES (~0u) #define LOCKFILE_FAIL_IMMEDIATELY 1 #define LOCKFILE_EXCLUSIVE_LOCK 2 -#define FLS_OUT_OF_INDEXES ((DWORD)~0UL) -#define TLS_OUT_OF_INDEXES ((DWORD)~0UL) +#define FLS_OUT_OF_INDEXES (~0u) +#define TLS_OUT_OF_INDEXES (~0u) #define SHUTDOWN_NORETRY 1 @@ -2436,8 +2436,8 @@ static inline PVOID WINAPI InterlockedExchangePointer( PVOID volatile *dest, PVO } #ifdef __WINESRC__ -#define GetCurrentProcess() ((HANDLE)0xffffffff) -#define GetCurrentThread() ((HANDLE)0xfffffffe) +#define GetCurrentProcess() ((HANDLE)~(ULONG_PTR)0) +#define GetCurrentThread() ((HANDLE)~(ULONG_PTR)1) #endif /* WinMain(entry point) must be declared in winbase.h. */ diff --git a/include/wine/test.h b/include/wine/test.h index 62d8c3addcc..caa3f35a699 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -40,10 +40,10 @@ #endif #ifndef INVALID_FILE_ATTRIBUTES -#define INVALID_FILE_ATTRIBUTES ((DWORD)~0UL) +#define INVALID_FILE_ATTRIBUTES (~0u) #endif #ifndef INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER ((DWORD)~0UL) +#define INVALID_SET_FILE_POINTER (~0u) #endif /* debug level */ diff --git a/include/wingdi.h b/include/wingdi.h index e7be055261e..ac4ba2bff86 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3253,8 +3253,8 @@ typedef struct _BLENDFUNCTION #define GRADIENT_FILL_TRIANGLE 0x00000002 #define GRADIENT_FILL_OP_FLAG 0x000000ff -#define GDI_ERROR (0xFFFFFFFFL) -#define HGDI_ERROR ((HANDLE)0xFFFFFFFFL) +#define GDI_ERROR (~0u) +#define HGDI_ERROR ((HANDLE)~(ULONG_PTR)0) /* AddFontResourceEx flags */ #define FR_PRIVATE 0x10