From d46dfe99e53e7f587f54a28c702d11199ccf3a20 Mon Sep 17 00:00:00 2001 From: eric_tian Date: Thu, 16 Apr 2009 02:43:41 +0000 Subject: [PATCH] remove the gEfiLoadPeImageProtocolGuid and replace all references for it with BasePeCoffLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8095 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DxeSmmDriverEntryPoint/DriverEntryPoint.c | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c index ed3d2c667a..afa09e75a6 100644 --- a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c +++ b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c @@ -174,16 +174,6 @@ _ModuleEntryPoint ( // gBS = SystemTable->BootServices; - // - // Retrieve the Loaded Image Protocol - // - Status = gBS->HandleProtocol ( - ImageHandle, - &gEfiLoadedImageProtocolGuid, - (VOID*)&LoadedImage - ); - ASSERT_EFI_ERROR (Status); - // // Retrieve SMM Base Protocol // @@ -203,6 +193,15 @@ _ModuleEntryPoint ( // // if (!InSmm) { + // + // Retrieve the Loaded Image Protocol + // + Status = gBS->HandleProtocol ( + ImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID*)&LoadedImage + ); + ASSERT_EFI_ERROR (Status); // // Retrieve the Device Path Protocol from the DeviceHandle from which this driver was loaded // @@ -222,8 +221,21 @@ _ModuleEntryPoint ( // Load the image in memory to SMRAM; it will automatically generate the // SMI. // - Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE); + Status = SmmBase->Register (SmmBase, CompleteFilePath, LoadedImage->ImageBase, 0, &Handle, FALSE); ASSERT_EFI_ERROR (Status); + // + // Optionally install the unload handler + // + if (_gDriverUnloadImageCount > 0) { + Status = gBS->HandleProtocol ( + ImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID **)&LoadedImage + ); + ASSERT_EFI_ERROR (Status); + LoadedImage->Unload = _DriverUnloadHandler; + } + return Status; } @@ -232,19 +244,6 @@ _ModuleEntryPoint ( // ProcessLibraryConstructorList (ImageHandle, SystemTable); - // - // Optionally install the unload handler - // - if (_gDriverUnloadImageCount > 0) { - Status = gBS->HandleProtocol ( - ImageHandle, - &gEfiLoadedImageProtocolGuid, - (VOID **)&LoadedImage - ); - ASSERT_EFI_ERROR (Status); - LoadedImage->Unload = _DriverUnloadHandler; - } - // // Call the list of driver entry points // -- 2.39.2