RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrEntry->EntryPointActivationContext);
- /* Check if it has TLS */
- if (LdrEntry->TlsIndex)
+ _SEH2_TRY
{
+ /* Check if it has TLS */
+ if (LdrEntry->TlsIndex)
+ {
+ /* Make sure we're not shutting down */
+ if (!LdrpShutdownInProgress)
+ {
+ /* Call TLS */
+ LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_THREAD_ATTACH);
+ }
+ }
+
/* Make sure we're not shutting down */
if (!LdrpShutdownInProgress)
{
- /* Call TLS */
- LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_THREAD_ATTACH);
+ /* Call the Entrypoint */
+ DPRINT("%wZ - Calling entry point at %p for thread attaching, %p/%p\n",
+ &LdrEntry->BaseDllName, LdrEntry->EntryPoint,
+ NtCurrentTeb()->RealClientId.UniqueProcess,
+ NtCurrentTeb()->RealClientId.UniqueThread);
+ LdrpCallInitRoutine(LdrEntry->EntryPoint,
+ LdrEntry->DllBase,
+ DLL_THREAD_ATTACH,
+ NULL);
}
}
-
- /* Make sure we're not shutting down */
- if (!LdrpShutdownInProgress)
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- /* Call the Entrypoint */
- DPRINT("%wZ - Calling entry point at %p for thread attaching, %p/%p\n",
- &LdrEntry->BaseDllName, LdrEntry->EntryPoint,
- NtCurrentTeb()->RealClientId.UniqueProcess,
- NtCurrentTeb()->RealClientId.UniqueThread);
- LdrpCallInitRoutine(LdrEntry->EntryPoint,
- LdrEntry->DllBase,
- DLL_THREAD_ATTACH,
- NULL);
+ /* Do nothing */
}
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrpImageEntry->EntryPointActivationContext);
- /* Do TLS callbacks */
- LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_THREAD_ATTACH);
+ _SEH2_TRY
+ {
+ /* Do TLS callbacks */
+ LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_THREAD_ATTACH);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrEntry->EntryPointActivationContext);
- /* Check if it has TLS */
- if (LdrEntry->TlsIndex && Context)
+ _SEH2_TRY
{
- /* Call TLS */
- LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_PROCESS_ATTACH);
- }
+ /* Check if it has TLS */
+ if (LdrEntry->TlsIndex && Context)
+ {
+ /* Call TLS */
+ LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_PROCESS_ATTACH);
+ }
- /* Call the Entrypoint */
- if (ShowSnaps)
+ /* Call the Entrypoint */
+ if (ShowSnaps)
+ {
+ DPRINT1("%wZ - Calling entry point at %p for DLL_PROCESS_ATTACH\n",
+ &LdrEntry->BaseDllName, EntryPoint);
+ }
+ DllStatus = LdrpCallInitRoutine(EntryPoint,
+ LdrEntry->DllBase,
+ DLL_PROCESS_ATTACH,
+ Context);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- DPRINT1("%wZ - Calling entry point at %p for DLL_PROCESS_ATTACH\n",
- &LdrEntry->BaseDllName, EntryPoint);
+ DllStatus = FALSE;
}
- DllStatus = LdrpCallInitRoutine(EntryPoint,
- LdrEntry->DllBase,
- DLL_PROCESS_ATTACH,
- Context);
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrpImageEntry->EntryPointActivationContext);
- /* Do TLS callbacks */
- LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_PROCESS_ATTACH);
+ _SEH2_TRY
+ {
+ /* Do TLS callbacks */
+ LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_PROCESS_ATTACH);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrEntry->EntryPointActivationContext);
- /* Check if it has TLS */
- if (LdrEntry->TlsIndex)
+ _SEH2_TRY
{
- /* Call TLS */
- LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_PROCESS_DETACH);
- }
+ /* Check if it has TLS */
+ if (LdrEntry->TlsIndex)
+ {
+ /* Call TLS */
+ LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_PROCESS_DETACH);
+ }
- /* Call the Entrypoint */
- DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
- &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
- LdrpCallInitRoutine(EntryPoint,
- LdrEntry->DllBase,
- DLL_PROCESS_DETACH,
- (PVOID)1);
+ /* Call the Entrypoint */
+ DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
+ &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
+ LdrpCallInitRoutine(EntryPoint,
+ LdrEntry->DllBase,
+ DLL_PROCESS_DETACH,
+ (PVOID)1);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrpImageEntry->EntryPointActivationContext);
- /* Do TLS callbacks */
- LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_PROCESS_DETACH);
+ _SEH2_TRY
+ {
+ /* Do TLS callbacks */
+ LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_PROCESS_DETACH);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrEntry->EntryPointActivationContext);
- /* Check if it has TLS */
- if (LdrEntry->TlsIndex)
+ _SEH2_TRY
{
+ /* Check if it has TLS */
+ if (LdrEntry->TlsIndex)
+ {
+ /* Make sure we're not shutting down */
+ if (!LdrpShutdownInProgress)
+ {
+ /* Call TLS */
+ LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_THREAD_DETACH);
+ }
+ }
+
/* Make sure we're not shutting down */
if (!LdrpShutdownInProgress)
{
- /* Call TLS */
- LdrpCallTlsInitializers(LdrEntry->DllBase, DLL_THREAD_DETACH);
+ /* Call the Entrypoint */
+ DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
+ &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
+ LdrpCallInitRoutine(EntryPoint,
+ LdrEntry->DllBase,
+ DLL_THREAD_DETACH,
+ NULL);
}
}
-
- /* Make sure we're not shutting down */
- if (!LdrpShutdownInProgress)
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- /* Call the Entrypoint */
- DPRINT("%wZ - Calling entry point at %p for thread detaching\n",
- &LdrEntry->BaseDllName, LdrEntry->EntryPoint);
- LdrpCallInitRoutine(EntryPoint,
- LdrEntry->DllBase,
- DLL_THREAD_DETACH,
- NULL);
+ /* Do nothing */
}
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);
RtlActivateActivationContextUnsafeFast(&ActCtx,
LdrpImageEntry->EntryPointActivationContext);
- /* Do TLS callbacks */
- LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_THREAD_DETACH);
+ _SEH2_TRY
+ {
+ /* Do TLS callbacks */
+ LdrpCallTlsInitializers(Peb->ImageBaseAddress, DLL_THREAD_DETACH);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
/* Deactivate the ActCtx */
RtlDeactivateActivationContextUnsafeFast(&ActCtx);