From 6cb6f078ae95b64715609b87c1e28538395bd821 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Sat, 9 May 2009 00:51:14 +0000 Subject: [PATCH] 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@8274 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DxeUnixPeCoffExtraActionLib.c | 32 +++++++++---------- .../PeiUnixPeCoffExtraActionLib.c | 32 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c index d2c6b67b53..1d5cfe48a5 100644 --- a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c +++ b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c @@ -68,13 +68,12 @@ DxeUnixPeCoffLibExtraActionConstructor ( } /** - Applies additional actions to relocate fixups to a PE/COFF image. - - Generally this function is called after sucessfully Applying relocation fixups - to a PE/COFF image for some specicial purpose. - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image that is being relocated. + Performs additional actions after a PE/COFF image has been loaded and relocated. + + If ImageContext is NULL, then ASSERT(). + + @param ImageContext Pointer to the image context structure that describes the + PE/COFF image that has already been loaded and relocated. **/ VOID @@ -86,6 +85,8 @@ PeCoffLoaderRelocateImageExtraAction ( VOID * Handle; VOID * Entry; + ASSERT (ImageContext != NULL); + Handle = NULL; Entry = NULL; @@ -112,15 +113,13 @@ PeCoffLoaderRelocateImageExtraAction ( } /** - Unloads a loaded PE/COFF image from memory and releases its taken resource. - - Releases any environment specific resources that were allocated when the image - specified by ImageContext was loaded using PeCoffLoaderLoadImage(). - - If ImageContext is NULL, then ASSERT(). - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image to be unloaded. + Performs additional actions just before a PE/COFF image is unloaded. Any resources + that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed. + + If ImageContext is NULL, then ASSERT(). + + @param ImageContext Pointer to the image context structure that describes the + PE/COFF image that is being unloaded. **/ VOID @@ -129,4 +128,5 @@ PeCoffLoaderUnloadImageExtraAction ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ) { + ASSERT (ImageContext != NULL); } diff --git a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c index 4fcb9d418e..e20b16a814 100644 --- a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c +++ b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c @@ -70,13 +70,12 @@ UnixPeCoffGetUnixThunkStucture ( } /** - Applies additional actions to relocate fixups to a PE/COFF image. - - Generally this function is called after sucessfully Applying relocation fixups - to a PE/COFF image for some specicial purpose. - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image that is being relocated. + Performs additional actions after a PE/COFF image has been loaded and relocated. + + If ImageContext is NULL, then ASSERT(). + + @param ImageContext Pointer to the image context structure that describes the + PE/COFF image that has already been loaded and relocated. **/ VOID @@ -88,6 +87,8 @@ PeCoffLoaderRelocateImageExtraAction ( VOID * Handle; VOID * Entry; + ASSERT (ImageContext != NULL); + Handle = NULL; Entry = NULL; @@ -117,15 +118,13 @@ PeCoffLoaderRelocateImageExtraAction ( } /** - Unloads a loaded PE/COFF image from memory and releases its taken resource. - - Releases any environment specific resources that were allocated when the image - specified by ImageContext was loaded using PeCoffLoaderLoadImage(). - - If ImageContext is NULL, then ASSERT(). - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image to be unloaded. + Performs additional actions just before a PE/COFF image is unloaded. Any resources + that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed. + + If ImageContext is NULL, then ASSERT(). + + @param ImageContext Pointer to the image context structure that describes the + PE/COFF image that is being unloaded. **/ VOID @@ -134,4 +133,5 @@ PeCoffLoaderUnloadImageExtraAction ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ) { + ASSERT (ImageContext != NULL); } -- 2.39.2