mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 07:05:12 +00:00
Send correct data to MiDereferenceImports()
svn path=/trunk/; revision=31015
This commit is contained in:
parent
155a5c8344
commit
e3876e7f3c
|
@ -177,15 +177,23 @@ NTSTATUS
|
|||
NTAPI
|
||||
MiDereferenceImports(IN PLOAD_IMPORTS ImportList)
|
||||
{
|
||||
SIZE_T i;
|
||||
|
||||
/* Check if there's no imports or if we're a boot driver */
|
||||
if ((ImportList == (PVOID)-1) || (ImportList == (PVOID)-2))
|
||||
if ((ImportList == (PVOID)-1) ||
|
||||
(ImportList == (PVOID)-2) ||
|
||||
(ImportList->Count == 0))
|
||||
{
|
||||
/* Then there's nothing to do */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Otherwise, FIXME */
|
||||
DPRINT1("Imports not dereferenced!\n");
|
||||
DPRINT1("%u imports not dereferenced!\n", ImportList->Count);
|
||||
for (i = 0; i < ImportList->Count; i++)
|
||||
{
|
||||
DPRINT1("%wZ <%wZ>\n", &ImportList->Entry[i]->FullDllName, &ImportList->Entry[i]->BaseDllName);
|
||||
}
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
|
@ -813,9 +821,8 @@ MiResolveImageReferences(IN PVOID ImageBase,
|
|||
TAG_LDR_WSTR);
|
||||
if (LoadedImports)
|
||||
{
|
||||
/* Zero it and set the count */
|
||||
/* Zero it */
|
||||
RtlZeroMemory(LoadedImports, LoadedImportsSize);
|
||||
LoadedImports->Count = ImportCount;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1006,8 +1013,8 @@ CheckDllState:
|
|||
if (!(LdrEntry->Flags & LDRP_LOAD_IN_PROGRESS))
|
||||
{
|
||||
/* Add the entry */
|
||||
LoadedImports->Entry[ImportCount] = LdrEntry;
|
||||
ImportCount++;
|
||||
LoadedImports->Entry[LoadedImports->Count] = LdrEntry;
|
||||
LoadedImports->Count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1104,17 +1111,17 @@ CheckDllState:
|
|||
if (NewImports)
|
||||
{
|
||||
/* Set count */
|
||||
NewImports->Count = ImportCount;
|
||||
NewImports->Count = 0;
|
||||
|
||||
/* Loop all the imports */
|
||||
for (i = 0, ImportCount = 0; i < LoadedImports->Count; i++)
|
||||
for (i = 0; i < LoadedImports->Count; i++)
|
||||
{
|
||||
/* Make sure it's valid */
|
||||
if (LoadedImports->Entry[i])
|
||||
{
|
||||
/* Copy it */
|
||||
NewImports->Entry[i] = LoadedImports->Entry[i];
|
||||
ImportCount++;
|
||||
NewImports->Entry[NewImports->Count] = LoadedImports->Entry[i];
|
||||
NewImports->Count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue