ntdll: Avoid using HIWORD on types that are 64bit on Win64.
authorMichael Stefaniuc <mstefani@redhat.de>
Wed, 10 Feb 2010 10:43:59 +0000 (11:43 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 10 Feb 2010 13:32:05 +0000 (14:32 +0100)
dlls/ntdll/atom.c
dlls/ntdll/relay.c
dlls/ntdll/resource.c

index 27e27a23f05d19dd4cdc063c8b77ebc9c88919ef..8ac4b970c9d716a6df01056acc1fb943cd429ad1 100644 (file)
@@ -39,7 +39,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(atom);
 
-#define MAX_ATOM_LEN              255
+#define MAX_ATOM_LEN    255
+#define IS_INTATOM(x)   (((ULONG_PTR)(x) >> 16) == 0)
 
 /******************************************************************
  *             is_integral_atom
@@ -51,7 +52,7 @@ static NTSTATUS is_integral_atom( LPCWSTR atomstr, size_t len, RTL_ATOM* pAtom )
 {
     RTL_ATOM atom;
 
-    if (HIWORD( atomstr ))
+    if (!IS_INTATOM( atomstr ))
     {
         const WCHAR* ptr = atomstr;
         if (!len) return STATUS_OBJECT_NAME_INVALID;
index 7fd3c35d93354a18fc07ab057e006dd478c3c26d..ee042deaa5e8a46cc12c2c5c68b96438cc0ee024 100644 (file)
@@ -52,6 +52,7 @@ struct relay_descr  /* descriptor for a module */
 };
 
 #define RELAY_DESCR_MAGIC  ((void *)0xdeb90001)
+#define IS_INTARG(x)       (((ULONG_PTR)(x) >> 16) == 0)
 
 /* private data built at dll load time */
 
@@ -303,7 +304,7 @@ static inline void RELAY_PrintArgs( const INT_PTR *args, int nb_args, unsigned i
 {
     while (nb_args--)
     {
-       if ((typemask & 3) && HIWORD(*args))
+        if ((typemask & 3) && !IS_INTARG(*args))
         {
            if (typemask & 2)
                 DPRINTF( "%08lx %s", *args, debugstr_w((LPCWSTR)*args) );
@@ -880,7 +881,7 @@ static void SNOOP_PrintArg(DWORD x)
     int i,nostring;
 
     DPRINTF("%08x",x);
-    if (!HIWORD(x) || TRACE_ON(seh)) return; /* trivial reject to avoid faults */
+    if (IS_INTARG(x) || TRACE_ON(seh)) return; /* trivial reject to avoid faults */
     __TRY
     {
         LPBYTE s=(LPBYTE)x;
index ff0a5d072b6e50a119549b5f922365c39681f117..f93a705e5334e246d9e26e140706c69bcb7b9d7d 100644 (file)
@@ -49,6 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(resource);
 static LCID user_lcid, system_lcid;
 static LANGID user_ui_language, system_ui_language;
 
+#define IS_INTRESOURCE(x)       (((ULONG_PTR)(x) >> 16) == 0)
+
 /**********************************************************************
  *  is_data_file_module
  *
@@ -142,7 +144,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_
     const IMAGE_RESOURCE_DIR_STRING_U *str;
     int min, max, res, pos, namelen;
 
-    if (!HIWORD(name)) return find_entry_by_id( dir, LOWORD(name), root, want_dir );
+    if (IS_INTRESOURCE(name)) return find_entry_by_id( dir, LOWORD(name), root, want_dir );
     entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
     namelen = strlenW(name);
     min = 0;