CreateFile() fails with INVALID_HANDLE_VALUE, not NULL - this fixes GetLastError() to more accurately point to the problem when diagnosing problems.
Modified: trunk/reactos/lib/user32/windows/bitmap.c

Modified: trunk/reactos/lib/user32/windows/bitmap.c
--- trunk/reactos/lib/user32/windows/bitmap.c	2005-12-17 05:47:19 UTC (rev 20215)
+++ trunk/reactos/lib/user32/windows/bitmap.c	2005-12-17 06:26:20 UTC (rev 20216)
@@ -66,7 +66,7 @@
       Handle = LoadImageW(hinst, (LPCWSTR)lpszName, uType, cxDesired,
 			  cyDesired, fuLoad);
    }
- 
+
    return Handle;
 }
 
@@ -130,7 +130,7 @@
 
       id = LookupIconIdFromDirectoryEx((PBYTE)IconResDir, Icon, width, height,
                                        fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME));
-  
+
       h2Resource = FindResourceW(hinst, MAKEINTRESOURCEW(id),
                                  Icon ? MAKEINTRESOURCEW(RT_ICON) :
                                  MAKEINTRESOURCEW(RT_CURSOR));
@@ -171,7 +171,7 @@
 
    hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL,
                        OPEN_EXISTING, 0, NULL);
-   if (hFile == NULL)
+   if (hFile == INVALID_HANDLE_VALUE)
       return NULL;
 
    hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
@@ -298,7 +298,7 @@
    {
       hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL,
                           OPEN_EXISTING, 0, NULL);
-      if (hFile == NULL)
+      if (hFile == INVALID_HANDLE_VALUE)
          return NULL;
 
       hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
@@ -411,7 +411,7 @@
       default:
          break;
    }
- 
+
    return NULL;
 }
 
@@ -501,6 +501,6 @@
             return CopyCursor(hnd);
          }
    }
-   
+
    return NULL;
 }