- Timestamp:
- Oct 6, 1999, 10:08:10 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimgres.cpp
r1146 r1150 1 /* $Id: winimgres.cpp,v 1.2 0 1999-10-05 23:24:31 phallerExp $ */1 /* $Id: winimgres.cpp,v 1.21 1999-10-06 08:07:41 sandervl Exp $ */ 2 2 3 3 /* … … 10 10 * 11 11 * TODO: Check created resource objects before loading the resource! 12 * TODO: Is the name id of the version resource always 1? 13 * TODO: Once the resource handling in PE2LX/win32k is changed, 12 * TODO: Once the resource handling in PE2LX/win32k is changed, 14 13 * getVersionStruct/Size can be moved into the Win32ImageBase class 15 14 * … … 36 35 //PE spec says names & ids are sorted; keep on searching just to be sure 37 36 //****************************************************************************** 38 PIMAGE_RESOURCE_DATA_ENTRY 37 PIMAGE_RESOURCE_DATA_ENTRY 39 38 Win32ImageBase::getPEResourceEntry(ULONG id, ULONG type, ULONG lang) 40 39 { … … 77 76 prdType = (PIMAGE_RESOURCE_DIRECTORY)((int)pResDir + (int)prde->u2.OffsetToData); 78 77 79 if(i < pResDir->NumberOfNamedEntries) 78 if(i < pResDir->NumberOfNamedEntries) 80 79 {//name or id entry? 81 80 //SvL: 30-10-'97, high bit is set, so clear to get real offset … … 86 85 lstrcpynWtoA(typename, pstring->NameString, pstring->Length+1); 87 86 typename[pstring->Length] = 0; 88 87 89 88 if(!fNumType) { 90 89 if(stricmp(typename, (char *)type) == 0) { … … 147 146 prde = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)((DWORD)prdType + sizeof(IMAGE_RESOURCE_DIRECTORY)); 148 147 149 if(level == 3 && *nodeData == LANG_GETFIRST) { 148 //level 2 (id) -> get first id? 149 //level 3 (lang) -> get first language? 150 if(*nodeData == IDLANG_GETFIRST) { 150 151 nrres = prdType->NumberOfNamedEntries + prdType->NumberOfIdEntries; 151 152 fNumId = (prdType->NumberOfNamedEntries == 0); … … 154 155 fNumId = HIWORD(*nodeData) == 0; 155 156 156 157 if(fNumId) {//numeric or string id? 157 158 nrres = prdType->NumberOfIdEntries; 158 159 prde += prdType->NumberOfNamedEntries; //skip name entries … … 165 166 prdType2 = (PIMAGE_RESOURCE_DIRECTORY)((ULONG)pResDir + (ULONG)prde->u2.OffsetToData); 166 167 168 if(*nodeData == IDLANG_GETFIRST) { 169 fFound = TRUE; //always take the first one 170 } 171 else 167 172 if(!fNumId) {//name or id entry? 168 173 nameOffset = prde->u1.Name; … … 184 189 fFound = TRUE; 185 190 } 186 if(*nodeData == LANG_GETFIRST)187 fFound = TRUE;188 191 189 192 if(fFound) { … … 394 397 if(HIWORD(lpszType) != 0) { 395 398 astring2 = UnicodeToAsciiString(lpszType); 396 } 399 } 397 400 else astring2 = (char *)lpszType; 398 401 … … 432 435 if(HIWORD(lpszType) != 0) { 433 436 astring2 = UnicodeToAsciiString(lpszType); 434 } 437 } 435 438 else astring2 = (char *)lpszType; 436 439 … … 478 481 return FALSE; 479 482 } 480 pData = getPEResourceEntry( 1, NTRT_VERSION);483 pData = getPEResourceEntry(ID_GETFIRST, NTRT_VERSION); 481 484 if(pData == NULL) { 482 485 dprintf(("Win32PeLdrImage::getVersionStruct: couldn't find version resource!"));
Note:
See TracChangeset
for help on using the changeset viewer.