]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Sync with PE/COFF Extra Action library class comments and add ASSERT() conditions...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 00:50:40 +0000 (00:50 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 00:50:40 +0000 (00:50 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8273 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c
Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c

index ff5028d4a845b25c7325ca6874ee3b5848e0d0b9..ef46107742a69f550f22c53fe4071142b74cfd57 100644 (file)
@@ -250,15 +250,14 @@ RemoveModeHandle (
 }\r
 \r
 /**\r
-  Applies additional actions to relocate fixups to a PE/COFF image.\r
+  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
 \r
-  Generally this function is called after sucessfully Applying relocation fixups \r
-  to a PE/COFF image for some specicial purpose. \r
-  As a example, For NT32 emulator, the function should be implemented and called\r
-  to support source level debug.  \r
-  \r
-  @param  ImageContext        Pointer to the image context structure that describes the PE/COFF\r
-                              image that is being relocated.\r
+  For NT32, this function load symbols to support source level debugging.\r
+\r
+  If ImageContext is NULL, then ASSERT().\r
+\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that has already been loaded and relocated.\r
 \r
 **/\r
 VOID\r
@@ -271,7 +270,9 @@ PeCoffLoaderRelocateImageExtraAction (
   CHAR16            *DllFileName;\r
   HMODULE           Library;\r
   UINTN             Index;\r
-  \r
+\r
+  ASSERT (ImageContext != NULL);\r
+\r
        //\r
   // If we load our own PE COFF images the Windows debugger can not source\r
   //  level debug our code. If a valid PDB pointer exists usw it to load\r
@@ -351,17 +352,15 @@ PeCoffLoaderRelocateImageExtraAction (
 }  \r
 \r
 /**\r
-  Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
-  \r
-  Releases any environment specific resources that were allocated when the image \r
-  specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
-  For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
-  For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
+  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
   \r
+  For NT32, this function unloads symbols for source level debugging.\r
+\r
   If ImageContext is NULL, then ASSERT().\r
   \r
-  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
-                                    image to be unloaded.\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that is being unloaded.\r
 \r
 **/\r
 VOID\r
@@ -372,6 +371,8 @@ PeCoffLoaderUnloadImageExtraAction (
 {\r
        VOID *ModHandle;\r
 \r
+  ASSERT (ImageContext != NULL);\r
+\r
   ModHandle = RemoveModeHandle (ImageContext);\r
   if (ModHandle != NULL) {\r
     mWinNt->FreeLibrary (ModHandle);\r
index e491bf3a10ed489cef5d65cb6d6f7215547f1681..d3ac3ae183bf27022ba2c0c983ffe1b4ac4f12e9 100644 (file)
@@ -126,15 +126,14 @@ AsciiToUnicode (
 }\r
 \r
 /**\r
-  Applies additional actions to relocate fixups to a PE/COFF image.\r
+  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
 \r
-  Generally this function is called after sucessfully Applying relocation fixups \r
-  to a PE/COFF image for some specicial purpose. \r
-  As a example, For NT32 emulator, the function should be implemented and called\r
-  to support source level debug.  \r
-  \r
-  @param  ImageContext        Pointer to the image context structure that describes the PE/COFF\r
-                              image that is being relocated.\r
+  For NT32, this function load symbols to support source level debugging.\r
+\r
+  If ImageContext is NULL, then ASSERT().\r
+\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that has already been loaded and relocated.\r
 \r
 **/\r
 VOID\r
@@ -148,6 +147,8 @@ PeCoffLoaderRelocateImageExtraAction (
   HMODULE           Library;\r
   UINTN             Index;\r
   \r
+  ASSERT (ImageContext != NULL);\r
+\r
   if (mWinNt == NULL) {\r
     Nt32PeCoffGetWinNtThunkStucture ();\r
   }\r
@@ -229,17 +230,15 @@ PeCoffLoaderRelocateImageExtraAction (
 }  \r
 \r
 /**\r
-  Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
-  \r
-  Releases any environment specific resources that were allocated when the image \r
-  specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
-  For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
-  For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
+  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
   \r
+  For NT32, this function unloads symbols for source level debugging.\r
+\r
   If ImageContext is NULL, then ASSERT().\r
   \r
-  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
-                                    image to be unloaded.\r
+  @param  ImageContext  Pointer to the image context structure that describes the\r
+                        PE/COFF image that is being unloaded.\r
 \r
 **/\r
 VOID\r
@@ -248,4 +247,5 @@ PeCoffLoaderUnloadImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
+  ASSERT (ImageContext != NULL);\r
 }\r