ReactOS 0.4.15-dev-5672-gf73ac17
umfuncs.h File Reference
#include <umtypes.h>
#include <dbgktypes.h>
Include dependency graph for umfuncs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef VOID(NTAPIPLDR_CALLBACK) (PVOID CallbackContext, PCHAR Name)
 

Functions

__analysis_noreturn NTSYSAPI VOID NTAPI DbgBreakPointWithStatus (_In_ ULONG Status)
 
NTSTATUS NTAPI DbgUiConnectToDbg (VOID)
 
NTSTATUS NTAPI DbgUiContinue (_In_ PCLIENT_ID ClientId, _In_ NTSTATUS ContinueStatus)
 
NTSTATUS NTAPI DbgUiDebugActiveProcess (_In_ HANDLE Process)
 
NTSTATUS NTAPI DbgUiStopDebugging (_In_ HANDLE Process)
 
NTSYSAPI NTSTATUS NTAPI DbgUiWaitStateChange (_In_ PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, _In_ PLARGE_INTEGER TimeOut)
 
NTSTATUS NTAPI DbgUiConvertStateChangeStructure (_In_ PDBGUI_WAIT_STATE_CHANGE WaitStateChange, _In_ PVOID DebugEvent)
 
VOID NTAPI DbgUiRemoteBreakin (VOID)
 
NTSTATUS NTAPI DbgUiIssueRemoteBreakin (_In_ HANDLE Process)
 
HANDLE NTAPI DbgUiGetThreadDebugObject (VOID)
 
NTSTATUS NTAPI LdrAddRefDll (_In_ ULONG Flags, _In_ PVOID BaseAddress)
 
NTSTATUS NTAPI LdrDisableThreadCalloutsForDll (_In_ PVOID BaseAddress)
 
NTSTATUS NTAPI LdrGetDllHandle (_In_opt_ PWSTR DllPath, _In_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *DllHandle)
 
NTSTATUS NTAPI LdrGetDllHandleEx (_In_ ULONG Flags, _In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_opt_ PVOID *DllHandle)
 
NTSTATUS NTAPI LdrFindEntryForAddress (_In_ PVOID Address, _Out_ PLDR_DATA_TABLE_ENTRY *Module)
 
NTSTATUS NTAPI LdrGetProcedureAddress (_In_ PVOID BaseAddress, _In_ PANSI_STRING Name, _In_ ULONG Ordinal, _Out_ PVOID *ProcedureAddress)
 
VOID NTAPI LdrInitializeThunk (ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4)
 
NTSTATUS NTAPI LdrLoadDll (_In_opt_ PWSTR SearchPath, _In_opt_ PULONG LoadFlags, _In_ PUNICODE_STRING Name, _Out_opt_ PVOID *BaseAddress)
 
PIMAGE_BASE_RELOCATION NTAPI LdrProcessRelocationBlock (_In_ ULONG_PTR Address, _In_ ULONG Count, _In_ PUSHORT TypeOffset, _In_ LONG_PTR Delta)
 
NTSTATUS NTAPI LdrQueryImageFileExecutionOptions (_In_ PUNICODE_STRING SubKey, _In_ PCWSTR ValueName, _In_ ULONG ValueSize, _Out_ PVOID Buffer, _In_ ULONG BufferSize, _Out_opt_ PULONG RetunedLength)
 
NTSTATUS NTAPI LdrQueryProcessModuleInformation (_In_opt_ PRTL_PROCESS_MODULES ModuleInformation, _In_opt_ ULONG Size, _Out_ PULONG ReturnedSize)
 
VOID NTAPI LdrSetDllManifestProber (_In_ PLDR_MANIFEST_PROBER_ROUTINE Routine)
 
NTSTATUS NTAPI LdrShutdownProcess (VOID)
 
NTSTATUS NTAPI LdrShutdownThread (VOID)
 
NTSTATUS NTAPI LdrUnloadDll (_In_ PVOID BaseAddress)
 
NTSTATUS NTAPI LdrVerifyImageMatchesChecksum (_In_ HANDLE FileHandle, _In_ PLDR_CALLBACK Callback, _In_ PVOID CallbackContext, _Out_ PUSHORT ImageCharacterstics)
 
NTSTATUS NTAPI LdrOpenImageFileOptionsKey (_In_ PUNICODE_STRING SubKey, _In_ BOOLEAN Wow64, _Out_ PHANDLE NewKeyHandle)
 
NTSTATUS NTAPI LdrQueryImageFileKeyOption (_In_ HANDLE KeyHandle, _In_ PCWSTR ValueName, _In_ ULONG Type, _Out_ PVOID Buffer, _In_ ULONG BufferSize, _Out_opt_ PULONG ReturnedLength)
 

Typedef Documentation

◆ PLDR_CALLBACK

typedef VOID(NTAPI * PLDR_CALLBACK) (PVOID CallbackContext, PCHAR Name)

Definition at line 217 of file umfuncs.h.

Function Documentation

◆ DbgBreakPointWithStatus()

◆ DbgUiConnectToDbg()

NTSTATUS NTAPI DbgUiConnectToDbg ( VOID  )

Definition at line 25 of file dbgui.c.

26{
28
29 /* Don't connect twice */
30 if (NtCurrentTeb()->DbgSsReserved[1]) return STATUS_SUCCESS;
31
32 /* Setup the Attributes */
34
35 /* Create the object */
36 return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1],
40}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
NTSYSAPI NTSTATUS NTAPI ZwCreateDebugObject(_Out_ PHANDLE DebugHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ULONG Flags)
#define DEBUG_OBJECT_ALL_ACCESS
Definition: dbgktypes.h:34
#define DBGK_KILL_PROCESS_ON_EXIT
Definition: dbgktypes.h:49
#define NULL
Definition: types.h:112
#define NtCurrentTeb
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by CreateProcessInternalW(), DebugActiveProcess(), and Main().

◆ DbgUiContinue()

NTSTATUS NTAPI DbgUiContinue ( _In_ PCLIENT_ID  ClientId,
_In_ NTSTATUS  ContinueStatus 
)

◆ DbgUiConvertStateChangeStructure()

NTSTATUS NTAPI DbgUiConvertStateChangeStructure ( _In_ PDBGUI_WAIT_STATE_CHANGE  WaitStateChange,
_In_ PVOID  DebugEvent 
)

◆ DbgUiDebugActiveProcess()

NTSTATUS NTAPI DbgUiDebugActiveProcess ( _In_ HANDLE  Process)

◆ DbgUiGetThreadDebugObject()

HANDLE NTAPI DbgUiGetThreadDebugObject ( VOID  )

Definition at line 333 of file dbgui.c.

334{
335 /* Just return the handle from the TEB */
336 return NtCurrentTeb()->DbgSsReserved[1];
337}

Referenced by CreateProcessInternalW(), and DebugSetProcessKillOnExit().

◆ DbgUiIssueRemoteBreakin()

NTSTATUS NTAPI DbgUiIssueRemoteBreakin ( _In_ HANDLE  Process)

◆ DbgUiRemoteBreakin()

VOID NTAPI DbgUiRemoteBreakin ( VOID  )

Definition at line 289 of file dbgui.c.

290{
291 /* Make sure a debugger is enabled; if so, breakpoint */
292 if (NtCurrentPeb()->BeingDebugged) DbgBreakPoint();
293
294 /* Exit the thread */
296}
#define NtCurrentPeb()
Definition: FLS.c:22
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI VOID NTAPI RtlExitUserThread(_In_ NTSTATUS Status)

Referenced by DbgUiIssueRemoteBreakin().

◆ DbgUiStopDebugging()

NTSTATUS NTAPI DbgUiStopDebugging ( _In_ HANDLE  Process)

◆ DbgUiWaitStateChange()

NTSYSAPI NTSTATUS NTAPI DbgUiWaitStateChange ( _In_ PDBGUI_WAIT_STATE_CHANGE  DbgUiWaitStateCange,
_In_ PLARGE_INTEGER  TimeOut 
)

◆ LdrAddRefDll()

NTSTATUS NTAPI LdrAddRefDll ( _In_ ULONG  Flags,
_In_ PVOID  BaseAddress 
)

◆ LdrDisableThreadCalloutsForDll()

NTSTATUS NTAPI LdrDisableThreadCalloutsForDll ( _In_ PVOID  BaseAddress)

◆ LdrFindEntryForAddress()

NTSTATUS NTAPI LdrFindEntryForAddress ( _In_ PVOID  Address,
_Out_ PLDR_DATA_TABLE_ENTRY Module 
)

◆ LdrGetDllHandle()

NTSTATUS NTAPI LdrGetDllHandle ( _In_opt_ PWSTR  DllPath,
_In_ PULONG  DllCharacteristics,
_In_ PUNICODE_STRING  DllName,
_Out_ PVOID DllHandle 
)

◆ LdrGetDllHandleEx()

NTSTATUS NTAPI LdrGetDllHandleEx ( _In_ ULONG  Flags,
_In_opt_ PWSTR  DllPath,
_In_opt_ PULONG  DllCharacteristics,
_In_ PUNICODE_STRING  DllName,
_Out_opt_ PVOID DllHandle 
)

◆ LdrGetProcedureAddress()

NTSTATUS NTAPI LdrGetProcedureAddress ( _In_ PVOID  BaseAddress,
_In_ PANSI_STRING  Name,
_In_ ULONG  Ordinal,
_Out_ PVOID ProcedureAddress 
)

◆ LdrInitializeThunk()

VOID NTAPI LdrInitializeThunk ( ULONG  Unknown1,
ULONG  Unknown2,
ULONG  Unknown3,
ULONG  Unknown4 
)

◆ LdrLoadDll()

NTSTATUS NTAPI LdrLoadDll ( _In_opt_ PWSTR  SearchPath,
_In_opt_ PULONG  LoadFlags,
_In_ PUNICODE_STRING  Name,
_Out_opt_ PVOID BaseAddress 
)

◆ LdrOpenImageFileOptionsKey()

NTSTATUS NTAPI LdrOpenImageFileOptionsKey ( _In_ PUNICODE_STRING  SubKey,
_In_ BOOLEAN  Wow64,
_Out_ PHANDLE  NewKeyHandle 
)

◆ LdrProcessRelocationBlock()

PIMAGE_BASE_RELOCATION NTAPI LdrProcessRelocationBlock ( _In_ ULONG_PTR  Address,
_In_ ULONG  Count,
_In_ PUSHORT  TypeOffset,
_In_ LONG_PTR  Delta 
)

◆ LdrQueryImageFileExecutionOptions()

NTSTATUS NTAPI LdrQueryImageFileExecutionOptions ( _In_ PUNICODE_STRING  SubKey,
_In_ PCWSTR  ValueName,
_In_ ULONG  ValueSize,
_Out_ PVOID  Buffer,
_In_ ULONG  BufferSize,
_Out_opt_ PULONG  RetunedLength 
)

◆ LdrQueryImageFileKeyOption()

NTSTATUS NTAPI LdrQueryImageFileKeyOption ( _In_ HANDLE  KeyHandle,
_In_ PCWSTR  ValueName,
_In_ ULONG  Type,
_Out_ PVOID  Buffer,
_In_ ULONG  BufferSize,
_Out_opt_ PULONG  ReturnedLength 
)

◆ LdrQueryProcessModuleInformation()

NTSTATUS NTAPI LdrQueryProcessModuleInformation ( _In_opt_ PRTL_PROCESS_MODULES  ModuleInformation,
_In_opt_ ULONG  Size,
_Out_ PULONG  ReturnedSize 
)

◆ LdrSetDllManifestProber()

VOID NTAPI LdrSetDllManifestProber ( _In_ PLDR_MANIFEST_PROBER_ROUTINE  Routine)

Definition at line 73 of file ldrapi.c.

75{
77}
PLDR_MANIFEST_PROBER_ROUTINE LdrpManifestProberRoutine
Definition: ldrpe.c:18

Referenced by DllMain().

◆ LdrShutdownProcess()

NTSTATUS NTAPI LdrShutdownProcess ( VOID  )

Definition at line 939 of file ldrinit.c.

940{
942 PLDR_DATA_TABLE_ENTRY LdrEntry;
943 PLIST_ENTRY NextEntry, ListHead;
944 RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED ActCtx;
945 PVOID EntryPoint;
946
947 DPRINT("LdrShutdownProcess() called for %wZ\n", &LdrpImageEntry->BaseDllName);
949
950 /* Tell the Shim Engine */
951 if (g_ShimsEnabled)
952 {
956 }
957
958 /* Tell the world */
959 if (ShowSnaps)
960 {
961 DPRINT1("\n");
962 }
963
964 /* Set the shutdown variables */
965 LdrpShutdownThreadId = NtCurrentTeb()->RealClientId.UniqueThread;
967
968 /* Enter the Loader Lock */
970
971 /* Cleanup trace logging data (Etw) */
972 if (SharedUserData->TraceLogging)
973 {
974 /* FIXME */
975 DPRINT1("We don't support Etw yet.\n");
976 }
977
978 /* Start at the end */
980 NextEntry = ListHead->Blink;
981 while (NextEntry != ListHead)
982 {
983 /* Get the current entry */
984 LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
985 NextEntry = NextEntry->Blink;
986
987 /* Make sure it's not ourselves */
988 if (Peb->ImageBaseAddress != LdrEntry->DllBase)
989 {
990 /* Get the entrypoint */
991 EntryPoint = LdrEntry->EntryPoint;
992
993 /* Check if we are ready to call it */
994 if (EntryPoint &&
995 (LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) &&
996 LdrEntry->Flags)
997 {
998 /* Set up the Act Ctx */
999 ActCtx.Size = sizeof(ActCtx);
1000 ActCtx.Format = 1;
1002
1003 /* Activate the ActCtx */
1005 LdrEntry->EntryPointActivationContext);
1006
1007 _SEH2_TRY
1008 {
1009 /* Check if it has TLS */
1010 if (LdrEntry->TlsIndex)
1011 {
1012 /* Call TLS */
1014 }
1015
1016 /* Call the Entrypoint */
1017 DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
1018 &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
1019 LdrpCallInitRoutine(EntryPoint,
1020 LdrEntry->DllBase,
1022 (PVOID)1);
1023 }
1025 {
1026 DPRINT1("WARNING: Exception 0x%x during LdrpCallInitRoutine(DLL_PROCESS_DETACH) for %wZ\n",
1027 _SEH2_GetExceptionCode(), &LdrEntry->BaseDllName);
1028 }
1029 _SEH2_END;
1030
1031 /* Deactivate the ActCtx */
1033 }
1034 }
1035 }
1036
1037 /* Check for TLS */
1038 if (LdrpImageHasTls)
1039 {
1040 /* Set up the Act Ctx */
1041 ActCtx.Size = sizeof(ActCtx);
1042 ActCtx.Format = 1;
1044
1045 /* Activate the ActCtx */
1048
1049 _SEH2_TRY
1050 {
1051 /* Do TLS callbacks */
1053 }
1055 {
1056 /* Do nothing */
1057 }
1058 _SEH2_END;
1059
1060 /* Deactivate the ActCtx */
1062 }
1063
1064 /* FIXME: Do Heap detection and Etw final shutdown */
1065
1066 /* Release the lock */
1068 DPRINT("LdrpShutdownProcess() done\n");
1069
1070 return STATUS_SUCCESS;
1071}
#define VOID
Definition: acefi.h:82
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_DETACH
Definition: compat.h:130
PPEB Peb
Definition: dllmain.c:27
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PLDR_DATA_TABLE_ENTRY LdrpImageEntry
Definition: ldrinit.c:39
BOOLEAN LdrpShutdownInProgress
Definition: ldrinit.c:34
HANDLE LdrpShutdownThreadId
Definition: ldrinit.c:35
BOOLEAN LdrpImageHasTls
Definition: ldrinit.c:52
BOOLEAN ShowSnaps
Definition: ldrinit.c:81
RTL_CRITICAL_SECTION LdrpLoaderLock
Definition: ldrinit.c:70
_In_ PCWSTR _Out_ PVOID * ActCtx
Definition: ldrtypes.h:247
#define LDRP_PROCESS_ATTACH_CALLED
Definition: ldrtypes.h:49
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
VOID NTAPI LdrpCallTlsInitializers(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN ULONG Reason)
Definition: ldrutils.c:473
PVOID g_pfnSE_ProcessDying
Definition: ldrutils.c:27
BOOLEAN NTAPI LdrpCallInitRoutine(IN PDLL_INIT_ROUTINE EntryPoint, IN PVOID BaseAddress, IN ULONG Reason, IN PVOID Context)
Definition: ldrutils.c:100
BOOLEAN g_ShimsEnabled
Definition: ldrutils.c:21
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define SharedUserData
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlActivateActivationContextUnsafeFast(IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame, IN PVOID Context)
Definition: actctx.c:5934
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlDeactivateActivationContextUnsafeFast(IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame)
Definition: actctx.c:6011
PVOID NTAPI RtlDecodeSystemPointer(IN PVOID Pointer)
Definition: process.c:439
VOID NTAPI SE_ProcessDying(VOID)
Definition: shimeng.c:1441
#define DPRINT
Definition: sndvol32.h:71
Definition: btrfs_drv.h:1876
PACTIVATION_CONTEXT EntryPointActivationContext
Definition: ldrtypes.h:163
PVOID EntryPoint
Definition: ntddk_ex.h:203
PVOID DllBase
Definition: btrfs_drv.h:1880
USHORT TlsIndex
Definition: ntddk_ex.h:209
ULONG Flags
Definition: ntddk_ex.h:207
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
Definition: typedefs.h:120
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
LIST_ENTRY InInitializationOrderModuleList
Definition: ldrtypes.h:122
PPEB_LDR_DATA Ldr
Definition: btrfs_drv.h:1912
PVOID ImageBaseAddress
Definition: ntddk_ex.h:245
#define NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ LdrShutdownThread()

