mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[WIN32K]
Improve LDEVOBJ_bLoadImage, use ExportSectionPointer from the GdiDriverInfo structure instead of calling RtlImageDirectoryEntryToData svn path=/trunk/; revision=50260
This commit is contained in:
parent
ebef3b756c
commit
a29fc23779
1 changed files with 10 additions and 7 deletions
|
@ -31,6 +31,8 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
InitLDEVImpl()
|
InitLDEVImpl()
|
||||||
{
|
{
|
||||||
|
ULONG cbSize;
|
||||||
|
|
||||||
/* Initialize the loader lock */
|
/* Initialize the loader lock */
|
||||||
ghsemLDEVList = EngCreateSemaphore();
|
ghsemLDEVList = EngCreateSemaphore();
|
||||||
if (!ghsemLDEVList)
|
if (!ghsemLDEVList)
|
||||||
|
@ -60,7 +62,11 @@ InitLDEVImpl()
|
||||||
gpldevWin32k->pGdiDriverInfo->ImageAddress = &__ImageBase;
|
gpldevWin32k->pGdiDriverInfo->ImageAddress = &__ImageBase;
|
||||||
gpldevWin32k->pGdiDriverInfo->SectionPointer = NULL;
|
gpldevWin32k->pGdiDriverInfo->SectionPointer = NULL;
|
||||||
gpldevWin32k->pGdiDriverInfo->EntryPoint = (PVOID)DriverEntry;
|
gpldevWin32k->pGdiDriverInfo->EntryPoint = (PVOID)DriverEntry;
|
||||||
gpldevWin32k->pGdiDriverInfo->ExportSectionPointer = NULL;
|
gpldevWin32k->pGdiDriverInfo->ExportSectionPointer =
|
||||||
|
RtlImageDirectoryEntryToData(&__ImageBase,
|
||||||
|
TRUE,
|
||||||
|
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
||||||
|
&cbSize);
|
||||||
gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME;
|
gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -182,7 +188,7 @@ LDEVOBJ_bLoadImage(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to load a GDI driver: '%S', Status = 0x%lx\n",
|
DPRINT1("Failed to load a GDI driver: '%S', Status = 0x%lx\n",
|
||||||
pstrPathName->Buffer, Status);
|
pstrPathName->Buffer, Status);
|
||||||
|
|
||||||
/* Free the allocated memory */
|
/* Free the allocated memory */
|
||||||
|
@ -277,17 +283,14 @@ LDEVOBJ_pvFindImageProcAddress(
|
||||||
PVOID pvProcAdress = NULL;
|
PVOID pvProcAdress = NULL;
|
||||||
PUSHORT pOrdinals;
|
PUSHORT pOrdinals;
|
||||||
PULONG pNames, pAddresses;
|
PULONG pNames, pAddresses;
|
||||||
ULONG i, cbSize;
|
ULONG i;
|
||||||
|
|
||||||
/* Make sure we have a driver info */
|
/* Make sure we have a driver info */
|
||||||
ASSERT(pldev && pldev->pGdiDriverInfo != NULL);
|
ASSERT(pldev && pldev->pGdiDriverInfo != NULL);
|
||||||
|
|
||||||
/* Get the pointer to the export directory */
|
/* Get the pointer to the export directory */
|
||||||
pvImageBase = pldev->pGdiDriverInfo->ImageAddress;
|
pvImageBase = pldev->pGdiDriverInfo->ImageAddress;
|
||||||
pExportDir = RtlImageDirectoryEntryToData(pvImageBase,
|
pExportDir = pldev->pGdiDriverInfo->ExportSectionPointer;
|
||||||
TRUE,
|
|
||||||
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
|
||||||
&cbSize);
|
|
||||||
if (!pExportDir)
|
if (!pExportDir)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue