Changeset 1146 for trunk/src/kernel32/winimgres.cpp
- Timestamp:
- Oct 6, 1999, 1:26:02 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimgres.cpp
r1131 r1146 1 /* $Id: winimgres.cpp,v 1. 19 1999-10-04 20:52:34 sandervlExp $ */1 /* $Id: winimgres.cpp,v 1.20 1999-10-05 23:24:31 phaller Exp $ */ 2 2 3 3 /* … … 10 10 * 11 11 * 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, 13 14 * getVersionStruct/Size can be moved into the Win32ImageBase class 14 15 * … … 35 36 //PE spec says names & ids are sorted; keep on searching just to be sure 36 37 //****************************************************************************** 37 PIMAGE_RESOURCE_DATA_ENTRY 38 PIMAGE_RESOURCE_DATA_ENTRY 38 39 Win32ImageBase::getPEResourceEntry(ULONG id, ULONG type, ULONG lang) 39 40 { … … 44 45 ULONG nodeData[3], i, j, nameOffset; 45 46 BOOL fFound = FALSE, fNumType; 47 48 //PH: our system LX DLLs might not have a resource segment 49 if (pResDir == NULL) 50 return NULL; 46 51 47 52 /* set pointer to first resource type entry */ … … 72 77 prdType = (PIMAGE_RESOURCE_DIRECTORY)((int)pResDir + (int)prde->u2.OffsetToData); 73 78 74 if(i < pResDir->NumberOfNamedEntries) 79 if(i < pResDir->NumberOfNamedEntries) 75 80 {//name or id entry? 76 81 //SvL: 30-10-'97, high bit is set, so clear to get real offset … … 81 86 lstrcpynWtoA(typename, pstring->NameString, pstring->Length+1); 82 87 typename[pstring->Length] = 0; 83 88 84 89 if(!fNumType) { 85 90 if(stricmp(typename, (char *)type) == 0) { … … 142 147 prde = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)((DWORD)prdType + sizeof(IMAGE_RESOURCE_DIRECTORY)); 143 148 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) { 147 150 nrres = prdType->NumberOfNamedEntries + prdType->NumberOfIdEntries; 148 151 fNumId = (prdType->NumberOfNamedEntries == 0); … … 151 154 fNumId = HIWORD(*nodeData) == 0; 152 155 153 if(fNumId) {//numeric or string id?156 if(fNumId) {//numeric or string id? 154 157 nrres = prdType->NumberOfIdEntries; 155 158 prde += prdType->NumberOfNamedEntries; //skip name entries … … 162 165 prdType2 = (PIMAGE_RESOURCE_DIRECTORY)((ULONG)pResDir + (ULONG)prde->u2.OffsetToData); 163 166 164 if(*nodeData == IDLANG_GETFIRST) {165 fFound = TRUE; //always take the first one166 }167 else168 167 if(!fNumId) {//name or id entry? 169 168 nameOffset = prde->u1.Name; … … 185 184 fFound = TRUE; 186 185 } 186 if(*nodeData == LANG_GETFIRST) 187 fFound = TRUE; 187 188 188 189 if(fFound) { … … 393 394 if(HIWORD(lpszType) != 0) { 394 395 astring2 = UnicodeToAsciiString(lpszType); 395 } 396 } 396 397 else astring2 = (char *)lpszType; 397 398 … … 431 432 if(HIWORD(lpszType) != 0) { 432 433 astring2 = UnicodeToAsciiString(lpszType); 433 } 434 } 434 435 else astring2 = (char *)lpszType; 435 436 … … 477 478 return FALSE; 478 479 } 479 pData = getPEResourceEntry( ID_GETFIRST, NTRT_VERSION);480 pData = getPEResourceEntry(1, NTRT_VERSION); 480 481 if(pData == NULL) { 481 482 dprintf(("Win32PeLdrImage::getVersionStruct: couldn't find version resource!"));
Note:
See TracChangeset
for help on using the changeset viewer.