ReactOS  0.4.15-dev-1392-g3014417
libsupp.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS NT User-Mode DLL
4  * FILE: lib/ntdll/rtl/libsup.c
5  * PURPOSE: RTL Support Routines
6  * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7  * Gunnar Dalsnes
8  */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include <ntdll.h>
13 
14 #define NDEBUG
15 #include <debug.h>
16 
20 
21 /* FUNCTIONS ***************************************************************/
22 
23 BOOLEAN
24 NTAPI
26 {
27  /* Return the flag in the PEB */
28  return NtCurrentPeb()->BeingDebugged;
29 }
30 
31 BOOLEAN
32 NTAPI
34 {
35  /* Check if it's already set and return TRUE if so */
36  if (NtCurrentTeb()->InDbgPrint) return TRUE;
37 
38  /* Set it and return */
39  NtCurrentTeb()->InDbgPrint = TRUE;
40  return FALSE;
41 }
42 
43 VOID
44 NTAPI
46 {
47  /* Clear the flag */
48  NtCurrentTeb()->InDbgPrint = FALSE;
49 }
50 
52 NTAPI
54 {
55  return UserMode;
56 }
57 
58 /*
59  * @implemented
60  */
61 PPEB
62 NTAPI
64 {
65  return NtCurrentPeb();
66 }
67 
68 /*
69  * @implemented
70  */
71 VOID NTAPI
73 {
74  PPEB Peb = NtCurrentPeb ();
76 }
77 
78 /*
79  * @implemented
80  */
81 VOID NTAPI
83 {
84  PPEB Peb = NtCurrentPeb ();
86 }
87 
88 /*
89 * @implemented
90 */
91 ULONG
92 NTAPI
94 {
95  PPEB pPeb = NtCurrentPeb();
96  return pPeb->NtGlobalFlag;
97 }
98 
100 NTAPI
102 {
103  return RtlDeleteCriticalSection(&Lock->CriticalSection);
104 }
105 
106 NTSTATUS
107 NTAPI
109 {
111 
112  return RtlEnterCriticalSection(&Lock->CriticalSection);
113 }
114 
115 BOOLEAN
116 NTAPI
118 {
120 
121  return RtlTryEnterCriticalSection(&Lock->CriticalSection);
122 }
123 
124 NTSTATUS
125 NTAPI
127 {
128  return RtlInitializeCriticalSection(&(*Lock)->CriticalSection);
129 }
130 
131 NTSTATUS
132 NTAPI
134 {
135  return RtlLeaveCriticalSection(&Lock->CriticalSection);
136 }
137 
138 PVOID
139 NTAPI
141  ULONG Tag)
142 {
144 
145  return RtlAllocateHeap(RtlGetProcessHeap(),
146  0,
147  Bytes);
148 }
149 
150 
151 VOID
152 NTAPI
154  ULONG Tag)
155 {
157 
158  RtlFreeHeap(RtlGetProcessHeap(),
159  0,
160  Mem);
161 }
162 
163 
164 #if DBG
166 CHECK_PAGED_CODE_RTL(char *file, int line)
167 {
168  /* meaningless in user mode */
169 }
170 #endif
171 
172 VOID
173 NTAPI
175 {
176  PPEB Peb;
177 
178  /* Get PEB */
179  Peb = RtlGetCurrentPeb();
180 
181  /* Apply defaults for non-set parameters */
182  if (!Parameters->SegmentCommit) Parameters->SegmentCommit = Peb->HeapSegmentCommit;
183  if (!Parameters->SegmentReserve) Parameters->SegmentReserve = Peb->HeapSegmentReserve;
184  if (!Parameters->DeCommitFreeBlockThreshold) Parameters->DeCommitFreeBlockThreshold = Peb->HeapDeCommitFreeBlockThreshold;
185  if (!Parameters->DeCommitTotalFreeThreshold) Parameters->DeCommitTotalFreeThreshold = Peb->HeapDeCommitTotalFreeThreshold;
186 }
187 
188 BOOLEAN
189 NTAPI
191  IN ULONG_PTR RegistrationFrameEnd,
192  IN OUT PULONG_PTR StackLow,
193  IN OUT PULONG_PTR StackHigh)
194 {
195  /* There's no such thing as a DPC stack in user-mode */
196  return FALSE;
197 }
198 
199 VOID
200 NTAPI
203  IN PVOID ContextData,
204  IN ULONG Size)
205 {
206  /* Exception logging is not done in user-mode */
207 }
208 
209 BOOLEAN
210 NTAPI
212  IN ULONG_PTR *StackBegin,
213  IN ULONG_PTR *StackEnd)
214 {
215  /* FIXME: Verify */
216  *StackBegin = (ULONG_PTR)NtCurrentTeb()->NtTib.StackLimit;
217  *StackEnd = (ULONG_PTR)NtCurrentTeb()->NtTib.StackBase;
218  return TRUE;
219 }
220 
221 #ifndef _M_AMD64
222 /*
223  * @implemented
224  */
225 ULONG
226 NTAPI
228  IN ULONG Count,
229  IN ULONG Flags)
230 {
231  ULONG_PTR Stack, NewStack, StackBegin, StackEnd = 0;
232  ULONG Eip;
233  BOOLEAN Result, StopSearch = FALSE;
234  ULONG i = 0;
235 
236  /* Get current EBP */
237 #if defined(_M_IX86)
238 #if defined __GNUC__
239  __asm__("mov %%ebp, %0" : "=r" (Stack) : );
240 #elif defined(_MSC_VER)
241  __asm mov Stack, ebp
242 #endif
243 #elif defined(_M_MIPS)
244  __asm__("move $sp, %0" : "=r" (Stack) : );
245 #elif defined(_M_PPC)
246  __asm__("mr %0,1" : "=r" (Stack) : );
247 #elif defined(_M_ARM)
248 #if defined __GNUC__
249  __asm__("mov sp, %0" : "=r"(Stack) : );
250 #elif defined(_MSC_VER)
251  // FIXME: Hack. Probably won't work if this ever actually manages to run someday.
252  Stack = (ULONG_PTR)&Stack;
253 #endif
254 #else
255 #error Unknown architecture
256 #endif
257 
258  /* Set it as the stack begin limit as well */
259  StackBegin = (ULONG_PTR)Stack;
260 
261  /* Check if we're called for non-logging mode */
262  if (!Flags)
263  {
264  /* Get the actual safe limits */
266  &StackBegin,
267  &StackEnd);
268  if (!Result) return 0;
269  }
270 
271  /* Use a SEH block for maximum protection */
272  _SEH2_TRY
273  {
274  /* Loop the frames */
275  for (i = 0; i < Count; i++)
276  {
277  /*
278  * Leave if we're past the stack,
279  * if we're before the stack,
280  * or if we've reached ourselves.
281  */
282  if ((Stack >= StackEnd) ||
283  (!i ? (Stack < StackBegin) : (Stack <= StackBegin)) ||
284  ((StackEnd - Stack) < (2 * sizeof(ULONG_PTR))))
285  {
286  /* We're done or hit a bad address */
287  break;
288  }
289 
290  /* Get new stack and EIP */
291  NewStack = *(PULONG_PTR)Stack;
292  Eip = *(PULONG_PTR)(Stack + sizeof(ULONG_PTR));
293 
294  /* Check if the new pointer is above the oldone and past the end */
295  if (!((Stack < NewStack) && (NewStack < StackEnd)))
296  {
297  /* Stop searching after this entry */
298  StopSearch = TRUE;
299  }
300 
301  /* Also make sure that the EIP isn't a stack address */
302  if ((StackBegin < Eip) && (Eip < StackEnd)) break;
303 
304  /* FIXME: Check that EIP is inside a loaded module */
305 
306  /* Save this frame */
307  Callers[i] = (PVOID)Eip;
308 
309  /* Check if we should continue */
310  if (StopSearch)
311  {
312  /* Return the next index */
313  i++;
314  break;
315  }
316 
317  /* Move to the next stack */
318  Stack = NewStack;
319  }
320  }
322  {
323  /* No index */
324  i = 0;
325  }
326  _SEH2_END;
327 
328  /* Return frames parsed */
329  return i;
330 }
331 #endif
332 
333 #ifdef _AMD64_
334 VOID
335 NTAPI
337  OUT PULONG_PTR LowLimit,
339 {
340  *LowLimit = (ULONG_PTR)NtCurrentTeb()->NtTib.StackLimit;
341  *HighLimit = (ULONG_PTR)NtCurrentTeb()->NtTib.StackBase;
342  return;
343 }
344 #endif
345 
346 BOOLEAN
347 NTAPI
349 {
351 }
352 
353 /* RTL Atom Tables ************************************************************/
354 
355 typedef struct _RTL_ATOM_HANDLE
356 {
360 
361 NTSTATUS
363 {
364  RtlInitializeCriticalSection(&AtomTable->CriticalSection);
365  return STATUS_SUCCESS;
366 }
367 
368 
369 VOID
371 {
372  RtlDeleteCriticalSection(&AtomTable->CriticalSection);
373 }
374 
375 
376 BOOLEAN
378 {
379  RtlEnterCriticalSection(&AtomTable->CriticalSection);
380  return TRUE;
381 }
382 
383 
384 VOID
386 {
387  RtlLeaveCriticalSection(&AtomTable->CriticalSection);
388 }
389 
390 
391 /* handle functions */
392 
393 BOOLEAN
395 {
397  sizeof(RTL_ATOM_HANDLE),
398  &AtomTable->RtlHandleTable);
399 
400  return TRUE;
401 }
402 
403 VOID
405 {
406  RtlDestroyHandleTable(&AtomTable->RtlHandleTable);
407 }
408 
411 {
412  return (PRTL_ATOM_TABLE)RtlAllocateHeap(RtlGetProcessHeap(),
414  Size);
415 }
416 
417 VOID
419 {
420  RtlFreeHeap(RtlGetProcessHeap(),
421  0,
422  AtomTable);
423 }
424 
427 {
428  return (PRTL_ATOM_TABLE_ENTRY)RtlAllocateHeap(RtlGetProcessHeap(),
430  Size);
431 }
432 
433 VOID
435 {
436  RtlFreeHeap(RtlGetProcessHeap(),
437  0,
438  Entry);
439 }
440 
441 VOID
443 {
444  PRTL_HANDLE_TABLE_ENTRY RtlHandleEntry;
445 
446  if (RtlIsValidIndexHandle(&AtomTable->RtlHandleTable,
447  (ULONG)Entry->HandleIndex,
448  &RtlHandleEntry))
449  {
450  RtlFreeHandle(&AtomTable->RtlHandleTable,
451  RtlHandleEntry);
452  }
453 }
454 
455 BOOLEAN
457 {
458  ULONG HandleIndex;
459  PRTL_HANDLE_TABLE_ENTRY RtlHandle;
460 
461  RtlHandle = RtlAllocateHandle(&AtomTable->RtlHandleTable,
462  &HandleIndex);
463  if (RtlHandle != NULL)
464  {
465  PRTL_ATOM_HANDLE AtomHandle = (PRTL_ATOM_HANDLE)RtlHandle;
466 
467  /* FIXME - Handle Indexes >= 0xC000 ?! */
468  if (HandleIndex < 0xC000)
469  {
470  Entry->HandleIndex = (USHORT)HandleIndex;
471  Entry->Atom = 0xC000 + (USHORT)HandleIndex;
472 
473  AtomHandle->AtomEntry = Entry;
474  AtomHandle->Handle.Flags = RTL_HANDLE_VALID;
475 
476  return TRUE;
477  }
478  else
479  {
480  /* set the valid flag, otherwise RtlFreeHandle will fail! */
481  AtomHandle->Handle.Flags = RTL_HANDLE_VALID;
482 
483  RtlFreeHandle(&AtomTable->RtlHandleTable,
484  RtlHandle);
485  }
486  }
487 
488  return FALSE;
489 }
490 
493 {
494  PRTL_HANDLE_TABLE_ENTRY RtlHandle;
495 
496  if (RtlIsValidIndexHandle(&AtomTable->RtlHandleTable,
497  Index,
498  &RtlHandle))
499  {
500  PRTL_ATOM_HANDLE AtomHandle = (PRTL_ATOM_HANDLE)RtlHandle;
501 
502  return AtomHandle->AtomEntry;
503  }
504 
505  return NULL;
506 }
507 
508 /* Ldr SEH-Protected access to IMAGE_NT_HEADERS */
509 
510 /* Rtl SEH-Free version of this */
511 NTSTATUS
512 NTAPI
514  _In_ ULONG Flags,
515  _In_ PVOID Base,
516  _In_ ULONG64 Size,
517  _Out_ PIMAGE_NT_HEADERS *OutHeaders);
518 
519 
520 /*
521  * @implemented
522  * @note: This is here, so that we do not drag SEH into rosload, freeldr and bootmgfw
523  */
524 NTSTATUS
525 NTAPI
527  _In_ ULONG Flags,
528  _In_ PVOID Base,
529  _In_ ULONG64 Size,
530  _Out_ PIMAGE_NT_HEADERS *OutHeaders)
531 {
533 
534  /* Assume failure. This is also done in RtlpImageNtHeaderEx, but this is guarded by SEH. */
535  if (OutHeaders != NULL)
536  *OutHeaders = NULL;
537 
538  _SEH2_TRY
539  {
540  Status = RtlpImageNtHeaderEx(Flags, Base, Size, OutHeaders);
541  }
543  {
544  /* Fail with the SEH error */
546  }
547  _SEH2_END;
548 
549  return Status;
550 }
551 
552 /*
553  * Ldr Resource support code
554  */
555 
557  LPCWSTR name, void *root,
558  int want_dir );
560  WORD id, void *root, int want_dir );
562  void *root, int want_dir );
564 
565 /**********************************************************************
566  * find_entry
567  *
568  * Find a resource entry
569  */
571  ULONG level, void **ret, int want_dir )
572 {
573  ULONG size;
574  void *root;
575  IMAGE_RESOURCE_DIRECTORY *resdirptr;
576  USHORT list[9]; /* list of languages to try */
577  int i, pos = 0;
578  LCID user_lcid, system_lcid;
579 
582  if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND;
583  resdirptr = root;
584 
585  if (!level--) goto done;
586  if (!(*ret = find_entry_by_name( resdirptr, (LPCWSTR)info->Type, root, want_dir || level )))
588  if (!level--) return STATUS_SUCCESS;
589 
590  resdirptr = *ret;
591  if (!(*ret = find_entry_by_name( resdirptr, (LPCWSTR)info->Name, root, want_dir || level )))
593  if (!level--) return STATUS_SUCCESS;
594  if (level) return STATUS_INVALID_PARAMETER; /* level > 3 */
595 
596  /* 1. specified language */
597  pos = push_language( list, pos, info->Language );
598 
599  /* 2. specified language with neutral sublanguage */
601 
602  /* 3. neutral language with neutral sublanguage */
604 
605  /* if no explicitly specified language, try some defaults */
606  if (PRIMARYLANGID(info->Language) == LANG_NEUTRAL)
607  {
608  /* user defaults, unless SYS_DEFAULT sublanguage specified */
609  if (SUBLANGID(info->Language) != SUBLANG_SYS_DEFAULT)
610  {
611  /* 4. current thread locale language */
612  pos = push_language( list, pos, LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale) );
613 
614  if (NT_SUCCESS(NtQueryDefaultLocale(TRUE, &user_lcid)))
615  {
616  /* 5. user locale language */
617  pos = push_language( list, pos, LANGIDFROMLCID(user_lcid) );
618 
619  /* 6. user locale language with neutral sublanguage */
621  }
622  }
623 
624  /* now system defaults */
625 
626  if (NT_SUCCESS(NtQueryDefaultLocale(FALSE, &system_lcid)))
627  {
628  /* 7. system locale language */
629  pos = push_language( list, pos, LANGIDFROMLCID( system_lcid ) );
630 
631  /* 8. system locale language with neutral sublanguage */
633  }
634 
635  /* 9. English */
637  }
638 
639  resdirptr = *ret;
640  for (i = 0; i < pos; i++)
641  if ((*ret = find_entry_by_id( resdirptr, list[i], root, want_dir ))) return STATUS_SUCCESS;
642 
643  /* if no explicitly specified language, return the first entry */
644  if (PRIMARYLANGID(info->Language) == LANG_NEUTRAL)
645  {
646  if ((*ret = find_first_entry( resdirptr, root, want_dir ))) return STATUS_SUCCESS;
647  }
649 
650 done:
651  *ret = resdirptr;
652  return STATUS_SUCCESS;
653 }
654 
655 /*
656  * @implemented
657  */
658 PVOID NTAPI
660  PVOID* BaseOfImage)
661 {
664  PLDR_DATA_TABLE_ENTRY Module;
665  PVOID ImageBase = NULL;
666 
667  RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
668  ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
670  while (Entry != ModuleListHead)
671  {
672  Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
673 
674  if ((ULONG_PTR)PcValue >= (ULONG_PTR)Module->DllBase &&
675  (ULONG_PTR)PcValue < (ULONG_PTR)Module->DllBase + Module->SizeOfImage)
676  {
677  ImageBase = Module->DllBase;
678  break;
679  }
680  Entry = Entry->Flink;
681  }
682  RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
683 
684  *BaseOfImage = ImageBase;
685  return ImageBase;
686 }
687 
688 NTSTATUS get_buffer(LPWSTR *buffer, SIZE_T needed, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
689 {
690  WCHAR *p;
691 
692  if (CallerBuffer && CallerBuffer->MaximumLength > needed)
693  {
694  p = CallerBuffer->Buffer;
695  CallerBuffer->Length = needed - sizeof(WCHAR);
696  }
697  else
698  {
699  if (!bAllocateBuffer)
701 
702  if (CallerBuffer)
703  CallerBuffer->Buffer[0] = 0;
704 
705  p = RtlAllocateHeap(RtlGetProcessHeap(), 0, needed );
706  if (!p)
707  return STATUS_NO_MEMORY;
708  }
709  *buffer = p;
710 
711  return STATUS_SUCCESS;
712 }
713 
714 /* NOTE: Remove this one once our actctx support becomes better */
716 {
717  static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\'};
718  static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0};
719 
720  ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info;
721  ACTCTX_SECTION_KEYED_DATA data;
723  SIZE_T needed, size = 1024;
724  WCHAR *p;
725 
726  data.cbSize = sizeof(data);
727  status = RtlFindActivationContextSectionString( FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
728  ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
729  pnameW, &data );
730  if (status != STATUS_SUCCESS)
731  {
732  //DPRINT1("RtlFindActivationContextSectionString returned 0x%x for %wZ\n", status, pnameW);
733  return status;
734  }
735 
736  for (;;)
737  {
738  if (!(info = RtlAllocateHeap( RtlGetProcessHeap(), 0, size )))
739  {
741  goto done;
742  }
743  status = RtlQueryInformationActivationContext( 0, data.hActCtx, &data.ulAssemblyRosterIndex,
744  AssemblyDetailedInformationInActivationContext,
745  info, size, &needed );
746  if (status == STATUS_SUCCESS) break;
747  if (status != STATUS_BUFFER_TOO_SMALL) goto done;
748  RtlFreeHeap( RtlGetProcessHeap(), 0, info );
749  size = needed;
750  }
751 
752  DPRINT("manifestpath === %S\n", info->lpAssemblyManifestPath);
753  DPRINT("DirectoryName === %S\n", info->lpAssemblyDirectoryName);
754  if (!info->lpAssemblyManifestPath /*|| !info->lpAssemblyDirectoryName*/)
755  {
757  goto done;
758  }
759 
760  if ((p = wcsrchr( info->lpAssemblyManifestPath, '\\' )))
761  {
762  DWORD dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
763 
764  p++;
765  if (!info->lpAssemblyDirectoryName || _wcsnicmp( p, info->lpAssemblyDirectoryName, dirlen ) || wcsicmp( p + dirlen, dotManifestW ))
766  {
767  /* manifest name does not match directory name, so it's not a global
768  * windows/winsxs manifest; use the manifest directory name instead */
769  dirlen = p - info->lpAssemblyManifestPath;
770  needed = (dirlen + 1) * sizeof(WCHAR) + pnameW->Length;
771 
772  status = get_buffer(fullname, needed, CallerBuffer, bAllocateBuffer);
773  if (!NT_SUCCESS(status))
774  goto done;
775 
776  p = *fullname;
777 
778  memcpy( p, info->lpAssemblyManifestPath, dirlen * sizeof(WCHAR) );
779  p += dirlen;
780  memcpy( p, pnameW->Buffer, pnameW->Length);
781  p += (pnameW->Length / sizeof(WCHAR));
782  *p = L'\0';
783 
784  goto done;
785  }
786  }
787 
788  needed = (wcslen(SharedUserData->NtSystemRoot) * sizeof(WCHAR) +
789  sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength + pnameW->Length + 2*sizeof(WCHAR));
790 
791  status = get_buffer(fullname, needed, CallerBuffer, bAllocateBuffer);
792  if (!NT_SUCCESS(status))
793  goto done;
794 
795  p = *fullname;
796 
797  wcscpy( p, SharedUserData->NtSystemRoot );
798  p += wcslen(p);
799  memcpy( p, winsxsW, sizeof(winsxsW) );
800  p += sizeof(winsxsW) / sizeof(WCHAR);
801  memcpy( p, info->lpAssemblyDirectoryName, info->ulAssemblyDirectoryNameLength );
802  p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
803  *p++ = L'\\';
804  memcpy( p, pnameW->Buffer, pnameW->Length);
805  p += (pnameW->Length / sizeof(WCHAR));
806  *p = L'\0';
807 
808 done:
809  RtlFreeHeap( RtlGetProcessHeap(), 0, info );
811  DPRINT("%S\n", fullname);
812  return status;
813 }
814 
815 /*
816  * @unimplemented
817  */
818 NTSYSAPI
819 NTSTATUS
820 NTAPI
822  IN PUNICODE_STRING OriginalName,
827  IN PULONG NewFlags,
828  IN PSIZE_T FileNameSize,
830 {
834  UNICODE_STRING localStr, localStr2, *pstrParam;
835  WCHAR *p;
836  BOOLEAN GotExtension;
837  WCHAR c;
838  C_ASSERT(sizeof(UNICODE_NULL) == sizeof(WCHAR));
839 
840 
841  /* Check for invalid parameters */
842  if (!OriginalName)
843  {
845  }
846 
847  if (!DynamicString && !StaticString)
848  {
850  }
851 
852  if ((DynamicString) && (StaticString) && !(NewName))
853  {
855  }
856 
857  if (!OriginalName->Buffer || OriginalName->Length == 0)
858  {
860  }
861 
862  if (StaticString && (OriginalName == StaticString || OriginalName->Buffer == StaticString->Buffer))
863  {
865  }
866 
867  if (NtCurrentPeb()->ProcessParameters &&
868  (NtCurrentPeb()->ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH))
869  {
870  UNICODE_STRING RealName, LocalName;
871  WCHAR RealNameBuf[MAX_PATH], LocalNameBuf[MAX_PATH];
872 
873  RtlInitEmptyUnicodeString(&RealName, RealNameBuf, sizeof(RealNameBuf));
874  RtlInitEmptyUnicodeString(&LocalName, LocalNameBuf, sizeof(LocalNameBuf));
875 
876  Status = RtlComputePrivatizedDllName_U(OriginalName, &RealName, &LocalName);
877  if (!NT_SUCCESS(Status))
878  {
879  DPRINT1("RtlComputePrivatizedDllName_U failed for %wZ: 0x%lx\n", OriginalName, Status);
880  return Status;
881  }
882 
883  if (RtlDoesFileExists_UStr(&LocalName))
884  {
886  if (NT_SUCCESS(Status))
887  {
888  RtlCopyMemory(fullname, LocalName.Buffer, LocalName.Length + sizeof(UNICODE_NULL));
889  }
890  else
891  {
892  DPRINT1("Error while retrieving buffer for %wZ: 0x%lx\n", OriginalName, Status);
893  }
894  }
895  else if (RtlDoesFileExists_UStr(&RealName))
896  {
898  if (NT_SUCCESS(Status))
899  {
900  RtlCopyMemory(fullname, RealName.Buffer, RealName.Length + sizeof(UNICODE_NULL));
901  }
902  else
903  {
904  DPRINT1("Error while retrieving buffer for %wZ: 0x%lx\n", OriginalName, Status);
905  }
906  }
907  else
908  {
910  }
911 
912  if (RealName.Buffer != RealNameBuf)
913  RtlFreeUnicodeString(&RealName);
914  if (LocalName.Buffer != LocalNameBuf)
915  RtlFreeUnicodeString(&LocalName);
916 
917  if (NT_SUCCESS(Status))
918  {
919  DPRINT("Redirecting %wZ to %S\n", OriginalName, fullname);
921  {
924  }
925  else
926  {
928  }
929  return Status;
930  }
931  }
932 
933  pstrParam = OriginalName;
934 
935  /* Get the file name with an extension */
936  p = OriginalName->Buffer + OriginalName->Length / sizeof(WCHAR) - 1;
937  GotExtension = FALSE;
938  while (p >= OriginalName->Buffer)
939  {
940  c = *p--;
941  if (c == L'.')
942  {
943  GotExtension = TRUE;
944  }
945  else if (c == L'\\')
946  {
947  localStr.Buffer = p + 2;
948  localStr.Length = OriginalName->Length - ((ULONG_PTR)localStr.Buffer - (ULONG_PTR)OriginalName->Buffer);
949  localStr.MaximumLength = OriginalName->MaximumLength - ((ULONG_PTR)localStr.Buffer - (ULONG_PTR)OriginalName->Buffer);
950  pstrParam = &localStr;
951  break;
952  }
953  }
954 
955  if (!GotExtension)
956  {
957  if (!Extension)
958  {
960  }
961 
962  if (pstrParam->Length + Extension->Length > sizeof(buffer))
963  {
964  //FIXME!
965  return STATUS_NO_MEMORY;
966  }
967 
968  RtlInitEmptyUnicodeString(&localStr2, buffer, sizeof(buffer));
969  RtlAppendUnicodeStringToString(&localStr2, pstrParam);
971  pstrParam = &localStr2;
972  }
973 
974  /* Use wine's function as long as we use wine's sxs implementation in ntdll */
976  if (!NT_SUCCESS(Status))
977  {
978  return Status;
979  }
980 
981  DPRINT("Redirecting %wZ to %S\n", OriginalName, fullname);
982 
984  {
987  }
988  else
989  {
991  }
992 
993  return Status;
994 }
995 
996 /*
997  * @implemented
998  */
999 NTSYSAPI
1000 NTSTATUS
1001 NTAPI
1002 RtlWow64EnableFsRedirection(IN BOOLEAN Wow64FsEnableRedirection)
1003 {
1004  /* This is what Windows returns on x86 */
1005  return STATUS_NOT_IMPLEMENTED;
1006 }
1007 
1008 /*
1009  * @implemented
1010  */
1011 NTSYSAPI
1012 NTSTATUS
1013 NTAPI
1014 RtlWow64EnableFsRedirectionEx(IN PVOID Wow64FsEnableRedirection,
1015  OUT PVOID *OldFsRedirectionLevel)
1016 {
1017  /* This is what Windows returns on x86 */
1018  return STATUS_NOT_IMPLEMENTED;
1019 }
1020 
1021 /*
1022  * @unimplemented
1023  */
1024 NTSYSAPI
1025 NTSTATUS
1026 NTAPI
1028  OUT PCHAR Hash,
1029  IN ULONG ImportTableHashSize)
1030 {
1031  UNIMPLEMENTED;
1032  return STATUS_NOT_IMPLEMENTED;
1033 }
1034 
1035 NTSTATUS
1036 NTAPI
1040  _In_ SIZE_T Length)
1041 {
1042  _SEH2_TRY
1043  {
1045  }
1047  {
1049  }
1050  _SEH2_END;
1051 
1052  return STATUS_SUCCESS;
1053 }
1054 
1055 /* FIXME: code duplication with kernel32/client/time.c */
1056 ULONG
1057 NTAPI
1059 {
1060  ULARGE_INTEGER TickCount;
1061 
1062 #ifdef _WIN64
1063  TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
1064 #else
1065  while (TRUE)
1066  {
1067  TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
1068  TickCount.LowPart = SharedUserData->TickCount.LowPart;
1069 
1070  if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
1071  break;
1072 
1073  YieldProcessor();
1074  }
1075 #endif
1076 
1077  return (ULONG)((UInt32x32To64(TickCount.LowPart,
1078  SharedUserData->TickCountMultiplier) >> 24) +
1079  UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
1080  SharedUserData->TickCountMultiplier));
1081 }
1082 
1083 /* EOF */
VOID RtlpDestroyAtomHandleTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:404
signed char * PCHAR
Definition: retypes.h:7
PTEB LdrpTopLevelDllBeingLoadedTeb
Definition: libsupp.c:18
#define RTL_HANDLE_VALID
Definition: rtltypes.h:374
static int Hash(const char *)
Definition: reader.c:2257
GLint level
Definition: gl.h:1546
#define IN
Definition: typedefs.h:39
_Out_ PULONG_PTR HighLimit
Definition: iofuncs.h:2881
Definition: rtltypes.h:1669
struct _RTL_ATOM_HANDLE * PRTL_ATOM_HANDLE
PPEB Peb
Definition: dllmain.c:27
KPROCESSOR_MODE NTAPI RtlpGetMode(VOID)
Definition: libsupp.c:53
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
BOOLEAN RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:456
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
NTSTATUS find_entry(PVOID BaseAddress, LDR_RESOURCE_INFO *info, ULONG level, void **ret, int want_dir)
Definition: libsupp.c:570
struct _Entry Entry
Definition: kefuncs.h:627
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
NTSTATUS NTAPI RtlpImageNtHeaderEx(_In_ ULONG Flags, _In_ PVOID Base, _In_ ULONG64 Size, _Out_ PIMAGE_NT_HEADERS *OutHeaders)
Definition: image.c:140
USHORT MaximumLength
Definition: env_spec_w32.h:370
NTSYSAPI VOID NTAPI RtlDestroyHandleTable(_Inout_ PRTL_HANDLE_TABLE HandleTable)
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 mm1 mm5 paddd mm0 paddd mm4 mm0 mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 mm1 paddd mm0 mm0 packssdw mm0 movd eax movw edi esi edx esi ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 mm1 mm5 paddd mm1 paddd mm5 mm1 mm5 packssdw mm1 packssdw mm5 psubd mm0 psubd mm4 psubsw mm0 psubsw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 mm1 paddd mm1 mm1 packssdw mm1 psubd mm0 psubsw mm0 movd eax movw edi emms popl ebx popl esi popl edi mov ebp
Definition: synth_sse3d.h:248
NTSTATUS NTAPI RtlEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:108
#define TRUE
Definition: types.h:120
VOID RtlpUnlockAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:385
NTSYSAPI VOID NTAPI RtlInitializeHandleTable(_In_ ULONG TableSize, _In_ ULONG HandleSize, _In_ PRTL_HANDLE_TABLE HandleTable)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IMAGE_RESOURCE_DIRECTORY * find_entry_by_name(IMAGE_RESOURCE_DIRECTORY *dir, LPCWSTR name, void *root, int want_dir)
Definition: res.c:130
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define LANG_NEUTRAL
Definition: nls.h:22
struct _root root
#define SUBLANG_DEFAULT
Definition: nls.h:168
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
NTSTATUS find_actctx_dll(PUNICODE_STRING pnameW, LPWSTR *fullname, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
Definition: libsupp.c:715
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2373
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_In_ UINT Bytes
Definition: mmcopy.h:9
#define _Out_writes_bytes_all_(s)
Definition: no_sal2.h:194
ULONG SizeOfImage
Definition: ldrtypes.h:143
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlWow64EnableFsRedirection(IN BOOLEAN Wow64FsEnableRedirection)
Definition: libsupp.c:1002
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
$ULONG LowPart
Definition: ntbasedef.h:570
GLuint buffer
Definition: glext.h:5915
VOID NTAPI RtlReleasePebLock(VOID)
Definition: libsupp.c:82
NTSTATUS NTAPI RtlpSafeCopyMemory(_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, _In_ SIZE_T Length)
Definition: libsupp.c:52
VOID RtlpFreeAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:442
DWORD LCID
Definition: nls.h:13
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1389
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
Definition: libsupp.c:659
#define SUBLANG_NEUTRAL
Definition: nls.h:167
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5413
#define FASTCALL
Definition: nt_native.h:50
#define NTSYSAPI
Definition: ntoskrnl.h:14
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
_SEH2_TRY
Definition: create.c:4226
#define SUBLANG_SYS_DEFAULT
Definition: nls.h:169
uint32_t ULONG_PTR
Definition: typedefs.h:65
VOID NTAPI RtlpClearInDbgPrint(VOID)
Definition: libsupp.c:45
NTSYSAPI NTSTATUS NTAPI RtlComputeImportTableHash(IN HANDLE FileHandle, OUT PCHAR Hash, IN ULONG ImportTableHashSize)
Definition: libsupp.c:1027
FORCEINLINE VOID YieldProcessor(VOID)
Definition: ke.h:32
PVOID DllBase
Definition: btrfs_drv.h:1926
ULONG NtGlobalFlag
Definition: ntddk_ex.h:270
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
HANDLE FileHandle
Definition: stats.c:38
return STATUS_NOT_IMPLEMENTED
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
VOID NTAPI RtlpSetHeapParameters(IN PRTL_HEAP_PARAMETERS Parameters)
Definition: libsupp.c:174
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
#define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH
Definition: rtltypes.h:52
BOOLEAN NTAPI RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:117
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
_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:426
#define _Out_
Definition: no_sal2.h:160
Definition: parser.c:48
void DPRINT(...)
Definition: polytest.cpp:61
PRTL_ATOM_TABLE_ENTRY AtomEntry
Definition: libsupp.c:358
NTSTATUS NTAPI RtlImageNtHeaderEx(_In_ ULONG Flags, _In_ PVOID Base, _In_ ULONG64 Size, _Out_ PIMAGE_NT_HEADERS *OutHeaders)
Definition: libsupp.c:32
#define C_ASSERT(e)
Definition: intsafe.h:71
unsigned int dir
Definition: maze.c:112
void * PVOID
Definition: retypes.h:9
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
ULONG HeapSegmentCommit
Definition: ntddk_ex.h:276
NTSYSAPI PRTL_HANDLE_TABLE_ENTRY NTAPI RtlAllocateHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _Inout_ PULONG Index)
BOOLEAN NTAPI RtlpCaptureStackLimits(IN ULONG_PTR Ebp, IN ULONG_PTR *StackBegin, IN ULONG_PTR *StackEnd)
Definition: libsupp.c:211
NTSTATUS NTAPI RtlLeaveHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:133
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
NTSYSAPI BOOLEAN NTAPI RtlFreeHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _In_ PRTL_HANDLE_TABLE_ENTRY Handle)
static const WCHAR lang[]
Definition: wbemdisp.c:287
NTSYSAPI NTSTATUS NTAPI RtlComputePrivatizedDllName_U(_In_ PUNICODE_STRING DllName, _Inout_ PUNICODE_STRING RealName, _Inout_ PUNICODE_STRING LocalName)
Definition: path.c:467
Status
Definition: gdiplustypes.h:24
#define UNALIGNED
Definition: crtdefs.h:132
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define STATUS_NOT_FOUND
Definition: shellext.h:72
int Count
Definition: noreturn.cpp:7
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
$ULONG HighPart
Definition: ntbasedef.h:571
ULONG HeapSegmentReserve
Definition: ntddk_ex.h:275
GLsizeiptr size
Definition: glext.h:5919
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
IMAGE_RESOURCE_DIRECTORY * find_entry_by_id(IMAGE_RESOURCE_DIRECTORY *dir, WORD id, void *root, int want_dir)
Definition: res.c:95
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
IMAGE_RESOURCE_DIRECTORY * find_first_entry(IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
Definition: res.c:75
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ WDFCOLLECTION _In_ ULONG Index
#define MI_HIGHEST_USER_ADDRESS
Definition: mmtypes.h:43
BOOLEAN NTAPI RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, IN ULONG_PTR RegistrationFrameEnd, IN OUT PULONG_PTR StackLow, IN OUT PULONG_PTR StackHigh)
Definition: libsupp.c:190
#define MAX_PATH
Definition: compat.h:34
const GLubyte * c
Definition: glext.h:8905
unsigned short WORD
Definition: ntddk_ex.h:93
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG, const GUID *, ULONG, const UNICODE_STRING *, PVOID)
Definition: actctx.c:5713
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2937
PPEB NTAPI RtlGetCurrentPeb(VOID)
Definition: libsupp.c:63
PVOID MmHighestUserAddress
Definition: libsupp.c:23
NTSTATUS RtlpInitAtomTableLock(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:362
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
NTSTATUS NTAPI RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock)
Definition: libsupp.c:126
#define LANG_ENGLISH
Definition: nls.h:52
struct _test_info info[]
Definition: SetCursorPos.c:19
struct _RTL_ATOM_HANDLE RTL_ATOM_HANDLE
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:655
#define wcsicmp
Definition: compat.h:15
unsigned __int64 ULONG64
Definition: imports.h:198
#define SharedUserData
int ret
#define STATUS_RESOURCE_DATA_NOT_FOUND
Definition: ntstatus.h:373
VOID RtlpFreeAtomTableEntry(PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:434
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOLEAN NTAPI RtlpCheckForActiveDebugger(VOID)
Definition: libsupp.c:25
const char * fullname
Definition: shader.c:1766
static const WCHAR L[]
Definition: oid.c:1250
#define RtlImageDirectoryEntryToData
Definition: compat.h:668
NTSYSAPI NTSTATUS NTAPI RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG Flags, IN PUNICODE_STRING OriginalName, IN PUNICODE_STRING Extension, IN OUT PUNICODE_STRING StaticString, IN OUT PUNICODE_STRING DynamicString, IN OUT PUNICODE_STRING *NewName, IN PULONG NewFlags, IN PSIZE_T FileNameSize, IN PSIZE_T RequiredLength)
Definition: libsupp.c:821
Definition: btrfs_drv.h:1922
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define LANGIDFROMLCID(l)
Definition: nls.h:18
SIZE_T RtlpAllocDeallocQueryBufferSize
Definition: libsupp.c:17
Definition: _list.h:228
#define PAGE_SIZE
Definition: env_spec_w32.h:49
Definition: typedefs.h:119
#define wcsrchr
Definition: compat.h:16
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5242
VOID NTAPI RtlpGetStackLimits(PULONG_PTR StackBase, PULONG_PTR StackLimit)
struct atom_table ** PRTL_ATOM_TABLE
Definition: atom.c:43
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
VOID RtlpFreeAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:418
int push_language(USHORT *list, ULONG pos, WORD lang)
Definition: res.c:61
#define _In_
Definition: no_sal2.h:158
BOOLEAN RtlpCreateAtomHandleTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:394
ULONG_PTR SIZE_T
Definition: typedefs.h:80
Definition: compat.h:694
_SEH2_END
Definition: create.c:4400
VOID RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:370
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
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
#define STATUS_RESOURCE_LANG_NOT_FOUND
Definition: ntstatus.h:648
#define NtCurrentPeb()
Definition: FLS.c:20
unsigned short USHORT
Definition: pedump.c:61
NTSYSAPI NTSTATUS NTAPI RtlWow64EnableFsRedirectionEx(IN PVOID Wow64FsEnableRedirection, OUT PVOID *OldFsRedirectionLevel)
Definition: libsupp.c:1014
BOOLEAN NTAPI RtlDoesFileExists_UStr(IN PUNICODE_STRING FileName)
Definition: path.c:1384
ULONG NTAPI RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags)
Definition: libsupp.c:227
#define STATUS_RESOURCE_NAME_NOT_FOUND
Definition: ntstatus.h:375
ULONG NTAPI RtlGetTickCount(VOID)
Definition: libsupp.c:1058
NTSTATUS NTAPI NtQueryDefaultLocale(IN BOOLEAN UserProfile, OUT PLCID DefaultLocaleId)
Definition: locale.c:162
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:348
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
VOID NTAPI RtlAcquirePebLock(VOID)
Definition: libsupp.c:72
PRTL_ATOM_TABLE RtlpAllocAtomTable(ULONG Size)
Definition: libsupp.c:410
#define DPRINT1
Definition: precomp.h:8
BOOLEAN NTAPI RtlpSetInDbgPrint(VOID)
Definition: libsupp.c:33
ULONG Flags
Definition: rtltypes.h:1248
BOOLEAN RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:377
_In_ PUNICODE_STRING NewName
Definition: zwfuncs.h:1203
Definition: name.c:38
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
#define c
Definition: ke_i.h:80
NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **)
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI RtlpFreeMemory(PVOID Mem, ULONG Tag)
Definition: libsupp.c:44
NTSTATUS get_buffer(LPWSTR *buffer, SIZE_T needed, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
Definition: libsupp.c:688
PVOID NTAPI RtlpAllocateMemory(ULONG Bytes, ULONG Tag)
Definition: libsupp.c:35
VOID NTAPI RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN PVOID ContextData, IN ULONG Size)
Definition: libsupp.c:201
Definition: rtltypes.h:1244
static const WCHAR dotManifestW[]
Definition: actctx.c:760
#define MAKELANGID(p, s)
Definition: nls.h:15
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:115
#define ULONG_PTR
Definition: config.h:101
uint32_t * PULONG_PTR
Definition: typedefs.h:65
NTSTATUS NTAPI RtlDeleteHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:101
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
PVOID FastPebLock
Definition: ntddk_ex.h:250
RTL_HANDLE_TABLE_ENTRY Handle
Definition: libsupp.c:357
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
ULONG HeapDeCommitFreeBlockThreshold
Definition: ntddk_ex.h:278
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
Definition: pedump.c:261
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PRTL_ATOM_TABLE_ENTRY RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index)
Definition: libsupp.c:492
static SERVICE_STATUS status
Definition: service.c:31
NTSYSAPI BOOLEAN NTAPI RtlTryEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define UInt32x32To64(a, b)
Definition: intsafe.h:250
PRTL_ATOM_TABLE_ENTRY RtlpAllocAtomTableEntry(ULONG Size)
Definition: libsupp.c:426
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LIST_ENTRY * ModuleListHead
Definition: kdpacket.c:23
#define CONST
Definition: pedump.c:81
base of all file and directory entries
Definition: entries.h:82
IN PUNICODE_STRING StaticString
ULONG NTAPI RtlGetNtGlobalFlags(VOID)
Definition: libsupp.c:93
ULONG HeapDeCommitTotalFreeThreshold
Definition: ntddk_ex.h:277
#define PRIMARYLANGID(l)
Definition: nls.h:16
Definition: fci.c:126
#define STATUS_RESOURCE_TYPE_NOT_FOUND
Definition: ntstatus.h:374
IN PUNICODE_STRING IN PUNICODE_STRING DynamicString
Definition: ps.c:97
#define SUBLANGID(l)
Definition: nls.h:17