Changeset 1613 for trunk/src


Ignore:
Timestamp:
Nov 5, 1999, 1:54:50 PM (26 years ago)
Author:
sandervl
Message:

string resource loading changes

File:
1 edited

Legend:

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

    r1454 r1613  
    1 /* $Id: winimgres.cpp,v 1.25 1999-10-26 11:15:33 sandervl Exp $ */
     1/* $Id: winimgres.cpp,v 1.26 1999-11-05 12:54:50 sandervl Exp $ */
    22
    33/*
     
    238238 char  *winres = NULL;
    239239 ULONG  id, type;
    240  int    i, stringid = -1, j;
     240 int    i, j;
    241241
    242242    fNumType = TRUE;    //assume numeric
     
    260260    else  type = (ULONG)lpszType;
    261261
    262     //String format: tables of 16 strings stored as one resource
    263     //upper 12 bits of resource id passed by user determines block (res id)
    264     //lower 4 bits are an index into the string table
    265     if(fNumType) {
    266         if(type == NTRT_STRING) {
    267             stringid = (ULONG)lpszName & 0xF;
    268             id       = (((ULONG)lpszName) >> 4)+1;
    269         }
    270         else id = (ULONG)lpszName;
    271     }
    272     else {
    273         if(stricmp((char *)type, ResTypes[NTRT_STRING]) == 0) {
    274             stringid = (ULONG)lpszName & 0xF;
    275             id       = (((ULONG)lpszName) >> 4)+1;
    276         }
    277         else id = (ULONG)lpszName;
    278     }
     262    id = (ULONG)lpszName;
    279263
    280264    pData = getPEResourceEntry(id, type, lang);
     
    290274    //For LX images, this is 0 as OffsetToData contains a relative offset
    291275    char *resdata = (char *)((char *)pResDir + pData->OffsetToData - pResourceSectionStart);
    292     if(stringid != -1) {//search for string in table
    293         USHORT *unicodestr = (USHORT *)resdata;
    294 
    295         for(i=0;i<stringid;i++) {
    296             unicodestr += *unicodestr+1;
    297         }
    298         res = new Win32Resource(this, id, NTRT_STRING, (*unicodestr+1)*sizeof(WCHAR),
    299                                 (char *)(unicodestr+1));
    300         if(res == NULL) {
    301             dprintf(("new Win32Resource failed!\n"));
    302             return(NULL);
    303         }
    304     }
    305     else
    306     {
    307         res = new Win32Resource(this, id, type, pData->Size, resdata);
    308     }
     276    res = new Win32Resource(this, id, type, pData->Size, resdata);
    309277
    310278    return (HRSRC) res;
Note: See TracChangeset for help on using the changeset viewer.