mirror of https://github.com/acidanthera/audk.git
Add WinNtBlockIoDxe module into Nt32Pkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2770 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ff9f122612
commit
1016045636
|
@ -152,13 +152,13 @@
|
||||||
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||||
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
||||||
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||||
PrintLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
PrintLib|$(WORKSPACE)\MdePkg\Library/BasePrintLib/BasePrintLib.inf
|
||||||
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||||
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
||||||
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
||||||
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||||
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryLib/DxeMemoryLib.inf
|
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
UefiRuntimeLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.inf
|
UefiRuntimeLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.inf
|
||||||
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
||||||
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
||||||
|
@ -168,7 +168,7 @@
|
||||||
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
||||||
DebugLib|$(WORKSPACE)\MdePkg\Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
DebugLib|$(WORKSPACE)\MdePkg\Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||||
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||||
PrintLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
PrintLib|$(WORKSPACE)\MdePkg\Library/BasePrintLib/BasePrintLib.inf
|
||||||
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
||||||
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
||||||
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
HobLib|$(WORKSPACE)\MdePkg\Library/DxeHobLib/DxeHobLib.inf
|
HobLib|$(WORKSPACE)\MdePkg\Library/DxeHobLib/DxeHobLib.inf
|
||||||
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
EdkIfrSupportLib|$(WORKSPACE)\MdeModulePkg\Library/EdkIfrSupportLib/EdkIfrSupportLib.inf
|
EdkIfrSupportLib|$(WORKSPACE)\MdeModulePkg\Library/EdkIfrSupportLib/EdkIfrSupportLib.inf
|
||||||
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryLib/DxeMemoryLib.inf
|
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
EdkPeCoffLoaderLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.inf
|
EdkPeCoffLoaderLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.inf
|
||||||
PcdLib|$(WORKSPACE)\MdePkg\Library/DxePcdLib/DxePcdLib.inf
|
PcdLib|$(WORKSPACE)\MdePkg\Library/DxePcdLib/DxePcdLib.inf
|
||||||
MemoryAllocationLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
|
MemoryAllocationLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
|
||||||
|
@ -221,13 +221,13 @@
|
||||||
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||||
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
||||||
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||||
PrintLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
PrintLib|$(WORKSPACE)\MdePkg\Library/BasePrintLib/BasePrintLib.inf
|
||||||
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||||
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
||||||
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
||||||
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||||
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryLib/DxeMemoryLib.inf
|
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
UefiRuntimeLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.inf
|
UefiRuntimeLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.inf
|
||||||
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
||||||
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
||||||
|
@ -246,13 +246,13 @@
|
||||||
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
UefiDriverEntryPoint|$(WORKSPACE)\MdePkg\Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||||
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
EdkGraphicsLib|$(WORKSPACE)\MdeModulePkg\Library/EdkGraphicsLib/EdkGraphicsLib.inf
|
||||||
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|$(WORKSPACE)\MdePkg\Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||||
PrintLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
PrintLib|$(WORKSPACE)\MdePkg\Library/BasePrintLib/BasePrintLib.inf
|
||||||
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||||
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
||||||
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
||||||
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
UefiBootServicesTableLib|$(WORKSPACE)\MdePkg\Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||||
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryLib/DxeMemoryLib.inf
|
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
TianoDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.inf
|
||||||
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
||||||
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
||||||
|
@ -286,7 +286,7 @@
|
||||||
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
EdkUsbLib|$(WORKSPACE)\MdeModulePkg\Library/EdkUsbLib/EdkUsbLib.inf
|
||||||
DebugLib|$(WORKSPACE)\MdePkg\Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
DebugLib|$(WORKSPACE)\MdePkg\Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||||
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
DxeServicesTableLib|$(WORKSPACE)\MdePkg\Library/DxeServicesTableLib/DxeServicesTableLib.inf
|
||||||
PrintLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
PrintLib|$(WORKSPACE)\MdePkg\Library/BasePrintLib/BasePrintLib.inf
|
||||||
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
EdkScsiLib|$(WORKSPACE)\MdeModulePkg\Library/EdkScsiLib/EdkScsiLib.inf
|
||||||
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
UefiDecompressLib|$(WORKSPACE)\MdeModulePkg\Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.inf
|
||||||
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
HiiLib|$(WORKSPACE)\MdePkg\Library/HiiLib/HiiLib.inf
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
HobLib|$(WORKSPACE)\MdePkg\Library/DxeHobLib/DxeHobLib.inf
|
HobLib|$(WORKSPACE)\MdePkg\Library/DxeHobLib/DxeHobLib.inf
|
||||||
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
DevicePathLib|$(WORKSPACE)\MdePkg\Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
EdkIfrSupportLib|$(WORKSPACE)\MdeModulePkg\Library/EdkIfrSupportLib/EdkIfrSupportLib.inf
|
EdkIfrSupportLib|$(WORKSPACE)\MdeModulePkg\Library/EdkIfrSupportLib/EdkIfrSupportLib.inf
|
||||||
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryLib/DxeMemoryLib.inf
|
BaseMemoryLib|$(WORKSPACE)\MdePkg\Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
EdkPeCoffLoaderLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.inf
|
EdkPeCoffLoaderLib|$(WORKSPACE)\MdeModulePkg\Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.inf
|
||||||
PcdLib|$(WORKSPACE)\MdePkg\Library/DxePcdLib/DxePcdLib.inf
|
PcdLib|$(WORKSPACE)\MdePkg\Library/DxePcdLib/DxePcdLib.inf
|
||||||
MemoryAllocationLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
|
MemoryAllocationLib|$(WORKSPACE)\MdePkg\Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
|
||||||
|
@ -403,4 +403,5 @@
|
||||||
[Components.IA32]
|
[Components.IA32]
|
||||||
$(WORKSPACE)\Nt32Pkg\WinNtThunkDxe\WinNtThunk.inf
|
$(WORKSPACE)\Nt32Pkg\WinNtThunkDxe\WinNtThunk.inf
|
||||||
$(WORKSPACE)\Nt32Pkg\WinNtThunkPPIToProtocolPeim\WinNtThunkPPIToProtocolPeim.inf
|
$(WORKSPACE)\Nt32Pkg\WinNtThunkPPIToProtocolPeim\WinNtThunkPPIToProtocolPeim.inf
|
||||||
$(WORKSPACE)\Nt32Pkg\WinNtAutoScanPeim\WinNtAutoScan.inf
|
$(WORKSPACE)\Nt32Pkg\WinNtAutoScanPeim\WinNtAutoScan.inf
|
||||||
|
$(WORKSPACE)\Nt32Pkg\WinNtBlockIoDxe\WinNtBlockIo.inf
|
|
@ -0,0 +1,201 @@
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2006, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
ComponentName.c
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
--*/
|
||||||
|
#include <Uefi.h>
|
||||||
|
#include <WinNtDxe.h>
|
||||||
|
#include <Protocol/ComponentName.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
|
|
||||||
|
#include "WinNtBlockIo.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Component Name Functions
|
||||||
|
//
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoComponentNameGetDriverName (
|
||||||
|
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT CHAR16 **DriverName
|
||||||
|
);
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoComponentNameGetControllerName (
|
||||||
|
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT CHAR16 **ControllerName
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Component Name Protocol
|
||||||
|
//
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL gWinNtBlockIoComponentName = {
|
||||||
|
WinNtBlockIoComponentNameGetDriverName,
|
||||||
|
WinNtBlockIoComponentNameGetControllerName,
|
||||||
|
"eng"
|
||||||
|
};
|
||||||
|
|
||||||
|
static EFI_UNICODE_STRING_TABLE mWinNtBlockIoDriverNameTable[] = {
|
||||||
|
{ "eng", L"Windows Block I/O Driver" },
|
||||||
|
{ NULL , NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoComponentNameGetDriverName (
|
||||||
|
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT CHAR16 **DriverName
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||||
|
This is the language of the driver name that that the caller
|
||||||
|
is requesting, and it must match one of the languages specified
|
||||||
|
in SupportedLanguages. The number of languages supported by a
|
||||||
|
driver is up to the driver writer.
|
||||||
|
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||||
|
is the name of the driver specified by This in the language
|
||||||
|
specified by Language.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||||
|
and the language specified by Language was returned
|
||||||
|
in DriverName.
|
||||||
|
EFI_INVALID_PARAMETER - Language is NULL.
|
||||||
|
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
|
language specified by Language.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
return LookupUnicodeString (
|
||||||
|
Language,
|
||||||
|
gWinNtBlockIoComponentName.SupportedLanguages,
|
||||||
|
mWinNtBlockIoDriverNameTable,
|
||||||
|
DriverName
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoComponentNameGetControllerName (
|
||||||
|
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT CHAR16 **ControllerName
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Retrieves a Unicode string that is the user readable name of the controller
|
||||||
|
that is being managed by an EFI Driver.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
ControllerHandle - The handle of a controller that the driver specified by
|
||||||
|
This is managing. This handle specifies the controller
|
||||||
|
whose name is to be returned.
|
||||||
|
ChildHandle - The handle of the child controller to retrieve the name
|
||||||
|
of. This is an optional parameter that may be NULL. It
|
||||||
|
will be NULL for device drivers. It will also be NULL
|
||||||
|
for a bus drivers that wish to retrieve the name of the
|
||||||
|
bus controller. It will not be NULL for a bus driver
|
||||||
|
that wishes to retrieve the name of a child controller.
|
||||||
|
Language - A pointer to a three character ISO 639-2 language
|
||||||
|
identifier. This is the language of the controller name
|
||||||
|
that that the caller is requesting, and it must match one
|
||||||
|
of the languages specified in SupportedLanguages. The
|
||||||
|
number of languages supported by a driver is up to the
|
||||||
|
driver writer.
|
||||||
|
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||||
|
string is the name of the controller specified by
|
||||||
|
ControllerHandle and ChildHandle in the language specified
|
||||||
|
by Language from the point of view of the driver specified
|
||||||
|
by This.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||||
|
language specified by Language for the driver
|
||||||
|
specified by This was returned in DriverName.
|
||||||
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - Language is NULL.
|
||||||
|
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This is not currently managing
|
||||||
|
the controller specified by ControllerHandle and
|
||||||
|
ChildHandle.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
|
language specified by Language.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
WIN_NT_BLOCK_IO_PRIVATE *Private;
|
||||||
|
|
||||||
|
//
|
||||||
|
// This is a device driver, so ChildHandle must be NULL.
|
||||||
|
//
|
||||||
|
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
|
||||||
|
//
|
||||||
|
Status = gBS->OpenProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiBlockIoProtocolGuid,
|
||||||
|
&BlockIo,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle,
|
||||||
|
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);
|
||||||
|
|
||||||
|
return LookupUnicodeString (
|
||||||
|
Language,
|
||||||
|
gWinNtBlockIoComponentName.SupportedLanguages,
|
||||||
|
Private->ControllerNameTable,
|
||||||
|
ControllerName
|
||||||
|
);
|
||||||
|
}
|
|
@ -0,0 +1,343 @@
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2006, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
DriverConfiguration.c
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
--*/
|
||||||
|
#include <Uefi.h>
|
||||||
|
#include <WinNtDxe.h>
|
||||||
|
#include <Protocol/BlockIo.h>
|
||||||
|
#include <Protocol/ComponentName.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
|
|
||||||
|
#include "WinNtBlockIo.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Driver Configuration Functions
|
||||||
|
//
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationSetOptions (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
|
||||||
|
);
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationOptionsValid (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationForceDefaults (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN UINT32 DefaultType,
|
||||||
|
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Driver Configuration Protocol
|
||||||
|
//
|
||||||
|
EFI_DRIVER_CONFIGURATION_PROTOCOL gWinNtBlockIoDriverConfiguration = {
|
||||||
|
WinNtBlockIoDriverConfigurationSetOptions,
|
||||||
|
WinNtBlockIoDriverConfigurationOptionsValid,
|
||||||
|
WinNtBlockIoDriverConfigurationForceDefaults,
|
||||||
|
LANGUAGESUPPORTED
|
||||||
|
};
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationSetOptions (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Allows the user to set controller specific options for a controller that a
|
||||||
|
driver is currently managing.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
|
||||||
|
ControllerHandle - The handle of the controller to set options on.
|
||||||
|
ChildHandle - The handle of the child controller to set options on. This
|
||||||
|
is an optional parameter that may be NULL. It will be NULL
|
||||||
|
for device drivers, and for a bus drivers that wish to set
|
||||||
|
options for the bus controller. It will not be NULL for a
|
||||||
|
bus driver that wishes to set options for one of its child
|
||||||
|
controllers.
|
||||||
|
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||||
|
This is the language of the user interface that should be
|
||||||
|
presented to the user, and it must match one of the languages
|
||||||
|
specified in SupportedLanguages. The number of languages
|
||||||
|
supported by a driver is up to the driver writer.
|
||||||
|
ActionRequired - A pointer to the action that the calling agent is required
|
||||||
|
to perform when this function returns. See "Related
|
||||||
|
Definitions" for a list of the actions that the calling
|
||||||
|
agent is required to perform prior to accessing
|
||||||
|
ControllerHandle again.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The driver specified by This successfully set the
|
||||||
|
configuration options for the controller specified
|
||||||
|
by ControllerHandle..
|
||||||
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ActionRequired is NULL.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support setting
|
||||||
|
configuration options for the controller specified by
|
||||||
|
ControllerHandle and ChildHandle.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
|
language specified by Language.
|
||||||
|
EFI_DEVICE_ERROR - A device error occurred while attempt to set the
|
||||||
|
configuration options for the controller specified
|
||||||
|
by ControllerHandle and ChildHandle.
|
||||||
|
EFI_OUT_RESOURCES - There are not enough resources available to set the
|
||||||
|
configuration options for the controller specified
|
||||||
|
by ControllerHandle and ChildHandle.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
CHAR8 *SupportedLanguage;
|
||||||
|
|
||||||
|
SupportedLanguage = This->SupportedLanguages;
|
||||||
|
|
||||||
|
Status = EFI_UNSUPPORTED;
|
||||||
|
while (*SupportedLanguage != 0) {
|
||||||
|
if (AsciiStrnCmp (Language, SupportedLanguage, 3) == 0) {
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
SupportedLanguage += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ActionRequired == NULL || ControllerHandle == NULL) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ChildHandle != NULL) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate controller handle
|
||||||
|
//
|
||||||
|
Status = gBS->OpenProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
&BlockIo,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle,
|
||||||
|
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
gBS->CloseProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Status == EFI_UNSUPPORTED) {
|
||||||
|
return Status;
|
||||||
|
} else if (Status != EFI_ALREADY_STARTED) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ActionRequired = EfiDriverConfigurationActionNone;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationOptionsValid (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Tests to see if a controller's current configuration options are valid.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
|
||||||
|
ControllerHandle - The handle of the controller to test if it's current
|
||||||
|
configuration options are valid.
|
||||||
|
ChildHandle - The handle of the child controller to test if it's current
|
||||||
|
configuration options are valid. This is an optional
|
||||||
|
parameter that may be NULL. It will be NULL for device
|
||||||
|
drivers. It will also be NULL for a bus drivers that wish
|
||||||
|
to test the configuration options for the bus controller.
|
||||||
|
It will not be NULL for a bus driver that wishes to test
|
||||||
|
configuration options for one of its child controllers.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The controller specified by ControllerHandle and
|
||||||
|
ChildHandle that is being managed by the driver
|
||||||
|
specified by This has a valid set of configuration
|
||||||
|
options.
|
||||||
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This is not currently
|
||||||
|
managing the controller specified by ControllerHandle
|
||||||
|
and ChildHandle.
|
||||||
|
EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
|
||||||
|
ChildHandle that is being managed by the driver
|
||||||
|
specified by This has an invalid set of configuration
|
||||||
|
options.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
|
||||||
|
if (ChildHandle != NULL) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ControllerHandle == NULL) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate controller handle
|
||||||
|
//
|
||||||
|
Status = gBS->OpenProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
&BlockIo,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle,
|
||||||
|
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
gBS->CloseProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Status == EFI_UNSUPPORTED) {
|
||||||
|
return Status;
|
||||||
|
} else if (Status != EFI_ALREADY_STARTED) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverConfigurationForceDefaults (
|
||||||
|
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN UINT32 DefaultType,
|
||||||
|
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Forces a driver to set the default configuration options for a controller.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
|
||||||
|
ControllerHandle - The handle of the controller to force default configuration options on.
|
||||||
|
ChildHandle - The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.
|
||||||
|
DefaultType - The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.
|
||||||
|
ActionRequired - A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
|
||||||
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ActionRequired is NULL.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the configuration type specified by DefaultType.
|
||||||
|
EFI_DEVICE_ERROR - A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
|
||||||
|
EFI_OUT_RESOURCES - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
|
||||||
|
if (ChildHandle != NULL) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ActionRequired == NULL || ControllerHandle == NULL) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate controller handle
|
||||||
|
//
|
||||||
|
Status = gBS->OpenProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
&BlockIo,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle,
|
||||||
|
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
gBS->CloseProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Status == EFI_UNSUPPORTED) {
|
||||||
|
return Status;
|
||||||
|
} else if (Status != EFI_ALREADY_STARTED) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ActionRequired = EfiDriverConfigurationActionNone;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
|
@ -0,0 +1,191 @@
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
DriverDiagnostics.c
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
--*/
|
||||||
|
#include <Uefi.h>
|
||||||
|
#include <WinNtDxe.h>
|
||||||
|
#include <Protocol/BlockIo.h>
|
||||||
|
#include <Protocol/ComponentName.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
|
|
||||||
|
#include "WinNtBlockIo.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Driver Diagnostics Functions
|
||||||
|
//
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverDiagnosticsRunDiagnostics (
|
||||||
|
IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT EFI_GUID **ErrorType,
|
||||||
|
OUT UINTN *BufferSize,
|
||||||
|
OUT CHAR16 **Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Driver Diagnostics Protocol
|
||||||
|
//
|
||||||
|
EFI_DRIVER_DIAGNOSTICS_PROTOCOL gWinNtBlockIoDriverDiagnostics = {
|
||||||
|
WinNtBlockIoDriverDiagnosticsRunDiagnostics,
|
||||||
|
LANGUAGESUPPORTED
|
||||||
|
};
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverDiagnosticsRunDiagnostics (
|
||||||
|
IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||||
|
IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT EFI_GUID **ErrorType,
|
||||||
|
OUT UINTN *BufferSize,
|
||||||
|
OUT CHAR16 **Buffer
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Runs diagnostics on a controller.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
|
||||||
|
ControllerHandle - The handle of the controller to run diagnostics on.
|
||||||
|
ChildHandle - The handle of the child controller to run diagnostics on
|
||||||
|
This is an optional parameter that may be NULL. It will
|
||||||
|
be NULL for device drivers. It will also be NULL for a
|
||||||
|
bus drivers that wish to run diagnostics on the bus
|
||||||
|
controller. It will not be NULL for a bus driver that
|
||||||
|
wishes to run diagnostics on one of its child controllers.
|
||||||
|
DiagnosticType - Indicates type of diagnostics to perform on the controller
|
||||||
|
specified by ControllerHandle and ChildHandle. See
|
||||||
|
"Related Definitions" for the list of supported types.
|
||||||
|
Language - A pointer to a three character ISO 639-2 language
|
||||||
|
identifier. This is the language in which the optional
|
||||||
|
error message should be returned in Buffer, and it must
|
||||||
|
match one of the languages specified in SupportedLanguages.
|
||||||
|
The number of languages supported by a driver is up to
|
||||||
|
the driver writer.
|
||||||
|
ErrorType - A GUID that defines the format of the data returned in
|
||||||
|
Buffer.
|
||||||
|
BufferSize - The size, in bytes, of the data returned in Buffer.
|
||||||
|
Buffer - A buffer that contains a Null-terminated Unicode string
|
||||||
|
plus some additional data whose format is defined by
|
||||||
|
ErrorType. Buffer is allocated by this function with
|
||||||
|
AllocatePool(), and it is the caller's responsibility
|
||||||
|
to free it with a call to FreePool().
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The controller specified by ControllerHandle and
|
||||||
|
ChildHandle passed the diagnostic.
|
||||||
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||||
|
EFI_HANDLE.
|
||||||
|
EFI_INVALID_PARAMETER - Language is NULL.
|
||||||
|
EFI_INVALID_PARAMETER - ErrorType is NULL.
|
||||||
|
EFI_INVALID_PARAMETER - BufferType is NULL.
|
||||||
|
EFI_INVALID_PARAMETER - Buffer is NULL.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support
|
||||||
|
running diagnostics for the controller specified
|
||||||
|
by ControllerHandle and ChildHandle.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
|
type of diagnostic specified by DiagnosticType.
|
||||||
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
|
language specified by Language.
|
||||||
|
EFI_OUT_OF_RESOURCES - There are not enough resources available to complete
|
||||||
|
the diagnostics.
|
||||||
|
EFI_OUT_OF_RESOURCES - There are not enough resources available to return
|
||||||
|
the status information in ErrorType, BufferSize,
|
||||||
|
and Buffer.
|
||||||
|
EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
|
||||||
|
ChildHandle did not pass the diagnostic.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||||
|
CHAR8 *SupportedLanguage;
|
||||||
|
|
||||||
|
if (Language == NULL ||
|
||||||
|
ErrorType == NULL ||
|
||||||
|
Buffer == NULL ||
|
||||||
|
ControllerHandle == NULL ||
|
||||||
|
BufferSize == NULL) {
|
||||||
|
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
SupportedLanguage = This->SupportedLanguages;
|
||||||
|
|
||||||
|
Status = EFI_UNSUPPORTED;
|
||||||
|
while (*SupportedLanguage != 0) {
|
||||||
|
if (AsciiStrnCmp (Language, SupportedLanguage, 3) == 0) {
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SupportedLanguage += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ErrorType = NULL;
|
||||||
|
*BufferSize = 0;
|
||||||
|
if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {
|
||||||
|
*ErrorType = &gEfiBlockIoProtocolGuid;
|
||||||
|
*BufferSize = 0x60;
|
||||||
|
Buffer = AllocatePool ((UINTN) (*BufferSize));
|
||||||
|
CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);
|
||||||
|
return EFI_DEVICE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate controller handle
|
||||||
|
//
|
||||||
|
Status = gBS->OpenProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
&BlockIo,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle,
|
||||||
|
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
gBS->CloseProtocol (
|
||||||
|
ControllerHandle,
|
||||||
|
&gEfiWinNtIoProtocolGuid,
|
||||||
|
gWinNtBlockIoDriverBinding.DriverBindingHandle,
|
||||||
|
ControllerHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Status == EFI_UNSUPPORTED) {
|
||||||
|
return Status;
|
||||||
|
} else if (Status != EFI_ALREADY_STARTED) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,487 @@
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2006, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
WinNtBlockIo.h
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
Produce block IO abstractions for real devices on your PC using Win32 APIs.
|
||||||
|
The configuration of what devices to mount or emulate comes from NT
|
||||||
|
environment variables. The variables must be visible to the Microsoft*
|
||||||
|
Developer Studio for them to work.
|
||||||
|
|
||||||
|
* Other names and brands may be claimed as the property of others.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
|
||||||
|
#ifndef _WIN_NT_BLOCK_IO_H_
|
||||||
|
#define _WIN_NT_BLOCK_IO_H_
|
||||||
|
|
||||||
|
#include <Uefi.h>
|
||||||
|
#include <WinNtDxe.h>
|
||||||
|
#include <Protocol/WinNtThunk.h>
|
||||||
|
#include <Protocol/WinNtIo.h>
|
||||||
|
#include <Protocol/BlockIo.h>
|
||||||
|
#include <Protocol/ComponentName.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
|
//
|
||||||
|
// The Library classes this module consumes
|
||||||
|
//
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/BaseLib.h>
|
||||||
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
|
#include <Library/UefiLib.h>
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
|
||||||
|
#define FILENAME_BUFFER_SIZE 80
|
||||||
|
|
||||||
|
//
|
||||||
|
// Language supported for driverconfiguration protocol
|
||||||
|
//
|
||||||
|
#define LANGUAGESUPPORTED "eng"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
EfiWinNtVirtualDisks,
|
||||||
|
EfiWinNtPhysicalDisks,
|
||||||
|
EifWinNtMaxTypeDisks
|
||||||
|
} WIN_NT_RAW_DISK_DEVICE_TYPE;
|
||||||
|
|
||||||
|
#define WIN_NT_BLOCK_IO_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'b', 'k')
|
||||||
|
typedef struct {
|
||||||
|
UINTN Signature;
|
||||||
|
|
||||||
|
EFI_LOCK Lock;
|
||||||
|
|
||||||
|
CHAR16 Filename[FILENAME_BUFFER_SIZE];
|
||||||
|
UINTN ReadMode;
|
||||||
|
UINTN ShareMode;
|
||||||
|
UINTN OpenMode;
|
||||||
|
|
||||||
|
HANDLE NtHandle;
|
||||||
|
WIN_NT_RAW_DISK_DEVICE_TYPE DeviceType;
|
||||||
|
|
||||||
|
UINT64 LastBlock;
|
||||||
|
UINTN BlockSize;
|
||||||
|
UINT64 NumberOfBlocks;
|
||||||
|
|
||||||
|
EFI_HANDLE EfiHandle;
|
||||||
|
EFI_BLOCK_IO_PROTOCOL BlockIo;
|
||||||
|
EFI_BLOCK_IO_MEDIA Media;
|
||||||
|
|
||||||
|
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
|
||||||
|
|
||||||
|
EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
|
||||||
|
|
||||||
|
} WIN_NT_BLOCK_IO_PRIVATE;
|
||||||
|
|
||||||
|
#define WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS(a) \
|
||||||
|
CR(a, WIN_NT_BLOCK_IO_PRIVATE, BlockIo, WIN_NT_BLOCK_IO_PRIVATE_SIGNATURE)
|
||||||
|
|
||||||
|
#define LIST_BUFFER_SIZE 512
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block I/O Global Variables
|
||||||
|
//
|
||||||
|
extern EFI_DRIVER_BINDING_PROTOCOL gWinNtBlockIoDriverBinding;
|
||||||
|
extern EFI_COMPONENT_NAME_PROTOCOL gWinNtBlockIoComponentName;
|
||||||
|
extern EFI_DRIVER_CONFIGURATION_PROTOCOL gWinNtBlockIoDriverConfiguration;
|
||||||
|
extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gWinNtBlockIoDriverDiagnostics;
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Driver Binding Functions
|
||||||
|
//
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverBindingSupported (
|
||||||
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE Handle,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
Handle - TODO: add argument description
|
||||||
|
RemainingDevicePath - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverBindingStart (
|
||||||
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE Handle,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
Handle - TODO: add argument description
|
||||||
|
RemainingDevicePath - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoDriverBindingStop (
|
||||||
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE Handle,
|
||||||
|
IN UINTN NumberOfChildren,
|
||||||
|
IN EFI_HANDLE *ChildHandleBuffer
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
Handle - TODO: add argument description
|
||||||
|
NumberOfChildren - TODO: add argument description
|
||||||
|
ChildHandleBuffer - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block IO protocol member functions
|
||||||
|
//
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoReadBlocks (
|
||||||
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
|
IN UINT32 MediaId,
|
||||||
|
IN EFI_LBA Lba,
|
||||||
|
IN UINTN BufferSize,
|
||||||
|
OUT VOID *Buffer
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
MediaId - TODO: add argument description
|
||||||
|
Lba - TODO: add argument description
|
||||||
|
BufferSize - TODO: add argument description
|
||||||
|
Buffer - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoWriteBlocks (
|
||||||
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
|
IN UINT32 MediaId,
|
||||||
|
IN EFI_LBA Lba,
|
||||||
|
IN UINTN BufferSize,
|
||||||
|
IN VOID *Buffer
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
MediaId - TODO: add argument description
|
||||||
|
Lba - TODO: add argument description
|
||||||
|
BufferSize - TODO: add argument description
|
||||||
|
Buffer - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoFlushBlocks (
|
||||||
|
IN EFI_BLOCK_IO_PROTOCOL *This
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
WinNtBlockIoResetBlock (
|
||||||
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
|
IN BOOLEAN ExtendedVerification
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
This - TODO: add argument description
|
||||||
|
ExtendedVerification - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private Worker functions
|
||||||
|
//
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
WinNtBlockIoCreateMapping (
|
||||||
|
IN EFI_WIN_NT_IO_PROTOCOL *WinNtIo,
|
||||||
|
IN EFI_HANDLE EfiDeviceHandle,
|
||||||
|
IN CHAR16 *Filename,
|
||||||
|
IN BOOLEAN ReadOnly,
|
||||||
|
IN BOOLEAN RemovableMedia,
|
||||||
|
IN UINTN NumberOfBlocks,
|
||||||
|
IN UINTN BlockSize,
|
||||||
|
IN WIN_NT_RAW_DISK_DEVICE_TYPE DeviceType
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
WinNtIo - TODO: add argument description
|
||||||
|
EfiDeviceHandle - TODO: add argument description
|
||||||
|
Filename - TODO: add argument description
|
||||||
|
ReadOnly - TODO: add argument description
|
||||||
|
RemovableMedia - TODO: add argument description
|
||||||
|
NumberOfBlocks - TODO: add argument description
|
||||||
|
BlockSize - TODO: add argument description
|
||||||
|
DeviceType - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
WinNtBlockIoReadWriteCommon (
|
||||||
|
IN WIN_NT_BLOCK_IO_PRIVATE *Private,
|
||||||
|
IN UINT32 MediaId,
|
||||||
|
IN EFI_LBA Lba,
|
||||||
|
IN UINTN BufferSize,
|
||||||
|
IN VOID *Buffer,
|
||||||
|
IN CHAR8 *CallerName
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
Private - TODO: add argument description
|
||||||
|
MediaId - TODO: add argument description
|
||||||
|
Lba - TODO: add argument description
|
||||||
|
BufferSize - TODO: add argument description
|
||||||
|
Buffer - TODO: add argument description
|
||||||
|
CallerName - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
WinNtBlockIoError (
|
||||||
|
IN WIN_NT_BLOCK_IO_PRIVATE *Private
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
Private - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
EFI_STATUS
|
||||||
|
WinNtBlockIoOpenDevice (
|
||||||
|
WIN_NT_BLOCK_IO_PRIVATE *Private
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
Private - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
STATIC
|
||||||
|
CHAR16 *
|
||||||
|
GetNextElementPastTerminator (
|
||||||
|
IN CHAR16 *EnvironmentVariable,
|
||||||
|
IN CHAR16 Terminator
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
EnvironmentVariable - TODO: add argument description
|
||||||
|
Terminator - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
SetFilePointer64 (
|
||||||
|
IN WIN_NT_BLOCK_IO_PRIVATE *Private,
|
||||||
|
IN INT64 DistanceToMove,
|
||||||
|
OUT UINT64 *NewFilePointer,
|
||||||
|
IN DWORD MoveMethod
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
Private - TODO: add argument description
|
||||||
|
DistanceToMove - TODO: add argument description
|
||||||
|
NewFilePointer - TODO: add argument description
|
||||||
|
MoveMethod - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
UINTN
|
||||||
|
Atoi (
|
||||||
|
CHAR16 *String
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
TODO: Add function description
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
String - TODO: add argument description
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
TODO: add return values
|
||||||
|
|
||||||
|
--*/
|
||||||
|
;
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,120 @@
|
||||||
|
#/** @file
|
||||||
|
# Block Io driver
|
||||||
|
#
|
||||||
|
# Produce block IO abstractions for real devices on your PC using Win32 APIs.
|
||||||
|
# The configuration of what devices to mount or emulate comes from NT
|
||||||
|
# environment variables. The variables must be visible to the Microsoft*
|
||||||
|
# Developer Studio for them to work.
|
||||||
|
# Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
|
#
|
||||||
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#**/
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Defines Section - statements that will be processed to create a Makefile.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x00010005
|
||||||
|
BASE_NAME = WinNtBlockIo
|
||||||
|
FILE_GUID = F479E147-A125-11d4-BCFC-0080C73C8881
|
||||||
|
MODULE_TYPE = UEFI_DRIVER
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
EDK_RELEASE_VERSION = 0x00020000
|
||||||
|
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||||
|
|
||||||
|
ENTRY_POINT = InitializeWinNtBlockIo
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32
|
||||||
|
#
|
||||||
|
# DRIVER_BINDING = gWinNtBlockIoDriverBinding
|
||||||
|
# COMPONENT_NAME = gWinNtBlockIoComponentName
|
||||||
|
# DRIVER_DIAG = gWinNtBlockIoDriverDiagnostics
|
||||||
|
#
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Sources Section - list of files that are required for the build to succeed.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[Sources.common]
|
||||||
|
DriverDiagnostics.c
|
||||||
|
DriverConfiguration.c
|
||||||
|
ComponentName.c
|
||||||
|
WinNtBlockIo.c
|
||||||
|
WinNtBlockIo.h
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Includes Section - list of Include locations that are required for
|
||||||
|
# this module.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[Includes]
|
||||||
|
$(WORKSPACE)/MdePkgPkg/Include/Library
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Package Dependency Section - list of Package files that are required for
|
||||||
|
# this module.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
Nt32Pkg/Nt32Pkg.dec
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Library Class Section - list of Library Classes that are required for
|
||||||
|
# this module.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
MemoryAllocationLib
|
||||||
|
UefiBootServicesTableLib
|
||||||
|
BaseMemoryLib
|
||||||
|
UefiLib
|
||||||
|
UefiDriverEntryPoint
|
||||||
|
BaseLib
|
||||||
|
DebugLib
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Guid C Name Section - list of Guids that this module uses or produces.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gEfiWinNtPhysicalDisksGuid # SOMETIMES_CONSUMED
|
||||||
|
gEfiWinNtVirtualDisksGuid # ALWAYS_CONSUMED
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
|
||||||
|
# that this module uses or produces.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
gEfiBlockIoProtocolGuid # PROTOCOL BY_START
|
||||||
|
gEfiWinNtIoProtocolGuid # PROTOCOL TO_START
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<MsaHeader>
|
||||||
|
<ModuleName>WinNtBlockIo</ModuleName>
|
||||||
|
<ModuleType>UEFI_DRIVER</ModuleType>
|
||||||
|
<GuidValue>F479E147-A125-11d4-BCFC-0080C73C8881</GuidValue>
|
||||||
|
<Version>1.0</Version>
|
||||||
|
<Abstract>Block Io driver</Abstract>
|
||||||
|
<Description>Produce block IO abstractions for real devices on your PC using Win32 APIs.
|
||||||
|
The configuration of what devices to mount or emulate comes from NT
|
||||||
|
environment variables. The variables must be visible to the Microsoft*
|
||||||
|
Developer Studio for them to work.</Description>
|
||||||
|
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||||
|
<License>All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
|
||||||
|
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||||
|
</MsaHeader>
|
||||||
|
<ModuleDefinitions>
|
||||||
|
<SupportedArchitectures>IA32</SupportedArchitectures>
|
||||||
|
<BinaryModule>false</BinaryModule>
|
||||||
|
<OutputFileBasename>WinNtBlockIo</OutputFileBasename>
|
||||||
|
</ModuleDefinitions>
|
||||||
|
<LibraryClassDefinitions>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>DebugLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>BaseLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>UefiDriverModelLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>UefiLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>BaseMemoryLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||||
|
<Keyword>MemoryAllocationLib</Keyword>
|
||||||
|
</LibraryClass>
|
||||||
|
</LibraryClassDefinitions>
|
||||||
|
<SourceFiles>
|
||||||
|
<Filename>WinNtBlockIo.h</Filename>
|
||||||
|
<Filename>WinNtBlockIo.c</Filename>
|
||||||
|
<Filename>ComponentName.c</Filename>
|
||||||
|
<Filename>DriverConfiguration.c</Filename>
|
||||||
|
<Filename>DriverDiagnostics.c</Filename>
|
||||||
|
</SourceFiles>
|
||||||
|
<PackageDependencies>
|
||||||
|
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||||
|
<Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>
|
||||||
|
</PackageDependencies>
|
||||||
|
<Protocols>
|
||||||
|
<Protocol Usage="TO_START">
|
||||||
|
<ProtocolCName>gEfiWinNtIoProtocolGuid</ProtocolCName>
|
||||||
|
</Protocol>
|
||||||
|
<Protocol Usage="BY_START">
|
||||||
|
<ProtocolCName>gEfiBlockIoProtocolGuid</ProtocolCName>
|
||||||
|
</Protocol>
|
||||||
|
</Protocols>
|
||||||
|
<Guids>
|
||||||
|
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||||
|
<GuidCName>gEfiWinNtVirtualDisksGuid</GuidCName>
|
||||||
|
</GuidCNames>
|
||||||
|
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||||
|
<GuidCName>gEfiWinNtPhysicalDisksGuid</GuidCName>
|
||||||
|
</GuidCNames>
|
||||||
|
</Guids>
|
||||||
|
<Externs>
|
||||||
|
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||||
|
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||||
|
<Extern>
|
||||||
|
<DriverBinding>gWinNtBlockIoDriverBinding</DriverBinding>
|
||||||
|
<ComponentName>gWinNtBlockIoComponentName</ComponentName>
|
||||||
|
<DriverDiag>gWinNtBlockIoDriverDiagnostics</DriverDiag>
|
||||||
|
</Extern>
|
||||||
|
</Externs>
|
||||||
|
</ModuleSurfaceArea>
|
Loading…
Reference in New Issue