// The package level header files this module uses\r
//\r
#include <FrameworkDxe.h>\r
-#include <FrameworkModuleDxe.h>\r
#include <WinNtDxe.h>\r
\r
//\r
PDB_NAME_TO_MOD_HANDLE *Array;\r
UINTN PreviousSize;\r
PDB_NAME_TO_MOD_HANDLE *TempArray;\r
+ HANDLE Handle;\r
\r
Array = mPdbNameModHandleArray;\r
for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {\r
//\r
// Make a copy of the stirng and store the ModHandle\r
//\r
- Array->PdbPointer = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),\r
+ Handle = mWinNt->GetProcessHeap ();\r
+ Array->PdbPointer = mWinNt->HeapAlloc ( Handle,\r
HEAP_ZERO_MEMORY,\r
AsciiStrLen (ImageContext->PdbPointer) + 1\r
); \r
}\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
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
} \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
{\r
VOID *ModHandle;\r
\r
+ ASSERT (ImageContext != NULL);\r
+\r
ModHandle = RemoveModeHandle (ImageContext);\r
if (ModHandle != NULL) {\r
mWinNt->FreeLibrary (ModHandle);\r