Changeset 1146 for trunk/src


Ignore:
Timestamp:
Oct 6, 1999, 1:26:02 AM (26 years ago)
Author:
phaller
Message:

Fix: problems while initializing SHELL32/NEW

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/kernel32exp.def

    r862 r1146  
    590590    _lstrncmpA@12                             @785
    591591    _lstrncmpW@12                             @786
     592    _GetFileAttributesExA@12                  @874
     593    _GetFileAttributesExW@12                  @875
     594    _lstrncmpiA@12                            @887
     595    _lstrncmpiW@12                            @888
    592596    _OS2memmove                               @906
    593     ConvertNameId                             @1200
     597    DebugErrorBox                             @1201
    594598    WriteLog                                  @1202
    595599    WriteLogError                             @1214
    596     _RegisterExe@48                           @1203
     600    _RegisterPe2LxExe@48                      @1203
     601    _RegisterPe2LxDll@48                      @1209
     602    _CreateWin32PeLdrExe@8                    @1236
     603    _RegisterLxExe@8                          @1237
     604    _RegisterLxDll@12                         @1238
     605    _UnregisterLxDll@4                        @1239
    597606    enter__6VMutexFUl                         @1204
    598607    leave__6VMutexFv                          @1205
    599608    __ct__6VMutexFi                           @1206
    600609    __dt__6VMutexFv                           @1207
    601     _RegisterDll@48                           @1209
    602610    _UnicodeToAsciiString@4                   @1210
    603611    _UnicodeToAscii@8                         @1211
     
    606614    _UnicodeToAsciiN@12                       @1215
    607615    _AsciiToUnicodeN@12                       @1216
    608     __ct__8Win32ExeFPc                        @1220
    609616    GetVersionStruct                          @1221
    610617    GetVersionSize                            @1222
     
    622629    _GetThreadTEB@0                           @1234
    623630    _GetThreadTHDB@0                          @1235
    624     _CreateWin32Exe@4                         @1236
    625631    _HEAP_xalloc@12                           @1240
    626632    _HEAP_xrealloc@16                         @1241
     
    638644    OS2SetExceptionHandler                    @1253
    639645    OS2UnsetExceptionHandler                  @1254
    640     __ct__12Win32MenuResFP10Win32ImageUlN22   @1260
    641     __ct__12Win32MenuResFP10Win32ImageUlN22Pc  @1261
     646    __ct__12Win32MenuResFP14Win32ImageBaseUlN22  @1260
     647    __ct__12Win32MenuResFP14Win32ImageBaseUlN22Pc  @1261
    642648    __ct__12Win32MenuResFUl                   @1262
    643649    __ct__12Win32MenuResFPv                   @1263
  • trunk/src/kernel32/winimagepeldr.cpp

    r1075 r1146  
    1 /* $Id: winimagepeldr.cpp,v 1.3 1999-09-28 00:37:39 phaller Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.4 1999-10-05 23:23:47 phaller Exp $ */
    22
    33/*
     
    351351  hinstance = (HINSTANCE)realBaseAddress;
    352352
    353   if(processImports((char *)win32file) == FALSE) {
    354         fout << "Failed to process imports!" << endl;
    355         goto failure;
    356   }
    357 
     353  //PH: get pResDir pointer correct first, since processImports may
     354  //    implicitly call functions depending on it.
    358355  IMAGE_SECTION_HEADER sh;
    359356  if(GetSectionHdrByName (win32file, &sh, ".rsrc")) {
     
    361358        pResDir = (PIMAGE_RESOURCE_DIRECTORY)(sh.VirtualAddress + realBaseAddress);
    362359        pResourceSectionStart = (ULONG)pResSection->virtaddr - oh.ImageBase;
     360  }
     361
     362  if(processImports((char *)win32file) == FALSE) {
     363        fout << "Failed to process imports!" << endl;
     364        goto failure;
    363365  }
    364366
  • trunk/src/kernel32/winimgres.cpp

    r1131 r1146  
    1 /* $Id: winimgres.cpp,v 1.19 1999-10-04 20:52:34 sandervl Exp $ */
     1/* $Id: winimgres.cpp,v 1.20 1999-10-05 23:24:31 phaller Exp $ */
    22
    33/*
     
    1010 *
    1111 * TODO: Check created resource objects before loading the resource!
    12  * TODO: Once the resource handling in PE2LX/win32k is changed,
     12 * TODO: Is the name id of the version resource always 1?
     13 * TODO: Once the resource handling in PE2LX/win32k is changed,
    1314 *       getVersionStruct/Size can be moved into the Win32ImageBase class
    1415 *
     
    3536//PE spec says names & ids are sorted; keep on searching just to be sure
    3637//******************************************************************************
    37 PIMAGE_RESOURCE_DATA_ENTRY 
     38PIMAGE_RESOURCE_DATA_ENTRY
    3839 Win32ImageBase::getPEResourceEntry(ULONG id, ULONG type, ULONG lang)
    3940{
     
    4445 ULONG  nodeData[3], i, j, nameOffset;
    4546 BOOL  fFound = FALSE, fNumType;
     47
     48  //PH: our system LX DLLs might not have a resource segment
     49  if (pResDir == NULL)
     50    return NULL;
    4651
    4752  /* set pointer to first resource type entry */
     
    7277    prdType = (PIMAGE_RESOURCE_DIRECTORY)((int)pResDir + (int)prde->u2.OffsetToData);
    7378
    74     if(i < pResDir->NumberOfNamedEntries) 
     79    if(i < pResDir->NumberOfNamedEntries)
    7580    {//name or id entry?
    7681        //SvL: 30-10-'97, high bit is set, so clear to get real offset
     
    8186        lstrcpynWtoA(typename, pstring->NameString, pstring->Length+1);
    8287        typename[pstring->Length] = 0;
    83        
     88
    8489        if(!fNumType) {
    8590            if(stricmp(typename, (char *)type) == 0) {
     
    142147  prde    = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)((DWORD)prdType + sizeof(IMAGE_RESOURCE_DIRECTORY));
    143148
    144   //level 2 (id)   -> get first id?
    145   //level 3 (lang) -> get first language?
    146   if(*nodeData == IDLANG_GETFIRST) {
     149  if(level == 3 && *nodeData == LANG_GETFIRST) {
    147150        nrres  = prdType->NumberOfNamedEntries + prdType->NumberOfIdEntries;
    148151        fNumId = (prdType->NumberOfNamedEntries == 0);
     
    151154        fNumId = HIWORD(*nodeData) == 0;
    152155
    153         if(fNumId) {//numeric or string id?
     156        if(fNumId) {//numeric or string id?
    154157                nrres = prdType->NumberOfIdEntries;
    155158                prde += prdType->NumberOfNamedEntries;  //skip name entries
     
    162165        prdType2 = (PIMAGE_RESOURCE_DIRECTORY)((ULONG)pResDir + (ULONG)prde->u2.OffsetToData);
    163166
    164         if(*nodeData == IDLANG_GETFIRST) {
    165                 fFound = TRUE; //always take the first one
    166         }
    167         else
    168167        if(!fNumId) {//name or id entry?
    169168                nameOffset = prde->u1.Name;
     
    185184                        fFound = TRUE;
    186185        }
     186        if(*nodeData == LANG_GETFIRST)
     187                fFound = TRUE;
    187188
    188189        if(fFound) {
     
    393394    if(HIWORD(lpszType) != 0) {
    394395                astring2 = UnicodeToAsciiString(lpszType);
    395     } 
     396    }
    396397    else        astring2 = (char *)lpszType;
    397398
     
    431432    if(HIWORD(lpszType) != 0) {
    432433                astring2 = UnicodeToAsciiString(lpszType);
    433     } 
     434    }
    434435    else        astring2 = (char *)lpszType;
    435436
     
    477478        return FALSE;
    478479  }
    479   pData = getPEResourceEntry(ID_GETFIRST, NTRT_VERSION);
     480  pData = getPEResourceEntry(1, NTRT_VERSION);
    480481  if(pData == NULL) {
    481482        dprintf(("Win32PeLdrImage::getVersionStruct: couldn't find version resource!"));
Note: See TracChangeset for help on using the changeset viewer.