Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 1 | /* |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 2 | * Resources |
| 3 | * |
| 4 | * Copyright 1993 Robert J. Amstadt |
| 5 | * Copyright 1995 Alexandre Julliard |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Patrik Stridvall | d016f81 | 2002-08-17 00:43:16 +0000 | [diff] [blame] | 22 | #include "config.h" |
Patrik Stridvall | 9aab47e | 2002-08-28 23:42:34 +0000 | [diff] [blame] | 23 | #include "wine/port.h" |
Patrik Stridvall | d016f81 | 2002-08-17 00:43:16 +0000 | [diff] [blame] | 24 | |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 25 | #include <assert.h> |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 26 | #include <stdlib.h> |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 27 | #include <string.h> |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 28 | #include <sys/types.h> |
| 29 | #include <sys/stat.h> |
| 30 | #include <fcntl.h> |
Patrik Stridvall | d016f81 | 2002-08-17 00:43:16 +0000 | [diff] [blame] | 31 | #ifdef HAVE_UNISTD_H |
| 32 | # include <unistd.h> |
| 33 | #endif |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 34 | #include "windef.h" |
Alexandre Julliard | 58d5a0a | 2000-07-29 21:58:17 +0000 | [diff] [blame] | 35 | #include "winbase.h" |
Marcus Meissner | 04c3e1d | 1999-02-19 10:37:02 +0000 | [diff] [blame] | 36 | #include "wine/winbase16.h" |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 37 | #include "wine/exception.h" |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 38 | #include "heap.h" |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 39 | #include "cursoricon.h" |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 40 | #include "module.h" |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 41 | #include "file.h" |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 42 | #include "wine/debug.h" |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 43 | #include "winerror.h" |
Joshua Thielen | a49bb26 | 1999-07-04 12:55:10 +0000 | [diff] [blame] | 44 | #include "winnls.h" |
Dimitrie O. Paun | 737d4be | 2002-12-12 23:34:01 +0000 | [diff] [blame] | 45 | #include "excpt.h" |
Matthew Davison | 60009b9 | 2003-01-23 23:07:38 +0000 | [diff] [blame] | 46 | #include "winternl.h" |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 47 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 48 | WINE_DEFAULT_DEBUG_CHANNEL(resource); |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 49 | |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 50 | #define HRSRC_MAP_BLOCKSIZE 16 |
| 51 | |
Michael Stefaniuc | 9d2b862 | 2002-09-16 22:47:05 +0000 | [diff] [blame] | 52 | /* handle conversions */ |
| 53 | #define HRSRC_32(h16) ((HRSRC)(ULONG_PTR)(h16)) |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 54 | #define HGLOBAL_32(h16) ((HGLOBAL)(ULONG_PTR)(h16)) |
| 55 | #define HGLOBAL_16(h32) (LOWORD(h32)) |
| 56 | #define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16)) |
Michael Stefaniuc | 9d2b862 | 2002-09-16 22:47:05 +0000 | [diff] [blame] | 57 | |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 58 | typedef struct _HRSRC_ELEM |
| 59 | { |
Michael Stefaniuc | 9d2b862 | 2002-09-16 22:47:05 +0000 | [diff] [blame] | 60 | HRSRC hRsrc; |
| 61 | WORD type; |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 62 | } HRSRC_ELEM; |
| 63 | |
| 64 | typedef struct _HRSRC_MAP |
| 65 | { |
| 66 | int nAlloc; |
| 67 | int nUsed; |
| 68 | HRSRC_ELEM *elem; |
| 69 | } HRSRC_MAP; |
| 70 | |
| 71 | /********************************************************************** |
| 72 | * MapHRsrc32To16 |
| 73 | */ |
Michael Stefaniuc | 9d2b862 | 2002-09-16 22:47:05 +0000 | [diff] [blame] | 74 | static HRSRC MapHRsrc32To16( NE_MODULE *pModule, HRSRC hRsrc32, WORD type ) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 75 | { |
| 76 | HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; |
| 77 | HRSRC_ELEM *newElem; |
| 78 | int i; |
| 79 | |
| 80 | /* On first call, initialize HRSRC map */ |
| 81 | if ( !map ) |
| 82 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 83 | if ( !(map = (HRSRC_MAP *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 84 | sizeof(HRSRC_MAP) ) ) ) |
| 85 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 86 | ERR("Cannot allocate HRSRC map\n" ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 87 | return 0; |
| 88 | } |
| 89 | pModule->hRsrcMap = (LPVOID)map; |
| 90 | } |
| 91 | |
| 92 | /* Check whether HRSRC32 already in map */ |
| 93 | for ( i = 0; i < map->nUsed; i++ ) |
| 94 | if ( map->elem[i].hRsrc == hRsrc32 ) |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 95 | return (HRSRC)(i + 1); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 96 | |
| 97 | /* If no space left, grow table */ |
| 98 | if ( map->nUsed == map->nAlloc ) |
| 99 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 100 | if ( !(newElem = (HRSRC_ELEM *)HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, |
| 101 | map->elem, |
| 102 | (map->nAlloc + HRSRC_MAP_BLOCKSIZE) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 103 | * sizeof(HRSRC_ELEM) ) )) |
| 104 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 105 | ERR("Cannot grow HRSRC map\n" ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 106 | return 0; |
| 107 | } |
| 108 | map->elem = newElem; |
| 109 | map->nAlloc += HRSRC_MAP_BLOCKSIZE; |
| 110 | } |
| 111 | |
| 112 | /* Add HRSRC32 to table */ |
| 113 | map->elem[map->nUsed].hRsrc = hRsrc32; |
| 114 | map->elem[map->nUsed].type = type; |
| 115 | map->nUsed++; |
| 116 | |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 117 | return (HRSRC)map->nUsed; |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | /********************************************************************** |
| 121 | * MapHRsrc16To32 |
| 122 | */ |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 123 | static HRSRC MapHRsrc16To32( NE_MODULE *pModule, HRSRC hRsrc16 ) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 124 | { |
| 125 | HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; |
| 126 | if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0; |
| 127 | |
| 128 | return map->elem[(int)hRsrc16-1].hRsrc; |
| 129 | } |
| 130 | |
| 131 | /********************************************************************** |
| 132 | * MapHRsrc16ToType |
| 133 | */ |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 134 | static WORD MapHRsrc16ToType( NE_MODULE *pModule, HRSRC hRsrc16 ) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 135 | { |
| 136 | HRSRC_MAP *map = (HRSRC_MAP *)pModule->hRsrcMap; |
| 137 | if ( !map || !hRsrc16 || (int)hRsrc16 > map->nUsed ) return 0; |
| 138 | |
| 139 | return map->elem[(int)hRsrc16-1].type; |
| 140 | } |
| 141 | |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 142 | |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 143 | /* filter for page-fault exceptions */ |
| 144 | static WINE_EXCEPTION_FILTER(page_fault) |
| 145 | { |
| 146 | if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) |
| 147 | return EXCEPTION_EXECUTE_HANDLER; |
| 148 | return EXCEPTION_CONTINUE_SEARCH; |
| 149 | } |
| 150 | |
| 151 | static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 152 | LPCSTR name, WORD lang, |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 153 | BOOL bUnicode, BOOL bRet16 ) |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 154 | { |
| 155 | HRSRC hRsrc = 0; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 156 | |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 157 | TRACE("(%p, %08x%s, %08x%s, %04x, %s, %s)\n", |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 158 | hModule, |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 159 | (UINT)type, HIWORD(type)? (bUnicode? debugstr_w((LPWSTR)type) : debugstr_a(type)) : "", |
| 160 | (UINT)name, HIWORD(name)? (bUnicode? debugstr_w((LPWSTR)name) : debugstr_a(name)) : "", |
| 161 | lang, |
| 162 | bUnicode? "W" : "A", |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 163 | bRet16? "NE" : "PE" ); |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 164 | |
| 165 | if (!HIWORD(hModule)) |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 166 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 167 | HMODULE16 hMod16 = MapHModuleLS( hModule ); |
| 168 | NE_MODULE *pModule = NE_GetPtr( hMod16 ); |
| 169 | if (!pModule) return 0; |
| 170 | if (!pModule->module32) |
| 171 | { |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 172 | /* 16-bit NE module */ |
| 173 | LPSTR typeStr, nameStr; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 174 | |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 175 | if ( HIWORD( type ) && bUnicode ) |
| 176 | typeStr = HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)type ); |
| 177 | else |
| 178 | typeStr = (LPSTR)type; |
| 179 | if ( HIWORD( name ) && bUnicode ) |
| 180 | nameStr = HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)name ); |
| 181 | else |
| 182 | nameStr = (LPSTR)name; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 183 | |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 184 | hRsrc = NE_FindResource( pModule, nameStr, typeStr ); |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 185 | |
| 186 | if ( HIWORD( type ) && bUnicode ) |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 187 | HeapFree( GetProcessHeap(), 0, typeStr ); |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 188 | if ( HIWORD( name ) && bUnicode ) |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 189 | HeapFree( GetProcessHeap(), 0, nameStr ); |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 190 | |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 191 | /* If we need to return 32-bit HRSRC, no conversion is necessary, |
| 192 | we simply use the 16-bit HRSRC as 32-bit HRSRC */ |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 193 | } |
| 194 | else |
| 195 | { |
| 196 | /* 32-bit PE module */ |
| 197 | hRsrc = RES_FindResource2( pModule->module32, type, name, lang, bUnicode, FALSE ); |
| 198 | /* If we need to return 16-bit HRSRC, perform conversion */ |
| 199 | if ( bRet16 ) |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 200 | hRsrc = MapHRsrc32To16( pModule, hRsrc, |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 201 | HIWORD( type )? 0 : LOWORD( type ) ); |
| 202 | } |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | /* 32-bit PE module */ |
| 207 | LPWSTR typeStr, nameStr; |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 208 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 209 | if ( HIWORD( type ) && !bUnicode ) |
Matthew Davison | 60009b9 | 2003-01-23 23:07:38 +0000 | [diff] [blame] | 210 | { |
| 211 | UNICODE_STRING usBuffer; |
| 212 | RtlCreateUnicodeStringFromAsciiz(&usBuffer,type); |
| 213 | typeStr = usBuffer.Buffer; |
| 214 | } |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 215 | else |
| 216 | typeStr = (LPWSTR)type; |
| 217 | if ( HIWORD( name ) && !bUnicode ) |
Matthew Davison | 60009b9 | 2003-01-23 23:07:38 +0000 | [diff] [blame] | 218 | { |
| 219 | UNICODE_STRING usBuffer; |
| 220 | RtlCreateUnicodeStringFromAsciiz(&usBuffer,name); |
| 221 | nameStr = usBuffer.Buffer; |
| 222 | } |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 223 | else |
| 224 | nameStr = (LPWSTR)name; |
| 225 | |
Dmitry Timoshkov | 05c88fa | 2000-08-11 12:50:56 +0000 | [diff] [blame] | 226 | /* Here is the real difference between FindResouce and FindResourceEx */ |
| 227 | if(lang == MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) || |
| 228 | lang == MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) || |
| 229 | lang == MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT) || |
| 230 | lang == MAKELANGID(LANG_NEUTRAL, 3)) /* FIXME: real name? */ |
| 231 | hRsrc = PE_FindResourceW( hModule, nameStr, typeStr ); |
| 232 | else |
| 233 | hRsrc = PE_FindResourceExW( hModule, nameStr, typeStr, lang ); |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 234 | |
| 235 | if ( HIWORD( type ) && !bUnicode ) |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 236 | HeapFree( GetProcessHeap(), 0, typeStr ); |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 237 | if ( HIWORD( name ) && !bUnicode ) |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 238 | HeapFree( GetProcessHeap(), 0, nameStr ); |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 239 | } |
| 240 | return hRsrc; |
| 241 | } |
| 242 | |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 243 | /********************************************************************** |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 244 | * RES_FindResource |
| 245 | */ |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 246 | |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 247 | static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 248 | LPCSTR name, WORD lang, |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 249 | BOOL bUnicode, BOOL bRet16 ) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 250 | { |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 251 | HRSRC hRsrc; |
| 252 | __TRY |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 253 | { |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 254 | hRsrc = RES_FindResource2(hModule, type, name, lang, bUnicode, bRet16); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 255 | } |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 256 | __EXCEPT(page_fault) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 257 | { |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 258 | WARN("page fault\n"); |
| 259 | SetLastError(ERROR_INVALID_PARAMETER); |
| 260 | return 0; |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 261 | } |
Richard Cohen | c775e1e | 2000-04-16 20:27:51 +0000 | [diff] [blame] | 262 | __ENDTRY |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 263 | return hRsrc; |
| 264 | } |
| 265 | |
| 266 | /********************************************************************** |
| 267 | * RES_SizeofResource |
| 268 | */ |
| 269 | static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 ) |
| 270 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 271 | if (!hRsrc) return 0; |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 272 | |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 273 | TRACE("(%p, %p, %s)\n", hModule, hRsrc, bRet16? "NE" : "PE" ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 274 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 275 | if (!HIWORD(hModule)) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 276 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 277 | HMODULE16 hMod16 = MapHModuleLS( hModule ); |
| 278 | NE_MODULE *pModule = NE_GetPtr( hMod16 ); |
| 279 | if (!pModule) return 0; |
| 280 | |
| 281 | if (!pModule->module32) /* 16-bit NE module */ |
| 282 | { |
| 283 | /* If we got a 32-bit hRsrc, we don't need to convert it */ |
| 284 | return NE_SizeofResource( pModule, hRsrc ); |
| 285 | } |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 286 | |
| 287 | /* If we got a 16-bit hRsrc, convert it */ |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 288 | if (!HIWORD(hRsrc)) hRsrc = MapHRsrc16To32( pModule, hRsrc ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 289 | } |
| 290 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 291 | /* 32-bit PE module */ |
| 292 | return PE_SizeofResource( hRsrc ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | /********************************************************************** |
| 296 | * RES_LoadResource |
| 297 | */ |
| 298 | static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 ) |
| 299 | { |
| 300 | HGLOBAL hMem = 0; |
| 301 | |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 302 | TRACE("(%p, %p, %s)\n", hModule, hRsrc, bRet16? "NE" : "PE" ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 303 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 304 | if (!hRsrc) return 0; |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 305 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 306 | if (!HIWORD(hModule)) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 307 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 308 | HMODULE16 hMod16 = MapHModuleLS( hModule ); |
| 309 | NE_MODULE *pModule = NE_GetPtr( hMod16 ); |
| 310 | if (!pModule) return 0; |
| 311 | if (!pModule->module32) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 312 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 313 | /* 16-bit NE module */ |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 314 | |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 315 | /* If we got a 32-bit hRsrc, we don't need to convert it */ |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 316 | hMem = HGLOBAL_32(NE_LoadResource( pModule, LOWORD(hRsrc) )); |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 317 | |
| 318 | /* If we are to return a 32-bit resource, we should probably |
| 319 | convert it but we don't for now. FIXME !!! */ |
| 320 | return hMem; |
| 321 | } |
| 322 | else |
| 323 | { |
| 324 | /* If we got a 16-bit hRsrc, convert it */ |
| 325 | HRSRC hRsrc32 = HIWORD(hRsrc)? hRsrc : MapHRsrc16To32( pModule, hRsrc ); |
| 326 | |
| 327 | hMem = PE_LoadResource( pModule->module32, hRsrc32 ); |
| 328 | |
| 329 | /* If we need to return a 16-bit resource, convert it */ |
| 330 | if ( bRet16 ) |
| 331 | { |
| 332 | WORD type = MapHRsrc16ToType( pModule, hRsrc ); |
| 333 | DWORD size = SizeofResource( hModule, hRsrc ); |
| 334 | LPVOID bits = LockResource( hMem ); |
| 335 | |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 336 | hMem = HGLOBAL_32(NE_LoadPEResource( pModule, type, bits, size )); |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 337 | } |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 338 | } |
| 339 | } |
| 340 | else |
| 341 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 342 | /* 32-bit PE module */ |
| 343 | hMem = PE_LoadResource( hModule, hRsrc ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | return hMem; |
| 347 | } |
| 348 | |
| 349 | /********************************************************************** |
Patrik Stridvall | 044855c | 2001-07-11 18:56:41 +0000 | [diff] [blame] | 350 | * FindResource (KERNEL.60) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 351 | */ |
Alexandre Julliard | ac7efef | 2000-11-27 21:54:01 +0000 | [diff] [blame] | 352 | HRSRC16 WINAPI FindResource16( HMODULE16 hModule, LPCSTR name, LPCSTR type ) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 353 | { |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 354 | return LOWORD( RES_FindResource( HMODULE_32(hModule), type, name, |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 355 | MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, TRUE ) ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 356 | } |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 357 | |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 358 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 359 | * FindResourceA (KERNEL32.@) |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 360 | */ |
François Gouget | 55146db | 2000-12-24 20:33:01 +0000 | [diff] [blame] | 361 | HRSRC WINAPI FindResourceA( HMODULE hModule, LPCSTR name, LPCSTR type ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 362 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 363 | return RES_FindResource( hModule, type, name, |
Dmitry Timoshkov | 05c88fa | 2000-08-11 12:50:56 +0000 | [diff] [blame] | 364 | MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, FALSE ); |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 368 | * FindResourceExA (KERNEL32.@) |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 369 | */ |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 370 | HRSRC WINAPI FindResourceExA( HMODULE hModule, |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 371 | LPCSTR type, LPCSTR name, WORD lang ) |
Ulrich Weigand | 7df1fbb | 1998-11-01 18:01:53 +0000 | [diff] [blame] | 372 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 373 | return RES_FindResource( hModule, type, name, |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 374 | lang, FALSE, FALSE ); |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 375 | } |
| 376 | |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 377 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 378 | * FindResourceExW (KERNEL32.@) |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 379 | */ |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 380 | HRSRC WINAPI FindResourceExW( HMODULE hModule, |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 381 | LPCWSTR type, LPCWSTR name, WORD lang ) |
| 382 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 383 | return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, |
Alexandre Julliard | fd8a6de | 2000-07-31 20:59:59 +0000 | [diff] [blame] | 384 | lang, TRUE, FALSE ); |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 385 | } |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 386 | |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 387 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 388 | * FindResourceW (KERNEL32.@) |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 389 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 390 | HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type) |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 391 | { |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 392 | return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, |
Dmitry Timoshkov | 05c88fa | 2000-08-11 12:50:56 +0000 | [diff] [blame] | 393 | MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), TRUE, FALSE ); |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 394 | } |
| 395 | |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 396 | /********************************************************************** |
Patrik Stridvall | 044855c | 2001-07-11 18:56:41 +0000 | [diff] [blame] | 397 | * LoadResource (KERNEL.61) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 398 | */ |
| 399 | HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc ) |
| 400 | { |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 401 | return HGLOBAL_16(RES_LoadResource( HMODULE_32(hModule), HRSRC_32(hRsrc), TRUE )); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 402 | } |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 403 | |
| 404 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 405 | * LoadResource (KERNEL32.@) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 406 | */ |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 407 | HGLOBAL WINAPI LoadResource( HINSTANCE hModule, HRSRC hRsrc ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 408 | { |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 409 | return RES_LoadResource( hModule, hRsrc, FALSE ); |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 410 | } |
| 411 | |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 412 | /********************************************************************** |
Patrik Stridvall | 01d5e5b | 2001-07-02 19:59:40 +0000 | [diff] [blame] | 413 | * LockResource (KERNEL.62) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 414 | */ |
| 415 | SEGPTR WINAPI WIN16_LockResource16( HGLOBAL16 handle ) |
| 416 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 417 | TRACE("(%04x)\n", handle ); |
| 418 | /* May need to reload the resource if discarded */ |
Alexandre Julliard | 5801723 | 2000-12-22 01:09:26 +0000 | [diff] [blame] | 419 | return K32WOWGlobalLock16( handle ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 420 | } |
Patrik Stridvall | 697bf65 | 2000-12-02 23:44:59 +0000 | [diff] [blame] | 421 | |
| 422 | /********************************************************************** |
Patrik Stridvall | 044855c | 2001-07-11 18:56:41 +0000 | [diff] [blame] | 423 | * LockResource16 (KERNEL32.@) |
Patrik Stridvall | 697bf65 | 2000-12-02 23:44:59 +0000 | [diff] [blame] | 424 | */ |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 425 | LPVOID WINAPI LockResource16( HGLOBAL16 handle ) |
| 426 | { |
Alexandre Julliard | 982a223 | 2000-12-13 20:20:09 +0000 | [diff] [blame] | 427 | return MapSL( WIN16_LockResource16(handle) ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 428 | } |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 429 | |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 430 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 431 | * LockResource (KERNEL32.@) |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 432 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 433 | LPVOID WINAPI LockResource( HGLOBAL handle ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 434 | { |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 435 | TRACE("(%p)\n", handle ); |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 436 | |
| 437 | if (HIWORD( handle )) /* 32-bit memory handle */ |
| 438 | return (LPVOID)handle; |
| 439 | |
| 440 | /* 16-bit memory handle */ |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 441 | return LockResource16( LOWORD(handle) ); |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 442 | } |
| 443 | |
Patrik Stridvall | 57e5784 | 2002-02-02 18:42:11 +0000 | [diff] [blame] | 444 | typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags ); |
Alexandre Julliard | 8eeed94 | 2001-12-17 21:40:56 +0000 | [diff] [blame] | 445 | |
| 446 | |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 447 | /********************************************************************** |
Patrik Stridvall | 044855c | 2001-07-11 18:56:41 +0000 | [diff] [blame] | 448 | * FreeResource (KERNEL.63) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 449 | */ |
| 450 | BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) |
| 451 | { |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 452 | HGLOBAL16 retv = handle; |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 453 | NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) ); |
| 454 | |
| 455 | TRACE("(%04x)\n", handle ); |
| 456 | |
| 457 | /* Try NE resource first */ |
| 458 | retv = NE_FreeResource( pModule, handle ); |
| 459 | |
| 460 | /* If this failed, call USER.DestroyIcon32; this will check |
| 461 | whether it is a shared cursor/icon; if not it will call |
| 462 | GlobalFree16() */ |
| 463 | if ( retv ) |
| 464 | { |
Alexandre Julliard | 8eeed94 | 2001-12-17 21:40:56 +0000 | [diff] [blame] | 465 | pDestroyIcon32Proc proc; |
| 466 | HMODULE user = GetModuleHandleA( "user32.dll" ); |
| 467 | |
| 468 | if (user && (proc = (pDestroyIcon32Proc)GetProcAddress( user, "DestroyIcon32" ))) |
| 469 | retv = proc( handle, CID_RESOURCE ); |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 470 | else |
| 471 | retv = GlobalFree16( handle ); |
| 472 | } |
| 473 | return (BOOL)retv; |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 474 | } |
| 475 | |
| 476 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 477 | * FreeResource (KERNEL32.@) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 478 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 479 | BOOL WINAPI FreeResource( HGLOBAL handle ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 480 | { |
Alexandre Julliard | 32936f0 | 2000-08-07 23:50:00 +0000 | [diff] [blame] | 481 | if (HIWORD(handle)) return 0; /* 32-bit memory handle: nothing to do */ |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 482 | |
Alexandre Julliard | 267ca68 | 2002-07-31 17:20:00 +0000 | [diff] [blame] | 483 | return FreeResource16( LOWORD(handle) ); |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 484 | } |
| 485 | |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 486 | /********************************************************************** |
Patrik Stridvall | 044855c | 2001-07-11 18:56:41 +0000 | [diff] [blame] | 487 | * SizeofResource (KERNEL.65) |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 488 | */ |
| 489 | DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc ) |
| 490 | { |
Andrew John Hughes | ed800c6 | 2002-11-21 03:45:01 +0000 | [diff] [blame] | 491 | return RES_SizeofResource( HMODULE_32(hModule), HRSRC_32(hRsrc), TRUE ); |
Ulrich Weigand | 80a69b6 | 1998-11-25 17:58:51 +0000 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | /********************************************************************** |
Patrik Stridvall | dae8de6 | 2001-06-13 20:13:18 +0000 | [diff] [blame] | 495 | * SizeofResource (KERNEL32.@) |
Alexandre Julliard | 594997c | 1995-04-30 10:05:20 +0000 | [diff] [blame] | 496 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 497 | DWORD WINAPI SizeofResource( HINSTANCE hModule, HRSRC hRsrc ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 498 | { |
Ulrich Weigand | 0511282 | 1999-03-10 14:02:06 +0000 | [diff] [blame] | 499 | return RES_SizeofResource( hModule, hRsrc, FALSE ); |
Alexandre Julliard | a2f2e01 | 1995-06-06 16:40:35 +0000 | [diff] [blame] | 500 | } |