diff --git a/subsystems/win32/csrsrv/server.c b/subsystems/win32/csrsrv/server.c index c161bb4166b..4fa35367927 100644 --- a/subsystems/win32/csrsrv/server.c +++ b/subsystems/win32/csrsrv/server.c @@ -205,6 +205,9 @@ CsrLoadServerDll(IN PCHAR DllString, else { /* No handle, so we are loading ourselves */ +#ifdef CSR_DBG + RtlInitAnsiString(&EntryPointString, "CsrServerDllInitialization"); +#endif ServerDllInitProcedure = CsrServerDllInitialization; Status = STATUS_SUCCESS; } @@ -212,8 +215,21 @@ CsrLoadServerDll(IN PCHAR DllString, /* Check if we got the pointer, and call it */ if (NT_SUCCESS(Status)) { - /* Get the result from the Server DLL */ - Status = ServerDllInitProcedure(ServerDll); + /* Call the Server DLL entrypoint */ + _SEH2_TRY + { + Status = ServerDllInitProcedure(ServerDll); + } + _SEH2_EXCEPT(CsrUnhandledExceptionFilter(_SEH2_GetExceptionInformation())) + { + Status = _SEH2_GetExceptionCode(); +#ifdef CSR_DBG + DPRINT1("CSRSS: Exception 0x%lx while calling Server DLL entrypoint %Z!%Z()\n", + Status, &DllName, &EntryPointString); +#endif + } + _SEH2_END; + if (NT_SUCCESS(Status)) { /*