ReactOS 0.4.16-dev-1405-gc14a14e
loader.c
Go to the documentation of this file.
1/*
2 * Module loader
3 *
4 * Copyright 1993 Robert J. Amstadt
5 * Copyright 2006 Mike McCormack
6 * Copyright 1995, 2003, 2019 Alexandre Julliard
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include <stdarg.h>
24
25#include "ntstatus.h"
26#define WIN32_NO_STATUS
27#include "windef.h"
28#include "winbase.h"
29#include "winnls.h"
30#include "winternl.h"
31#include "ddk/ntddk.h"
32#include "kernelbase.h"
33#include "wine/list.h"
34#include "wine/asm.h"
35#include "wine/debug.h"
36#include "wine/exception.h"
37
39
40
41/* to keep track of LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE file handles */
43{
44 struct list entry;
47};
49
52{
55 0, 0, { (DWORD_PTR)(__FILE__ ": exclusive_datafile_list_section") }
56};
58
59/***********************************************************************
60 * Modules
61 ***********************************************************************/
62
63
64/******************************************************************
65 * get_proc_address
66 */
68{
71
72 if (!module) module = NtCurrentTeb()->Peb->ImageBaseAddress;
73
74 if ((ULONG_PTR)function >> 16)
75 {
76 RtlInitAnsiString( &str, function );
77 if (!set_ntstatus( LdrGetProcedureAddress( module, &str, 0, (void**)&proc ))) return NULL;
78 }
79 else if (!set_ntstatus( LdrGetProcedureAddress( module, NULL, LOWORD(function), (void**)&proc )))
80 return NULL;
81
82 return proc;
83}
84
85
86/******************************************************************
87 * load_library_as_datafile
88 */
90{
93 HMODULE module = 0;
94 DWORD protect = PAGE_READONLY;
95
96 *mod_ret = 0;
97
99
101 {
103 NULL, OPEN_EXISTING, 0, 0 );
104 }
105 if (file == INVALID_HANDLE_VALUE) return FALSE;
106
107 mapping = CreateFileMappingW( file, NULL, protect, 0, 0, NULL );
108 if (!mapping) goto failed;
109
112 if (!module) goto failed;
113
115 {
116 /* make sure it's a valid PE file */
117 if (!RtlImageNtHeader( module ))
118 {
120 goto failed;
121 }
122 *mod_ret = (HMODULE)((char *)module + 1); /* set bit 0 for data file module */
123
125 {
126 struct exclusive_datafile *datafile = HeapAlloc( GetProcessHeap(), 0, sizeof(*datafile) );
127 if (!datafile) goto failed;
128 datafile->module = *mod_ret;
129 datafile->file = file;
133 TRACE( "delaying close %p for module %p\n", datafile->file, datafile->module );
134 return TRUE;
135 }
136 }
137 else *mod_ret = (HMODULE)((char *)module + 2); /* set bit 1 for image resource module */
138
139 CloseHandle( file );
140 return TRUE;
141
142failed:
144 CloseHandle( file );
145 return FALSE;
146}
147
148
149/******************************************************************
150 * load_library
151 */
153{
157 WCHAR *load_path, *dummy;
158
159 if (flags & unsupported_flags) FIXME( "unsupported flag(s) used %#08lx\n", flags );
160
161 if (!set_ntstatus( LdrGetDllPath( libname->Buffer, flags, &load_path, &dummy ))) return 0;
162
165 {
166 if (LdrGetDllHandleEx( 0, load_path, NULL, libname, &module ))
167 load_library_as_datafile( load_path, flags, libname->Buffer, &module );
168 }
169 else
170 {
171 status = LdrLoadDll( load_path, flags, libname, &module );
172 if (!set_ntstatus( status ))
173 {
174 module = 0;
175 if (status == STATUS_DLL_NOT_FOUND && (GetVersion() & 0x80000000))
177 }
178 }
179
180 RtlReleasePath( load_path );
181 return module;
182}
183
184
185/****************************************************************************
186 * AddDllDirectory (kernelbase.@)
187 */
189{
191 void *cookie;
192
194 if (!set_ntstatus( LdrAddDllDirectory( &str, &cookie ))) return NULL;
195 return cookie;
196}
197
198
199/***********************************************************************
200 * DelayLoadFailureHook (kernelbase.@)
201 */
203{
204 ULONG_PTR args[2];
205
206 if ((ULONG_PTR)function >> 16)
207 ERR( "failed to delay load %s.%s\n", name, function );
208 else
209 ERR( "failed to delay load %s.%u\n", name, LOWORD(function) );
210 args[0] = (ULONG_PTR)name;
211 args[1] = (ULONG_PTR)function;
213 return NULL;
214}
215
216
217/****************************************************************************
218 * DisableThreadLibraryCalls (kernelbase.@)
219 */
221{
223}
224
225
226/***********************************************************************
227 * FreeLibrary (kernelbase.@)
228 */
230{
231 if (!module)
232 {
234 return FALSE;
235 }
236
237 if ((ULONG_PTR)module & 3) /* this is a datafile module */
238 {
239 void *ptr = (void *)((ULONG_PTR)module & ~3);
240 if (!RtlImageNtHeader( ptr ))
241 {
243 return FALSE;
244 }
245 if ((ULONG_PTR)module & 1)
246 {
247 struct exclusive_datafile *file;
248
251 {
252 if (file->module != module) continue;
253 TRACE( "closing %p for module %p\n", file->file, file->module );
254 CloseHandle( file->file );
257 break;
258 }
260 }
261 return UnmapViewOfFile( ptr );
262 }
263
264 return set_ntstatus( LdrUnloadDll( module ));
265}
266
267
268/***********************************************************************
269 * GetModuleFileNameA (kernelbase.@)
270 */
272{
273 LPWSTR filenameW = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) );
274 DWORD len;
275
276 if (!filenameW)
277 {
279 return 0;
280 }
282 {
284 if (len < size)
285 filename[len] = 0;
286 else
288 }
290 return len;
291}
292
293
294/***********************************************************************
295 * GetModuleFileNameW (kernelbase.@)
296 */
298{
299 ULONG len = 0;
300 WIN16_SUBSYSTEM_TIB *win16_tib;
303
304 if (!module && ((win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name)
305 {
306 len = min( size, win16_tib->exe_name->Length / sizeof(WCHAR) );
307 memcpy( filename, win16_tib->exe_name->Buffer, len * sizeof(WCHAR) );
308 if (len < size) filename[len] = 0;
309 goto done;
310 }
311
312 name.Buffer = filename;
313 name.MaximumLength = min( size, UNICODE_STRING_MAX_CHARS ) * sizeof(WCHAR);
314 status = LdrGetDllFullName( module, &name );
315 if (!status || status == STATUS_BUFFER_TOO_SMALL) len = name.Length / sizeof(WCHAR);
317done:
318 TRACE( "%s\n", debugstr_wn(filename, len) );
319 return len;
320}
321
322
323/***********************************************************************
324 * GetModuleHandleA (kernelbase.@)
325 */
327{
328 HMODULE ret;
329
330 GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, module, &ret );
331 return ret;
332}
333
334
335/***********************************************************************
336 * GetModuleHandleW (kernelbase.@)
337 */
339{
340 HMODULE ret;
341
342 GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, module, &ret );
343 return ret;
344}
345
346
347/***********************************************************************
348 * GetModuleHandleExA (kernelbase.@)
349 */
351{
352 WCHAR *nameW;
353
354 if (!module)
355 {
357 return FALSE;
358 }
359
360 if (!name || (flags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
362
363 if (!(nameW = file_name_AtoW( name, FALSE )))
364 {
365 *module = NULL;
367 return FALSE;
368 }
370}
371
372
373/***********************************************************************
374 * GetModuleHandleExW (kernelbase.@)
375 */
377{
378 HMODULE ret = NULL;
380 void *dummy;
381
382 if (!module)
383 {
385 return FALSE;
386 }
387
388 if ((flags & ~(GET_MODULE_HANDLE_EX_FLAG_PIN | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
389 | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
390 || (flags & (GET_MODULE_HANDLE_EX_FLAG_PIN | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT))
391 == (GET_MODULE_HANDLE_EX_FLAG_PIN | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT))
392 {
393 *module = NULL;
395 return FALSE;
396 }
397
398 if (name && !(flags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
399 {
400 UNICODE_STRING wstr;
401 ULONG ldr_flags = 0;
402
403 if (flags & GET_MODULE_HANDLE_EX_FLAG_PIN)
404 ldr_flags |= LDR_GET_DLL_HANDLE_EX_FLAG_PIN;
405 if (flags & GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT)
406 ldr_flags |= LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
407
408 RtlInitUnicodeString( &wstr, name );
409 status = LdrGetDllHandleEx( ldr_flags, NULL, NULL, &wstr, &ret );
410 }
411 else
412 {
413 ret = name ? RtlPcToFileHeader( (void *)name, &dummy ) : NtCurrentTeb()->Peb->ImageBaseAddress;
414
415 if (ret)
416 {
417 if (!(flags & GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT))
418 status = LdrAddRefDll( flags & GET_MODULE_HANDLE_EX_FLAG_PIN ? LDR_ADDREF_DLL_PIN : 0, ret );
419 else
422 }
423
424 *module = ret;
425 return set_ntstatus( status );
426}
427
428
429/***********************************************************************
430 * GetProcAddress (kernelbase.@)
431 */
432
433/*
434 * Work around a Delphi bug on x86_64. When delay loading a symbol,
435 * Delphi saves rcx, rdx, r8 and r9 to the stack. It then calls
436 * GetProcAddress(), pops the saved registers and calls the function.
437 * This works fine if all of the parameters are ints. However, since
438 * it does not save xmm0 - 3, it relies on GetProcAddress() preserving
439 * these registers if the function takes floating point parameters.
440 * This wrapper saves xmm0 - 3 to the stack.
441 */
442#ifdef __arm64ec__
444{
445 asm( ".seh_proc \"#GetProcAddress\"\n\t"
446 "stp x29, x30, [sp, #-48]!\n\t"
447 ".seh_save_fplr_x 48\n\t"
448 ".seh_endprologue\n\t"
449 "stp d0, d1, [sp, #16]\n\t"
450 "stp d2, d3, [sp, #32]\n\t"
451 "bl \"#get_proc_address\"\n\t"
452 "ldp d0, d1, [sp, #16]\n\t"
453 "ldp d2, d3, [sp, #32]\n\t"
454 "ldp x29, x30, [sp], #48\n\t"
455 "ret\n\t"
456 ".seh_endproc" );
457}
458#elif defined(__x86_64__)
460 ".byte 0x48\n\t" /* hotpatch prolog */
461 "pushq %rbp\n\t"
462 __ASM_SEH(".seh_pushreg %rbp\n\t")
463 __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t")
464 __ASM_CFI(".cfi_rel_offset %rbp,0\n\t")
465 "movq %rsp,%rbp\n\t"
466 __ASM_SEH(".seh_setframe %rbp,0\n\t")
467 __ASM_CFI(".cfi_def_cfa_register %rbp\n\t")
468 __ASM_SEH(".seh_endprologue\n\t")
469 "subq $0x60,%rsp\n\t"
470 "andq $~15,%rsp\n\t"
471 "movaps %xmm0,0x20(%rsp)\n\t"
472 "movaps %xmm1,0x30(%rsp)\n\t"
473 "movaps %xmm2,0x40(%rsp)\n\t"
474 "movaps %xmm3,0x50(%rsp)\n\t"
475 "call " __ASM_NAME("get_proc_address") "\n\t"
476 "movaps 0x50(%rsp), %xmm3\n\t"
477 "movaps 0x40(%rsp), %xmm2\n\t"
478 "movaps 0x30(%rsp), %xmm1\n\t"
479 "movaps 0x20(%rsp), %xmm0\n\t"
480 "leaq 0(%rbp),%rsp\n\t"
481 __ASM_CFI(".cfi_def_cfa_register %rsp\n\t")
482 "popq %rbp\n\t"
483 __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")
484 __ASM_CFI(".cfi_same_value %rbp\n\t")
485 "ret" )
486#else /* __x86_64__ */
487
489{
490 return get_proc_address( module, function );
491}
492
493#endif /* __x86_64__ */
494
495
496/***********************************************************************
497 * IsApiSetImplemented (kernelbase.@)
498 */
500{
503 BOOLEAN in_schema, present;
504
506 status = ApiSetQueryApiSetPresenceEx( &str, &in_schema, &present );
508 return !status && present;
509}
510
511
512/***********************************************************************
513 * LoadLibraryA (kernelbase.@)
514 */
516{
517 return LoadLibraryExA( name, 0, 0 );
518}
519
520
521/***********************************************************************
522 * LoadLibraryW (kernelbase.@)
523 */
525{
526 return LoadLibraryExW( name, 0, 0 );
527}
528
529
530/******************************************************************
531 * LoadLibraryExA (kernelbase.@)
532 */
534{
535 WCHAR *nameW;
536
537 if (!(nameW = file_name_AtoW( name, FALSE ))) return 0;
538 return LoadLibraryExW( nameW, file, flags );
539}
540
541
542/***********************************************************************
543 * LoadLibraryExW (kernelbase.@)
544 */
546{
549
550 if (!name)
551 {
553 return 0;
554 }
556 if (str.Buffer[str.Length/sizeof(WCHAR) - 1] != ' ') return load_library( &str, flags );
557
558 /* library name has trailing spaces */
560 while (str.Length > sizeof(WCHAR) && str.Buffer[str.Length/sizeof(WCHAR) - 1] == ' ')
561 str.Length -= sizeof(WCHAR);
562
563 str.Buffer[str.Length/sizeof(WCHAR)] = 0;
566 return module;
567}
568
569
570/***********************************************************************
571 * LoadPackagedLibrary (kernelbase.@)
572 */
574{
575 FIXME( "semi-stub, name %s, reserved %#lx.\n", debugstr_w(name), reserved );
577 return NULL;
578}
579
580
581/***********************************************************************
582 * LoadAppInitDlls (kernelbase.@)
583 */
585{
586 TRACE( "\n" );
587}
588
589
590/****************************************************************************
591 * RemoveDllDirectory (kernelbase.@)
592 */
594{
595 return set_ntstatus( LdrRemoveDllDirectory( cookie ));
596}
597
598
599/*************************************************************************
600 * SetDefaultDllDirectories (kernelbase.@)
601 */
603{
604 return set_ntstatus( LdrSetDefaultDllDirectories( flags ));
605}
606
607
608/***********************************************************************
609 * Resources
610 ***********************************************************************/
611
612
613#define IS_INTRESOURCE(x) (((ULONG_PTR)(x) >> 16) == 0)
614
615/* retrieve the resource name to pass to the ntdll functions */
617{
618 if (IS_INTRESOURCE(name))
619 {
620 str->Buffer = ULongToPtr( LOWORD(name) );
621 return STATUS_SUCCESS;
622 }
623 if (name[0] == '#')
624 {
625 ULONG value;
626 if (RtlCharToInteger( name + 1, 10, &value ) != STATUS_SUCCESS || HIWORD(value))
628 str->Buffer = ULongToPtr(value);
629 return STATUS_SUCCESS;
630 }
633 return STATUS_SUCCESS;
634}
635
636/* retrieve the resource name to pass to the ntdll functions */
638{
639 if (IS_INTRESOURCE(name))
640 {
641 str->Buffer = ULongToPtr( LOWORD(name) );
642 return STATUS_SUCCESS;
643 }
644 if (name[0] == '#')
645 {
646 ULONG value;
650 str->Buffer = ULongToPtr(value);
651 return STATUS_SUCCESS;
652 }
655 return STATUS_SUCCESS;
656}
657
658
659/**********************************************************************
660 * EnumResourceLanguagesExA (kernelbase.@)
661 */
665{
666 int i;
667 BOOL ret = FALSE;
671 const IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
673
674 TRACE( "%p %s %s %p %Ix %lx %d\n", module, debugstr_a(type), debugstr_a(name),
675 func, param, flags, lang );
676
677 if (flags & (RESOURCE_ENUM_MUI | RESOURCE_ENUM_MUI_SYSTEM | RESOURCE_ENUM_VALIDATE))
678 FIXME( "unimplemented flags: %lx\n", flags );
679
680 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
681 if (!(flags & RESOURCE_ENUM_LN)) return ret;
682
683 if (!module) module = GetModuleHandleW( 0 );
684 typeW.Buffer = nameW.Buffer = NULL;
685 if ((status = LdrFindResourceDirectory_U( module, NULL, 0, &basedir )) != STATUS_SUCCESS)
686 goto done;
688 goto done;
690 goto done;
691 info.Type = (ULONG_PTR)typeW.Buffer;
692 info.Name = (ULONG_PTR)nameW.Buffer;
693 if ((status = LdrFindResourceDirectory_U( module, &info, 2, &resdir )) != STATUS_SUCCESS)
694 goto done;
695
696 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
697 __TRY
698 {
699 for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
700 {
701 ret = func( module, type, name, et[i].Id, param );
702 if (!ret) break;
703 }
704 }
706 {
707 ret = FALSE;
709 }
711done:
712 if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
713 if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
715 return ret;
716}
717
718
719/**********************************************************************
720 * EnumResourceLanguagesExW (kernelbase.@)
721 */
725{
726 int i;
727 BOOL ret = FALSE;
731 const IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
733
734 TRACE( "%p %s %s %p %Ix %lx %d\n", module, debugstr_w(type), debugstr_w(name),
735 func, param, flags, lang );
736
737 if (flags & (RESOURCE_ENUM_MUI | RESOURCE_ENUM_MUI_SYSTEM | RESOURCE_ENUM_VALIDATE))
738 FIXME( "unimplemented flags: %lx\n", flags );
739
740 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
741 if (!(flags & RESOURCE_ENUM_LN)) return ret;
742
743 if (!module) module = GetModuleHandleW( 0 );
744 typeW.Buffer = nameW.Buffer = NULL;
745 if ((status = LdrFindResourceDirectory_U( module, NULL, 0, &basedir )) != STATUS_SUCCESS)
746 goto done;
748 goto done;
750 goto done;
751 info.Type = (ULONG_PTR)typeW.Buffer;
752 info.Name = (ULONG_PTR)nameW.Buffer;
753 if ((status = LdrFindResourceDirectory_U( module, &info, 2, &resdir )) != STATUS_SUCCESS)
754 goto done;
755
756 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
757 __TRY
758 {
759 for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
760 {
761 ret = func( module, type, name, et[i].Id, param );
762 if (!ret) break;
763 }
764 }
766 {
767 ret = FALSE;
769 }
771done:
772 if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
773 if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
775 return ret;
776}
777
778
779/**********************************************************************
780 * EnumResourceNamesExA (kernelbase.@)
781 */
784{
785 int i;
786 BOOL ret = FALSE;
787 DWORD len = 0, newlen;
788 LPSTR name = NULL;
792 const IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
795
796 TRACE( "%p %s %p %Ix\n", module, debugstr_a(type), func, param );
797
798 if (flags & (RESOURCE_ENUM_MUI | RESOURCE_ENUM_MUI_SYSTEM | RESOURCE_ENUM_VALIDATE))
799 FIXME( "unimplemented flags: %lx\n", flags );
800
801 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
802 if (!(flags & RESOURCE_ENUM_LN)) return ret;
803
804 if (!module) module = GetModuleHandleW( 0 );
805 typeW.Buffer = NULL;
806 if ((status = LdrFindResourceDirectory_U( module, NULL, 0, &basedir )) != STATUS_SUCCESS)
807 goto done;
809 goto done;
810 info.Type = (ULONG_PTR)typeW.Buffer;
812 goto done;
813
814 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
815 __TRY
816 {
817 for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
818 {
819 if (et[i].NameIsString)
820 {
821 str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)basedir + et[i].NameOffset);
822 newlen = WideCharToMultiByte(CP_ACP, 0, str->NameString, str->Length, NULL, 0, NULL, NULL);
823 if (newlen + 1 > len)
824 {
825 len = newlen + 1;
827 if (!(name = HeapAlloc( GetProcessHeap(), 0, len + 1 )))
828 {
829 ret = FALSE;
830 break;
831 }
832 }
833 WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, name, len, NULL, NULL );
834 name[newlen] = 0;
835 ret = func( module, type, name, param );
836 }
837 else
838 {
839 ret = func( module, type, UIntToPtr(et[i].Id), param );
840 }
841 if (!ret) break;
842 }
843 }
845 {
846 ret = FALSE;
848 }
850
851done:
853 if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
855 return ret;
856}
857
858
859/**********************************************************************
860 * EnumResourceNamesExW (kernelbase.@)
861 */
864{
865 int i, len = 0;
866 BOOL ret = FALSE;
867 LPWSTR name = NULL;
871 const IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
874
875 TRACE( "%p %s %p %Ix\n", module, debugstr_w(type), func, param );
876
877 if (flags & (RESOURCE_ENUM_MUI | RESOURCE_ENUM_MUI_SYSTEM | RESOURCE_ENUM_VALIDATE))
878 FIXME( "unimplemented flags: %lx\n", flags );
879
880 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
881 if (!(flags & RESOURCE_ENUM_LN)) return ret;
882
883 if (!module) module = GetModuleHandleW( 0 );
884 typeW.Buffer = NULL;
885 if ((status = LdrFindResourceDirectory_U( module, NULL, 0, &basedir )) != STATUS_SUCCESS)
886 goto done;
888 goto done;
889 info.Type = (ULONG_PTR)typeW.Buffer;
891 goto done;
892
893 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
894 __TRY
895 {
896 for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
897 {
898 if (et[i].NameIsString)
899 {
900 str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)basedir + et[i].NameOffset);
901 if (str->Length + 1 > len)
902 {
903 len = str->Length + 1;
905 if (!(name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
906 {
907 ret = FALSE;
908 break;
909 }
910 }
911 memcpy(name, str->NameString, str->Length * sizeof (WCHAR));
912 name[str->Length] = 0;
913 ret = func( module, type, name, param );
914 }
915 else
916 {
917 ret = func( module, type, UIntToPtr(et[i].Id), param );
918 }
919 if (!ret) break;
920 }
921 }
923 {
924 ret = FALSE;
926 }
928done:
930 if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
932 return ret;
933}
934
935
936/**********************************************************************
937 * EnumResourceNamesW (kernelbase.@)
938 */
941{
942 return EnumResourceNamesExW( module, type, func, param, 0, 0 );
943}
944
945
946/**********************************************************************
947 * EnumResourceTypesExA (kernelbase.@)
948 */
951{
952 int i;
953 BOOL ret = FALSE;
954 LPSTR type = NULL;
955 DWORD len = 0, newlen;
956 const IMAGE_RESOURCE_DIRECTORY *resdir;
959
960 TRACE( "%p %p %Ix\n", module, func, param );
961
962 if (flags & (RESOURCE_ENUM_MUI | RESOURCE_ENUM_MUI_SYSTEM | RESOURCE_ENUM_VALIDATE))
963 FIXME( "unimplemented flags: %lx\n", flags );
964
965 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
966 if (!(flags & RESOURCE_ENUM_LN)) return ret;
967
968 if (!module) module = GetModuleHandleW( 0 );
969
970 if (!set_ntstatus( LdrFindResourceDirectory_U( module, NULL, 0, &resdir ))) return FALSE;
971
972 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
973 for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
974 {
975 if (et[i].NameIsString)
976 {
977 str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)resdir + et[i].NameOffset);
978 newlen = WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, NULL, 0, NULL, NULL);
979 if (newlen + 1 > len)
980 {
981 len = newlen + 1;
983 if (!(type = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE;
984 }
985 WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, type, len, NULL, NULL);
986 type[newlen] = 0;
987 ret = func( module, type, param );
988 }
989 else
990 {
991 ret = func( module, UIntToPtr(et[i].Id), param );
992 }
993 if (!ret) break;
994 }
996 return ret;
997}
998
999
1000/**********************************************************************
1001 * EnumResourceTypesExW (kernelbase.@)
1002 */
1005{
1006 int i, len = 0;
1007 BOOL ret = FALSE;
1008 LPWSTR type = NULL;
1009 const IMAGE_RESOURCE_DIRECTORY *resdir;
1012
1013 TRACE( "%p %p %Ix\n", module, func, param );
1014
1015 if (!flags) flags = RESOURCE_ENUM_LN | RESOURCE_ENUM_MUI;
1016 if (!(flags & RESOURCE_ENUM_LN)) return ret;
1017
1018 if (!module) module = GetModuleHandleW( 0 );
1019
1020 if (!set_ntstatus( LdrFindResourceDirectory_U( module, NULL, 0, &resdir ))) return FALSE;
1021
1022 et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
1023 for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
1024 {
1025 if (et[i].NameIsString)
1026 {
1027 str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)resdir + et[i].NameOffset);
1028 if (str->Length + 1 > len)
1029 {
1030 len = str->Length + 1;
1031 HeapFree( GetProcessHeap(), 0, type );
1032 if (!(type = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return FALSE;
1033 }
1034 memcpy(type, str->NameString, str->Length * sizeof (WCHAR));
1035 type[str->Length] = 0;
1036 ret = func( module, type, param );
1037 }
1038 else
1039 {
1040 ret = func( module, UIntToPtr(et[i].Id), param );
1041 }
1042 if (!ret) break;
1043 }
1044 HeapFree( GetProcessHeap(), 0, type );
1045 return ret;
1046}
1047
1048
1049/**********************************************************************
1050 * FindResourceExW (kernelbase.@)
1051 */
1053{
1058
1059 TRACE( "%p %s %s %04x\n", module, debugstr_w(type), debugstr_w(name), lang );
1060
1061 if (!module) module = GetModuleHandleW( 0 );
1062 nameW.Buffer = typeW.Buffer = NULL;
1063
1064 __TRY
1065 {
1066 if ((status = get_res_nameW( name, &nameW )) != STATUS_SUCCESS) goto done;
1067 if ((status = get_res_nameW( type, &typeW )) != STATUS_SUCCESS) goto done;
1068 info.Type = (ULONG_PTR)typeW.Buffer;
1069 info.Name = (ULONG_PTR)nameW.Buffer;
1070 info.Language = lang;
1072 done:
1074 }
1076 {
1078 }
1079 __ENDTRY
1080
1081 if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
1082 if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
1083 return (HRSRC)entry;
1084}
1085
1086
1087/**********************************************************************
1088 * FindResourceW (kernelbase.@)
1089 */
1091{
1093}
1094
1095
1096/**********************************************************************
1097 * FreeResource (kernelbase.@)
1098 */
1100{
1101 return FALSE;
1102}
1103
1104
1105/**********************************************************************
1106 * LoadResource (kernelbase.@)
1107 */
1109{
1110 void *ret;
1111
1112 TRACE( "%p %p\n", module, rsrc );
1113
1114 if (!rsrc) return 0;
1115 if (!module) module = GetModuleHandleW( 0 );
1117 return 0;
1118 return ret;
1119}
1120
1121
1122/**********************************************************************
1123 * LockResource (kernelbase.@)
1124 */
1126{
1127 return handle;
1128}
1129
1130
1131/**********************************************************************
1132 * SizeofResource (kernelbase.@)
1133 */
1135{
1136 if (!rsrc) return 0;
1137 return ((IMAGE_RESOURCE_DATA_ENTRY *)rsrc)->Size;
1138}
1139
1140
1141/***********************************************************************
1142 * Activation contexts
1143 ***********************************************************************/
1144
1145
1146/***********************************************************************
1147 * ActivateActCtx (kernelbase.@)
1148 */
1150{
1152}
1153
1154
1155/***********************************************************************
1156 * AddRefActCtx (kernelbase.@)
1157 */
1159{
1161}
1162
1163
1164/***********************************************************************
1165 * CreateActCtxW (kernelbase.@)
1166 */
1168{
1170
1171 TRACE( "%p %08lx\n", ctx, ctx ? ctx->dwFlags : 0 );
1172
1174 return context;
1175}
1176
1177
1178/***********************************************************************
1179 * DeactivateActCtx (kernelbase.@)
1180 */
1182{
1184 return TRUE;
1185}
1186
1187
1188/***********************************************************************
1189 * FindActCtxSectionGuid (kernelbase.@)
1190 */
1193{
1195}
1196
1197
1198/***********************************************************************
1199 * FindActCtxSectionStringW (kernelbase.@)
1200 */
1203{
1205
1206 if (!info)
1207 {
1209 return FALSE;
1210 }
1212 return set_ntstatus( RtlFindActivationContextSectionString( flags, ext_guid, id, &us, info ));
1213}
1214
1215
1216/***********************************************************************
1217 * GetCurrentActCtx (kernelbase.@)
1218 */
1220{
1221 return set_ntstatus( RtlGetActiveActivationContext( pcontext ));
1222}
1223
1224
1225/***********************************************************************
1226 * QueryActCtxSettingsW (kernelbase.@)
1227 */
1230 SIZE_T *written )
1231{
1233 buffer, size, written ));
1234}
1235
1236
1237/***********************************************************************
1238 * QueryActCtxW (kernelbase.@)
1239 */
1241 PVOID buffer, SIZE_T size, SIZE_T *written )
1242{
1244 buffer, size, written ));
1245}
1246
1247
1248/***********************************************************************
1249 * ReleaseActCtx (kernelbase.@)
1250 */
1252{
1254}
1255
1256
1257/***********************************************************************
1258 * ZombifyActCtx (kernelbase.@)
1259 */
1261{
1263}
DWORD Id
struct mke2fs_defaults settings[]
unsigned char BOOLEAN
unsigned int dir
Definition: maze.c:112
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
static const WCHAR nameW[]
Definition: main.c:49
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
NTSTATUS NTAPI LdrDisableThreadCalloutsForDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1154
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define UIntToPtr(ui)
Definition: basetsd.h:90
#define ULongToPtr(ul)
Definition: basetsd.h:92
Definition: list.h:37
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define __attribute__(x)
Definition: wpp_private.h:207
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
Definition: libsupp.c:658
static __inline BOOL set_ntstatus(NTSTATUS status)
Definition: security.c:227
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define PAGE_READONLY
Definition: compat.h:138
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:104
int(* FARPROC)()
Definition: compat.h:36
#define UnmapViewOfFile
Definition: compat.h:746
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define __TRY
Definition: compat.h:80
#define FreeLibrary(x)
Definition: compat.h:748
#define GENERIC_READ
Definition: compat.h:135
#define RtlImageNtHeader
Definition: compat.h:806
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define __ENDTRY
Definition: compat.h:82
#define WideCharToMultiByte
Definition: compat.h:111
#define MapViewOfFile
Definition: compat.h:745
#define LoadLibraryW(x)
Definition: compat.h:747
#define FILE_SHARE_READ
Definition: compat.h:136
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:866
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI GetModuleHandleExA(IN DWORD dwFlags, IN LPCSTR lpModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:896
FARPROC WINAPI DelayLoadFailureHook(LPCSTR pszDllName, LPCSTR pszProcName)
Definition: loader.c:1083
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
WCHAR * file_name_AtoW(LPCSTR name, BOOL alloc)
Definition: file.c:411
DWORD file_name_WtoA(LPCWSTR src, INT srclen, LPSTR dest, INT destlen)
Definition: file.c:438
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceNamesW(HMODULE module, LPCWSTR type, ENUMRESNAMEPROCW func, LONG_PTR param)
Definition: loader.c:939
static BOOL load_library_as_datafile(LPCWSTR load_path, DWORD flags, LPCWSTR name, HMODULE *mod_ret)
Definition: loader.c:89
HGLOBAL WINAPI DECLSPEC_HOTPATCH LoadResource(HINSTANCE module, HRSRC rsrc)
Definition: loader.c:1108
BOOL WINAPI DECLSPEC_HOTPATCH QueryActCtxW(DWORD flags, HANDLE context, PVOID inst, ULONG class, PVOID buffer, SIZE_T size, SIZE_T *written)
Definition: loader.c:1240
DLL_DIRECTORY_COOKIE WINAPI DECLSPEC_HOTPATCH AddDllDirectory(const WCHAR *dir)
Definition: loader.c:188
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceTypesExA(HMODULE module, ENUMRESTYPEPROCA func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:949
BOOL WINAPI DECLSPEC_HOTPATCH FreeResource(HGLOBAL handle)
Definition: loader.c:1099
LPVOID WINAPI DECLSPEC_HOTPATCH LockResource(HGLOBAL handle)
Definition: loader.c:1125
static NTSTATUS get_res_nameW(LPCWSTR name, UNICODE_STRING *str)
Definition: loader.c:637
void WINAPI DECLSPEC_HOTPATCH ReleaseActCtx(HANDLE context)
Definition: loader.c:1251
BOOL WINAPI DECLSPEC_HOTPATCH SetDefaultDllDirectories(DWORD flags)
Definition: loader.c:602
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: loader.c:51
BOOL WINAPI DECLSPEC_HOTPATCH QueryActCtxSettingsW(DWORD flags, HANDLE ctx, const WCHAR *ns, const WCHAR *settings, WCHAR *buffer, SIZE_T size, SIZE_T *written)
Definition: loader.c:1228
HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceExW(HMODULE module, LPCWSTR type, LPCWSTR name, WORD lang)
Definition: loader.c:1052
BOOL WINAPI DECLSPEC_HOTPATCH DeactivateActCtx(DWORD flags, ULONG_PTR cookie)
Definition: loader.c:1181
DWORD WINAPI DECLSPEC_HOTPATCH SizeofResource(HINSTANCE module, HRSRC rsrc)
Definition: loader.c:1134
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceLanguagesExA(HMODULE module, LPCSTR type, LPCSTR name, ENUMRESLANGPROCA func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:662
FARPROC WINAPI get_proc_address(HMODULE module, LPCSTR function)
Definition: loader.c:67
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceNamesExW(HMODULE module, LPCWSTR type, ENUMRESNAMEPROCW func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:862
BOOL WINAPI DECLSPEC_HOTPATCH FindActCtxSectionStringW(DWORD flags, const GUID *ext_guid, ULONG id, LPCWSTR str, PACTCTX_SECTION_KEYED_DATA info)
Definition: loader.c:1201
static CRITICAL_SECTION exclusive_datafile_list_section
Definition: loader.c:50
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceTypesExW(HMODULE module, ENUMRESTYPEPROCW func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:1003
#define IS_INTRESOURCE(x)
Definition: loader.c:613
BOOL WINAPI IsApiSetImplemented(LPCSTR name)
Definition: loader.c:499
BOOL WINAPI DECLSPEC_HOTPATCH RemoveDllDirectory(DLL_DIRECTORY_COOKIE cookie)
Definition: loader.c:593
void WINAPI DECLSPEC_HOTPATCH AddRefActCtx(HANDLE context)
Definition: loader.c:1158
static struct list exclusive_datafile_list
Definition: loader.c:48
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceLanguagesExW(HMODULE module, LPCWSTR type, LPCWSTR name, ENUMRESLANGPROCW func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:722
HMODULE WINAPI LoadPackagedLibrary(LPCWSTR name, DWORD reserved)
Definition: loader.c:573
static NTSTATUS get_res_nameA(LPCSTR name, UNICODE_STRING *str)
Definition: loader.c:616
BOOL WINAPI DECLSPEC_HOTPATCH ActivateActCtx(HANDLE context, ULONG_PTR *cookie)
Definition: loader.c:1149
BOOL WINAPI DECLSPEC_HOTPATCH EnumResourceNamesExA(HMODULE module, LPCSTR type, ENUMRESNAMEPROCA func, LONG_PTR param, DWORD flags, LANGID lang)
Definition: loader.c:782
HRSRC WINAPI DECLSPEC_HOTPATCH FindResourceW(HINSTANCE module, LPCWSTR name, LPCWSTR type)
Definition: loader.c:1090
static HMODULE load_library(const UNICODE_STRING *libname, DWORD flags)
Definition: loader.c:152
void WINAPI LoadAppInitDlls(void)
Definition: loader.c:584
BOOL WINAPI DECLSPEC_HOTPATCH ZombifyActCtx(HANDLE context)
Definition: loader.c:1260
HANDLE WINAPI DECLSPEC_HOTPATCH CreateActCtxW(PCACTCTXW ctx)
Definition: loader.c:1167
BOOL WINAPI DECLSPEC_HOTPATCH GetCurrentActCtx(HANDLE *pcontext)
Definition: loader.c:1219
BOOL WINAPI DECLSPEC_HOTPATCH FindActCtxSectionGuid(DWORD flags, const GUID *ext_guid, ULONG id, const GUID *guid, PACTCTX_SECTION_KEYED_DATA info)
Definition: loader.c:1191
GUID guid
Definition: version.c:147
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
static const WCHAR typeW[]
Definition: name.c:51
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
#define ULONG_PTR
Definition: config.h:101
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
Definition: string_lib.cpp:46
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum func
Definition: glext.h:6028
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
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
NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD, HANDLE, ULONG_PTR *)
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG, const GUID *, ULONG, const UNICODE_STRING *, PVOID)
Definition: actctx.c:5874
NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE)
Definition: actctx.c:5396
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
Definition: actctx.c:5373
NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD, ULONG_PTR)
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5384
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE *, const void *)
NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE *)
Definition: actctx.c:5539
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5572
const char * filename
Definition: ioapi.h:137
#define NtCurrentTeb
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
NTSTATUS NTAPI LdrUnloadDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1291
NTSTATUS NTAPI LdrGetDllHandleEx(_In_ ULONG Flags, _In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_opt_ PVOID *DllHandle)
Definition: ldrapi.c:505
NTSTATUS NTAPI DECLSPEC_HOTPATCH LdrLoadDll(_In_opt_ PWSTR SearchPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *BaseAddress)
Definition: ldrapi.c:312
NTSTATUS NTAPI LdrAddRefDll(_In_ ULONG Flags, _In_ PVOID BaseAddress)
Definition: ldrapi.c:1205
NTSTATUS NTAPI LdrGetProcedureAddress(_In_ PVOID BaseAddress, _In_opt_ _When_(Ordinal==0, _Notnull_) PANSI_STRING Name, _In_opt_ _When_(Name==NULL, _In_range_(>, 0)) ULONG Ordinal, _Out_ PVOID *ProcedureAddress)
Definition: ldrapi.c:789
NTSTATUS NTAPI LdrAccessResource(_In_ PVOID BaseAddress, _In_ PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, _Out_opt_ PVOID *Resource, _Out_opt_ PULONG Size)
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
NTSTATUS NTAPI LdrFindResourceDirectory_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory)
#define LDR_ADDREF_DLL_PIN
Definition: ldrtypes.h:75
USHORT LANGID
Definition: mui.h:9
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
static const WCHAR filenameW[]
Definition: amstream.c:41
static const BYTE us[]
Definition: encode.c:689
static const GUID PACTCTX_SECTION_KEYED_DATA
Definition: actctx.c:36
#define __ASM_NAME(name)
Definition: config.h:934
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
#define min(a, b)
Definition: monoChain.cc:55
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SEC_IMAGE
Definition: mmtypes.h:97
NTSYSAPI NTSTATUS NTAPI RtlFindActivationContextSectionGuid(ULONG flags, const GUID *extguid, ULONG section_kind, const GUID *guid, void *ptr)
Definition: actctx.c:5946
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
Definition: unicode.c:261
#define UNICODE_STRING_MAX_CHARS
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:545
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
static HANDLE proc()
Definition: pdb.c:34
#define LOWORD(l)
Definition: pedump.c:82
#define __ASM_CFI(str)
Definition: asm.h:39
#define __ASM_SEH(str)
Definition: asm.h:45
const WCHAR * str
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define DECLSPEC_HOTPATCH
Definition: config.h:9
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings(DWORD flags, HANDLE handle, const WCHAR *ns, const WCHAR *settings, WCHAR *buffer, SIZE_T size, SIZE_T *written)
Definition: actctx.c:5988
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define TRACE(s)
Definition: solgame.cpp:4
LIST_ENTRY ProcessLocksList
Definition: winbase.h:918
Definition: pedump.c:458
Definition: pedump.c:414
ULONG NameOffset
Definition: ntimage.h:185
Definition: match.c:390
Definition: http.c:7252
Definition: cookie.c:34
HMODULE module
Definition: loader.c:45
struct list entry
Definition: loader.c:44
Definition: fci.c:127
struct list entry
Definition: fci.c:128
Definition: name.c:39
Definition: mxnamespace.c:45
Definition: ps.c:97
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23
#define EXCEPTION_WINE_STUB
Definition: stubs.h:31
#define LIST_INIT(head)
Definition: queue.h:197
#define DWORD_PTR
Definition: treelist.c:76
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
HANDLE HMODULE
Definition: typedefs.h:77
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
Definition: pdh_main.c:96
static const WCHAR lang[]
Definition: wbemdisp.c:287
BOOL(CALLBACK * ENUMRESNAMEPROCW)(HMODULE, LPCWSTR, LPWSTR, LONG_PTR)
Definition: winbase.h:1489
BOOL(CALLBACK * ENUMRESLANGPROCA)(HMODULE, LPCSTR, LPCSTR, WORD, LONG_PTR)
Definition: winbase.h:1486
BOOL(CALLBACK * ENUMRESTYPEPROCA)(HMODULE, LPSTR, LONG_PTR)
Definition: winbase.h:1490
#define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET
Definition: winbase.h:382
#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE
Definition: winbase.h:381
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE
Definition: winbase.h:380
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:375
BOOL(CALLBACK * ENUMRESNAMEPROCA)(HMODULE, LPCSTR, LPSTR, LONG_PTR)
Definition: winbase.h:1488
#define LOAD_IGNORE_CODE_AUTHZ_LEVEL
Definition: winbase.h:378
BOOL(CALLBACK * ENUMRESLANGPROCW)(HMODULE, LPCWSTR, LPCWSTR, WORD, LONG_PTR)
Definition: winbase.h:1487
BOOL(CALLBACK * ENUMRESTYPEPROCW)(HMODULE, LPWSTR, LONG_PTR)
Definition: winbase.h:1491
#define WINAPI
Definition: msvc.h:6
#define APPMODEL_ERROR_NO_PACKAGE
Definition: winerror.h:2337
#define ERROR_DLL_NOT_FOUND
Definition: winerror.h:679
#define ERROR_BAD_EXE_FORMAT
Definition: winerror.h:251
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193