mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 16:51:23 +00:00
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:
parent
a6e430f084
commit
7bef6e865e
1 changed files with 7 additions and 1 deletions
|
@ -1329,12 +1329,18 @@ LdrpGetOrLoadModule(PWCHAR SerachPath,
|
||||||
PLDR_DATA_TABLE_ENTRY* Module,
|
PLDR_DATA_TABLE_ENTRY* Module,
|
||||||
BOOLEAN Load)
|
BOOLEAN Load)
|
||||||
{
|
{
|
||||||
|
ANSI_STRING AnsiDllName;
|
||||||
UNICODE_STRING DllName;
|
UNICODE_STRING DllName;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("LdrpGetOrLoadModule() called for %s\n", Name);
|
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);
|
Status = LdrFindEntryForName (&DllName, Module, Load);
|
||||||
if (Load && !NT_SUCCESS(Status))
|
if (Load && !NT_SUCCESS(Status))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue