summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg/Win
diff options
context:
space:
mode:
Diffstat (limited to 'EmulatorPkg/Win')
-rw-r--r--EmulatorPkg/Win/Host/WinHost.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c
index 096292f95a..084cd4cbd7 100644
--- a/EmulatorPkg/Win/Host/WinHost.c
+++ b/EmulatorPkg/Win/Host/WinHost.c
@@ -226,6 +226,8 @@ WinReset (
IN VOID *ResetData OPTIONAL
)
{
+ UINTN Index;
+
ASSERT (ResetType <= EfiResetPlatformSpecific);
SecPrint (" Emu ResetSystem is called: ResetType = %s\n", mResetTypeStr[ResetType]);
@@ -233,6 +235,18 @@ WinReset (
exit (0);
} else {
//
+ // Unload all DLLs
+ //
+ for (Index = 0; Index < mPdbNameModHandleArraySize; Index++) {
+ if (mPdbNameModHandleArray[Index].PdbPointer != NULL) {
+ SecPrint (" Emu Unload DLL: %s\n", mPdbNameModHandleArray[Index].PdbPointer);
+ FreeLibrary (mPdbNameModHandleArray[Index].ModHandle);
+ HeapFree (GetProcessHeap (), 0, mPdbNameModHandleArray[Index].PdbPointer);
+ mPdbNameModHandleArray[Index].PdbPointer = NULL;
+ }
+ }
+
+ //
// Jump back to SetJump with jump code = ResetType + 1
//
LongJump (&mResetJumpBuffer, ResetType + 1);