Changeset 576 for trunk/src


Ignore:
Timestamp:
Aug 19, 1999, 2:53:19 PM (26 years ago)
Author:
sandervl
Message:

PE Resource changes

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/makefile

    r510 r576  
    1 # $Id: makefile,v 1.18 1999-08-16 16:28:02 sandervl Exp $
     1# $Id: makefile,v 1.19 1999-08-19 12:53:18 sandervl Exp $
    22
    33#
     
    343343
    344344pefile.OBJ:    pefile.cpp $(PDWIN32_INCLUDE)\pefile.h
    345 winimage.OBJ:  winimage.cpp $(PDWIN32_INCLUDE)\winimage.h $(PDWIN32_INCLUDE)\windll.h $(PDWIN32_INCLUDE)\pefile.h
     345winimage.OBJ:  winimage.cpp $(PDWIN32_INCLUDE)\winimage.h $(PDWIN32_INCLUDE)\windll.h $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winres.h
    346346winimgres.OBJ: winimgres.cpp $(PDWIN32_INCLUDE)\winimage.h $(PDWIN32_INCLUDE)\windll.h $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winexe.h $(PDWIN32_INCLUDE)\winres.h
    347347windll.OBJ:    windll.cpp $(PDWIN32_INCLUDE)\winimage.h $(PDWIN32_INCLUDE)\windll.h
  • trunk/src/kernel32/winimgres.cpp

    r571 r576  
    1 /* $Id: winimgres.cpp,v 1.8 1999-08-19 10:25:27 sandervl Exp $ */
     1/* $Id: winimgres.cpp,v 1.9 1999-08-19 12:53:18 sandervl Exp $ */
    22
    33/*
     
    129129  }
    130130  if(pData == NULL) {
    131     dprintf(("getResource: res not found!\n"));
    132     return(NULL);
     131        dprintf(("getResource: res not found!\n"));
     132        return(NULL);
    133133  }
    134134
    135135  char *resdata = (char *)((char *)pResDir + pData->OffsetToData - pResSection->virtaddr);
    136136  if(stringid != -1) {//search for string in table
    137     USHORT *unicodestr = (USHORT *)resdata;
    138 
    139     for(i=0;i<stringid;i++) {
    140         unicodestr += *unicodestr;
    141     }
    142     res = new Win32Resource(this, id, NTRT_STRING, (ULONG)*unicodestr, (char *)unicodestr);
    143     if(res == NULL) {
    144         dprintf(("new Win32Resource failed!\n"));
    145         return(NULL);
    146     }
     137        USHORT *unicodestr = (USHORT *)resdata;
     138
     139        for(i=0;i<stringid;i++) {
     140                unicodestr += *unicodestr;
     141        }
     142        res = new Win32Resource(this, id, NTRT_STRING, (ULONG)*unicodestr, (char *)unicodestr);
     143        if(res == NULL) {
     144                dprintf(("new Win32Resource failed!\n"));
     145                return(NULL);
     146        }
    147147  }
    148148  else  res = new Win32Resource(this, id, type, pData->Size, resdata);
  • trunk/src/kernel32/winres.cpp

    r419 r576  
    1 /* $Id: winres.cpp,v 1.6 1999-08-05 11:44:35 sandervl Exp $ */
     1/* $Id: winres.cpp,v 1.7 1999-08-19 12:53:19 sandervl Exp $ */
    22
    33/*
     
    8383//******************************************************************************
    8484Win32Resource::Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type) :
    85         os2resdata(NULL), winresdata(NULL)
     85        os2resdata(NULL), winresdata(NULL), resType(RSRC_PE2LX)
    8686{
    8787 APIRET rc;
     
    139139Win32Resource::Win32Resource(Win32Image *module, ULONG id, ULONG type,
    140140                 ULONG size, char *resdata) : hres(NULL),
    141         os2resdata(NULL), winresdata(NULL)
     141        os2resdata(NULL), winresdata(NULL), resType(RSRC_PELOADER)
    142142{
    143143  next           = module->winres;
     
    162162 Win32Resource *res = module->winres;
    163163
    164 #if 0
    165164  //returned by DosGetResource, so we don't (and mustn't) free it
    166   if(os2resdata)    free(os2resdata);
    167 #endif
     165  if(os2resdata && resType == RSRC_PELOADER)   
     166        free(os2resdata);
     167
    168168  if(winresdata)    free(winresdata);
    169169
Note: See TracChangeset for help on using the changeset viewer.