IN VOID *ResetData OPTIONAL\r
)\r
{\r
+ UINTN Index;\r
+\r
ASSERT (ResetType <= EfiResetPlatformSpecific);\r
SecPrint (" Emu ResetSystem is called: ResetType = %s\n", mResetTypeStr[ResetType]);\r
\r
if (ResetType == EfiResetShutdown) {\r
exit (0);\r
} else {\r
+ //\r
+ // Unload all DLLs\r
+ //\r
+ for (Index = 0; Index < mPdbNameModHandleArraySize; Index++) {\r
+ if (mPdbNameModHandleArray[Index].PdbPointer != NULL) {\r
+ SecPrint (" Emu Unload DLL: %s\n", mPdbNameModHandleArray[Index].PdbPointer);\r
+ FreeLibrary (mPdbNameModHandleArray[Index].ModHandle);\r
+ HeapFree (GetProcessHeap (), 0, mPdbNameModHandleArray[Index].PdbPointer);\r
+ mPdbNameModHandleArray[Index].PdbPointer = NULL;\r
+ }\r
+ }\r
+\r
//\r
// Jump back to SetJump with jump code = ResetType + 1\r
//\r