Fix component name bugs when input Controller Name is invalid

Fix the driver binding version for platform/OEM specific drivers 


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2273 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2007-01-19 08:04:03 +00:00
parent e1b95c15ab
commit 8b018de64f
14 changed files with 105 additions and 11 deletions

View File

@ -160,7 +160,17 @@ WinNtBlockIoComponentNameGetControllerName (
if (ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
//
// Make sure this driver is currently managing ControllerHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtBlockIoDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
//
// Get our context back
//

View File

@ -66,7 +66,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtBlockIoDriverBinding = {
WinNtBlockIoDriverBindingSupported,
WinNtBlockIoDriverBindingStart,
WinNtBlockIoDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -160,7 +160,17 @@ WinNtConsoleComponentNameGetControllerName (
if (ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
//
// Make sure this driver is currently managing ControllerHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtConsoleDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
//
// Get out context back
//

View File

@ -50,7 +50,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtConsoleDriverBinding = {
WinNtConsoleDriverBindingSupported,
WinNtConsoleDriverBindingStart,
WinNtConsoleDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -162,8 +162,18 @@ WinNtGopComponentNameGetControllerName (
if (ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
//
//
// Make sure this driver is currently managing ControllerHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtGopDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
//
// Get our context back
//
Status = gBS->OpenProtocol (

View File

@ -28,7 +28,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding = {
WinNtGopDriverBindingSupported,
WinNtGopDriverBindingStart,
WinNtGopDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -154,6 +154,18 @@ WinNtSerialIoComponentNameGetControllerName (
EFI_SERIAL_IO_PROTOCOL *SerialIo;
WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;
//
// Make sure this driver is currently managing ControllHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtSerialIoDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// This is a bus driver, so ChildHandle must not be NULL.
//
@ -161,6 +173,15 @@ WinNtSerialIoComponentNameGetControllerName (
return EFI_UNSUPPORTED;
}
Status = EfiTestChildHandle (
ControllerHandle,
ChildHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Get our context back
//

View File

@ -51,7 +51,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtSerialIoDriverBinding = {
WinNtSerialIoDriverBindingSupported,
WinNtSerialIoDriverBindingStart,
WinNtSerialIoDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -167,6 +167,17 @@ WinNtSimpleFileSystemComponentNameGetControllerName (
return EFI_UNSUPPORTED;
}
//
// Make sure this driver is currently managing ControllerHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtSimpleFileSystemDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
//
// Get our context back
//

View File

@ -30,7 +30,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtSimpleFileSystemDriverBinding = {
WinNtSimpleFileSystemDriverBindingSupported,
WinNtSimpleFileSystemDriverBindingStart,
WinNtSimpleFileSystemDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -161,6 +161,17 @@ WinNtUgaComponentNameGetControllerName (
return EFI_UNSUPPORTED;
}
//
// Make sure this driver is currently managing ControllerHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtUgaDriverBinding.DriverBindingHandle,
&gEfiWinNtIoProtocolGuid
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
//
// Get our context back
//

View File

@ -31,7 +31,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtUgaDriverBinding = {
WinNtUgaDriverBindingSupported,
WinNtUgaDriverBindingStart,
WinNtUgaDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};

View File

@ -154,6 +154,18 @@ WinNtBusDriverComponentNameGetControllerName (
EFI_WIN_NT_IO_PROTOCOL *WinNtIo;
WIN_NT_IO_DEVICE *Private;
//
// Make sure this driver is currently managing ControllHandle
//
Status = EfiTestManagedDevice (
ControllerHandle,
gWinNtBusDriverBinding.DriverBindingHandle,
&gEfiWinNtThunkProtocolGuid
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// This is a bus driver, so ChildHandle can not be NULL.
//
@ -161,6 +173,15 @@ WinNtBusDriverComponentNameGetControllerName (
return EFI_UNSUPPORTED;
}
Status = EfiTestChildHandle (
ControllerHandle,
ChildHandle,
&gEfiWinNtThunkProtocolGuid
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Get our context back
//

View File

@ -114,7 +114,7 @@ EFI_DRIVER_BINDING_PROTOCOL gWinNtBusDriverBinding = {
WinNtBusDriverBindingSupported,
WinNtBusDriverBindingStart,
WinNtBusDriverBindingStop,
0x10,
0xa,
NULL,
NULL
};