Changeset 337 for trunk/src/kernel32/winres.cpp
- Timestamp:
- Jul 19, 1999, 1:51:03 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winres.cpp
r120 r337 1 /* $Id: winres.cpp,v 1. 3 1999-06-19 10:54:44sandervl Exp $ */1 /* $Id: winres.cpp,v 1.4 1999-07-19 11:50:35 sandervl Exp $ */ 2 2 3 3 /* … … 24 24 #include <string.h> 25 25 #define INCL_WINRES 26 #include "win32type.h"27 #include "winres.h"28 #include "misc.h"29 #include "nameid.h"30 #include "winexe.h"26 #include <win32type.h> 27 #include <winres.h> 28 #include <misc.h> 29 #include <nameid.h> 30 #include <winexe.h> 31 31 32 32 static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy) … … 95 95 this->hres = hRes; 96 96 97 switch(type) { 98 case NTRT_NEWBITMAP: 99 case NTRT_BITMAP: 100 orgos2type = RT_BITMAP; 101 break; 102 case NTRT_CURSOR: 103 case NTRT_GROUP_CURSOR: 104 case NTRT_GROUP_ICON: 105 case NTRT_ICON: 106 orgos2type = RT_POINTER; 107 break; 108 case NTRT_ACCELERATORS: 109 orgos2type = RT_ACCELTABLE; 110 break; 111 case NTRT_NEWMENU: 112 case NTRT_MENU: 113 orgos2type = RT_MENU; 114 break; 115 case NTRT_NEWDIALOG: 116 case NTRT_DIALOG: 117 orgos2type = RT_DIALOG; 118 break; 119 case NTRT_FONTDIR: 120 case NTRT_FONT: 121 case NTRT_MESSAGETABLE: 122 case NTRT_STRING: 123 case NTRT_RCDATA: 124 case NTRT_VERSION: 125 default: 126 orgos2type = RT_RCDATA; 127 break; 128 } 129 97 130 rc = DosQueryResourceSize(module->hinstance, type, id, &ressize); 98 131 if(rc) { 99 dprintf(("Win32Resource ctor: DosQueryResourceSize returned %X\n", rc));132 dprintf(("Win32Resource ctor: DosQueryResourceSize %x %d %d returned %X\n", module->hinstance, type, id, rc)); 100 133 ressize = 0; 101 134 } … … 113 146 this->id = id; 114 147 this->type = type; 148 orgos2type = -1; 115 149 this->ressize = size; 116 150 winresdata = (char *)malloc(size); … … 127 161 Win32Resource *res = module->winres; 128 162 163 #if 0 164 //returned by DosGetResource, so we don't (and mustn't) free it 129 165 if(os2resdata) free(os2resdata); 166 #endif 130 167 if(winresdata) free(winresdata); 131 168 … … 225 262 DosFreeResource(resdata); 226 263 return winresdata; 264 } 265 //****************************************************************************** 266 //****************************************************************************** 267 PVOID Win32Resource::lockOS2Resource() 268 { 269 APIRET rc; 270 PVOID resdata; 271 272 dprintf(("Win32Resource::lockOS2Resource %d\n", id)); 273 if(os2resdata == NULL) { 274 rc = DosGetResource((HMODULE)module->hinstance, orgos2type, id, (PPVOID)&resdata); 275 if(rc) return(NULL); 276 os2resdata = resdata; 277 } 278 return os2resdata; 227 279 } 228 280 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.