Ignore:
Timestamp:
Aug 20, 1999, 1:52:44 PM (26 years ago)
Author:
sandervl
Message:

PE loader resource fixes

File:
1 edited

Legend:

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

    r589 r597  
    1 /* $Id: winres.cpp,v 1.9 1999-08-19 19:50:41 sandervl Exp $ */
     1/* $Id: winres.cpp,v 1.10 1999-08-20 11:52:44 sandervl Exp $ */
    22
    33/*
     
    88 *
    99 * Project Odin Software License can be found in LICENSE.TXT
     10 *
    1011 *
    1112 */
     
    3132#include "cvtresource.h"
    3233
     34//******************************************************************************
     35//******************************************************************************
    3336static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy)
    3437{
     
    155158    return;
    156159  }
    157   memcpy(winresdata, resdata, size);
     160  OS2ResHandle = 0;
     161
     162  if(type == NTRT_STRING) {
     163        memcpy(winresdata, resdata, size-sizeof(WCHAR));
     164        ((USHORT *)winresdata)[size/sizeof(WCHAR)-1] = 0;
     165  }
     166  else  memcpy(winresdata, resdata, size);
    158167}
    159168//******************************************************************************
     
    253262
    254263  if(winresdata == NULL) {
    255     rc = DosGetResource((HMODULE)module->hinstance, os2type, id, (PPVOID)&resdata);
    256     if(rc) {
    257         dprintf(("Can't find original string!!!\n"));
    258         return(NULL);
    259     }
    260     winresdata = (char *)malloc(ressize);
    261     memcpy(winresdata, resdata, ressize);
     264        rc = DosGetResource((HMODULE)module->hinstance, os2type, id, (PPVOID)&resdata);
     265        if(rc) {
     266                dprintf(("Can't find original resource!!!\n"));
     267                return(NULL);
     268        }
     269        winresdata = (char *)malloc(ressize);
     270        memcpy(winresdata, resdata, ressize);
    262271  }
    263272  if(resdata)
    264     DosFreeResource(resdata);
     273        DosFreeResource(resdata);
     274
    265275  return winresdata;
    266276}
     
    321331    case NTRT_FONT:
    322332    case NTRT_MESSAGETABLE:
    323     case NTRT_STRING:
    324333    case NTRT_RCDATA:
    325334    case NTRT_VERSION:
     335    case NTRT_STRING:
     336        break;
     337
    326338    default:
    327339        break;
Note: See TracChangeset for help on using the changeset viewer.