X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=blobdiff_plain;f=ntoskrnl%2Fldr%2Fsysdll.c;h=58ecd32b3a1ea4f771995df4e3b6c52141ef300f;hp=11a8fa65b8afbe1b05f5ce534c3232737a908b36;hb=HEAD;hpb=7c0db166f81fbe8c8b913d7f26048e337d383605 diff --git a/ntoskrnl/ldr/sysdll.c b/ntoskrnl/ldr/sysdll.c index 11a8fa6..58ecd32 100644 --- a/ntoskrnl/ldr/sysdll.c +++ b/ntoskrnl/ldr/sysdll.c @@ -7,6 +7,7 @@ * Rex Jolliff (rex@lvcablemodem.com) * UPDATE HISTORY: * DW 26/01/00 Created + * Skywing 09/11/2003 Added support for KiRaiseUserExceptionDispatcher */ /* INCLUDES *****************************************************************/ @@ -27,6 +28,7 @@ static PVOID SystemDllEntryPoint = NULL; static PVOID SystemDllApcDispatcher = NULL; static PVOID SystemDllCallbackDispatcher = NULL; static PVOID SystemDllExceptionDispatcher = NULL; +static PVOID SystemDllRaiseExceptionDispatcher = NULL; /* FUNCTIONS *****************************************************************/ @@ -50,6 +52,11 @@ PVOID LdrpGetSystemDllApcDispatcher(VOID) return(SystemDllApcDispatcher); } +PVOID LdrpGetSystemDllRaiseExceptionDispatcher(VOID) +{ + return(SystemDllRaiseExceptionDispatcher); +} + NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, PVOID* LdrStartupAddr) /* @@ -276,6 +283,27 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, return (Status); } } + + /* + * Retrieve the offset of the raise exception dispatcher from NTDLL + */ + if (SystemDllRaiseExceptionDispatcher == NULL) + { + RtlInitAnsiString (&ProcedureName, + "KiRaiseUserExceptionDispatcher"); + Status = LdrGetProcedureAddress ((PVOID)ImageBase, + &ProcedureName, + 0, + &SystemDllRaiseExceptionDispatcher); + if (!NT_SUCCESS(Status)) + { + DbgPrint ("LdrGetProcedureAddress failed (Status %x)\n", Status); + KeDetachProcess(); + ObDereferenceObject(Process); + ZwClose(NTDllSectionHandle); + return (Status); + } + } KeDetachProcess(); ObDereferenceObject(Process);