NTSTATUS NTAPI LdrShutdownThread ( VOID  )

Definition at line 1078 of file ldrinit.c.

1079{
1080 PPEB Peb = NtCurrentPeb();
1081 PTEB Teb = NtCurrentTeb();
1082 PLDR_DATA_TABLE_ENTRY LdrEntry;
1083 PLIST_ENTRY NextEntry, ListHead;
1084 RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED ActCtx;
1085 PVOID EntryPoint;
1086
1087 DPRINT("LdrShutdownThread() called for %wZ\n",
1089
1090 /* Cleanup trace logging data (Etw) */
1091 if (SharedUserData->TraceLogging)
1092 {
1093 /* FIXME */
1094 DPRINT1("We don't support Etw yet.\n");
1095 }
1096
1097 /* Get the Ldr Lock */
1099
1100 /* Start at the end */
1102 NextEntry = ListHead->Blink;
1103 while (NextEntry != ListHead)
1104 {
1105 /* Get the current entry */
1106 LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
1107 NextEntry = NextEntry->Blink;
1108
1109 /* Make sure it's not ourselves */
1110 if (Peb->ImageBaseAddress != LdrEntry->DllBase)
1111 {
1112 /* Check if we should call */
1113 if (!(LdrEntry->Flags & LDRP_DONT_CALL_FOR_THREADS) &&
1114 (LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) &&
1115 (LdrEntry->Flags & LDRP_IMAGE_DLL))
1116 {
1117 /* Get the entrypoint */
1118 EntryPoint = LdrEntry->EntryPoint;
1119
1120 /* Check if we are ready to call it */
1121 if (EntryPoint)
1122 {
1123 /* Set up the Act Ctx */
1124 ActCtx.Size = sizeof(ActCtx);
1125 ActCtx.Format = 1;
1127
1128 /* Activate the ActCtx */
1130 LdrEntry->EntryPointActivationContext);
1131
1132 _SEH2_TRY
1133 {
1134 /* Check if it has TLS */
1135 if (LdrEntry->TlsIndex)
1136 {
1137 /* Make sure we're not shutting down */
1139 {
1140 /* Call TLS */
1142 }
1143 }
1144
1145 /* Make sure we're not shutting down */
1147 {
1148 /* Call the Entrypoint */
1149 DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
1150 &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
1151 LdrpCallInitRoutine(EntryPoint,
1152 LdrEntry->DllBase,
1154 NULL);
1155 }
1156 }
1158 {
1159 DPRINT1("WARNING: Exception 0x%x during LdrpCallInitRoutine(DLL_THREAD_DETACH) for %wZ\n",
1160 _SEH2_GetExceptionCode(), &LdrEntry->BaseDllName);
1161 }
1162 _SEH2_END;
1163
1164 /* Deactivate the ActCtx */
1166 }
1167 }
1168 }
1169 }
1170
1171 /* Check for TLS */
1172 if (LdrpImageHasTls)
1173 {
1174 /* Set up the Act Ctx */
1175 ActCtx.Size = sizeof(ActCtx);
1176 ActCtx.Format = 1;
1178
1179 /* Activate the ActCtx */
1182
1183 _SEH2_TRY
1184 {
1185 /* Do TLS callbacks */
1187 }
1189 {
1190 /* Do nothing */
1191 }
1192 _SEH2_END;
1193
1194 /* Deactivate the ActCtx */
1196 }
1197
1198 /* Free TLS */
1199 LdrpFreeTls();
1201
1202 /* Check for expansion slots */
1203 if (Teb->TlsExpansionSlots)
1204 {
1205 /* Free expansion slots */
1206 RtlFreeHeap(RtlGetProcessHeap(), 0, Teb->TlsExpansionSlots);
1207 }
1208
1209 /* Check for FLS Data */
1210 if (Teb->FlsData)
1211 {
1212 /* Mimic BaseRundownFls */
1213 ULONG n, FlsHighIndex;
1214 PRTL_FLS_DATA pFlsData;
1215 PFLS_CALLBACK_FUNCTION lpCallback;
1216
1217 pFlsData = Teb->FlsData;
1218
1220 FlsHighIndex = NtCurrentPeb()->FlsHighIndex;
1221 RemoveEntryList(&pFlsData->ListEntry);
1223
1224 for (n = 1; n <= FlsHighIndex; ++n)
1225 {
1226 lpCallback = NtCurrentPeb()->FlsCallback[n];
1227 if (lpCallback && pFlsData->Data[n])
1228 {
1229 lpCallback(pFlsData->Data[n]);
1230 }
1231 }
1232
1233 RtlFreeHeap(RtlGetProcessHeap(), 0, pFlsData);
1234 Teb->FlsData = NULL;
1235 }
1236
1237 /* Check for Fiber data */
1238 if (Teb->HasFiberData)
1239 {
1240 /* Free Fiber data*/
1241 RtlFreeHeap(RtlGetProcessHeap(), 0, Teb->NtTib.FiberData);
1242 Teb->NtTib.FiberData = NULL;
1243 }
1244
1245 /* Free the activation context stack */
1247 DPRINT("LdrShutdownThread() done\n");
1248
1249 return STATUS_SUCCESS;
1250}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
GLdouble n
Definition: glext.h:7729
NTSYSAPI void WINAPI RtlReleasePebLock(void)
Definition: libsupp.c:82
NTSYSAPI void WINAPI RtlAcquirePebLock(void)
Definition: libsupp.c:72
NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void)
Definition: actctx.c:5472
VOID NTAPI LdrpFreeTls(VOID)
Definition: ldrinit.c:1380
#define LDRP_DONT_CALL_FOR_THREADS
Definition: ldrtypes.h:48
#define LDRP_IMAGE_DLL
Definition: ldrtypes.h:39
PVOID FiberData
Definition: compat.h:716
LIST_ENTRY ListEntry
Definition: rtltypes.h:1223
PVOID Data[RTL_FLS_MAXIMUM_AVAILABLE]
Definition: rtltypes.h:1224
Definition: compat.h:836
PVOID * TlsExpansionSlots
Definition: compat.h:894
NT_TIB NtTib
Definition: ntddk_ex.h:332
uint32_t ULONG
Definition: typedefs.h:59
VOID(WINAPI * PFLS_CALLBACK_FUNCTION)(PVOID)
Definition: winbase.h:1432

◆ LdrUnloadDll()

NTSTATUS NTAPI LdrUnloadDll ( _In_ PVOID  BaseAddress)

◆ LdrVerifyImageMatchesChecksum()

NTSTATUS NTAPI LdrVerifyImageMatchesChecksum ( _In_ HANDLE  FileHandle,
_In_ PLDR_CALLBACK  Callback,
_In_ PVOID  CallbackContext,
_Out_ PUSHORT  ImageCharacterstics 
)