mirror of https://github.com/acidanthera/audk.git
update DriverSample driver unload function to remove the installed package list.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8171 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d32509c04c
commit
14d59fa188
|
@ -792,7 +792,6 @@ DriverSampleInit (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_STATUS SavedStatus;
|
|
||||||
EFI_HII_HANDLE HiiHandle[2];
|
EFI_HII_HANDLE HiiHandle[2];
|
||||||
EFI_SCREEN_DESCRIPTOR Screen;
|
EFI_SCREEN_DESCRIPTOR Screen;
|
||||||
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
||||||
|
@ -968,8 +967,6 @@ DriverSampleInit (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SavedStatus = EFI_SUCCESS;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Default this driver is built into Flash device image,
|
// Default this driver is built into Flash device image,
|
||||||
// the following code doesn't run.
|
// the following code doesn't run.
|
||||||
|
@ -993,22 +990,15 @@ DriverSampleInit (
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
SavedStatus = Status;
|
|
||||||
|
|
||||||
Status = HiiDatabase->RemovePackageList (HiiDatabase, HiiHandle[0]);
|
HiiRemovePackages (HiiHandle[0]);
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
|
HiiRemovePackages (HiiHandle[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = HiiDatabase->RemovePackageList (HiiDatabase, HiiHandle[1]);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return SavedStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Unloads the application and its installed protocol.
|
Unloads the application and its installed protocol.
|
||||||
|
|
||||||
|
@ -1042,6 +1032,14 @@ DriverSampleUnload (
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PrivateData->HiiHandle[0] != NULL) {
|
||||||
|
HiiRemovePackages (PrivateData->HiiHandle[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PrivateData->HiiHandle[1] != NULL) {
|
||||||
|
HiiRemovePackages (PrivateData->HiiHandle[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if (PrivateData != NULL) {
|
if (PrivateData != NULL) {
|
||||||
FreePool (PrivateData);
|
FreePool (PrivateData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue