mirror of https://github.com/acidanthera/audk.git
Sync with PE/COFF Extra Action library class comments and add ASSERT() conditions if ImageContext is NULL.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8273 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
727fb9b1d3
commit
51f1a2b5b8
|
@ -250,15 +250,14 @@ RemoveModeHandle (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Applies additional actions to relocate fixups to a PE/COFF image.
|
Performs additional actions after a PE/COFF image has been loaded and relocated.
|
||||||
|
|
||||||
Generally this function is called after sucessfully Applying relocation fixups
|
For NT32, this function load symbols to support source level debugging.
|
||||||
to a PE/COFF image for some specicial purpose.
|
|
||||||
As a example, For NT32 emulator, the function should be implemented and called
|
|
||||||
to support source level debug.
|
|
||||||
|
|
||||||
@param ImageContext Pointer to the image context structure that describes the PE/COFF
|
If ImageContext is NULL, then ASSERT().
|
||||||
image that is being relocated.
|
|
||||||
|
@param ImageContext Pointer to the image context structure that describes the
|
||||||
|
PE/COFF image that has already been loaded and relocated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -272,6 +271,8 @@ PeCoffLoaderRelocateImageExtraAction (
|
||||||
HMODULE Library;
|
HMODULE Library;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
|
ASSERT (ImageContext != NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// If we load our own PE COFF images the Windows debugger can not source
|
// 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
|
// level debug our code. If a valid PDB pointer exists usw it to load
|
||||||
|
@ -351,17 +352,15 @@ PeCoffLoaderRelocateImageExtraAction (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Unloads a loaded PE/COFF image from memory and releases its taken resource.
|
Performs additional actions just before a PE/COFF image is unloaded. Any resources
|
||||||
|
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
|
||||||
|
|
||||||
Releases any environment specific resources that were allocated when the image
|
For NT32, this function unloads symbols for source level debugging.
|
||||||
specified by ImageContext was loaded using PeCoffLoaderLoadImage().
|
|
||||||
For NT32 emulator, the PE/COFF image loaded by system needs to release.
|
|
||||||
For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
|
|
||||||
|
|
||||||
If ImageContext is NULL, then ASSERT().
|
If ImageContext is NULL, then ASSERT().
|
||||||
|
|
||||||
@param ImageContext Pointer to the image context structure that describes the PE/COFF
|
@param ImageContext Pointer to the image context structure that describes the
|
||||||
image to be unloaded.
|
PE/COFF image that is being unloaded.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -372,6 +371,8 @@ PeCoffLoaderUnloadImageExtraAction (
|
||||||
{
|
{
|
||||||
VOID *ModHandle;
|
VOID *ModHandle;
|
||||||
|
|
||||||
|
ASSERT (ImageContext != NULL);
|
||||||
|
|
||||||
ModHandle = RemoveModeHandle (ImageContext);
|
ModHandle = RemoveModeHandle (ImageContext);
|
||||||
if (ModHandle != NULL) {
|
if (ModHandle != NULL) {
|
||||||
mWinNt->FreeLibrary (ModHandle);
|
mWinNt->FreeLibrary (ModHandle);
|
||||||
|
|
|
@ -126,15 +126,14 @@ AsciiToUnicode (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Applies additional actions to relocate fixups to a PE/COFF image.
|
Performs additional actions after a PE/COFF image has been loaded and relocated.
|
||||||
|
|
||||||
Generally this function is called after sucessfully Applying relocation fixups
|
For NT32, this function load symbols to support source level debugging.
|
||||||
to a PE/COFF image for some specicial purpose.
|
|
||||||
As a example, For NT32 emulator, the function should be implemented and called
|
|
||||||
to support source level debug.
|
|
||||||
|
|
||||||
@param ImageContext Pointer to the image context structure that describes the PE/COFF
|
If ImageContext is NULL, then ASSERT().
|
||||||
image that is being relocated.
|
|
||||||
|
@param ImageContext Pointer to the image context structure that describes the
|
||||||
|
PE/COFF image that has already been loaded and relocated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -148,6 +147,8 @@ PeCoffLoaderRelocateImageExtraAction (
|
||||||
HMODULE Library;
|
HMODULE Library;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
|
ASSERT (ImageContext != NULL);
|
||||||
|
|
||||||
if (mWinNt == NULL) {
|
if (mWinNt == NULL) {
|
||||||
Nt32PeCoffGetWinNtThunkStucture ();
|
Nt32PeCoffGetWinNtThunkStucture ();
|
||||||
}
|
}
|
||||||
|
@ -229,17 +230,15 @@ PeCoffLoaderRelocateImageExtraAction (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Unloads a loaded PE/COFF image from memory and releases its taken resource.
|
Performs additional actions just before a PE/COFF image is unloaded. Any resources
|
||||||
|
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
|
||||||
|
|
||||||
Releases any environment specific resources that were allocated when the image
|
For NT32, this function unloads symbols for source level debugging.
|
||||||
specified by ImageContext was loaded using PeCoffLoaderLoadImage().
|
|
||||||
For NT32 emulator, the PE/COFF image loaded by system needs to release.
|
|
||||||
For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
|
|
||||||
|
|
||||||
If ImageContext is NULL, then ASSERT().
|
If ImageContext is NULL, then ASSERT().
|
||||||
|
|
||||||
@param ImageContext Pointer to the image context structure that describes the PE/COFF
|
@param ImageContext Pointer to the image context structure that describes the
|
||||||
image to be unloaded.
|
PE/COFF image that is being unloaded.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -248,4 +247,5 @@ PeCoffLoaderUnloadImageExtraAction (
|
||||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
ASSERT (ImageContext != NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue