diff --git a/dlls/kernel32/atom.c b/dlls/kernel32/atom.c index d6caec25494..a8deb5ed4f4 100644 --- a/dlls/kernel32/atom.c +++ b/dlls/kernel32/atom.c @@ -37,6 +37,7 @@ #include "kernel_private.h" #define MAX_ATOM_LEN 255 +#define IS_INTATOM(x) (((ULONG_PTR)(x) >> 16) == 0) /****************************************************************** * get_local_table @@ -88,7 +89,7 @@ BOOL WINAPI InitAtomTable( DWORD entries ) */ static inline BOOL check_integral_atom( const void* ptr, ATOM* patom) { - if (HIWORD( ptr )) return FALSE; + if (!IS_INTATOM( ptr )) return FALSE; if ((*patom = LOWORD( ptr )) >= MAXINTATOM) { SetLastError( ERROR_INVALID_PARAMETER ); diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c index d6dea99ae34..6ed88ad0fe6 100644 --- a/dlls/kernel32/except.c +++ b/dlls/kernel32/except.c @@ -133,7 +133,7 @@ static int format_exception_msg( const EXCEPTION_POINTERS *ptr, char *buffer, in rec->ExceptionInformation[0]); break; case EXCEPTION_WINE_STUB: - if (HIWORD(rec->ExceptionInformation[1])) + if ((ULONG_PTR)rec->ExceptionInformation[1] >> 16) len = snprintf( buffer, size, "Unimplemented function %s.%s called", (char *)rec->ExceptionInformation[0], (char *)rec->ExceptionInformation[1] ); else diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 96a240e6cda..2b8f11ee28f 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -1032,7 +1032,7 @@ FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function ) if (!hModule) hModule = NtCurrentTeb()->Peb->ImageBaseAddress; - if (HIWORD(function)) + if ((ULONG_PTR)function >> 16) { ANSI_STRING str;