Change DxeNt32PeCoffExtraActionLib to not depend on the library constructor to initialize mWinNt pointer because DxeCore calls the library API before it calls the constructor.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10776 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu 2010-08-06 01:20:17 +00:00
parent 21ff163c8c
commit 1a2ae0f71f
2 changed files with 6 additions and 12 deletions

View File

@ -68,12 +68,11 @@ UINTN mPdbNameModHandleArraySize = 0;
**/
EFI_STATUS
EFIAPI
DxeNt32PeCoffLibExtraActionConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
Nt32PeCoffGetWinNtThunkStucture (
VOID
)
{
EFI_HOB_GUID_TYPE *GuidHob;
EFI_HOB_GUID_TYPE *GuidHob;
//
// Retrieve WinNtThunkProtocol from GUID'ed HOB
@ -284,10 +283,10 @@ PeCoffLoaderRelocateImageExtraAction (
ASSERT (ImageContext != NULL);
if (mWinNt == NULL) {
return;
Nt32PeCoffGetWinNtThunkStucture ();
}
//
//
// If we load our own PE COFF images the Windows debugger can not source
// level debug our code. If a valid PDB pointer exists usw it to load
// the *.dll file as a library using Windows* APIs. This allows
@ -397,12 +396,9 @@ PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
VOID *ModHandle;
VOID *ModHandle;
ASSERT (ImageContext != NULL);
if (mWinNt == NULL) {
return;
}
ModHandle = RemoveModeHandle (ImageContext);
if (ModHandle != NULL) {

View File

@ -23,8 +23,6 @@
VERSION_STRING = 1.0
LIBRARY_CLASS = PeCoffExtraActionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER
CONSTRUCTOR = DxeNt32PeCoffLibExtraActionConstructor
#
# The following information is for reference only and not required by the build tools.
#