Changeset 1720 for trunk/src/kernel32


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

better error reporting for pe loader

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

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

    r1284 r1720  
    1 /* $Id: winexepeldr.cpp,v 1.3 1999-10-14 09:57:34 sandervl Exp $ */
     1/* $Id: winexepeldr.cpp,v 1.4 1999-11-13 15:41:10 sandervl Exp $ */
    22
    33/*
     
    3434
    3535#include "cio.h"
     36#include "oslibmisc.h"
     37
     38extern char szErrorTitle[];
     39extern char szErrorModule[];
    3640
    3741//******************************************************************************
     
    6872  OS2SetExceptionHandler(&exceptFrame);
    6973  if(WinExe->init(reservedMem) == FALSE) {
     74        if(szErrorModule[0] != 0) {
     75          char szErrorMsg[128];
     76
     77                sprintf(szErrorMsg, "Can't execute %s due to bad or missing %s", OSLibStripPath(szFileName), szErrorModule);
     78                WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
     79        }
    7080        delete WinExe;
    7181        return FALSE;
  • trunk/src/kernel32/winimagepeldr.cpp

    r1708 r1720  
    1 /* $Id: winimagepeldr.cpp,v 1.12 1999-11-11 19:10:09 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.13 1999-11-13 15:41:11 sandervl Exp $ */
    22
    33/*
     
    5353char szExeErrorMsg[]    = "File isn't an executable";
    5454char szInteralErrorMsg[]= "Internal Error";
     55char szErrorModule[128] = "";
    5556
    5657#ifndef max
     
    136137BOOL Win32PeLdrImage::init(ULONG reservedMem)
    137138{
    138  char   szErrorMsg[64];
    139139 LPVOID win32file     = NULL;
    140140 ULONG  filesize, ulRead;
     
    148148
    149149  if (fImgMapping == -1) {
    150         sprintf(szErrorMsg, "Unable to open %32s\n", szFileName);
    151         WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
     150        strcpy(szErrorModule, OSLibStripPath(szFileName));
    152151        goto failure;
    153152  }
     
    10891088                if(rc) {
    10901089                        dprintf(("DosLoadModule returned %X for %s\n", rc, szModuleFailure));
     1090                        sprintf(szErrorModule, "%s.DLL", szModuleFailure);
    10911091                        errorState = rc;
    10921092                        return(FALSE);
     
    11131113                if(WinDll->init(0) == FALSE) {
    11141114                    fout << "Internal WinDll error " << WinDll->getError() << endl;
     1115                    strcpy(szErrorModule, OSLibStripPath(modname));
    11151116                    return(FALSE);
    11161117                }
Note: See TracChangeset for help on using the changeset viewer.