Changeset 1720 for trunk/src/peldr


Ignore:
Timestamp:
Nov 13, 1999, 4:41:11 PM (26 years ago)
Author:
sandervl
Message:

better error reporting for pe loader

Location:
trunk/src/peldr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/peldr/makefile

    r1459 r1720  
    1 # $Id: makefile,v 1.10 1999-10-26 17:54:42 sandervl Exp $
     1# $Id: makefile,v 1.11 1999-11-13 15:40:51 sandervl Exp $
    22
    33#
     
    4949
    5050clean:
    51         $(RM) *.obj *.lib *.dll *~ *.map *.pch *.exe
     51        $(RM) *.obj *.lib *.dll *.map *.pch *.exe
    5252        $(RM) $(PDWIN32_BIN)\$(TARGET).exe
    5353        $(RM) $(PDWIN32_BIN)\$(TARGETDLL).dll
  • trunk/src/peldr/pe.cpp

    r1239 r1720  
    1 /* $Id: pe.cpp,v 1.10 1999-10-10 08:58:51 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.11 1999-11-13 15:39:45 sandervl Exp $ */
    22
    33/*
     
    3737char szExeErrorMsg[]    = "File isn't an executable";
    3838char szInteralErrorMsg[]= "Internal Error";
     39char szNoKernel32Msg[]  = "Can't load/find kernel32.dll";
    3940
    4041char fullpath[CCHMAXPATH];
     
    7778  rc = DosQueryProcAddr(hmodPMWin, ORD_WIN32MESSAGEBOX, NULL, (PFN *)&MyWinMessageBox);
    7879
    79   rc = DosLoadModule(exeName, sizeof(exeName), "KERNEL32.DLL", &hmodKernel32);
    80   rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@8", (PFN *)&CreateWin32Exe);
    81 
    8280  if ((hab = MyWinInitialize(0)) == 0L) /* Initialize PM     */
    8381        goto fail;
     
    9088  }
    9189
     90  rc = DosLoadModule(exeName, sizeof(exeName), "KERNEL32.DLL", &hmodKernel32);
     91  if(rc) {
     92        MyWinMessageBox(HWND_DESKTOP, NULL, szNoKernel32Msg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
     93        goto fail;
     94  }
     95  rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@8", (PFN *)&CreateWin32Exe);
     96
    9297  strcpy(exeName, argv[1]);
    9398  strupr(exeName);
     
    96101  }
    97102  if(CreateWin32Exe(exeName, ReserveMem()) == FALSE) {
    98         MyWinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szLoadErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
    99103        goto fail;
    100104  }
Note: See TracChangeset for help on using the changeset viewer.