Author: fireball
Date: Thu Apr 16 17:44:59 2009
New Revision: 40542
URL:
http://svn.reactos.org/svn/reactos?rev=40542&view=rev
Log:
- Use a common exit point from a function, and thus fix two returns from a seh block not
wrapped into _SEH2_YIELD.
- Fixes a crash in Downloader app and in numerous other applications.
Modified:
trunk/reactos/dll/ntdll/ldr/utils.c
Modified: trunk/reactos/dll/ntdll/ldr/utils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Thu Apr 16 17:44:59 2009
@@ -2474,6 +2474,7 @@
IN ULONG Ordinal,
OUT PVOID *ProcedureAddress)
{
+ NTSTATUS Status = STATUS_PROCEDURE_NOT_FOUND;
if (Name && Name->Length)
{
TRACE_LDR("LdrGetProcedureAddress by NAME - %Z\n", Name);
@@ -2494,7 +2495,7 @@
*ProcedureAddress = LdrGetExportByName(BaseAddress, (PUCHAR)Name->Buffer,
0xffff);
if (*ProcedureAddress != NULL)
{
- return STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
}
DPRINT("LdrGetProcedureAddress: Can't resolve symbol
'%Z'\n", Name);
}
@@ -2505,17 +2506,18 @@
*ProcedureAddress = LdrGetExportByOrdinal(BaseAddress, (WORD)Ordinal);
if (*ProcedureAddress)
{
- return STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
}
DPRINT("LdrGetProcedureAddress: Can't resolve symbol @%lu\n",
Ordinal);
}
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- _SEH2_YIELD(return STATUS_DLL_NOT_FOUND);
+ Status = STATUS_DLL_NOT_FOUND;
}
_SEH2_END;
- return STATUS_PROCEDURE_NOT_FOUND;
+
+ return Status;
}
/**********************************************************************