ReactOS 0.4.15-dev-7918-g2a2556c
loader.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT : ReactOS system libraries
4 * MODULE : kernel32.dll
5 * FILE : reactos/dll/win32/kernel32/misc/ldr.c
6 * AUTHOR : Aleksey Bragin <aleksey@reactos.org>
7 */
8
9#include <k32.h>
10
11#define NDEBUG
12#include <debug.h>
13
14/* FUNCTIONS ****************************************************************/
15
19{
22}
23
27 LPCWSTR lpwModuleName,
28 HMODULE *phModule)
29{
30 /* Set phModule to 0 if it's not a NULL pointer */
31 if (phModule) *phModule = 0;
32
33 /* Check for invalid flags combination */
34 if (dwFlags & ~(GET_MODULE_HANDLE_EX_FLAG_PIN |
35 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT |
36 GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS) ||
37 ((dwFlags & GET_MODULE_HANDLE_EX_FLAG_PIN) &&
38 (dwFlags & GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT)) ||
39 (!lpwModuleName && (dwFlags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
40 )
41 {
44 }
45
46 /* Check 2nd parameter */
47 if (!phModule)
48 {
51 }
52
53 /* Return what we have according to the module name */
54 if (lpwModuleName)
55 {
57 }
58
59 /* No name given, so put ImageBaseAddress there */
60 *phModule = (HMODULE)NtCurrentPeb()->ImageBaseAddress;
61
63}
64
68{
69 /* If no handle is provided - use current image base address */
70 if (!hModule) return NtCurrentPeb()->ImageBaseAddress;
71
72 /* Check if it's a normal or a datafile one */
73 if (LDR_IS_DATAFILE(hModule) && !AsDataFile)
74 return NULL;
75
76 /* It's a normal DLL, just return its handle */
77 return hModule;
78}
79
80/*
81 * @implemented
82 */
83BOOL
87{
89
90 /* Disable thread library calls */
92
93 /* If it wasn't success - set last error and return failure */
94 if (!NT_SUCCESS(Status))
95 {
97 return FALSE;
98 }
99
100 /* Return success */
101 return TRUE;
102}
103
104
105/*
106 * @implemented
107 */
109WINAPI
111LoadLibraryA(LPCSTR lpLibFileName)
112{
113 static const CHAR TwainDllName[] = "twain_32.dll";
114 LPSTR PathBuffer;
115 UINT Len;
117
118 /* Treat twain_32.dll in a special way (what a surprise...) */
119 if (lpLibFileName && !_strcmpi(lpLibFileName, TwainDllName))
120 {
121 /* Allocate space for the buffer */
122 PathBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, MAX_PATH + sizeof(ANSI_NULL));
123 if (PathBuffer)
124 {
125 /* Get windows dir in this buffer */
126 Len = GetWindowsDirectoryA(PathBuffer, MAX_PATH);
127 if ((Len != 0) && (Len < (MAX_PATH - sizeof(TwainDllName) - sizeof('\\'))))
128 {
129 /* We successfully got windows directory. Concatenate twain_32.dll to it */
130 PathBuffer[Len] = '\\';
131 strcpy(&PathBuffer[Len + 1], TwainDllName);
132
133 /* And recursively call ourselves with a new string */
134 Result = LoadLibraryA(PathBuffer);
135
136 /* If it was successful - free memory and return result */
137 if (Result)
138 {
139 RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer);
140 return Result;
141 }
142 }
143
144 /* Free allocated buffer */
145 RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer);
146 }
147 }
148
149 /* Call the Ex version of the API */
150 return LoadLibraryExA(lpLibFileName, 0, 0);
151}
152
153/*
154 * @implemented
155 */
157WINAPI
159LoadLibraryExA(LPCSTR lpLibFileName,
162{
163 PUNICODE_STRING FileNameW;
164
165 /* Convert file name to unicode */
166 if (!(FileNameW = Basep8BitStringToStaticUnicodeString(lpLibFileName)))
167 return NULL;
168
169 /* And call W version of the API */
170 return LoadLibraryExW(FileNameW->Buffer, hFile, dwFlags);
171}
172
173/*
174 * @implemented
175 */
177WINAPI
179LoadLibraryW(LPCWSTR lpLibFileName)
180{
181 /* Call Ex version of the API */
182 return LoadLibraryExW(lpLibFileName, 0, 0);
183}
184
185
186static
189{
190 WCHAR FilenameW[MAX_PATH];
192 HANDLE hMapping;
194 PVOID lpBaseAddress = NULL;
195 SIZE_T ViewSize = 0;
196 //PUNICODE_STRING OriginalName;
197 //UNICODE_STRING dotDLL = RTL_CONSTANT_STRING(L".DLL");
198
199 /* Zero out handle value */
200 *hModule = 0;
201
202 DPRINT("BasepLoadLibraryAsDatafile(%S %S %p)\n", Path, Name, hModule);
203
204 /*Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
205 Name,
206 &dotDLL,
207 RedirName,
208 RedirName2,
209 &OriginalName2,
210 NULL,
211 NULL,
212 NULL);*/
213
214 /* Try to search for it */
215 if (!SearchPathW(Path,
216 Name,
217 L".DLL",
218 sizeof(FilenameW) / sizeof(FilenameW[0]),
219 FilenameW,
220 NULL))
221 {
222 /* Return last status value directly */
223 return NtCurrentTeb()->LastStatusValue;
224 }
225
226 /* Open this file we found */
227 hFile = CreateFileW(FilenameW,
230 NULL,
232 0,
233 0);
234
235 /* If opening failed - return last status value */
236 if (hFile == INVALID_HANDLE_VALUE) return NtCurrentTeb()->LastStatusValue;
237
238 /* Create file mapping */
239 hMapping = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
240
241 /* Close the file handle */
243
244 /* If creating file mapping failed - return last status value */
245 if (!hMapping) return NtCurrentTeb()->LastStatusValue;
246
247 /* Map view of section */
248 Status = NtMapViewOfSection(hMapping,
250 &lpBaseAddress,
251 0,
252 0,
253 0,
254 &ViewSize,
255 ViewShare,
256 0,
258
259 /* Close handle to the section */
260 CloseHandle(hMapping);
261
262 /* If mapping view of section failed - return last status value */
263 if (!NT_SUCCESS(Status)) return NtCurrentTeb()->LastStatusValue;
264
265 /* Make sure it's a valid PE file */
266 if (!RtlImageNtHeader(lpBaseAddress))
267 {
268 /* Unmap the view and return failure status */
269 UnmapViewOfFile(lpBaseAddress);
271 }
272
273 /* Set low bit of handle to indicate datafile module */
274 *hModule = (HMODULE)((ULONG_PTR)lpBaseAddress | 1);
275
276 /* Load alternate resource module */
277 //LdrLoadAlternateResourceModule(*hModule, FilenameW);
278
279 return STATUS_SUCCESS;
280}
281
282/*
283 * @implemented
284 */
286WINAPI
291{
292 UNICODE_STRING DllName;
296 ULONG DllCharacteristics = 0;
297 BOOL FreeString = FALSE;
298
299 /* Check for any flags LdrLoadDll might be interested in */
301 {
302 /* Tell LDR to treat it as an EXE */
303 DllCharacteristics = IMAGE_FILE_EXECUTABLE_IMAGE;
304 }
305
306 /* Build up a unicode dll name from null-terminated string */
307 RtlInitUnicodeString(&DllName, (LPWSTR)lpLibFileName);
308
309 /* Lazy-initialize BasepExeLdrEntry */
310 if (!BasepExeLdrEntry)
312
313 /* Check if that module is our exe*/
316 {
317 /* Lengths match and it's not a datafile, so perform name comparison */
319 {
320 /* That's us! */
322 }
323 }
324
325 /* Check for trailing spaces and remove them if necessary */
326 if (DllName.Buffer[DllName.Length/sizeof(WCHAR) - 1] == L' ')
327 {
328 RtlCreateUnicodeString(&DllName, (LPWSTR)lpLibFileName);
329 while (DllName.Length > sizeof(WCHAR) &&
330 DllName.Buffer[DllName.Length/sizeof(WCHAR) - 1] == L' ')
331 {
332 DllName.Length -= sizeof(WCHAR);
333 }
334 DllName.Buffer[DllName.Length/sizeof(WCHAR)] = UNICODE_NULL;
335 FreeString = TRUE;
336 }
337
338 /* Compute the load path */
340 DllName.Buffer : NULL,
341 NULL);
342 if (!SearchPath)
343 {
344 /* Getting DLL path failed, so set last error, free mem and return */
346 if (FreeString) RtlFreeUnicodeString(&DllName);
347 return NULL;
348 }
349
351 {
353 {
354 /* If the image is loaded as a datafile, try to get its handle */
355 Status = LdrGetDllHandleEx(0, SearchPath, NULL, &DllName, (PVOID*)&hInst);
356 if (!NT_SUCCESS(Status))
357 {
358 /* It's not loaded yet - so load it up */
360 }
361 _SEH2_YIELD(goto done;)
362 }
363
364 /* Call the API Properly */
366 &DllCharacteristics,
367 &DllName,
368 (PVOID*)&hInst);
369 }
371 {
373 } _SEH2_END;
374
375
376done:
377 /* Free SearchPath buffer */
378 RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
379
380 /* Free DllName string if it was dynamically allocated */
381 if (FreeString) RtlFreeUnicodeString(&DllName);
382
383 /* Set last error in failure case */
384 if (!NT_SUCCESS(Status))
385 {
386 DPRINT1("LoadLibraryExW(%ls) failing with status %lx\n", lpLibFileName, Status);
388 return NULL;
389 }
390
391 /* Return loaded module handle */
392 return hInst;
393}
394
395
396/*
397 * @implemented
398 */
400WINAPI
402{
403 ANSI_STRING ProcedureName, *ProcNamePtr = NULL;
404 FARPROC fnExp = NULL;
406 PVOID hMapped;
407 ULONG Ordinal = 0;
408
409 if ((ULONG_PTR)lpProcName > MAXUSHORT)
410 {
411 /* Look up by name */
412 RtlInitAnsiString(&ProcedureName, (LPSTR)lpProcName);
413 ProcNamePtr = &ProcedureName;
414 }
415 else
416 {
417 /* Look up by ordinal */
418 Ordinal = PtrToUlong(lpProcName);
419 }
420
421 /* Map provided handle */
423
424 /* Get the proc address */
426 ProcNamePtr,
427 Ordinal,
428 (PVOID*)&fnExp);
429
430 if (!NT_SUCCESS(Status))
431 {
433 return NULL;
434 }
435
436 /* Check for a special case when returned pointer is
437 the same as image's base address */
438 if (fnExp == hMapped)
439 {
440 /* Set correct error code */
441 if (HIWORD(lpProcName) != 0)
443 else
445
446 return NULL;
447 }
448
449 /* All good, return procedure pointer */
450 return fnExp;
451}
452
453
454/*
455 * @implemented
456 */
457BOOL
458WINAPI
461{
463 PIMAGE_NT_HEADERS NtHeaders;
464
466 {
467 /* This is a LOAD_LIBRARY_AS_DATAFILE module, check if it's a valid one */
468 NtHeaders = RtlImageNtHeader((PVOID)((ULONG_PTR)hLibModule & ~1));
469
470 if (NtHeaders)
471 {
472 /* Unmap view */
474
475 /* Unload alternate resource module */
477 }
478 else
480 }
481 else
482 {
483 /* Just unload it */
485 }
486
487 /* Check what kind of status we got */
488 if (!NT_SUCCESS(Status))
489 {
490 /* Set last error */
492
493 /* Return failure */
494 return FALSE;
495 }
496
497 /* Return success */
498 return TRUE;
499}
500
501
502/*
503 * @implemented
504 */
505VOID
506WINAPI
508 DWORD dwExitCode)
509{
510
512 {
513 /* This is a LOAD_LIBRARY_AS_DATAFILE module */
515 {
516 /* Unmap view */
518
519 /* Unload alternate resource module */
521 }
522 }
523 else
524 {
525 /* Just unload it */
527 }
528
529 /* Exit thread */
530 ExitThread(dwExitCode);
531}
532
533
534/*
535 * @implemented
536 */
537DWORD
538WINAPI
540 LPSTR lpFilename,
541 DWORD nSize)
542{
543 UNICODE_STRING FilenameW;
544 ANSI_STRING FilenameA;
546 DWORD Length = 0, LengthToCopy;
547
548 /* Allocate a unicode buffer */
549 FilenameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, nSize * sizeof(WCHAR));
550 if (!FilenameW.Buffer)
551 {
553 return 0;
554 }
555
556 /* Call unicode API */
557 FilenameW.Length = (USHORT)GetModuleFileNameW(hModule, FilenameW.Buffer, nSize) * sizeof(WCHAR);
558 FilenameW.MaximumLength = FilenameW.Length + sizeof(WCHAR);
559
560 if (FilenameW.Length)
561 {
562 /* Convert to ansi string */
563 Status = BasepUnicodeStringTo8BitString(&FilenameA, &FilenameW, TRUE);
564 if (!NT_SUCCESS(Status))
565 {
566 /* Set last error, free string and return failure */
568 RtlFreeUnicodeString(&FilenameW);
569 return 0;
570 }
571
572 /* Calculate size to copy */
573 Length = min(nSize, FilenameA.Length);
574
575 /* Include terminating zero */
576 if (nSize > Length)
577 LengthToCopy = Length + 1;
578 else
579 LengthToCopy = nSize;
580
581 /* Now copy back to the caller amount he asked */
582 RtlMoveMemory(lpFilename, FilenameA.Buffer, LengthToCopy);
583
584 /* Free ansi filename */
585 RtlFreeAnsiString(&FilenameA);
586 }
587
588 /* Free unicode filename */
589 RtlFreeHeap(RtlGetProcessHeap(), 0, FilenameW.Buffer);
590
591 /* Return length copied */
592 return Length;
593}
594
595/*
596 * @implemented
597 */
598DWORD
599WINAPI
601 LPWSTR lpFilename,
602 DWORD nSize)
603{
606 ULONG Length = 0;
608 PPEB Peb;
609
611
612 /* Upscale nSize from chars to bytes */
613 nSize *= sizeof(WCHAR);
614
616 {
617 /* We don't use per-thread cur dir now */
618 //PRTL_PERTHREAD_CURDIR PerThreadCurdir = (PRTL_PERTHREAD_CURDIR)teb->NtTib.SubSystemTib;
619
620 Peb = NtCurrentPeb ();
621
622 /* Acquire a loader lock */
624
625 /* Traverse the module list */
628 while (Entry != ModuleListHead)
629 {
630 Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
631
632 /* Check if this is the requested module */
633 if (Module->DllBase == (PVOID)hModule)
634 {
635 /* Calculate size to copy */
637
638 /* Copy contents */
639 RtlMoveMemory(lpFilename, Module->FullDllName.Buffer, Length);
640
641 /* Subtract a terminating zero */
642 if (Length == Module->FullDllName.MaximumLength)
643 Length -= sizeof(WCHAR);
644
645 /* Break out of the loop */
646 break;
647 }
648
649 /* Advance to the next entry */
650 Entry = Entry->Flink;
651 }
652 }
654 {
656 Length = 0;
657 } _SEH2_END
658
659 /* Release the loader lock */
661
662 return Length / sizeof(WCHAR);
663}
664
666WINAPI
668{
670 PVOID Module;
672
673 /* Try to get a handle with a magic value of 1 for DllPath */
675
676 /* If that succeeded - we're done */
677 if (NT_SUCCESS(Status)) return Module;
678
679 /* If not, then the path should be computed */
681 if (!DllPath)
682 {
684 }
685 else
686 {
688 {
690 }
692 {
693 /* Fail with the SEH error */
695 }
696 _SEH2_END;
697 }
698
699 /* Free the DllPath */
700 RtlFreeHeap(RtlGetProcessHeap(), 0, DllPath);
701
702 /* In case of error set last win32 error and return NULL */
703 if (!NT_SUCCESS(Status))
704 {
705 DPRINT("Failure acquiring DLL module '%wZ' handle, Status 0x%08X\n", ModuleName, Status);
707 Module = 0;
708 }
709
710 /* Return module */
711 return (HMODULE)Module;
712}
713
715WINAPI
716BasepGetModuleHandleExW(BOOLEAN NoLock, DWORD dwPublicFlags, LPCWSTR lpwModuleName, HMODULE *phModule)
717{
719 NTSTATUS Status = STATUS_SUCCESS, Status2;
721 UNICODE_STRING ModuleNameU;
722 DWORD dwValid;
723 BOOLEAN Redirected = FALSE; // FIXME
724
725 /* Validate parameters */
726 dwValid = BasepGetModuleHandleExParameterValidation(dwPublicFlags, lpwModuleName, phModule);
728
729 /* Acquire lock if necessary */
730 if (!NoLock)
731 {
733 if (!NT_SUCCESS(Status))
734 {
735 /* Fail */
737 if (phModule) *phModule = NULL;
738 return NT_SUCCESS(Status);
739 }
740 }
741
742 if (!(dwPublicFlags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
743 {
744 /* Create a unicode string out of module name */
745 RtlInitUnicodeString(&ModuleNameU, lpwModuleName);
746
747 // FIXME: Do some redirected DLL stuff?
748 if (Redirected)
749 {
751 }
752
753 if (!hModule)
754 {
756 if (!hModule)
757 {
758 /* Last error is already set, so just return failure by setting status */
760 goto quickie;
761 }
762 }
763 }
764 else
765 {
766 /* Perform Pc to file header to get module instance */
767 hModule = (HMODULE)RtlPcToFileHeader((PVOID)lpwModuleName,
768 (PVOID*)&hModule);
769
770 /* Check if it succeeded */
771 if (!hModule)
772 {
773 /* Set "dll not found" status and quit */
775 goto quickie;
776 }
777 }
778
779 /* Check if changing reference is not forbidden */
780 if (!(dwPublicFlags & GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT))
781 {
782 /* Add reference to this DLL */
783 Status = LdrAddRefDll((dwPublicFlags & GET_MODULE_HANDLE_EX_FLAG_PIN) ? LDR_ADDREF_DLL_PIN : 0,
784 hModule);
785 }
786
787quickie:
788 /* Set last error in case of failure */
789 if (!NT_SUCCESS(Status))
791
792 /* Unlock loader lock if it was acquired */
793 if (!NoLock)
794 {
795 Status2 = LdrUnlockLoaderLock(0, Cookie);
796 ASSERT(NT_SUCCESS(Status2));
797 }
798
799 /* Set the module handle to the caller */
800 if (phModule) *phModule = hModule;
801
802 /* Return TRUE on success and FALSE otherwise */
803 return NT_SUCCESS(Status);
804}
805
806/*
807 * @implemented
808 */
810WINAPI
813{
814 PUNICODE_STRING ModuleNameW;
815 PTEB pTeb = NtCurrentTeb();
816
817 /* Check if we have no name to convert */
818 if (!lpModuleName)
820
821 /* Convert module name to unicode */
822 ModuleNameW = Basep8BitStringToStaticUnicodeString(lpModuleName);
823
824 /* Call W version if conversion was successful */
825 if (ModuleNameW)
826 return GetModuleHandleW(ModuleNameW->Buffer);
827
828 /* Return failure */
829 return 0;
830}
831
832
833/*
834 * @implemented
835 */
837WINAPI
839{
842
843 /* If current module is requested - return it right away */
844 if (!lpModuleName)
845 return ((HMODULE)NtCurrentPeb()->ImageBaseAddress);
846
847 /* Use common helper routine */
849 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
850 lpModuleName,
851 &hModule);
852
853 /* If it wasn't successful - return NULL */
854 if (!Success) hModule = NULL;
855
856 /* Return the handle */
857 return hModule;
858}
859
860
861/*
862 * @implemented
863 */
864BOOL
865WINAPI
867 IN LPCWSTR lpwModuleName OPTIONAL,
868 OUT HMODULE* phModule)
869{
870 DWORD dwValid;
871 BOOL Ret;
872
873 /* Validate parameters */
874 dwValid = BasepGetModuleHandleExParameterValidation(dwFlags, lpwModuleName, phModule);
875
876 /* If result is invalid parameter - return failure */
878
879 /* If result is 2, there is no need to do anything - return success. */
881
882 /* Use common helper routine */
884 dwFlags,
885 lpwModuleName,
886 phModule);
887
888 return Ret;
889}
890
891/*
892 * @implemented
893 */
894BOOL
895WINAPI
897 IN LPCSTR lpModuleName OPTIONAL,
898 OUT HMODULE* phModule)
899{
900 PUNICODE_STRING lpModuleNameW;
901 DWORD dwValid;
902 BOOL Ret;
903
904 /* Validate parameters */
905 dwValid = BasepGetModuleHandleExParameterValidation(dwFlags, (LPCWSTR)lpModuleName, phModule);
906
907 /* If result is invalid parameter - return failure */
909
910 /* If result is 2, there is no need to do anything - return success. */
912
913 /* Check if we don't need to convert the name */
914 if (dwFlags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS)
915 {
916 /* Call the extended version of the API without conversion */
918 dwFlags,
919 (LPCWSTR)lpModuleName,
920 phModule);
921 }
922 else
923 {
924 /* Convert module name to unicode */
925 lpModuleNameW = Basep8BitStringToStaticUnicodeString(lpModuleName);
926
927 /* Return FALSE if conversion failed */
928 if (!lpModuleNameW) return FALSE;
929
930 /* Call the extended version of the API */
932 dwFlags,
933 lpModuleNameW->Buffer,
934 phModule);
935 }
936
937 /* Return result */
938 return Ret;
939}
940
941
942/*
943 * @implemented
944 */
945DWORD
946WINAPI
947LoadModule(LPCSTR lpModuleName,
948 LPVOID lpParameterBlock)
949{
950 STARTUPINFOA StartupInfo;
951 PROCESS_INFORMATION ProcessInformation;
952 LOADPARMS32 *LoadParams;
953 char FileName[MAX_PATH];
954 LPSTR CommandLine;
956 BOOL ProcessStatus;
957 ANSI_STRING AnsiStr;
958 UNICODE_STRING UnicStr;
961
962 LoadParams = (LOADPARMS32*)lpParameterBlock;
963
964 /* Check load parameters */
965 if (LoadParams->dwReserved || LoadParams->wMagicValue != 2)
966 {
967 /* Fail with invalid param error */
969 return 0;
970 }
971
972 /* Search path */
973 Length = SearchPathA(NULL, lpModuleName, ".exe", MAX_PATH, FileName, NULL);
974
975 /* Check if path was found */
976 if (Length && Length < MAX_PATH)
977 {
978 /* Build StartupInfo */
979 RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
980
981 StartupInfo.cb = sizeof(STARTUPINFOA);
982 StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
983 StartupInfo.wShowWindow = LoadParams->wCmdShow;
984
985 /* Allocate command line buffer */
986 CommandLine = RtlAllocateHeap(RtlGetProcessHeap(),
988 (ULONG)LoadParams->lpCmdLine[0] + Length + 2);
989
990 /* Put module name there, then a space, and then copy provided command line,
991 and null-terminate it */
992 RtlCopyMemory(CommandLine, FileName, Length);
993 CommandLine[Length] = ' ';
994 RtlCopyMemory(&CommandLine[Length + 1], &LoadParams->lpCmdLine[1], (ULONG)LoadParams->lpCmdLine[0]);
995 CommandLine[Length + 1 + (ULONG)LoadParams->lpCmdLine[0]] = 0;
996
997 /* Create the process */
998 ProcessStatus = CreateProcessA(FileName,
999 CommandLine,
1000 NULL,
1001 NULL,
1002 FALSE,
1003 0,
1004 LoadParams->lpEnvAddress,
1005 NULL,
1006 &StartupInfo,
1007 &ProcessInformation);
1008
1009 /* Free the command line buffer */
1010 RtlFreeHeap(RtlGetProcessHeap(), 0, CommandLine);
1011
1012 if (!ProcessStatus)
1013 {
1014 /* Creating process failed, return right error code */
1015 Error = GetLastError();
1016 switch(Error)
1017 {
1019 return ERROR_BAD_FORMAT;
1020
1023 return Error;
1024 }
1025
1026 /* Return 0 otherwise */
1027 return 0;
1028 }
1029
1030 /* Wait up to 30 seconds for the process to become idle */
1032 {
1033 UserWaitForInputIdleRoutine(ProcessInformation.hProcess, 30000);
1034 }
1035
1036 /* Close handles */
1037 NtClose(ProcessInformation.hThread);
1038 NtClose(ProcessInformation.hProcess);
1039
1040 /* Return magic success value (33) */
1041 return 33;
1042 }
1043
1044 /* The path was not found, create an ansi string from
1045 the module name and convert it to unicode */
1046 RtlInitAnsiString(&AnsiStr, lpModuleName);
1047 if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&UnicStr,&AnsiStr,TRUE)))
1048 return ERROR_FILE_NOT_FOUND;
1049
1050 /* Determine path type */
1052
1053 /* Free the unicode module name */
1054 RtlFreeUnicodeString(&UnicStr);
1055
1056 /* If it's a relative path, return file not found */
1058 return ERROR_FILE_NOT_FOUND;
1059
1060 /* If not, try to open it */
1061 Handle = CreateFile(lpModuleName,
1064 NULL,
1067 NULL);
1068
1070 {
1071 /* Opening file succeeded for some reason, close the handle and return file not found anyway */
1073 return ERROR_FILE_NOT_FOUND;
1074 }
1075
1076 /* Return last error which CreateFile set during an attempt to open it */
1077 return GetLastError();
1078}
1079
1080/*
1081 * @unimplemented
1082 */
1084{
1085 STUB;
1086 return NULL;
1087}
1088
1089/*
1090 * @unimplemented
1091 */
1093 LPSTR lpszInitName, LPSTR lpszProcName,
1094 FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack,
1095 LPVOID lpBuff )
1096{
1097 STUB;
1098 return 0;
1099}
1100
1101/*
1102 * @unimplemented
1103 */
1105{
1106 STUB;
1107}
1108
1109/*
1110 * @unimplemented
1111 */
1112BOOL
1113WINAPI
1116 IN PVOID Unknown2,
1119{
1120 DPRINT1("BaseQueryModuleData called: %s %s %p %p %p\n",
1121 ModuleName,
1122 Unknown,
1123 Unknown2,
1124 Unknown3,
1125 Unknown4);
1126 return FALSE;
1127}
1128
1129/*
1130 * @implemented
1131 */
1133WINAPI
1135{
1136 DPRINT("Post-init called\n");
1137
1138 /* Check if this is a terminal server */
1139 if (SharedUserData->SuiteMask & VER_SUITE_TERMINAL)
1140 {
1141 /* Initialize TS pointers */
1143 }
1144
1145 /* FIXME: Initialize TS pointers */
1146 return STATUS_SUCCESS;
1147}
1148
1149/* EOF */
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
Definition: section.c:3848
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
Definition: section.c:3622
#define NtCurrentPeb()
Definition: FLS.c:22
unsigned char BOOLEAN
static IN ULONG IN PWSTR OUT PCWSTR OUT PBOOLEAN OUT PATH_TYPE_AND_UNKNOWN * PathType
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
PRTL_UNICODE_STRING_BUFFER Path
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:243
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
BOOL Error
Definition: chkdsk.c:66
#define UNIMPLEMENTED
Definition: debug.h:115
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:37
#define Len
Definition: deflate.h:82
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
Definition: libsupp.c:656
HMODULE hModule
Definition: animate.c:44
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
int(* FARPROC)()
Definition: compat.h:36
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#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 CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define LoadLibraryW(x)
Definition: compat.h:747
#define FILE_SHARE_READ
Definition: compat.h:136
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PPEB Peb
Definition: dllmain.c:27
BOOL WINAPI BaseQueryModuleData(IN LPSTR ModuleName, IN LPSTR Unknown, IN PVOID Unknown2, IN PVOID Unknown3, IN PVOID Unknown4)
Definition: loader.c:1114
static NTSTATUS BasepLoadLibraryAsDatafile(PWSTR Path, LPCWSTR Name, HMODULE *hModule)
Definition: loader.c:188
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
BOOL WINAPI UTRegister(HMODULE hModule, LPSTR lpsz16BITDLL, LPSTR lpszInitName, LPSTR lpszProcName, FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack, LPVOID lpBuff)
Definition: loader.c:1092
DWORD WINAPI BasepGetModuleHandleExParameterValidation(DWORD dwFlags, LPCWSTR lpwModuleName, HMODULE *phModule)
Definition: loader.c:26
HMODULE WINAPI GetModuleHandleForUnicodeString(PUNICODE_STRING ModuleName)
Definition: loader.c:667
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
PVOID WINAPI BasepMapModuleHandle(HMODULE hModule, BOOLEAN AsDataFile)
Definition: loader.c:67
NTSTATUS WINAPI BaseProcessInitPostImport(VOID)
Definition: loader.c:1134
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
VOID WINAPI UTUnRegister(HMODULE hModule)
Definition: loader.c:1104
NTSTATUS WINAPI BasepInitializeTermsrvFpns(VOID)
Definition: loader.c:18
DWORD WINAPI LoadModule(LPCSTR lpModuleName, LPVOID lpParameterBlock)
Definition: loader.c:947
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
BOOLEAN WINAPI BasepGetModuleHandleExW(BOOLEAN NoLock, DWORD dwPublicFlags, LPCWSTR lpwModuleName, HMODULE *phModule)
Definition: loader.c:716
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
Definition: loader.c:507
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
Definition: path.c:1123
LPWSTR WINAPI BaseComputeProcessDllPath(IN LPWSTR FullPath, IN PVOID Environment)
Definition: path.c:420
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
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
WaitForInputIdleType UserWaitForInputIdleRoutine
Definition: proc.c:20
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4741
PLDR_DATA_TABLE_ENTRY BasepExeLdrEntry
Definition: proc.c:25
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:365
PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString
Definition: utils.c:27
VOID NTAPI BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry, IN PVOID Context, OUT BOOLEAN *StopEnumeration)
Definition: utils.c:156
PUNICODE_STRING WINAPI Basep8BitStringToStaticUnicodeString(IN LPCSTR String)
Definition: utils.c:188
#define PtrToUlong(u)
Definition: config.h:107
HINSTANCE hInst
Definition: dxdiag.c:13
@ Success
Definition: eventcreate.c:712
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
@ Unknown
Definition: i8042prt.h:114
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NtCurrentTeb
LIST_ENTRY * ModuleListHead
Definition: kdpacket.c:23
#define STUB
Definition: kernel32.h:27
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS
Definition: kernel32.h:108
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR
Definition: kernel32.h:107
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE
Definition: kernel32.h:109
NTSTATUS NTAPI LdrGetDllHandle(_In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *DllHandle)
Definition: ldrapi.c:810
NTSTATUS NTAPI LdrUnloadDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1331
NTSTATUS NTAPI LdrDisableThreadCalloutsForDll(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1194
NTSTATUS NTAPI LdrUnlockLoaderLock(_In_ ULONG Flags, _In_opt_ ULONG_PTR Cookie)
Definition: ldrapi.c:101
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:526
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 LdrLockLoaderLock(_In_ ULONG Flags, _Out_opt_ PULONG Disposition, _Out_opt_ PULONG_PTR Cookie)
Definition: ldrapi.c:174
NTSTATUS NTAPI LdrAddRefDll(_In_ ULONG Flags, _In_ PVOID BaseAddress)
Definition: ldrapi.c:1245
BOOLEAN NTAPI LdrUnloadAlternateResourceModule(_In_ PVOID BaseAddress)
Definition: ldrapi.c:1641
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:829
NTSTATUS NTAPI LdrEnumerateLoadedModules(_Reserved_ ULONG ReservedFlag, _In_ PLDR_ENUM_CALLBACK EnumProc, _In_opt_ PVOID Context)
Definition: ldrapi.c:1130
#define LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS
Definition: ldrtypes.h:76
#define LDR_ADDREF_DLL_PIN
Definition: ldrtypes.h:71
#define LDR_IS_DATAFILE(handle)
Definition: ldrtypes.h:103
#define LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS
Definition: ldrtypes.h:82
#define ASSERT(a)
Definition: mode.c:44
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const char const char * DllPath
Definition: image.c:34
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:408
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
@ RtlPathTypeRelative
Definition: rtltypes.h:476
enum _RTL_PATH_TYPE RTL_PATH_TYPE
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
@ ViewShare
Definition: nt_native.h:1278
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define UNICODE_NULL
#define VER_SUITE_TERMINAL
#define ANSI_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_INVALID_IMAGE_FORMAT
Definition: ntstatus.h:359
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:545
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
#define STATUS_ORDINAL_NOT_FOUND
Definition: ntstatus.h:548
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_ENTRYPOINT_NOT_FOUND
Definition: ntstatus.h:549
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:475
#define L(x)
Definition: ntvdm.h:50
#define IMAGE_FILE_EXECUTABLE_IMAGE
Definition: pedump.c:160
unsigned short USHORT
Definition: pedump.c:61
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:162
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
_Check_return_ _CRTIMP int __cdecl _strcmpi(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
#define SharedUserData
HINSTANCE hLibModule
Definition: sfc.c:23
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
char * pszDllName
Definition: spec2def.c:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
base of all file and directory entries
Definition: entries.h:83
Definition: btrfs_drv.h:1876
UNICODE_STRING FullDllName
Definition: btrfs_drv.h:1882
PVOID DllBase
Definition: btrfs_drv.h:1880
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY InLoadOrderModuleList
Definition: ldrtypes.h:120
PPEB_LDR_DATA Ldr
Definition: btrfs_drv.h:1912
PVOID ImageBaseAddress
Definition: ntddk_ex.h:245
DWORD dwFlags
Definition: winbase.h:842
DWORD cb
Definition: winbase.h:831
WORD wShowWindow
Definition: winbase.h:843
Definition: compat.h:836
PPEB ProcessEnvironmentBlock
Definition: ntddk_ex.h:337
USHORT MaximumLength
Definition: env_spec_w32.h:370
LPSTR lpEnvAddress
Definition: kernel32.h:73
DWORD dwReserved
Definition: kernel32.h:77
WORD wCmdShow
Definition: kernel32.h:76
LPSTR lpCmdLine
Definition: kernel32.h:74
WORD wMagicValue
Definition: kernel32.h:75
uint16_t * PWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define MAXUSHORT
Definition: typedefs.h:83
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
HANDLE HMODULE
Definition: typedefs.h:77
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
struct _STARTUPINFOA STARTUPINFOA
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define STARTF_USESHOWWINDOW
Definition: winbase.h:491
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:344
#define SearchPath
Definition: winbase.h:3900
#define DONT_RESOLVE_DLL_REFERENCES
Definition: winbase.h:341
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2084
#define CreateFile
Definition: winbase.h:3749
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define ERROR_BAD_EXE_FORMAT
Definition: winerror.h:251
#define ERROR_BAD_FORMAT
Definition: winerror.h:114
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie
Definition: cmfuncs.h:14
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
char CHAR
Definition: xmlstorage.h:175