Changeset 3625 for trunk/src


Ignore:
Timestamp:
May 28, 2000, 6:45:14 PM (25 years ago)
Author:
sandervl
Message:

resource handling changes

Location:
trunk/src
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.DEF

    r3461 r3625  
    1 ; $Id: KERNEL32.DEF,v 1.80 2000-04-29 18:26:56 sandervl Exp $
     1; $Id: KERNEL32.DEF,v 1.81 2000-05-28 16:45:11 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    10851085    CPUFeatures          @2005
    10861086    InitSystemAndRegistry__Fv @2006
     1087    _ConvertResourceToOS2@12  @2007
    10871088
    10881089;registry apis imported by advapi32
  • trunk/src/kernel32/cvtcursorgrp.cpp

    r3101 r3625  
    1 /* $Id: cvtcursorgrp.cpp,v 1.9 2000-03-13 13:10:09 sandervl Exp $ */
     1/* $Id: cvtcursorgrp.cpp,v 1.10 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    2323#include <string.h>
    2424#include <win32type.h>
     25#include <win32api.h>
     26#include <winconst.h>
    2527#include <wincursor.h>
    26 #include <winres.h>
    2728#include <misc.h>
    2829#include "cvtresource.h"
     30#include <winres.h>
    2931
    3032#define DBG_LOCALLOG    DBG_cvtcursorgrp
    3133#include "dbglocal.h"
    32 
    33 HRSRC WIN32API FindResourceA(HINSTANCE hModule, LPCSTR lpszName, LPCSTR lpszType);
    3434
    3535//******************************************************************************
     
    4141 BITMAPARRAYFILEHEADER2 *bafh, *orgbafh;
    4242 CursorComponent       *cursorhdr;
    43  Win32Resource         *winres;
    4443 void                  *os2cursor;
     44 HRSRC                  hRes;
    4545
    4646  dprintf(("ConvertCursorGroup"));
     
    5353        dprintf2(("Bits    : %d", rdir->wBitCount));
    5454        dprintf2(("ResBytes: %d", rdir->lBytesInRes));
    55         winres     = (Win32Resource *)FindResourceA(module->getInstanceHandle(),
    56                                                     (LPCSTR)rdir->wNameOrdinal,
    57                                                     (LPSTR)NTRT_CURSOR);
    58         groupsize += winres->getOS2Size();
     55        hRes = FindResourceA(module->getInstanceHandle(),
     56                            (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_CURSOR);
     57
     58        groupsize += QueryConvertedResourceSize(module->getInstanceHandle(), (char *)NTRT_CURSOR, hRes);
    5959        rdir++;
    6060  }
     
    6868        bafh->cxDisplay = 0;
    6969        bafh->cyDisplay = 0;
    70         winres          = (Win32Resource *)FindResourceA(module->getInstanceHandle(),
    71                                                          (LPCSTR)rdir->wNameOrdinal,
    72                                                          (LPSTR)NTRT_CURSOR);
    73         if(winres == NULL) {
     70        hRes = FindResourceA(module->getInstanceHandle(),
     71                            (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_CURSOR);
     72
     73        if(hRes == NULL) {
    7474                dprintf(("Can't find cursor!"));
    7575                rdir++;
     
    7777        }
    7878
    79         cursorhdr = (CursorComponent *)winres->lockResource();
    80         os2cursor = ConvertCursor(cursorhdr, winres->getSize(), &os2cursorsize, (int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2));
     79        cursorhdr = (CursorComponent *)LockResource(LoadResource(module->getInstanceHandle(), hRes));
     80        os2cursor = ConvertCursor(cursorhdr, SizeofResource(module->getInstanceHandle(), hRes), &os2cursorsize, (int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2));
    8181
    8282        if(os2cursor == NULL) {
    8383                dprintf(("Can't convert cursor!"));
    84                 delete winres;
    8584                rdir++;
    8685                continue;
     
    9695
    9796        bafh = (BITMAPARRAYFILEHEADER2 *)((int)&bafh->bfh2 + os2cursorsize);
    98         delete winres;
    9997
    10098        rdir++;
  • trunk/src/kernel32/cvticongrp.cpp

    r2802 r3625  
    1 /* $Id: cvticongrp.cpp,v 1.6 2000-02-16 14:25:37 sandervl Exp $ */
     1/* $Id: cvticongrp.cpp,v 1.7 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    2323#include <string.h>
    2424#include <win32type.h>
     25#include <win32api.h>
     26#include <winconst.h>
    2527#include <winicon.h>
    26 #include <winres.h>
    2728#include <misc.h>
    2829#include "cvtresource.h"
     30#include <winres.h>
    2931
    3032#define DBG_LOCALLOG    DBG_cvticongrp
    3133#include "dbglocal.h"
    32 
    33 HRSRC WIN32API FindResourceA(HINSTANCE hModule, LPCSTR lpszName, LPCSTR lpszType);
    3434
    3535//******************************************************************************
     
    4141 BITMAPARRAYFILEHEADER2 *bafh, *orgbafh;
    4242 WINBITMAPINFOHEADER    *iconhdr;
    43  Win32Resource          *winres;
    4443 void                   *os2icon;
     44 HRSRC                   hRes;
    4545
    4646  dprintf(("Icon Group type :%d", ihdr->wType));
     
    5353        dprintf2(("Bits    : %d", rdir->wBitCount));
    5454        dprintf2(("ResBytes: %d", rdir->lBytesInRes));
    55         winres     = (Win32Resource *)FindResourceA(module->getInstanceHandle(),
    56                                                    (LPCSTR)rdir->wNameOrdinal,
    57                                                    (LPSTR)NTRT_ICON);
    58         groupsize += winres->getOS2Size();
     55        hRes = FindResourceA(module->getInstanceHandle(),
     56                             (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_ICON);
     57
     58        groupsize += QueryConvertedResourceSize(module->getInstanceHandle(), (char *)NTRT_ICON, hRes);
    5959        rdir++;
    6060  }
     
    6868        bafh->cxDisplay = 0;
    6969        bafh->cyDisplay = 0;
    70         winres          = (Win32Resource *)FindResourceA(module->getInstanceHandle(),
    71                                                          (LPCSTR)rdir->wNameOrdinal,
    72                                                          (LPSTR)NTRT_ICON);
    73         if(winres == NULL) {
     70        hRes = FindResourceA(module->getInstanceHandle(),
     71                             (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_ICON);
     72
     73        if(hRes == NULL) {
    7474                dprintf(("Can't find icon!"));
    7575                rdir++;
     
    7777        }
    7878
    79         iconhdr = (WINBITMAPINFOHEADER *)winres->lockResource();
    80         os2icon = ConvertIcon(iconhdr, winres->getSize(), &os2iconsize, (int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2));
     79        iconhdr = (WINBITMAPINFOHEADER *)LockResource(LoadResource(module->getInstanceHandle(), hRes));
     80        os2icon = ConvertIcon(iconhdr, SizeofResource(module->getInstanceHandle(), hRes), &os2iconsize, (int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2));
    8181
    8282        if(os2icon == NULL) {
    8383                dprintf(("Can't convert icon!"));
    84                 delete winres;
    8584                rdir++;
    8685                continue;
     
    9695
    9796        bafh = (BITMAPARRAYFILEHEADER2 *)((int)&bafh->bfh2 + os2iconsize);
    98         delete winres;
    9997
    10098        rdir++;
  • trunk/src/kernel32/directory.cpp

    r3611 r3625  
    1 /* $Id: directory.cpp,v 1.21 2000-05-26 18:53:18 sandervl Exp $ */
     1/* $Id: directory.cpp,v 1.22 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    381381    tmp[len -1] = 0;
    382382
    383   dprintf(("RemoveDirectory %S", arg1));
     383  dprintf(("RemoveDirectory %s", arg1));
    384384
    385385  return O32_RemoveDirectory(tmp);
  • trunk/src/kernel32/pefile.cpp

    r2802 r3625  
    1 /* $Id: pefile.cpp,v 1.7 2000-02-16 14:23:11 sandervl Exp $ */
     1/* $Id: pefile.cpp,v 1.8 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    1515#include <pefile.h>
    1616#include <misc.h>
    17 #include <winres.h>
    1817
    1918#define DBG_LOCALLOG    DBG_pefile
  • trunk/src/kernel32/resource.cpp

    r2803 r3625  
    1 /* $Id: resource.cpp,v 1.15 2000-02-16 14:25:45 sandervl Exp $ */
     1/* $Id: resource.cpp,v 1.16 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    1313#include <os2win.h>
    1414#include <unicode.h>
    15 #include "winres.h"
    1615#include <winimagebase.h>
    1716#include <winexebase.h>
     
    7170 *****************************************************************************/
    7271
    73 HRSRC  WIN32API FindResourceExA( HMODULE hModule, LPCSTR lpType,
    74                                     LPCSTR lpName, WORD wLanguage)
     72HRSRC WIN32API FindResourceExA( HMODULE hModule, LPCSTR lpType,
     73                                LPCSTR lpName, WORD wLanguage)
    7574{
    7675 Win32ImageBase *module;
     
    105104 *****************************************************************************/
    106105
    107 HRSRC  WIN32API FindResourceExW(HMODULE hModule,
    108                                 LPCWSTR lpType,
    109                                 LPCWSTR lpName,
    110                                 WORD    wLanguage)
     106HRSRC WIN32API FindResourceExW(HMODULE hModule,
     107                               LPCWSTR lpType,
     108                               LPCWSTR lpName,
     109                               WORD    wLanguage)
    111110{
    112111 Win32ImageBase *module;
     
    117116          return(NULL);
    118117    }
    119 
    120118    return module->findResourceW((LPWSTR)lpName, (LPWSTR)lpType, wLanguage);
    121119}
     
    128126}
    129127//******************************************************************************
     128//hRes == returned by FindResource(Ex) = PIMAGE_RESOURCE_DATA_ENTRY for resource
     129//******************************************************************************
     130HGLOBAL WIN32API LoadResource(HINSTANCE hModule, HRSRC hRes)
     131{
     132  Win32ImageBase *module;
     133
     134  /* @@@PH */
     135  if(HIWORD(hRes) == NULL) {
     136        dprintf(("ERROR: LoadResource %x: invalid hRes %x", hModule, hRes));
     137        return 0;
     138  }
     139
     140  dprintf(("LoadResource %x %X\n", hModule, hRes));
     141  if(hModule == 0 || hModule == -1 || (WinExe && hModule == WinExe->getInstanceHandle())) {
     142        module = (Win32ImageBase *)WinExe;
     143  }
     144  else {
     145        module = (Win32ImageBase *)Win32DllBase::findModule(hModule);
     146  }
     147
     148  return (HGLOBAL)module->getResourceAddr(hRes);
     149}
     150//******************************************************************************
    130151//hRes == returned by FindResource(Ex)
    131152//******************************************************************************
    132 HGLOBAL WIN32API LoadResource(HINSTANCE hModule, HRSRC hRes)
    133 {
    134   Win32Resource *res = (Win32Resource *)hRes;
    135 
    136   dprintf(("LoadResource %x %X\n", hModule, hRes));
    137 
    138   /* @@@PH */
    139   if (HIWORD(res) == NULL) {
    140    dprintf(("LoadResource %x: invalid hRes %x", hModule, hRes));
    141    return 0;
    142   }
    143   else  return (HGLOBAL)res->lockResource();
    144 }
    145 //******************************************************************************
    146 //hRes == returned by FindResource(Ex)
    147 //******************************************************************************
    148153DWORD WIN32API SizeofResource(HINSTANCE hModule, HRSRC hRes)
    149154{
    150  Win32Resource *res = (Win32Resource *)hRes;
    151 
    152     dprintf(("OS2SizeofResource\n"));
    153     if(res == NULL)
    154     return(0);
    155 
    156     return res->getSize();
     155 Win32ImageBase *module;
     156
     157  if(hRes == NULL) {
     158        dprintf(("ERROR: SizeofResource %x: invalid hRes %x", hModule, hRes));
     159        return(0);
     160  }
     161
     162  dprintf(("SizeofResource %x %x", hModule, hRes));
     163
     164  if(hModule == 0 || hModule == -1 || (WinExe && hModule == WinExe->getInstanceHandle())) {
     165        module = (Win32ImageBase *)WinExe;
     166  }
     167  else {
     168        module = (Win32ImageBase *)Win32DllBase::findModule(hModule);
     169  }
     170
     171  return module->getResourceSize(hRes);
    157172}
    158173//******************************************************************************
  • trunk/src/kernel32/winimagebase.cpp

    r3609 r3625  
    1 /* $Id: winimagebase.cpp,v 1.20 2000-05-26 18:42:56 sandervl Exp $ */
     1/* $Id: winimagebase.cpp,v 1.21 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    3232#include <pefile.h>
    3333#include <unicode.h>
    34 #include <winres.h>
    3534#include "oslibmisc.h"
    3635#include "oslibdos.h"
     
    4746    errorState(NO_ERROR), entryPoint(0), fullpath(NULL),
    4847    tlsAddress(0), tlsIndexAddr(0), tlsInitSize(0), tlsTotalSize(0),
    49     tlsCallBackAddr(0), tlsIndex(-1), winres(NULL), pResDir(NULL),
     48    tlsCallBackAddr(0), tlsIndex(-1), pResDir(NULL),
    5049    ulRVAResourceSection(0)
    5150{
     
    7877Win32ImageBase::~Win32ImageBase()
    7978{
    80  Win32Resource *res;
    81 
    82   while(winres)
    83   {
    84         res    = winres->next;
    85         delete(winres);
    86         winres = res;
    87   }
    8879  if(fullpath)
    8980        free(fullpath);
  • trunk/src/kernel32/winimagebase.h

    r3609 r3625  
    1 /* $Id: winimagebase.h,v 1.9 2000-05-26 18:42:56 sandervl Exp $ */
     1/* $Id: winimagebase.h,v 1.10 2000-05-28 16:45:12 sandervl Exp $ */
    22
    33/*
     
    6767        char *getModuleName()         { return szModule; };
    6868
     69        //findResource returns the pointer of the resource's IMAGE_RESOURCE_DATA_ENTRY structure
    6970virtual HRSRC findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
    7071        HRSRC findResourceW(LPWSTR lpszName, LPWSTR lpszType, ULONG lang = LANG_GETFIRST);
     72
    7173virtual ULONG getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
    7274        ULONG getResourceSizeW(LPCWSTR lpszName, LPWSTR lpszType, ULONG lang = LANG_GETFIRST);
     
    8082virtual ULONG getVersionSize();
    8183virtual BOOL  getVersionStruct(char *verstruct, ULONG bufLength);
     84
     85        //Returns pointer to data of resource handle
     86        char *getResourceAddr(HRSRC hResource);
     87        ULONG getResourceSize(HRSRC hResource);
    8288
    8389static  BOOL  isPEImage(char *szFileName);
     
    118124        void tlsAlloc();                //Allocate TLS index for this module
    119125        void tlsDelete();               //Destroy TLS index for this module
    120 
    121         Win32Resource        *winres;
    122126
    123127        ULONG                 errorState, entryPoint;
  • trunk/src/kernel32/winimagelx.cpp

    r2802 r3625  
    1 /* $Id: winimagelx.cpp,v 1.6 2000-02-16 14:22:12 sandervl Exp $ */
     1/* $Id: winimagelx.cpp,v 1.7 2000-05-28 16:45:13 sandervl Exp $ */
    22
    33/*
     
    3333#include <pefile.h>
    3434#include <unicode.h>
    35 #include <winres.h>
    3635#include "oslibmisc.h"
    3736#include "initterm.h"
  • trunk/src/kernel32/winimagepeldr.cpp

    r3609 r3625  
    1 /* $Id: winimagepeldr.cpp,v 1.43 2000-05-26 18:42:56 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.44 2000-05-28 16:45:13 sandervl Exp $ */
    22
    33/*
     
    4343#include <pefile.h>
    4444#include <unicode.h>
    45 #include <winres.h>
    4645#include "oslibmisc.h"
    4746#include "initterm.h"
  • trunk/src/kernel32/winimgres.cpp

    r3588 r3625  
    1 /* $Id: winimgres.cpp,v 1.37 2000-05-22 19:08:00 sandervl Exp $ */
     1/* $Id: winimgres.cpp,v 1.38 2000-05-28 16:45:13 sandervl Exp $ */
    22
    33/*
     
    2323#include <misc.h>
    2424#include <winimagebase.h>
    25 #include <winres.h>
    2625#include <unicode.h>
    2726#include <heapstring.h>
     
    3130#define DBG_LOCALLOG    DBG_winimgres
    3231#include "dbglocal.h"
     32
     33#define MAX_RES 17
     34char *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"};
    3338
    3439//SvL: VPBuddy bugfix, seems to load bitmaps with type name 'DIB'
     
    262267}
    263268//******************************************************************************
     269//Returns pointer to data of resource handle
     270//******************************************************************************
     271char *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//******************************************************************************
     286ULONG 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
    264298//******************************************************************************
    265299HRSRC Win32ImageBase::findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG langid)
    266300{
    267301 PIMAGE_RESOURCE_DATA_ENTRY      pData = NULL;
    268  Win32Resource                  *res;
    269302 BOOL   fNumType;
    270303 char  *winres = NULL;
     
    334367    }
    335368    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;
    343371}
    344372//******************************************************************************
     
    359387    else    astring2 = (char *)lpszType;
    360388
    361     hres = (HRSRC) findResourceA(astring1, astring2, lang);
     389    hres = findResourceA(astring1, astring2, lang);
    362390
    363391    if(HIWORD(astring1)) FreeAsciiString(astring1);
  • trunk/src/kernel32/winres.cpp

    r2802 r3625  
    1 /* $Id: winres.cpp,v 1.26 2000-02-16 14:22:12 sandervl Exp $ */
     1/* $Id: winres.cpp,v 1.27 2000-05-28 16:45:14 sandervl Exp $ */
    22
    33/*
     
    2626#define INCL_WINRES
    2727#include <win32type.h>
     28#include <win32api.h>
     29#include <winconst.h>
    2830#include <winres.h>
    2931#include <misc.h>
    30 #include <winexepe2lx.h>
    31 #include <windllpe2lx.h>
     32#include <winimagebase.h>
     33#include <winexebase.h>
     34#include <windllbase.h>
    3235#include "cvtresource.h"
    33 #include <vmutex.h>
    3436
    3537#define DBG_LOCALLOG    DBG_winres
    3638#include "dbglocal.h"
    3739
    38 VMutex resmutex;
    39 
    40 char *ResTypes[MAX_RES] =
    41       {"niks", "CURSOR", "BITMAP", "ICON", "MENU", "DIALOG", "STRING",
    42        "FONTDIR", "FONT", "ACCELERATOR", "RCDATA",  "MESSAGETABLE",
    43        "GROUP_CURSOR", "niks", "GROUP_ICON", "niks", "VERSION"};
    44 
    4540//******************************************************************************
    4641//******************************************************************************
    47 Win32Resource::Win32Resource() :
    48         os2resdata(NULL), winresdata(NULL), resType(RSRC_CUSTOMNODATA)
     42PVOID WIN32API ConvertResourceToOS2(HINSTANCE hInstance, LPSTR restype, HRSRC hResource)
    4943{
    50   next       = NULL;
    51   module     = NULL;
     44 PIMAGE_RESOURCE_DATA_ENTRY pData = (PIMAGE_RESOURCE_DATA_ENTRY)hResource;
     45 Win32ImageBase *module;
     46 char           *resdata;
     47 int             ressize, cvtressize;
    5248
    53   id         = -1;
    54   type       = -1;
    55   hres       = 0;
    56   OS2ResHandle = 0;
    57   //resources are in Unicode format by default; indirectly created resources
    58   //can also be in ascii format
    59   isUnicode  = TRUE;
    60 }
    61 //******************************************************************************
    62 //******************************************************************************
    63 Win32Resource::Win32Resource(Win32ImageBase *module, ULONG id, ULONG type,
    64                  ULONG size, char *resdata) : hres(NULL),
    65         os2resdata(NULL), winresdata(NULL), resType(RSRC_PELOADER)
    66 {
    67   resmutex.enter();
    68   next           = module->winres;
    69   module->winres = this;
    70   resmutex.leave();
    71 
    72   this->module   = module;
    73   this->id       = id;
    74   this->type     = type;
    75   this->ressize  = size;
    76   winresdata     = (char *)malloc(size+sizeof(WCHAR));
    77   if(winresdata == NULL) {
    78     DebugInt3();
    79     return;
    80   }
    81   OS2ResHandle = 0;
    82 
    83   if(type == NTRT_STRING) {
    84         memcpy(winresdata, resdata, size);
    85         ((USHORT *)winresdata)[size/sizeof(WCHAR)] = 0;
    86 //        ((USHORT *)winresdata)[size/sizeof(WCHAR)-1] = 0;
    87   }
    88   else  memcpy(winresdata, resdata, size);
    89 
    90   //resources are in Unicode format by default
    91   isUnicode  = TRUE;
    92 }
    93 //******************************************************************************
    94 //******************************************************************************
    95 Win32Resource::~Win32Resource()
    96 {
    97  Win32Resource *res = module->winres;
    98 
    99   if(os2resdata && (resType == RSRC_PELOADER || resType == RSRC_CUSTOMINDIRECT))
    100     free(os2resdata);
    101 
    102   if(winresdata)    free(winresdata);
    103 
    104   resmutex.enter();
    105   if(res == this) {
    106     module->winres = res->next;
     49  if(hInstance == 0 || hInstance == -1 || (WinExe && hInstance == WinExe->getInstanceHandle())) {
     50        module = (Win32ImageBase *)WinExe;
    10751  }
    10852  else {
    109     while(res->next != this) {
    110         res  = res->next;
    111     }
    112     if(res)
    113         res->next = next;
     53        module = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
    11454  }
    115   resmutex.leave();
    116 }
    117 //******************************************************************************
    118 //******************************************************************************
    119 PVOID Win32Resource::lockResource()
    120 {
    121   dprintf(("Win32Resource::lockResource %d %x\n", id, winresdata));
     55  resdata = (char *)LockResource(LoadResource(hInstance, hResource));
     56  ressize = SizeofResource(hInstance, hResource);
    12257
    123   if(winresdata)
    124     return(winresdata);
    125 
    126   dprintf(("Win32Resource::lockResource: NO windows resource!"));
    127   return NULL;
    128 }
    129 //******************************************************************************
    130 //******************************************************************************
    131 PVOID Win32Resource::lockOS2Resource()
    132 {
    133  APIRET rc;
    134  PVOID  resdata;
    135 
    136    dprintf(("Win32Resource::lockOS2Resource %d\n", id));
    137    if(os2resdata == NULL) {
    138         os2resdata = convertResource(winresdata);
    139    }
    140    return os2resdata;
    141 }
    142 //******************************************************************************
    143 //return size of converted win32 resource
    144 //******************************************************************************
    145 ULONG Win32Resource::getOS2Size()
    146 {
    147   switch(type) {
     58  switch((int)restype) {
    14859    case NTRT_NEWBITMAP:
    14960    case NTRT_BITMAP:
    150         return QueryConvertedBitmapSize((WINBITMAPINFOHEADER *)winresdata, ressize);
     61        return ConvertBitmap((WINBITMAPINFOHEADER *)resdata, ressize, (PULONG)&cvtressize);
    15162
    15263    case NTRT_CURSOR:
    153         return QueryConvertedCursorSize((CursorComponent *)winresdata, ressize);
     64        return ConvertCursor((CursorComponent *)resdata, ressize, &cvtressize);
     65
     66    case NTRT_GROUP_CURSOR:
     67        return ConvertCursorGroup((CursorHeader *)resdata, ressize, module);
     68
     69    case NTRT_GROUP_ICON:
     70        return ConvertIconGroup((IconHeader *)resdata, ressize, module);
    15471
    15572    case NTRT_ICON:
    156         return QueryConvertedIconSize((WINBITMAPINFOHEADER *)winresdata, ressize);
    157 
    158     case NTRT_GROUP_ICON:
    159     case NTRT_GROUP_CURSOR:
    160     case NTRT_ACCELERATORS:
    161     case NTRT_NEWMENU:
    162     case NTRT_MENU:
    163     case NTRT_NEWDIALOG:
    164     case NTRT_DIALOG:
    165     case NTRT_FONTDIR:
    166     case NTRT_FONT:
    167     case NTRT_MESSAGETABLE:
    168     case NTRT_RCDATA:
    169     case NTRT_VERSION:
    170     case NTRT_STRING:
    171     default:
    172         dprintf(("Win32Resource::getOS2Size SHOULDN'T BE CALLED for this resource type (%d) (NOT IMPLEMENTED)!!", type));
    173         break;
    174   }
    175   return 0;
    176 }
    177 //******************************************************************************
    178 //******************************************************************************
    179 PVOID Win32Resource::convertResource(void *win32res)
    180 {
    181  int cvtressize;
    182 
    183   switch(type) {
    184     case NTRT_NEWBITMAP:
    185     case NTRT_BITMAP:
    186         return ConvertBitmap((WINBITMAPINFOHEADER *)win32res, ressize, &ressize);
    187 
    188     case NTRT_CURSOR:
    189         return ConvertCursor((CursorComponent *)win32res, ressize, &cvtressize);
    190 
    191     case NTRT_GROUP_CURSOR:
    192         return ConvertCursorGroup((CursorHeader *)win32res, ressize, module);
    193 
    194     case NTRT_GROUP_ICON:
    195         return ConvertIconGroup((IconHeader *)win32res, ressize, module);
    196 
    197     case NTRT_ICON:
    198         return ConvertIcon((WINBITMAPINFOHEADER *)win32res, ressize, &cvtressize);
     73        return ConvertIcon((WINBITMAPINFOHEADER *)resdata, ressize, &cvtressize);
    19974
    20075    case NTRT_ACCELERATORS:
    201         return ConvertAccelerator((WINACCEL *)win32res, ressize);
     76        return ConvertAccelerator((WINACCEL *)resdata, ressize);
    20277
    20378    case NTRT_NEWMENU:
     
    21691        break;
    21792  }
    218   dprintf(("Win32Resource::convertResource: Can't convert resource %d (type %d)", id, type));
     93  dprintf(("ConvertResourceToOS2: Can't convert resource %x (inst %x)", hResource, hInstance));
    21994  return 0;
    22095}
    22196//******************************************************************************
    22297//******************************************************************************
    223 void Win32Resource::destroyAll(Win32ImageBase *module)
     98ULONG WIN32API QueryConvertedResourceSize(HINSTANCE hInstance, LPSTR restype, HRSRC hResource)
    22499{
    225  Win32Resource *res = module->winres, *next;
     100 PIMAGE_RESOURCE_DATA_ENTRY pData = (PIMAGE_RESOURCE_DATA_ENTRY)hResource;
     101 Win32ImageBase *module;
     102 char           *resdata;
     103 int             ressize, cvtressize;
    226104
    227    while(res) {
    228     next = res->next;
    229     delete(res);
    230     res  = next;
    231    }
     105  if(hInstance == 0 || hInstance == -1 || (WinExe && hInstance == WinExe->getInstanceHandle())) {
     106        module = (Win32ImageBase *)WinExe;
     107  }
     108  else {
     109        module = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
     110  }
     111  resdata = (char *)LockResource(LoadResource(hInstance, hResource));
     112  ressize = SizeofResource(hInstance, hResource);
     113
     114  switch((int)restype) {
     115    case NTRT_NEWBITMAP:
     116    case NTRT_BITMAP:
     117        return QueryConvertedBitmapSize((WINBITMAPINFOHEADER *)resdata, ressize);
     118
     119    case NTRT_CURSOR:
     120        return QueryConvertedCursorSize((CursorComponent *)resdata, ressize);
     121
     122    case NTRT_ICON:
     123        return QueryConvertedIconSize((WINBITMAPINFOHEADER *)resdata, ressize);
     124
     125    case NTRT_GROUP_ICON:
     126    case NTRT_GROUP_CURSOR:
     127    case NTRT_ACCELERATORS:
     128    case NTRT_NEWMENU:
     129    case NTRT_MENU:
     130    case NTRT_NEWDIALOG:
     131    case NTRT_DIALOG:
     132    case NTRT_FONTDIR:
     133    case NTRT_FONT:
     134    case NTRT_MESSAGETABLE:
     135    case NTRT_RCDATA:
     136    case NTRT_VERSION:
     137    case NTRT_STRING:
     138    default:
     139        dprintf(("Win32Resource::getOS2Size SHOULDN'T BE CALLED for this resource type (%d) (NOT IMPLEMENTED)!!", restype));
     140        break;
     141  }
     142  return 0;
    232143}
    233144//******************************************************************************
  • trunk/src/user32/loadres.cpp

    r3482 r3625  
    1 /* $Id: loadres.cpp,v 1.28 2000-05-02 20:50:48 sandervl Exp $ */
     1/* $Id: loadres.cpp,v 1.29 2000-05-28 16:43:45 sandervl Exp $ */
    22
    33/*
     
    2020#include <os2win.h>
    2121#include <user32.h>
    22 #include <winres.h>
    2322#include <heapstring.h>
    2423#include <oslibres.h>
     
    2726#include "initterm.h"
    2827#include <win\cursoricon.h>
     28#include <winres.h>
    2929
    3030#define DBG_LOCALLOG    DBG_loadres
     
    6060int WIN32API LoadStringW(HINSTANCE hinst, UINT wID, LPWSTR lpBuffer, int cchBuffer)
    6161{
    62  Win32Resource *winres;
    6362 WCHAR *p;
    6463 int string_num;
    6564 int i = 0;
     65 HRSRC hRes;
    6666
    6767    /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out
    6868     * 20 - 31. */
    69     winres = (Win32Resource *)FindResourceW(hinst, (LPWSTR)(((wID>>4)&0xffff)+1), RT_STRINGW);
    70     if(winres == NULL) {
     69    hRes = FindResourceW(hinst, (LPWSTR)(((wID>>4)&0xffff)+1), RT_STRINGW);
     70    if(hRes == NULL) {
    7171        dprintf(("LoadStringW NOT FOUND from %X, id %d buffersize %d\n", hinst, wID, cchBuffer));
    7272        *lpBuffer = 0;
     
    7474    }
    7575
    76     p = (LPWSTR)winres->lockResource();
     76    p = (LPWSTR)LockResource(LoadResource(hinst, hRes));
    7777    if(p) {
    7878        string_num = wID & 0x000f;
     
    9393        }
    9494    }
    95     delete winres;
    9695
    9796#ifdef DEBUG_ENABLELOG_LEVEL2
     
    111110                DWORD cyDesired, DWORD fuLoad)
    112111{
    113  Win32Resource *winres;
    114112 HICON          hIcon;
    115113 HANDLE         hMapping = 0;
    116114 char          *ptr = NULL;
     115 HRSRC          hRes;
     116 LPSTR          restype = RT_ICONA;
    117117
    118118    if(fuLoad & LR_LOADFROMFILE)
     
    128128        if(!hinst)
    129129        {
    130                 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA);
    131                 if(!winres)
    132                         winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA);
    133                 if(winres)
     130                hRes = FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA);
     131                if(!hRes)  {
     132                        hRes = FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA);
     133                        restype = RT_GROUP_ICONA;
     134                }
     135                if(hRes)
    134136                {
    135                         hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
    136                         delete winres;
     137                        hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hInstanceUser32, restype, hRes));
    137138                }
    138                 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
     139                else    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
    139140        }
    140141        else
    141142        { //not a system icon
    142                 winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA);
    143                 if(winres == 0) {
    144                         winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA);
    145                 }
    146                 if(winres) {
    147                         hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
    148                         delete winres;
     143                hRes = FindResourceA(hinst,lpszIcon,RT_ICONA);
     144                if(!hRes) {
     145                        hRes = FindResourceA(hinst,lpszIcon,RT_GROUP_ICONA);
     146                        restype = RT_GROUP_ICONA;
     147                }
     148                if(hRes) {
     149                        hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hinst, restype, hRes));
    149150                }
    150151                else    hIcon = 0;
     
    160161                DWORD cyDesired, DWORD fuLoad)
    161162{
    162  Win32Resource *winres;
    163163 HICON          hIcon;
    164164 HANDLE         hMapping = 0;
    165165 char          *ptr = NULL;
     166 HRSRC          hRes;
     167 LPSTR          restype = RT_ICONA;
    166168
    167169    if(fuLoad & LR_LOADFROMFILE)
     
    177179        if (!hinst)
    178180        {
    179                 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW);
    180                 if(!winres)
    181                         winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW);
    182                 if(winres)
     181                hRes = FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW);
     182                if(!hRes)  {
     183                        hRes = FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW);
     184                        restype = RT_GROUP_ICONA;
     185                }
     186                if(hRes)
    183187                {
    184                         hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
    185                         delete winres;
     188                        hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hInstanceUser32, restype, hRes));
    186189                }
    187                 else    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
     190                else    hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));
    188191        }
    189192        else
    190193        {//not a system icon
    191                 winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW);
    192                 if(winres == 0) {
    193                         winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW);
    194                 }
    195                 if(winres) {
    196                         hIcon = OSLibWinCreateIcon(winres->lockOS2Resource());
    197                         delete winres;
     194                hRes = FindResourceW(hinst,lpszIcon,RT_ICONW);
     195                if(!hRes) {
     196                        hRes = FindResourceW(hinst,lpszIcon,RT_GROUP_ICONW);
     197                        restype = RT_GROUP_ICONA;
     198                }
     199                if(hRes) {
     200                        hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hinst, restype, hRes));
    198201                }
    199                 else    hIcon = 0;
     202                else    hIcon = 0;
    200203        }
    201204    }
     
    221224                    DWORD cyDesired, DWORD fuLoad)
    222225{
    223  Win32Resource *winres;
    224226 HCURSOR        hCursor;
    225227 HANDLE         hMapping = 0;
    226228 char          *ptr = NULL;
     229 HRSRC          hRes;
     230 LPSTR          restype = RT_CURSORA;
    227231
    228232    if(fuLoad & LR_LOADFROMFILE)
     
    236240    else
    237241    {
    238         if (!hinst)
     242        if(!hinst)
    239243        {
    240                 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA);
    241                 if(!winres)
    242                         winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA);
    243                 if(winres)
     244                hRes = FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA);
     245                if(!hRes)  {
     246                        hRes = FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA);
     247                        restype = RT_GROUP_CURSORA;
     248                }
     249                if(hRes)
    244250                {
    245                         hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
    246                         delete winres;
     251                        hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hInstanceUser32, restype, hRes));
    247252                }
    248253                else    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
    249         }
    250         else
    251         {//not a system pointer
    252                 winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA);
    253                 if(winres == 0) {
    254                         winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA);
    255                 }
    256                 if(winres) {
    257                         hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
    258                         delete winres;
     254        }
     255        else
     256        { //not a system icon
     257                hRes = FindResourceA(hinst,lpszCursor,RT_CURSORA);
     258                if(!hRes) {
     259                        hRes = FindResourceA(hinst,lpszCursor,RT_GROUP_CURSORA);
     260                        restype = RT_GROUP_CURSORA;
     261                }
     262                if(hRes) {
     263                        hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hinst, restype, hRes));
    259264                }
    260265                else    hCursor = 0;
    261         }
     266        }
    262267    }
    263268    if(HIWORD(lpszCursor)) {
     
    273278                    DWORD cyDesired, DWORD fuLoad)
    274279{
    275  Win32Resource *winres;
    276280 HCURSOR        hCursor;
    277281 HANDLE         hMapping = 0;
    278282 char          *ptr = NULL;
     283 HRSRC          hRes;
     284 LPSTR          restype = RT_CURSORA;
    279285
    280286    if(fuLoad & LR_LOADFROMFILE)
     
    290296        if(!hinst)
    291297        {
    292                 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW);
    293                 if(!winres)
    294                         winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW);
    295                 if(winres)
     298                hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW);
     299                if(!hRes)  {
     300                        hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW);
     301                        restype = RT_GROUP_CURSORA;
     302                }
     303                if(hRes)
    296304                {
    297                         hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
    298                         delete winres;
     305                        hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hInstanceUser32, restype, hRes));
    299306                }
    300307                else    hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR));
    301             }
    302             else
    303             {//not a system pointer
    304                 winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW);
    305                 if(winres == 0) {
    306                         winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW);
    307                 }
    308                 if(winres) {
    309                         hCursor = OSLibWinCreatePointer(winres->lockOS2Resource());
    310                         delete winres;
     308        }
     309        else
     310        { //not a system icon
     311                hRes = FindResourceW(hinst,lpszCursor,RT_CURSORW);
     312                if(!hRes) {
     313                        hRes = FindResourceW(hinst,lpszCursor,RT_GROUP_CURSORW);
     314                        restype = RT_GROUP_CURSORA;
     315                }
     316                if(hRes) {
     317                        hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hinst, restype, hRes));
    311318                }
    312319                else    hCursor = 0;
    313             }
     320        }
    314321    }
    315322    dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor));
     
    498505        hBitmap = LoadBitmapA(hinst, lpszBitmap, 0, 0, 0);
    499506
    500   dprintf(("LoadBitmapA returned %08xh\n", hBitmap));
     507  if(HIWORD(lpszBitmap)) {
     508        dprintf(("LoadBitmapA %x %s returned %08xh\n", hinst, lpszBitmap, hBitmap));
     509  }
     510  else  dprintf(("LoadBitmapA %x %x returned %08xh\n", hinst, lpszBitmap, hBitmap));
    501511
    502512  return(hBitmap);
     
    517527    FreeAsciiString((LPSTR)lpszBitmap);
    518528
    519   dprintf(("LoadBitmapW returned %08xh\n", hBitmap));
     529  if(HIWORD(lpszBitmap)) {
     530        dprintf(("LoadBitmapW %x %s returned %08xh\n", hinst, lpszBitmap, hBitmap));
     531  }
     532  else  dprintf(("LoadBitmapW %x %x returned %08xh\n", hinst, lpszBitmap, hBitmap));
    520533
    521534  return(hBitmap);
  • trunk/src/user32/syscolor.cpp

    r3525 r3625  
    1 /* $Id: syscolor.cpp,v 1.21 2000-05-12 18:09:41 sandervl Exp $ */
     1/* $Id: syscolor.cpp,v 1.22 2000-05-28 16:43:46 sandervl Exp $ */
    22
    33/*
     
    246246HBRUSH WIN32API GetSysColorBrush(int nIndex)
    247247{
    248   dprintf(("GetSysColorBrush %d returned", nIndex));
    249248  if (!fColorInit)
    250249  {
     
    252251    fColorInit = TRUE;
    253252  }
    254 
     253  dprintf(("GetSysColorBrush %d returned %x ", nIndex, ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0));
    255254  return ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0;
    256255}
  • trunk/src/user32/win32wbase.cpp

    r3610 r3625  
    1 /* $Id: win32wbase.cpp,v 1.195 2000-05-26 18:43:34 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.196 2000-05-28 16:43:46 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    2929#include <heapstring.h>
    3030#include <win32wbase.h>
    31 #include <winres.h>
    3231#include "wndmsg.h"
    3332#include "oslibwin.h"
  • trunk/src/user32/win32wbasenonclient.cpp

    r3350 r3625  
    1 /* $Id: win32wbasenonclient.cpp,v 1.22 2000-04-08 18:31:07 cbratschi Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.23 2000-05-28 16:43:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    2424#include <heapstring.h>
    2525#include <win32wbase.h>
    26 #include <winres.h>
    2726#include "wndmsg.h"
    2827#include "pmframe.h"
  • trunk/src/user32/win32wbasepos.cpp

    r2803 r3625  
    1 /* $Id: win32wbasepos.cpp,v 1.13 2000-02-16 14:28:24 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.14 2000-05-28 16:43:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    2525#include <misc.h>
    2626#include <win32wbase.h>
    27 #include <winres.h>
    2827#include <spy.h>
    2928#include "wndmsg.h"
  • trunk/src/user32/win32wmdichild.cpp

    r3603 r3625  
    1 /* $Id: win32wmdichild.cpp,v 1.23 2000-05-24 19:30:08 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.24 2000-05-28 16:43:47 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    3737#include <oslibres.h>
    3838#include "oslibdos.h"
    39 #include <winres.h>
    4039#include "syscolor.h"
    4140#include "win32wndhandle.h"
  • trunk/src/user32/win32wmdiclient.cpp

    r3603 r3625  
    1 /* $Id: win32wmdiclient.cpp,v 1.27 2000-05-24 19:30:08 sandervl Exp $ */
     1/* $Id: win32wmdiclient.cpp,v 1.28 2000-05-28 16:43:47 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    3333#include <oslibres.h>
    3434#include "oslibdos.h"
    35 #include <winres.h>
    3635#include "syscolor.h"
    3736#include "win32wndhandle.h"
  • trunk/src/user32/win32wnd.cpp

    r2803 r3625  
    1 /* $Id: win32wnd.cpp,v 1.8 2000-02-16 14:28:24 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.9 2000-05-28 16:43:48 sandervl Exp $ */
    22/*
    33 * Win32 Window Class for OS/2
     
    3030#include <oslibres.h>
    3131#include "oslibdos.h"
    32 #include <winres.h>
    3332#include "syscolor.h"
    3433#include "win32wndhandle.h"
  • trunk/src/user32/windowclass.cpp

    r2803 r3625  
    1 /* $Id: windowclass.cpp,v 1.9 2000-02-16 14:28:26 sandervl Exp $ */
     1/* $Id: windowclass.cpp,v 1.10 2000-05-28 16:43:48 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Code for OS/2
     
    197197 * Variables :
    198198 * Result    : If the function finds a matching class and successfully copies
    199  *               the data, the return value is TRUE;
     199 *             the data, the return value is TRUE;
    200200 *             otherwise, it is FALSE.
    201201 *             To get extended error information, call GetLastError.
     
    203203 *****************************************************************************/
    204204BOOL WIN32API GetClassInfoExA(HINSTANCE     hInstance,
    205                                  LPCTSTR       lpszClass,
    206                                  LPWNDCLASSEXA lpwcx)
     205                              LPCTSTR       lpszClass,
     206                              LPWNDCLASSEXA lpwcx)
    207207{
    208208 BOOL           rc;
    209209 Win32WndClass *wndclass;
    210210
    211   dprintf(("USER32:GetClassInfoExA (%08xh,%x,%08x).\n",
    212          hInstance,
    213          lpszClass,
    214          lpwcx));
     211  if(HIWORD(lpszClass)) {
     212       dprintf(("USER32:GetClassInfoExA (%08xh,%s,%08x)",
     213                 hInstance, lpszClass, lpwcx));
     214  }
     215  else dprintf(("USER32:GetClassInfoExA (%08xh,%x,%08x)",
     216                 hInstance, lpszClass, lpwcx));
    215217
    216218  wndclass = Win32WndClass::FindClass(hInstance, (LPSTR)lpszClass);
Note: See TracChangeset for help on using the changeset viewer.