Check result of ANSI -> Unicode conversion, which can fail in the case of

memory shortage.

svn path=/trunk/; revision=26741
This commit is contained in:
Dmitry Gorbachev 2007-05-12 22:54:58 +00:00
parent a6e430f084
commit 7bef6e865e

View file

@ -1329,12 +1329,18 @@ LdrpGetOrLoadModule(PWCHAR SerachPath,
PLDR_DATA_TABLE_ENTRY* Module,
BOOLEAN Load)
{
ANSI_STRING AnsiDllName;
UNICODE_STRING DllName;
NTSTATUS Status;
DPRINT("LdrpGetOrLoadModule() called for %s\n", Name);
RtlCreateUnicodeStringFromAsciiz (&DllName, Name);
RtlInitAnsiString(&AnsiDllName, Name);
Status = RtlAnsiStringToUnicodeString(&DllName, &AnsiDllName, TRUE);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = LdrFindEntryForName (&DllName, Module, Load);
if (Load && !NT_SUCCESS(Status))