ReactOS  0.4.14-dev-552-g2fad488
resource.c
Go to the documentation of this file.
1 /*
2  * Unit test suite for resource functions.
3  *
4  * Copyright 2006 Mike McCormack
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <windows.h>
22 #include <stdio.h>
23 
24 #include "wine/test.h"
25 
26 static const char filename[] = "test_.exe";
27 static DWORD GLE;
28 
29 enum constants {
30  page_size = 0x1000,
33 };
34 
35 /* rodata @ [0x1000-0x3000) */
37 {
38  ".rodata", {2*page_size}, page_size, 2*page_size, page_size, 0, 0, 0, 0,
40 };
41 
42 /* rodata @ [0x1000-0x2000) */
44 {
45  ".rodata", {page_size}, page_size, page_size, page_size, 0, 0, 0, 0,
47 };
48 
49 /* rsrc @ [0x3000-0x4000) */
51 {
52  ".rsrc\0\0", {page_size}, rva_rsrc_start, page_size, rva_rsrc_start, 0, 0, 0, 0,
54 };
55 
56 /* rsrc @ [0x2000-0x4000) */
58 {
59  ".rsrc\0\0", {2*page_size}, rva_rsrc_start-page_size, 2*page_size, rva_rsrc_start-page_size, 0, 0, 0, 0,
61 };
62 
63 /* rsrc @ [0x2000-0x3000) */
65 {
68 };
69 
70 /* rsrc @ [0x3000-0x6000) */
72 {
73  ".rsrc\0\0", {3*page_size}, rva_rsrc_start, 3*page_size, rva_rsrc_start, 0, 0, 0, 0,
75 };
76 
77 /* rsrc @ [0x2000-0x5000) */
79 {
80  ".rsrc\0\0", {3*page_size}, 2*page_size, 3*page_size, 2*page_size, 0, 0, 0, 0,
82 };
83 
84 /* rsrc @ [0x3000-0x4000), small SizeOfRawData */
86 {
87  ".rsrc\0\0", {page_size}, rva_rsrc_start, 8, rva_rsrc_start, 0, 0, 0, 0,
89 };
90 
91 /* reloc @ [0x4000-0x5000) */
93 {
94  ".reloc\0", {page_size}, 4*page_size, page_size, 4*page_size, 0, 0, 0, 0,
96 };
97 
98 /* reloc @ [0x6000-0x7000) */
100 {
101  ".reloc\0", {page_size}, 6*page_size, page_size, 6*page_size, 0, 0, 0, 0,
103 };
104 
105 typedef struct _sec_build
106 {
108 } sec_build;
109 
110 typedef struct _sec_verify
111 {
116 } sec_verify;
117 
118 static const struct _sec_variants
119 {
122 } sec_variants[] =
123 {
124  /* .rsrc is the last section, data directory entry points to whole section */
125  {
126  {{&sh_rodata_1, &sh_rsrc_1, NULL}},
127  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 0},
128  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 0},
129  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 1},
130  {{&sh_rodata_1, &sh_rsrc_4, NULL}, 6*page_size, 1, 0, 1}
131  },
132  /* .rsrc is the last section, data directory entry points to section end */
133  /* Vista+ - resources are moved to section start (trashing data that could be there), and section is trimmed */
134  /* NT4/2000/2003 - resources are moved to section start (trashing data that could be there); section isn't trimmed */
135  {
136  {{&sh_rodata_2, &sh_rsrc_2, NULL}},
137  {{&sh_rodata_2, &sh_rsrc_3, NULL}, 3*page_size, 1, 0, 0},
138  {{&sh_rodata_2, &sh_rsrc_3, NULL}, 3*page_size, 1, 0, 0},
139  {{&sh_rodata_2, &sh_rsrc_3, NULL}, 3*page_size, 1, 0, 1},
140  {{&sh_rodata_2, &sh_rsrc_5, NULL}, 5*page_size, 1, 0, 1}
141  },
142  /* .rsrc is not the last section */
143  /* section is reused; sections after .rsrc are shifted to give space to rsrc (in-image offset and RVA!) */
144  {
145  {{&sh_rodata_1, &sh_rsrc_1, &sh_junk}},
146  {{&sh_rodata_1, &sh_rsrc_1, &sh_junk}, 5*page_size, 1, 0, 0},
147  {{&sh_rodata_1, &sh_rsrc_1, &sh_junk}, 5*page_size, 1, 0, 0},
148  {{&sh_rodata_1, &sh_rsrc_1, &sh_junk}, 5*page_size, 1, 0, 1},
149  {{&sh_rodata_1, &sh_rsrc_4, &sh_junk_2}, 7*page_size, 1, 0, 1}
150  },
151  /* .rsrc is the last section, data directory entry points to whole section, file size is not aligned on FileAlign */
152  {
153  {{&sh_rodata_1, &sh_rsrc_6, NULL}},
154  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 0},
155  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 0},
156  {{&sh_rodata_1, &sh_rsrc_1, NULL}, 4*page_size, 1, 0, 1},
157  {{&sh_rodata_1, &sh_rsrc_4, NULL}, 6*page_size, 1, 0, 1}
158  }
159 };
160 
161 static int build_exe( const sec_build* sec_descr )
162 {
167  HANDLE file;
168  DWORD written, i, file_size;
170 
171  memset( page, 0, sizeof page );
172 
173  dos = (void*) page;
175  dos->e_lfanew = sizeof *dos;
176 
177  nt = (void*) &dos[1];
178 
184 
185  opt = &nt->OptionalHeader;
186 
188  opt->MajorLinkerVersion = 1;
189  opt->BaseOfCode = 0x10;
190  opt->ImageBase = 0x10000000;
192  opt->MajorImageVersion = 1;
193  opt->MajorSubsystemVersion = 4;
194  opt->SizeOfHeaders = sizeof *dos + sizeof *nt + sizeof *sec * 2;
195  opt->SizeOfImage = page_size;
197 
198  /* if SectionAlignment and File alignment are not specified */
199  /* UpdateResource fails trying to create a huge temporary file */
201  opt->FileAlignment = page_size;
202 
205 
206  sec = (void*) &nt[1];
207 
208  file_size = 0;
209  for ( i = 0; i < max_sections; i++ )
210  if ( sec_descr->sect_in[i] )
211  {
212  DWORD virt_end_of_section = sec_descr->sect_in[i]->Misc.VirtualSize +
213  sec_descr->sect_in[i]->VirtualAddress;
214  DWORD phys_end_of_section = sec_descr->sect_in[i]->SizeOfRawData +
215  sec_descr->sect_in[i]->PointerToRawData;
216  memcpy( sec + nt->FileHeader.NumberOfSections, sec_descr->sect_in[i],
217  sizeof(sec[0]) );
219  if ( opt->SizeOfImage < virt_end_of_section )
220  opt->SizeOfImage = virt_end_of_section;
221  if ( file_size < phys_end_of_section )
222  file_size = phys_end_of_section;
223  }
224 
226  ok (file != INVALID_HANDLE_VALUE, "failed to create file\n");
227 
228  /* write out the header */
229  WriteFile( file, page, sizeof page, &written, NULL );
230 
231  /* write out zeroed pages for sections */
232  memset( page, 0, sizeof page );
233  for ( i = page_size; i < file_size; i += page_size )
234  {
236  WriteFile( file, page, size, &written, NULL );
237  }
238 
239  CloseHandle( file );
240 
241  return 0;
242 }
243 
244 static void update_missing_exe( void )
245 {
246  HANDLE res;
247 
248  SetLastError(0xdeadbeef);
250  GLE = GetLastError();
251  ok( res == NULL, "BeginUpdateResource should fail\n");
252 }
253 
254 static void update_empty_exe( void )
255 {
256  HANDLE file, res, test;
257  BOOL r;
258 
260  ok (file != INVALID_HANDLE_VALUE, "failed to create file\n");
261 
262  CloseHandle( file );
263 
265  if ( res != NULL || GetLastError() != ERROR_FILE_INVALID )
266  {
267  ok( res != NULL, "BeginUpdateResource failed\n");
268 
269  /* check if it's possible to open the file now */
271  ok (test != INVALID_HANDLE_VALUE, "failed to create file\n");
272 
273  CloseHandle( test );
274 
276  ok( r == FALSE, "EndUpdateResource failed\n");
277  }
278  else
279  skip( "Can't update resource in empty file\n" );
280 
282  ok( res == NULL, "BeginUpdateResource failed\n");
283 }
284 
285 static void update_resources_none( void )
286 {
287  HMODULE res;
288  BOOL r;
289 
291  ok( res != NULL, "BeginUpdateResource failed\n");
292 
294  ok( r, "EndUpdateResource failed\n");
295 }
296 
297 static void update_resources_delete( void )
298 {
299  HMODULE res;
300  BOOL r;
301 
303  ok( res != NULL, "BeginUpdateResource failed\n");
304 
306  ok( r, "EndUpdateResource failed\n");
307 }
308 
309 static void update_resources_version( void )
310 {
311  HANDLE res = NULL;
312  BOOL r;
313  char foo[] = "red and white";
314 
316  ok( res != NULL, "BeginUpdateResource failed\n");
317 
318  if (0) /* this causes subsequent tests to fail on Vista */
319  {
320  r = UpdateResourceA( res,
321  MAKEINTRESOURCEA(0x1230),
322  MAKEINTRESOURCEA(0x4567),
323  0xabcd,
324  NULL, 0 );
325  ok( r == FALSE, "UpdateResource failed\n");
326  }
327 
328  r = UpdateResourceA( res,
329  MAKEINTRESOURCEA(0x1230),
330  MAKEINTRESOURCEA(0x4567),
331  0xabcd,
332  foo, sizeof foo );
333  ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
334 
336  ok( r, "EndUpdateResource failed: %d\n", GetLastError());
337 }
338 
339 static void update_resources_bigdata( void )
340 {
341  HANDLE res = NULL;
342  BOOL r;
343  char foo[2*page_size] = "foobar";
344 
346  ok( res != NULL, "BeginUpdateResource succeeded\n");
347 
348  r = UpdateResourceA( res,
349  MAKEINTRESOURCEA(0x3012),
350  MAKEINTRESOURCEA(0x5647),
351  0xcdba,
352  foo, sizeof foo );
353  ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
354 
356  ok( r, "EndUpdateResource failed\n");
357 }
358 
359 static void check_exe( const sec_verify *verify )
360 {
361  int i;
368  DWORD length, sec_count = 0;
369 
371  ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError());
372 
373  length = GetFileSize( file, NULL );
374  ok( length >= verify->length, "file size wrong\n");
375 
377  ok (mapping != NULL, "failed to create file\n");
378 
380  ok( dos != NULL, "failed to map file\n");
381 
382  if (!dos)
383  goto end;
384 
385  nt = (void*) ((BYTE*) dos + dos->e_lfanew);
386  opt = &nt->OptionalHeader;
387  sec = (void*) &nt[1];
388 
389  for(i = 0; i < max_sections; i++)
390  if (verify->sect_out[i])
391  {
392  ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %d name wrong\n", sec_count);
393  ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %d vaddr wrong\n", sec_count);
394  ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %d SizeOfRawData wrong (%d vs %d)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData);
395  ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %d PointerToRawData wrong\n", sec_count);
396  ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %d characteristics wrong\n", sec_count);
397  sec_count++;
398  }
399 
400  ok( nt->FileHeader.NumberOfSections == sec_count, "number of sections wrong\n" );
401 
402  if (verify->rsrc_section >= 0 && verify->rsrc_section < nt->FileHeader.NumberOfSections)
403  {
404  dir = (void*) ((BYTE*) dos + sec[verify->rsrc_section].VirtualAddress);
405 
406  ok( dir->Characteristics == 0, "Characteristics wrong\n");
407  ok( dir->TimeDateStamp == 0 || abs( dir->TimeDateStamp - GetTickCount() ) < 1000 /* nt4 */,
408  "TimeDateStamp wrong %u\n", dir->TimeDateStamp);
409  ok( dir->MajorVersion == 4, "MajorVersion wrong\n");
410  ok( dir->MinorVersion == 0, "MinorVersion wrong\n");
411 
412  ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %d instead of %d\n",
413  verify->NumberOfNamedEntries, dir->NumberOfNamedEntries);
414  ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %d instead of %d\n",
415  verify->NumberOfIdEntries, dir->NumberOfIdEntries);
416 
418  "VirtualAddress in optional header should be %d instead of %d\n",
420  }
421 
422 end:
423  UnmapViewOfFile( dos );
424 
425  CloseHandle( mapping );
426 
427  CloseHandle( file );
428 }
429 
430 static void test_find_resource(void)
431 {
432  HRSRC rsrc;
433 
435  ok( rsrc != 0, "resource not found\n" );
438  ok( rsrc != 0, "resource not found\n" );
441  ok( rsrc != 0, "resource not found\n" );
442 
443  SetLastError( 0xdeadbeef );
445  ok( !rsrc, "resource found\n" );
446  ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %u\n", GetLastError() );
447 
448  SetLastError( 0xdeadbeef );
450  ok( !rsrc, "resource found\n" );
451  ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %u\n", GetLastError() );
452 
453  SetLastError( 0xdeadbeef );
456  ok( !rsrc, "resource found\n" );
457  ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
458 
459  SetLastError( 0xdeadbeef );
462  ok( !rsrc, "resource found\n" );
463  ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
464 }
465 
467 {
468  DWORD i;
469 
472 
474  {
475  win_skip("Resource calls are not implemented\n");
476  return;
477  }
478 
480 
481  for(i=0; i < sizeof( sec_variants ) / sizeof( sec_variants[0] ); i++)
482  {
483  const struct _sec_variants *sec = &sec_variants[i];
484  build_exe( &sec->build );
486  check_exe( &sec->chk_none );
488  check_exe( &sec->chk_delete );
490  check_exe( &sec->chk_version );
492  check_exe( &sec->chk_bigdata );
494  }
496 }
int rsrc_section
Definition: resource.c:114
#define abs(i)
Definition: fconv.c:206
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
static const IMAGE_SECTION_HEADER sh_junk
Definition: resource.c:92
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
BOOL WINAPI UpdateResourceA(HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, WORD wLanguage, LPVOID lpData, DWORD cbData)
Definition: res.c:1738
#define MapViewOfFile
Definition: compat.h:410
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1121
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LANG_NEUTRAL
Definition: nls.h:22
static void update_resources_none(void)
Definition: resource.c:285
#define SUBLANG_DEFAULT
Definition: nls.h:168
static int build_exe(const sec_build *sec_descr)
Definition: resource.c:161
static void check_exe(const sec_verify *verify)
Definition: resource.c:359
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define IMAGE_SCN_MEM_READ
Definition: ntimage.h:240
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
START_TEST(resource)
Definition: resource.c:466
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
static void update_resources_delete(void)
Definition: resource.c:297
#define test
Definition: rosglue.h:37
GLuint GLuint end
Definition: gl.h:1545
static DWORD GLE
Definition: resource.c:27
DWORD PointerToRawData
Definition: pedump.c:290
#define SUBLANG_NEUTRAL
Definition: nls.h:167
const char * filename
Definition: ioapi.h:135
static void update_resources_bigdata(void)
Definition: resource.c:339
IMAGE_NT_HEADERS nt
Definition: module.c:50
#define IMAGE_FILE_DLL
Definition: pedump.c:169
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
static const IMAGE_SECTION_HEADER sh_rsrc_2
Definition: resource.c:57
static void update_empty_exe(void)
Definition: resource.c:254
WORD MajorOperatingSystemVersion
Definition: ntddk_ex.h:160
sec_verify chk_none
Definition: resource.c:121
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
static const IMAGE_SECTION_HEADER sh_junk_2
Definition: resource.c:99
DWORD length
Definition: resource.c:113
static const struct _sec_variants sec_variants[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _sec_build sec_build
#define GENERIC_WRITE
Definition: nt_native.h:90
DWORD NumberOfNamedEntries
Definition: resource.c:115
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
Definition: ntimage.h:438
static void update_resources_version(void)
Definition: resource.c:309
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
sec_verify chk_delete
Definition: resource.c:121
Definition: module.h:566
WORD SizeOfOptionalHeader
Definition: ntddk_ex.h:127
#define FILE_MAP_READ
Definition: compat.h:435
sec_build build
Definition: resource.c:120
unsigned int dir
Definition: maze.c:112
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
#define OPEN_EXISTING
Definition: compat.h:434
static const IMAGE_SECTION_HEADER sh_rodata_1
Definition: resource.c:36
static void update_missing_exe(void)
Definition: resource.c:244
#define RT_DIALOG
Definition: pedump.c:367
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define IMAGE_FILE_MACHINE_I386
Definition: pedump.c:174
#define IMAGE_SCN_CNT_INITIALIZED_DATA
Definition: ntimage.h:231
GLsizeiptr size
Definition: glext.h:5919
sec_verify chk_version
Definition: resource.c:121
static const IMAGE_SECTION_HEADER sh_rsrc_1
Definition: resource.c:50
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
const char file[]
Definition: icontest.c:11
const IMAGE_SECTION_HEADER * sect_in[max_sections]
Definition: resource.c:107
#define IMAGE_FILE_EXECUTABLE_IMAGE
Definition: pedump.c:160
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
static const IMAGE_SECTION_HEADER sh_rsrc_4
Definition: resource.c:71
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define SetLastError(x)
Definition: compat.h:417
#define LANG_ENGLISH
Definition: nls.h:52
struct _sec_verify sec_verify
static const IMAGE_SECTION_HEADER sh_rsrc_6
Definition: resource.c:85
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
Definition: res.c:164
IMAGE_DOS_HEADER dos
Definition: module.c:49
const IMAGE_SECTION_HEADER * sect_out[max_sections]
Definition: resource.c:112
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define GENERIC_READ
Definition: compat.h:124
#define LANG_FRENCH
Definition: nls.h:58
#define LANG_GERMAN
Definition: nls.h:62
DWORD NumberOfIdEntries
Definition: resource.c:115
#define RT_MENU
Definition: pedump.c:366
static const IMAGE_SECTION_HEADER sh_rsrc_5
Definition: resource.c:78
#define CREATE_ALWAYS
Definition: disk.h:72
#define ERROR_RESOURCE_LANG_NOT_FOUND
Definition: winerror.h:1122
sec_verify chk_bigdata
Definition: resource.c:121
#define ok(value,...)
Definition: atltest.h:57
constants
Definition: resource.c:29
#define min(a, b)
Definition: monoChain.cc:55
#define PAGE_READONLY
Definition: compat.h:127
BYTE Name[IMAGE_SIZEOF_SHORT_NAME]
Definition: pedump.c:281
HANDLE WINAPI BeginUpdateResourceA(LPCSTR pFileName, BOOL bDeleteExistingResources)
Definition: res.c:1657
#define ERROR_FILE_INVALID
Definition: winerror.h:585
#define IMAGE_NT_OPTIONAL_HDR_MAGIC
Definition: ntimage.h:387
#define skip(...)
Definition: atltest.h:64
static void test_find_resource(void)
Definition: resource.c:430
GLuint res
Definition: glext.h:9613
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define IMAGE_FILE_RESOURCE_DIRECTORY
Definition: winnt_old.h:647
#define MAKELANGID(p, s)
Definition: nls.h:15
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static const IMAGE_SECTION_HEADER sh_rodata_2
Definition: resource.c:43
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
static const IMAGE_SECTION_HEADER sh_rsrc_3
Definition: resource.c:64
#define UnmapViewOfFile
Definition: compat.h:411
#define memset(x, y, z)
Definition: compat.h:39
union _IMAGE_SECTION_HEADER::@1543 Misc
#define win_skip
Definition: test.h:150
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
Definition: filemap.c:23
#define file_size(inode)
Definition: reiserfs_fs.h:1869
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1120
Definition: fci.c:126
BOOL WINAPI EndUpdateResourceA(HANDLE hUpdate, BOOL fDiscard)
Definition: res.c:1697