mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
dll name comparison in LdrFindDll() must be case-insensitive
svn path=/trunk/; revision=842
This commit is contained in:
parent
ec235d7468
commit
5d99e9003a
1 changed files with 40 additions and 55 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: utils.c,v 1.17 1999/11/25 10:47:56 dwelch Exp $
|
||||
/* $Id: utils.c,v 1.18 1999/12/09 19:14:45 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -78,11 +78,9 @@ NTSTATUS LdrLoadDll (PDLL* Dll,
|
|||
HANDLE SectionHandle;
|
||||
PDLLMAIN_FUNC Entrypoint;
|
||||
|
||||
|
||||
if ( Dll == NULL )
|
||||
return -1;
|
||||
|
||||
|
||||
if ( Name == NULL ) {
|
||||
*Dll = &LdrDllListHead;
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -90,8 +88,6 @@ NTSTATUS LdrLoadDll (PDLL* Dll,
|
|||
|
||||
DPRINT("LdrLoadDll(Base %x, Name \"%s\")\n", Dll, Name);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Build the DLL's absolute name
|
||||
*/
|
||||
|
@ -234,7 +230,7 @@ NTSTATUS LdrLoadDll (PDLL* Dll,
|
|||
);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
dprintf("NTDLL.LDR: map view of section failed (Status %x)",
|
||||
dprintf("NTDLL.LDR: map view of section failed (Status %x)\n",
|
||||
Status);
|
||||
ZwClose(FileHandle);
|
||||
return(Status);
|
||||
|
@ -339,7 +335,7 @@ static NTSTATUS LdrFindDll(PDLL* Dll, PCHAR Name)
|
|||
DPRINT("Scanning %s %s\n",
|
||||
ExportDir->Name + current->BaseAddress, Name);
|
||||
|
||||
if (strcmp(ExportDir->Name + current->BaseAddress, Name) == 0)
|
||||
if (_stricmp(ExportDir->Name + current->BaseAddress, Name) == 0)
|
||||
{
|
||||
*Dll = current;
|
||||
current->ReferenceCount++;
|
||||
|
@ -903,7 +899,7 @@ NTSTATUS LdrUnloadDll(PDLL Dll)
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if ( Dll->Headers->FileHeader.Characteristics & IMAGE_FILE_DLL == IMAGE_FILE_DLL ) {
|
||||
if (( Dll->Headers->FileHeader.Characteristics & IMAGE_FILE_DLL ) == IMAGE_FILE_DLL ) {
|
||||
|
||||
Entrypoint = (PDLLMAIN_FUNC) LdrPEStartup(Dll->BaseAddress,
|
||||
Dll->SectionHandle);
|
||||
|
@ -1049,10 +1045,6 @@ NTSTATUS LdrFindResource_U(DLL *Dll, IMAGE_RESOURCE_DATA_ENTRY **ResourceDataEnt
|
|||
|
||||
NTSTATUS LdrAccessResource(DLL *Dll, IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry, void **Data)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
PIMAGE_SECTION_HEADER Sections;
|
||||
int i;
|
||||
|
||||
|
@ -1065,7 +1057,6 @@ NTSTATUS LdrAccessResource(DLL *Dll, IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntr
|
|||
if ( Dll == NULL )
|
||||
return -1;
|
||||
|
||||
|
||||
Sections = (PIMAGE_SECTION_HEADER) SECHDROFFSET(Dll->BaseAddress);
|
||||
|
||||
for ( i = 0;
|
||||
|
@ -1073,27 +1064,21 @@ NTSTATUS LdrAccessResource(DLL *Dll, IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntr
|
|||
i++
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
if (Sections[i].VirtualAddress <= ResourceDataEntry->OffsetToData
|
||||
&& Sections[i].VirtualAddress + Sections[i].Misc.VirtualSize > ResourceDataEntry->OffsetToData )
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( i == Dll->Headers->FileHeader.NumberOfSections ) {
|
||||
*Data = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
*Data = (void *)(((ULONG)Dll->BaseAddress + ResourceDataEntry->OffsetToData - (ULONG)Sections[i].VirtualAddress) +
|
||||
(ULONG)Sections[i].PointerToRawData);
|
||||
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue