Ignore:
Timestamp:
Jun 8, 2000, 8:08:58 PM (25 years ago)
Author:
sandervl
Message:

RegQueryValueW, OpenFile and LoadLibrary fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/winimagebase.cpp

    r3625 r3678  
    1 /* $Id: winimagebase.cpp,v 1.21 2000-05-28 16:45:12 sandervl Exp $ */
     1/* $Id: winimagebase.cpp,v 1.22 2000-06-08 18:08:56 sandervl Exp $ */
    22
    33/*
     
    3737#include "directory.h"
    3838#include <win\virtual.h>
     39#include <winconst.h>
    3940
    4041#define DBG_LOCALLOG    DBG_winimagebase
     
    200201}
    201202//******************************************************************************
    202 //******************************************************************************
    203 BOOL Win32ImageBase::isPEImage(char *szFileName)
     203//returns ERROR_SUCCESS or error code
     204//******************************************************************************
     205ULONG Win32ImageBase::isPEImage(char *szFileName)
    204206{
    205207 char   filename[CCHMAXPATH];
     
    219221        dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) findDll failed to find the file.\n",
    220222                 szFileName, rc));
    221         return FALSE;
     223        return ERROR_FILE_NOT_FOUND_W;
    222224  }
    223225  rc = DosOpen(filename,                       /* File path name */
     
    237239        dprintf(("KERNEL32:Win32ImageBase::isPEImage(%s) failed with %u\n",
    238240                  szFileName, rc));
    239         return(FALSE);
     241        return ERROR_FILE_NOT_FOUND_W;
    240242  }
    241243
     
    246248  if(pdoshdr == NULL)   {
    247249        DosClose(win32handle);                /* Close the file */
    248         return(FALSE);
     250        return ERROR_INVALID_EXE_SIGNATURE_W;
    249251  }
    250252  rc = DosRead(win32handle, pdoshdr, sizeof(IMAGE_DOS_HEADER), &ulRead);
    251253  if(rc != NO_ERROR) {
    252254        DosClose(win32handle);                /* Close the file */
    253         return(FALSE);
     255        return ERROR_INVALID_EXE_SIGNATURE_W;
    254256  }
    255257  ULONG hdrsize = pdoshdr->e_lfanew + SIZE_OF_NT_SIGNATURE + sizeof(IMAGE_FILE_HEADER);
     
    262264  if(win32file == NULL) {
    263265        DosClose(win32handle);                /* Close the file */
    264         return(FALSE);
     266        return ERROR_NOT_ENOUGH_MEMORY_W;
    265267  }
    266268  rc = DosRead(win32handle, win32file, hdrsize, &ulRead);
     
    284286  }
    285287  DosClose(win32handle);
    286   return(TRUE);
     288  return ERROR_SUCCESS_W;
    287289
    288290failure:
    289291  free(win32file);
    290292  DosClose(win32handle);
    291   return(FALSE);
     293  return ERROR_INVALID_EXE_SIGNATURE_W;
    292294}
    293295//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.