]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c
Nt32Pkg: Fix typos in comments and variables
[mirror_edk2.git] / Nt32Pkg / Library / PeiNt32PeCoffExtraActionLib / PeiNt32PeCoffExtraActionLib.c
index e491bf3a10ed489cef5d65cb6d6f7215547f1681..682446ad86301c4b63fd56a014709ad8e61b4c90 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
 \r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -24,8 +24,7 @@ Abstract:
 //\r
 // The package level header files this module uses\r
 //\r
-#include <FrameworkPei.h>\r
-#include <FrameworkModulePei.h>\r
+#include <PiPei.h>\r
 #include <WinNtPeim.h>\r
 \r
 //\r
@@ -126,15 +125,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 +146,8 @@ PeCoffLoaderRelocateImageExtraAction (
   HMODULE           Library;\r
   UINTN             Index;\r
   \r
+  ASSERT (ImageContext != NULL);\r
+\r
   if (mWinNt == NULL) {\r
     Nt32PeCoffGetWinNtThunkStucture ();\r
   }\r
@@ -155,7 +155,7 @@ PeCoffLoaderRelocateImageExtraAction (
   // 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
   //  the *.dll file as a library using Windows* APIs. This allows \r
-  //  source level debug. The image is still loaded and reloaced\r
+  //  source level debug. The image is still loaded and relocated\r
   //  in the Framework memory space like on a real system (by the code above),\r
   //  but the entry point points into the DLL loaded by the code bellow. \r
   //\r
@@ -200,11 +200,11 @@ PeCoffLoaderRelocateImageExtraAction (
     if (Library != NULL) {\r
       //\r
       // InitializeDriver is the entry point we put in all our EFI DLL's. The\r
-      // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() supresses the \r
+      // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the \r
       // normal DLL entry point of DllMain, and prevents other modules that are\r
       // referenced in side the DllFileName from being loaded. There is no error \r
       // checking as the we can point to the PE32 image loaded by Tiano. This \r
-      // step is only needed for source level debuging\r
+      // step is only needed for source level debugging\r
       //\r
       DllEntryPoint = (VOID *) (UINTN) mWinNt->GetProcAddress (Library, "InitializeDriver");\r
 \r
@@ -229,17 +229,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 +246,5 @@ PeCoffLoaderUnloadImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
+  ASSERT (ImageContext != NULL);\r
 }\r