+/**\r
+ Unloads an image from memory.\r
+\r
+ This function is a callback that a driver registers to do cleanup\r
+ when the UnloadImage boot service function is called.\r
+\r
+ @param ImageHandle The handle to the image to unload.\r
+\r
+ @return Status returned by all unload().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+_DriverUnloadHandler (\r
+ EFI_HANDLE ImageHandle\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // If an UnloadImage() handler is specified, then call it\r
+ //\r
+ Status = ProcessModuleUnloadList (ImageHandle);\r
+\r
+ //\r
+ // If the driver specific unload handler does not return an error, then call all of the\r
+ // library destructors. If the unload handler returned an error, then the driver can not be\r
+ // unloaded, and the library destructors should not be called\r
+ //\r
+ if (!EFI_ERROR (Status)) {\r
+ ProcessLibraryDestructorList (ImageHandle, gMmst);\r
+ }\r
+\r
+ //\r
+ // Return the status from the driver specific unload handler\r
+ //\r
+ return Status;\r
+}\r
+\r