Changeset 3625 for trunk/src/kernel32/winimgres.cpp
- Timestamp:
- May 28, 2000, 6:45:14 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimgres.cpp
r3588 r3625 1 /* $Id: winimgres.cpp,v 1.3 7 2000-05-22 19:08:00sandervl Exp $ */1 /* $Id: winimgres.cpp,v 1.38 2000-05-28 16:45:13 sandervl Exp $ */ 2 2 3 3 /* … … 23 23 #include <misc.h> 24 24 #include <winimagebase.h> 25 #include <winres.h>26 25 #include <unicode.h> 27 26 #include <heapstring.h> … … 31 30 #define DBG_LOCALLOG DBG_winimgres 32 31 #include "dbglocal.h" 32 33 #define MAX_RES 17 34 char *ResTypes[MAX_RES] = 35 {"niks", "CURSOR", "BITMAP", "ICON", "MENU", "DIALOG", "STRING", 36 "FONTDIR", "FONT", "ACCELERATOR", "RCDATA", "MESSAGETABLE", 37 "GROUP_CURSOR", "niks", "GROUP_ICON", "niks", "VERSION"}; 33 38 34 39 //SvL: VPBuddy bugfix, seems to load bitmaps with type name 'DIB' … … 262 267 } 263 268 //****************************************************************************** 269 //Returns pointer to data of resource handle 270 //****************************************************************************** 271 char *Win32ImageBase::getResourceAddr(HRSRC hResource) 272 { 273 PIMAGE_RESOURCE_DATA_ENTRY pData = (PIMAGE_RESOURCE_DATA_ENTRY)hResource; 274 275 if(pData == NULL) { 276 DebugInt3(); 277 return NULL; 278 } 279 //ulRVAResourceSection contains the relative virtual address (relative to the start of the image) 280 //for the resource section (images loaded by the pe.exe and pe2lx/win32k) 281 //For LX images, this is 0 as OffsetToData contains a relative offset 282 return (char *)((char *)pResDir + (pData->OffsetToData - ulRVAResourceSection)); 283 } 284 //****************************************************************************** 285 //****************************************************************************** 286 ULONG Win32ImageBase::getResourceSize(HRSRC hResource) 287 { 288 PIMAGE_RESOURCE_DATA_ENTRY pData = (PIMAGE_RESOURCE_DATA_ENTRY)hResource; 289 290 if(pData == NULL) { 291 DebugInt3(); 292 return NULL; 293 } 294 return pData->Size; 295 } 296 //****************************************************************************** 297 //findResource returns the pointer of the resource's IMAGE_RESOURCE_DATA_ENTRY structure 264 298 //****************************************************************************** 265 299 HRSRC Win32ImageBase::findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG langid) 266 300 { 267 301 PIMAGE_RESOURCE_DATA_ENTRY pData = NULL; 268 Win32Resource *res;269 302 BOOL fNumType; 270 303 char *winres = NULL; … … 334 367 } 335 368 else dprintf(("FindResource %s: resource %d (type %d, lang %x)", szModule, id, type, lang)); 336 //ulRVAResourceSection contains the relative virtual address (relative to the start of the image) 337 //for the resource section (images loaded by the pe.exe and pe2lx/win32k) 338 //For LX images, this is 0 as OffsetToData contains a relative offset 339 char *resdata = (char *)((char *)pResDir + (pData->OffsetToData - ulRVAResourceSection)); 340 res = new Win32Resource(this, id, type, pData->Size, resdata); 341 342 return (HRSRC) res; 369 370 return (HRSRC) pData; 343 371 } 344 372 //****************************************************************************** … … 359 387 else astring2 = (char *)lpszType; 360 388 361 hres = (HRSRC)findResourceA(astring1, astring2, lang);389 hres = findResourceA(astring1, astring2, lang); 362 390 363 391 if(HIWORD(astring1)) FreeAsciiString(astring1);
Note:
See TracChangeset
for help on using the changeset viewer.