Changeset 3678 for trunk/src/kernel32/winimagebase.cpp
- Timestamp:
- Jun 8, 2000, 8:08:58 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagebase.cpp
r3625 r3678 1 /* $Id: winimagebase.cpp,v 1.2 1 2000-05-28 16:45:12sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.22 2000-06-08 18:08:56 sandervl Exp $ */ 2 2 3 3 /* … … 37 37 #include "directory.h" 38 38 #include <win\virtual.h> 39 #include <winconst.h> 39 40 40 41 #define DBG_LOCALLOG DBG_winimagebase … … 200 201 } 201 202 //****************************************************************************** 202 //****************************************************************************** 203 BOOL Win32ImageBase::isPEImage(char *szFileName) 203 //returns ERROR_SUCCESS or error code 204 //****************************************************************************** 205 ULONG Win32ImageBase::isPEImage(char *szFileName) 204 206 { 205 207 char filename[CCHMAXPATH]; … … 219 221 dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) findDll failed to find the file.\n", 220 222 szFileName, rc)); 221 return FALSE;223 return ERROR_FILE_NOT_FOUND_W; 222 224 } 223 225 rc = DosOpen(filename, /* File path name */ … … 237 239 dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) failed with %u\n", 238 240 szFileName, rc)); 239 return (FALSE);241 return ERROR_FILE_NOT_FOUND_W; 240 242 } 241 243 … … 246 248 if(pdoshdr == NULL) { 247 249 DosClose(win32handle); /* Close the file */ 248 return (FALSE);250 return ERROR_INVALID_EXE_SIGNATURE_W; 249 251 } 250 252 rc = DosRead(win32handle, pdoshdr, sizeof(IMAGE_DOS_HEADER), &ulRead); 251 253 if(rc != NO_ERROR) { 252 254 DosClose(win32handle); /* Close the file */ 253 return (FALSE);255 return ERROR_INVALID_EXE_SIGNATURE_W; 254 256 } 255 257 ULONG hdrsize = pdoshdr->e_lfanew + SIZE_OF_NT_SIGNATURE + sizeof(IMAGE_FILE_HEADER); … … 262 264 if(win32file == NULL) { 263 265 DosClose(win32handle); /* Close the file */ 264 return (FALSE);266 return ERROR_NOT_ENOUGH_MEMORY_W; 265 267 } 266 268 rc = DosRead(win32handle, win32file, hdrsize, &ulRead); … … 284 286 } 285 287 DosClose(win32handle); 286 return (TRUE);288 return ERROR_SUCCESS_W; 287 289 288 290 failure: 289 291 free(win32file); 290 292 DosClose(win32handle); 291 return (FALSE);293 return ERROR_INVALID_EXE_SIGNATURE_W; 292 294 } 293 295 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.