Ignore:
Timestamp:
Dec 20, 2002, 12:39:43 PM (23 years ago)
Author:
sandervl
Message:

Don't display message boxes for module load errors. Pass errors back to the PE loader.

File:
1 edited

Legend:

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

    r8589 r9537  
    1 /* $Id: winimagepe2lx.cpp,v 1.20 2002-06-08 00:26:59 bird Exp $ */
     1/* $Id: winimagepe2lx.cpp,v 1.21 2002-12-20 11:39:42 sandervl Exp $ */
    22
    33/*
     
    179179 * Initiates the object.
    180180 * Must be called immediately after the object construction.
    181  * @returns   Success indicator, TRUE == success; FALSE = failure.
     181 * @returns   Error value, LDRERROR_SUCCESS == success; failure otherwise.
    182182 * @sketch    Get section placement and sizes for this module. (paSections, cSections)
    183183 *            Verify that there is at least one section - the header section.
     
    194194 * @remark    Object must be destroyed if failure!
    195195 */
    196 BOOL Win32Pe2LxImage::init()
     196DWORD Win32Pe2LxImage::init()
    197197{
    198198    APIRET rc;
     
    204204        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: error - getSection failed with rc=%d\n",
    205205                 rc));
    206         return FALSE;
     206        return LDRERROR_INVALID_HEADER;
    207207    }
    208208
     
    211211    {
    212212        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: no header section, cSections is 0\n"));
    213         return FALSE;
     213        return LDRERROR_INVALID_HEADER;
    214214    }
    215215
     
    224224    {
    225225        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: Not a pe2lx image!(?)\n"));
    226         return FALSE;
     226        return LDRERROR_INVALID_HEADER;
    227227    }
    228228
     
    245245    {
    246246        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: Not a pe2lx image!(?)\n"));
    247         return FALSE;
     247        return LDRERROR_INVALID_HEADER;
    248248    }
    249249
     
    253253    {
    254254        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: setSectionRVAs failed with rc=%d\n", rc));
    255         return FALSE;
     255        return LDRERROR_INVALID_HEADER;
    256256    }
    257257
     
    268268        dprintf(("Win32Pe2LxImage::Win32Pe2LxImage: entrypoint is incorrect, AddrOfEP=0x%08x, entryPoint=0x%08x\n",
    269269                 pNtHdrs->OptionalHeader.AddressOfEntryPoint, entryPoint));
    270         return FALSE;
     270        return LDRERROR_NO_ENTRYPOINT;
    271271    }
    272272
     
    367367                            eprintf(("Win32Pe2LxImage::init: invalid RVA to TLS AddressOfIndex - %#8x.\n",
    368368                                     pTLSDir->AddressOfIndex));
    369                             return FALSE;
     369                            return LDRERROR_INVALID_HEADER;
    370370                        }
    371371                        setTLSIndexAddr((LPDWORD)pv);
     
    387387                            eprintf(("Win32Pe2LxImage::init: invalid pointer to TLS AddressOfCallBacks - %#8x.\n",
    388388                                     pTLSDir->AddressOfIndex));
    389                             return FALSE;
     389                            return LDRERROR_INVALID_HEADER;
    390390                        }
    391391                        setTLSCallBackAddr((PIMAGE_TLS_CALLBACK*)pv);
     
    398398            eprintf(("Win32Pe2LxImage::init: invalid RVA to TLS Dir - %#8x. (getPointerFromRVA failed)\n",
    399399                     pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress));
    400             return FALSE;
     400            return LDRERROR_INVALID_HEADER;
    401401        }
    402402    }
    403     return TRUE;
     403    return LDRERROR_SUCCESS;
    404404}
    405405
Note: See TracChangeset for help on using the changeset viewer.