- Use MAXUINT, MAXULONG, MAXDWORD, MAXULONGLONG and MAXULONGLONG instead of ~0 or...
[reactos.git] / reactos / dll / win32 / kernel32 / file / bintype.c
index ac992e2..98d8f67 100644 (file)
@@ -38,7 +38,7 @@ InternalIsOS2OrOldWin(HANDLE hFile, IMAGE_DOS_HEADER *mz, IMAGE_OS2_HEADER *ne)
   CurPos = SetFilePointer(hFile, 0, NULL, FILE_CURRENT);
 
   /* read modref table */
-  if((SetFilePointer(hFile, mz->e_lfanew + ne->ne_modtab, NULL, FILE_BEGIN) == (DWORD)-1) ||
+  if((SetFilePointer(hFile, mz->e_lfanew + ne->ne_modtab, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) ||
      (!(modtab = HeapAlloc(GetProcessHeap(), 0, ne->ne_cmod * sizeof(WORD)))) ||
      (!(ReadFile(hFile, modtab, ne->ne_cmod * sizeof(WORD), &Read, NULL))) ||
      (Read != (DWORD)ne->ne_cmod * sizeof(WORD)))
@@ -47,7 +47,7 @@ InternalIsOS2OrOldWin(HANDLE hFile, IMAGE_DOS_HEADER *mz, IMAGE_OS2_HEADER *ne)
   }
 
   /* read imported names table */
-  if((SetFilePointer(hFile, mz->e_lfanew + ne->ne_imptab, NULL, FILE_BEGIN) == (DWORD)-1) ||
+  if((SetFilePointer(hFile, mz->e_lfanew + ne->ne_imptab, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) ||
      (!(nametab = HeapAlloc(GetProcessHeap(), 0, ne->ne_enttab - ne->ne_imptab))) ||
      (!(ReadFile(hFile, nametab, ne->ne_enttab - ne->ne_imptab, &Read, NULL))) ||
      (Read != (DWORD)ne->ne_enttab - ne->ne_imptab))
@@ -100,7 +100,7 @@ InternalGetBinaryType(HANDLE hFile)
   char magic[4];
   DWORD Read;
 
-  if((SetFilePointer(hFile, 0, NULL, FILE_BEGIN) == (DWORD)-1) ||
+  if((SetFilePointer(hFile, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) ||
      (!ReadFile(hFile, &Header, sizeof(Header), &Read, NULL) ||
       (Read != sizeof(Header))))
   {
@@ -143,7 +143,7 @@ InternalGetBinaryType(HANDLE hFile)
      * This will tell us if there is more header information
      * to read or not.
      */
-    if((SetFilePointer(hFile, Header.mz.e_lfanew, NULL, FILE_BEGIN) == (DWORD)-1) ||
+    if((SetFilePointer(hFile, Header.mz.e_lfanew, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) ||
        (!ReadFile(hFile, magic, sizeof(magic), &Read, NULL) ||
         (Read != sizeof(magic))))
     {