ReactOS  0.4.11-dev-195-gef016bf
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 {
110  UNREFERENCED_PARAMETER(Exclusive);
111 
112  return RtlEnterCriticalSection(&Lock->CriticalSection);
113 }
114 
115 BOOLEAN
116 NTAPI
118 {
119  UNREFERENCED_PARAMETER(Exclusive);
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 */
265  Result = RtlpCaptureStackLimits((ULONG_PTR)Stack,
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 {
350  return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
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 
509 /*
510  * Ldr Resource support code
511  */
512 
514  LPCWSTR name, void *root,
515  int want_dir );
517  WORD id, void *root, int want_dir );
519  void *root, int want_dir );
521 
522 /**********************************************************************
523  * find_entry
524  *
525  * Find a resource entry
526  */
528  ULONG level, void **ret, int want_dir )
529 {
530  ULONG size;
531  void *root;
532  IMAGE_RESOURCE_DIRECTORY *resdirptr;
533  USHORT list[9]; /* list of languages to try */
534  int i, pos = 0;
535  LCID user_lcid, system_lcid;
536 
538  if (!root) return STATUS_RESOURCE_DATA_NOT_FOUND;
539  if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND;
540  resdirptr = root;
541 
542  if (!level--) goto done;
543  if (!(*ret = find_entry_by_name( resdirptr, (LPCWSTR)info->Type, root, want_dir || level )))
545  if (!level--) return STATUS_SUCCESS;
546 
547  resdirptr = *ret;
548  if (!(*ret = find_entry_by_name( resdirptr, (LPCWSTR)info->Name, root, want_dir || level )))
550  if (!level--) return STATUS_SUCCESS;
551  if (level) return STATUS_INVALID_PARAMETER; /* level > 3 */
552 
553  /* 1. specified language */
554  pos = push_language( list, pos, info->Language );
555 
556  /* 2. specified language with neutral sublanguage */
557  pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(info->Language), SUBLANG_NEUTRAL ) );
558 
559  /* 3. neutral language with neutral sublanguage */
560  pos = push_language( list, pos, MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) );
561 
562  /* if no explicitly specified language, try some defaults */
563  if (PRIMARYLANGID(info->Language) == LANG_NEUTRAL)
564  {
565  /* user defaults, unless SYS_DEFAULT sublanguage specified */
566  if (SUBLANGID(info->Language) != SUBLANG_SYS_DEFAULT)
567  {
568  /* 4. current thread locale language */
569  pos = push_language( list, pos, LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale) );
570 
571  if (NT_SUCCESS(NtQueryDefaultLocale(TRUE, &user_lcid)))
572  {
573  /* 5. user locale language */
574  pos = push_language( list, pos, LANGIDFROMLCID(user_lcid) );
575 
576  /* 6. user locale language with neutral sublanguage */
577  pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(user_lcid), SUBLANG_NEUTRAL ) );
578  }
579  }
580 
581  /* now system defaults */
582 
583  if (NT_SUCCESS(NtQueryDefaultLocale(FALSE, &system_lcid)))
584  {
585  /* 7. system locale language */
586  pos = push_language( list, pos, LANGIDFROMLCID( system_lcid ) );
587 
588  /* 8. system locale language with neutral sublanguage */
589  pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(system_lcid), SUBLANG_NEUTRAL ) );
590  }
591 
592  /* 9. English */
593  pos = push_language( list, pos, MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) );
594  }
595 
596  resdirptr = *ret;
597  for (i = 0; i < pos; i++)
598  if ((*ret = find_entry_by_id( resdirptr, list[i], root, want_dir ))) return STATUS_SUCCESS;
599 
600  /* if no explicitly specified language, return the first entry */
601  if (PRIMARYLANGID(info->Language) == LANG_NEUTRAL)
602  {
603  if ((*ret = find_first_entry( resdirptr, root, want_dir ))) return STATUS_SUCCESS;
604  }
606 
607 done:
608  *ret = resdirptr;
609  return STATUS_SUCCESS;
610 }
611 
612 /*
613  * @implemented
614  */
615 PVOID NTAPI
617  PVOID* BaseOfImage)
618 {
621  PLDR_DATA_TABLE_ENTRY Module;
622  PVOID ImageBase = NULL;
623 
624  RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
625  ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
626  Entry = ModuleListHead->Flink;
627  while (Entry != ModuleListHead)
628  {
629  Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
630 
631  if ((ULONG_PTR)PcValue >= (ULONG_PTR)Module->DllBase &&
632  (ULONG_PTR)PcValue < (ULONG_PTR)Module->DllBase + Module->SizeOfImage)
633  {
634  ImageBase = Module->DllBase;
635  break;
636  }
637  Entry = Entry->Flink;
638  }
639  RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
640 
641  *BaseOfImage = ImageBase;
642  return ImageBase;
643 }
644 
645 NTSTATUS get_buffer(LPWSTR *buffer, SIZE_T needed, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
646 {
647  WCHAR *p;
648 
649  if (CallerBuffer && CallerBuffer->MaximumLength > needed)
650  {
651  p = CallerBuffer->Buffer;
652  CallerBuffer->Length = needed - sizeof(WCHAR);
653  }
654  else
655  {
656  if (!bAllocateBuffer)
658 
659  if (CallerBuffer)
660  CallerBuffer->Buffer[0] = 0;
661 
662  p = RtlAllocateHeap(RtlGetProcessHeap(), 0, needed );
663  if (!p)
664  return STATUS_NO_MEMORY;
665  }
666  *buffer = p;
667 
668  return STATUS_SUCCESS;
669 }
670 
671 /* NOTE: Remove this one once our actctx support becomes better */
672 NTSTATUS find_actctx_dll( PUNICODE_STRING pnameW, LPWSTR *fullname, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
673 {
674  static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\'};
675  static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0};
676 
677  ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info;
678  ACTCTX_SECTION_KEYED_DATA data;
680  SIZE_T needed, size = 1024;
681  WCHAR *p;
682 
683  data.cbSize = sizeof(data);
684  status = RtlFindActivationContextSectionString( FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
685  ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
686  pnameW, &data );
687  if (status != STATUS_SUCCESS)
688  {
689  //DPRINT1("RtlFindActivationContextSectionString returned 0x%x for %wZ\n", status, pnameW);
690  return status;
691  }
692 
693  for (;;)
694  {
695  if (!(info = RtlAllocateHeap( RtlGetProcessHeap(), 0, size )))
696  {
697  status = STATUS_NO_MEMORY;
698  goto done;
699  }
700  status = RtlQueryInformationActivationContext( 0, data.hActCtx, &data.ulAssemblyRosterIndex,
701  AssemblyDetailedInformationInActivationContext,
702  info, size, &needed );
703  if (status == STATUS_SUCCESS) break;
704  if (status != STATUS_BUFFER_TOO_SMALL) goto done;
705  RtlFreeHeap( RtlGetProcessHeap(), 0, info );
706  size = needed;
707  }
708 
709  DPRINT("manifestpath === %S\n", info->lpAssemblyManifestPath);
710  DPRINT("DirectoryName === %S\n", info->lpAssemblyDirectoryName);
711  if (!info->lpAssemblyManifestPath /*|| !info->lpAssemblyDirectoryName*/)
712  {
713  status = STATUS_SXS_KEY_NOT_FOUND;
714  goto done;
715  }
716 
717  if ((p = wcsrchr( info->lpAssemblyManifestPath, '\\' )))
718  {
719  DWORD dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
720 
721  p++;
722  if (!info->lpAssemblyDirectoryName || _wcsnicmp( p, info->lpAssemblyDirectoryName, dirlen ) || wcsicmp( p + dirlen, dotManifestW ))
723  {
724  /* manifest name does not match directory name, so it's not a global
725  * windows/winsxs manifest; use the manifest directory name instead */
726  dirlen = p - info->lpAssemblyManifestPath;
727  needed = (dirlen + 1) * sizeof(WCHAR) + pnameW->Length;
728 
729  status = get_buffer(fullname, needed, CallerBuffer, bAllocateBuffer);
730  if (!NT_SUCCESS(status))
731  goto done;
732 
733  p = *fullname;
734 
735  memcpy( p, info->lpAssemblyManifestPath, dirlen * sizeof(WCHAR) );
736  p += dirlen;
737  memcpy( p, pnameW->Buffer, pnameW->Length);
738  p += (pnameW->Length / sizeof(WCHAR));
739  *p = L'\0';
740 
741  goto done;
742  }
743  }
744 
745  needed = (wcslen(SharedUserData->NtSystemRoot) * sizeof(WCHAR) +
746  sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength + pnameW->Length + 2*sizeof(WCHAR));
747 
748  status = get_buffer(fullname, needed, CallerBuffer, bAllocateBuffer);
749  if (!NT_SUCCESS(status))
750  goto done;
751 
752  p = *fullname;
753 
754  wcscpy( p, SharedUserData->NtSystemRoot );
755  p += wcslen(p);
756  memcpy( p, winsxsW, sizeof(winsxsW) );
757  p += sizeof(winsxsW) / sizeof(WCHAR);
758  memcpy( p, info->lpAssemblyDirectoryName, info->ulAssemblyDirectoryNameLength );
759  p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
760  *p++ = L'\\';
761  memcpy( p, pnameW->Buffer, pnameW->Length);
762  p += (pnameW->Length / sizeof(WCHAR));
763  *p = L'\0';
764 
765 done:
766  RtlFreeHeap( RtlGetProcessHeap(), 0, info );
767  RtlReleaseActivationContext( data.hActCtx );
768  DPRINT("%S\n", fullname);
769  return status;
770 }
771 
772 /*
773  * @unimplemented
774  */
775 NTSYSAPI
776 NTSTATUS
777 NTAPI
779  IN PUNICODE_STRING OriginalName,
784  IN PULONG NewFlags,
785  IN PSIZE_T FileNameSize,
787 {
789  LPWSTR fullname;
791  UNICODE_STRING localStr, localStr2, *pstrParam;
792  WCHAR *p;
793  BOOLEAN GotExtension;
794  WCHAR c;
795 
796  /* Check for invalid parameters */
797  if (!OriginalName)
798  {
800  }
801 
802  if (!DynamicString && !StaticString)
803  {
805  }
806 
807  if ((DynamicString) && (StaticString) && !(NewName))
808  {
810  }
811 
812  if (!OriginalName->Buffer || OriginalName->Length == 0)
813  {
815  }
816 
817  if (StaticString && (OriginalName == StaticString || OriginalName->Buffer == StaticString->Buffer))
818  {
820  }
821 
822  pstrParam = OriginalName;
823 
824  /* Get the file name with an extension */
825  p = OriginalName->Buffer + OriginalName->Length / sizeof(WCHAR) - 1;
826  GotExtension = FALSE;
827  while (p >= OriginalName->Buffer)
828  {
829  c = *p--;
830  if (c == L'.')
831  {
832  GotExtension = TRUE;
833  }
834  else if (c == L'\\')
835  {
836  localStr.Buffer = p + 2;
837  localStr.Length = OriginalName->Length - ((ULONG_PTR)localStr.Buffer - (ULONG_PTR)OriginalName->Buffer);
838  localStr.MaximumLength = OriginalName->MaximumLength - ((ULONG_PTR)localStr.Buffer - (ULONG_PTR)OriginalName->Buffer);
839  pstrParam = &localStr;
840  break;
841  }
842  }
843 
844  if (!GotExtension)
845  {
846  if (!Extension)
847  {
849  }
850 
851  if (pstrParam->Length + Extension->Length > sizeof(buffer))
852  {
853  //FIXME!
854  return STATUS_NO_MEMORY;
855  }
856 
857  RtlInitEmptyUnicodeString(&localStr2, buffer, sizeof(buffer));
858  RtlAppendUnicodeStringToString(&localStr2, pstrParam);
859  RtlAppendUnicodeStringToString(&localStr2, Extension);
860  pstrParam = &localStr2;
861  }
862 
863  /* Use wine's function as long as we use wine's sxs implementation in ntdll */
864  Status = find_actctx_dll(pstrParam, &fullname, StaticString, DynamicString != NULL);
865  if (!NT_SUCCESS(Status))
866  {
867  return Status;
868  }
869 
870  DPRINT("Redirecting %wZ to %S\n", OriginalName, fullname);
871 
872  if (!StaticString || StaticString->Buffer != fullname)
873  {
874  RtlInitUnicodeString(DynamicString, fullname);
875  *NewName = DynamicString;
876  }
877  else
878  {
879  *NewName = StaticString;
880  }
881 
882  return Status;
883 }
884 
885 /*
886  * @implemented
887  */
888 NTSYSAPI
889 NTSTATUS
890 NTAPI
891 RtlWow64EnableFsRedirection(IN BOOLEAN Wow64FsEnableRedirection)
892 {
893  /* This is what Windows returns on x86 */
894  return STATUS_NOT_IMPLEMENTED;
895 }
896 
897 /*
898  * @implemented
899  */
900 NTSYSAPI
901 NTSTATUS
902 NTAPI
903 RtlWow64EnableFsRedirectionEx(IN PVOID Wow64FsEnableRedirection,
904  OUT PVOID *OldFsRedirectionLevel)
905 {
906  /* This is what Windows returns on x86 */
907  return STATUS_NOT_IMPLEMENTED;
908 }
909 
910 /*
911  * @unimplemented
912  */
913 NTSYSAPI
914 NTSTATUS
915 NTAPI
917  OUT PCHAR Hash,
918  IN ULONG ImportTableHashSize)
919 {
921  return STATUS_NOT_IMPLEMENTED;
922 }
923 
924 NTSTATUS
925 NTAPI
930 {
931  _SEH2_TRY
932  {
933  RtlCopyMemory(Destination, Source, Length);
934  }
936  {
938  }
939  _SEH2_END;
940 
941  return STATUS_SUCCESS;
942 }
943 
944 /* FIXME: code duplication with kernel32/client/time.c */
945 ULONG
946 NTAPI
948 {
949  ULARGE_INTEGER TickCount;
950 
951 #ifdef _WIN64
952  TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
953 #else
954  while (TRUE)
955  {
956  TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
957  TickCount.LowPart = SharedUserData->TickCount.LowPart;
958 
959  if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
960  break;
961 
962  YieldProcessor();
963  }
964 #endif
965 
966  return (ULONG)((UInt32x32To64(TickCount.LowPart,
967  SharedUserData->TickCountMultiplier) >> 24) +
968  UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
969  SharedUserData->TickCountMultiplier));
970 }
971 
972 /* EOF */
DWORD *typedef PVOID
Definition: winlogon.h:61
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:372
static int Hash(const char *)
Definition: reader.c:2258
GLint level
Definition: gl.h:1546
#define IN
Definition: typedefs.h:38
_Out_ PULONG_PTR HighLimit
Definition: iofuncs.h:2837
Definition: rtltypes.h:1642
unsigned short WORD
Definition: ntddk_ex.h:93
ULONG HeapSegmentReserve
Definition: ntddk_ex.h:279
struct _RTL_ATOM_HANDLE * PRTL_ATOM_HANDLE
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ ULONG _Out_writes_bytes_all_(Length) PUCHAR Buffer
Definition: ntddpcm.h:100
PPEB Peb
Definition: dllmain.c:27
KPROCESSOR_MODE NTAPI RtlpGetMode(VOID)
Definition: libsupp.c:53
BOOLEAN RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry)
Definition: libsupp.c:456
NTSTATUS find_entry(PVOID BaseAddress, LDR_RESOURCE_INFO *info, ULONG level, void **ret, int want_dir)
Definition: libsupp.c:527
struct _Entry Entry
Definition: kefuncs.h:640
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
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
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5197
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:323
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LANG_NEUTRAL
Definition: nls.h:22
struct _root root
#define SUBLANG_DEFAULT
Definition: nls.h:168
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
NTSTATUS find_actctx_dll(PUNICODE_STRING pnameW, LPWSTR *fullname, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
Definition: libsupp.c:672
_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
USHORT Atom
Definition: rtltypes.h:1646
ULONG SizeOfImage
Definition: ldrtypes.h:141
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlWow64EnableFsRedirection(IN BOOLEAN Wow64FsEnableRedirection)
Definition: libsupp.c:891
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
$ULONG LowPart
Definition: ntbasedef.h:576
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:1170
_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
PVOID NTAPI RtlPcToFileHeader(IN PVOID PcValue, PVOID *BaseOfImage)
Definition: libsupp.c:616
#define WCHAR
Definition: msvc.h:43
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define FASTCALL
Definition: nt_native.h:50
__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 NTSYSAPI
Definition: ntoskrnl.h:14
ULONG_PTR Type
Definition: ldrtypes.h:179
DWORD DWORD
Definition: winlogon.h:84
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:52
_SEH2_TRY
Definition: create.c:4250
#define SUBLANG_SYS_DEFAULT
Definition: nls.h:169
uint32_t ULONG_PTR
Definition: typedefs.h:63
VOID NTAPI RtlpClearInDbgPrint(VOID)
Definition: libsupp.c:45
NTSYSAPI NTSTATUS NTAPI RtlComputeImportTableHash(IN HANDLE FileHandle, OUT PCHAR Hash, IN ULONG ImportTableHashSize)
Definition: libsupp.c:916
ULONG HeapDeCommitFreeBlockThreshold
Definition: ntddk_ex.h:282
FORCEINLINE VOID YieldProcessor(VOID)
Definition: ke.h:32
PVOID DllBase
Definition: btrfs_drv.h:1766
ULONG NtGlobalFlag
Definition: ntddk_ex.h:274
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLenum GLclampf GLint i
Definition: glfuncs.h:14
ULONG_PTR * PSIZE_T
Definition: typedefs.h:78
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
VOID NTAPI RtlpSetHeapParameters(IN PRTL_HEAP_PARAMETERS Parameters)
Definition: libsupp.c:174
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
USHORT HandleIndex
Definition: rtltypes.h:1645
PIN_DIRECTION dir
Definition: strmbase.h:230
BOOLEAN NTAPI RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:117
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
ULONG_PTR Name
Definition: ldrtypes.h:180
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
void DPRINT(...)
Definition: polytest.cpp:61
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
PRTL_ATOM_TABLE_ENTRY AtomEntry
Definition: libsupp.c:358
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
#define CONST
Definition: compiler.h:170
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
UINTN Size
Definition: acefiex.h:555
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
NTSYSAPI BOOLEAN NTAPI RtlFreeHandle(_In_ PRTL_HANDLE_TABLE HandleTable, _In_ PRTL_HANDLE_TABLE_ENTRY Handle)
static const WCHAR lang[]
Definition: wbemdisp.c:252
#define UNALIGNED
Definition: crtdefs.h:132
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
unsigned char BOOLEAN
ULONG HeapSegmentCommit
Definition: ntddk_ex.h:280
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
$ULONG HighPart
Definition: ntbasedef.h:577
GLsizeiptr size
Definition: glext.h:5919
LONG NTSTATUS
Definition: precomp.h:26
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:717
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#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:26
static const UCHAR Index[8]
Definition: usbohci.c:18
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2875
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 _RTL_ATOM_HANDLE RTL_ATOM_HANDLE
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:661
unsigned __int64 ULONG64
Definition: imports.h:198
#define SharedUserData
int ret
PVOID FastPebLock
Definition: ntddk_ex.h:254
#define STATUS_RESOURCE_DATA_NOT_FOUND
Definition: ntstatus.h:359
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
static const WCHAR L[]
Definition: oid.c:1087
VOID UINTN Length
Definition: acefiex.h:744
#define RtlImageDirectoryEntryToData
Definition: compat.h:460
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG, const GUID *, ULONG, const UNICODE_STRING *, PVOID)
Definition: actctx.c:5668
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:778
Definition: btrfs_drv.h:1762
#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:117
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
VOID NTAPI RtlpGetStackLimits(PULONG_PTR StackBase, PULONG_PTR StackLimit)
struct atom_table ** PRTL_ATOM_TABLE
Definition: atom.c:43
#define wcsicmp
Definition: string.h:1152
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
Status
Definition: gdiplustypes.h:24
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:204
BOOLEAN RtlpCreateAtomHandleTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:394
static HANDLE FileHandle
Definition: cabinet.c:48
ULONG_PTR SIZE_T
Definition: typedefs.h:78
Definition: compat.h:484
ULONG HeapDeCommitTotalFreeThreshold
Definition: ntddk_ex.h:281
const XML_Char XML_Encoding * info
Definition: expat.h:530
DWORD *typedef HANDLE
Definition: winlogon.h:61
_SEH2_END
Definition: create.c:4424
VOID RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:370
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define STATUS_RESOURCE_LANG_NOT_FOUND
Definition: ntstatus.h:634
#define NtCurrentPeb()
Definition: FLS.c:19
unsigned short USHORT
Definition: pedump.c:61
NTSYSAPI NTSTATUS NTAPI RtlWow64EnableFsRedirectionEx(IN PVOID Wow64FsEnableRedirection, OUT PVOID *OldFsRedirectionLevel)
Definition: libsupp.c:903
ULONG NTAPI RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags)
Definition: libsupp.c:227
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
#define STATUS_RESOURCE_NAME_NOT_FOUND
Definition: ntstatus.h:361
ULONG NTAPI RtlGetTickCount(VOID)
Definition: libsupp.c:947
NTSTATUS NTAPI NtQueryDefaultLocale(IN BOOLEAN UserProfile, OUT PLCID DefaultLocaleId)
Definition: locale.c:162
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:348
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5368
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
VOID NTAPI RtlAcquirePebLock(VOID)
Definition: libsupp.c:72
PRTL_ATOM_TABLE RtlpAllocAtomTable(ULONG Size)
Definition: libsupp.c:410
ULONG_PTR Language
Definition: ldrtypes.h:181
BOOLEAN NTAPI RtlpSetInDbgPrint(VOID)
Definition: libsupp.c:33
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
ULONG Flags
Definition: rtltypes.h:1244
BOOLEAN RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable)
Definition: libsupp.c:377
_In_ PUNICODE_STRING NewName
Definition: zwfuncs.h:1203
Definition: name.c:36
#define OUT
Definition: typedefs.h:39
#define c
Definition: ke_i.h:80
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI RtlpFreeMemory(PVOID Mem, ULONG Tag)
Definition: libsupp.c:44
NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **)
NTSTATUS get_buffer(LPWSTR *buffer, SIZE_T needed, PUNICODE_STRING CallerBuffer, BOOLEAN bAllocateBuffer)
Definition: libsupp.c:645
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:1240
static const WCHAR dotManifestW[]
Definition: actctx.c:707
#define MAKELANGID(p, s)
Definition: nls.h:15
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:114
#define ULONG_PTR
Definition: config.h:101
uint32_t * PULONG_PTR
Definition: typedefs.h:63
NTSTATUS NTAPI RtlDeleteHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:101
RTL_HANDLE_TABLE_ENTRY Handle
Definition: libsupp.c:357
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
GLfloat GLfloat p
Definition: glext.h:8902
#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
return STATUS_SUCCESS
Definition: btrfs.c:2710
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
NTSYSAPI BOOLEAN NTAPI RtlTryEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define UInt32x32To64(a, b)
Definition: intsafe.h:258
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
base of all file and directory entries
Definition: entries.h:82
IN PUNICODE_STRING StaticString
ULONG NTAPI RtlGetNtGlobalFlags(VOID)
Definition: libsupp.c:93
IN SCSI_ADAPTER_CONTROL_TYPE IN PVOID Parameters
Definition: srb.h:488
#define PRIMARYLANGID(l)
Definition: nls.h:16
Definition: fci.c:126
#define STATUS_RESOURCE_TYPE_NOT_FOUND
Definition: ntstatus.h:360
IN PUNICODE_STRING IN PUNICODE_STRING DynamicString
#define SUBLANGID(l)
Definition: nls.h:17