]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/ComponentName.c
Fix component name bugs when input Controller Name is invalid
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / Uga / ComponentName.c
index 7b9c2972d0fa6bc76efe98bc60edb5775b19ce3d..910771964d05afb5c49738f1159f3030ed68891a 100644 (file)
@@ -161,6 +161,17 @@ WinNtUgaComponentNameGetControllerName (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  //\r
+  // Make sure this driver is currently managing ControllerHandle\r
+  //\r
+  Status = EfiTestManagedDevice (\r
+             ControllerHandle,\r
+             gWinNtUgaDriverBinding.DriverBindingHandle,\r
+             &gEfiWinNtIoProtocolGuid\r
+             );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
   //\r
   // Get our context back\r
   //\r