]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Nt32Pkg: Remove it
authorRay Ni <ray.ni@intel.com>
Fri, 17 May 2019 04:55:16 +0000 (12:55 +0800)
committerRay Ni <ray.ni@intel.com>
Fri, 17 May 2019 05:02:41 +0000 (13:02 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1812

Now since EmulatorPkg supports to run in Windows environment,
this patch removes Nt32Pkg to remove duplicate code in edk2 repo.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
137 files changed:
Nt32Pkg/BootModePei/BootModePei.c [deleted file]
Nt32Pkg/BootModePei/BootModePei.inf [deleted file]
Nt32Pkg/CpuRuntimeDxe/Cpu.c [deleted file]
Nt32Pkg/CpuRuntimeDxe/CpuDriver.h [deleted file]
Nt32Pkg/CpuRuntimeDxe/CpuIo.c [deleted file]
Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf [deleted file]
Nt32Pkg/CpuRuntimeDxe/Strings.uni [deleted file]
Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c [deleted file]
Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c [deleted file]
Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf [deleted file]
Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h [deleted file]
Nt32Pkg/Include/Common/WinNTInclude.h [deleted file]
Nt32Pkg/Include/Guid/WinNtSystemConfig.h [deleted file]
Nt32Pkg/Include/Library/WinNtLib.h [deleted file]
Nt32Pkg/Include/Ppi/NtAutoscan.h [deleted file]
Nt32Pkg/Include/Ppi/NtFwh.h [deleted file]
Nt32Pkg/Include/Ppi/NtPeiLoadFile.h [deleted file]
Nt32Pkg/Include/Ppi/NtThunk.h [deleted file]
Nt32Pkg/Include/Protocol/WinNtIo.h [deleted file]
Nt32Pkg/Include/Protocol/WinNtThunk.h [deleted file]
Nt32Pkg/Include/WinNtDxe.h [deleted file]
Nt32Pkg/Include/WinNtPeim.h [deleted file]
Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf [deleted file]
Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c [deleted file]
Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c [deleted file]
Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf [deleted file]
Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf [deleted file]
Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c [deleted file]
Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf [deleted file]
Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c [deleted file]
Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c [deleted file]
Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf [deleted file]
Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c [deleted file]
Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c [deleted file]
Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni [deleted file]
Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c [deleted file]
Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf [deleted file]
Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c [deleted file]
Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf [deleted file]
Nt32Pkg/MetronomeDxe/Metronome.c [deleted file]
Nt32Pkg/MetronomeDxe/Metronome.h [deleted file]
Nt32Pkg/MetronomeDxe/MetronomeDxe.inf [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c [deleted file]
Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c [deleted file]
Nt32Pkg/Nt32Pkg.dec [deleted file]
Nt32Pkg/Nt32Pkg.dsc [deleted file]
Nt32Pkg/Nt32Pkg.fdf [deleted file]
Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c [deleted file]
Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf [deleted file]
Nt32Pkg/Sec/FwVol.c [deleted file]
Nt32Pkg/Sec/SecMain.c [deleted file]
Nt32Pkg/Sec/SecMain.h [deleted file]
Nt32Pkg/Sec/SecMain.inf [deleted file]
Nt32Pkg/Sec/Stack.asm [deleted file]
Nt32Pkg/Sec/StackX64.asm [deleted file]
Nt32Pkg/Sec/WinNtThunk.c [deleted file]
Nt32Pkg/SnpNt32Dxe/ComponentName.c [deleted file]
Nt32Pkg/SnpNt32Dxe/SnpNt32.c [deleted file]
Nt32Pkg/SnpNt32Dxe/SnpNt32.h [deleted file]
Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf [deleted file]
Nt32Pkg/StallPei/Stall.c [deleted file]
Nt32Pkg/StallPei/StallPei.inf [deleted file]
Nt32Pkg/TimerDxe/Timer.c [deleted file]
Nt32Pkg/TimerDxe/Timer.h [deleted file]
Nt32Pkg/TimerDxe/TimerDxe.inf [deleted file]
Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c [deleted file]
Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf [deleted file]
Nt32Pkg/WinNtBlockIoDxe/ComponentName.c [deleted file]
Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c [deleted file]
Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c [deleted file]
Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c [deleted file]
Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.h [deleted file]
Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf [deleted file]
Nt32Pkg/WinNtBusDriverDxe/ComponentName.c [deleted file]
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c [deleted file]
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.h [deleted file]
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf [deleted file]
Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf [deleted file]
Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c [deleted file]
Nt32Pkg/WinNtFlashMapPei/FlashMap.c [deleted file]
Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf [deleted file]
Nt32Pkg/WinNtGopDxe/ComponentName.c [deleted file]
Nt32Pkg/WinNtGopDxe/WinNtGop.h [deleted file]
Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c [deleted file]
Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf [deleted file]
Nt32Pkg/WinNtGopDxe/WinNtGopInput.c [deleted file]
Nt32Pkg/WinNtGopDxe/WinNtGopScreen.c [deleted file]
Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c [deleted file]
Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf [deleted file]
Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.c [deleted file]
Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf [deleted file]
Nt32Pkg/WinNtSerialIoDxe/ComponentName.c [deleted file]
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c [deleted file]
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.h [deleted file]
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf [deleted file]
Nt32Pkg/WinNtSimpleFileSystemDxe/ComponentName.c [deleted file]
Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c [deleted file]
Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.h [deleted file]
Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf [deleted file]
Nt32Pkg/WinNtThunkDxe/WinNtThunk.c [deleted file]
Nt32Pkg/WinNtThunkDxe/WinNtThunk.h [deleted file]
Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf [deleted file]
Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c [deleted file]
Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf [deleted file]

diff --git a/Nt32Pkg/BootModePei/BootModePei.c b/Nt32Pkg/BootModePei/BootModePei.c
deleted file mode 100644 (file)
index 6de0774..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  BootMode.c\r
-   \r
-Abstract:\r
-\r
-  Tiano PEIM to provide the platform support functionality within Windows\r
-\r
-**/\r
-\r
-\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/MasterBootMode.h>\r
-#include <Ppi/BootInRecoveryMode.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-\r
-\r
-//\r
-// Module globals\r
-//\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiMasterBootModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiBootInRecoveryModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeBootMode (\r
-  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Peform the boot mode determination logic\r
-\r
-Arguments:\r
-\r
-  FileHandle  - Handle of the file being invoked.\r
-  PeiServices - Describes the list of possible PEI Services.\r
-    \r
-Returns:\r
-\r
-  Status -  EFI_SUCCESS if the boot mode could be set\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       BootMode;\r
-\r
-  DEBUG ((EFI_D_ERROR, "NT32 Boot Mode PEIM Loaded\n"));\r
-\r
-  //\r
-  // Let's assume things are OK if not told otherwise\r
-  // Should we read an environment variable in order to easily change this?\r
-  //\r
-  BootMode  = BOOT_WITH_FULL_CONFIGURATION;\r
-\r
-  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
-    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/BootModePei/BootModePei.inf b/Nt32Pkg/BootModePei/BootModePei.inf
deleted file mode 100644 (file)
index 2579b34..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file\r
-# Component description file for BootMode module\r
-#\r
-# This module provides platform specific function to detect boot mode.\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = BootMode\r
-  FILE_GUID                      = B7611005-1F26-45ba-A3DB-01F39DDB2785\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeBootMode\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  BootModePei.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-\r
-[Ppis]\r
-  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED\r
-  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED\r
-\r
-[depex]\r
-  TRUE\r
diff --git a/Nt32Pkg/CpuRuntimeDxe/Cpu.c b/Nt32Pkg/CpuRuntimeDxe/Cpu.c
deleted file mode 100644 (file)
index 8bf93ae..0000000
+++ /dev/null
@@ -1,547 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  Cpu.c\r
-\r
-Abstract:\r
-\r
-  NT Emulation Architectural Protocol Driver as defined in Tiano.\r
-  This CPU module abstracts the interrupt subsystem of a platform and\r
-  the CPU-specific setjump/long pair.  Other services are not implemented\r
-  in this driver.\r
-\r
-**/\r
-\r
-\r
-#include "CpuDriver.h"\r
-\r
-UINT64  mTimerPeriod;\r
-\r
-CPU_ARCH_PROTOCOL_PRIVATE mCpuTemplate = {\r
-  CPU_ARCH_PROT_PRIVATE_SIGNATURE,\r
-  NULL,\r
-  {\r
-    WinNtFlushCpuDataCache,\r
-    WinNtEnableInterrupt,\r
-    WinNtDisableInterrupt,\r
-    WinNtGetInterruptState,\r
-    WinNtInit,\r
-    WinNtRegisterInterruptHandler,\r
-    WinNtGetTimerValue,\r
-    WinNtSetMemoryAttributes,\r
-    1,\r
-    4\r
-  },\r
-  {\r
-    CpuMemoryServiceRead,\r
-    CpuMemoryServiceWrite,\r
-    CpuIoServiceRead,\r
-    CpuIoServiceWrite\r
-  },\r
-  0,\r
-  TRUE\r
-};\r
-\r
-#define EFI_CPU_DATA_MAXIMUM_LENGTH 0x100\r
-\r
-\r
-\r
-//\r
-// Service routines for the driver\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtFlushCpuDataCache (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   Start,\r
-  IN UINT64                 Length,\r
-  IN EFI_CPU_FLUSH_TYPE     FlushType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would provide support for flushing the CPU data cache.\r
-  In the case of NT emulation environment, this flushing is not necessary and\r
-  is thus not implemented.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Start adddress in memory to flush\r
-  Length of memory to flush\r
-  Flush type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    FlushType - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {\r
-    //\r
-    // Only WB flush is supported. We actually need do nothing on NT emulator\r
-    // environment. Classify this to follow EFI spec\r
-    //\r
-    return EFI_SUCCESS;\r
-  }\r
-  //\r
-  // Other flush types are not supported by NT emulator\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtEnableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt enable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  Private                 = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  Private->InterruptState = TRUE;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtDisableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  Private                 = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  Private->InterruptState = FALSE;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetInterruptState (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  OUT BOOLEAN               *State\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    State - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  if (State == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  *State  = Private->InterruptState;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtInit (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_CPU_INIT_TYPE      InitType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support generation of a CPU INIT.  At\r
-  present, this code does not provide emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  INIT Type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    InitType - add argument and description to function comment\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtRegisterInterruptHandler (\r
-  IN EFI_CPU_ARCH_PROTOCOL      *This,\r
-  IN EFI_EXCEPTION_TYPE         InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support registration of an interrupt handler.  At\r
-  present, this code does not provide emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Pointer to interrupt handlers\r
-  Interrupt type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    InterruptType - add argument and description to function comment\r
-// TODO:    InterruptHandler - add argument and description to function comment\r
-{\r
-\r
-  //\r
-  // Do parameter checking for EFI spec conformance\r
-  //\r
-  if (InterruptType < 0 || InterruptType > 0xff) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Do nothing for Nt32 emulation\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetTimerValue (\r
-  IN  EFI_CPU_ARCH_PROTOCOL *This,\r
-  IN  UINT32                TimerIndex,\r
-  OUT UINT64                *TimerValue,\r
-  OUT UINT64                *TimerPeriod OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support querying of an on-CPU timer.  At present,\r
-  this code does not provide timer emulation.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to CPU Architectural Protocol interface\r
-  TimerIndex  - Index of given CPU timer\r
-  TimerValue  - Output of the timer\r
-  TimerPeriod - Output of the timer period\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED       - not yet implemented\r
-  EFI_INVALID_PARAMETER - TimeValue is NULL\r
-\r
---*/\r
-{\r
-  if (TimerValue == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  if (TimerIndex != 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  gWinNt->QueryPerformanceCounter ((LARGE_INTEGER *)TimerValue);\r
-  \r
-  if (TimerPeriod != NULL) {\r
-    *TimerPeriod = mTimerPeriod;\r
-  }\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSetMemoryAttributes (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   BaseAddress,\r
-  IN UINT64                 Length,\r
-  IN UINT64                 Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support querying of an on-CPU timer.  At present,\r
-  this code does not provide timer emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Start address of memory region\r
-  The size in bytes of the memory region\r
-  The bit mask of attributes to set for the memory region\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    BaseAddress - add argument and description to function comment\r
-// TODO:    Length - add argument and description to function comment\r
-// TODO:    Attributes - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  //\r
-  // Check for invalid parameter for Spec conformance\r
-  //\r
-  if (Length == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 emulation\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Logs SMBIOS record.\r
-\r
-  @param  Smbios   Pointer to SMBIOS protocol instance.\r
-  @param  Buffer   Pointer to the data buffer.\r
-\r
-**/\r
-VOID\r
-LogSmbiosData (\r
-  IN  EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  IN  UINT8                      *Buffer\r
-  )\r
-{\r
-  EFI_STATUS         Status;\r
-  EFI_SMBIOS_HANDLE  SmbiosHandle;\r
-  \r
-  SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (\r
-                     Smbios,\r
-                     NULL,\r
-                     &SmbiosHandle,\r
-                     (EFI_SMBIOS_TABLE_HEADER*)Buffer\r
-                     );\r
-  ASSERT_EFI_ERROR (Status);\r
-}\r
-\r
-\r
-VOID\r
-CpuUpdateSmbios (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This function will log processor version and frequency data to Smbios.\r
-\r
-Arguments:\r
-  Event        - Event whose notification function is being invoked.\r
-  Context      - Pointer to the notification function's context.\r
-\r
-Returns:\r
-  None.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  UINT32                      TotalSize;\r
-  EFI_SMBIOS_PROTOCOL         *Smbios;\r
-  EFI_HII_HANDLE              HiiHandle;\r
-  STRING_REF                  Token;\r
-  UINTN                       CpuVerStrLen;\r
-  EFI_STRING                  CpuVerStr;\r
-  SMBIOS_TABLE_TYPE4          *SmbiosRecord;\r
-  CHAR8                       *OptionalStrStart;\r
-\r
-  //\r
-  // Locate Smbios protocol.\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios);\r
-  \r
-  if (EFI_ERROR (Status)) {\r
-    return;\r
-  }\r
-\r
-  //\r
-  // Initialize strings to HII database\r
-  //\r
-  HiiHandle = HiiAddPackages (\r
-                &gEfiCallerIdGuid,\r
-                NULL,\r
-                CpuStrings,\r
-                NULL\r
-                );\r
-  ASSERT (HiiHandle != NULL);\r
-\r
-  Token  = STRING_TOKEN (STR_PROCESSOR_VERSION);\r
-  CpuVerStr = HiiGetPackageString(&gEfiCallerIdGuid, Token, NULL);\r
-  CpuVerStrLen = StrLen(CpuVerStr);\r
-  ASSERT (CpuVerStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-\r
-  TotalSize = (UINT32)(sizeof(SMBIOS_TABLE_TYPE4) + CpuVerStrLen + 1 + 1);\r
-  SmbiosRecord = AllocatePool(TotalSize);\r
-  ZeroMem(SmbiosRecord, TotalSize);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE4);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Processor version is the 1st string.\r
-  //\r
-  SmbiosRecord->ProcessorVersion = 1;\r
-  //\r
-  // Store CPU frequency data record to data hub - It's an emulator so make up a value\r
-  //\r
-  SmbiosRecord->CurrentSpeed  = 1234;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(CpuVerStr, OptionalStrStart);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  LogSmbiosData(Smbios, (UINT8 *) SmbiosRecord);\r
-  FreePool (SmbiosRecord);\r
-\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeCpu (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the state information for the CPU Architectural Protocol\r
-\r
-Arguments:\r
-\r
-  ImageHandle of the loaded driver\r
-  Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS           - protocol instance can be published\r
-  EFI_OUT_OF_RESOURCES  - cannot allocate protocol data structure\r
-  EFI_DEVICE_ERROR      - cannot create the thread\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINT64      Frequency;\r
-\r
-  //\r
-  // Retrieve the frequency of the performance counter in Hz.\r
-  //  \r
-  gWinNt->QueryPerformanceFrequency ((LARGE_INTEGER *)&Frequency);\r
-  \r
-  //\r
-  // Convert frequency in Hz to a clock period in femtoseconds.\r
-  //\r
-  mTimerPeriod = DivU64x64Remainder (1000000000000000, Frequency, NULL);\r
-  \r
-  CpuUpdateSmbios ();\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &mCpuTemplate.Handle,\r
-                  &gEfiCpuArchProtocolGuid,   &mCpuTemplate.Cpu,\r
-                  &gEfiCpuIo2ProtocolGuid,    &mCpuTemplate.CpuIo,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuDriver.h b/Nt32Pkg/CpuRuntimeDxe/CpuDriver.h
deleted file mode 100644 (file)
index 94f8eb4..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  CpuDriver.h\r
-\r
-Abstract:\r
-\r
-  NT Emulation Architectural Protocol Driver as defined in Tiano.\r
-\r
-**/\r
-\r
-#ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r
-#define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r
-\r
-\r
-#include <FrameworkDxe.h>\r
-#include <IndustryStandard/SmBios.h>\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/Smbios.h>\r
-#include <Protocol/FrameworkHii.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <Protocol/CpuIo2.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/WinNtLib.h>\r
-\r
-\r
-extern UINT8  CpuStrings[];\r
-\r
-//\r
-// Internal Data Structures\r
-//\r
-#define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')\r
-\r
-typedef struct {\r
-  UINTN                 Signature;\r
-  EFI_HANDLE            Handle;\r
-\r
-  EFI_CPU_ARCH_PROTOCOL Cpu;\r
-  EFI_CPU_IO2_PROTOCOL  CpuIo;\r
-\r
-  //\r
-  // Local Data for CPU interface goes here\r
-  //\r
-  CRITICAL_SECTION      NtCriticalSection;\r
-  BOOLEAN               InterruptState;\r
-\r
-} CPU_ARCH_PROTOCOL_PRIVATE;\r
-\r
-#define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      CPU_ARCH_PROTOCOL_PRIVATE, \\r
-      Cpu, \\r
-      CPU_ARCH_PROT_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceRead (\r
-  IN  EFI_CPU_IO2_PROTOCOL              *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceRead (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  );\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeCpu (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtFlushCpuDataCache (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   Start,\r
-  IN UINT64                 Length,\r
-  IN EFI_CPU_FLUSH_TYPE     FlushType\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtEnableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtDisableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetInterruptState (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  OUT BOOLEAN               *State\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtInit (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_CPU_INIT_TYPE      InitType\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtRegisterInterruptHandler (\r
-  IN EFI_CPU_ARCH_PROTOCOL      *This,\r
-  IN EFI_EXCEPTION_TYPE         InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetTimerValue (\r
-  IN  EFI_CPU_ARCH_PROTOCOL *This,\r
-  IN  UINT32                TimerIndex,\r
-  OUT UINT64                *TimerValue,\r
-  OUT UINT64                *TimerPeriod OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSetMemoryAttributes (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   BaseAddress,\r
-  IN UINT64                 Length,\r
-  IN UINT64                 Attributes\r
-  );\r
-\r
-\r
-\r
-\r
-\r
-\r
-#endif\r
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuIo.c b/Nt32Pkg/CpuRuntimeDxe/CpuIo.c
deleted file mode 100644 (file)
index 4809f9c..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  CpuIo.c\r
-\r
-Abstract:\r
-\r
-  This is the code that publishes the CPU I/O Protocol.\r
-  The intent herein is to have a single I/O service that can load\r
-  as early as possible, extend into runtime, and be layered upon by \r
-  the implementations of architectural protocols and the PCI Root\r
-  Bridge I/O Protocol.\r
-\r
-**/\r
-\r
-#include <CpuDriver.h>\r
-\r
-#define IA32_MAX_IO_ADDRESS   0xFFFF\r
-#define IA32_MAX_MEM_ADDRESS  0xFFFFFFFF\r
-\r
-EFI_STATUS\r
-CpuIoCheckAddressRange (\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  VOID                              *Buffer,\r
-  IN  UINT64                            Limit\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceRead (\r
-  IN  EFI_CPU_IO2_PROTOCOL              *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform the Memory Access Read service for the CPU I/O Protocol\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the Memory access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from memory\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS             - The data was read from or written to the EFI \r
-                            System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, \r
-                            and Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  if (!Buffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform the Memory Access Read service for the CPU I/O Protocol\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the Memory access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from memory\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  if (!Buffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceRead (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  This is the service that implements the I/O read\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the I/O access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from I/O space\r
-\r
-Returns:\r
-\r
-  Status\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    UserAddress - add argument and description to function comment\r
-// TODO:    UserBuffer - add argument and description to function comment\r
-{\r
-  UINTN       Address;\r
-  EFI_STATUS  Status;\r
-\r
-  if (!UserBuffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Address = (UINTN) UserAddress;\r
-\r
-  if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  \r
-  This is the service that implements the I/O Write\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the I/O access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from I/O space\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  Status\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    UserAddress - add argument and description to function comment\r
-// TODO:    UserBuffer - add argument and description to function comment\r
-{\r
-  UINTN       Address;\r
-  EFI_STATUS  Status;\r
-\r
-  if (!UserBuffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Address = (UINTN) UserAddress;\r
-\r
-  if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CpuIoCheckAddressRange (\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  VOID                              *Buffer,\r
-  IN  UINT64                            Limit\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Width   - TODO: add argument description\r
-  Address - TODO: add argument description\r
-  Count   - TODO: add argument description\r
-  Buffer  - TODO: add argument description\r
-  Limit   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UINTN AlignMask;\r
-\r
-  if (Address > Limit) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // For FiFo type, the target address won't increase during the access, so treat count as 1\r
-  //\r
-  if (Width >= EfiCpuIoWidthFifoUint8 && Width <= EfiCpuIoWidthFifoUint64) {\r
-    Count = 1;\r
-  }\r
-\r
-  Width = (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03);\r
-  if (Address - 1 + ((UINTN)1 << Width) * Count > Limit) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  AlignMask = ((UINTN)1 << Width) - 1;\r
-  if ((UINTN) Buffer & AlignMask) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf b/Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
deleted file mode 100644 (file)
index c55b628..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file\r
-# Component description file for Cpu module.\r
-#\r
-# This CPU module abstracts the interrupt subsystem of a platform and the CPU-specific setjump-long pair.\r
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Cpu\r
-  FILE_GUID                      = ee993080-5197-4d4e-b63c-f1f7413e33ce\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeCpu\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  CpuIo.c\r
-  Cpu.c\r
-  CpuDriver.h\r
-  Strings.uni\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiDriverEntryPoint\r
-  DebugLib\r
-  HiiLib\r
-  WinNtLib\r
-\r
-[Protocols]\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL_NOTIFY SOMETIMES_CONSUMED\r
-  gEfiSmbiosProtocolGuid                        # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiCpuIo2ProtocolGuid                        # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiCpuArchProtocolGuid                       # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[Depex]\r
-  gEfiSmbiosProtocolGuid\r
diff --git a/Nt32Pkg/CpuRuntimeDxe/Strings.uni b/Nt32Pkg/CpuRuntimeDxe/Strings.uni
deleted file mode 100644 (file)
index 0b3a612..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// *++\r
-//\r
-// Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-// SPDX-License-Identifier: BSD-2-Clause-Patent\r
-// \r
-// Module Name:\r
-//\r
-//   Strings.uni\r
-// \r
-// Abstract:\r
-// \r
-//     String definition\r
-// Revision History:\r
-// \r
-// --*/\r
-\r
-/=#\r
-\r
-#langdef  en-US "English"\r
-#langdef  fr-FR "Français"\r
-\r
-\r
-#string STR_PROCESSOR_VERSION          #language en-US  "NT32 Emulated Processor"\r
-                                       #language fr-FR  "Processeur Ã‰mulé par NT32"
\ No newline at end of file
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
deleted file mode 100644 (file)
index 4af535d..0000000
+++ /dev/null
@@ -1,1372 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  FWBlockService.c\r
-\r
-Abstract:\r
-\r
-Revision History\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiDxe.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include "FWBlockService.h"\r
-\r
-#define EFI_FVB2_STATUS (EFI_FVB2_READ_STATUS | EFI_FVB2_WRITE_STATUS | EFI_FVB2_LOCK_STATUS)\r
-\r
-ESAL_FWB_GLOBAL         *mFvbModuleGlobal;\r
-\r
-FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate = {\r
-  {\r
-    {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_MEMMAP_DP,\r
-      {\r
-        (UINT8)(sizeof (MEMMAP_DEVICE_PATH)),\r
-        (UINT8)(sizeof (MEMMAP_DEVICE_PATH) >> 8)\r
-      }\r
-    },\r
-    EfiMemoryMappedIO,\r
-    (EFI_PHYSICAL_ADDRESS) 0,\r
-    (EFI_PHYSICAL_ADDRESS) 0,\r
-  },\r
-  {\r
-    END_DEVICE_PATH_TYPE,\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    {\r
-      END_DEVICE_PATH_LENGTH,\r
-      0\r
-    }\r
-  }\r
-};\r
-\r
-FV_PIWG_DEVICE_PATH mFvPIWGDevicePathTemplate = {\r
-  {\r
-    {\r
-      MEDIA_DEVICE_PATH,\r
-      MEDIA_PIWG_FW_VOL_DP,\r
-      {\r
-        (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH)),\r
-        (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH) >> 8)\r
-      }\r
-    },\r
-    { 0 }\r
-  },\r
-  {\r
-    END_DEVICE_PATH_TYPE,\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    {\r
-      END_DEVICE_PATH_LENGTH,\r
-      0\r
-    }\r
-  }\r
-};\r
-\r
-EFI_FW_VOL_BLOCK_DEVICE mFvbDeviceTemplate = {\r
-  FVB_DEVICE_SIGNATURE,\r
-  NULL,\r
-  0,\r
-  {\r
-    FvbProtocolGetAttributes,\r
-    FvbProtocolSetAttributes,\r
-    FvbProtocolGetPhysicalAddress,\r
-    FvbProtocolGetBlockSize,\r
-    FvbProtocolRead,\r
-    FvbProtocolWrite,\r
-    FvbProtocolEraseBlocks,\r
-    NULL\r
-  }\r
-};\r
-\r
-\r
-\r
-VOID\r
-EFIAPI\r
-FvbVirtualddressChangeEvent (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Fixup internal data so that EFI and SAL can be call in virtual mode.\r
-  Call the passed in Child Notify event and convert the mFvbModuleGlobal\r
-  date items to there virtual address.\r
-\r
-  mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]  - Physical copy of instance data\r
-  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]   - Virtual pointer to common\r
-                                                instance data.\r
-\r
-Arguments:\r
-\r
-  (Standard EFI notify event - EFI_EVENT_NOTIFY)\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance;\r
-  UINTN               Index;\r
-\r
-  EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]);\r
-\r
-  //\r
-  // Convert the base address of all the instances\r
-  //\r
-  Index       = 0;\r
-  FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];\r
-  while (Index < mFvbModuleGlobal->NumFv) {\r
-    EfiConvertPointer (0x0, (VOID **) &FwhInstance->FvBase[FVB_VIRTUAL]);\r
-    FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhInstance) + FwhInstance->VolumeHeader.HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-    Index++;\r
-  }\r
-\r
-  EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL]);\r
-  EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal);\r
-}\r
-\r
-EFI_STATUS\r
-GetFvbInstance (\r
-  IN  UINTN                               Instance,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  OUT EFI_FW_VOL_INSTANCE                 **FwhInstance,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the physical address of a memory mapped FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose base address is going to be\r
-                          returned\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  FwhInstance           - The EFI_FW_VOL_INSTANCE fimrware instance structure\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhRecord;\r
-\r
-  if (Instance >= Global->NumFv) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  FwhRecord = Global->FvInstance[Virtual];\r
-  while (Instance > 0) {\r
-    FwhRecord = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhRecord) + FwhRecord->VolumeHeader.HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-    Instance--;\r
-  }\r
-\r
-  *FwhInstance = FwhRecord;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetPhysicalAddress (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_PHYSICAL_ADDRESS                *Address,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the physical address of a memory mapped FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose base address is going to be\r
-                          returned\r
-  Address               - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
-                          that on successful return, contains the base address\r
-                          of the firmware volume.\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-  *Address = FwhInstance->FvBase[Virtual];\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_FVB_ATTRIBUTES_2                *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves attributes, insures positive polarity of attribute bits, returns\r
-  resulting attributes in output parameter\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose attributes is going to be\r
-                          returned\r
-  Attributes            - Output buffer which contains attributes\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-  *Attributes = FwhInstance->VolumeHeader.Attributes;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetLbaAddress (\r
-  IN  UINTN                               Instance,\r
-  IN  EFI_LBA                             Lba,\r
-  OUT UINTN                               *LbaAddress,\r
-  OUT UINTN                               *LbaLength,\r
-  OUT UINTN                               *NumOfBlocks,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  IN  BOOLEAN                             Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the starting address of an LBA in an FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance which the Lba belongs to\r
-  Lba                   - The logical block address\r
-  LbaAddress            - On output, contains the physical starting address\r
-                          of the Lba\r
-  LbaLength             - On output, contains the length of the block\r
-  NumOfBlocks           - A pointer to a caller allocated UINTN in which the\r
-                          number of consecutive blocks starting with Lba is\r
-                          returned. All blocks in this range have a size of\r
-                          BlockSize\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  UINT32                  NumBlocks;\r
-  UINT32                  BlockLength;\r
-  UINTN                   Offset;\r
-  EFI_LBA                 StartLba;\r
-  EFI_LBA                 NextLba;\r
-  EFI_FW_VOL_INSTANCE     *FwhInstance;\r
-  EFI_FV_BLOCK_MAP_ENTRY  *BlockMap;\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  StartLba  = 0;\r
-  Offset    = 0;\r
-  BlockMap  = &(FwhInstance->VolumeHeader.BlockMap[0]);\r
-\r
-  //\r
-  // Parse the blockmap of the FV to find which map entry the Lba belongs to\r
-  //\r
-  while (TRUE) {\r
-    NumBlocks   = BlockMap->NumBlocks;\r
-    BlockLength = BlockMap->Length;\r
-\r
-    if (NumBlocks == 0 || BlockLength == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    NextLba = StartLba + NumBlocks;\r
-\r
-    //\r
-    // The map entry found\r
-    //\r
-    if (Lba >= StartLba && Lba < NextLba) {\r
-      Offset = Offset + (UINTN) MultU64x32 ((Lba - StartLba), BlockLength);\r
-      if (LbaAddress != NULL) {\r
-        *LbaAddress = FwhInstance->FvBase[Virtual] + Offset;\r
-      }\r
-\r
-      if (LbaLength != NULL) {\r
-        *LbaLength = BlockLength;\r
-      }\r
-\r
-      if (NumOfBlocks != NULL) {\r
-        *NumOfBlocks = (UINTN) (NextLba - Lba);\r
-      }\r
-\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    StartLba  = NextLba;\r
-    Offset    = Offset + NumBlocks * BlockLength;\r
-    BlockMap++;\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-FvbReadBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Reads specified number of bytes into a buffer from the specified block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be read from\r
-  Lba                   - The logical block address to be read from\r
-  BlockOffset           - Offset into the block at which to begin reading\r
-  NumBytes              - Pointer that on input contains the total size of\r
-                          the buffer. On output, it contains the total number\r
-                          of bytes read\r
-  Buffer                - Pointer to a caller allocated buffer that will be\r
-                          used to hold the data read\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume was read successfully and\r
-                          contents are in Buffer\r
-  EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes returned\r
-                          in Buffer\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be read\r
-  EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
-\r
---*/\r
-{\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN                 LbaAddress;\r
-  UINTN                 LbaLength;\r
-  EFI_STATUS            Status;\r
-\r
-  //\r
-  // Check for invalid conditions\r
-  //\r
-  if ((NumBytes == NULL) || (Buffer == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (*NumBytes == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Check if the FV is read enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_READ_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Perform boundary checks and adjust NumBytes\r
-  //\r
-  if (BlockOffset > LbaLength) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (LbaLength < (*NumBytes + BlockOffset)) {\r
-    *NumBytes = (UINT32) (LbaLength - BlockOffset);\r
-    Status    = EFI_BAD_BUFFER_SIZE;\r
-  }\r
-\r
-  CopyMem (Buffer, (UINT8 *) (LbaAddress + BlockOffset), (UINTN) (*NumBytes));\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-FvbWriteBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Writes specified number of bytes from the input buffer to the block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be written to\r
-  Lba                   - The starting logical block index to write to\r
-  BlockOffset           - Offset into the block at which to begin writing\r
-  NumBytes              - Pointer that on input contains the total size of\r
-                          the buffer. On output, it contains the total number\r
-                          of bytes actually written\r
-  Buffer                - Pointer to a caller allocated buffer that contains\r
-                          the source for the write\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume was written successfully\r
-  EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes\r
-                          actually written\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be written\r
-  EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
-\r
---*/\r
-{\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN                 LbaAddress;\r
-  UINTN                 LbaLength;\r
-  EFI_STATUS            Status;\r
-\r
-  //\r
-  // Check for invalid conditions\r
-  //\r
-  if ((NumBytes == NULL) || (Buffer == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (*NumBytes == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Check if the FV is write enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Perform boundary checks and adjust NumBytes\r
-  //\r
-  if (BlockOffset > LbaLength) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (LbaLength < (*NumBytes + BlockOffset)) {\r
-    *NumBytes = (UINT32) (LbaLength - BlockOffset);\r
-    Status    = EFI_BAD_BUFFER_SIZE;\r
-  }\r
-  //\r
-  // Write data\r
-  //\r
-  CopyMem ((UINT8 *) (LbaAddress + BlockOffset), Buffer, (UINTN) (*NumBytes));\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-FvbEraseBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Erases and initializes a firmware volume block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be erased\r
-  Lba                   - The logical block index to be erased\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The erase request was successfully completed\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be written. Firmware device may have been\r
-                          partially erased\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN                 LbaAddress;\r
-  UINTN                 LbaLength;\r
-  EFI_STATUS            Status;\r
-  UINT8                 Data;\r
-\r
-  //\r
-  // Check if the FV is write enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Get the starting address of the block for erase.\r
-  //\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if ((Attributes & EFI_FVB2_ERASE_POLARITY) != 0) {\r
-    Data = 0xFF;\r
-  } else {\r
-    Data = 0x0;\r
-  }\r
-\r
-  SetMem ((UINT8 *) LbaAddress, LbaLength, Data);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbSetVolumeAttributes (\r
-  IN UINTN                                  Instance,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2               *Attributes,\r
-  IN ESAL_FWB_GLOBAL                        *Global,\r
-  IN BOOLEAN                                Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Modifies the current settings of the firmware volume according to the\r
-  input parameter, and returns the new setting of the volume\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose attributes is going to be\r
-                          modified\r
-  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES_2\r
-                          containing the desired firmware volume settings.\r
-                          On successful return, it contains the new settings\r
-                          of the firmware volume\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_ACCESS_DENIED     - The volume setting is locked and cannot be modified\r
-  EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are\r
-                          in conflict with the capabilities as declared in the\r
-                          firmware volume header\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE   *FwhInstance;\r
-  EFI_FVB_ATTRIBUTES_2  OldAttributes;\r
-  EFI_FVB_ATTRIBUTES_2  *AttribPtr;\r
-  UINT32                Capabilities;\r
-  UINT32                OldStatus;\r
-  UINT32                NewStatus;\r
-  EFI_STATUS            Status;\r
-  EFI_FVB_ATTRIBUTES_2  UnchangedAttributes;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  AttribPtr     = (EFI_FVB_ATTRIBUTES_2 *) &(FwhInstance->VolumeHeader.Attributes);\r
-  OldAttributes = *AttribPtr;\r
-  Capabilities  = OldAttributes & (EFI_FVB2_READ_DISABLED_CAP | \\r
-                                   EFI_FVB2_READ_ENABLED_CAP | \\r
-                                   EFI_FVB2_WRITE_DISABLED_CAP | \\r
-                                   EFI_FVB2_WRITE_ENABLED_CAP | \\r
-                                   EFI_FVB2_LOCK_CAP \\r
-                                   );\r
-  OldStatus     = OldAttributes & EFI_FVB2_STATUS;\r
-  NewStatus     = *Attributes & EFI_FVB2_STATUS;\r
-\r
-  UnchangedAttributes = EFI_FVB2_READ_DISABLED_CAP  | \\r
-                        EFI_FVB2_READ_ENABLED_CAP   | \\r
-                        EFI_FVB2_WRITE_DISABLED_CAP | \\r
-                        EFI_FVB2_WRITE_ENABLED_CAP  | \\r
-                        EFI_FVB2_LOCK_CAP           | \\r
-                        EFI_FVB2_STICKY_WRITE       | \\r
-                        EFI_FVB2_MEMORY_MAPPED      | \\r
-                        EFI_FVB2_ERASE_POLARITY     | \\r
-                        EFI_FVB2_READ_LOCK_CAP      | \\r
-                        EFI_FVB2_WRITE_LOCK_CAP     | \\r
-                        EFI_FVB2_ALIGNMENT;\r
-\r
-  //\r
-  // Some attributes of FV is read only can *not* be set\r
-  //\r
-  if ((OldAttributes & UnchangedAttributes) ^ (*Attributes & UnchangedAttributes)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // If firmware volume is locked, no status bit can be updated\r
-  //\r
-  if (OldAttributes & EFI_FVB2_LOCK_STATUS) {\r
-    if (OldStatus ^ NewStatus) {\r
-      return EFI_ACCESS_DENIED;\r
-    }\r
-  }\r
-  //\r
-  // Test read disable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_READ_DISABLED_CAP) == 0) {\r
-    if ((NewStatus & EFI_FVB2_READ_STATUS) == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test read enable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_READ_ENABLED_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_READ_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test write disable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_WRITE_DISABLED_CAP) == 0) {\r
-    if ((NewStatus & EFI_FVB2_WRITE_STATUS) == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test write enable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_WRITE_ENABLED_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_WRITE_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test lock\r
-  //\r
-  if ((Capabilities & EFI_FVB2_LOCK_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_LOCK_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-\r
-  *AttribPtr  = (*AttribPtr) & (0xFFFFFFFF & (~EFI_FVB2_STATUS));\r
-  *AttribPtr  = (*AttribPtr) | NewStatus;\r
-  *Attributes = *AttribPtr;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-//\r
-// FVB protocol APIs\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetPhysicalAddress (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT EFI_PHYSICAL_ADDRESS                        *Address\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Retrieves the physical address of the device.\r
-\r
-Arguments:\r
-\r
-  This                  - Calling context\r
-  Address               - Output buffer containing the address.\r
-\r
-Returns:\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetPhysicalAddress (FvbDevice->Instance, Address, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetBlockSize (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN CONST EFI_LBA                                     Lba,\r
-  OUT UINTN                                       *BlockSize,\r
-  OUT UINTN                                       *NumOfBlocks\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieve the size of a logical block\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Indicates which block to return the size for.\r
-  BlockSize             - A pointer to a caller allocated UINTN in which\r
-                          the size of the block is returned\r
-  NumOfBlocks           - a pointer to a caller allocated UINTN in which the\r
-                          number of consecutive blocks starting with Lba is\r
-                          returned. All blocks in this range have a size of\r
-                          BlockSize\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume was read successfully and\r
-                          contents are in Buffer\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetLbaAddress (\r
-          FvbDevice->Instance,\r
-          Lba,\r
-          NULL,\r
-          BlockSize,\r
-          NumOfBlocks,\r
-          mFvbModuleGlobal,\r
-          EfiGoneVirtual ()\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT EFI_FVB_ATTRIBUTES_2                              *Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Retrieves Volume attributes.  No polarity translations are done.\r
-\r
-Arguments:\r
-    This                - Calling context\r
-    Attributes          - output buffer which contains attributes\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolSetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2                           *Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Sets Volume attributes. No polarity translations are done.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Attributes            - output buffer which contains attributes\r
-\r
-Returns:\r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbSetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolEraseBlocks (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *This,\r
-  ...\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The EraseBlock() function erases one or more blocks as denoted by the\r
-  variable argument list. The entire parameter list of blocks must be verified\r
-  prior to erasing any blocks.  If a block is requested that does not exist\r
-  within the associated firmware volume (it has a larger index than the last\r
-  block of the firmware volume), the EraseBlock() function must return\r
-  EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  ...                   - Starting LBA followed by Number of Lba to erase.\r
-                          a -1 to terminate the list.\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The erase request was successfully completed\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be written. Firmware device may have been\r
-                          partially erased\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-  EFI_FW_VOL_INSTANCE     *FwhInstance;\r
-  UINTN                   NumOfBlocks;\r
-  VA_LIST                 args;\r
-  EFI_LBA                 StartingLba;\r
-  UINTN                   NumOfLba;\r
-  EFI_STATUS              Status;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  Status    = GetFvbInstance (FvbDevice->Instance, mFvbModuleGlobal, &FwhInstance, EfiGoneVirtual ());\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  NumOfBlocks = FwhInstance->NumOfBlocks;\r
-\r
-  VA_START (args, This);\r
-\r
-  do {\r
-    StartingLba = VA_ARG (args, EFI_LBA);\r
-    if (StartingLba == EFI_LBA_LIST_TERMINATOR) {\r
-      break;\r
-    }\r
-\r
-    NumOfLba = VA_ARG (args, UINTN);\r
-\r
-    //\r
-    // Check input parameters\r
-    //\r
-    if ((NumOfLba == 0) || ((StartingLba + NumOfLba) > NumOfBlocks)) {\r
-      VA_END (args);\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  } while (1);\r
-\r
-  VA_END (args);\r
-\r
-  VA_START (args, This);\r
-  do {\r
-    StartingLba = VA_ARG (args, EFI_LBA);\r
-    if (StartingLba == EFI_LBA_LIST_TERMINATOR) {\r
-      break;\r
-    }\r
-\r
-    NumOfLba = VA_ARG (args, UINTN);\r
-\r
-    while (NumOfLba > 0) {\r
-      Status = FvbEraseBlock (FvbDevice->Instance, StartingLba, mFvbModuleGlobal, EfiGoneVirtual ());\r
-      if (EFI_ERROR (Status)) {\r
-        VA_END (args);\r
-        return Status;\r
-      }\r
-\r
-      StartingLba++;\r
-      NumOfLba--;\r
-    }\r
-\r
-  } while (1);\r
-\r
-  VA_END (args);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolWrite (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN       EFI_LBA                                      Lba,\r
-  IN       UINTN                                        Offset,\r
-  IN OUT   UINTN                                    *NumBytes,\r
-  IN       UINT8                                        *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Writes data beginning at Lba:Offset from FV. The write terminates either\r
-  when *NumBytes of data have been written, or when a block boundary is\r
-  reached.  *NumBytes is updated to reflect the actual number of bytes\r
-  written. The write opertion does not include erase. This routine will\r
-  attempt to write only the specified bytes. If the writes do not stick,\r
-  it will return an error.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Block in which to begin write\r
-  Offset                - Offset in the block at which to begin write\r
-  NumBytes              - On input, indicates the requested write size. On\r
-                          output, indicates the actual number of bytes written\r
-  Buffer                - Buffer containing source data for the write.\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume was written successfully\r
-  EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes\r
-                          actually written\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be written\r
-  EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
-\r
---*/\r
-{\r
-\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbWriteBlock (FvbDevice->Instance, (EFI_LBA)Lba, (UINTN)Offset, NumBytes, (UINT8 *)Buffer, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolRead (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN CONST EFI_LBA                                      Lba,\r
-  IN CONST UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Reads data beginning at Lba:Offset from FV. The Read terminates either\r
-  when *NumBytes of data have been read, or when a block boundary is\r
-  reached.  *NumBytes is updated to reflect the actual number of bytes\r
-  written. The write opertion does not include erase. This routine will\r
-  attempt to write only the specified bytes. If the writes do not stick,\r
-  it will return an error.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Block in which to begin Read\r
-  Offset                - Offset in the block at which to begin Read\r
-  NumBytes              - On input, indicates the requested write size. On\r
-                          output, indicates the actual number of bytes Read\r
-  Buffer                - Buffer containing source data for the Read.\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume was read successfully and\r
-                          contents are in Buffer\r
-  EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes returned\r
-                          in Buffer\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
-                          could not be read\r
-  EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
-\r
---*/\r
-{\r
-\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbReadBlock (FvbDevice->Instance, Lba, Offset, NumBytes, Buffer, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-ValidateFvHeader (\r
-  EFI_FIRMWARE_VOLUME_HEADER            *FwVolHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Check the integrity of firmware volume header\r
-\r
-Arguments:\r
-  FwVolHeader           - A pointer to a firmware volume header\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The firmware volume is consistent\r
-  EFI_NOT_FOUND         - The firmware volume has corrupted. So it is not an FV\r
-\r
---*/\r
-{\r
-  //\r
-  // Verify the header revision, header signature, length\r
-  // Length of FvBlock cannot be 2**64-1\r
-  // HeaderLength cannot be an odd number\r
-  //\r
-  if ((FwVolHeader->Revision != EFI_FVH_REVISION) ||\r
-      (FwVolHeader->Signature != EFI_FVH_SIGNATURE) ||\r
-      (FwVolHeader->FvLength == ((UINTN) -1)) ||\r
-      ((FwVolHeader->HeaderLength & 0x01) != 0)\r
-      ) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  \r
-  //\r
-  // Verify the header checksum\r
-  //\r
-  if (CalculateCheckSum16 ((UINT16 *) FwVolHeader, FwVolHeader->HeaderLength) != 0) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This function does common initialization for FVB services\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_FW_VOL_INSTANCE                 *FwhInstance;\r
-  EFI_FIRMWARE_VOLUME_HEADER          *FwVolHeader;\r
-  EFI_DXE_SERVICES                    *DxeServices;\r
-  EFI_GCD_MEMORY_SPACE_DESCRIPTOR     Descriptor;\r
-  UINT32                              BufferSize;\r
-  EFI_FV_BLOCK_MAP_ENTRY              *PtrBlockMapEntry;\r
-  EFI_HANDLE                          FwbHandle;\r
-  EFI_FW_VOL_BLOCK_DEVICE             *FvbDevice;\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *OldFwbInterface;\r
-  UINT32                              MaxLbaSize;\r
-  EFI_PHYSICAL_ADDRESS                BaseAddress;\r
-  UINT64                              Length;\r
-  UINTN                               NumOfBlocks;\r
-  EFI_PEI_HOB_POINTERS                FvHob;\r
-\r
-  //\r
-  // Get the DXE services table\r
-  //\r
-  DxeServices = gDS;\r
-\r
-  //\r
-  // Allocate runtime services data for global variable, which contains\r
-  // the private data of all firmware volume block instances\r
-  //\r
-  mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));\r
-  ASSERT (mFvbModuleGlobal != NULL);\r
-\r
-  //\r
-  // Calculate the total size for all firmware volume block instances\r
-  //\r
-  BufferSize            = 0;\r
-\r
-  FvHob.Raw = GetHobList ();\r
-  while ((FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw)) != NULL) {\r
-    BaseAddress = FvHob.FirmwareVolume->BaseAddress;\r
-    Length      = FvHob.FirmwareVolume->Length;\r
-    //\r
-    // Check if it is a "real" flash\r
-    //\r
-    Status = DxeServices->GetMemorySpaceDescriptor (\r
-                            BaseAddress,\r
-                            &Descriptor\r
-                            );\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {\r
-      FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-      continue;\r
-    }\r
-\r
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;\r
-    Status      = ValidateFvHeader (FwVolHeader);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Get FvbInfo\r
-      //\r
-      Status = GetFvbInfo (Length, &FwVolHeader);\r
-      if (EFI_ERROR (Status)) {\r
-        FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-        continue;\r
-      }\r
-    }\r
-\r
-    BufferSize += (sizeof (EFI_FW_VOL_INSTANCE) + FwVolHeader->HeaderLength - sizeof (EFI_FIRMWARE_VOLUME_HEADER));\r
-    FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-  }\r
-\r
-  //\r
-  // Only need to allocate once. There is only one copy of physical memory for\r
-  // the private data of each FV instance. But in virtual mode or in physical\r
-  // mode, the address of the the physical memory may be different.\r
-  //\r
-  mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);\r
-  ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);\r
-\r
-  //\r
-  // Make a virtual copy of the FvInstance pointer.\r
-  //\r
-  FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];\r
-  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] = FwhInstance;\r
-\r
-  mFvbModuleGlobal->NumFv                   = 0;\r
-  MaxLbaSize = 0;\r
-\r
-  FvHob.Raw = GetHobList ();\r
-  while (NULL != (FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw))) {\r
-    BaseAddress = FvHob.FirmwareVolume->BaseAddress;\r
-    Length      = FvHob.FirmwareVolume->Length;\r
-    //\r
-    // Check if it is a "real" flash\r
-    //\r
-    Status = DxeServices->GetMemorySpaceDescriptor (\r
-                            BaseAddress,\r
-                            &Descriptor\r
-                            );\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {\r
-      FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-      continue;\r
-    }\r
-\r
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;\r
-    Status      = ValidateFvHeader (FwVolHeader);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Get FvbInfo to provide in FwhInstance.\r
-      //\r
-      Status = GetFvbInfo (Length, &FwVolHeader);\r
-      if (EFI_ERROR (Status)) {\r
-        FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-        continue;\r
-      }\r
-      //\r
-      //  Write healthy FV header back.\r
-      //\r
-      CopyMem (\r
-        (VOID *) (UINTN) BaseAddress,\r
-        (VOID *) FwVolHeader,\r
-        FwVolHeader->HeaderLength\r
-        );\r
-    }\r
-    \r
-    FwhInstance->FvBase[FVB_PHYSICAL] = (UINTN) BaseAddress;\r
-    FwhInstance->FvBase[FVB_VIRTUAL]  = (UINTN) BaseAddress;\r
-\r
-    CopyMem ((UINTN *) &(FwhInstance->VolumeHeader), (UINTN *) FwVolHeader, FwVolHeader->HeaderLength);\r
-    FwVolHeader = &(FwhInstance->VolumeHeader);\r
-    EfiInitializeLock (&(FwhInstance->FvbDevLock), TPL_HIGH_LEVEL);\r
-\r
-    NumOfBlocks = 0;\r
-\r
-    for (PtrBlockMapEntry = FwVolHeader->BlockMap; PtrBlockMapEntry->NumBlocks != 0; PtrBlockMapEntry++) {\r
-      //\r
-      // Get the maximum size of a block.\r
-      //\r
-      if (MaxLbaSize < PtrBlockMapEntry->Length) {\r
-        MaxLbaSize = PtrBlockMapEntry->Length;\r
-      }\r
-\r
-      NumOfBlocks = NumOfBlocks + PtrBlockMapEntry->NumBlocks;\r
-    }\r
-    //\r
-    // The total number of blocks in the FV.\r
-    //\r
-    FwhInstance->NumOfBlocks = NumOfBlocks;\r
-\r
-    //\r
-    // Add a FVB Protocol Instance\r
-    //\r
-    FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
-    ASSERT (FvbDevice != NULL);\r
-\r
-    CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
-\r
-    FvbDevice->Instance = mFvbModuleGlobal->NumFv;\r
-    mFvbModuleGlobal->NumFv++;\r
-    \r
-    \r
-    //\r
-    // Set up the devicepath\r
-    //\r
-    if (FwVolHeader->ExtHeaderOffset == 0) {\r
-        //\r
-        // FV does not contains extension header, then produce MEMMAP_DEVICE_PATH\r
-        //\r
-      FvbDevice->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);\r
-      ((FV_MEMMAP_DEVICE_PATH *) FvbDevice->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress;\r
-      ((FV_MEMMAP_DEVICE_PATH *) FvbDevice->DevicePath)->MemMapDevPath.EndingAddress   = BaseAddress + FwVolHeader->FvLength - 1;\r
-    } else {\r
-      FvbDevice->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);\r
-      CopyGuid (\r
-        &((FV_PIWG_DEVICE_PATH *)FvbDevice->DevicePath)->FvDevPath.FvName, \r
-        (GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)\r
-        );\r
-    }\r
-    //\r
-    // Find a handle with a matching device path that has supports FW Block protocol\r
-    //\r
-    Status = gBS->LocateDevicePath (&gEfiFirmwareVolumeBlockProtocolGuid, &FvbDevice->DevicePath, &FwbHandle);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // LocateDevicePath fails so install a new interface and device path\r
-      //\r
-      FwbHandle = NULL;\r
-      Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      &FvbDevice->FwVolBlockInstance,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      FvbDevice->DevicePath,\r
-                      NULL\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-    } else if (IsDevicePathEnd (FvbDevice->DevicePath)) {\r
-      //\r
-      // Device allready exists, so reinstall the FVB protocol\r
-      //\r
-      Status = gBS->HandleProtocol (\r
-                      FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      (VOID**)&OldFwbInterface\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-      Status = gBS->ReinstallProtocolInterface (\r
-                      FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      OldFwbInterface,\r
-                      &FvbDevice->FwVolBlockInstance\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-    } else {\r
-      //\r
-      // There was a FVB protocol on an End Device Path node\r
-      //\r
-      ASSERT (FALSE);\r
-    }\r
-\r
-    FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-\r
-    FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c b/Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c
deleted file mode 100644 (file)
index 1b4d082..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  FvbInfo.c\r
-\r
-Abstract:\r
-\r
-  Defines data structure that is the volume header found.These data is intent\r
-  to decouple FVB driver with FV header.\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiDxe.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/EventGroup.h>\r
-#include <Guid/FirmwareFileSystem2.h>\r
-#include <Guid/SystemNvDataGuid.h>\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-typedef struct {\r
-  UINT64                      FvLength;\r
-  EFI_FIRMWARE_VOLUME_HEADER  FvbInfo;\r
-  //\r
-  // EFI_FV_BLOCK_MAP_ENTRY    ExtraBlockMap[n];//n=0\r
-  //\r
-  EFI_FV_BLOCK_MAP_ENTRY      End[1];\r
-} EFI_FVB_MEDIA_INFO;\r
-\r
-EFI_FVB_MEDIA_INFO  mPlatformFvbMediaInfo[] = {\r
-  //\r
-  // Recovery BOIS FVB\r
-  //\r
-  {\r
-    FixedPcdGet32 (PcdWinNtFlashFvRecoverySize),\r
-    {\r
-      {\r
-        0,\r
-      },  // ZeroVector[16]\r
-      EFI_FIRMWARE_FILE_SYSTEM2_GUID,\r
-      FixedPcdGet32 (PcdWinNtFlashFvRecoverySize),\r
-      EFI_FVH_SIGNATURE,\r
-      EFI_FVB2_MEMORY_MAPPED |  \r
-        EFI_FVB2_READ_ENABLED_CAP |\r
-        EFI_FVB2_READ_STATUS |\r
-        EFI_FVB2_WRITE_ENABLED_CAP |\r
-        EFI_FVB2_WRITE_STATUS |\r
-        EFI_FVB2_ERASE_POLARITY |\r
-        EFI_FVB2_ALIGNMENT_16,\r
-      sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),\r
-      0xE947,   // CheckSum\r
-      0,        // ExtHeaderOffset\r
-      {\r
-        0,\r
-      },  // Reserved[1]\r
-      2,  // Revision\r
-      {\r
-        FixedPcdGet32 (PcdWinNtFlashFvRecoverySize)/FixedPcdGet32 (PcdWinNtFirmwareBlockSize),\r
-        FixedPcdGet32 (PcdWinNtFirmwareBlockSize),\r
-      }\r
-    },\r
-    {\r
-      0,\r
-      0\r
-    }\r
-  },\r
-  //\r
-  // Systen NvStorage FVB\r
-  //\r
-  {\r
-    FixedPcdGet32 (PcdFlashNvStorageVariableSize) +\r
-    FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-    FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-    FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize),\r
-    {\r
-      {\r
-        0,\r
-      },  // ZeroVector[16]\r
-      EFI_SYSTEM_NV_DATA_FV_GUID,\r
-      FixedPcdGet32 (PcdFlashNvStorageVariableSize) +\r
-      FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-      FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-      FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize),\r
-      EFI_FVH_SIGNATURE,\r
-      EFI_FVB2_MEMORY_MAPPED |  \r
-        EFI_FVB2_READ_ENABLED_CAP |\r
-        EFI_FVB2_READ_STATUS |\r
-        EFI_FVB2_WRITE_ENABLED_CAP |\r
-        EFI_FVB2_WRITE_STATUS |\r
-        EFI_FVB2_ERASE_POLARITY |\r
-        EFI_FVB2_ALIGNMENT_16,\r
-      sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),\r
-      0xFBFF,  // CheckSum\r
-      0,       // ExtHeaderOffset\r
-      {\r
-        0,\r
-      },  // Reserved[1]\r
-      2,  // Revision\r
-      {\r
-       (FixedPcdGet32 (PcdFlashNvStorageVariableSize) +\r
-        FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-        FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-        FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize)) / FixedPcdGet32 (PcdWinNtFirmwareBlockSize),\r
-        FixedPcdGet32 (PcdWinNtFirmwareBlockSize),\r
-      }\r
-    },\r
-    {\r
-      0,\r
-      0\r
-    }\r
-  }\r
-};\r
-\r
-EFI_STATUS\r
-GetFvbInfo (\r
-  IN  UINT64                        FvLength,\r
-  OUT EFI_FIRMWARE_VOLUME_HEADER    **FvbInfo\r
-  )\r
-{\r
-  UINTN Index;\r
-\r
-  for (Index = 0; Index < sizeof (mPlatformFvbMediaInfo) / sizeof (EFI_FVB_MEDIA_INFO); Index += 1) {\r
-    if (mPlatformFvbMediaInfo[Index].FvLength == FvLength) {\r
-      *FvbInfo = &mPlatformFvbMediaInfo[Index].FvbInfo;\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf b/Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
deleted file mode 100644 (file)
index 1d7c86f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-## @file\r
-# Component description file for Nt32 Fimware Volume Block DXE driver module.\r
-#\r
-# This DXE runtime driver implements and produces the Fimware Volue Block Protocol on\r
-#  NT32 emulator.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = FvbServicesRuntimeDxe\r
-  FILE_GUID                      = BDFE5FAA-2A35-44bb-B17A-8084D4E2B9E9\r
-  MODULE_TYPE                    = DXE_RUNTIME_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = FvbInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  FvbInfo.c\r
-  FwBlockService.h\r
-  FWBlockService.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  HobLib\r
-  DebugLib\r
-  UefiRuntimeLib\r
-  DxeServicesTableLib\r
-  BaseLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  PcdLib\r
-\r
-[Guids]\r
-  gEfiEventVirtualAddressChangeGuid             # ALWAYS_CONSUMED  Create Event: EVENT_GROUP_GUID\r
-\r
-[Protocols]\r
-  gEfiFirmwareVolumeBlockProtocolGuid           # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL SOMETIMES_PRODUCED\r
-\r
-[FixedPcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase\r
-\r
-[Depex]\r
-  TRUE\r
-  \r
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h b/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h
deleted file mode 100644 (file)
index cdf6b1f..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  FwBlockService.h\r
-  \r
-Abstract:\r
-\r
-  Firmware volume block driver for Intel Firmware Hub (FWH) device\r
-\r
-**/\r
-\r
-#ifndef _FW_BLOCK_SERVICE_H\r
-#define _FW_BLOCK_SERVICE_H\r
-\r
-//\r
-// BugBug: Add documentation here for data structure!!!!\r
-//\r
-#define FVB_PHYSICAL  0\r
-#define FVB_VIRTUAL   1\r
-\r
-typedef struct {\r
-  EFI_LOCK                    FvbDevLock;\r
-  UINTN                       FvBase[2];\r
-  UINTN                       NumOfBlocks;\r
-  EFI_FIRMWARE_VOLUME_HEADER  VolumeHeader;\r
-} EFI_FW_VOL_INSTANCE;\r
-\r
-typedef struct {\r
-  UINT32              NumFv;\r
-  EFI_FW_VOL_INSTANCE *FvInstance[2];\r
-  UINT8               *FvbScratchSpace[2];\r
-} ESAL_FWB_GLOBAL;\r
-\r
-//\r
-// Fvb Protocol instance data\r
-//\r
-#define FVB_DEVICE_FROM_THIS(a)         CR (a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)\r
-#define FVB_EXTEND_DEVICE_FROM_THIS(a)  CR (a, EFI_FW_VOL_BLOCK_DEVICE, FvbExtension, FVB_DEVICE_SIGNATURE)\r
-#define FVB_DEVICE_SIGNATURE            SIGNATURE_32 ('F', 'V', 'B', 'N')\r
-\r
-typedef struct {\r
-  MEDIA_FW_VOL_DEVICE_PATH  FvDevPath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevPath;\r
-} FV_PIWG_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  MEMMAP_DEVICE_PATH          MemMapDevPath;\r
-  EFI_DEVICE_PATH_PROTOCOL    EndDevPath;\r
-} FV_MEMMAP_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  UINTN                               Signature;\r
-  EFI_DEVICE_PATH_PROTOCOL            *DevicePath;\r
-  UINTN                               Instance;\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  FwVolBlockInstance;\r
-} EFI_FW_VOL_BLOCK_DEVICE;\r
-\r
-EFI_STATUS\r
-GetFvbInfo (\r
-  IN  UINT64                            FvLength,\r
-  OUT EFI_FIRMWARE_VOLUME_HEADER        **FvbInfo\r
-  );\r
-\r
-EFI_STATUS\r
-FvbReadBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-FvbWriteBlock (\r
-  IN UINTN                                Instance,\r
-  IN CONST EFI_LBA                              Lba,\r
-  IN CONST UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN CONST UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-FvbEraseBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-FvbSetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2             *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-FvbGetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_FVB_ATTRIBUTES_2                *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-FvbGetPhysicalAddress (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_PHYSICAL_ADDRESS                *Address,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  );\r
-\r
-\r
-VOID\r
-EFIAPI\r
-FvbClassAddressChangeEvent (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  );\r
-\r
-EFI_STATUS\r
-FvbGetLbaAddress (\r
-  IN  UINTN                               Instance,\r
-  IN  EFI_LBA                             Lba,\r
-  OUT UINTN                               *LbaAddress,\r
-  OUT UINTN                               *LbaLength,\r
-  OUT UINTN                               *NumOfBlocks,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  IN  BOOLEAN                             Virtual\r
-  );\r
-\r
-//\r
-// Protocol APIs\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT EFI_FVB_ATTRIBUTES_2                              *Attributes\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolSetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2                           *Attributes\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetPhysicalAddress (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT EFI_PHYSICAL_ADDRESS                        *Address\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetBlockSize (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN CONST EFI_LBA                                     Lba,\r
-  OUT UINTN                                       *BlockSize,\r
-  OUT UINTN                                       *NumOfBlocks\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolRead (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN CONST EFI_LBA                                      Lba,\r
-  IN CONST UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolWrite (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN       EFI_LBA                                      Lba,\r
-  IN       UINTN                                        Offset,\r
-  IN OUT   UINTN                                        *NumBytes,\r
-  IN       UINT8                                        *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolEraseBlocks (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *This,\r
-  ...\r
-  );\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Common/WinNTInclude.h b/Nt32Pkg/Include/Common/WinNTInclude.h
deleted file mode 100644 (file)
index 345d15d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  WinNtLib.h\r
-\r
-Abstract:\r
-  Public include file for the WinNt Library\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_INCLUDE_H__\r
-#define __WIN_NT_INCLUDE_H__\r
-\r
-//\r
-// Win32 include files do not compile clean with /W4, so we use the warning\r
-// pragma to suppress the warnings for Win32 only. This way our code can stil\r
-// compile at /W4 (highest warning level) with /WX (warnings cause build\r
-// errors).\r
-//\r
-#pragma warning(disable : 4115)\r
-#pragma warning(disable : 4201)\r
-#pragma warning(disable : 4028)\r
-#pragma warning(disable : 4133)\r
-\r
-#define GUID  _WINNT_DUP_GUID_____\r
-#define _LIST_ENTRY  _WINNT_DUP_LIST_ENTRY_FORWARD\r
-#define LIST_ENTRY   _WINNT_DUP_LIST_ENTRY\r
-#if defined (MDE_CPU_IA32) && (_MSC_VER < 1800)\r
-#define InterlockedIncrement _WINNT_DUP_InterlockedIncrement\r
-#define InterlockedDecrement _WINNT_DUP_InterlockedDecrement\r
-#define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64\r
-#endif\r
-#undef UNALIGNED\r
-#undef CONST\r
-#undef VOID\r
-#undef DEBUG_EVENT\r
-\r
-// WQBugBug: This typedef is to make "windows.h" buildable.\r
-//                   It should be removed after the root cause why\r
-//                   size_t is undefined when go into the line below is found.\r
-#if defined (MDE_CPU_IA32)\r
-typedef UINT32 size_t ;\r
-#endif\r
-\r
-#include "windows.h"\r
-\r
-#undef GUID\r
-#undef _LIST_ENTRY\r
-#undef LIST_ENTRY\r
-#undef InterlockedIncrement\r
-#undef InterlockedDecrement\r
-#undef InterlockedCompareExchange64\r
-#undef InterlockedCompareExchangePointer\r
-#undef CreateEventEx\r
-\r
-#define VOID void\r
-\r
-//\r
-// Prevent collisions with Windows API name macros that deal with Unicode/Not issues\r
-//\r
-#undef LoadImage\r
-#undef CreateEvent\r
-\r
-//\r
-// Set the warnings back on as the EFI code must be /W4.\r
-//\r
-#pragma warning(default : 4115)\r
-#pragma warning(default : 4201)\r
-\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Guid/WinNtSystemConfig.h b/Nt32Pkg/Include/Guid/WinNtSystemConfig.h
deleted file mode 100644 (file)
index 975de36..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/**@file\r
-  Setup Variable data structure for NT32 platform.\r
-\r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_SYSTEM_CONFIGUE_H__\r
-#define __WIN_NT_SYSTEM_CONFIGUE_H__\r
-\r
-#define EFI_WIN_NT_SYSTEM_CONFIG_GUID  \\r
-  { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
-  //\r
-  // Console output mode\r
-  //\r
-  UINT32        ConOutColumn;\r
-  UINT32        ConOutRow;\r
-} WIN_NT_SYSTEM_CONFIGURATION;\r
-#pragma pack()\r
-\r
-\r
-extern EFI_GUID   gEfiWinNtSystemConfigGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Library/WinNtLib.h b/Nt32Pkg/Include/Library/WinNtLib.h
deleted file mode 100644 (file)
index a3e3152..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/** @file\r
-  Public include file for the WinNt Library\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_LIB_H__\r
-#define __WIN_NT_LIB_H__\r
-\r
-#include <Protocol/WinNtThunk.h>\r
-\r
-extern EFI_WIN_NT_THUNK_PROTOCOL  *gWinNt;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Ppi/NtAutoscan.h b/Nt32Pkg/Include/Ppi/NtAutoscan.h
deleted file mode 100644 (file)
index 130112a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  NtAutoscan.h\r
-\r
-Abstract:\r
-\r
-Nt Autoscan PPI\r
-\r
-**/\r
-\r
-#ifndef __NT_PEI_AUTOSCAN_H__\r
-#define __NT_PEI_AUTOSCAN_H__\r
-\r
-#include <WinNtDxe.h>\r
-\r
-#define PEI_NT_AUTOSCAN_PPI_GUID \\r
-  { \\r
-    0xdce384d, 0x7c, 0x4ba5, {0x94, 0xbd, 0xf, 0x6e, 0xb6, 0x4d, 0x2a, 0xa9 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *PEI_NT_AUTOSCAN) (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  * MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  This service is called from Index == 0 until it returns EFI_UNSUPPORTED.\r
-  It allows discontinuous memory regions to be supported by the emulator.\r
-  It uses gSystemMemory[] and gSystemMemoryCount that were created by\r
-  parsing the Windows environment variable EFI_MEMORY_SIZE.\r
-  The size comes from the varaible and the address comes from the call to\r
-  WinNtOpenFile. \r
-\r
-Arguments:\r
-  Index      - Which memory region to use\r
-  MemoryBase - Return Base address of memory region\r
-  MemorySize - Return size in bytes of the memory region\r
-\r
-Returns:\r
-  EFI_SUCCESS - If memory region was mapped\r
-  EFI_UNSUPPORTED - If Index is not supported\r
-\r
---*/\r
-typedef struct {\r
-  PEI_NT_AUTOSCAN NtAutoScan;\r
-} PEI_NT_AUTOSCAN_PPI;\r
-\r
-extern EFI_GUID gPeiNtAutoScanPpiGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Ppi/NtFwh.h b/Nt32Pkg/Include/Ppi/NtFwh.h
deleted file mode 100644 (file)
index 711d44d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  NtFwh.h\r
-\r
-Abstract:\r
-\r
-  WinNt FWH PPI as defined in Tiano\r
-\r
-**/\r
-\r
-#ifndef __NT_PEI_FWH_H__\r
-#define __NT_PEI_FWH_H__\r
-\r
-#include <WinNtDxe.h>\r
-\r
-#define NT_FWH_PPI_GUID \\r
-  { \\r
-    0x4e76928f, 0x50ad, 0x4334, {0xb0, 0x6b, 0xa8, 0x42, 0x13, 0x10, 0x8a, 0x57 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *NT_FWH_INFORMATION) (\r
-  IN     UINTN                  Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS   * FdBase,\r
-  IN OUT UINT64                 *FdSize\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Return the FD Size and base address. Since the FD is loaded from a \r
-  file into Windows memory only the SEC will know it's address.\r
-\r
-Arguments:\r
-  Index  - Which FD, starts at zero.\r
-  FdSize - Size of the FD in bytes\r
-  FdBase - Start address of the FD. Assume it points to an FV Header\r
-\r
-Returns:\r
-  EFI_SUCCESS     - Return the Base address and size of the FV\r
-  EFI_UNSUPPORTED - Index does nto map to an FD in the system\r
-\r
---*/\r
-typedef struct {\r
-  NT_FWH_INFORMATION  NtFwh;\r
-} NT_FWH_PPI;\r
-\r
-extern EFI_GUID gNtFwhPpiGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Ppi/NtPeiLoadFile.h b/Nt32Pkg/Include/Ppi/NtPeiLoadFile.h
deleted file mode 100644 (file)
index c961e35..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
- NtPeiLoadFile.h\r
-\r
-Abstract:\r
-\r
-  WinNt Load File PPI.\r
-\r
-  When the PEI core is done it calls the DXE IPL via PPI\r
-\r
-**/\r
-\r
-#ifndef __NT_PEI_LOAD_FILE_H__\r
-#define __NT_PEI_LOAD_FILE_H__\r
-\r
-#include <WinNtDxe.h>\r
-\r
-#define NT_PEI_LOAD_FILE_GUID \\r
-  { \\r
-    0xfd0c65eb, 0x405, 0x4cd2, {0x8a, 0xee, 0xf4, 0x0, 0xef, 0x13, 0xba, 0xc2 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *NT_PEI_LOAD_FILE) (\r
-  VOID                  *Pe32Data,\r
-  EFI_PHYSICAL_ADDRESS  *ImageAddress,\r
-  UINT64                *ImageSize,\r
-  EFI_PHYSICAL_ADDRESS  *EntryPoint\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Loads and relocates a PE/COFF image into memory.\r
-\r
-Arguments:\r
-  Pe32Data         - The base address of the PE/COFF file that is to be loaded and relocated\r
-  ImageAddress     - The base address of the relocated PE/COFF image\r
-  ImageSize        - The size of the relocated PE/COFF image\r
-  EntryPoint       - The entry point of the relocated PE/COFF image\r
-\r
-Returns:\r
-  EFI_SUCCESS   - The file was loaded and relocated\r
-  EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file\r
-\r
---*/\r
-typedef struct {\r
-  NT_PEI_LOAD_FILE  PeiLoadFileService;\r
-} NT_PEI_LOAD_FILE_PPI;\r
-\r
-extern EFI_GUID gNtPeiLoadFilePpiGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Ppi/NtThunk.h b/Nt32Pkg/Include/Ppi/NtThunk.h
deleted file mode 100644 (file)
index a585bfb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  NtThunk.h\r
-\r
-Abstract:\r
-\r
-  WinNt Thunk interface PPI\r
-\r
-**/\r
-\r
-#ifndef __NT_PEI_WIN_NT_THUNK_H__\r
-#define __NT_PEI_WIN_NT_THUNK_H__\r
-\r
-#include <WinNtDxe.h>\r
-\r
-#define PEI_NT_THUNK_PPI_GUID \\r
-  { \\r
-    0x98c281e5, 0xf906, 0x43dd, {0xa9, 0x2b, 0xb0, 0x3, 0xbf, 0x27, 0x65, 0xda } \\r
-  }\r
-\r
-typedef\r
-VOID *\r
-(EFIAPI *PEI_NT_THUNK_INTERFACE) (\r
-  VOID\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Export of EFI_WIN_NT_THUNK_PROTOCOL from the Windows SEC.\r
-\r
-Arguments:\r
-  InterfaceBase - Address of the EFI_WIN_NT_THUNK_PROTOCOL\r
-\r
-Returns:\r
-  EFI_SUCCESS - Data returned\r
-\r
---*/\r
-typedef struct {\r
-  PEI_NT_THUNK_INTERFACE  NtThunk;\r
-} PEI_NT_THUNK_PPI;\r
-\r
-extern EFI_GUID gPeiNtThunkPpiGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Protocol/WinNtIo.h b/Nt32Pkg/Include/Protocol/WinNtIo.h
deleted file mode 100644 (file)
index 00a7128..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtIo.h\r
-\r
-Abstract:\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_IO_H__\r
-#define __WIN_NT_IO_H__\r
-\r
-#include <Protocol/WinNtThunk.h>\r
-\r
-#define EFI_WIN_NT_IO_PROTOCOL_GUID \\r
-  { 0x96eb4ad6, 0xa32a, 0x11d4, { 0xbc, 0xfd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
-\r
-extern EFI_GUID gEfiWinNtIoProtocolGuid;\r
-\r
-typedef struct {\r
-  EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
-  EFI_GUID                  *TypeGuid;\r
-  CHAR16                    *EnvString;\r
-  UINT16                    InstanceNumber;\r
-} EFI_WIN_NT_IO_PROTOCOL;\r
-\r
-//\r
-// The following GUIDs are used in EFI_WIN_NT_IO_PROTOCOL_GUID\r
-// Device paths. They map 1:1 with NT envirnment variables. The variables\r
-// define what virtual hardware the emulator/WinNtBusDriver will produce.\r
-//\r
-//\r
-// EFI_WIN_NT_VIRTUAL_DISKS\r
-//\r
-#define EFI_WIN_NT_VIRTUAL_DISKS_GUID \\r
-  { \\r
-    0xc95a928, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtVirtualDisksGuid;\r
-\r
-//\r
-// EFI_WIN_NT_PHYSICAL_DISKS\r
-//\r
-#define EFI_WIN_NT_PHYSICAL_DISKS_GUID \\r
-  { \\r
-    0xc95a92f, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtPhysicalDisksGuid;\r
-\r
-//\r
-// EFI_WIN_NT_FILE_SYSTEM\r
-//\r
-#define EFI_WIN_NT_FILE_SYSTEM_GUID \\r
-  { \\r
-    0xc95a935, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtFileSystemGuid;\r
-\r
-//\r
-// EFI_WIN_NT_SERIAL_PORT\r
-//\r
-#define EFI_WIN_NT_SERIAL_PORT_GUID \\r
-  { \\r
-    0xc95a93d, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtSerialPortGuid;\r
-\r
-//\r
-// EFI_WIN_NT_UGA\r
-//\r
-#define EFI_WIN_NT_UGA_GUID \\r
-  { \\r
-    0xab248e99, 0xabe1, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtUgaGuid;\r
-\r
-//\r
-// EFI_WIN_NT_GOP\r
-//\r
-#define EFI_WIN_NT_GOP_GUID \\r
-  { \\r
-    0x4e11e955, 0xccca, 0x11d4, 0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtGopGuid;\r
-\r
-//\r
-// EFI_WIN_NT_CONSOLE\r
-//\r
-#define EFI_WIN_NT_CONSOLE_GUID \\r
-  { \\r
-    0xba73672c, 0xa5d3, 0x11d4, {0xbd, 0x0, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtConsoleGuid;\r
-\r
-//\r
-// EFI_WIN_NT_MEMORY\r
-//\r
-#define EFI_WIN_NT_MEMORY_GUID \\r
-  { \\r
-    0x99042912, 0x122a, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtMemoryGuid;\r
-\r
-//\r
-// EFI_WIN_NT_CPU_MODEL\r
-//\r
-#define EFI_WIN_NT_CPU_MODEL_GUID \\r
-  { \\r
-    0xbee9b6ce, 0x2f8a, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtCPUModelGuid;\r
-\r
-//\r
-// EFI_WIN_NT_CPU_SPEED\r
-//\r
-#define EFI_WIN_NT_CPU_SPEED_GUID \\r
-  { \\r
-    0xd4f29055, 0xe1fb, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtCPUSpeedGuid;\r
-\r
-//\r
-// EFI_WIN_NT_PASS_THROUGH\r
-//\r
-#define EFI_WIN_NT_PASS_THROUGH_GUID \\r
-  { \\r
-    0xcc664eb8, 0x3c24, 0x4086, {0xb6, 0xf6, 0x34, 0xe8, 0x56, 0xbc, 0xe3, 0x6e } \\r
-  }\r
-\r
-extern EFI_GUID gEfiWinNtPassThroughGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/Protocol/WinNtThunk.h b/Nt32Pkg/Include/Protocol/WinNtThunk.h
deleted file mode 100644 (file)
index 847f67b..0000000
+++ /dev/null
@@ -1,1287 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtThunk.h\r
-\r
-Abstract:\r
-\r
-  This protocol allows an EFI driver (DLL) in the NT emulation envirnment\r
-  to make Win32 API calls.\r
-\r
-  NEVER make a Win32 call directly, always make the call via this protocol.\r
-\r
-  There are no This pointers on the protocol member functions as they map\r
-  exactly into Win32 system calls.\r
-\r
-  YOU MUST include EfiWinNT.h in place of Efi.h to make this file compile.\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_THUNK_H__\r
-#define __WIN_NT_THUNK_H__\r
-\r
-#include <Common/WinNtInclude.h>\r
-\r
-#define EFI_WIN_NT_THUNK_PROTOCOL_GUID \\r
-  { 0x58c518b1, 0x76f3, 0x11d4, { 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtSleep) (\r
-  DWORD Milliseconds\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtSuspendThread) (\r
-  HANDLE hThread\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtGetCurrentThread) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetCurrentThreadId) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtGetCurrentProcess) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtCreateThread) (\r
-  LPSECURITY_ATTRIBUTES   lpThreadAttributes,\r
-  DWORD                   dwStackSize,\r
-  LPTHREAD_START_ROUTINE  lpStartAddress,\r
-  LPVOID                  lpParameter,\r
-  DWORD                   dwCreationFlags,\r
-  LPDWORD                 lpThreadId\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtTerminateThread) (\r
-  HANDLE hThread,\r
-  DWORD  dwExitCode\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSendMessage) (\r
-  HWND    hWnd,\r
-  UINT    Msg,\r
-  WPARAM  wParam,\r
-  LPARAM  lParam\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtExitThread) (\r
-  DWORD   dwExitCode\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtResumeThread) (\r
-  HANDLE hThread\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetThreadPriority) (\r
-  HANDLE    hThread,\r
-  INTN      nPriority\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtInitializeCriticalSection) (\r
-  LPCRITICAL_SECTION lpCriticalSection\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtDeleteCriticalSection) (\r
-  LPCRITICAL_SECTION lpCriticalSection\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtEnterCriticalSection) (\r
-  LPCRITICAL_SECTION lpCriticalSection\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtLeaveCriticalSection) (\r
-  LPCRITICAL_SECTION lpCriticalSection\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtTlsAlloc) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-LPVOID\r
-(WINAPI *WinNtTlsGetValue) (\r
-  DWORD dwTlsIndex\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtTlsSetValue) (\r
-  DWORD  dwTlsIndex,\r
-  LPVOID lpTlsValue\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtTlsFree) (\r
-  DWORD dwTlsIndex\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtCreateSemaphore) (\r
-  LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,\r
-  LONG                  lInitialCount,\r
-  LONG                  lMaximumCount,\r
-  LPCWSTR               lpName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtWaitForSingleObject) (\r
-  HANDLE  hHandle,\r
-  DWORD   dwMilliseconds\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtReleaseSemaphore) (\r
-  HANDLE  hSemaphore,\r
-  LONG    lReleaseCount,\r
-  LPLONG  lpPreviousCount\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtDuplicateHandle) (\r
-  HANDLE   hSourceProcessHandle,\r
-  HANDLE   hSourceHandle,\r
-  HANDLE   hTargetProcessHandle,\r
-  LPHANDLE lpTargetHandle,\r
-  DWORD    dwDesiredAccess,\r
-  BOOL     bInheritHandle,\r
-  DWORD    dwOptions\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtCreateConsoleScreenBuffer) (\r
-  DWORD                       DesiredAccess,\r
-  DWORD                       ShareMode,\r
-  CONST SECURITY_ATTRIBUTES   *SecurityAttributes,\r
-  DWORD                       Flags,\r
-  LPVOID                      ScreenBufferData\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetConsoleScreenBufferSize) (\r
-  HANDLE  ConsoleOutput,\r
-  COORD   Size\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetConsoleActiveScreenBuffer) (\r
-  HANDLE  ConsoleOutput\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFillConsoleOutputAttribute) (\r
-  HANDLE  ConsoleOutput,\r
-  WORD    Attribute,\r
-  DWORD   Length,\r
-  COORD   WriteCoord,\r
-  LPDWORD NumberOfAttrsWritten\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFillConsoleOutputCharacter) (\r
-  HANDLE  ConsoleOutput,\r
-  TCHAR   Character,\r
-  DWORD   Length,\r
-  COORD   WriteCoord,\r
-  LPDWORD NumberOfCharsWritten\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtWriteConsoleOutput) (\r
-  HANDLE          ConsoleOutput,\r
-  CONST CHAR_INFO *Buffer,\r
-  COORD           BufferSize,\r
-  COORD           BufferCoord,\r
-  PSMALL_RECT     WriteRegion\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtScrollConsoleScreenBuffer) (\r
-  HANDLE            ConsoleOutput,\r
-  CONST SMALL_RECT  *ScrollRectangle,\r
-  CONST SMALL_RECT  *ClipRectangle,\r
-  COORD             DestinationOrigin,\r
-  CONST CHAR_INFO   *Fill\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetConsoleTitleW) (\r
-  LPCTSTR   ConsoleTitle\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetConsoleCursorInfo) (\r
-  HANDLE                ConsoleOutput,\r
-  PCONSOLE_CURSOR_INFO  ConsoleCursorInfo\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetConsoleCursorInfo) (\r
-  HANDLE                      ConsoleOutput,\r
-  CONST CONSOLE_CURSOR_INFO   *ConsoleCursorInfo\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetPriorityClass) (\r
-  HANDLE  Process,\r
-  DWORD   PriorityClass\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtWriteConsoleInput) (\r
-  HANDLE              ConsoleInput,\r
-  CONST INPUT_RECORD  *Buffer,\r
-  DWORD               Legnth,\r
-  LPDWORD             NumberOfEventsWritten\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetNumberOfConsoleInputEvents) (\r
-  HANDLE              ConsoleInput,\r
-  LPDWORD             NumberOfEvents\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtGetStdHandle) (\r
-  DWORD   StdHandle\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtReadConsoleInput) (\r
-  HANDLE              ConsoleInput,\r
-  PINPUT_RECORD       Buffer,\r
-  DWORD               Length,\r
-  LPDWORD             NumberOfEventsRead\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtPeekConsoleInput) (\r
-  HANDLE              ConsoleInput,\r
-  PINPUT_RECORD       Buffer,\r
-  DWORD               Length,\r
-  LPDWORD             NumberOfEventsRead\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetConsoleCursorPosition) (\r
-  HANDLE              ConsoleInput,\r
-  COORD               CursorPosition\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtCreateFile) (\r
-  LPCWSTR               FileName,\r
-  DWORD                 DesiredAccess,\r
-  DWORD                 SharedMode,\r
-  LPSECURITY_ATTRIBUTES SecurityAttributes,\r
-  DWORD                 CreationDisposition,\r
-  DWORD                 FlagsAndAttributes,\r
-  HANDLE                TemplateFile\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtDeviceIoControl) (\r
-  HANDLE                DeviceHandle,\r
-  DWORD                 IoControlCode,\r
-  LPVOID                InBuffer,\r
-  DWORD                 InBufferSize,\r
-  LPVOID                OutBuffer,\r
-  DWORD                 OutBufferSize,\r
-  LPDWORD               BytesReturned,\r
-  LPOVERLAPPED          Overlapped\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtCreateDirectory) (\r
-  LPCWSTR               PathName,\r
-  LPSECURITY_ATTRIBUTES SecurityAttributes\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtRemoveDirectory) (\r
-  LPCWSTR               PathName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetFileAttributes) (\r
-  LPCWSTR               FileName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetFileAttributes) (\r
-  LPCWSTR               FileName,\r
-  DWORD                 FileAttributes\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtCreateFileMapping) (\r
-  HANDLE                  FileHandle,\r
-  LPSECURITY_ATTRIBUTES   Attributes,\r
-  DWORD                   Protect,\r
-  DWORD                   MaximumSizeHigh,\r
-  DWORD                   MaximumSizeLow,\r
-  LPCTSTR                 Name\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-LPVOID\r
-(WINAPI *WinNtMapViewOfFileEx) (\r
-  HANDLE                  FileHandle,\r
-  DWORD                   DesiredAccess,\r
-  DWORD                   FileOffsetHigh,\r
-  DWORD                   FileOffsetLow,\r
-  DWORD                   NumberOfBytesToMap,\r
-  LPVOID                  BaseAddress\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetEnvironmentVariable) (\r
-  LPCTSTR Name,\r
-  LPTSTR  Buffer,\r
-  DWORD   Size\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtCloseHandle) (\r
-  HANDLE    Object\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtSetFilePointer) (\r
-  HANDLE    FileHandle,\r
-  LONG      DistanceToMove,\r
-  PLONG     DistanceToHoveHigh,\r
-  DWORD     MoveMethod\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetEndOfFile) (\r
-  HANDLE    FileHandle\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtReadFile) (\r
-  HANDLE        FileHandle,\r
-  LPVOID        Buffer,\r
-  DWORD         NumberOfBytesToRead,\r
-  LPDWORD       NumberOfBytesRead,\r
-  LPOVERLAPPED  Overlapped\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtWriteFile) (\r
-  HANDLE        FileHandle,\r
-  LPCVOID       Buffer,\r
-  DWORD         NumberOfBytesToWrite,\r
-  LPDWORD       NumberOfBytesWritten,\r
-  LPOVERLAPPED  Overlapped\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetFileInformationByHandle) (\r
-  HANDLE                      FileHandle,\r
-  BY_HANDLE_FILE_INFORMATION  *FileInfo\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetDiskFreeSpace) (\r
-  LPCTSTR     RootPathName,\r
-  LPDWORD     SectorsPerCluster,\r
-  LPDWORD     BytesPerSector,\r
-  LPDWORD     NumberOfFreeClusters,\r
-  LPDWORD     TotalNumberOfClusters\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetDiskFreeSpaceEx) (\r
-  LPCTSTR             DirectoryName,\r
-  PULARGE_INTEGER     FreeBytesAvailable,\r
-  PULARGE_INTEGER     TotalNumberOfBytes,\r
-  PULARGE_INTEGER     TotoalNumberOfFreeBytes\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtMoveFile) (\r
-  LPCTSTR     ExistingFileName,\r
-  LPCTSTR     NewFileName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetFileTime) (\r
-  HANDLE      FileHandle,\r
-  FILETIME    *CreationTime,\r
-  FILETIME    *LastAccessTime,\r
-  FILETIME    *LastWriteTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSystemTimeToFileTime) (\r
-  SYSTEMTIME  * SystemTime,\r
-  FILETIME    * FileTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtDeleteFile) (\r
-  LPCTSTR   FileName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFlushFileBuffers) (\r
-  HANDLE\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetLastError) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-UINT\r
-(WINAPI *WinNtSetErrorMode) (\r
-  UINT  Mode\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetTickCount) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HMODULE\r
-(WINAPI *WinNtLoadLibraryEx) (\r
-  LPCTSTR LibFileName,\r
-  HANDLE  FileHandle,\r
-  DWORD   Flags\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-FARPROC\r
-(WINAPI *WinNtGetProcAddress) (\r
-  HMODULE Module,\r
-  LPCSTR  ProcName\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtGetTimeZoneInformation) (\r
-  LPTIME_ZONE_INFORMATION timeZoneInformation\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-MMRESULT\r
-(WINAPI *WinNttimeSetEvent) (\r
-  UINT           uDelay,\r
-  UINT           uResolution,\r
-  LPTIMECALLBACK lpTimeProc,\r
-  DWORD_PTR      dwUser,\r
-  UINT           fuEvent\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-MMRESULT\r
-(WINAPI *WinNttimeKillEvent) (\r
-  UINT           uTimerID\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-DWORD\r
-(WINAPI *WinNtSetTimeZoneInformation) (\r
-  LPTIME_ZONE_INFORMATION timeZoneInformation\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtGetSystemTime) (\r
-  LPSYSTEMTIME        SystemTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetSystemTime) (\r
-  CONST SYSTEMTIME    *SystemTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtGetLocalTime) (\r
-  LPSYSTEMTIME        SystemTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetLocalTime) (\r
-  CONST SYSTEMTIME    *SystemTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtLocalFileTimeToFileTime) (\r
-  CONST FILETIME  *LocalFileTime,\r
-  LPFILETIME      FileTime\r
-  );\r
-\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFileTimeToLocalFileTime) (\r
-  CONST FILETIME  *FileTime,\r
-  LPFILETIME      LocalFileTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFileTimeToSystemTime) (\r
-  CONST FILETIME  *FileTime,\r
-  LPSYSTEMTIME    SystemTime\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-HANDLE\r
-(WINAPI *WinNtFindFirstFile) (\r
-  LPCTSTR           FileName,\r
-  LPWIN32_FIND_DATA FindFileData\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFindNextFile) (\r
-  HANDLE            FindFile,\r
-  LPWIN32_FIND_DATA FindFileData\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFindClose) (\r
-  HANDLE            FindFile\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetCommState) (\r
-  HANDLE  FileHandle,\r
-  LPDCB   DCB\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetCommState) (\r
-  HANDLE  FileHandle,\r
-  LPDCB   DCB\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetCommState) (\r
-  HANDLE  FileHandle,\r
-  LPDCB   DCB\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtSetCommTimeouts) (\r
-  HANDLE          FileHandle,\r
-  LPCOMMTIMEOUTS  CommTimeouts\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-VOID\r
-(WINAPI *WinNtExitProcess) (\r
-  UINT uExitCode  // exit code for all threads\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtPurgeComm) (\r
-  HANDLE  FileHandle,\r
-  DWORD   Flags\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtEscapeCommFunction) (\r
-  HANDLE  FileHandle,\r
-  DWORD   Func\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtGetCommModemStatus) (\r
-  HANDLE  FileHandle,\r
-  LPDWORD ModemStat\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtClearCommError) (\r
-  HANDLE    FileHandle,\r
-  LPDWORD   Errors,\r
-  LPCOMSTAT Stat\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-INT32\r
-(WINAPIV *WinNtSprintf) (\r
-  LPWSTR    Buffer,\r
-  size_t    Count,\r
-  LPCWSTR   String,\r
-  ...\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HWND\r
-(WINAPI *WinNtGetDesktopWindow) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HWND\r
-(WINAPI *WinNtGetForegroundWindow) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HWND\r
-(WINAPI *WinNtCreateWindowEx) (\r
-  DWORD     dwExStyle,\r
-  LPCTSTR   lpClassName,\r
-  LPCTSTR   lpWindowName,\r
-  DWORD     dwStyle,\r
-  INT32     x,\r
-  INT32     y,\r
-  INT32     nWidth,\r
-  INT32     nHeight,\r
-  HWND      hWndParent,\r
-  HMENU     hMenu,\r
-  HINSTANCE hInstance,\r
-  LPVOID    *lpParam\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtUpdateWindow) (\r
-  HWND      hWnd\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtShowWindow) (\r
-  HWND        hWnd,\r
-  INT32       nCmdShow\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtDestroyWindow) (\r
-  HWND    hWnd\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HDC\r
-(WINAPI *WinNtGetWindowDC) (\r
-  HWND    hWnd\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtGetClientRect) (\r
-  HWND    hWnd,\r
-  LPRECT  lpRect\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtAdjustWindowRect) (\r
-  LPRECT  lpRect,\r
-  DWORD   dwStyle,\r
-  BOOL    bMenu\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-INT32\r
-(WINAPI *WinNtSetDIBitsToDevice) (\r
-  HDC,\r
-  INT32,\r
-  INT32,\r
-  DWORD,\r
-  DWORD,\r
-  INT32,\r
-  INT32,\r
-  UINT,\r
-  UINT,\r
-  CONST VOID       *,\r
-  CONST BITMAPINFO *,\r
-  UINT\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtBitBlt) (\r
-  HDC,\r
-  INT32,\r
-  INT32,\r
-  INT32,\r
-  INT32,\r
-  HDC,\r
-  INT32,\r
-  INT32,\r
-  DWORD\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtInvalidateRect) (\r
-  HWND        hWnd,\r
-  CONST RECT  *lpRect,\r
-  BOOL        bErase\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HDC\r
-(WINAPI *WinNtGetDC) (\r
-  HWND    hWnd\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-INT32\r
-(WINAPI *WinNtReleaseDC) (\r
-  HWND    hWnd,\r
-  HDC     hDC\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-ATOM\r
-(WINAPI *WinNtRegisterClassEx) (\r
-  CONST   WNDCLASSEX *\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtUnregisterClass) (\r
-  LPCTSTR   lpClassName,\r
-  HINSTANCE hInstance\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HDC\r
-(WINAPI *WinNtBeginPaint) (\r
-  HWND          hWnd,\r
-  LPPAINTSTRUCT lpPaint\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtEndPaint) (\r
-  HWND                hWnd,\r
-  CONST PAINTSTRUCT   *lpPaint\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-VOID\r
-(WINAPI *WinNtPostQuitMessage) (\r
-  INT32   nExitCode\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-LRESULT\r
-(WINAPI *WinNtDefWindowProc) (\r
-  HWND    hWnd,\r
-  UINT    Msg,\r
-  WPARAM  wParam,\r
-  LPARAM  lParam\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HICON\r
-(WINAPI *WinNtLoadIcon) (\r
-  HINSTANCE hInstance,\r
-  LPCTSTR   lpIconName\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HCURSOR\r
-(WINAPI *WinNtLoadCursor) (\r
-  HINSTANCE   hInstance,\r
-  LPCTSTR     lpCursorName\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-HGDIOBJ\r
-(WINAPI *WinNtGetStockObject) (\r
-  INT32\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtSetViewportOrgEx) (\r
-  HDC,\r
-  INT32,\r
-  INT32,\r
-  LPPOINT\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtSetWindowOrgEx) (\r
-  HDC,\r
-  INT32,\r
-  INT32,\r
-  LPPOINT\r
-  );\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtMoveWindow) (\r
-  HWND,\r
-  INT32,\r
-  INT32,\r
-  INT32,\r
-  INT32,\r
-  BOOL\r
-  );\r
-\r
-typedef\r
-WINGDIAPI\r
-BOOL\r
-(WINAPI *WinNtGetWindowRect) (\r
-  HWND,\r
-  LPRECT\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtGetMessage) (\r
-  LPMSG     lpMsg,\r
-  HWND      hWnd,\r
-  UINT      wMsgFilterMin,\r
-  UINT      wMsgFilterMax\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtTranslateMessage) (\r
-  CONST MSG *lpMsg\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtDispatchMessage) (\r
-  CONST MSG *lpMsg\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-HANDLE\r
-(WINAPI *WinNtGetProcessHeap) ();\r
-\r
-typedef\r
-WINUSERAPI\r
-LPVOID\r
-(WINAPI *WinNtHeapAlloc) (\r
-  HANDLE  hHeap,\r
-  DWORD   dwFlags,\r
-  SIZE_T  dwBytes\r
-  );\r
-\r
-typedef\r
-WINUSERAPI\r
-BOOL\r
-(WINAPI *WinNtHeapFree) (\r
-  HANDLE  hHeap,\r
-  DWORD   dwFlags,\r
-  LPVOID  lpMem\r
-  );\r
-\r
-typedef\r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtFreeLibrary) (\r
-  HANDLE  ModHandle\r
-  );\r
-typedef  \r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtQueryPerformanceCounter) (\r
-  LARGE_INTEGER  *PerformanceCount\r
-  );\r
-  \r
-typedef  \r
-WINBASEAPI\r
-BOOL\r
-(WINAPI *WinNtQueryPerformanceFrequency) (\r
-  LARGE_INTEGER  *Frequency\r
-  );\r
-//\r
-//\r
-//\r
-\r
-#define EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE SIGNATURE_32 ('N', 'T', 'T', 'T')\r
-\r
-typedef struct {\r
-  UINT64                              Signature;\r
-\r
-  //\r
-  // Win32 Process APIs\r
-  //\r
-  WinNtGetProcAddress                 GetProcAddress;\r
-  WinNtGetTickCount                   GetTickCount;\r
-  WinNtLoadLibraryEx                  LoadLibraryEx;\r
-  WinNtFreeLibrary                    FreeLibrary;\r
-\r
-  WinNtSetPriorityClass               SetPriorityClass;\r
-  WinNtSetThreadPriority              SetThreadPriority;\r
-  WinNtSleep                          Sleep;\r
-\r
-  WinNtSuspendThread                  SuspendThread;\r
-  WinNtGetCurrentThread               GetCurrentThread;\r
-  WinNtGetCurrentThreadId             GetCurrentThreadId;\r
-  WinNtGetCurrentProcess              GetCurrentProcess;\r
-  WinNtCreateThread                   CreateThread;\r
-  WinNtTerminateThread                TerminateThread;\r
-  WinNtSendMessage                    SendMessage;\r
-  WinNtExitThread                     ExitThread;\r
-  WinNtResumeThread                   ResumeThread;\r
-  WinNtDuplicateHandle                DuplicateHandle;\r
-\r
-  //\r
-  // Wint32 Mutex primitive\r
-  //\r
-  WinNtInitializeCriticalSection      InitializeCriticalSection;\r
-  WinNtEnterCriticalSection           EnterCriticalSection;\r
-  WinNtLeaveCriticalSection           LeaveCriticalSection;\r
-  WinNtDeleteCriticalSection          DeleteCriticalSection;\r
-  WinNtTlsAlloc                       TlsAlloc;\r
-  WinNtTlsFree                        TlsFree;\r
-  WinNtTlsSetValue                    TlsSetValue;\r
-  WinNtTlsGetValue                    TlsGetValue;\r
-  WinNtCreateSemaphore                CreateSemaphore;\r
-  WinNtWaitForSingleObject            WaitForSingleObject;\r
-  WinNtReleaseSemaphore               ReleaseSemaphore;\r
-\r
-  //\r
-  // Win32 Console APIs\r
-  //\r
-  WinNtCreateConsoleScreenBuffer      CreateConsoleScreenBuffer;\r
-  WinNtFillConsoleOutputAttribute     FillConsoleOutputAttribute;\r
-  WinNtFillConsoleOutputCharacter     FillConsoleOutputCharacter;\r
-  WinNtGetConsoleCursorInfo           GetConsoleCursorInfo;\r
-  WinNtGetNumberOfConsoleInputEvents  GetNumberOfConsoleInputEvents;\r
-  WinNtPeekConsoleInput               PeekConsoleInput;\r
-  WinNtScrollConsoleScreenBuffer      ScrollConsoleScreenBuffer;\r
-  WinNtReadConsoleInput               ReadConsoleInput;\r
-\r
-  WinNtSetConsoleActiveScreenBuffer   SetConsoleActiveScreenBuffer;\r
-  WinNtSetConsoleCursorInfo           SetConsoleCursorInfo;\r
-  WinNtSetConsoleCursorPosition       SetConsoleCursorPosition;\r
-  WinNtSetConsoleScreenBufferSize     SetConsoleScreenBufferSize;\r
-  WinNtSetConsoleTitleW               SetConsoleTitleW;\r
-  WinNtWriteConsoleInput              WriteConsoleInput;\r
-  WinNtWriteConsoleOutput             WriteConsoleOutput;\r
-\r
-  //\r
-  // Win32 File APIs\r
-  //\r
-  WinNtCreateFile                     CreateFile;\r
-  WinNtDeviceIoControl                DeviceIoControl;\r
-  WinNtCreateDirectory                CreateDirectory;\r
-  WinNtRemoveDirectory                RemoveDirectory;\r
-  WinNtGetFileAttributes              GetFileAttributes;\r
-  WinNtSetFileAttributes              SetFileAttributes;\r
-  WinNtCreateFileMapping              CreateFileMapping;\r
-  WinNtCloseHandle                    CloseHandle;\r
-  WinNtDeleteFile                     DeleteFile;\r
-  WinNtFindFirstFile                  FindFirstFile;\r
-  WinNtFindNextFile                   FindNextFile;\r
-  WinNtFindClose                      FindClose;\r
-  WinNtFlushFileBuffers               FlushFileBuffers;\r
-  WinNtGetEnvironmentVariable         GetEnvironmentVariable;\r
-  WinNtGetLastError                   GetLastError;\r
-  WinNtSetErrorMode                   SetErrorMode;\r
-  WinNtGetStdHandle                   GetStdHandle;\r
-  WinNtMapViewOfFileEx                MapViewOfFileEx;\r
-  WinNtReadFile                       ReadFile;\r
-  WinNtSetEndOfFile                   SetEndOfFile;\r
-  WinNtSetFilePointer                 SetFilePointer;\r
-  WinNtWriteFile                      WriteFile;\r
-  WinNtGetFileInformationByHandle     GetFileInformationByHandle;\r
-  WinNtGetDiskFreeSpace               GetDiskFreeSpace;\r
-  WinNtGetDiskFreeSpaceEx             GetDiskFreeSpaceEx;\r
-  WinNtMoveFile                       MoveFile;\r
-  WinNtSetFileTime                    SetFileTime;\r
-  WinNtSystemTimeToFileTime           SystemTimeToFileTime;\r
-\r
-  //\r
-  // Win32 Time APIs\r
-  //\r
-  WinNtLocalFileTimeToFileTime        LocalFileTimeToFileTime;\r
-  WinNtFileTimeToLocalFileTime        FileTimeToLocalFileTime;\r
-  WinNtFileTimeToSystemTime           FileTimeToSystemTime;\r
-  WinNtGetSystemTime                  GetSystemTime;\r
-  WinNtSetSystemTime                  SetSystemTime;\r
-  WinNtGetLocalTime                   GetLocalTime;\r
-  WinNtSetLocalTime                   SetLocalTime;\r
-  WinNtGetTimeZoneInformation         GetTimeZoneInformation;\r
-  WinNtSetTimeZoneInformation         SetTimeZoneInformation;\r
-  WinNttimeSetEvent                   timeSetEvent;\r
-  WinNttimeKillEvent                  timeKillEvent;\r
-\r
-  //\r
-  // Win32 Serial APIs\r
-  //\r
-  WinNtClearCommError                 ClearCommError;\r
-  WinNtEscapeCommFunction             EscapeCommFunction;\r
-  WinNtGetCommModemStatus             GetCommModemStatus;\r
-  WinNtGetCommState                   GetCommState;\r
-  WinNtSetCommState                   SetCommState;\r
-  WinNtPurgeComm                      PurgeComm;\r
-  WinNtSetCommTimeouts                SetCommTimeouts;\r
-\r
-  WinNtExitProcess                    ExitProcess;\r
-\r
-  WinNtSprintf                        SPrintf;\r
-\r
-  WinNtGetDesktopWindow               GetDesktopWindow;\r
-  WinNtGetForegroundWindow            GetForegroundWindow;\r
-  WinNtCreateWindowEx                 CreateWindowEx;\r
-  WinNtShowWindow                     ShowWindow;\r
-  WinNtUpdateWindow                   UpdateWindow;\r
-  WinNtDestroyWindow                  DestroyWindow;\r
-  WinNtInvalidateRect                 InvalidateRect;\r
-  WinNtGetWindowDC                    GetWindowDC;\r
-  WinNtGetClientRect                  GetClientRect;\r
-  WinNtAdjustWindowRect               AdjustWindowRect;\r
-  WinNtSetDIBitsToDevice              SetDIBitsToDevice;\r
-  WinNtBitBlt                         BitBlt;\r
-  WinNtGetDC                          GetDC;\r
-  WinNtReleaseDC                      ReleaseDC;\r
-  WinNtRegisterClassEx                RegisterClassEx;\r
-  WinNtUnregisterClass                UnregisterClass;\r
-\r
-  WinNtBeginPaint                     BeginPaint;\r
-  WinNtEndPaint                       EndPaint;\r
-  WinNtPostQuitMessage                PostQuitMessage;\r
-  WinNtDefWindowProc                  DefWindowProc;\r
-  WinNtLoadIcon                       LoadIcon;\r
-  WinNtLoadCursor                     LoadCursor;\r
-  WinNtGetStockObject                 GetStockObject;\r
-  WinNtSetViewportOrgEx               SetViewportOrgEx;\r
-  WinNtSetWindowOrgEx                 SetWindowOrgEx;\r
-  WinNtMoveWindow                     MoveWindow;\r
-  WinNtGetWindowRect                  GetWindowRect;\r
-\r
-  WinNtGetMessage                     GetMessage;\r
-  WinNtTranslateMessage               TranslateMessage;\r
-  WinNtDispatchMessage                DispatchMessage;\r
-\r
-  WinNtGetProcessHeap                 GetProcessHeap;\r
-  WinNtHeapAlloc                      HeapAlloc;\r
-  WinNtHeapFree                       HeapFree;\r
-  \r
-  WinNtQueryPerformanceCounter        QueryPerformanceCounter;\r
-  WinNtQueryPerformanceFrequency      QueryPerformanceFrequency;\r
-  \r
-} EFI_WIN_NT_THUNK_PROTOCOL;\r
-\r
-extern EFI_GUID gEfiWinNtThunkProtocolGuid;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Include/WinNtDxe.h b/Nt32Pkg/Include/WinNtDxe.h
deleted file mode 100644 (file)
index c57ab93..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  WinNtLib.h\r
-\r
-Abstract:\r
-  Public include file for the WinNt Library\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_DXE_H__\r
-#define __WIN_NT_DXE_H__\r
-\r
-//\r
-// This forces Windows.h WIN32 include file to be included\r
-//  it's needed for WinNtThunk.h\r
-//  WinNtIo.h depends on WinNtThunk.h\r
-//\r
-#include <Common/WinNtInclude.h>\r
-#endif\r
diff --git a/Nt32Pkg/Include/WinNtPeim.h b/Nt32Pkg/Include/WinNtPeim.h
deleted file mode 100644 (file)
index 57d66a2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  WinNtLib.h\r
-\r
-Abstract:\r
-  Public include file for the WinNt Library\r
-\r
-**/\r
-\r
-#ifndef __WIN_NT_PEIM_H__\r
-#define __WIN_NT_PEIM_H__\r
-\r
-//\r
-// This forces Windows.h WIN32 include file to be included\r
-//  it's needed for WinNtThunk.h\r
-//\r
-#include <Common/WinNtInclude.h>\r
-\r
-#include <Protocol/WinNtThunk.h>\r
-\r
-#endif\r
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf
deleted file mode 100644 (file)
index dd98ba1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file\r
-# Memory Status Code Library for UEFI drivers\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-# \r
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = DxeNt32OemHookStatusCodeLib\r
-  FILE_GUID                      = EF172A23-C7C5-47b7-B24E-D10DFE15540F\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = OemHookStatusCodeLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION\r
-#\r
-\r
-[Sources]\r
-  Nt32OemHookStatusCodeLib.c\r
-\r
-\r
-[Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  ReportStatusCodeLib\r
-  BaseMemoryLib\r
-  PrintLib\r
-  HobLib\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiWinNtThunkProtocolGuid                    # ALWAYS_CONSUMED\r
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
deleted file mode 100644 (file)
index a69dc33..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/** @file\r
-  OEM hook status code library functions with no library constructor/destructor\r
-\r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-  Module Name:  Nt32OemHookStatusCodeLib.c\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <WinNtDxe.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/OemHookStatusCodeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-\r
-//\r
-// Cache of WinNtThunk protocol\r
-//\r
-EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt;\r
-\r
-//\r
-// Cache of standard output handle .\r
-//\r
-HANDLE                      mStdOut;\r
-\r
-/**\r
-\r
-  Initialize OEM status code device .\r
-\r
-  @return    Always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeInitialize (\r
-  VOID\r
-  )\r
-{\r
-  EFI_HOB_GUID_TYPE   *GuidHob;\r
-\r
-  //\r
-  // Retrieve WinNtThunkProtocol from GUID'ed HOB\r
-  //\r
-  GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (mWinNt != NULL);\r
-\r
-  //\r
-  // Cache standard output handle.\r
-  //\r
-  mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Report status code to OEM device.\r
-\r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  For progress codes, the operation is the current activity.\r
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time.\r
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\r
-  @param  CallerId      This optional parameter may be used to identify the caller.\r
-                        This parameter allows the status code driver to apply different rules to different callers.\r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
-\r
-  @return               The function always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeReport (\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId, OPTIONAL\r
-  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
-  )\r
-{\r
-  CHAR8           *Filename;\r
-  CHAR8           *Description;\r
-  CHAR8           *Format;\r
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-  UINT32          ErrorLevel;\r
-  UINT32          LineNumber;\r
-  UINTN           CharCount;\r
-  BASE_LIST       Marker;\r
-\r
-  Buffer[0] = '\0';\r
-\r
-  if (Data != NULL &&\r
-      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-    //\r
-    // Print ASSERT() information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "\n\rASSERT!: %a (%d): %a\n\r",\r
-                  Filename,\r
-                  LineNumber,\r
-                  Description\r
-                  );\r
-\r
-    //\r
-    // Callout to standard output.\r
-    //\r
-    mWinNt->WriteFile (\r
-              mStdOut,\r
-              Buffer,\r
-              (DWORD)CharCount,\r
-              (LPDWORD)&CharCount,\r
-              NULL\r
-              );\r
-\r
-    return EFI_SUCCESS;\r
-\r
-  } else if (Data != NULL &&\r
-             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
-    //\r
-    // Print DEBUG() information into output buffer.\r
-    //\r
-    CharCount = AsciiBSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  Format,\r
-                  Marker\r
-                  );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
-    //\r
-    // Print ERROR information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "ERROR: C%x:V%x I%x",\r
-                  CodeType,\r
-                  Value,\r
-                  Instance\r
-                  );\r
-\r
-    //\r
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
-    //\r
-\r
-    if (CallerId != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %g",\r
-                     CallerId\r
-                     );\r
-    }\r
-\r
-    if (Data != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %p",\r
-                     Data\r
-                     );\r
-    }\r
-\r
-    CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
-                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                   "\n\r"\r
-                   );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "PROGRESS CODE: V%x I%x\n\r",\r
-                  Value,\r
-                  Instance\r
-                  );\r
-  } else {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "Undefined: C%x:V%x I%x\n\r",\r
-                  CodeType,\r
-                  Value,\r
-                  Instance\r
-                  );\r
-  }\r
-\r
-  //\r
-  // Callout to standard output.\r
-  //\r
-  mWinNt->WriteFile (\r
-            mStdOut,\r
-            Buffer,\r
-            (DWORD)CharCount,\r
-            (LPDWORD)&CharCount,\r
-            NULL\r
-            );\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c
deleted file mode 100644 (file)
index 82bbbde..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  PeiNt32PeCoffExtraActionLib.c\r
-\r
-Abstract:\r
-\r
-  Provides services to perform additional actions to relocate and unload\r
-  PE/Coff image for NT32 environment specific purpose such as souce level debug.\r
-  This version only works for DXE phase  \r
-\r
-\r
-**/\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <WinNtDxe.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-\r
-#include <Library/PeCoffLib.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PeCoffExtraActionLib.h>\r
-\r
-#define MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE 0x100\r
-\r
-typedef struct {\r
-  CHAR8   *PdbPointer;\r
-  VOID    *ModHandle;\r
-} PDB_NAME_TO_MOD_HANDLE;\r
-\r
-\r
-//\r
-// Cache of WinNtThunk protocol\r
-//\r
-EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt = NULL;\r
-\r
-//\r
-// An Array to hold the ModHandle\r
-//\r
-PDB_NAME_TO_MOD_HANDLE  *mPdbNameModHandleArray = NULL;\r
-UINTN                   mPdbNameModHandleArraySize = 0;\r
-\r
-\r
-/**\r
-  The constructor function gets  the pointer of the WinNT thunk functions\r
-  It will ASSERT() if NT thunk protocol is not installed.\r
-\r
-  @retval EFI_SUCCESS   WinNT thunk protocol is found and cached.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Nt32PeCoffGetWinNtThunkStucture (\r
-  VOID\r
-  )\r
-{\r
-  EFI_HOB_GUID_TYPE   *GuidHob;\r
-\r
-  //\r
-  // Retrieve WinNtThunkProtocol from GUID'ed HOB\r
-  //\r
-  GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (mWinNt != NULL);\r
-\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Convert the passed in Ascii string to Unicode.\r
-  \r
-  This function  Convert the passed in Ascii string to Unicode.Optionally return\r
-   the length of the strings..\r
-\r
-  @param  AsciiString    Pointer to an AscII string\r
-  @param  StrLen         Length of string\r
-\r
-  @return  Pointer to malloc'ed Unicode version of Ascii\r
-\r
-**/\r
-CHAR16 *\r
-AsciiToUnicode (\r
-  IN  CHAR8   *Ascii,\r
-  IN  UINTN   *StrLen OPTIONAL\r
-  )\r
-{\r
-  UINTN   Index;\r
-  CHAR16  *Unicode;\r
-\r
-  //\r
-  // Allocate a buffer for unicode string\r
-  //\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++)\r
-    ;\r
-  Unicode = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),\r
-                                HEAP_ZERO_MEMORY,\r
-                                ((Index + 1) * sizeof (CHAR16))\r
-                               ); \r
-  if (Unicode == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++) {\r
-    Unicode[Index] = (CHAR16) Ascii[Index];\r
-  }\r
-\r
-  Unicode[Index] = '\0';\r
-\r
-  if (StrLen != NULL) {\r
-    *StrLen = Index;\r
-  }\r
-\r
-  return Unicode;\r
-}\r
-/**\r
-  Store the ModHandle in an array indexed by the Pdb File name.\r
-  The ModHandle is needed to unload the image. \r
-\r
-\r
-  @param ImageContext - Input data returned from PE Laoder Library. Used to find the \r
-                 .PDB file name of the PE Image.\r
-  @param ModHandle    - Returned from LoadLibraryEx() and stored for call to \r
-                 FreeLibrary().\r
-\r
-  @return   return EFI_SUCCESS when ModHandle was stored. \r
-\r
---*/\r
-EFI_STATUS\r
-AddModHandle (\r
-  IN  PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext,\r
-  IN  VOID                                 *ModHandle\r
-  )\r
-\r
-{\r
-  UINTN                   Index;\r
-  PDB_NAME_TO_MOD_HANDLE  *Array;\r
-  UINTN                   PreviousSize;\r
-  PDB_NAME_TO_MOD_HANDLE  *TempArray;\r
-  HANDLE                  Handle;\r
-\r
-  //\r
-  // Return EFI_ALREADY_STARTED if this DLL has already been loaded\r
-  //\r
-  Array = mPdbNameModHandleArray;\r
-  for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {\r
-    if (Array->PdbPointer != NULL && Array->ModHandle == ModHandle) {\r
-      return EFI_ALREADY_STARTED;\r
-    }\r
-  }\r
-  \r
-  Array = mPdbNameModHandleArray;\r
-  for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {\r
-    if (Array->PdbPointer == NULL) {\r
-      //\r
-      // Make a copy of the stirng and store the ModHandle\r
-      //\r
-      Handle = mWinNt->GetProcessHeap ();\r
-      Array->PdbPointer = mWinNt->HeapAlloc ( Handle,\r
-                                HEAP_ZERO_MEMORY,\r
-                                AsciiStrLen (ImageContext->PdbPointer) + 1\r
-                               ); \r
-                               \r
-      ASSERT (Array->PdbPointer != NULL);\r
-\r
-      AsciiStrCpy (Array->PdbPointer, ImageContext->PdbPointer);\r
-      Array->ModHandle = ModHandle;\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-  \r
-  //\r
-  // No free space in mPdbNameModHandleArray so grow it by \r
-  // MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE entires. \r
-  //\r
-  PreviousSize = mPdbNameModHandleArraySize * sizeof (PDB_NAME_TO_MOD_HANDLE);\r
-  mPdbNameModHandleArraySize += MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE;\r
-  //\r
-  // re-allocate a new buffer and copy the old values to the new locaiton. \r
-  //\r
-  TempArray = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),\r
-                                HEAP_ZERO_MEMORY,\r
-                                mPdbNameModHandleArraySize * sizeof (PDB_NAME_TO_MOD_HANDLE)\r
-                               ); \r
\r
-  CopyMem ((VOID *) (UINTN) TempArray, (VOID *) (UINTN)mPdbNameModHandleArray, PreviousSize);\r
-  \r
-  mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, mPdbNameModHandleArray);\r
-  \r
-  mPdbNameModHandleArray = TempArray;\r
-  if (mPdbNameModHandleArray == NULL) {\r
-    ASSERT (FALSE);\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-  \r
-  \r
-  return AddModHandle (ImageContext, ModHandle);\r
-}\r
-/**\r
-  Return the ModHandle and delete the entry in the array.\r
-\r
-\r
-   @param  ImageContext - Input data returned from PE Laoder Library. Used to find the \r
-                 .PDB file name of the PE Image.\r
-\r
-  @return   \r
-    ModHandle - ModHandle assoicated with ImageContext is returned\r
-    NULL      - No ModHandle associated with ImageContext\r
-\r
-**/\r
-VOID *\r
-RemoveModeHandle (\r
-  IN  PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext\r
-  )\r
-{\r
-  UINTN                   Index;\r
-  PDB_NAME_TO_MOD_HANDLE  *Array;\r
-\r
-  if (ImageContext->PdbPointer == NULL) {\r
-    //\r
-    // If no PDB pointer there is no ModHandle so return NULL\r
-    //\r
-    return NULL;\r
-  }\r
-\r
-  Array = mPdbNameModHandleArray;\r
-  for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {\r
-    if ((Array->PdbPointer != NULL) && (AsciiStrCmp(Array->PdbPointer, ImageContext->PdbPointer) == 0)) {\r
-      //\r
-      // If you find a match return it and delete the entry\r
-      //\r
-      mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, Array->PdbPointer);\r
-      Array->PdbPointer = NULL;\r
-      return Array->ModHandle;\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-/**\r
-  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
-\r
-  For NT32, this function load symbols to support source level debugging.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-\r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that has already been loaded and relocated.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  EFI_STATUS        Status;\r
-  VOID              *DllEntryPoint;\r
-  CHAR16            *DllFileName;\r
-  HMODULE           Library;\r
-  UINTN             Index;\r
-\r
-  ASSERT (ImageContext != NULL);\r
-\r
-  if (mWinNt == NULL) {\r
-    Nt32PeCoffGetWinNtThunkStucture ();\r
-  }\r
-\r
-  //\r
-  // If we load our own PE COFF images the Windows debugger can not source\r
-  //  level debug our code. If a valid PDB pointer exists usw it to load\r
-  //  the *.dll file as a library using Windows* APIs. This allows \r
-  //  source level debug. The image is still loaded and relocated\r
-  //  in the Framework memory space like on a real system (by the code above),\r
-  //  but the entry point points into the DLL loaded by the code bellow. \r
-  //\r
-\r
-  DllEntryPoint = NULL;\r
-\r
-  //\r
-  // Load the DLL if it's not an EBC image.\r
-  //\r
-  if ((ImageContext->PdbPointer != NULL) &&\r
-      (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {\r
-    //\r
-    // Convert filename from ASCII to Unicode\r
-    //\r
-    DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);\r
-\r
-    //\r
-    // Check that we have a valid filename\r
-    //\r
-    if (Index < 5 || DllFileName[Index - 4] != '.') {\r
-      mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);\r
-\r
-      //\r
-      // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-      // The image will run, but we just can't source level debug. If we\r
-      // return an error the image will not run.\r
-      //\r
-      return;\r
-    }\r
-    //\r
-    // Replace .PDB with .DLL on the filename\r
-    //\r
-    DllFileName[Index - 3]  = 'D';\r
-    DllFileName[Index - 2]  = 'L';\r
-    DllFileName[Index - 1]  = 'L';\r
-\r
-    //\r
-    // Load the .DLL file into the user process's address space for source \r
-    // level debug\r
-    //\r
-    Library = mWinNt->LoadLibraryEx  (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);\r
-    if (Library != NULL) {\r
-      //\r
-      // InitializeDriver is the entry point we put in all our EFI DLL's. The\r
-      // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the \r
-      // normal DLL entry point of DllMain, and prevents other modules that are\r
-      // referenced in side the DllFileName from being loaded. There is no error \r
-      // checking as the we can point to the PE32 image loaded by Tiano. This \r
-      // step is only needed for source level debugging\r
-      //\r
-      DllEntryPoint = (VOID *) (UINTN) mWinNt->GetProcAddress (Library, "InitializeDriver");\r
-\r
-    }\r
-\r
-    if ((Library != NULL) && (DllEntryPoint != NULL)) {\r
-      Status = AddModHandle (ImageContext, Library);\r
-      if (Status == EFI_ALREADY_STARTED) {\r
-        //\r
-        // If the DLL has already been loaded before, then this instance of the DLL can not be debugged.\r
-        //\r
-        ImageContext->PdbPointer = NULL;\r
-        DEBUG ((EFI_D_ERROR, "WARNING: DLL already loaded.  No source level debug %s. \n", DllFileName));\r
-      } else {\r
-        //\r
-        // This DLL is not already loaded, so source level debugging is supported.\r
-        //\r
-        ImageContext->EntryPoint  = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;\r
-        DEBUG ((EFI_D_INFO, "LoadLibraryEx (%s,\n               NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName));\r
-      }\r
-    } else {\r
-      //\r
-      // This DLL does not support source level debugging at all.\r
-      //\r
-      DEBUG ((EFI_D_ERROR, "WARNING: No source level debug %s. \n", DllFileName));\r
-    }\r
-\r
-    mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);\r
-  }\r
-\r
-  //\r
-  // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-  // The image will run, but we just can't source level debug. If we\r
-  // return an error the image will not run.\r
-  //\r
-  return;\r
-}  \r
-\r
-/**\r
-  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
-  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
-  \r
-  For NT32, this function unloads symbols for source level debugging.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-  \r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that is being unloaded.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  VOID *ModHandle;\r
-\r
-  ASSERT (ImageContext != NULL);\r
-\r
-  ModHandle = RemoveModeHandle (ImageContext);\r
-  if (ModHandle != NULL) {\r
-    mWinNt->FreeLibrary (ModHandle);\r
-  }\r
-  return;\r
-}\r
diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf
deleted file mode 100644 (file)
index d81517a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file\r
-# PeCoff extra action libary for DXE phase that run NT32 emulator.\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = DxeNt32PeCoffExtraActionLib\r
-  FILE_GUID                      = 23AF9A54-3D7C-444d-8318-E9CF752DA349\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PeCoffExtraActionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  DxeNt32PeCoffExtraActionLib.c\r
-\r
-[Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdePkg/MdePkg.dec\r
-\r
-[LibraryClasses]\r
-  DebugLib\r
-  HobLib\r
-  BaseMemoryLib\r
-\r
-[Protocols]\r
-  gEfiWinNtThunkProtocolGuid                # ALWAYS_CONSUMED\r
-\r
diff --git a/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
deleted file mode 100644 (file)
index 47430e8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-## @file\r
-# A library to produce the global variable 'gWinNt'\r
-#\r
-# This library contains a single global variable 'gWinNt' along with a constructor to initialize that global.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = DxeWinNtLib\r
-  FILE_GUID                      = f6b5871d-5226-41b3-a569-3ff893fdc7bc\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = WinNtLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
-\r
-  CONSTRUCTOR                    = WinNtLibConstructor\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION\r
-#\r
-\r
-[Sources]\r
-  WinNtLib.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  HobLib\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiWinNtThunkProtocolGuid      # Used as HOB in the code.\r
-  \r
diff --git a/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c b/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c
deleted file mode 100644 (file)
index 55d6f9c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtLib.c\r
-\r
-Abstract:\r
-\r
-  WinNt Library \r
-\r
-**/\r
-\r
-#include <PiDxe.h>\r
-#include <WinNtDxe.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;\r
-\r
-EFI_STATUS\r
-WinNtLibConstructor (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-{\r
-  EFI_HOB_GUID_TYPE        *GuidHob;\r
-\r
-  GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  gWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (gWinNt != NULL);\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf b/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf
deleted file mode 100644 (file)
index 011c9d6..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-## @file\r
-# Component description file for the EdkNt32PeiPeCoffGetEntryPointLib library.\r
-#\r
-# PeCoffGetEntryPointLib library class for NT32 instance implemented by use NTPeiLoadFile PPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = EdkNt32PeiPeCoffGetEntryPointLib\r
-  FILE_GUID                      = 434b164e-5fa6-4a3d-bc04-02da2a4eeb26\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PeCoffGetEntryPointLib|PEI_CORE PEIM SEC\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  PeCoffGetEntryPoint.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  PeiServicesLib\r
-\r
-[Ppis]\r
-  gNtPeiLoadFilePpiGuid                         # PPI ALWAYS_CONSUMED\r
-\r
diff --git a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
deleted file mode 100644 (file)
index 58a88a4..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  PeCoffGetEntryPoint.c\r
-\r
-Abstract:\r
-\r
-  Tiano PE/COFF loader\r
-\r
-Revision History\r
-\r
-**/\r
-\r
-#include <PiPei.h>\r
-#include <IndustryStandard/PeImage.h>\r
-#include <WinNtPeim.h>\r
-#include <Ppi/NtPeiLoadFile.h>\r
-#include <Library/PeCoffGetEntryPointLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/DebugLib.h>\r
-\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-PeCoffLoaderGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads a PE/COFF image into memory, this is not follow the original purpose of \r
-  PeCoffGetEntryPoint library class.  But it's ok that Unix package not run on a real \r
-  platform and this is for source level debug.\r
-\r
-Arguments:\r
-\r
-  Pe32Data   - Pointer to a PE/COFF Image\r
-\r
-  EntryPoint - Pointer to the entry point of the PE/COFF image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            if the EntryPoint was returned\r
-  EFI_INVALID_PARAMETER  if the EntryPoint could not be found from Pe32Data\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-  NT_PEI_LOAD_FILE_PPI    *PeiNtService;\r
-  EFI_PHYSICAL_ADDRESS    ImageAddress;\r
-  UINT64                  ImageSize;\r
-  EFI_PHYSICAL_ADDRESS    ImageEntryPoint;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
-  ASSERT (EntryPoint != NULL);\r
-\r
-  Status = PeiServicesLocatePpi (\r
-             &gNtPeiLoadFilePpiGuid,\r
-             0,\r
-             &PpiDescriptor,\r
-             (VOID**)&PeiNtService\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = PeiNtService->PeiLoadFileService (\r
-                           Pe32Data,\r
-                           &ImageAddress,\r
-                           &ImageSize,\r
-                           &ImageEntryPoint\r
-                           );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Returns the machine type of PE/COFF image. \r
-  This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.\r
-  The reason is NT32 package needs to load the image to memory to support source\r
-  level debug.\r
-   \r
-\r
-  @param  Pe32Data   Pointer to a PE/COFF header\r
-\r
-  @return            Machine type or zero if not a valid iamge\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-PeCoffLoaderGetMachineType (\r
-  IN  VOID  *Pe32Data\r
-  )\r
-{  \r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
-  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
-\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER  *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    //\r
-    // DOS image header is present, so read the PE header after the DOS image header.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-  } else {\r
-    //\r
-    // DOS image header is not present, so PE header is at the image base.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    return Hdr.Te->Machine;\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {\r
-    return Hdr.Pe32->FileHeader.Machine;\r
-  }\r
-\r
-  return 0x0000;\r
-}\r
-\r
-/**\r
-  Returns a pointer to the PDB file name for a PE/COFF image that has been\r
-  loaded into system memory with the PE/COFF Loader Library functions.\r
-\r
-  Returns the PDB file name for the PE/COFF image specified by Pe32Data.  If\r
-  the PE/COFF image specified by Pe32Data is not a valid, then NULL is\r
-  returned.  If the PE/COFF image specified by Pe32Data does not contain a\r
-  debug directory entry, then NULL is returned.  If the debug directory entry\r
-  in the PE/COFF image specified by Pe32Data does not contain a PDB file name,\r
-  then NULL is returned.\r
-  If Pe32Data is NULL, then ASSERT().\r
-\r
-  @param  Pe32Data   Pointer to the PE/COFF image that is loaded in system\r
-                     memory.\r
-\r
-  @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL\r
-          if it cannot be retrieved.\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-PeCoffLoaderGetPdbPointer (\r
-  IN VOID  *Pe32Data\r
-  )\r
-{\r
-  EFI_IMAGE_DOS_HEADER                  *DosHdr;\r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
-  EFI_IMAGE_DATA_DIRECTORY              *DirectoryEntry;\r
-  EFI_IMAGE_DEBUG_DIRECTORY_ENTRY       *DebugEntry;\r
-  UINTN                                 DirCount;\r
-  VOID                                  *CodeViewEntryPointer;\r
-  INTN                                  TEImageAdjust;\r
-  UINT32                                NumberOfRvaAndSizes;\r
-  UINT16                                Magic;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
-\r
-  TEImageAdjust       = 0;\r
-  DirectoryEntry      = NULL;\r
-  DebugEntry          = NULL;\r
-  NumberOfRvaAndSizes = 0;\r
-\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    //\r
-    // DOS image header is present, so read the PE header after the DOS image header.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-  } else {\r
-    //\r
-    // DOS image header is not present, so PE header is at the image base.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {\r
-      DirectoryEntry  = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];\r
-      TEImageAdjust   = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;\r
-      DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +\r
-                    Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +\r
-                    TEImageAdjust);\r
-    }\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
-    //\r
-    // NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.\r
-    //       It is due to backward-compatibility, for some system might\r
-    //       generate PE32+ image with PE32 Magic.\r
-    //\r
-    switch (Hdr.Pe32->FileHeader.Machine) {\r
-    case IMAGE_FILE_MACHINE_I386:\r
-      //\r
-      // Assume PE32 image with IA32 Machine field.\r
-      //\r
-      Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;\r
-      break;\r
-    case IMAGE_FILE_MACHINE_X64:\r
-    case IMAGE_FILE_MACHINE_IA64:\r
-      //\r
-      // Assume PE32+ image with X64 or IA64 Machine field\r
-      //\r
-      Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;\r
-      break;\r
-    default:\r
-      //\r
-      // For unknow Machine field, use Magic in optional Header\r
-      //\r
-      Magic = Hdr.Pe32->OptionalHeader.Magic;\r
-    }\r
-\r
-    if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
-      //\r
-      // Use PE32 offset get Debug Directory Entry\r
-      //\r
-      NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;\r
-      DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);\r
-      DebugEntry     = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);\r
-    } else if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {\r
-      //\r
-      // Use PE32+ offset get Debug Directory Entry\r
-      //\r
-      NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;\r
-      DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);\r
-      DebugEntry     = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);\r
-    }\r
-\r
-    if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {\r
-      DirectoryEntry = NULL;\r
-      DebugEntry = NULL;\r
-    }\r
-  } else {\r
-    return NULL;\r
-  }\r
-\r
-  if (DebugEntry == NULL || DirectoryEntry == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {\r
-    if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {\r
-      if (DebugEntry->SizeOfData > 0) {\r
-        CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);\r
-        switch (* (UINT32 *) CodeViewEntryPointer) {\r
-        case CODEVIEW_SIGNATURE_NB10:\r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));\r
-        case CODEVIEW_SIGNATURE_RSDS:\r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));\r
-        case CODEVIEW_SIGNATURE_MTOC:              \r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));\r
-          break;\r
-        default:\r
-          break;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-/**\r
-  Returns the size of the PE/COFF headers\r
-\r
-  Returns the size of the PE/COFF header specified by Pe32Data.\r
-  If Pe32Data is NULL, then ASSERT().\r
-\r
-  @param  Pe32Data   Pointer to the PE/COFF image that is loaded in system\r
-                     memory.\r
-\r
-  @return Size of PE/COFF header in bytes or zero if not a valid image.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-PeCoffGetSizeOfHeaders (\r
-  IN VOID     *Pe32Data\r
-  )\r
-{\r
-  EFI_IMAGE_DOS_HEADER                  *DosHdr;\r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
-  UINTN                                 SizeOfHeaders;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    //\r
-    // DOS image header is present, so read the PE header after the DOS image header.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-  } else {\r
-    //\r
-    // DOS image header is not present, so PE header is at the image base.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
-    SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;\r
-  } else {\r
-    SizeOfHeaders = 0;\r
-  }\r
-\r
-  return (UINT32) SizeOfHeaders;\r
-}\r
-\r
diff --git a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
deleted file mode 100644 (file)
index e7c2df0..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/** @file\r
-  OEM hook status code library functions with no library constructor/destructor\r
-\r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-  Module Name:  Nt32OemHookStatusCodeLib.c\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <WinNtPeim.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-#include <Ppi/NtThunk.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/OemHookStatusCodeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-//\r
-// Cache of WinNtThunk protocol\r
-//\r
-EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt;\r
-\r
-//\r
-// Cache of standard output handle .\r
-//\r
-HANDLE                      mStdOut;\r
-\r
-/**\r
-\r
-  Initialize OEM status code device .\r
-\r
-  @return    Always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeInitialize (\r
-  VOID\r
-  )\r
-{\r
-  PEI_NT_THUNK_PPI  *NtThunkPpi;\r
-  EFI_STATUS        Status;\r
-\r
-\r
-  //\r
-  // Locate NtThunkPpi for retrieving standard output handle\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-              &gPeiNtThunkPpiGuid,\r
-              0,\r
-              NULL,\r
-              (VOID **) &NtThunkPpi\r
-              );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  mWinNt  = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();\r
-\r
-\r
-  //\r
-  // Cache standard output handle.\r
-  //\r
-  mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Report status code to OEM device.\r
-\r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  For progress codes, the operation is the current activity.\r
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time.\r
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\r
-  @param  CallerId      This optional parameter may be used to identify the caller.\r
-                        This parameter allows the status code driver to apply different rules to different callers.\r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
-\r
-  @return               The function always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeReport (\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId, OPTIONAL\r
-  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
-  )\r
-{\r
-  CHAR8           *Filename;\r
-  CHAR8           *Description;\r
-  CHAR8           *Format;\r
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-  UINT32          ErrorLevel;\r
-  UINT32          LineNumber;\r
-  UINTN           CharCount;\r
-  BASE_LIST       Marker;\r
-\r
-  Buffer[0] = '\0';\r
-\r
-  if (Data != NULL &&\r
-      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-    //\r
-    // Print ASSERT() information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "\n\rASSERT!: %a (%d): %a\n\r",\r
-                  Filename,\r
-                  LineNumber,\r
-                  Description\r
-                  );\r
-\r
-    //\r
-    // Callout to standard output.\r
-    //\r
-    mWinNt->WriteFile (\r
-              mStdOut,\r
-              Buffer,\r
-              (DWORD)CharCount,\r
-              (LPDWORD)&CharCount,\r
-              NULL\r
-              );\r
-\r
-    return EFI_SUCCESS;\r
-\r
-  } else if (Data != NULL &&\r
-             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
-    //\r
-    // Print DEBUG() information into output buffer.\r
-    //\r
-    CharCount = AsciiBSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  Format,\r
-                  Marker\r
-                  );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
-    //\r
-    // Print ERROR information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "ERROR: C%x:V%x I%x",\r
-                  CodeType,\r
-                  Value,\r
-                  Instance\r
-                  );\r
-\r
-    //\r
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
-    //\r
-\r
-    if (CallerId != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %g",\r
-                     CallerId\r
-                     );\r
-    }\r
-\r
-    if (Data != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %p",\r
-                     Data\r
-                     );\r
-    }\r
-\r
-    CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
-                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                   "\n\r"\r
-                   );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "PROGRESS CODE: V%x I%x\n\r",\r
-                  Value,\r
-                  Instance\r
-                  );\r
-  } else {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "Undefined: C%x:V%x I%x\n\r",\r
-                  CodeType,\r
-                  Value,\r
-                  Instance\r
-                  );\r
-  }\r
-\r
-  //\r
-  // Callout to standard output.\r
-  //\r
-  mWinNt->WriteFile (\r
-            mStdOut,\r
-            Buffer,\r
-            (DWORD)CharCount,\r
-            (LPDWORD)&CharCount,\r
-            NULL\r
-            );\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf
deleted file mode 100644 (file)
index 5df74af..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-## @file\r
-# Memory Status Code Library for UEFI drivers\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PeiNt32OemHookStatusCodeLib\r
-  FILE_GUID                      = 0C2070F9-02A7-4e8e-B584-84EA922363FB\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = OemHookStatusCodeLib|PEIM\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  Nt32OemHookStatusCodeLib.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  PeiServicesLib\r
-  ReportStatusCodeLib\r
-  BaseMemoryLib\r
-  PrintLib\r
-  DebugLib\r
-\r
-[Ppis]\r
-  gPeiNtThunkPpiGuid                            # PPI ALWAYS_CONSUMED\r
-\r
diff --git a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c
deleted file mode 100644 (file)
index 1035b92..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  PeiNt32PeCoffExtraActionLib.c\r
-\r
-Abstract:\r
-\r
-  Provides services to perform additional actions to relocate and unload\r
-  PE/Coff image for NT32 environment specific purpose such as souce level debug.\r
-  This version only works for PEI phase  \r
-\r
-\r
-**/\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-#include <WinNtPeim.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/NtThunk.h>\r
-\r
-#include <PiPei.h>\r
-#include <Library/PeCoffLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/PeCoffExtraActionLib.h>\r
-\r
-//\r
-// Cache of WinNtThunk protocol\r
-//\r
-EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt = NULL;\r
-\r
-/**\r
-  The function caches the pointer of the WinNT thunk functions\r
-  It will ASSERT() if NT thunk ppi is not installed.\r
-\r
-  @retval EFI_SUCCESS   WinNT thunk protocol is found and cached.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Nt32PeCoffGetWinNtThunkStucture (\r
-  )\r
-{\r
-       PEI_NT_THUNK_PPI  *NtThunkPpi;\r
-  EFI_STATUS        Status;\r
-\r
-\r
-  //\r
-  // Locate NtThunkPpi for retrieving standard output handle\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-              &gPeiNtThunkPpiGuid,\r
-              0,\r
-              NULL,\r
-              (VOID **) &NtThunkPpi\r
-              );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  mWinNt  = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Convert the passed in Ascii string to Unicode.\r
-  \r
-  This function  Convert the passed in Ascii string to Unicode.Optionally return\r
-   the length of the strings..\r
-\r
-  @param  AsciiString    Pointer to an AscII string\r
-  @param  StrLen         Length of string\r
-\r
-  @return  Pointer to malloc'ed Unicode version of Ascii\r
-\r
-**/\r
-CHAR16 *\r
-AsciiToUnicode (\r
-  IN  CHAR8   *Ascii,\r
-  IN  UINTN   *StrLen OPTIONAL\r
-  )\r
-{\r
-  UINTN   Index;\r
-  CHAR16  *Unicode;\r
-\r
-  //\r
-  // Allocate a buffer for unicode string\r
-  //\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++)\r
-    ;\r
-  Unicode = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),\r
-                                HEAP_ZERO_MEMORY,\r
-                                ((Index + 1) * sizeof (CHAR16))\r
-                               ); \r
-  if (Unicode == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++) {\r
-    Unicode[Index] = (CHAR16) Ascii[Index];\r
-  }\r
-\r
-  Unicode[Index] = '\0';\r
-\r
-  if (StrLen != NULL) {\r
-    *StrLen = Index;\r
-  }\r
-\r
-  return Unicode;\r
-}\r
-\r
-/**\r
-  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
-\r
-  For NT32, this function load symbols to support source level debugging.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-\r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that has already been loaded and relocated.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  VOID              *DllEntryPoint;\r
-  CHAR16            *DllFileName;\r
-  HMODULE           Library;\r
-  UINTN             Index;\r
-  \r
-  ASSERT (ImageContext != NULL);\r
-\r
-  if (mWinNt == NULL) {\r
-    Nt32PeCoffGetWinNtThunkStucture ();\r
-  }\r
-       //\r
-  // If we load our own PE COFF images the Windows debugger can not source\r
-  //  level debug our code. If a valid PDB pointer exists usw it to load\r
-  //  the *.dll file as a library using Windows* APIs. This allows \r
-  //  source level debug. The image is still loaded and relocated\r
-  //  in the Framework memory space like on a real system (by the code above),\r
-  //  but the entry point points into the DLL loaded by the code bellow. \r
-  //\r
-\r
-  DllEntryPoint = NULL;\r
-\r
-  //\r
-  // Load the DLL if it's not an EBC image.\r
-  //\r
-  if ((ImageContext->PdbPointer != NULL) &&\r
-      (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {\r
-    //\r
-    // Convert filename from ASCII to Unicode\r
-    //\r
-    DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);\r
-\r
-    //\r
-    // Check that we have a valid filename\r
-    //\r
-    if (Index < 5 || DllFileName[Index - 4] != '.') {\r
-      mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);\r
-\r
-      //\r
-      // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-      // The image will run, but we just can't source level debug. If we\r
-      // return an error the image will not run.\r
-      //\r
-      return;\r
-    }\r
-    //\r
-    // Replace .PDB with .DLL on the filename\r
-    //\r
-    DllFileName[Index - 3]  = 'D';\r
-    DllFileName[Index - 2]  = 'L';\r
-    DllFileName[Index - 1]  = 'L';\r
-\r
-    //\r
-    // Load the .DLL file into the user process's address space for source \r
-    // level debug\r
-    //\r
-    Library = mWinNt->LoadLibraryEx  (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);\r
-    if (Library != NULL) {\r
-      //\r
-      // InitializeDriver is the entry point we put in all our EFI DLL's. The\r
-      // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the \r
-      // normal DLL entry point of DllMain, and prevents other modules that are\r
-      // referenced in side the DllFileName from being loaded. There is no error \r
-      // checking as the we can point to the PE32 image loaded by Tiano. This \r
-      // step is only needed for source level debugging\r
-      //\r
-      DllEntryPoint = (VOID *) (UINTN) mWinNt->GetProcAddress (Library, "InitializeDriver");\r
-\r
-    }\r
-\r
-    if ((Library != NULL) && (DllEntryPoint != NULL)) {\r
-      ImageContext->EntryPoint  = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;\r
-      DEBUG ((EFI_D_INFO, "LoadLibraryEx (%s,\n               NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName));\r
-     } else {\r
-      DEBUG ((EFI_D_ERROR, "WARNING: No source level debug %s. \n", DllFileName));\r
-    }\r
-\r
-    mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);\r
-  }\r
-\r
-  //\r
-  // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-  // The image will run, but we just can't source level debug. If we\r
-  // return an error the image will not run.\r
-  //\r
-  return;\r
-}  \r
-\r
-/**\r
-  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
-  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
-  \r
-  For NT32, this function unloads symbols for source level debugging.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-  \r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that is being unloaded.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  ASSERT (ImageContext != NULL);\r
-}\r
diff --git a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf b/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf
deleted file mode 100644 (file)
index 8b6bd91..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-## @file\r
-# PeCoff extra action libary for Pei phase that run NT32 emulator.\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PeiNt32PeCoffExtraActionLib\r
-  FILE_GUID                      = 057C712A-84F0-4f4a-94CB-713EEF002E2F\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PeCoffExtraActionLib|PEI_CORE PEIM\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  PeiNt32PeCoffExtraActionLib.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  PeiServicesLib\r
-  DebugLib\r
-\r
-[Ppis]\r
-  gPeiNtThunkPpiGuid                            # PPI ALWAYS_CONSUMED\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
deleted file mode 100644 (file)
index df0d56a..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/** @file\r
-  Perform the platform memory test\r
-\r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "PlatformBootManager.h"\r
-\r
-EFI_HII_HANDLE gStringPackHandle                  = NULL;\r
-EFI_GUID       mPlatformBootManagerStringPackGuid = {\r
-  0x154dd51, 0x9079, 0x4a10, { 0x89, 0x5c, 0x9c, 0x7, 0x72, 0x81, 0x57, 0x88 }\r
-  };\r
-// extern UINT8  BdsDxeStrings[];\r
-\r
-//\r
-// BDS Platform Functions\r
-//\r
-\r
-/**\r
-  Perform the memory test base on the memory test intensive level,\r
-  and update the memory resource.\r
-\r
-  @param  Level         The memory test intensive level.\r
-\r
-  @retval EFI_STATUS    Success test all the system memory and update\r
-                        the memory resource\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBootManagerMemoryTest (\r
-  IN EXTENDMEM_COVERAGE_LEVEL Level\r
-  )\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_STATUS                        KeyStatus;\r
-  EFI_STATUS                        InitStatus;\r
-  EFI_STATUS                        ReturnStatus;\r
-  BOOLEAN                           RequireSoftECCInit;\r
-  EFI_GENERIC_MEMORY_TEST_PROTOCOL  *GenMemoryTest;\r
-  UINT64                            TestedMemorySize;\r
-  UINT64                            TotalMemorySize;\r
-  UINTN                             TestPercent;\r
-  UINT64                            PreviousValue;\r
-  BOOLEAN                           ErrorOut;\r
-  BOOLEAN                           TestAbort;\r
-  EFI_INPUT_KEY                     Key;\r
-  CHAR16                            StrPercent[80];\r
-  CHAR16                            *StrTotalMemory;\r
-  CHAR16                            *Pos;\r
-  CHAR16                            *TmpStr;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL     Foreground;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL     Background;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL     Color;\r
-  UINT32                            TempData;\r
-  UINTN                             StrTotalMemorySize;\r
-\r
-  ReturnStatus = EFI_SUCCESS;\r
-  ZeroMem (&Key, sizeof (EFI_INPUT_KEY));\r
-\r
-  StrTotalMemorySize = 128;\r
-  Pos = AllocateZeroPool (StrTotalMemorySize);\r
-  ASSERT (Pos != NULL);\r
-\r
-  if (gStringPackHandle == NULL) {  \r
-    gStringPackHandle = HiiAddPackages (\r
-                           &mPlatformBootManagerStringPackGuid,\r
-                           gImageHandle,\r
-                           PlatformBootManagerLibStrings,\r
-                           NULL\r
-                           );\r
-    ASSERT (gStringPackHandle != NULL);\r
-  }\r
-\r
-  StrTotalMemory    = Pos;\r
-\r
-  TestedMemorySize  = 0;\r
-  TotalMemorySize   = 0;\r
-  PreviousValue     = 0;\r
-  ErrorOut          = FALSE;\r
-  TestAbort         = FALSE;\r
-\r
-  SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
-  SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
-  SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
-\r
-  RequireSoftECCInit = FALSE;\r
-\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiGenericMemTestProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &GenMemoryTest\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    FreePool (Pos);\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  InitStatus = GenMemoryTest->MemoryTestInit (\r
-                                GenMemoryTest,\r
-                                Level,\r
-                                &RequireSoftECCInit\r
-                                );\r
-  if (InitStatus == EFI_NO_MEDIA) {\r
-    //\r
-    // The PEI codes also have the relevant memory test code to check the memory,\r
-    // it can select to test some range of the memory or all of them. If PEI code\r
-    // checks all the memory, this BDS memory test will has no not-test memory to\r
-    // do the test, and then the status of EFI_NO_MEDIA will be returned by\r
-    // "MemoryTestInit". So it does not need to test memory again, just return.\r
-    //\r
-    FreePool (Pos);\r
-    return EFI_SUCCESS;\r
-  }\r
-  \r
-  if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
-    TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST), NULL);\r
-\r
-    if (TmpStr != NULL) {\r
-      PrintXY (10, 10, NULL, NULL, TmpStr);\r
-      FreePool (TmpStr);\r
-    }\r
-  } else {\r
-    DEBUG ((EFI_D_INFO, "Enter memory test.\n"));\r
-  }\r
-  do {\r
-    Status = GenMemoryTest->PerformMemoryTest (\r
-                              GenMemoryTest,\r
-                              &TestedMemorySize,\r
-                              &TotalMemorySize,\r
-                              &ErrorOut,\r
-                              TestAbort\r
-                              );\r
-    if (ErrorOut && (Status == EFI_DEVICE_ERROR)) {\r
-      TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_SYSTEM_MEM_ERROR), NULL);\r
-      if (TmpStr != NULL) {\r
-        PrintXY (10, 10, NULL, NULL, TmpStr);\r
-        FreePool (TmpStr);\r
-      }\r
-\r
-      ASSERT (0);\r
-    }\r
-    \r
-    if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
-      TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);\r
-      TestPercent = (UINTN) DivU64x32 (\r
-                              DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),\r
-                              TempData\r
-                              );\r
-      if (TestPercent != PreviousValue) {\r
-        UnicodeValueToStringS (StrPercent, sizeof (StrPercent), 0, TestPercent, 0);\r
-        TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_MEMORY_TEST_PERCENT), NULL);\r
-        if (TmpStr != NULL) {\r
-          //\r
-          // TmpStr size is 64, StrPercent is reserved to 16.\r
-          //\r
-          StrnCatS (\r
-            StrPercent,\r
-            sizeof (StrPercent) / sizeof (CHAR16), \r
-            TmpStr,\r
-            sizeof (StrPercent) / sizeof (CHAR16) - StrLen (StrPercent) - 1\r
-            );\r
-          PrintXY (10, 10, NULL, NULL, StrPercent);\r
-          FreePool (TmpStr);\r
-        }\r
-\r
-        TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_PERFORM_MEM_TEST), NULL);\r
-        if (TmpStr != NULL) {\r
-          BootLogoUpdateProgress (\r
-            Foreground,\r
-            Background,\r
-            TmpStr,\r
-            Color,\r
-            TestPercent,\r
-            (UINTN) PreviousValue\r
-            );\r
-          FreePool (TmpStr);\r
-        }\r
-      }\r
-\r
-      PreviousValue = TestPercent;\r
-    } else {\r
-      DEBUG ((EFI_D_INFO, "Perform memory test (ESC to skip).\n"));\r
-    }\r
-\r
-    if (!PcdGetBool (PcdConInConnectOnDemand)) {\r
-      KeyStatus     = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
-      if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {\r
-        if (!RequireSoftECCInit) {\r
-          if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
-            TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_PERFORM_MEM_TEST), NULL);\r
-            if (TmpStr != NULL) {\r
-              BootLogoUpdateProgress (\r
-                Foreground,\r
-                Background,\r
-                TmpStr,\r
-                Color,\r
-                100,\r
-                (UINTN) PreviousValue\r
-                );\r
-              FreePool (TmpStr);\r
-            }\r
-\r
-            PrintXY (10, 10, NULL, NULL, L"100");\r
-          }\r
-          Status = GenMemoryTest->Finished (GenMemoryTest);\r
-          goto Done;\r
-        }\r
-\r
-        TestAbort = TRUE;\r
-      }\r
-    }\r
-  } while (Status != EFI_NOT_FOUND);\r
-\r
-  Status = GenMemoryTest->Finished (GenMemoryTest);\r
-\r
-Done:\r
-  if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
-    UnicodeValueToStringS (StrTotalMemory, StrTotalMemorySize, COMMA_TYPE, TotalMemorySize, 0);\r
-    if (StrTotalMemory[0] == L',') {\r
-      StrTotalMemory++;\r
-      StrTotalMemorySize -= sizeof (CHAR16);\r
-    }\r
-\r
-    TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_MEM_TEST_COMPLETED), NULL);\r
-    if (TmpStr != NULL) {\r
-      StrnCatS (\r
-        StrTotalMemory,\r
-        StrTotalMemorySize / sizeof (CHAR16),\r
-        TmpStr,\r
-        StrTotalMemorySize / sizeof (CHAR16) - StrLen (StrTotalMemory) - 1\r
-        );\r
-      FreePool (TmpStr);\r
-    }\r
-\r
-    PrintXY (10, 10, NULL, NULL, StrTotalMemory);\r
-    BootLogoUpdateProgress (\r
-      Foreground,\r
-      Background,\r
-      StrTotalMemory,\r
-      Color,\r
-      100,\r
-      (UINTN) PreviousValue\r
-      );\r
-    \r
-  } else {\r
-    DEBUG ((EFI_D_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize));\r
-  }\r
-  \r
-  FreePool (Pos);\r
-  return ReturnStatus;\r
-}\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
deleted file mode 100644 (file)
index 5967db1..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-/** @file\r
-  This file include all platform action which can be customized\r
-  by IBV/OEM.\r
-\r
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "PlatformBootManager.h"\r
-\r
-EFI_GUID mBootMenuFile = {\r
-  0xEEC25BDC, 0x67F2, 0x4D95, { 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D }\r
-};\r
-\r
-/**\r
-  Perform the platform diagnostic, such like test memory. OEM/IBV also\r
-  can customize this function to support specific platform diagnostic.\r
-\r
-  @param MemoryTestLevel  The memory test intensive level\r
-  @param QuietBoot        Indicate if need to enable the quiet boot\r
-\r
-**/\r
-VOID\r
-PlatformBootManagerDiagnostics (\r
-  IN EXTENDMEM_COVERAGE_LEVEL    MemoryTestLevel,\r
-  IN BOOLEAN                     QuietBoot\r
-  )\r
-{\r
-  EFI_STATUS                     Status;\r
-\r
-  //\r
-  // Here we can decide if we need to show\r
-  // the diagnostics screen\r
-  // Notes: this quiet boot code should be remove\r
-  // from the graphic lib\r
-  //\r
-  if (QuietBoot) {\r
-    BootLogoEnableLogo ();\r
-\r
-    //\r
-    // Perform system diagnostic\r
-    //\r
-    Status = PlatformBootManagerMemoryTest (MemoryTestLevel);\r
-    if (EFI_ERROR (Status)) {\r
-      BootLogoDisableLogo ();\r
-    }\r
-\r
-    return;\r
-  }\r
-\r
-  //\r
-  // Perform system diagnostic\r
-  //\r
-  Status = PlatformBootManagerMemoryTest (MemoryTestLevel);\r
-}\r
-\r
-/**\r
-  Do the platform specific action before the console is connected.\r
-\r
-  Such as:\r
-    Update console variable;\r
-    Register new Driver#### or Boot####;\r
-    Signal ReadyToLock event.\r
-**/\r
-VOID\r
-EFIAPI\r
-PlatformBootManagerBeforeConsole (\r
-  VOID\r
-  )\r
-{\r
-  UINTN                        Index;\r
-  EFI_STATUS                   Status;\r
-  WIN_NT_SYSTEM_CONFIGURATION  *Configuration;\r
-\r
-  GetVariable2 (L"Setup", &gEfiWinNtSystemConfigGuid, (VOID **) &Configuration, NULL);\r
-  if (Configuration != NULL) {\r
-    //\r
-    // SetupVariable is corrupt\r
-    //\r
-    Configuration->ConOutRow = PcdGet32 (PcdConOutColumn);\r
-    Configuration->ConOutColumn = PcdGet32 (PcdConOutRow);\r
-\r
-    Status = gRT->SetVariable (\r
-                    L"Setup",\r
-                    &gEfiWinNtSystemConfigGuid,\r
-                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-                    sizeof (WIN_NT_SYSTEM_CONFIGURATION),\r
-                    Configuration\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status));\r
-    }\r
-    FreePool (Configuration);\r
-  }\r
-\r
-  //\r
-  // Update the ocnsole variables.\r
-  //\r
-  for (Index = 0; gPlatformConsole[Index].DevicePath != NULL; Index++) {\r
-    if ((gPlatformConsole[Index].ConnectType & CONSOLE_IN) == CONSOLE_IN) {\r
-      EfiBootManagerUpdateConsoleVariable (ConIn, gPlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-\r
-    if ((gPlatformConsole[Index].ConnectType & CONSOLE_OUT) == CONSOLE_OUT) {\r
-      EfiBootManagerUpdateConsoleVariable (ConOut, gPlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-\r
-    if ((gPlatformConsole[Index].ConnectType & STD_ERROR) == STD_ERROR) {\r
-      EfiBootManagerUpdateConsoleVariable (ErrOut, gPlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-  }\r
-\r
-  //\r
-  // From PI spec vol2:\r
-  // Prior to invoking any UEFI drivers, applications, or connecting consoles, \r
-  // the platform should signal the event EFI_END_OF_DXE_EVENT_GUID\r
-  //\r
-  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);\r
-\r
-  //\r
-  // Dispatch deferred images after EndOfDxe event.\r
-  //\r
-  EfiBootManagerDispatchDeferredImages ();\r
-}\r
-\r
-/**\r
-  Returns the priority number.\r
-\r
-  @param BootOption\r
-**/\r
-UINTN\r
-BootOptionPriority (\r
-  CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
-  )\r
-{\r
-  //\r
-  // Make sure Shell is first\r
-  //\r
-  if (StrCmp (BootOption->Description, L"UEFI Shell") == 0) {\r
-    return 0;\r
-  }\r
-  return 100;\r
-}\r
-\r
-INTN\r
-EFIAPI\r
-CompareBootOption (\r
-  CONST EFI_BOOT_MANAGER_LOAD_OPTION  *Left,\r
-  CONST EFI_BOOT_MANAGER_LOAD_OPTION  *Right\r
-  )\r
-{\r
-  return BootOptionPriority (Left) - BootOptionPriority (Right);\r
-}\r
-\r
-/**\r
-  Generate device path include the input file guid info.\r
-\r
-  @param  FileGuid     Input file guid for the BootManagerMenuApp.\r
-\r
-  @retval DevicePath for BootManagerMenuApp.\r
-**/\r
-EFI_DEVICE_PATH *\r
-FvFilePath (\r
-  EFI_GUID                     *FileGuid\r
-  )\r
-{\r
-\r
-  EFI_STATUS                         Status;\r
-  EFI_LOADED_IMAGE_PROTOCOL          *LoadedImage;\r
-  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;\r
-\r
-  EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);\r
-\r
-  Status = gBS->HandleProtocol (\r
-                  gImageHandle,\r
-                  &gEfiLoadedImageProtocolGuid,\r
-                  (VOID **) &LoadedImage\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return AppendDevicePathNode (\r
-           DevicePathFromHandle (LoadedImage->DeviceHandle),\r
-           (EFI_DEVICE_PATH_PROTOCOL *) &FileNode\r
-           );\r
-}\r
-\r
-/**\r
-  Create one boot option for BootManagerMenuApp.\r
-\r
-  @param  FileGuid          Input file guid for the BootManagerMenuApp.\r
-  @param  Description       Description of the BootManagerMenuApp boot option.\r
-  @param  Position          Position of the new load option to put in the ****Order variable.\r
-  @param  IsBootCategory    Whether this is a boot category.\r
-\r
-\r
-  @retval OptionNumber      Return the option number info.\r
-\r
-**/\r
-UINTN\r
-RegisterBootManagerMenuAppBootOption (\r
-  EFI_GUID                         *FileGuid,\r
-  CHAR16                           *Description,\r
-  UINTN                            Position,\r
-  BOOLEAN                          IsBootCategory\r
-  )\r
-{\r
-  EFI_STATUS                       Status;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION     NewOption;\r
-  EFI_DEVICE_PATH_PROTOCOL         *DevicePath;\r
-  UINTN                            OptionNumber;\r
-\r
-  DevicePath = FvFilePath (FileGuid);\r
-  Status = EfiBootManagerInitializeLoadOption (\r
-             &NewOption,\r
-             LoadOptionNumberUnassigned,\r
-             LoadOptionTypeBoot,\r
-             IsBootCategory ? LOAD_OPTION_ACTIVE : LOAD_OPTION_CATEGORY_APP,\r
-             Description,\r
-             DevicePath,\r
-             NULL,\r
-             0\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-  FreePool (DevicePath);\r
-\r
-  Status = EfiBootManagerAddLoadOptionVariable (&NewOption, Position);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  OptionNumber = NewOption.OptionNumber;\r
-\r
-  EfiBootManagerFreeLoadOption (&NewOption);\r
-\r
-  return OptionNumber;\r
-}\r
-\r
-/**\r
-  Check if it's a Device Path pointing to BootManagerMenuApp.\r
-\r
-  @param  DevicePath     Input device path.\r
-\r
-  @retval TRUE   The device path is BootManagerMenuApp File Device Path.\r
-  @retval FALSE  The device path is NOT BootManagerMenuApp File Device Path.\r
-**/\r
-BOOLEAN\r
-IsBootManagerMenuAppFilePath (\r
-  EFI_DEVICE_PATH_PROTOCOL     *DevicePath\r
-)\r
-{\r
-  EFI_HANDLE                      FvHandle;\r
-  VOID                            *NameGuid;\r
-  EFI_STATUS                      Status;\r
-\r
-  Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &DevicePath, &FvHandle);\r
-  if (!EFI_ERROR (Status)) {\r
-    NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) DevicePath);\r
-    if (NameGuid != NULL) {\r
-      return CompareGuid (NameGuid, &mBootMenuFile);\r
-    }\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  Return the boot option number to the BootManagerMenuApp.\r
-\r
-  If not found it in the current boot option, create a new one.\r
-\r
-  @retval OptionNumber   Return the boot option number to the BootManagerMenuApp.\r
-\r
-**/\r
-UINTN\r
-GetBootManagerMenuAppOption (\r
-  VOID\r
-  )\r
-{\r
-  UINTN                        BootOptionCount;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;\r
-  UINTN                        Index;\r
-  UINTN                        OptionNumber;\r
-\r
-  OptionNumber = 0;\r
-\r
-  BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);\r
-\r
-  for (Index = 0; Index < BootOptionCount; Index++) {\r
-    if (IsBootManagerMenuAppFilePath (BootOptions[Index].FilePath)) {\r
-      OptionNumber = BootOptions[Index].OptionNumber;\r
-      break;\r
-    }\r
-  }\r
-\r
-  EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
-\r
-  if (Index >= BootOptionCount) {\r
-    //\r
-    // If not found the BootManagerMenuApp, create it.\r
-    //\r
-    OptionNumber = (UINT16) RegisterBootManagerMenuAppBootOption (&mBootMenuFile, L"UEFI BootManagerMenuApp", (UINTN) -1, FALSE);\r
-  }\r
-\r
-  return OptionNumber;\r
-}\r
-\r
-/**\r
-  Do the platform specific action after the console is connected.\r
-\r
-  Such as:\r
-    Dynamically switch output mode;\r
-    Signal console ready platform customized event;\r
-    Run diagnostics like memory testing;\r
-    Connect certain devices;\r
-    Dispatch aditional option roms.\r
-**/\r
-VOID\r
-EFIAPI\r
-PlatformBootManagerAfterConsole (\r
-  VOID\r
-  )\r
-{\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Black;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  White;\r
-  EFI_INPUT_KEY                  Enter;\r
-  EFI_INPUT_KEY                  F2;\r
-  EFI_INPUT_KEY                  F7;\r
-  EFI_BOOT_MANAGER_LOAD_OPTION   BootOption;\r
-  UINTN                          OptionNumber;\r
-\r
-  Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;\r
-  White.Blue = White.Green = White.Red = White.Reserved = 0xFF;\r
-\r
-  EfiBootManagerConnectAll ();\r
-  EfiBootManagerRefreshAllBootOption ();\r
-\r
-  //\r
-  // Register ENTER as CONTINUE key\r
-  //\r
-  Enter.ScanCode    = SCAN_NULL;\r
-  Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;\r
-  EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);\r
-  //\r
-  // Map F2 to Boot Manager Menu\r
-  //\r
-  F2.ScanCode    = SCAN_F2;\r
-  F2.UnicodeChar = CHAR_NULL;\r
-  EfiBootManagerGetBootManagerMenu (&BootOption);\r
-  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &F2, NULL);\r
-\r
-  //\r
-  // 3. Boot Device List menu\r
-  //\r
-  F7.ScanCode     = SCAN_F7;\r
-  F7.UnicodeChar  = CHAR_NULL;\r
-  OptionNumber    = GetBootManagerMenuAppOption ();\r
-  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)OptionNumber, 0, &F7, NULL);\r
-\r
-  //\r
-  // Make Shell as the first boot option\r
-  //\r
-  EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, (SORT_COMPARE) CompareBootOption);\r
-\r
-  PlatformBootManagerDiagnostics (QUICK, TRUE);\r
-\r
-  PrintXY (10, 10, &White, &Black, L"F2    to enter Setup.                              ");\r
-  PrintXY (10, 30, &White, &Black, L"F7    to enter Boot Manager Menu.");\r
-  PrintXY (10, 50, &White, &Black, L"Enter to boot directly.");\r
-}\r
-\r
-/**\r
-  This function is called each second during the boot manager waits the timeout.\r
-\r
-  @param TimeoutRemain  The remaining timeout.\r
-**/\r
-VOID\r
-EFIAPI\r
-PlatformBootManagerWaitCallback (\r
-  UINT16          TimeoutRemain\r
-  )\r
-{\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;\r
-  UINT16                              Timeout;\r
-\r
-  Timeout = PcdGet16 (PcdPlatformBootTimeOut);\r
-\r
-  Black.Raw = 0x00000000;\r
-  White.Raw = 0x00FFFFFF;\r
-\r
-  BootLogoUpdateProgress (\r
-    White.Pixel,\r
-    Black.Pixel,\r
-    L"Start boot option",\r
-    White.Pixel,\r
-    (Timeout - TimeoutRemain) * 100 / Timeout,\r
-    0\r
-    );\r
-}\r
-\r
-/**\r
-  The function is called when no boot option could be launched,\r
-  including platform recovery options and options pointing to applications\r
-  built into firmware volumes.\r
-\r
-  If this function returns, BDS attempts to enter an infinite loop.\r
-**/\r
-VOID\r
-EFIAPI\r
-PlatformBootManagerUnableToBoot (\r
-  VOID\r
-  )\r
-{\r
-  return;\r
-}\r
-\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h
deleted file mode 100644 (file)
index 06822d1..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/**@file\r
-   Head file for BDS Platform specific code\r
-\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-**/\r
-\r
-#ifndef _PLATFORM_BOOT_MANAGER_H\r
-#define _PLATFORM_BOOT_MANAGER_H\r
-\r
-#include <PiDxe.h>\r
-#include <Guid/WinNtSystemConfig.h>\r
-#include <Protocol/GenericMemoryTest.h>\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/LoadedImage.h>\r
-#include <Protocol/FirmwareVolume2.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiBootManagerLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/DxeServicesLib.h>\r
-#include <Library/BootLogoLib.h>\r
-\r
-\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-  UINTN                     ConnectType;\r
-} PLATFORM_CONSOLE_CONNECT_ENTRY;\r
-\r
-extern PLATFORM_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
-\r
-#define gEndEntire \\r
-  { \\r
-    END_DEVICE_PATH_TYPE,\\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\\r
-    END_DEVICE_PATH_LENGTH,\\r
-    0\\r
-  }\r
-\r
-#define CONSOLE_OUT BIT0\r
-#define CONSOLE_IN  BIT1\r
-#define STD_ERROR   BIT2\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH  VendorDevicePath;\r
-  UINT32              Instance;\r
-} WIN_NT_VENDOR_DEVICE_PATH_NODE;\r
-\r
-//\r
-// Below is the platform console device path\r
-//\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH              NtBus;\r
-  WIN_NT_VENDOR_DEVICE_PATH_NODE  SerialDevice;\r
-  UART_DEVICE_PATH                Uart;\r
-  VENDOR_DEVICE_PATH              TerminalType;\r
-  EFI_DEVICE_PATH_PROTOCOL        End;\r
-} NT_ISA_SERIAL_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH              NtBus;\r
-  WIN_NT_VENDOR_DEVICE_PATH_NODE  NtGopDevice;\r
-  EFI_DEVICE_PATH_PROTOCOL        End;\r
-} NT_PLATFORM_GOP_DEVICE_PATH;\r
-\r
-/**\r
-  Use SystemTable Conout to stop video based Simple Text Out consoles from going\r
-  to the video device. Put up LogoFile on every video device that is a console.\r
-\r
-  @param[in]  LogoFile   File name of logo to display on the center of the screen.\r
-\r
-  @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo displayed.\r
-  @retval EFI_UNSUPPORTED Logo not found\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBootManagerEnableQuietBoot (\r
-  IN  EFI_GUID  *LogoFile\r
-  );\r
-\r
-/**\r
-  Use SystemTable Conout to turn on video based Simple Text Out consoles. The \r
-  Simple Text Out screens will now be synced up with all non video output devices\r
-\r
-  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBootManagerDisableQuietBoot (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Perform the memory test base on the memory test intensive level,\r
-  and update the memory resource.\r
-\r
-  @param  Level         The memory test intensive level.\r
-\r
-  @retval EFI_STATUS    Success test all the system memory and update\r
-                        the memory resource\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBootManagerMemoryTest (\r
-  IN EXTENDMEM_COVERAGE_LEVEL Level\r
-  );\r
-\r
-/**\r
-\r
-  Show progress bar with title above it. It only works in Graphics mode.\r
-\r
-\r
-  @param TitleForeground Foreground color for Title.\r
-  @param TitleBackground Background color for Title.\r
-  @param Title           Title above progress bar.\r
-  @param ProgressColor   Progress bar color.\r
-  @param Progress        Progress (0-100)\r
-  @param PreviousValue   The previous value of the progress.\r
-\r
-  @retval  EFI_STATUS       Success update the progress bar\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBootManagerShowProgress (\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,\r
-  IN CHAR16                        *Title,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,\r
-  IN UINTN                         Progress,\r
-  IN UINTN                         PreviousValue\r
-  );\r
-\r
-#endif // _PLATFORM_BOOT_MANAGER_H\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
deleted file mode 100644 (file)
index 343bd78..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file\r
-#  Include all platform action which can be customized by IBV/OEM.\r
-#\r
-#  Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
-#  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PlatformBootManagerLib\r
-  FILE_GUID                      = F0D9063A-DADB-4185-85E2-D7ACDA93F7A6\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PlatformBootManagerLib|DXE_DRIVER\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  PlatformData.c\r
-  PlatformBootManager.c\r
-  PlatformBootManager.h\r
-  MemoryTest.c\r
-  Strings.uni\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  UefiBootServicesTableLib\r
-  UefiRuntimeServicesTableLib\r
-  UefiLib\r
-  UefiBootManagerLib\r
-  PcdLib\r
-  DxeServicesLib\r
-  MemoryAllocationLib\r
-  DevicePathLib\r
-  HiiLib\r
-  PrintLib\r
-  BootLogoLib\r
-\r
-[Guids]\r
-  gEfiWinNtSystemConfigGuid\r
-  gEfiEndOfDxeEventGroupGuid\r
-\r
-[Protocols]\r
-  gEfiGenericMemTestProtocolGuid  ## CONSUMES\r
-  gEfiGraphicsOutputProtocolGuid  ## CONSUMES\r
-  gEfiUgaDrawProtocolGuid         ## CONSUMES\r
-  gEfiBootLogoProtocolGuid        ## CONSUMES\r
-  gEfiFirmwareVolume2ProtocolGuid ## CONSUMES\r
-\r
-[Pcd]\r
-  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut\r
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c
deleted file mode 100644 (file)
index 8ab53b4..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/**@file\r
-  Defined the platform specific device path which will be filled to\r
-  ConIn/ConOut variables.\r
-   \r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-**/\r
-\r
-#include "PlatformBootManager.h"\r
-\r
-//\r
-// Platform specific keyboard device path\r
-//\r
-NT_PLATFORM_GOP_DEVICE_PATH gGopDevicePath0 = {\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    EFI_WIN_NT_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),\r
-    (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),\r
-    EFI_WIN_NT_GOP_GUID,\r
-    0\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-NT_PLATFORM_GOP_DEVICE_PATH gGopDevicePath1 = {\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    EFI_WIN_NT_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),\r
-    (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),\r
-    EFI_WIN_NT_GOP_GUID,\r
-    1\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-//\r
-// Platform specific serial device path\r
-//\r
-NT_ISA_SERIAL_DEVICE_PATH   gNtSerialDevicePath0 = {\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    EFI_WIN_NT_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),\r
-    (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),\r
-    EFI_WIN_NT_SERIAL_PORT_GUID\r
-  },\r
-  {\r
-    MESSAGING_DEVICE_PATH,\r
-    MSG_UART_DP,\r
-    (UINT8) (sizeof (UART_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8),\r
-    0,\r
-    115200,\r
-    8,\r
-    1,\r
-    1\r
-  },\r
-  {\r
-    MESSAGING_DEVICE_PATH,\r
-    MSG_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    DEVICE_PATH_MESSAGING_PC_ANSI\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-NT_ISA_SERIAL_DEVICE_PATH   gNtSerialDevicePath1 = {\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    EFI_WIN_NT_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),\r
-    (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),\r
-    EFI_WIN_NT_SERIAL_PORT_GUID,\r
-    1\r
-  },\r
-  {\r
-    MESSAGING_DEVICE_PATH,\r
-    MSG_UART_DP,\r
-    (UINT8) (sizeof (UART_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8),\r
-    0,\r
-    115200,\r
-    8,\r
-    1,\r
-    1\r
-  },\r
-  {\r
-    MESSAGING_DEVICE_PATH,\r
-    MSG_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    DEVICE_PATH_MESSAGING_PC_ANSI\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-//\r
-// Predefined platform default console device path\r
-//\r
-PLATFORM_CONSOLE_CONNECT_ENTRY   gPlatformConsole[] = {\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gNtSerialDevicePath0,\r
-    (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
-  },\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gNtSerialDevicePath1,\r
-    (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
-  },\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gGopDevicePath0,\r
-    (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
-  },\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gGopDevicePath1,\r
-    (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
-  },\r
-  {\r
-    NULL,\r
-    0\r
-  }\r
-};\r
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni b/Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni
deleted file mode 100644 (file)
index d5a28e0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-///** @file\r
-//  \r
-//    String definitions for PlatformBootManagerLib.\r
-//  \r
-//  Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
-//  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-//  \r
-//**/\r
-\r
-/=#\r
-\r
-#langdef   en-US "English"\r
-#langdef   fr-FR "Français"\r
-\r
-#string STR_PERFORM_MEM_TEST           #language en-US  "Perform memory test (ESC to skip)"\r
-                                       #language fr-FR  "Exécute l'examen de mémoire (ESC pour sauter)"\r
-#string STR_MEMORY_TEST_PERCENT        #language en-US  "% of the system memory tested OK"\r
-                                       #language fr-FR  "% de la mémoire de système essayée D'ACCORD"\r
-#string STR_ESC_TO_SKIP_MEM_TEST       #language en-US  "Press ESC key to skip memory test"\r
-                                       #language fr-FR  "Appuie sur ESC sauter examen de mémoire"\r
-#string STR_MEM_TEST_COMPLETED         #language en-US  " bytes of system memory tested OK\r\n"\r
-                                       #language fr-FR  "octets dela mémoire de système essayée D'ACCORD\r\n"\r
-#string STR_SYSTEM_MEM_ERROR           #language en-US  "System encounters memory errors"\r
-                                       #language fr-FR  "le Système rencontre les erreurs de mémoire"\r
-#string STR_START_BOOT_OPTION          #language en-US  "Start boot option"\r
-                                       #language fr-FR  "l'option de botte de Début"\r
-                                       
\ No newline at end of file
diff --git a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c b/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c
deleted file mode 100644 (file)
index 8a37099..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file\r
-  Provides a platform-specific method to enable Secure Boot Custom Mode setup.\r
-\r
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-#include <Library/PcdLib.h>\r
-\r
-\r
-/**\r
-\r
-  This function provides a platform-specific method to detect whether the platform\r
-  is operating by a physically present user. \r
-\r
-  Programmatic changing of platform security policy (such as disable Secure Boot,\r
-  or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during\r
-  Boot Services or after exiting EFI Boot Services. Only a physically present user\r
-  is allowed to perform these operations.\r
-\r
-  NOTE THAT: This function cannot depend on any EFI Variable Service since they are\r
-  not available when this function is called in AuthenticateVariable driver.\r
-  \r
-  @retval  TRUE       The platform is operated by a physically present user.\r
-  @retval  FALSE      The platform is NOT operated by a physically present user.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-UserPhysicalPresent (\r
-  VOID\r
-  )\r
-{\r
-  return TRUE;\r
-}\r
diff --git a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf b/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf
deleted file mode 100644 (file)
index 0e5fb14..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-## @file\r
-#  Provides a platform-specific method to enable Secure Boot Custom Mode setup.\r
-#\r
-#  Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PlatformSecureLib\r
-  FILE_GUID                      = F263EC2A-F0DB-4640-8B12-4ED22A506FB1\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  PlatformSecureLib.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
diff --git a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c b/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c
deleted file mode 100644 (file)
index f8f9aa4..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/** @file\r
-  \r
-  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/WinNtLib.h>\r
-\r
-/**\r
-  This function causes a system-wide reset (cold reset), in which\r
-  all circuitry within the system returns to its initial state. This type of reset \r
-  is asynchronous to system operation and operates without regard to\r
-  cycle boundaries.\r
-\r
-  If this function returns, it means that the system does not support cold reset. \r
-**/\r
-VOID\r
-EFIAPI\r
-ResetCold (\r
-  VOID\r
-  )\r
-{\r
-  gWinNt->ExitProcess (0);\r
-  ASSERT (FALSE);\r
-}\r
-\r
-/**\r
-  This function causes a system-wide initialization (warm reset), in which all processors \r
-  are set to their initial state. Pending cycles are not corrupted.\r
-\r
-  If this function returns, it means that the system does not support warm reset.\r
-**/\r
-VOID\r
-EFIAPI\r
-ResetWarm (\r
-  VOID\r
-  )\r
-{\r
-  ResetCold ();\r
-}\r
-\r
-/**\r
-  This function causes the system to enter a power state equivalent \r
-  to the ACPI G2/S5 or G3 states.\r
-\r
-  If this function returns, it means that the system does not support shut down reset.\r
-**/\r
-VOID\r
-EFIAPI\r
-ResetShutdown (\r
-  VOID\r
-  )\r
-{\r
-  ResetCold ();\r
-}\r
-\r
-/**\r
-  This function causes the system to enter S3 and then wake up immediately.\r
-\r
-  If this function returns, it means that the system does not support S3 feature.\r
-**/\r
-VOID\r
-EFIAPI\r
-EnterS3WithImmediateWake (\r
-  VOID\r
-  )\r
-{\r
-  ResetCold ();\r
-}\r
-\r
-/**\r
-  This function causes a systemwide reset. The exact type of the reset is\r
-  defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r
-  into ResetData. If the platform does not recognize the EFI_GUID in ResetData\r
-  the platform must pick a supported reset type to perform.The platform may\r
-  optionally log the parameters from any non-normal reset that occurs.\r
-\r
-  @param[in]  DataSize   The size, in bytes, of ResetData.\r
-  @param[in]  ResetData  The data buffer starts with a Null-terminated string,\r
-                         followed by the EFI_GUID.\r
-**/\r
-VOID\r
-EFIAPI\r
-ResetPlatformSpecific (\r
-  IN UINTN   DataSize,\r
-  IN VOID    *ResetData\r
-  )\r
-{\r
-  ResetCold ();\r
-}\r
-\r
-/**\r
-  The ResetSystem function resets the entire platform.\r
-\r
-  @param[in] ResetType      The type of reset to perform.\r
-  @param[in] ResetStatus    The status code for the reset.\r
-  @param[in] DataSize       The size, in bytes, of ResetData.\r
-  @param[in] ResetData      For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r
-                            the data buffer starts with a Null-terminated string, optionally\r
-                            followed by additional binary data. The string is a description\r
-                            that the caller may use to further indicate the reason for the\r
-                            system reset.\r
-**/\r
-VOID\r
-EFIAPI\r
-ResetSystem (\r
-  IN EFI_RESET_TYPE               ResetType,\r
-  IN EFI_STATUS                   ResetStatus,\r
-  IN UINTN                        DataSize,\r
-  IN VOID                         *ResetData OPTIONAL\r
-  )\r
-{\r
-  switch (ResetType) {\r
-  case EfiResetWarm:\r
-    ResetWarm ();\r
-    break;\r
-\r
-  case EfiResetCold:\r
-    ResetCold ();\r
-    break;\r
-\r
-  case EfiResetShutdown:\r
-    ResetShutdown ();\r
-    return;\r
-\r
-  case EfiResetPlatformSpecific:\r
-    ResetPlatformSpecific (DataSize, ResetData);\r
-    return;\r
-\r
-  default:\r
-    return;\r
-  }\r
-}\r
diff --git a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf b/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf
deleted file mode 100644 (file)
index f93fe8a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-## @file\r
-#  \r
-#  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Nt32ResetSystemLib\r
-  FILE_GUID                      = A7EBA1F6-5505-4fba-8895-386EE02B2FAC\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = ResetSystemLib\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  ResetSystemLib.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  WinNtLib\r
-  DebugLib\r
diff --git a/Nt32Pkg/MetronomeDxe/Metronome.c b/Nt32Pkg/MetronomeDxe/Metronome.c
deleted file mode 100644 (file)
index aeb3469..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  Metronome.c\r
-\r
-Abstract:\r
-\r
-  NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-\r
-**/\r
-\r
-#include "Metronome.h"\r
-\r
-//\r
-// Global Variables\r
-//\r
-EFI_METRONOME_ARCH_PROTOCOL mMetronome = {\r
-  WinNtMetronomeDriverWaitForTick,\r
-  TICK_PERIOD\r
-};\r
-\r
-//\r
-// Worker Functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtMetronomeDriverWaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The WaitForTick() function waits for the number of ticks specified by\r
-  TickNumber from a known time source in the platform.  If TickNumber of\r
-  ticks are detected, then EFI_SUCCESS is returned.  The actual time passed\r
-  between entry of this function and the first tick is between 0 and\r
-  TickPeriod 100 nS units.  If you want to guarantee that at least TickPeriod\r
-  time has elapsed, wait for two ticks.  This function waits for a hardware\r
-  event to determine when a tick occurs.  It is possible for interrupt\r
-  processing, or exception processing to interrupt the execution of the\r
-  WaitForTick() function.  Depending on the hardware source for the ticks, it\r
-  is possible for a tick to be missed.  This function cannot guarantee that\r
-  ticks will not be missed.  If a timeout occurs waiting for the specified\r
-  number of ticks, then EFI_TIMEOUT is returned.\r
-\r
-Arguments:\r
-\r
-  This       - The EFI_METRONOME_ARCH_PROTOCOL instance.\r
-  TickNumber - Number of ticks to wait.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The wait for the number of ticks specified by TickNumber\r
-                succeeded.\r
-\r
---*/\r
-{\r
-  UINT64  SleepTime;\r
-\r
-  //\r
-  // Calculate the time to sleep.  Win API smallest unit to sleep is 1 millisec\r
-  // Tick Period is in 100ns units, divide by 10000 to convert to ms\r
-  //\r
-  SleepTime = DivU64x32 (MultU64x32 ((UINT64) TickNumber, TICK_PERIOD) + 9999, 10000);\r
-  gWinNt->Sleep ((UINT32) SleepTime);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtMetronomeDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Metronome Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Metronome Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-\r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-\r
-  //\r
-  // Install the Metronome Architectural Protocol onto a new handle\r
-  //\r
-  Handle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  &gEfiMetronomeArchProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mMetronome\r
-                  );\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MetronomeDxe/Metronome.h b/Nt32Pkg/MetronomeDxe/Metronome.h
deleted file mode 100644 (file)
index 4a1a58c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  Metronome.h\r
-\r
-Abstract:\r
-\r
-  NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-\r
-**/\r
-\r
-#ifndef _NT_THUNK_METRONOME_H_\r
-#define _NT_THUNK_METRONOME_H_\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/Metronome.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-\r
-//\r
-// Period of on tick in 100 nanosecond units\r
-//\r
-#define TICK_PERIOD 2000\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtMetronomeDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtMetronomeDriverWaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TickNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/MetronomeDxe/MetronomeDxe.inf b/Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
deleted file mode 100644 (file)
index d7a4065..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file\r
-# NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-#\r
-# This metronome module simulates metronome by Sleep WinAPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Metronome\r
-  FILE_GUID                      = 154CAB4A-52B5-46CD-99C3-4368ABBACFFD\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = WinNtMetronomeDriverInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  Metronome.h\r
-  Metronome.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  WinNtLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-\r
-[Protocols]\r
-  gEfiMetronomeArchProtocolGuid                 # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[Depex]\r
-  TRUE\r
-  \r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
deleted file mode 100644 (file)
index ab88a92..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscBaseBoardManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer) = {\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION),\r
-  {                         // BaseBoardFeatureFlags\r
-    1,                      // Motherboard\r
-    0,                      // RequiresDaughterCard\r
-    0,                      // Removable\r
-    1,                      // Replaceable,\r
-    0,                      // HotSwappable\r
-    0,                      // Reserved\r
-  },\r
-  EfiBaseBoardTypeUnknown,  // BaseBoardType\r
-  {                         // BaseBoardChassisLink\r
-    EFI_MISC_SUBCLASS_GUID, // ProducerName\r
-    1,                      // Instance\r
-    1,                      // SubInstance\r
-  },\r
-  0,                        // BaseBoardNumberLinks\r
-  {                         // LinkN\r
-    EFI_MISC_SUBCLASS_GUID, // ProducerName\r
-    1,                      // Instance\r
-    1,                      // SubInstance\r
-  },\r
-};\r
-\r
-/* eof - MiscBaseBoardManufacturerData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
deleted file mode 100644 (file)
index c414cf6..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file\r
-  BaseBoard manufacturer information boot time changes.\r
-  SMBIOS type 2.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBaseBoardManufacturer (Type 2).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer)\r
-{\r
-  CHAR8                           *OptionalStrStart;\r
-  UINTN                           ManuStrLen;\r
-  UINTN                           ProductStrLen;\r
-  UINTN                           VerStrLen;\r
-  UINTN                           AssetTagStrLen;\r
-  UINTN                           SerialNumStrLen;\r
-  UINTN                           ChassisStrLen;\r
-  EFI_STATUS                      Status;\r
-  EFI_STRING                      Manufacturer;\r
-  EFI_STRING                      Product;\r
-  EFI_STRING                      Version;\r
-  EFI_STRING                      SerialNumber;\r
-  EFI_STRING                      AssetTag;\r
-  EFI_STRING                      Chassis;\r
-  STRING_REF                      TokenToGet;\r
-  EFI_SMBIOS_HANDLE               SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE2              *SmbiosRecord;\r
-  EFI_MISC_BASE_BOARD_MANUFACTURER   *ForType2InputData;\r
-\r
-  ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);\r
-  Product = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ProductStrLen = StrLen(Product);\r
-  if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);\r
-  AssetTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  AssetTagStrLen = StrLen(AssetTag);\r
-  if (AssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);\r
-  Chassis = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ChassisStrLen = StrLen(Chassis);\r
-  if (ChassisStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  // Since we fill NumberOfContainedObjectHandles = 0, remove sizeof (UINT16) bytes for ContainedObjectHandles[1]\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + ChassisStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + ChassisStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION;\r
-  //\r
-  // Since we fill NumberOfContainedObjectHandles = 0, remove sizeof (UINT16) bytes for ContainedObjectHandles[1]\r
-  //\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->Manufacturer = 1;  \r
-  //\r
-  // ProductName will be the 2st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->ProductName  = 2;  \r
-  //\r
-  // Version will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Version = 3;  \r
-  //\r
-  // SerialNumber will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 4;  \r
-  //\r
-  // AssetTag will be the 5th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->AssetTag = 5;  \r
-\r
-  //\r
-  // LocationInChassis will be the 6th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->LocationInChassis = 6;  \r
-  SmbiosRecord->FeatureFlag = (*(BASE_BOARD_FEATURE_FLAGS*)&(ForType2InputData->BaseBoardFeatureFlags));\r
-  SmbiosRecord->ChassisHandle  = 0;\r
-  SmbiosRecord->BoardType      = (UINT8)ForType2InputData->BaseBoardType;\r
-  SmbiosRecord->NumberOfContainedObjectHandles = 0;\r
-  \r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  //\r
-  // Since we fill NumberOfContainedObjectHandles = 0, just after this field to fill string\r
-  //\r
-  OptionalStrStart -= sizeof (UINT16);\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Product, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1);\r
-  UnicodeStrToAsciiStr(AssetTag, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);\r
-  UnicodeStrToAsciiStr(Chassis, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c
deleted file mode 100644 (file)
index a9f33b4..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscBiosVendorData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor) = {\r
-  STRING_TOKEN(STR_MISC_BIOS_VENDOR),       // BiosVendor\r
-  STRING_TOKEN(STR_MISC_BIOS_VERSION),      // BiosVersion\r
-  STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate\r
-  0xBABE, // BiosStartingAddress\r
-  {       // BiosPhysicalDeviceSize\r
-    2,    // Value\r
-    3,    // Exponent\r
-  },\r
-  {       // BiosCharacteristics1\r
-    0,    // Reserved1                         :2\r
-    0,    // Unknown                           :1\r
-    1,    // BiosCharacteristicsNotSupported   :1\r
-    0,    // IsaIsSupported                    :1\r
-    0,    // McaIsSupported                    :1\r
-    0,    // EisaIsSupported                   :1\r
-    0,    // PciIsSupported                    :1\r
-    0,    // PcmciaIsSupported                 :1\r
-    0,    // PlugAndPlayIsSupported            :1\r
-    0,    // ApmIsSupported                    :1\r
-    0,    // BiosIsUpgradable                  :1\r
-    0,    // BiosShadowingAllowed              :1\r
-    0,    // VlVesaIsSupported                 :1\r
-    0,    // EscdSupportIsAvailable            :1\r
-    0,    // BootFromCdIsSupported             :1\r
-    0,    // SelectableBootIsSupported         :1\r
-    0,    // RomBiosIsSocketed                 :1\r
-    0,    // BootFromPcmciaIsSupported         :1\r
-    0,    // EDDSpecificationIsSupported       :1\r
-    0,    // JapaneseNecFloppyIsSupported      :1\r
-    0,    // JapaneseToshibaFloppyIsSupported  :1\r
-    0,    // Floppy525_360IsSupported          :1\r
-    0,    // Floppy525_12IsSupported           :1\r
-    0,    // Floppy35_720IsSupported           :1\r
-    0,    // Floppy35_288IsSupported           :1\r
-    0,    // PrintScreenIsSupported            :1\r
-    0,    // Keyboard8042IsSupported           :1\r
-    0,    // SerialIsSupported                 :1\r
-    0,    // PrinterIsSupported                :1\r
-    0,    // CgaMonoIsSupported                :1\r
-    0,    // NecPc98                           :1\r
-    0,    // AcpiIsSupported                   :1\r
-    0,    // UsbLegacyIsSupported              :1\r
-    0,    // AgpIsSupported                    :1\r
-    0,    // I20BootIsSupported                :1\r
-    0,    // Ls120BootIsSupported              :1\r
-    0,    // AtapiZipDriveBootIsSupported      :1\r
-    0,    // Boot1394IsSupported               :1\r
-    0,    // SmartBatteryIsSupported           :1\r
-    0,    // BiosBootSpecIsSupported           :1\r
-    0,    // FunctionKeyNetworkBootIsSupported :1\r
-    0     // Reserved                          :22\r
-  },\r
-  {       // BiosCharacteristics2\r
-    0,    // BiosReserved                      :16\r
-    0,    // SystemReserved                    :16\r
-    0     // Reserved                          :32\r
-  },\r
-};\r
-\r
-/* eof - MiscBiosVendorData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
deleted file mode 100644 (file)
index 5bb7561..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/** @file\r
-  BIOS vendor information boot time changes.\r
-  Misc. subclass type 2.\r
-  SMBIOS type 0.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-/**\r
-  This function returns the value & exponent to Base2 for a given\r
-  Hex value. This is used to calculate the BiosPhysicalDeviceSize.\r
-\r
-  @param Value                      The hex value which is to be converted into value-exponent form\r
-  @param Exponent                   The exponent out of the conversion\r
-\r
-  @retval EFI_SUCCESS               All parameters were valid and *Value & *Exponent have been set.\r
-  @retval EFI_INVALID_PARAMETER     Invalid parameter was found.\r
-  \r
-**/\r
-EFI_STATUS  \r
-GetValueExponentBase2(\r
-  IN OUT UINTN        *Value,\r
-  OUT    UINTN        *Exponent\r
-  )\r
-{\r
-  if ((Value == NULL) || (Exponent == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  while ((*Value % 2) == 0) {\r
-    *Value=*Value/2;\r
-    (*Exponent)++;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'\r
-  as the unit.\r
-\r
-  @param  Base2Data              Pointer to Base2_Data\r
-\r
-  @retval EFI_SUCCESS            Transform successfully.       \r
-  @retval EFI_INVALID_PARAMETER  Invalid parameter was found.    \r
-\r
-**/\r
-UINT16\r
-Base2ToByteWith64KUnit (\r
-  IN      EFI_EXP_BASE2_DATA  *Base2Data\r
-  )\r
-{  \r
-  UINT16              Value;\r
-  UINT16              Exponent;\r
-\r
-  Value     = Base2Data->Value;\r
-  Exponent  = Base2Data->Exponent;\r
-  Exponent -= 16;\r
-  Value <<= Exponent;\r
-\r
-  return Value;\r
-}\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBiosVendor (Type 0).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.\r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)\r
-{\r
-  CHAR8                 *OptionalStrStart;\r
-  UINTN                 VendorStrLen;\r
-  UINTN                 VerStrLen;\r
-  UINTN                 DateStrLen;\r
-  CHAR16                *Version;\r
-  CHAR16                *ReleaseDate;\r
-  EFI_STATUS            Status;\r
-  EFI_STRING            Char16String;\r
-  STRING_REF            TokenToGet;\r
-  STRING_REF            TokenToUpdate;\r
-  SMBIOS_TABLE_TYPE0    *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE     SmbiosHandle;\r
-  EFI_MISC_BIOS_VENDOR *ForType0InputData;\r
-\r
-  ForType0InputData        = (EFI_MISC_BIOS_VENDOR *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Version = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString);\r
-  if (StrLen (Version) > 0) {     \r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);\r
-  }\r
-  \r
-  ReleaseDate = (CHAR16 *) PcdGetPtr (PcdFirmwareReleaseDateString);\r
-  if (StrLen(ReleaseDate) > 0) {\r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL);\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);\r
-  Char16String = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VendorStrLen = StrLen(Char16String);\r
-  if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-  ReleaseDate = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  DateStrLen = StrLen(ReleaseDate);\r
-  if (DateStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;\r
-  //\r
-  // Vendor will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Vendor = 1;  \r
-  //\r
-  // Version will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosVersion = 2;\r
-  SmbiosRecord->BiosSegment = (UINT16)ForType0InputData->BiosStartingAddress;\r
-  //\r
-  // ReleaseDate will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosReleaseDate = 3;\r
-  //\r
-  // Nt32 has no PCD value to indicate BIOS Size, just fill 0 for simply.\r
-  //\r
-  SmbiosRecord->BiosSize = 0;\r
-  SmbiosRecord->BiosCharacteristics = *(MISC_BIOS_CHARACTERISTICS*)(&ForType0InputData->BiosCharacteristics1);\r
-  //\r
-  // CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.\r
-  //\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 4);\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 5);\r
-\r
-  SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;\r
-  SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Char16String, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1);\r
-  UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c
deleted file mode 100644 (file)
index 83ade64..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscBootInformationData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus) = {\r
-  EfiBootInformationStatusNoError,  // BootInformationStatus\r
-  0                                 // BootInformationData\r
-};\r
-\r
-/* eof - MiscBootInformationData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
deleted file mode 100644 (file)
index 5f4ffc5..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/** @file\r
-  boot information boot time changes.\r
-  SMBIOS type 32.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBootInformation (Type 32).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-\r
-MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)\r
-{\r
-  EFI_STATUS                         Status;\r
-  EFI_SMBIOS_HANDLE                  SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE32                *SmbiosRecord;\r
-  EFI_MISC_BOOT_INFORMATION_STATUS*  ForType32InputData;\r
\r
-  ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c
deleted file mode 100644 (file)
index 7de39b6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscChassisManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Chassis Manufacturer data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer) = {\r
-  STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER),  // ChassisManufactrurer\r
-  STRING_TOKEN(STR_MISC_CHASSIS_VERSION),       // ChassisVersion\r
-  STRING_TOKEN(STR_MISC_CHASSIS_SERIAL_NUMBER), // ChassisSerialNumber\r
-  STRING_TOKEN(STR_MISC_CHASSIS_ASSET_TAG),     // ChassisAssetTag\r
-  {                               // ChassisTypeStatus\r
-    EfiMiscChassisTypeOther,      // ChassisType\r
-    0,                            // ChassisLockPresent\r
-    0                             // Reserved\r
-  },\r
-  EfiChassisStateOther,           // ChassisBootupState\r
-  EfiChassisStateOther,           // ChassisPowerSupplyState\r
-  EfiChassisStateOther,           // ChassisThermalState\r
-  EfiChassisSecurityStatusOther,  // ChassisSecurityState\r
-  0,                              // ChassisOemDefined\r
-  1,                              // Height\r
-  1                               // NumberofPowerCords\r
-};\r
-\r
-/* eof - MiscChassisManufacaturerData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
deleted file mode 100644 (file)
index 238b62f..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file\r
-  Chassis manufacturer information boot time changes.\r
-  SMBIOS type 3.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscChassisManufacturer (Type 3).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)\r
-{\r
-  CHAR8                           *OptionalStrStart;\r
-  UINTN                           ManuStrLen;\r
-  UINTN                           VerStrLen;\r
-  UINTN                           AssetTagStrLen;\r
-  UINTN                           SerialNumStrLen;\r
-  UINTN                           SkuNumberStrLen;\r
-  EFI_STATUS                      Status;\r
-  EFI_STRING                      Manufacturer;\r
-  EFI_STRING                      Version;\r
-  EFI_STRING                      SerialNumber;\r
-  EFI_STRING                      AssetTag;\r
-  EFI_STRING                      SkuNumber;\r
-  STRING_REF                      TokenToGet;\r
-  EFI_SMBIOS_HANDLE               SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE3              *SmbiosRecord;\r
-  EFI_MISC_CHASSIS_MANUFACTURER   *ForType3InputData;\r
-  UINT8                           *Buffer;\r
-\r
-  ForType3InputData = (EFI_MISC_CHASSIS_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);\r
-  AssetTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  AssetTagStrLen = StrLen(AssetTag);\r
-  if (AssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER);\r
-  SkuNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SkuNumberStrLen = StrLen(SkuNumber);\r
-  if (SkuNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,\r
-  // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].\r
-  //\r
-  // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING) + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + SkuNumberStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING) + ManuStrLen + 1  + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + SkuNumberStrLen + 1 + 1);\r
-\r
-  Buffer = (UINT8 *) SmbiosRecord;\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE;\r
-  //\r
-  // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,\r
-  // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].\r
-  //\r
-  // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.\r
-  //\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->Manufacturer = 1;  \r
-  SmbiosRecord->Type = (UINT8)ForType3InputData->ChassisType.ChassisType;\r
-  //\r
-  // Version will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Version = 2;  \r
-  //\r
-  // SerialNumber will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 3;  \r
-  //\r
-  // AssetTag will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->AssetTag = 4;\r
-\r
-  SmbiosRecord->BootupState = (UINT8)ForType3InputData->ChassisBootupState;\r
-  SmbiosRecord->PowerSupplyState = (UINT8)ForType3InputData->ChassisPowerSupplyState;\r
-  SmbiosRecord->ThermalState = (UINT8)ForType3InputData->ChassisThermalState;\r
-  SmbiosRecord->SecurityStatus = (UINT8)ForType3InputData->ChassisSecurityState;\r
-  CopyMem (SmbiosRecord->OemDefined,(UINT8*)&ForType3InputData->ChassisOemDefined, 4);\r
-  SmbiosRecord->Height = (UINT8)ForType3InputData->ChassisHeight;\r
-  SmbiosRecord->NumberofPowerCords = (UINT8)ForType3InputData->ChassisNumberPowerCords;\r
-  SmbiosRecord->ContainedElementCount = 0;\r
-  SmbiosRecord->ContainedElementRecordLength = 0;\r
-\r
-  //\r
-  // SKU Number will be the 5th optional string following the formatted structure.\r
-  //\r
-  // Since SKU Number is not in SMBIOS_TABLE_TYPE3 structure, must locate it after ContainedElementRecordLength.\r
-  //\r
-  Buffer[sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT)] = 5;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  //\r
-  // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,\r
-  // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].\r
-  //\r
-  OptionalStrStart -= sizeof (CONTAINED_ELEMENT);\r
-  //\r
-  // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.\r
-  //\r
-  OptionalStrStart += sizeof (SMBIOS_TABLE_STRING);\r
-  UnicodeStrToAsciiStr (Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr (Version, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr (SerialNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1);\r
-  UnicodeStrToAsciiStr (AssetTag, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);\r
-  UnicodeStrToAsciiStr (SkuNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h b/Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h
deleted file mode 100644 (file)
index 875507b..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/**@file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscDevicePath.h\r
-\r
-Abstract:\r
-\r
-  Misc class required EFI Device Path definitions (Ports, slots & \r
-  onboard devices)\r
-\r
-**/\r
-\r
-#ifndef _MISC_DEVICE_PATH_H\r
-#define _MISC_DEVICE_PATH_H\r
-\r
-\r
-#pragma pack(1)\r
-//\r
-// USB\r
-//\r
-\r
-/* For reference:\r
-#define USB1_1_STR  "ACPI(PNP0A03,0)/PCI(1D,0)."\r
-#define USB1_2_STR  "ACPI(PNP0A03,0)/PCI(1D,1)."\r
-#define USB1_3_STR  "ACPI(PNP0A03,0)/PCI(1D,2)."\r
-#define USB2_1_STR  "ACPI(PNP0A03,0)/PCI(1D,7)." \r
-*/\r
-\r
-//\r
-// #define acpi { 0x02, 0x01, 0x00, 0x0C, 0x0a0341d0, 0x00000000 }\r
-// #define pci( device,function)  { 0x01, 0x01, 0x00, 0x06, device, function }\r
-// #define end  { 0xFF, 0xFF, 0x00, 0x04 }\r
-//\r
-#define DP_ACPI \\r
-  { \\r
-    ACPI_DEVICE_PATH, ACPI_DP, (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \\r
-      ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), EISA_PNP_ID (0x0A03), 0 \\r
-  }\r
-#define DP_PCI(device, function) \\r
-  { \\r
-    HARDWARE_DEVICE_PATH, HW_PCI_DP, (UINT8) (sizeof (PCI_DEVICE_PATH)), (UINT8) \\r
-      ((sizeof (PCI_DEVICE_PATH)) >> 8), function, device \\r
-  }\r
-#define DP_END \\r
-  { \\r
-    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, END_DEVICE_PATH_LENGTH, 0 \\r
-  }\r
-\r
-#define DP_LPC(eisaid, function) \\r
-  { \\r
-    ACPI_DEVICE_PATH, ACPI_DP, (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \\r
-      ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), EISA_PNP_ID (eisaid), function \\r
-  }\r
-\r
-//\r
-// Shanmu >> moved to TianoDevicePath.h\r
-//\r
-\r
-/*\r
-typedef struct _USB_PORT_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} USB_PORT_DEVICE_PATH;\r
-\r
-\r
-//IDE ??I am not sure. Should this be ATAPI_DEVICE_PATH\r
-typedef struct _IDE_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} IDE_DEVICE_PATH;\r
-\r
-//RMC Connector\r
-typedef struct _RMC_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} RMC_CONN_DEVICE_PATH;\r
-\r
-//static RMC_CONN_DEVICE_PATH mRmcConnDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x0A,0x00 ), end };\r
-\r
-//RIDE\r
-typedef struct _RIDE_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} RIDE_DEVICE_PATH;\r
-\r
-//static RIDE_DEVICE_PATH mRideDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x02,0x00 ), end };\r
-\r
-//Gigabit NIC\r
-//typedef struct _GB_NIC_DEVICE_PATH\r
-//{\r
-//  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciXBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciXBusDevicePath;\r
-//  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-//} GB_NIC_DEVICE_PATH;\r
-\r
-//static GB_NIC_DEVICE_PATH mGbNicDevicePath = { acpi, pci( 0x03,0x00 ),pci( 0x1F,0x00 ),pci( 0x07,0x00 ), end };\r
-\r
-\r
-//P/S2 Connector\r
-typedef struct _PS2_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} PS2_CONN_DEVICE_PATH;\r
-\r
-//static PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,0 ), end };\r
-//static PS2_CONN_DEVICE_PATH mPs2MouseDevicePath      = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,1 ), end };\r
-\r
-//Serial Port Connector\r
-typedef struct _SERIAL_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} SERIAL_CONN_DEVICE_PATH;\r
-\r
-//static SERIAL_CONN_DEVICE_PATH mCom1DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,0 ), end };\r
-//static SERIAL_CONN_DEVICE_PATH mCom2DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,1 ), end };\r
-\r
-//Parallel Port Connector\r
-typedef struct _PARALLEL_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} PARALLEL_CONN_DEVICE_PATH;\r
-\r
-//static PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0401,0 ), end };\r
-\r
-//Floopy Connector\r
-typedef struct _FLOOPY_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} FLOOPY_CONN_DEVICE_PATH;\r
-\r
-//static FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,0 ), end };\r
-//static FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,1 ), end };\r
-\r
-*/\r
-\r
-//\r
-// End Shanmu\r
-//\r
-#pragma pack()\r
-\r
-#endif\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c
deleted file mode 100644 (file)
index 3532001..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscNumberOfInstallableLanguagesData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages)\r
-= {\r
-  1,    // NumberOfInstallableLanguages\r
-  {     // LanguageFlags\r
-    0,  // AbbreviatedLanguageFormat\r
-    0   // Reserved\r
-  },\r
-  0,    // CurrentLanguageNumber\r
-};\r
-\r
-/* eof - MiscNumberOfInstallableLanguagesData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
deleted file mode 100644 (file)
index 58c0b69..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/** @file\r
\r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-/*++\r
-  Check whether the language is supported for given HII handle\r
-\r
-  @param   HiiHandle     The HII package list handle.\r
-  @param   Offset        The offest of current lanague in the supported languages.\r
-  @param   CurrentLang   The language code.\r
-\r
-  @retval  TRUE          Supported.\r
-  @retval  FALSE         Not Supported.\r
-\r
---*/\r
-VOID\r
-EFIAPI\r
-CurrentLanguageMatch (\r
-  IN  EFI_HII_HANDLE                   HiiHandle,\r
-  OUT UINT16                           *Offset,\r
-  OUT CHAR8                            *CurrentLang\r
-  )\r
-{\r
-  CHAR8     *DefaultLang;\r
-  CHAR8     *BestLanguage;\r
-  CHAR8     *Languages;\r
-  CHAR8     *MatchLang;\r
-  CHAR8     *EndMatchLang;\r
-  UINTN     CompareLength;\r
-  \r
-  Languages = HiiGetSupportedLanguages (HiiHandle);\r
-  if (Languages == NULL) {\r
-    return;\r
-  }\r
-\r
-  GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&CurrentLang, NULL);\r
-  DefaultLang  = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);\r
-  BestLanguage = GetBestLanguage (\r
-                   Languages,\r
-                   FALSE,\r
-                   (CurrentLang != NULL) ? CurrentLang : "",\r
-                   DefaultLang,\r
-                   NULL\r
-                   );\r
-  if (BestLanguage != NULL) {\r
-    //\r
-    // Find the best matching RFC 4646 language, compute the offset.\r
-    //\r
-    CompareLength = AsciiStrLen (BestLanguage);\r
-    for (MatchLang = Languages, (*Offset) = 0; MatchLang != '\0'; (*Offset)++) {\r
-      //\r
-      // Seek to the end of current match language. \r
-      //\r
-      for (EndMatchLang = MatchLang; *EndMatchLang != '\0' && *EndMatchLang != ';'; EndMatchLang++);\r
-  \r
-      if ((EndMatchLang == MatchLang + CompareLength) && AsciiStrnCmp(MatchLang, BestLanguage, CompareLength) == 0) {\r
-        //\r
-        // Find the current best Language in the supported languages\r
-        //\r
-        break;\r
-      }\r
-      //\r
-      // best language match be in the supported language.\r
-      //\r
-      ASSERT (*EndMatchLang == ';');\r
-      MatchLang = EndMatchLang + 1;\r
-    }\r
-    FreePool (BestLanguage);\r
-  }\r
-\r
-  FreePool (Languages);\r
-  if (CurrentLang != NULL) {\r
-    FreePool (CurrentLang);\r
-  }\r
-  return ;\r
-}\r
-\r
-\r
-/**\r
-  Get next language from language code list (with separator ';').\r
-\r
-  @param  LangCode       Input: point to first language in the list. On\r
-                         Otput: point to next language in the list, or\r
-                                NULL if no more language in the list.\r
-  @param  Lang           The first language in the list.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-GetNextLanguage (\r
-  IN OUT CHAR8      **LangCode,\r
-  OUT CHAR8         *Lang\r
-  )\r
-{\r
-  UINTN  Index;\r
-  CHAR8  *StringPtr;\r
-\r
-  ASSERT (LangCode != NULL);\r
-  ASSERT (*LangCode != NULL);\r
-  ASSERT (Lang != NULL);\r
-\r
-  Index     = 0;\r
-  StringPtr = *LangCode;\r
-  while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {\r
-    Index++;\r
-  }\r
-\r
-  CopyMem (Lang, StringPtr, Index);\r
-  Lang[Index] = 0;\r
-\r
-  if (StringPtr[Index] == ';') {\r
-    Index++;\r
-  }\r
-  *LangCode = StringPtr + Index;\r
-}\r
-\r
-/**\r
-  This function returns the number of supported languages on HiiHandle.\r
-\r
-  @param   HiiHandle    The HII package list handle.\r
-\r
-  @retval  The number of supported languages.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-GetSupportedLanguageNumber (\r
-  IN EFI_HII_HANDLE    HiiHandle\r
-  )\r
-{\r
-  CHAR8   *Lang;\r
-  CHAR8   *Languages;\r
-  CHAR8   *LanguageString;\r
-  UINT16  LangNumber;\r
-  \r
-  Languages = HiiGetSupportedLanguages (HiiHandle);\r
-  if (Languages == NULL) {\r
-    return 0;\r
-  }\r
-\r
-  LangNumber = 0;\r
-  Lang = AllocatePool (AsciiStrSize (Languages));\r
-  if (Lang != NULL) {\r
-    LanguageString = Languages;\r
-    while (*LanguageString != 0) {\r
-      GetNextLanguage (&LanguageString, Lang);\r
-      LangNumber++;\r
-    }\r
-    FreePool (Lang);\r
-  }\r
-  FreePool (Languages);\r
-  return LangNumber;\r
-}\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscNumberOfInstallableLanguages (Type 13).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.\r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages)\r
-{\r
-  UINTN                                     LangStrLen;\r
-  CHAR8                                     CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];\r
-  CHAR8                                     *OptionalStrStart;\r
-  UINT16                                    Offset;\r
-  EFI_STATUS                                Status;\r
-  EFI_SMBIOS_HANDLE                         SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE13                       *SmbiosRecord;\r
-  EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES  *ForType13InputData;\r
\r
-  ForType13InputData = (EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  ForType13InputData->NumberOfInstallableLanguages = GetSupportedLanguageNumber (mHiiHandle);\r
-\r
-  //\r
-  // Try to check if current langcode matches with the langcodes in installed languages\r
-  //\r
-  ZeroMem(CurrentLang, SMBIOS_STRING_MAX_LENGTH + 1);\r
-  CurrentLanguageMatch (mHiiHandle, &Offset, CurrentLang);\r
-  LangStrLen = AsciiStrLen(CurrentLang);\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-\r
-  SmbiosRecord->InstallableLanguages = (UINT8)ForType13InputData->NumberOfInstallableLanguages;\r
-  SmbiosRecord->Flags = (UINT8)ForType13InputData->LanguageFlags.AbbreviatedLanguageFormat;\r
-  SmbiosRecord->CurrentLanguages = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  AsciiStrCpy(OptionalStrStart, CurrentLang);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c
deleted file mode 100644 (file)
index 64a3e79..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  \r
-    MiscOemStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING_DATA, OemString) = {\r
-  STRING_TOKEN(STR_MISC_OEM_STRING)\r
-};\r
-\r
-/* eof - MiscOemStringData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
deleted file mode 100644 (file)
index 3c2d326..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file\r
-  boot information boot time changes.\r
-  SMBIOS type 11.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-\r
-#include "MiscSubclassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(OemString)\r
-{\r
-  UINTN                    OemStrLen;\r
-  CHAR8                    *OptionalStrStart;\r
-  EFI_STATUS               Status;\r
-  EFI_STRING               OemStr;\r
-  STRING_REF               TokenToGet;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE11      *SmbiosRecord;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_OEM_STRING);\r
-  OemStr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  OemStrLen = StrLen(OemStr);\r
-  if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->StringCount = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(OemStr, OptionalStrStart);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c
deleted file mode 100644 (file)
index 4e9117a..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscPortInternalConnectorDesignatorData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR),  // PortInternalConnectorDesignator\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR),  // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeOther,  // PortInternalConnectorType\r
-  EfiPortConnectorTypeOther,  // PortExternalConnectorType\r
-  EfiPortTypeNone,            // PortType\r
-  0                           // PortPath\r
-};\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard) = {\r
-  STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD),   // PortInternalConnectorDesignator\r
-  STRING_TOKEN (STR_MISC_PORT_EXTERNAL_KEYBOARD),   // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeNone, // PortInternalConnectorType\r
-  EfiPortConnectorTypePS2,  // PortExternalConnectorType\r
-  EfiPortTypeKeyboard,      // PortType\r
-  // mPs2KbyboardDevicePath                          // PortPath\r
-  //\r
-  0\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse) = {\r
-  STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE),      // PortInternalConnectorDesignator\r
-  STRING_TOKEN (STR_MISC_PORT_EXTERNAL_MOUSE),      // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeNone, // PortInternalConnectorType\r
-  EfiPortConnectorTypePS2,  // PortExternalConnectorType\r
-  EfiPortTypeMouse,         // PortType\r
-  // mPs2MouseDevicePath                // PortPath\r
-  //\r
-  0\r
-};\r
-\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM1),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1),\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortConnectorTypeDB9Female,\r
-  EfiPortTypeSerial16550ACompatible,\r
-  0\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM2),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2),\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortConnectorTypeDB9Female,\r
-  EfiPortTypeSerial16550ACompatible,\r
-  0\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_EXTENSION_POWER),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER),\r
-  EfiPortConnectorTypeOther,\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortTypeOther,\r
-  0\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_FLOPPY),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY),\r
-  EfiPortConnectorTypeOnboardFloppy,\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortTypeOther,\r
-  0\r
-};\r
-\r
-/* eof - MiscPortInternalConnectorDesignatorData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
deleted file mode 100644 (file)
index 8de657c..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/**@file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscPortInternalConnectorDesignatorFunction.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-\r
-MISC_SMBIOS_TABLE_FUNCTION (\r
-  MiscPortInternalConnectorDesignator\r
-  )\r
-/*++\r
-Description:\r
-\r
-  This function makes boot time changes to the contents of the\r
-  MiscPortConnectorInformation (Type 8).\r
-\r
-Parameters:\r
-\r
-  RecordType\r
-    Type of record to be processed from the Data Table.\r
-    mMiscSubclassDataTable[].RecordType\r
-\r
-  RecordLen\r
-    Size of static RecordData from the Data Table.\r
-    mMiscSubclassDataTable[].RecordLen\r
-\r
-  RecordData\r
-    Pointer to copy of RecordData from the Data Table.  Changes made\r
-    to this copy will be written to the Data Hub but will not alter\r
-    the contents of the static Data Table.\r
-\r
-  LogRecordData\r
-    Set *LogRecordData to TRUE to log RecordData to Data Hub.\r
-    Set *LogRecordData to FALSE when there is no more data to log.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-    All parameters were valid and *RecordData and *LogRecordData have\r
-    been set.\r
-\r
-  EFI_UNSUPPORTED\r
-    Unexpected RecordType value.\r
-\r
-  EFI_INVALID_PARAMETER\r
-    One of the following parameter conditions was true:\r
-      RecordLen was zero.\r
-      RecordData was NULL.\r
-      LogRecordData was NULL.\r
---*/\r
-{\r
-  CHAR8                                        *OptionalStrStart;\r
-  UINTN                                        InternalRefStrLen;\r
-  UINTN                                        ExternalRefStrLen;  \r
-  EFI_STRING                                   InternalRef;\r
-  EFI_STRING                                   ExternalRef;\r
-  STRING_REF                                   TokenForInternal;\r
-  STRING_REF                                   TokenForExternal;\r
-  EFI_STATUS                                   Status;\r
-  SMBIOS_TABLE_TYPE8                           *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE                            SmbiosHandle;\r
-  EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR  *ForType8InputData;\r
-  \r
-  ForType8InputData = (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *)RecordData;\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenForInternal = 0;\r
-  TokenForExternal = 0;\r
-  \r
-  switch (ForType8InputData->PortInternalConnectorDesignator) { \r
-\r
-    case STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_KEYBOARD:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_KEYBOARD);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_MOUSE:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_MOUSE);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_COM1:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM1);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_COM2:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM2);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_EXTENSION_POWER:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_EXTENSION_POWER);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_FLOPPY:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_FLOPPY);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY);\r
-      break;\r
-    default:\r
-      break;\r
-  }\r
-\r
-  InternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForInternal, NULL);\r
-  InternalRefStrLen = StrLen(InternalRef);\r
-  if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  ExternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForExternal, NULL);\r
-  ExternalRefStrLen = StrLen(ExternalRef);\r
-  if (ExternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE8);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->InternalReferenceDesignator = 1;\r
-  SmbiosRecord->InternalConnectorType = (UINT8)ForType8InputData->PortInternalConnectorType;\r
-  SmbiosRecord->ExternalReferenceDesignator = 2;\r
-  SmbiosRecord->ExternalConnectorType = (UINT8)ForType8InputData->PortExternalConnectorType;\r
-  SmbiosRecord->PortType = (UINT8)ForType8InputData->PortType;\r
-  \r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(InternalRef, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(ExternalRef, OptionalStrStart + InternalRefStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-/* eof - MiscSystemManufacturerFunction.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
deleted file mode 100644 (file)
index e8a66bf..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  \r
-    MiscResetCapabilitiesData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities) = {\r
-  {     // ResetCapabilities\r
-    0,  // Status\r
-    0,  // BootOption\r
-    0,  // BootOptionOnLimit\r
-    0,  // WatchdogTimerPresent\r
-    0   // Reserved\r
-  },\r
-  0,    // ResetCount\r
-  0,    // ResetLimit\r
-  0,    // ResetTimerInterval\r
-  0     // ResetTimeout\r
-};\r
-\r
-/* eof - MiscResetCapabilities.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
deleted file mode 100644 (file)
index 0cf894d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file\r
-  ResetCapabilities.\r
-  SMBIOS type 23.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-\r
-#include "MiscSubclassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r
-{\r
-  EFI_STATUS               Status;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE23      *SmbiosRecord;\r
-  EFI_MISC_RESET_CAPABILITIES   *ForType23InputData;\r
-  \r
-  ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle    = 0;  \r
-  SmbiosRecord->Capabilities  = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r
-  SmbiosRecord->ResetCount    = (UINT16)ForType23InputData->ResetCount;\r
-  SmbiosRecord->ResetLimit    = (UINT16)ForType23InputData->ResetLimit;  \r
-  SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r
-  SmbiosRecord->Timeout       = (UINT16)ForType23InputData->ResetTimeout;\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
deleted file mode 100644 (file)
index 2850598..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-## @file\r
-# Misc Sub class driver\r
-#\r
-# Parses the MiscSubclassDataTable and reports any generated data to the DataHub.\r
-#  All .uni file who tagged with "ToolCode="DUMMY"" in following file list is included by\r
-#  MiscSubclassDriver.uni file, the StrGather tool will expand MiscSubclassDriver.uni file\r
-#  and parse all .uni file.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = MiscSubclass\r
-  FILE_GUID                      = 4A9B9DB8-EC62-4A92-818F-8AA0246D246E\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = MiscSubclassDriverEntryPoint\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  MiscBaseBoardManufacturerData.c\r
-  MiscBaseBoardManufacturerFunction.c\r
-  MiscBiosVendorData.c\r
-  MiscBiosVendorFunction.c\r
-  MiscBootInformationData.c  \r
-  MiscBootInformationFunction.c\r
-  MiscChassisManufacturerData.c\r
-  MiscChassisManufacturerFunction.c\r
-  MiscNumberOfInstallableLanguagesData.c\r
-  MiscNumberOfInstallableLanguagesFunction.c\r
-  MiscOemStringData.c  \r
-  MiscOemStringFunction.c  \r
-  MiscPortInternalConnectorDesignatorData.c  \r
-  MiscPortInternalConnectorDesignatorFunction.c\r
-  MiscResetCapabilitiesData.c\r
-  MiscResetCapabilitiesFunction.c\r
-  MiscSystemLanguageStringData.c\r
-  MiscSystemLanguageStringFunction.c\r
-  MiscSystemManufacturerData.c\r
-  MiscSystemManufacturerFunction.c\r
-  MiscSystemOptionStringData.c\r
-  MiscSystemOptionStringFunction.c\r
-  MiscSystemSlotDesignationData.c\r
-  MiscSystemSlotDesignationFunction.c\r
-  MiscDevicePath.h\r
-  MiscSubclassDriver.h\r
-  MiscSubclassDriver.uni\r
-  MiscSubclassDriverDataTable.c\r
-  MiscSubclassDriverEntryPoint.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  HiiLib\r
-  DebugLib\r
-  BaseLib\r
-  MemoryAllocationLib\r
-  PcdLib\r
-\r
-[Protocols]\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL_NOTIFY SOMETIMES_CONSUMED\r
-  gEfiSmbiosProtocolGuid                        # PROTOCOL ALWAYS_CONSUMED\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang\r
-\r
-[Depex]\r
-  gEfiSmbiosProtocolGuid\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
deleted file mode 100644 (file)
index fbd29d7..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriver.h\r
-\r
-Abstract:\r
-\r
-  Header file for MiscSubclass Driver.\r
-\r
-**/\r
-\r
-#ifndef _MISC_SUBCLASS_DRIVER_H\r
-#define _MISC_SUBCLASS_DRIVER_H\r
-\r
-#include <FrameworkDxe.h>\r
-#include <WinNtDxe.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <IndustryStandard/SmBios.h>\r
-#include <Protocol/Smbios.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <MiscDevicePath.h>\r
-\r
-\r
-//\r
-// Data table entry update function.\r
-//\r
-typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (\r
-  IN  VOID                 *RecordData,\r
-  IN  EFI_SMBIOS_PROTOCOL  *Smbios\r
-  );\r
-\r
-//\r
-// Data table entry definition.\r
-//\r
-typedef struct {\r
-  //\r
-  // intermediat input data for SMBIOS record\r
-  //\r
-  VOID                              *RecordData;\r
-  EFI_MISC_SMBIOS_DATA_FUNCTION     *Function;\r
-} EFI_MISC_SMBIOS_DATA_TABLE;\r
-\r
-//\r
-// Data Table extern definitions.\r
-//\r
-#define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r
-extern NAME1 NAME2 ## Data; \\r
-extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function\r
-\r
-\r
-//\r
-// Data Table entries\r
-//\r
-#define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r
-{ \\r
-  & NAME1 ## Data, \\r
-  & NAME2 ## Function \\r
-}\r
-\r
-//\r
-// Global definition macros.\r
-//\r
-#define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \\r
-  NAME1 NAME2 ## Data\r
-\r
-#define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \\r
-  EFI_STATUS EFIAPI NAME2 ## Function( \\r
-  IN  VOID                  *RecordData, \\r
-  IN  EFI_SMBIOS_PROTOCOL   *Smbios \\r
-  )\r
-\r
-\r
-//\r
-// Data Table Array\r
-//\r
-extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];\r
-\r
-//\r
-// Data Table Array Entries\r
-//\r
-extern UINTN                        mMiscSubclassDataTableEntries;\r
-extern UINT8                        MiscSubclassStrings[];\r
-extern EFI_HII_HANDLE               mHiiHandle;\r
-\r
-\r
-/**\r
-  Add an SMBIOS record.\r
-\r
-  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
-  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
-  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
-                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
-                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
-                                a set of null terminated strings and a null.\r
-\r
-  @retval EFI_SUCCESS           Record was added.\r
-  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
-\r
-**/\r
-EFI_STATUS\r
-AddSmbiosRecord (\r
-  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
-  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
-  );\r
-\r
-#endif /* _MISC_SUBCLASS_DRIVER_H */\r
-\r
-/* eof - MiscSubclassDriver.h */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni
deleted file mode 100644 (file)
index 8d11a49..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-// *++\r
-//\r
-// Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-// (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>\r
-// SPDX-License-Identifier: BSD-2-Clause-Patent\r
-// \r
-// Module Name:\r
-//\r
-//  MiscSubclassStrings.Vfr\r
-// \r
-// Abstract:\r
-// \r
-//   Misc. Subclass formset.\r
-// \r
-// Revision History: \r
-// \r
-// --*/\r
-\r
-/=#\r
-\r
-#langdef en-US "English"\r
-#langdef fr-FR "Français"\r
-\r
-\r
-#string STR_MISC_SUBCLASS_DRIVER_TITLE #language en-US  "Not used"\r
-\r
-#string STR_MISC_BASE_BOARD_MANUFACTURER     #language en-US  "Base Board Manufacturer"\r
-#string STR_MISC_BASE_BOARD_PRODUCT_NAME     #language en-US  "Base Board Product Name"\r
-#string STR_MISC_BASE_BOARD_VERSION          #language en-US  "Base Board Version"\r
-#string STR_MISC_BASE_BOARD_SERIAL_NUMBER    #language en-US  "Base Board Serial Number"\r
-#string STR_MISC_BASE_BOARD_ASSET_TAG        #language en-US  "Base Board Asset Tag"\r
-#string STR_MISC_BASE_BOARD_CHASSIS_LOCATION #language en-US  "Base Board Chassis Location"\r
-\r
-#string STR_MISC_BIOS_VENDOR           #language en-US  "Bios Vendor"\r
-#string STR_MISC_BIOS_VERSION          #language en-US  "R9 Prime"\r
-                                       #language fr-FR  "Perfection R9"\r
-#string STR_MISC_BIOS_RELEASE_DATE     #language en-US  "Bios Release Date"\r
-\r
-#string STR_MISC_CHASSIS_MANUFACTURER  #language en-US  "Chassis Manufacturer"\r
-#string STR_MISC_CHASSIS_VERSION       #language en-US  "Chassis Version"\r
-#string STR_MISC_CHASSIS_SERIAL_NUMBER #language en-US  "Chassis Serial Number"\r
-#string STR_MISC_CHASSIS_ASSET_TAG     #language en-US  "Chassis Asset Tag"\r
-#string STR_MISC_CHASSIS_SKU_NUMBER    #language en-US  "Chassis SKU Number"\r
-\r
-#string STR_MISC_OEM_STRING            #language en-US  "System Language String"\r
-\r
-#string STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR #language en-US  "Port Internal Connector"\r
-#string STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR #language en-US  "Port External Connector"\r
-#string STR_MISC_PORT_INTERNAL_KEYBOARD #language en-US  "J1A1"\r
-#string STR_MISC_PORT_EXTERNAL_KEYBOARD #language en-US  "Keyboard"\r
-#string STR_MISC_PORT_INTERNAL_MOUSE   #language en-US  "J1A1"\r
-#string STR_MISC_PORT_EXTERNAL_MOUSE   #language en-US  "Mouse"\r
-#string STR_MISC_PORT_INTERNAL_COM1    #language en-US  "J2A1"\r
-#string STR_MISC_PORT_EXTERNAL_COM1    #language en-US  "COM 1"\r
-#string STR_MISC_PORT_INTERNAL_LPT1    #language en-US  "J4A2"\r
-#string STR_MISC_PORT_EXTERNAL_LPT1    #language en-US  "LPT 1"\r
-#string STR_MISC_PORT_INTERNAL_EXTENSION_POWER #language en-US  "J5C1"\r
-#string STR_MISC_PORT_EXTERNAL_EXTENSION_POWER #language en-US  "Extension Power Header"\r
-#string STR_MISC_PORT_INTERNAL_USB1    #language en-US  "JA5A1"\r
-#string STR_MISC_PORT_EXTERNAL_USB1    #language en-US  "USB"\r
-#string STR_MISC_PORT_INTERNAL_USB2    #language en-US  "J2A2"\r
-#string STR_MISC_PORT_EXTERNAL_USB2    #language en-US  "USB"\r
-#string STR_MISC_PORT_INTERNAL_NETWORK #language en-US  "JA5A1"\r
-#string STR_MISC_PORT_EXTERNAL_NETWORK #language en-US  "RJ-45 Type"\r
-#string STR_MISC_PORT_INTERNAL_MIC     #language en-US  "J6A1"\r
-#string STR_MISC_PORT_EXTERNAL_MIC     #language en-US  "Audio Mic In"\r
-#string STR_MISC_PORT_INTERNAL_LINE_IN #language en-US  "J6A1"\r
-#string STR_MISC_PORT_EXTERNAL_LINE_IN #language en-US  "Audio Line In"\r
-#string STR_MISC_PORT_INTERNAL_LINE_OUT #language en-US  "J6A1"\r
-#string STR_MISC_PORT_EXTERNAL_LINE_OUT #language en-US  "Audio Line Out"\r
-#string STR_MISC_PORT_INTERNAL_FLOPPY  #language en-US  "J4H1"\r
-#string STR_MISC_PORT_EXTERNAL_FLOPPY  #language en-US  "OnBoard Floppy Type"\r
-#string STR_MISC_PORT_INTERNAL_IDE1    #language en-US  "J6H2"\r
-#string STR_MISC_PORT_EXTERNAL_IDE1    #language en-US  "OnBoard Primary IDE"\r
-#string STR_MISC_PORT_INTERNAL_IDE2    #language en-US  "J6H1"\r
-#string STR_MISC_PORT_EXTERNAL_IDE2    #language en-US  "OnBoard Secondary IDE"\r
-#string STR_MISC_PORT_INTERNAL_SOUND_IN1 #language en-US  "J8B1"\r
-#string STR_MISC_PORT_EXTERNAL_SOUND_IN1 #language en-US  "OnBoard Sound Input Type"\r
-#string STR_MISC_PORT_INTERNAL_SOUND_IN2 #language en-US  "J6B1"\r
-#string STR_MISC_PORT_EXTERNAL_SOUND_IN2 #language en-US  "OnBoard Sound Input Type"\r
-#string STR_MISC_PORT_INTERNAL_FRONT_PANEL #language en-US  "J9G1"\r
-#string STR_MISC_PORT_EXTERNAL_FRONT_PANEL #language en-US  "Front Panel Header Type"\r
-#string STR_MISC_PORT_INTERNAL_CPU_FAN #language en-US  "J2F1"\r
-#string STR_MISC_PORT_EXTERNAL_CPU_FAN #language en-US  "CPU Fan Header"\r
-#string STR_MISC_PORT_INTERNAL_FRONT_FAN #language en-US  "J9H3"\r
-#string STR_MISC_PORT_EXTERNAL_FRONT_FAN #language en-US  "Front Chassis Fan"\r
-#string STR_MISC_PORT_INTERNAL_REAR_FAN #language en-US  "J1B1"\r
-#string STR_MISC_PORT_EXTERNAL_REAR_FAN #language en-US  "Rear Chassis Fan"\r
-#string STR_MISC_PORT_INTERNAL_CONFIG_JUMPER #language en-US  "J9H2"\r
-#string STR_MISC_PORT_EXTERNAL_CONFIG_JUMPER #language en-US  "Configuration Jumper"\r
-#string STR_MISC_PORT_INTERNAL_AUDIO_PANEL #language en-US  "J8A1"\r
-#string STR_MISC_PORT_EXTERNAL_AUDIO_PANEL #language en-US  "Audio Front Panel Header"\r
-#string STR_MISC_PORT_INTERNAL_USB_PANEL #language en-US  "J9F1"\r
-#string STR_MISC_PORT_EXTERNAL_USB_PANEL #language en-US  "USB Front Panel Header"\r
-#string STR_MISC_PORT_INTERNAL_ATX_POWER #language en-US  "J2H1"\r
-#string STR_MISC_PORT_EXTERNAL_ATX_POWER #language en-US  "ATX Power Header"\r
-#string STR_MISC_PORT_INTERNAL_COM2       #language en-US     "J5A1"\r
-#string STR_MISC_PORT_EXTERNAL_COM2       #language en-US     "COM 2" \r
-#string STR_MISC_PORT_INTERNAL_USB3       #language en-US     "J1D3"\r
-#string STR_MISC_PORT_EXTERNAL_USB3       #language en-US     "USB"\r
-\r
-#string STR_MISC_SYSTEM_LANGUAGE_STRING #language en-US  "System Language String"\r
-\r
-#string STR_MISC_SYSTEM_MANUFACTURER   #language en-US  "System Manufacturer"\r
-#string STR_MISC_SYSTEM_PRODUCT_NAME   #language en-US  "NT32 Emulation Environment"\r
-                                       #language fr-FR  "Environnement De l'Émulation NT32"\r
-                                       \r
-#string STR_MISC_SYSTEM_VERSION        #language en-US  "System Version"\r
-#string STR_MISC_SYSTEM_SERIAL_NUMBER  #language en-US  "System Serial Number"\r
-\r
-#string STR_MISC_SYSTEM_OPTION_STRING  #language en-US  "System Option String"\r
-\r
-#string STR_MISC_SYSTEM_SLOT_DESIGNATION #language en-US  "System Slot Designation"\r
-\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c
deleted file mode 100644 (file)
index ceecbe9..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriverDataTable.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-\r
-//\r
-// External definitions referenced by Data Table entries.\r
-//\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer, MiscBaseBoardManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor,MiscBiosVendor );\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus, BootInformationStatus);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer, MiscChassisManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA,NumberOfInstallableLanguages, NumberOfInstallableLanguages);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_OEM_STRING_DATA,OemString, OemString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities, MiscResetCapabilities);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA,SystemLanguageString, SystemLanguageString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer, MiscSystemManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString, SystemOptionString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation, MiscSystemSlotDesignation);\r
-\r
-\r
-//\r
-// Data Table.\r
-//\r
-EFI_MISC_SMBIOS_DATA_TABLE  mMiscSubclassDataTable[] = {\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBaseBoardManufacturer, MiscBaseBoardManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBiosVendor,MiscBiosVendor ),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( BootInformationStatus, BootInformationStatus),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscChassisManufacturer, MiscChassisManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NumberOfInstallableLanguages, NumberOfInstallableLanguages),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(OemString, OemString),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortKeyboard, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortMouse, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom1, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom2, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortExtensionPower, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortFloppy, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscResetCapabilities, MiscResetCapabilities),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(SystemLanguageString, SystemLanguageString),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemManufacturer, MiscSystemManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( SystemOptionString, SystemOptionString),  \r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemSlotDesignation, MiscSystemSlotDesignation),  \r
-  };\r
\r
-//\r
-// Number of Data Table entries.\r
-//\r
-UINTN mMiscSubclassDataTableEntries = (sizeof mMiscSubclassDataTable) / sizeof (EFI_MISC_SMBIOS_DATA_TABLE);\r
-\r
-/* eof - MiscSubclassDriverDataTable.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
deleted file mode 100644 (file)
index b7098e9..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriverEntryPoint.c\r
-\r
-Abstract:\r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-EFI_HII_HANDLE  mHiiHandle;\r
-\r
-/**\r
-  This is the standard EFI driver point that detects whether there is a\r
-  MemoryConfigurationData Variable and, if so, reports memory configuration info\r
-  to the DataHub.\r
-\r
-  @param  ImageHandle  Handle for the image of this driver\r
-  @param  SystemTable  Pointer to the EFI System Table\r
-\r
-  @return EFI_SUCCESS if the data is successfully reported\r
-  @return EFI_NOT_FOUND if the HOB list could not be located.\r
-\r
-**/\r
-EFI_STATUS\r
-LogMemorySmbiosRecord (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  UINT64                          TotalMemorySize;\r
-  UINT8                           NumSlots;\r
-  SMBIOS_TABLE_TYPE19             *Type19Record;\r
-  EFI_SMBIOS_HANDLE               MemArrayMappedAddrSmbiosHandle;\r
-  EFI_SMBIOS_PROTOCOL             *Smbios;\r
-  CHAR16                          *Nt32MemString;\r
-\r
-  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
-  ASSERT_EFI_ERROR (Status);\r
-  \r
-  NumSlots        = 1;\r
-\r
-  //\r
-  // Process Memory String in form size!size ...\r
-  // So 64!64 is 128 MB\r
-  //\r
-  Nt32MemString   = PcdGetPtr (PcdWinNtMemorySize);\r
-  for (TotalMemorySize = 0; *Nt32MemString != '\0';) {\r
-    TotalMemorySize += StrDecimalToUint64 (Nt32MemString);\r
-    while (*Nt32MemString != '\0') {\r
-      if (*Nt32MemString == '!') {\r
-        Nt32MemString++;       \r
-        break;\r
-      }\r
-      Nt32MemString++;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Convert Total Memory Size to based on KiloByte\r
-  //\r
-  TotalMemorySize = LShiftU64 (TotalMemorySize, 20);\r
-  //\r
-  // Generate Memory Array Mapped Address info\r
-  //\r
-  Type19Record = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE19) + 2);\r
-  Type19Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS;\r
-  Type19Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE19);\r
-  Type19Record->Hdr.Handle = 0;\r
-  Type19Record->StartingAddress = 0;\r
-  Type19Record->EndingAddress =  (UINT32)RShiftU64(TotalMemorySize, 10) - 1;\r
-  Type19Record->MemoryArrayHandle = 0;\r
-  Type19Record->PartitionWidth = (UINT8)(NumSlots); \r
-\r
-  //\r
-  // Generate Memory Array Mapped Address info (TYPE 19)\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);\r
-\r
-  FreePool(Type19Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MiscSubclassDriverEntryPoint (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-/*++\r
-Description:\r
-\r
-  Standard EFI driver point.  This driver parses the mMiscSubclassDataTable\r
-  structure and reports any generated data to the DataHub.\r
-\r
-Arguments:\r
-\r
-  ImageHandle\r
-    Handle for the image of this driver\r
-\r
-  SystemTable\r
-    Pointer to the EFI System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-    The data was successfully reported to the Data Hub.\r
-\r
---*/\r
-{\r
-  UINTN                Index;\r
-  EFI_STATUS           EfiStatus;\r
-  EFI_SMBIOS_PROTOCOL  *Smbios;  \r
-\r
-  EfiStatus = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
-\r
-  if (EFI_ERROR(EfiStatus)) {\r
-    DEBUG((EFI_D_ERROR, "Could not locate SMBIOS protocol.  %r\n", EfiStatus));\r
-    return EfiStatus;\r
-  }\r
-\r
-  mHiiHandle = HiiAddPackages (\r
-                 &gEfiCallerIdGuid,\r
-                 NULL,\r
-                 MiscSubclassStrings,\r
-                 NULL\r
-                 );\r
-  ASSERT (mHiiHandle != NULL);\r
-\r
-  for (Index = 0; Index < mMiscSubclassDataTableEntries; ++Index) {\r
-    //\r
-    // If the entry have a function pointer, just log the data.\r
-    //\r
-    if (mMiscSubclassDataTable[Index].Function != NULL) {\r
-      EfiStatus = (*mMiscSubclassDataTable[Index].Function)(\r
-        mMiscSubclassDataTable[Index].RecordData,\r
-        Smbios\r
-        );\r
-\r
-      if (EFI_ERROR(EfiStatus)) {\r
-        DEBUG((EFI_D_ERROR, "Misc smbios store error.  Index=%d, ReturnStatus=%r\n", Index, EfiStatus));\r
-        return EfiStatus;\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Log Memory SMBIOS Record\r
-  //\r
-  EfiStatus = LogMemorySmbiosRecord();\r
-  return EfiStatus;\r
-}\r
-\r
-/**\r
-  Add an SMBIOS record.\r
-\r
-  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
-  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
-  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
-                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
-                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
-                                a set of null terminated strings and a null.\r
-\r
-  @retval EFI_SUCCESS           Record was added.\r
-  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
-\r
-**/\r
-EFI_STATUS\r
-AddSmbiosRecord (\r
-  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
-  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
-  )\r
-{\r
-  *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  return Smbios->Add (\r
-                   Smbios,\r
-                   NULL,\r
-                   SmbiosHandle,\r
-                   Record\r
-                   );\r
-}\r
-\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c
deleted file mode 100644 (file)
index dd432e3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSystemLanguageStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString) = {\r
-  0,\r
-  STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_STRING)\r
-};\r
-\r
-/* eof - MiscSystemLanguageStringData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c
deleted file mode 100644 (file)
index 45d2279..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString)\r
-{\r
-  EFI_STATUS               Status;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE13      *SmbiosRecord;\r
-  UINTN                    StrLeng;\r
-  CHAR8                    *OptionalStrStart;\r
-  EFI_STRING               Str;\r
-  STRING_REF               TokenToGet;\r
-  \r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_STRING);\r
-  Str = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  StrLeng = StrLen(Str);\r
-  if (StrLeng > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle    = 0;\r
-  SmbiosRecord->InstallableLanguages = 1;\r
-  SmbiosRecord->Flags   = 1;\r
-  SmbiosRecord->CurrentLanguages = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Str, OptionalStrStart);\r
-  \r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c
deleted file mode 100644 (file)
index bc44ca5..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSystemManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) System Manufacturer data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer)\r
-= {\r
-  STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER),\r
-  // SystemManufactrurer\r
-  STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME),\r
-  // SystemProductName\r
-  STRING_TOKEN(STR_MISC_SYSTEM_VERSION),\r
-  // SystemVersion\r
-  STRING_TOKEN(STR_MISC_SYSTEM_SERIAL_NUMBER),\r
-  // SystemSerialNumber\r
-  {\r
-    0xbadfaced,\r
-    0xdead,\r
-    0xbeef,\r
-    0x13,\r
-    0x13,\r
-    0x13,\r
-    0x13,\r
-    0x13,\r
-    0x13,\r
-    0x13,\r
-    0x13\r
-  },\r
-  // SystemUuid\r
-  EfiSystemWakeupTypePowerSwitch  // SystemWakeupType\r
-};\r
-\r
-/* eof - MiscSystemManufacturerData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
deleted file mode 100644 (file)
index f0719f6..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSystemManufacturerFunction.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemManufacturer (Type 1).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)\r
-{\r
-  CHAR8                             *OptionalStrStart;\r
-  UINTN                             ManuStrLen;\r
-  UINTN                             VerStrLen;\r
-  UINTN                             PdNameStrLen;\r
-  UINTN                             SerialNumStrLen;\r
-  EFI_STATUS                        Status;\r
-  EFI_STRING                        Manufacturer;\r
-  EFI_STRING                        ProductName;\r
-  EFI_STRING                        Version;\r
-  EFI_STRING                        SerialNumber;\r
-  STRING_REF                        TokenToGet;\r
-  EFI_SMBIOS_HANDLE                 SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE1                *SmbiosRecord;\r
-  EFI_MISC_SYSTEM_MANUFACTURER      *ForType1InputData;\r
-\r
-  ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);\r
-  ProductName = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  PdNameStrLen = StrLen(ProductName);\r
-  if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Manufacturer = 1;\r
-  //\r
-  // ProductName will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->ProductName = 2;  \r
-  //\r
-  // Version will be the 3rd optional string following the formatted structure.  \r
-  //\r
-  SmbiosRecord->Version = 3;  \r
-  //\r
-  // Version will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 4;\r
-  CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,16);\r
-  SmbiosRecord->WakeUpType = (UINT8)ForType1InputData->SystemWakeupType;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
-/* eof - MiscSystemManufacturerFunction.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c
deleted file mode 100644 (file)
index b027354..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  MiscSystemOptionStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString) = {\r
-  STRING_TOKEN(STR_MISC_SYSTEM_OPTION_STRING)\r
-};\r
-\r
-/* eof - MiscSystemOptionStringData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
deleted file mode 100644 (file)
index e3abc4f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file\r
-  BIOS system option string boot time changes.\r
-  SMBIOS type 12.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemOptionString (Type 12).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString)\r
-{\r
-  CHAR8                             *OptionalStrStart;\r
-  UINTN                             OptStrLen;\r
-  EFI_STRING                        OptionString;\r
-  EFI_STATUS                        Status;\r
-  STRING_REF                        TokenToGet;\r
-  EFI_SMBIOS_HANDLE                 SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE12               *SmbiosRecord;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_OPTION_STRING);\r
-  OptionString = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  OptStrLen = StrLen(OptionString);\r
-  if (OptStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE12);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-\r
-  SmbiosRecord->StringCount = 1;\r
-  OptionalStrStart = (CHAR8*) (SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(OptionString, OptionalStrStart);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
deleted file mode 100644 (file)
index be70130..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-    MiscSystemSlotDesignationData.c\r
-\r
-Abstract:\r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation) = {\r
-  STRING_TOKEN(STR_MISC_SYSTEM_SLOT_DESIGNATION),   // SlotDesignation\r
-  EfiSlotTypeOther,         // SlotType\r
-  EfiSlotDataBusWidthOther, // SlotDataBusWidth\r
-  EfiSlotUsageOther,        // SlotUsage\r
-  EfiSlotLengthOther,       // SlotLength\r
-  0,                        // SlotId\r
-  {                         // SlotCharacteristics\r
-    0,                      // CharacteristicsUnknown  :1;\r
-    0,                      // Provides50Volts         :1;\r
-    0,                      // Provides33Volts         :1;\r
-    0,                      // SharedSlot              :1;\r
-    0,                      // PcCard16Supported       :1;\r
-    0,                      // CardBusSupported        :1;\r
-    0,                      // ZoomVideoSupported      :1;\r
-    0,                      // ModemRingResumeSupported:1;\r
-    0,                      // PmeSignalSupported      :1;\r
-    0,                      // HotPlugDevicesSupported :1;\r
-    0,                      // SmbusSignalSupported    :1;\r
-    0                       // Reserved                :21;\r
-  },\r
-  0                         // SlotDevicePath\r
-};\r
-\r
-/* eof - MiscSystemSlotsData.c */\r
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c
deleted file mode 100644 (file)
index f626003..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file\r
-  BIOS system slot designator information boot time changes.\r
-  SMBIOS type 9.\r
-  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MiscSubclassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemSlotDesignator structure (Type 9).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation)\r
-{\r
-  CHAR8                              *OptionalStrStart;\r
-  UINTN                              SlotDesignationStrLen;\r
-  EFI_STATUS                         Status;\r
-  EFI_STRING                         SlotDesignation;\r
-  STRING_REF                         TokenToGet;\r
-  SMBIOS_TABLE_TYPE9                 *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE                  SmbiosHandle;\r
-  EFI_MISC_SYSTEM_SLOT_DESIGNATION*  ForType9InputData;\r
-\r
-  ForType9InputData = (EFI_MISC_SYSTEM_SLOT_DESIGNATION *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = 0;\r
-  switch (ForType9InputData->SlotDesignation) {\r
-    case STR_MISC_SYSTEM_SLOT_DESIGNATION: \r
-      TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_DESIGNATION);\r
-      break;\r
-    default:\r
-      break;\r
-  }\r
-\r
-  SlotDesignation = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SlotDesignationStrLen = StrLen(SlotDesignation);\r
-  if (SlotDesignationStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE9) +SlotDesignationStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_SLOTS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE9);\r
-  SmbiosRecord->Hdr.Handle = 0; \r
-  SmbiosRecord->SlotDesignation = 1;\r
-  SmbiosRecord->SlotType = (UINT8)ForType9InputData->SlotType;\r
-  SmbiosRecord->SlotDataBusWidth = (UINT8)ForType9InputData->SlotDataBusWidth;\r
-  SmbiosRecord->CurrentUsage = (UINT8)ForType9InputData->SlotUsage;\r
-  SmbiosRecord->SlotLength = (UINT8)ForType9InputData->SlotLength;\r
-  SmbiosRecord->SlotID = ForType9InputData->SlotId;\r
-  \r
-  //\r
-  // Slot Characteristics\r
-  //\r
-  CopyMem ((UINT8 *) &SmbiosRecord->SlotCharacteristics1,(UINT8 *) &ForType9InputData->SlotCharacteristics,2);\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart);\r
-  //  \r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/Nt32Pkg.dec b/Nt32Pkg/Nt32Pkg.dec
deleted file mode 100644 (file)
index 158e896..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-## @file\r
-# This package is a platform package that provide platform module/library \r
-# required by NT32 platform.\r
-#\r
-# File/Directory Orignazation:\r
-# |- Sec            : Emulation SecCore for Nt32 platform\r
-# |- *Pei           : PEIM drivers\r
-# |- *Dxe           : DXE drivers\r
-# |- Nt32Pkg.dec    : This file\r
-# |- Nt32Pkg.dsc    : Nt32 platform DSC file\r
-# |- Nt32Pkg.fdf    : Flash description file for Nt32Pkg. It is used for creating FD file.\r
-# |- Include        : Include files for Nt32Pkg\r
-# \r
-#\r
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
-#\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-\r
-[Defines]\r
-  DEC_SPECIFICATION              = 0x00010005\r
-  PACKAGE_NAME                   = Nt32Pkg\r
-  PACKAGE_GUID                   = 0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3\r
-  PACKAGE_VERSION                = 0.4\r
-\r
-[Includes]\r
-  Include\r
-\r
-[LibraryClasses]\r
-  ##\r
-  #  Expose EFI_WIN_NT_THUNK_PROTOCOL's interface, this protocol wrapper all \r
-  #  necessary Window API used by Nt32 enumlation environment.\r
-  WinNtLib|Include/Library/WinNtLib.h\r
-\r
-[Guids]\r
-  gEfiWinNtPassThroughGuid       = { 0xCC664EB8, 0x3C24, 0x4086, { 0xB6, 0xF6, 0x34, 0xE8, 0x56, 0xBC, 0xE3, 0x6E }}\r
-  gEfiWinNtConsoleGuid           = { 0xBA73672C, 0xA5D3, 0x11D4, { 0xBD, 0x00, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtUgaGuid               = { 0xAB248E99, 0xABE1, 0x11D4, { 0xBD, 0x0D, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtGopGuid               = { 0x4e11e955, 0xccca, 0x11d4, { 0xbd, 0x0d, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 }}\r
-  gEfiWinNtSerialPortGuid        = { 0x0C95A93D, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtFileSystemGuid        = { 0x0C95A935, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtPhysicalDisksGuid     = { 0x0C95A92F, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtVirtualDisksGuid      = { 0x0C95A928, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiNt32PkgTokenSpaceGuid      = { 0x0D79A645, 0x1D91, 0x40a6, { 0xA8, 0x1F, 0x61, 0xE6, 0x98, 0x2B, 0x32, 0xB4 }}\r
-  gEfiWinNtSystemConfigGuid      = { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}\r
-\r
-[Ppis]\r
-  ## This PPI wrapper all necessary windows API used by PEI driver in NT32 environment.\r
-  gPeiNtThunkPpiGuid             = { 0x98c281e5, 0xf906, 0x43dd, { 0xa9, 0x2b, 0xb0, 0x03, 0xbf, 0x27, 0x65, 0xda }}\r
-  ## This PPI provide system memory scan interface which simulate real platform perform\r
-  # memory's auto scan.\r
-  gPeiNtAutoScanPpiGuid          = { 0x0dce384d, 0x007c, 0x4ba5, { 0x94, 0xbd, 0x0f, 0x6e, 0xb6, 0x4d, 0x2a, 0xa9 }}\r
-  ## This PPI provide interace to loads and relocates a PE/COFF image into memory.\r
-  gNtPeiLoadFilePpiGuid          = { 0xfd0c65eb, 0x0405, 0x4cd2, { 0x8a, 0xee, 0xf4, 0x0, 0xef, 0x13, 0xba, 0xc2 }}\r
-  ## This PPI instance hold information for an simulated firmware device.\r
-  gNtFwhPpiGuid                  = { 0x4e76928f, 0x50ad, 0x4334, {0xb0, 0x6b, 0xa8, 0x42, 0x13, 0x10, 0x8a, 0x57 }}\r
-\r
-[Protocols]\r
-  gWinNtBusDriverGuid            = { 0x0419f582, 0x0625, 0x4531, { 0x8a, 0x33, 0x85, 0xa9, 0x96, 0x5c, 0x95, 0xbc }}\r
-  gEfiWinNtThunkProtocolGuid     = { 0x58C518B1, 0x76F3, 0x11D4, { 0xBC, 0xEA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-  gEfiWinNtIoProtocolGuid        = { 0x96EB4AD6, 0xA32A, 0x11D4, { 0xBC, 0xFD, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
-\r
-[PcdsFixedAtBuild]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase|0x0|UINT32|0x0000100e\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize|0x0|UINT32|0x0000100f\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase|0x0|UINT32|0x00001010\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize|0x0|UINT32|0x00001011\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize|0x0|UINT32|0x00001012\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize|0|UINT32|0x00001013\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase|0x0|UINT32|0x00001014\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase|0x0|UINT32|0x00001015\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase|0x0|UINT32|0x00001016\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress|0x0|UINT32|0x00001017\r
-\r
-[PcdsFixedAtBuild, PcdsPatchableInModule]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtBootMode|1|UINT32|0x00001006\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume|L"..\\Fv\\Fv_Recovery.fd"|VOID*|0x00001009\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain|L"64!64"|VOID*|0x0000100c\r
-\r
-[PcdsDynamic, PcdsDynamicEx]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk|L"E:RW;245760;512"|VOID*|0x00001000\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|0x00001001\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|0x00001002\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga|L"UGA Window 1!UGA Window 2"|VOID*|0x00001003\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|0x00001004\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize|L"64!64"|VOID*|0x00001005\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console Window"|VOID*|0x0000100a\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 2"|VOID*|0x0000100d\r
-\r
diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
deleted file mode 100644 (file)
index 990d5ee..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-## @file\r
-# EFI/Framework Emulation Platform with UEFI HII interface supported.\r
-#\r
-# The Emulation Platform can be used to debug individual modules, prior to creating\r
-#    a real platform. This also provides an example for how an DSC is created.\r
-#\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>\r
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-#\r
-#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-################################################################################\r
-#\r
-# Defines Section - statements that will be processed to create a Makefile.\r
-#\r
-################################################################################\r
-[Defines]\r
-  PLATFORM_NAME                  = NT32\r
-  PLATFORM_GUID                  = EB216561-961F-47EE-9EF9-CA426EF547C2\r
-  PLATFORM_VERSION               = 0.4\r
-  DSC_SPECIFICATION              = 0x00010005\r
-  OUTPUT_DIRECTORY               = Build/NT32$(ARCH)\r
-  SUPPORTED_ARCHITECTURES        = IA32|X64\r
-  BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT\r
-  SKUID_IDENTIFIER               = DEFAULT\r
-  FLASH_DEFINITION               = Nt32Pkg/Nt32Pkg.fdf\r
-  #\r
-  # This flag is to control tool to generate PCD info for dynamic(ex) PCD,\r
-  # then enable or disable PCD info feature. TRUE is enable, and FLASE is disable.\r
-  # If the flag is absent, it will be same as FALSE.\r
-  #\r
-  PCD_INFO_GENERATION            = TRUE\r
-\r
-  #\r
-  # Defines for default states.  These can be changed on the command line.\r
-  # -D FLAG=VALUE\r
-  #\r
-  # Note: Secure Boot feature highly depends on the OpenSSL building. To enable this \r
-  #       feature, please follow the instructions found in the file "Patch-HOWTO.txt" \r
-  #       located in CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.\r
-  #\r
-  DEFINE SECURE_BOOT_ENABLE      = FALSE\r
-\r
-  #\r
-  # Network definition\r
-  # SnpNt32Dxe.inf will be used.\r
-  #\r
-  DEFINE NETWORK_TLS_ENABLE             = FALSE\r
-  DEFINE NETWORK_IP6_ENABLE             = FALSE\r
-  DEFINE NETWORK_SNP_ENABLE             = FALSE\r
-  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE\r
-\r
-################################################################################\r
-#\r
-# SKU Identification section - list of all SKU IDs supported by this\r
-#                              Platform.\r
-#\r
-################################################################################\r
-[SkuIds]\r
-  0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.\r
-\r
-################################################################################\r
-#\r
-# Library Class section - list of all Library Classes needed by this Platform.\r
-#\r
-################################################################################\r
-[LibraryClasses]\r
-  #\r
-  # Entry point\r
-  #\r
-  PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
-  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
-  DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
-  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
-  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
-  #\r
-  # Basic\r
-  #\r
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
-  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
-  CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
-  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
-  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
-  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf\r
-  PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf\r
-  CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
-  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
-  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
-  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf\r
-  #\r
-  # UEFI & PI\r
-  #\r
-  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
-  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
-  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
-  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
-  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
-  DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf\r
-  UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
-  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
-  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf\r
-  DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf\r
-  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf\r
-  \r
-  #\r
-  # Generic Modules\r
-  #\r
-  UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
-  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
-  GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf\r
-  CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf\r
-  SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-  SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf\r
-  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf\r
-  #\r
-  # Platform\r
-  #\r
-  PlatformBootManagerLib|Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf\r
-  #\r
-  # Misc\r
-  #\r
-  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
-  DebugPrintErrorLevelLib|MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf\r
-  PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
-  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
-  CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
-  LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf\r
-  ResetSystemLib|Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf\r
-!if $(NETWORK_TLS_ENABLE) == TRUE\r
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf\r
-!else\r
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf\r
-!endif\r
-  \r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-  PlatformSecureLib|Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf\r
-  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
-  AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf\r
-!else\r
-  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf\r
-  AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf\r
-!endif\r
-  VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf\r
-\r
-[LibraryClasses.common.USER_DEFINED]\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-  PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-\r
-[LibraryClasses.common.PEIM,LibraryClasses.common.PEI_CORE]\r
-  #\r
-  # PEI phase common\r
-  #\r
-  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf\r
-  IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf\r
-  PeCoffGetEntryPointLib|Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf\r
-  PeCoffExtraActionLib|Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf\r
-  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
-\r
-[LibraryClasses.common.PEI_CORE]\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
-\r
-[LibraryClasses.common.PEIM]\r
-  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
-  OemHookStatusCodeLib|Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf\r
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf\r
-\r
-[LibraryClasses.common]\r
-  #\r
-  # DXE phase common\r
-  #\r
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf\r
-  PeCoffExtraActionLib|Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
-  WinNtLib|Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf\r
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
-  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf\r
-\r
-[LibraryClasses.common.DXE_CORE]\r
-  HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf\r
-  MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-\r
-[LibraryClasses.common.DXE_SMM_DRIVER]\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-\r
-[LibraryClasses.common.UEFI_DRIVER]\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-\r
-[LibraryClasses.common.UEFI_APPLICATION]\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf\r
-  \r
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
-  #\r
-  # Runtime\r
-  #\r
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf\r
-\r
-################################################################################\r
-#\r
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform\r
-#\r
-################################################################################\r
-[PcdsFeatureFlag]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|TRUE\r
-\r
-[PcdsFixedAtBuild]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000000\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume|L"..\\Fv\\Nt32.fd"\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize|0x10000\r
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000\r
-\r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-  # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04\r
-  gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04\r
-!endif\r
-                        \r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }\r
-\r
-\r
-################################################################################\r
-#\r
-# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform\r
-#\r
-################################################################################\r
-[PcdsDynamicDefault.common.DEFAULT]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|20\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 2"|VOID*|52\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console Window"|VOID*|52\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|26\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize|L"64!64"|VOID*|12\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk|L"a:RW;2880;512!d:RO;307200;2048!j:RW;262144;512"|VOID*|100\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga|L"UGA Window 1!UGA Window 2"|VOID*|52\r
-\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0\r
-\r
-[PcdsDynamicDefault.Ia32]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106\r
-\r
-[PcdsDynamicDefault.x64]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106\r
-\r
-[PcdsDynamicHii.common.DEFAULT]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x0|80\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x4|25\r
-  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10\r
-  gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1\r
-\r
-###################################################################################################\r
-#\r
-# Components Section - list of the modules and components that will be processed by compilation\r
-#                      tools and the EDK II tools to generate PE32/PE32+/Coff image files.\r
-#\r
-# Note: The EDK II DSC file is not used to specify how compiled binary images get placed\r
-#       into firmware volume images. This section is just a list of modules to compile from\r
-#       source into UEFI-compliant binaries.\r
-#       It is the FDF file that contains information on combining binary files into firmware\r
-#       volume images, whose concept is beyond UEFI and is described in PI specification.\r
-#       Binary modules do not need to be listed in this section, as they should be\r
-#       specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),\r
-#       Logo (Logo.bmp), and etc.\r
-#       There may also be modules listed in this section that are not required in the FDF file,\r
-#       When a module listed here is excluded from FDF file, then UEFI-compliant binary will be\r
-#       generated for it, but the binary will not be put into any firmware volume.\r
-#\r
-###################################################################################################\r
-[Components]\r
-  ##\r
-  #  SEC Phase modules\r
-  ##\r
-  Nt32Pkg/Sec/SecMain.inf\r
-\r
-  ##\r
-  #  PEI Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Pei/PeiMain.inf\r
-  MdeModulePkg/Universal/PCD/Pei/Pcd.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-  MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf\r
-  MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf\r
-  Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf\r
-  Nt32Pkg/BootModePei/BootModePei.inf\r
-  Nt32Pkg/StallPei/StallPei.inf\r
-  Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf\r
-  \r
-  MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf\r
-  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-\r
-  Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf\r
-  Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf\r
-  Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf\r
-  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-  ##\r
-  #  DXE Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Dxe/DxeMain.inf {\r
-    <LibraryClasses>\r
-      NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
-      DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-    <BuildOptions>\r
-      *_*_*_CC_FLAGS =\r
-  }\r
-\r
-  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-  Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
-  Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
-  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf\r
-  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-  Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf\r
-  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf  {\r
-    <LibraryClasses>\r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-      NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf\r
-!endif \r
-  }\r
-  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-  Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf\r
-  Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf\r
-  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-  Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf\r
-  Nt32Pkg/TimerDxe/TimerDxe.inf\r
-  MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
-  MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf\r
-  Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf\r
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {\r
-    <LibraryClasses>\r
-      NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf\r
-  }\r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-  SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf\r
-!endif\r
-  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  }\r
-  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  }\r
-  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  }\r
-  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {\r
-    <LibraryClasses>\r
-      DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-  }\r
-  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-  FatPkg/EnhancedFatDxe/Fat.inf\r
-  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf\r
-  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf     ##This driver follows UEFI specification definition\r
-  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf    ##This driver follows UEFI specification definition\r
-  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-  Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  }\r
-  Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf\r
-  Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf\r
-  Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf\r
-  Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf\r
-  MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
-\r
-  #\r
-  # Network SNP drivers\r
-  # To test network drivers, need network Io driver(SnpNt32Io.dll), please refer to NETWORK-IO Subproject.\r
-  #\r
-!include NetworkPkg/Network.dsc.inc\r
-  Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf\r
-  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf\r
-  MdeModulePkg/Application/UiApp/UiApp.inf{\r
-    <LibraryClasses>\r
-      NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf\r
-      NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf\r
-      NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf\r
-  }\r
-  MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf\r
-  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf\r
-  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-  MdeModulePkg/Application/VariableInfo/VariableInfo.inf\r
-\r
-  MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf\r
-  MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf\r
-  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf {\r
-    <LibraryClasses>\r
-      NULL|IntelFrameworkModulePkg/Library/LegacyBootManagerLib/LegacyBootManagerLib.inf\r
-  }\r
-  MdeModulePkg/Logo/LogoDxe.inf\r
-  ShellPkg/Application/Shell/Shell.inf {\r
-    <PcdsFixedAtBuild>\r
-      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE\r
-    <LibraryClasses>\r
-      NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf\r
-      NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf\r
-      ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf\r
-      ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf\r
-      HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf\r
-      BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf\r
-      FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf\r
-  }\r
-\r
-###################################################################################################\r
-#\r
-# BuildOptions Section - Define the module specific tool chain flags that should be used as\r
-#                        the default flags for a module. These flags are appended to any \r
-#                        standard flags that are defined by the build process. They can be \r
-#                        applied for any modules or only those modules with the specific \r
-#                        module style (EDK or EDKII) specified in [Components] section.\r
-#\r
-###################################################################################################\r
-[BuildOptions]\r
-  DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE\r
-  NOOPT_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE\r
-  RELEASE_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096\r
-\r
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
deleted file mode 100644 (file)
index 7798d17..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-## @file\r
-# This is NT32 FDF file with UEFI HII features enabled\r
-#\r
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-#\r
-#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-\r
-################################################################################\r
-#\r
-# FD Section\r
-# The [FD] Section is made up of the definition statements and a\r
-# description of what goes into  the Flash Device Image.  Each FD section\r
-# defines one flash "device" image.  A flash device image may be one of\r
-# the following: Removable media bootable image (like a boot floppy\r
-# image,) an Option ROM image (that would be "flashed" into an add-in\r
-# card,) a System "Flash"  image (that would be burned into a system's\r
-# flash) or an Update ("Capsule") image that will be used to update and\r
-# existing system flash.\r
-#\r
-################################################################################\r
-[FD.Nt32]\r
-BaseAddress   = 0x0|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress          #The base address of the FLASH Device.\r
-Size          = 0x00480000|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize  #The size in bytes of the FLASH Device\r
-ErasePolarity = 1\r
-BlockSize     = 0x10000\r
-NumBlocks     = 0x48\r
-\r
-################################################################################\r
-#\r
-# Following are lists of FD Region layout which correspond to the locations of different\r
-# images within the flash device.\r
-#\r
-# Regions must be defined in ascending order and may not overlap.\r
-#\r
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by\r
-# the pipe "|" character, followed by the size of the region, also in hex with the leading\r
-# "0x" characters. Like:\r
-# Offset|Size\r
-# PcdOffsetCName|PcdSizeCName\r
-# RegionType <FV, DATA, or FILE>\r
-#\r
-################################################################################\r
-0x00000000|0x00460000\r
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize\r
-FV = FvRecovery\r
-\r
-0x00460000|0x0000c000\r
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-#NV_VARIABLE_STORE\r
-DATA = {\r
-  ## This is the EFI_FIRMWARE_VOLUME_HEADER\r
-  # ZeroVector []\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  # FileSystemGuid: gEfiSystemNvDataFvGuid         =\r
-  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}\r
-  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,\r
-  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,\r
-  # FvLength: 0x20000\r
-  0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  #Signature "_FVH"       #Attributes\r
-  0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,\r
-  #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision\r
-  0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,\r
-  #Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block\r
-  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,\r
-  #Blockmap[1]: End\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  ## This is the VARIABLE_STORE_HEADER\r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-  #Signature: gEfiAuthenticatedVariableGuid =\r
-  #  { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}\r
-  0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43,\r
-  0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92,\r
-!else\r
-  #Signature: gEfiVariableGuid =\r
-  #  { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}\r
-  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,\r
-  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,\r
-!endif\r
-  #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8\r
-  # This can speed up the Variable Dispatch a bit.\r
-  0xB8, 0xBF, 0x00, 0x00,\r
-  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32\r
-  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x0046c000|0x00002000\r
-#NV_EVENT_LOG\r
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize\r
-\r
-0x0046e000|0x00002000\r
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-#NV_FTW_WORKING\r
-DATA = {\r
-  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid         =\r
-  #  { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95 }}\r
-  0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49,\r
-  0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95,\r
-  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved\r
-  0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF,\r
-  # WriteQueueSize: UINT64\r
-  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x00470000|0x00010000\r
-#NV_FTW_SPARE\r
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-\r
-################################################################################\r
-#\r
-# FV Section\r
-#\r
-# [FV] section is used to define what components or modules are placed within a flash\r
-# device file.  This section also defines order the components and modules are positioned\r
-# within the image.  The [FV] section consists of define statements, set statements and\r
-# module statements.\r
-#\r
-################################################################################\r
-[FV.FvRecovery]\r
-FvAlignment        = 16         #FV alignment and FV attributes setting.\r
-ERASE_POLARITY     = 1\r
-MEMORY_MAPPED      = TRUE\r
-STICKY_WRITE       = TRUE\r
-LOCK_CAP           = TRUE\r
-LOCK_STATUS        = TRUE\r
-WRITE_DISABLED_CAP = TRUE\r
-WRITE_ENABLED_CAP  = TRUE\r
-WRITE_STATUS       = TRUE\r
-WRITE_LOCK_CAP     = TRUE\r
-WRITE_LOCK_STATUS  = TRUE\r
-READ_DISABLED_CAP  = TRUE\r
-READ_ENABLED_CAP   = TRUE\r
-READ_STATUS        = TRUE\r
-READ_LOCK_CAP      = TRUE\r
-READ_LOCK_STATUS   = TRUE\r
-FvNameGuid         = 6D99E806-3D38-42c2-A095-5F4300BFD7DC\r
-\r
-################################################################################\r
-#\r
-# The INF statements point to EDK component and EDK II module INF files, which will be placed into this FV image.\r
-# Parsing tools will scan the INF file to determine the type of component or module.\r
-# The component or module type is used to reference the standard rules\r
-# defined elsewhere in the FDF file.\r
-#\r
-# The format for INF statements is:\r
-# INF $(PathAndInfFileName)\r
-#\r
-################################################################################\r
-  ##\r
-  #  PEI Phase modules\r
-  ##\r
-  ##\r
-  #  PEI Apriori file example, more PEIM module added later.\r
-  ##\r
-APRIORI PEI {\r
-  INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-  INF  MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf\r
-  INF  MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf\r
-  INF  Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf\r
-  }\r
-APRIORI DXE {\r
-  INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-  INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-  INF  Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
-  INF  MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
-  INF  MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf\r
-  INF  Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf\r
-  }\r
-\r
-INF  MdeModulePkg/Core/Pei/PeiMain.inf\r
-INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-INF  MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf\r
-INF  MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf\r
-INF  Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf\r
-INF  Nt32Pkg/BootModePei/BootModePei.inf\r
-INF  Nt32Pkg/StallPei/StallPei.inf\r
-INF  Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf\r
-INF  Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf\r
-INF  Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf\r
-\r
-INF  MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf\r
-INF  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-\r
-INF  Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf\r
-INF  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
-  ##\r
-  #  DXE Phase modules\r
-  ##\r
-INF  MdeModulePkg/Core/Dxe/DxeMain.inf\r
-INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-INF  Nt32Pkg/MetronomeDxe/MetronomeDxe.inf\r
-INF  Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf\r
-INF  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-INF  Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
-INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-INF  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-INF  Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf\r
-INF  Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf\r
-INF  MdeModulePkg/Application/UiApp/UiApp.inf\r
-INF  MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf\r
-INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-INF  Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf\r
-INF  Nt32Pkg/TimerDxe/TimerDxe.inf\r
-INF  MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf\r
-INF  Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf\r
-INF  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
-!if $(SECURE_BOOT_ENABLE) == TRUE\r
-INF  SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf\r
-!endif\r
-INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-INF  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
-INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
-INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-INF  MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf\r
-INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-INF  RuleOverride = TIANOCOMPRESSED MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-INF  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf\r
-INF  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-INF  Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf\r
-INF  Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf\r
-INF  Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf\r
-INF  Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf\r
-INF  Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf\r
-INF  MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf\r
-INF  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf\r
-\r
-INF  Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf\r
-!include NetworkPkg/Network.fdf.inc\r
-\r
-INF  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf\r
-################################################################################\r
-#\r
-# FILE statements are provided so that a platform integrator can include\r
-# complete EFI FFS files, as well as a method for constructing FFS files\r
-# using curly "{}" brace scoping. The following three FILEs are\r
-# for binary shell, binary fat and logo module.\r
-#\r
-################################################################################\r
-INF  ShellPkg/Application/Shell/Shell.inf\r
-\r
-INF FatPkg/EnhancedFatDxe/Fat.inf\r
-INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf\r
-\r
-INF MdeModulePkg/Logo/LogoDxe.inf\r
-INF MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf\r
-################################################################################\r
-#\r
-# Rules are use with the [FV] section's module INF type to define\r
-# how an FFS file is created for a given INF file. The following Rule are the default\r
-# rules for the different module type. User can add the customized rules to define the\r
-# content of the FFS file.\r
-#\r
-################################################################################\r
-\r
-\r
-############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section   # \r
-############################################################################\r
-#\r
-#[Rule.Common.DXE_DRIVER]\r
-#  FILE DRIVER = $(NAMED_GUID) {\r
-#    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-#    COMPRESS PI_STD {\r
-#      GUIDED {\r
-#        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-#        UI       STRING="$(MODULE_NAME)" Optional\r
-#        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-#      }\r
-#    }\r
-#  }\r
-#\r
-############################################################################\r
-\r
-[Rule.Common.PEI_CORE]\r
-  FILE PEI_CORE = $(NAMED_GUID) {\r
-    PE32     PE32    Align=4K     $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-    UI       STRING ="$(MODULE_NAME)" Optional         \r
-    VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)    \r
-  }\r
-\r
-[Rule.Common.PEIM]\r
-  FILE PEIM = $(NAMED_GUID) {\r
-     PEI_DEPEX PEI_DEPEX Optional        $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-     PE32      PE32    Align=4K          $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-     UI       STRING="$(MODULE_NAME)" Optional         \r
-     VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)   \r
-  }\r
-\r
-[Rule.Common.DXE_CORE]\r
-  FILE DXE_CORE = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      PE32     PE32      $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-      UI       STRING="$(MODULE_NAME)" Optional\r
-      VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER.TIANOCOMPRESSED]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {\r
-      PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-      UI       STRING="$(MODULE_NAME)" Optional\r
-      VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_RUNTIME_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION.BINARY]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    |.efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER.BINARY]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      |.depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    |.efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
diff --git a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c
deleted file mode 100644 (file)
index 8a62301..0000000
+++ /dev/null
@@ -1,391 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  RealTimeClock.c\r
-\r
-Abstract:\r
-\r
-  NT Emulation Architectural Protocol Driver as defined in Tiano\r
-\r
-**/\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/RealTimeClock.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-\r
-BOOLEAN\r
-DayValid (\r
-  IN  EFI_TIME  *Time\r
-  );\r
-\r
-BOOLEAN\r
-IsLeapYear (\r
-  IN EFI_TIME   *Time\r
-  );\r
-\r
-EFI_STATUS\r
-RtcTimeFieldsValid (\r
-  IN EFI_TIME *Time\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeRealTimeClock (\r
-  IN EFI_HANDLE                          ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                    *SystemTable\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetTime (\r
-  OUT EFI_TIME                                 *Time,\r
-  OUT EFI_TIME_CAPABILITIES                    *Capabilities OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->GetTime \r
-\r
-Arguments:\r
-\r
-  Time          - A pointer to storage that will receive a snapshot of the current time.\r
-\r
-  Capabilities  - A pointer to storage that will receive the capabilities of the real time clock\r
-                  in the platform. This includes the real time clock's resolution and accuracy.  \r
-                  All reported device capabilities are rounded up.  This is an OPTIONAL argument.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS   - The underlying GetSystemTime call occurred and returned\r
-                  Note that in the NT32 emulation, the GetSystemTime call has no return value\r
-                  thus you will always receive a EFI_SUCCESS on this.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  SYSTEMTIME            SystemTime;\r
-  TIME_ZONE_INFORMATION TimeZone;\r
-\r
-  //\r
-  // Check parameter for null pointer\r
-  //\r
-  if (Time == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-\r
-  }\r
-\r
-  gWinNt->GetLocalTime (&SystemTime);\r
-  gWinNt->GetTimeZoneInformation (&TimeZone);\r
-\r
-  Time->Year        = (UINT16) SystemTime.wYear;\r
-  Time->Month       = (UINT8) SystemTime.wMonth;\r
-  Time->Day         = (UINT8) SystemTime.wDay;\r
-  Time->Hour        = (UINT8) SystemTime.wHour;\r
-  Time->Minute      = (UINT8) SystemTime.wMinute;\r
-  Time->Second      = (UINT8) SystemTime.wSecond;\r
-  Time->Nanosecond  = (UINT32) (SystemTime.wMilliseconds * 1000000);\r
-  Time->TimeZone    = (INT16) TimeZone.Bias;\r
-\r
-  if (Capabilities != NULL) {\r
-    Capabilities->Resolution  = 1;\r
-    Capabilities->Accuracy    = 50000000;\r
-    Capabilities->SetsToZero  = FALSE;\r
-  }\r
-\r
-  Time->Daylight = 0;\r
-  if (TimeZone.StandardDate.wMonth) {\r
-    Time->Daylight = (UINT8) TimeZone.StandardDate.wMonth;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSetTime (\r
-  IN EFI_TIME   *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->SetTime \r
-\r
-Arguments:\r
-\r
-  Time          - A pointer to storage containing the time and date information to\r
-                  program into the real time clock.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_INVALID_PARAMETER - One of the fields in Time is out of range.\r
-\r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
---*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  TIME_ZONE_INFORMATION TimeZone;\r
-  EFI_STATUS            Status;\r
-  SYSTEMTIME            SystemTime;\r
-  BOOL                  Flag;\r
-\r
-  if (Time == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Make sure that the time fields are valid\r
-  //\r
-  Status = RtcTimeFieldsValid (Time);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Set Daylight savings time information and Time Zone\r
-  //\r
-  gWinNt->GetTimeZoneInformation (&TimeZone);\r
-  TimeZone.StandardDate.wMonth  = Time->Daylight;\r
-  TimeZone.Bias                 = Time->TimeZone;\r
-  Flag = gWinNt->SetTimeZoneInformation (&TimeZone);\r
-  if (!Flag) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  SystemTime.wYear          = Time->Year;\r
-  SystemTime.wMonth         = Time->Month;\r
-  SystemTime.wDay           = Time->Day;\r
-  SystemTime.wHour          = Time->Hour;\r
-  SystemTime.wMinute        = Time->Minute;\r
-  SystemTime.wSecond        = Time->Second;\r
-  SystemTime.wMilliseconds  = (INT16) (Time->Nanosecond / 1000000);\r
-\r
-  Flag                      = gWinNt->SetLocalTime (&SystemTime);\r
-\r
-  if (!Flag) {\r
-    return EFI_DEVICE_ERROR;\r
-  } else {\r
-    return EFI_SUCCESS;\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGetWakeupTime (\r
-  OUT BOOLEAN        *Enabled,\r
-  OUT BOOLEAN        *Pending,\r
-  OUT EFI_TIME       *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->GetWakeupTime\r
-\r
-Arguments:\r
-  This          - Indicates the protocol instance structure.\r
-\r
-  Enabled       - Indicates if the alarm is currently enabled or disabled.\r
-\r
-  Pending       - Indicates if the alarm signal is pending and requires\r
-                  acknowledgement.\r
-\r
-  Time          - The current alarm setting.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
-  EFI_UNSUPPORTED       - The operation is not supported on this platform.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSetWakeupTime (\r
-  IN BOOLEAN      Enable,\r
-  OUT EFI_TIME    *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->SetWakeupTime\r
-\r
-Arguments:\r
-\r
-  Enabled       - Enable or disable the wakeup alarm.\r
-\r
-  Time          - If enable is TRUE, the time to set the wakup alarm for.\r
-                  If enable is FALSE, then this parameter is optional, and\r
-                  may be NULL.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
-  EFI_INVALID_PARAMETER - A field in Time is out of range.\r
-\r
-  EFI_UNSUPPORTED       - The operation is not supported on this platform.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeRealTimeClock (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Install Real Time Clock Protocol \r
-\r
-Arguments:\r
-  (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS - Real Time Clock Services are installed into the Runtime Services Table\r
-\r
---*/\r
-// TODO:    ImageHandle - add argument and description to function comment\r
-// TODO:    SystemTable - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-\r
-  SystemTable->RuntimeServices->GetTime       = WinNtGetTime;\r
-  SystemTable->RuntimeServices->SetTime       = WinNtSetTime;\r
-  SystemTable->RuntimeServices->GetWakeupTime = WinNtGetWakeupTime;\r
-  SystemTable->RuntimeServices->SetWakeupTime = WinNtSetWakeupTime;\r
-\r
-  Handle = NULL;\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Handle,\r
-                  &gEfiRealTimeClockArchProtocolGuid,\r
-                  NULL,\r
-                  NULL\r
-                  );\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-RtcTimeFieldsValid (\r
-  IN EFI_TIME *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Arguments:\r
\r
-  Returns: \r
---*/\r
-// TODO:    Time - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  if (Time->Year < 1998 ||\r
-      Time->Year > 2099 ||\r
-      Time->Month < 1 ||\r
-      Time->Month > 12 ||\r
-      (!DayValid (Time)) ||\r
-      Time->Hour > 23 ||\r
-      Time->Minute > 59 ||\r
-      Time->Second > 59 ||\r
-      Time->Nanosecond > 999999999 ||\r
-      (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) ||\r
-      (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT)))\r
-      ) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-BOOLEAN\r
-DayValid (\r
-  IN  EFI_TIME  *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Time  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-\r
-  INTN  DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\r
-\r
-  if (Time->Day < 1 ||\r
-      Time->Day > DayOfMonth[Time->Month - 1] ||\r
-      (Time->Month == 2 && (!IsLeapYear (Time) && Time->Day > 28))\r
-      ) {\r
-    return FALSE;\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-BOOLEAN\r
-IsLeapYear (\r
-  IN EFI_TIME   *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Time  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  if (Time->Year % 4 == 0) {\r
-    if (Time->Year % 100 == 0) {\r
-      if (Time->Year % 400 == 0) {\r
-        return TRUE;\r
-      } else {\r
-        return FALSE;\r
-      }\r
-    } else {\r
-      return TRUE;\r
-    }\r
-  } else {\r
-    return FALSE;\r
-  }\r
-}\r
diff --git a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf b/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
deleted file mode 100644 (file)
index 2cd9bf8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file\r
-# NT Emulation Real time clock Architectural Protocol Driver as defined in TIANO\r
-#\r
-# This real time clock module simulates virtual device by time WinAPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = RealTimeClock\r
-  FILE_GUID                      = 27F05AF5-1644-4EF4-8944-48C4F75675A0\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeRealTimeClock\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  RealTimeClock.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  WinNtLib\r
-  UefiDriverEntryPoint\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiRealTimeClockArchProtocolGuid             # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[depex]\r
-  TRUE\r
-  \r
diff --git a/Nt32Pkg/Sec/FwVol.c b/Nt32Pkg/Sec/FwVol.c
deleted file mode 100644 (file)
index c7c647e..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  FwVol.c\r
-\r
-Abstract:\r
-  A simple FV stack so the SEC can extract the SEC Core from an\r
-  FV.\r
-\r
-**/\r
-\r
-#include "SecMain.h"\r
-\r
-#define GET_OCCUPIED_SIZE(ActualSize, Alignment) \\r
-  (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1))\r
-\r
-EFI_FFS_FILE_STATE\r
-GetFileState (\r
-  IN UINT8                ErasePolarity,\r
-  IN EFI_FFS_FILE_HEADER  *FfsHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Returns the highest bit set of the State field\r
-\r
-Arguments:\r
-  ErasePolarity   - Erase Polarity  as defined by EFI_FVB_ERASE_POLARITY\r
-                    in the Attributes field.\r
-  FfsHeader       - Pointer to FFS File Header.\r
-\r
-Returns:\r
-  Returns the highest bit in the State field\r
-\r
---*/\r
-{\r
-  EFI_FFS_FILE_STATE  FileState;\r
-  EFI_FFS_FILE_STATE  HighestBit;\r
-\r
-  FileState = FfsHeader->State;\r
-\r
-  if (ErasePolarity != 0) {\r
-    FileState = (EFI_FFS_FILE_STATE)~FileState;\r
-  }\r
-\r
-  HighestBit = 0x80;\r
-  while (HighestBit != 0 && (HighestBit & FileState) == 0) {\r
-    HighestBit >>= 1;\r
-  }\r
-\r
-  return HighestBit;\r
-}\r
-\r
-UINT8\r
-CalculateHeaderChecksum (\r
-  IN EFI_FFS_FILE_HEADER  *FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Calculates the checksum of the header of a file.\r
-\r
-Arguments:\r
-  FileHeader       - Pointer to FFS File Header.\r
-\r
-Returns:\r
-  Checksum of the header.\r
-  \r
---*/\r
-{\r
-  UINT8 *ptr;\r
-  UINTN Index;\r
-  UINT8 Sum;\r
-\r
-  Sum = 0;\r
-  ptr = (UINT8 *) FileHeader;\r
-\r
-  for (Index = 0; Index < sizeof (EFI_FFS_FILE_HEADER) - 3; Index += 4) {\r
-    Sum = (UINT8) (Sum + ptr[Index]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 1]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 2]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 3]);\r
-  }\r
-\r
-  for (; Index < sizeof (EFI_FFS_FILE_HEADER); Index++) {\r
-    Sum = (UINT8) (Sum + ptr[Index]);\r
-  }\r
-  //\r
-  // State field (since this indicates the different state of file).\r
-  //\r
-  Sum = (UINT8) (Sum - FileHeader->State);\r
-  //\r
-  // Checksum field of the file is not part of the header checksum.\r
-  //\r
-  Sum = (UINT8) (Sum - FileHeader->IntegrityCheck.Checksum.File);\r
-\r
-  return Sum;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE             SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching file in the\r
-    FFS volume as defined by SearchType. The search starts from FileHeader inside\r
-    the Firmware Volume defined by FwVolHeader.\r
-\r
-Arguments:\r
-    SearchType - Filter to find only files of this type.\r
-                 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
-    FwVolHeader - Pointer to the FV header of the volume to search.\r
-                  This parameter must point to a valid FFS volume.\r
-    FileHeader  - Pointer to the current file from which to begin searching.\r
-                  This pointer will be updated upon return to reflect the file\r
-                  found.\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  EFI_FFS_FILE_HEADER *FfsFileHeader;\r
-  UINT32              FileLength;\r
-  UINT32              FileOccupiedSize;\r
-  UINT32              FileOffset;\r
-  UINT64              FvLength;\r
-  UINT8               ErasePolarity;\r
-  UINT8               FileState;\r
-\r
-  FvLength = FwVolHeader->FvLength;\r
-  if (FwVolHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {\r
-    ErasePolarity = 1;\r
-  } else {\r
-    ErasePolarity = 0;\r
-  }\r
-  //\r
-  // If FileHeader is not specified (NULL) start with the first file in the\r
-  // firmware volume.  Otherwise, start from the FileHeader.\r
-  //\r
-  if (*FileHeader == NULL) {\r
-    FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FwVolHeader + FwVolHeader->HeaderLength);\r
-  } else {\r
-    //\r
-    // Length is 24 bits wide so mask upper 8 bits\r
-    // FileLength is adjusted to FileOccupiedSize as it is 8 byte aligned.\r
-    //\r
-    FileLength        = *(UINT32 *) (*FileHeader)->Size & 0x00FFFFFF;\r
-    FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-    FfsFileHeader     = (EFI_FFS_FILE_HEADER *) ((UINT8 *) *FileHeader + FileOccupiedSize);\r
-  }\r
-\r
-  FileOffset = (UINT32) ((UINT8 *) FfsFileHeader - (UINT8 *) FwVolHeader);\r
-\r
-  while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {\r
-    //\r
-    // Get FileState which is the highest bit of the State\r
-    //\r
-    FileState = GetFileState (ErasePolarity, FfsFileHeader);\r
-\r
-    switch (FileState) {\r
-\r
-    case EFI_FILE_HEADER_INVALID:\r
-      FileOffset += sizeof (EFI_FFS_FILE_HEADER);\r
-      FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));\r
-      break;\r
-\r
-    case EFI_FILE_DATA_VALID:\r
-    case EFI_FILE_MARKED_FOR_UPDATE:\r
-      if (CalculateHeaderChecksum (FfsFileHeader) == 0) {\r
-        FileLength        = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-        FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-\r
-        if ((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) {\r
-\r
-          *FileHeader = FfsFileHeader;\r
-\r
-          return EFI_SUCCESS;\r
-        }\r
-\r
-        FileOffset += FileOccupiedSize;\r
-        FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);\r
-      } else {\r
-        return EFI_NOT_FOUND;\r
-      }\r
-      break;\r
-\r
-    case EFI_FILE_DELETED:\r
-      FileLength        = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-      FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-      FileOffset += FileOccupiedSize;\r
-      FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);\r
-      break;\r
-\r
-    default:\r
-      return EFI_NOT_FOUND;\r
-\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE      SectionType,\r
-  IN EFI_FFS_FILE_HEADER   *FfsFileHeader,\r
-  IN OUT VOID              **SectionData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching section in the\r
-    FFS volume.\r
-\r
-Arguments:\r
-    SearchType    - Filter to find only sections of this type.\r
-    FfsFileHeader - Pointer to the current file to search.\r
-    SectionData   - Pointer to the Section matching SectionType in FfsFileHeader.\r
-                     NULL if section not found\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  UINT32                    FileSize;\r
-  EFI_COMMON_SECTION_HEADER *Section;\r
-  UINT32                    SectionLength;\r
-  UINT32                    ParsedLength;\r
-\r
-  //\r
-  // Size is 24 bits wide so mask upper 8 bits.\r
-  //    Does not include FfsFileHeader header size\r
-  // FileSize is adjusted to FileOccupiedSize as it is 8 byte aligned.\r
-  //\r
-  Section   = (EFI_COMMON_SECTION_HEADER *) (FfsFileHeader + 1);\r
-  FileSize  = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-  FileSize -= sizeof (EFI_FFS_FILE_HEADER);\r
-\r
-  *SectionData  = NULL;\r
-  ParsedLength  = 0;\r
-  while (ParsedLength < FileSize) {\r
-    if (Section->Type == SectionType) {\r
-      *SectionData = (VOID *) (Section + 1);\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // Size is 24 bits wide so mask upper 8 bits.\r
-    // SectionLength is adjusted it is 4 byte aligned.\r
-    // Go to the next section\r
-    //\r
-    SectionLength = *(UINT32 *) Section->Size & 0x00FFFFFF;\r
-    SectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);\r
-\r
-    ParsedLength += SectionLength;\r
-    Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + SectionLength);\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindPeiCore (\r
-  IN  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  OUT VOID                        **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Given the pointer to the Firmware Volume Header find the SEC\r
-  core and return it's PE32 image.\r
-\r
-Arguments:\r
-  FwVolHeader - Pointer to memory mapped FV\r
-  Pe32Data - Pointer to SEC PE32 iamge.\r
\r
-Returns:  \r
-  EFI_SUCCESS - Pe32Data is valid\r
-  other       - Failure\r
-\r
---*/\r
-{\r
-  EFI_STATUS          Status;\r
-  EFI_FFS_FILE_HEADER *FileHeader;\r
-  EFI_FV_FILETYPE     SearchType;\r
-\r
-  SearchType  = EFI_FV_FILETYPE_PEI_CORE;\r
-  FileHeader  = NULL;\r
-  do {\r
-    Status = SecFfsFindNextFile (SearchType, FwVolHeader, &FileHeader);\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = SecFfsFindSectionData (EFI_SECTION_PE32, FileHeader, Pe32Data);\r
-      return Status;\r
-    }\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c
deleted file mode 100644 (file)
index c3bfe47..0000000
+++ /dev/null
@@ -1,1130 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  SecMain.c\r
-\r
-Abstract:\r
-  WinNt emulator of SEC phase. It's really a Win32 application, but this is\r
-  Ok since all the other modules for NT32 are NOT Win32 applications.\r
-\r
-  This program gets NT32 PCD setting and figures out what the memory layout \r
-  will be, how may FD's will be loaded and also what the boot mode is.\r
-\r
-  The SEC registers a set of services with the SEC core. gPrivateDispatchTable\r
-  is a list of PPI's produced by the SEC that are available for usage in PEI.\r
-\r
-  This code produces 128 K of temporary memory for the PEI stack by directly\r
-  allocate memory space with ReadWrite and Execute attribute.\r
-\r
-**/\r
-\r
-#include "SecMain.h"\r
-\r
-#ifndef SE_TIME_ZONE_NAME\r
-#define SE_TIME_ZONE_NAME                 TEXT("SeTimeZonePrivilege")\r
-#endif\r
-\r
-NT_PEI_LOAD_FILE_PPI                      mSecNtLoadFilePpi     = { SecWinNtPeiLoadFile };\r
-\r
-PEI_NT_AUTOSCAN_PPI                       mSecNtAutoScanPpi     = { SecWinNtPeiAutoScan };\r
-\r
-PEI_NT_THUNK_PPI                          mSecWinNtThunkPpi     = { SecWinNtWinNtThunkAddress };\r
-\r
-EFI_PEI_PROGRESS_CODE_PPI                 mSecStatusCodePpi     = { SecPeiReportStatusCode };\r
-\r
-NT_FWH_PPI                                mSecFwhInformationPpi = { SecWinNtFdAddress };\r
-\r
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI         mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR  gPrivateDispatchTable[] = {\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI,\r
-    &gNtPeiLoadFilePpiGuid,\r
-    &mSecNtLoadFilePpi\r
-  },\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI,\r
-    &gPeiNtAutoScanPpiGuid,\r
-    &mSecNtAutoScanPpi\r
-  },\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI,\r
-    &gPeiNtThunkPpiGuid,\r
-    &mSecWinNtThunkPpi\r
-  },\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI,\r
-    &gEfiPeiStatusCodePpiGuid,\r
-    &mSecStatusCodePpi\r
-  },\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI,\r
-    &gEfiTemporaryRamSupportPpiGuid,\r
-    &mSecTemporaryRamSupportPpi\r
-  },\r
-  {\r
-    EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
-    &gNtFwhPpiGuid,\r
-    &mSecFwhInformationPpi\r
-  }\r
-};\r
-\r
-\r
-//\r
-// Default information about where the FD is located.\r
-//  This array gets filled in with information from PcdWinNtFirmwareVolume\r
-//  The number of array elements is allocated base on parsing\r
-//  PcdWinNtFirmwareVolume and the memory is never freed.\r
-//\r
-UINTN                                     gFdInfoCount = 0;\r
-NT_FD_INFO                                *gFdInfo;\r
-\r
-//\r
-// Array that supports seperate memory rantes.\r
-//  The memory ranges are set by PcdWinNtMemorySizeForSecMain.\r
-//  The number of array elements is allocated base on parsing\r
-//  PcdWinNtMemorySizeForSecMain value and the memory is never freed.\r
-//\r
-UINTN                                     gSystemMemoryCount = 0;\r
-NT_SYSTEM_MEMORY                          *gSystemMemory;\r
-\r
-VOID\r
-EFIAPI\r
-SecSwitchStack (\r
-  UINT32   TemporaryMemoryBase,\r
-  UINT32   PermenentMemoryBase\r
-  );\r
-EFI_STATUS\r
-SecNt32PeCoffRelocateImage (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-PeiSwitchStacks (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *Context3,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  );\r
-\r
-VOID\r
-SecPrint (\r
-  CHAR8  *Format,\r
-  ...\r
-  )\r
-{\r
-  va_list  Marker;\r
-  UINTN    CharCount;\r
-  CHAR8    Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-\r
-  va_start (Marker, Format);\r
-  \r
-  _vsnprintf (Buffer, sizeof (Buffer), Format, Marker);\r
-\r
-  va_end (Marker);\r
-\r
-  CharCount = strlen (Buffer);\r
-  WriteFile (\r
-    GetStdHandle (STD_OUTPUT_HANDLE), \r
-    Buffer,\r
-    (DWORD)CharCount,\r
-    (LPDWORD)&CharCount,\r
-    NULL\r
-    );\r
-}\r
-\r
-INTN\r
-EFIAPI\r
-main (\r
-  IN  INTN  Argc,\r
-  IN  CHAR8 **Argv,\r
-  IN  CHAR8 **Envp\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Main entry point to SEC for WinNt. This is a Windows program\r
-\r
-Arguments:\r
-  Argc - Number of command line arguments\r
-  Argv - Array of command line argument strings\r
-  Envp - Array of environment variable strings\r
-\r
-Returns:\r
-  0 - Normal exit\r
-  1 - Abnormal exit\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  HANDLE                Token;\r
-  TOKEN_PRIVILEGES      TokenPrivileges;\r
-  EFI_PHYSICAL_ADDRESS  InitialStackMemory;\r
-  UINT64                InitialStackMemorySize;\r
-  UINTN                 Index;\r
-  UINTN                 Index1;\r
-  UINTN                 Index2;\r
-  CHAR16                *FileName;\r
-  CHAR16                *FileNamePtr;\r
-  BOOLEAN               Done;\r
-  VOID                  *PeiCoreFile;\r
-  CHAR16                *MemorySizeStr;\r
-  CHAR16                *FirmwareVolumesStr;\r
-  UINTN                 *StackPointer;\r
-  UINT32                ProcessAffinityMask;\r
-  UINT32                SystemAffinityMask;\r
-  INT32                 LowBit;\r
-\r
-\r
-  //\r
-  // Enable the privilege so that RTC driver can successfully run SetTime()\r
-  //\r
-  OpenProcessToken (GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &Token);\r
-  if (LookupPrivilegeValue(NULL, SE_TIME_ZONE_NAME, &TokenPrivileges.Privileges[0].Luid)) {\r
-    TokenPrivileges.PrivilegeCount = 1;\r
-    TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;\r
-    AdjustTokenPrivileges(Token, FALSE, &TokenPrivileges, 0, (PTOKEN_PRIVILEGES) NULL, 0);\r
-  }\r
-\r
-  MemorySizeStr      = (CHAR16 *) PcdGetPtr (PcdWinNtMemorySizeForSecMain);\r
-  FirmwareVolumesStr = (CHAR16 *) PcdGetPtr (PcdWinNtFirmwareVolume);\r
-\r
-  SecPrint ("\nEDK II SEC Main NT Emulation Environment from www.TianoCore.org\n");\r
-\r
-  //\r
-  // Determine the first thread available to this process.\r
-  //\r
-  if (GetProcessAffinityMask (GetCurrentProcess (), &ProcessAffinityMask, &SystemAffinityMask)) {\r
-    LowBit = (INT32)LowBitSet32 (ProcessAffinityMask);\r
-    if (LowBit != -1) {\r
-      //\r
-      // Force the system to bind the process to a single thread to work\r
-      // around odd semaphore type crashes.\r
-      //\r
-      SetProcessAffinityMask (GetCurrentProcess (), (INTN)(BIT0 << LowBit));\r
-    }\r
-  }\r
-\r
-  //\r
-  // Make some Windows calls to Set the process to the highest priority in the\r
-  //  idle class. We need this to have good performance.\r
-  //\r
-  SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);\r
-  SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST);\r
-\r
-  //\r
-  // Allocate space for gSystemMemory Array\r
-  //\r
-  gSystemMemoryCount  = CountSeparatorsInString (MemorySizeStr, '!') + 1;\r
-  gSystemMemory       = calloc (gSystemMemoryCount, sizeof (NT_SYSTEM_MEMORY));\r
-  if (gSystemMemory == NULL) {\r
-    SecPrint ("ERROR : Can not allocate memory for %S.  Exiting.\n", MemorySizeStr);\r
-    exit (1);\r
-  }\r
-  //\r
-  // Allocate space for gSystemMemory Array\r
-  //\r
-  gFdInfoCount  = CountSeparatorsInString (FirmwareVolumesStr, '!') + 1;\r
-  gFdInfo       = calloc (gFdInfoCount, sizeof (NT_FD_INFO));\r
-  if (gFdInfo == NULL) {\r
-    SecPrint ("ERROR : Can not allocate memory for %S.  Exiting.\n", FirmwareVolumesStr);\r
-    exit (1);\r
-  }\r
-  //\r
-  // Setup Boot Mode. If BootModeStr == "" then BootMode = 0 (BOOT_WITH_FULL_CONFIGURATION)\r
-  //\r
-  SecPrint ("  BootMode 0x%02x\n", PcdGet32 (PcdWinNtBootMode));\r
-\r
-  //\r
-  //  Allocate 128K memory to emulate temp memory for PEI.\r
-  //  on a real platform this would be SRAM, or using the cache as RAM.\r
-  //  Set InitialStackMemory to zero so WinNtOpenFile will allocate a new mapping\r
-  //\r
-  InitialStackMemorySize  = STACK_SIZE;\r
-  InitialStackMemory = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (InitialStackMemorySize), MEM_COMMIT, PAGE_EXECUTE_READWRITE);\r
-  if (InitialStackMemory == 0) {\r
-    SecPrint ("ERROR : Can not allocate enough space for SecStack\n");\r
-    exit (1);\r
-  }\r
-\r
-  for (StackPointer = (UINTN*) (UINTN) InitialStackMemory;\r
-       StackPointer < (UINTN*) ((UINTN)InitialStackMemory + (SIZE_T) InitialStackMemorySize);\r
-       StackPointer ++) {\r
-    *StackPointer = PcdGet32 (PcdInitValueInTempStack);\r
-  }\r
-  \r
-  SecPrint ("  SEC passing in %d bytes of temp RAM to PEI\n", InitialStackMemorySize);\r
-\r
-  //\r
-  // Open All the firmware volumes and remember the info in the gFdInfo global\r
-  //\r
-  FileNamePtr = (CHAR16 *)malloc (StrLen ((CHAR16 *)FirmwareVolumesStr) * sizeof(CHAR16));\r
-  if (FileNamePtr == NULL) {\r
-    SecPrint ("ERROR : Can not allocate memory for firmware volume string\n");\r
-    exit (1);\r
-  }\r
-\r
-  StrCpy (FileNamePtr, (CHAR16*)FirmwareVolumesStr);\r
-\r
-  for (Done = FALSE, Index = 0, PeiCoreFile = NULL; !Done; Index++) {\r
-    FileName = FileNamePtr;\r
-    for (Index1 = 0; (FileNamePtr[Index1] != '!') && (FileNamePtr[Index1] != 0); Index1++)\r
-      ;\r
-    if (FileNamePtr[Index1] == 0) {\r
-      Done = TRUE;\r
-    } else {\r
-      FileNamePtr[Index1]  = '\0';\r
-      FileNamePtr = FileNamePtr + Index1 + 1;\r
-    }\r
-\r
-    //\r
-    // Open the FD and remember where it got mapped into our processes address space\r
-    //\r
-    Status = WinNtOpenFile (\r
-              FileName,\r
-              0,\r
-              OPEN_EXISTING,\r
-              &gFdInfo[Index].Address,\r
-              &gFdInfo[Index].Size\r
-              );\r
-    if (EFI_ERROR (Status)) {\r
-      SecPrint ("ERROR : Can not open Firmware Device File %S (0x%X).  Exiting.\n", FileName, Status);\r
-      exit (1);\r
-    }\r
-\r
-    SecPrint ("  FD loaded from");\r
-    //\r
-    // printf can't print filenames directly as the \ gets interpreted as an\r
-    //  escape character.\r
-    //\r
-    for (Index2 = 0; FileName[Index2] != '\0'; Index2++) {\r
-      SecPrint ("%c", FileName[Index2]);\r
-    }\r
-\r
-    if (PeiCoreFile == NULL) {\r
-      //\r
-      // Assume the beginning of the FD is an FV and look for the PEI Core.\r
-      // Load the first one we find.\r
-      //\r
-      Status = SecFfsFindPeiCore ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) gFdInfo[Index].Address, &PeiCoreFile);\r
-      if (!EFI_ERROR (Status)) {\r
-        SecPrint (" contains SEC Core");\r
-      }\r
-    }\r
-\r
-    SecPrint ("\n");\r
-  }\r
-  //\r
-  // Calculate memory regions and store the information in the gSystemMemory\r
-  //  global for later use. The autosizing code will use this data to\r
-  //  map this memory into the SEC process memory space.\r
-  //\r
-  for (Index = 0, Done = FALSE; !Done; Index++) {\r
-    //\r
-    // Save the size of the memory and make a Unicode filename SystemMemory00, ...\r
-    //\r
-    gSystemMemory[Index].Size = _wtoi (MemorySizeStr) * 0x100000;\r
-\r
-    //\r
-    // Find the next region\r
-    //\r
-    for (Index1 = 0; MemorySizeStr[Index1] != '!' && MemorySizeStr[Index1] != 0; Index1++)\r
-      ;\r
-    if (MemorySizeStr[Index1] == 0) {\r
-      Done = TRUE;\r
-    }\r
-\r
-    MemorySizeStr = MemorySizeStr + Index1 + 1;\r
-  }\r
-\r
-  SecPrint ("\n");\r
-\r
-  //\r
-  // Hand off to PEI Core\r
-  //\r
-  SecLoadFromCore ((UINTN) InitialStackMemory, (UINTN) InitialStackMemorySize, (UINTN) gFdInfo[0].Address, PeiCoreFile);\r
-\r
-  //\r
-  // If we get here, then the PEI Core returned. This is an error as PEI should\r
-  //  always hand off to DXE.\r
-  //\r
-  SecPrint ("ERROR : PEI Core returned\n");\r
-  exit (1);\r
-}\r
-\r
-EFI_STATUS\r
-WinNtOpenFile (\r
-  IN  CHAR16                    *FileName,\r
-  IN  UINT32                    MapSize,\r
-  IN  DWORD                     CreationDisposition,\r
-  IN OUT  EFI_PHYSICAL_ADDRESS  *BaseAddress,\r
-  OUT UINT64                    *Length\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Opens and memory maps a file using WinNt services. If BaseAddress is non zero\r
-  the process will try and allocate the memory starting at BaseAddress.\r
-\r
-Arguments:\r
-  FileName            - The name of the file to open and map\r
-  MapSize             - The amount of the file to map in bytes\r
-  CreationDisposition - The flags to pass to CreateFile().  Use to create new files for\r
-                        memory emulation, and exiting files for firmware volume emulation\r
-  BaseAddress         - The base address of the mapped file in the user address space.\r
-                         If passed in as NULL the new memory region is used.\r
-                         If passed in as non NULL the request memory region is used for\r
-                          the mapping of the file into the process space.\r
-  Length              - The size of the mapped region in bytes\r
-\r
-Returns:\r
-  EFI_SUCCESS      - The file was opened and mapped.\r
-  EFI_NOT_FOUND    - FileName was not found in the current directory\r
-  EFI_DEVICE_ERROR - An error occured attempting to map the opened file\r
-\r
---*/\r
-{\r
-  HANDLE  NtFileHandle;\r
-  HANDLE  NtMapHandle;\r
-  VOID    *VirtualAddress;\r
-  UINTN   FileSize;\r
-\r
-  //\r
-  // Use Win API to open/create a file\r
-  //\r
-  NtFileHandle = CreateFile (\r
-                  FileName,\r
-                  GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,\r
-                  FILE_SHARE_READ,\r
-                  NULL,\r
-                  CreationDisposition,\r
-                  FILE_ATTRIBUTE_NORMAL,\r
-                  NULL\r
-                  );\r
-  if (NtFileHandle == INVALID_HANDLE_VALUE) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  //\r
-  // Map the open file into a memory range\r
-  //\r
-  NtMapHandle = CreateFileMapping (\r
-                  NtFileHandle,\r
-                  NULL,\r
-                  PAGE_EXECUTE_READWRITE,\r
-                  0,\r
-                  MapSize,\r
-                  NULL\r
-                  );\r
-  if (NtMapHandle == NULL) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-  //\r
-  // Get the virtual address (address in the emulator) of the mapped file\r
-  //\r
-  VirtualAddress = MapViewOfFileEx (\r
-                    NtMapHandle,\r
-                    FILE_MAP_EXECUTE | FILE_MAP_ALL_ACCESS,\r
-                    0,\r
-                    0,\r
-                    MapSize,\r
-                    (LPVOID) (UINTN) *BaseAddress\r
-                    );\r
-  if (VirtualAddress == NULL) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (MapSize == 0) {\r
-    //\r
-    // Seek to the end of the file to figure out the true file size.\r
-    //\r
-    FileSize = SetFilePointer (\r
-                NtFileHandle,\r
-                0,\r
-                NULL,\r
-                FILE_END\r
-                );\r
-    if (FileSize == -1) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-\r
-    *Length = (UINT64) FileSize;\r
-  } else {\r
-    *Length = (UINT64) MapSize;\r
-  }\r
-\r
-  *BaseAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAddress;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-#define BYTES_PER_RECORD  512\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecPeiReportStatusCode (\r
-  IN CONST EFI_PEI_SERVICES           **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE       CodeType,\r
-  IN EFI_STATUS_CODE_VALUE      Value,\r
-  IN UINT32                     Instance,\r
-  IN CONST EFI_GUID                   *CallerId,\r
-  IN CONST EFI_STATUS_CODE_DATA       *Data OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine produces the ReportStatusCode PEI service. It's passed\r
-  up to the PEI Core via a PPI. T\r
-\r
-  This code currently uses the NT clib printf. This does not work the same way\r
-  as the EFI Print (), as %t, %g, %s as Unicode are not supported.\r
-\r
-Arguments:\r
-  (see EFI_PEI_REPORT_STATUS_CODE)\r
-\r
-Returns:\r
-  EFI_SUCCESS - Always return success\r
-\r
---*/\r
-// TODO:    PeiServices - add argument and description to function comment\r
-// TODO:    CodeType - add argument and description to function comment\r
-// TODO:    Value - add argument and description to function comment\r
-// TODO:    Instance - add argument and description to function comment\r
-// TODO:    CallerId - add argument and description to function comment\r
-// TODO:    Data - add argument and description to function comment\r
-{\r
-  CHAR8           *Format;\r
-  BASE_LIST       Marker;\r
-  CHAR8           PrintBuffer[BYTES_PER_RECORD * 2];\r
-  CHAR8           *Filename;\r
-  CHAR8           *Description;\r
-  UINT32          LineNumber;\r
-  UINT32          ErrorLevel;\r
-\r
-\r
-  if (Data == NULL) {\r
-  } else if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-    //\r
-    // Processes ASSERT ()\r
-    //\r
-    SecPrint ("ASSERT %s(%d): %s\n", Filename, (int)LineNumber, Description);\r
-\r
-  } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
-    //\r
-    // Process DEBUG () macro \r
-    //\r
-    AsciiBSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker);\r
-    SecPrint (PrintBuffer);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-#if defined (MDE_CPU_IA32)\r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  NewBsp      A pointer to the new BSP for the EntryPoint on IPF. It's\r
-                      Reserved on other architectures.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeiSwitchStacks (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *Context3,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  BASE_LIBRARY_JUMP_BUFFER  JumpBuffer;\r
-  \r
-  ASSERT (EntryPoint != NULL);\r
-  ASSERT (NewStack != NULL);\r
-\r
-  //\r
-  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
-  //\r
-  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
-\r
-  JumpBuffer.Eip = (UINTN)EntryPoint;\r
-  JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);\r
-  JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2) + sizeof(Context3);\r
-  ((VOID**)JumpBuffer.Esp)[1] = Context1;\r
-  ((VOID**)JumpBuffer.Esp)[2] = Context2;\r
-  ((VOID**)JumpBuffer.Esp)[3] = Context3;\r
-\r
-  LongJump (&JumpBuffer, (UINTN)-1);\r
-  \r
-\r
-  //\r
-  // InternalSwitchStack () will never return\r
-  //\r
-  ASSERT (FALSE);  \r
-}\r
-#endif\r
-\r
-VOID\r
-SecLoadFromCore (\r
-  IN  UINTN   LargestRegion,\r
-  IN  UINTN   LargestRegionSize,\r
-  IN  UINTN   BootFirmwareVolumeBase,\r
-  IN  VOID    *PeiCorePe32File\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This is the service to load the PEI Core from the Firmware Volume\r
-\r
-Arguments:\r
-  LargestRegion           - Memory to use for PEI.\r
-  LargestRegionSize       - Size of Memory to use for PEI\r
-  BootFirmwareVolumeBase  - Start of the Boot FV\r
-  PeiCorePe32File         - PEI Core PE32\r
-\r
-Returns:\r
-  Success means control is transfered and thus we should never return\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  VOID                        *TopOfStack;\r
-  UINT64                      PeiCoreSize;\r
-  EFI_PHYSICAL_ADDRESS        PeiCoreEntryPoint;\r
-  EFI_PHYSICAL_ADDRESS        PeiImageAddress;\r
-  EFI_SEC_PEI_HAND_OFF        *SecCoreData;\r
-  UINTN                       PeiStackSize;\r
-\r
-  //\r
-  // Compute Top Of Memory for Stack and PEI Core Allocations\r
-  //\r
-  PeiStackSize = (UINTN)RShiftU64((UINT64)STACK_SIZE,1);\r
-\r
-  //\r
-  // |-----------| <---- TemporaryRamBase + TemporaryRamSize\r
-  // |   Heap    |\r
-  // |           |\r
-  // |-----------| <---- StackBase / PeiTemporaryMemoryBase\r
-  // |           |\r
-  // |  Stack    |\r
-  // |-----------| <---- TemporaryRamBase\r
-  // \r
-  TopOfStack  = (VOID *)(LargestRegion + PeiStackSize);\r
-\r
-  //\r
-  // Reservet space for storing PeiCore's parament in stack.\r
-  // \r
-  TopOfStack  = (VOID *)((UINTN)TopOfStack - sizeof (EFI_SEC_PEI_HAND_OFF) - CPU_STACK_ALIGNMENT);\r
-  TopOfStack  = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r
-\r
-  //\r
-  // Bind this information into the SEC hand-off state\r
-  //\r
-  SecCoreData                        = (EFI_SEC_PEI_HAND_OFF*)(UINTN) TopOfStack;\r
-  SecCoreData->DataSize               = sizeof(EFI_SEC_PEI_HAND_OFF);\r
-  SecCoreData->BootFirmwareVolumeBase = (VOID*)BootFirmwareVolumeBase;\r
-  SecCoreData->BootFirmwareVolumeSize = PcdGet32(PcdWinNtFirmwareFdSize);\r
-  SecCoreData->TemporaryRamBase       = (VOID*)(UINTN)LargestRegion; \r
-  SecCoreData->TemporaryRamSize       = STACK_SIZE;\r
-  SecCoreData->StackBase              = SecCoreData->TemporaryRamBase;\r
-  SecCoreData->StackSize              = PeiStackSize;\r
-  SecCoreData->PeiTemporaryRamBase    = (VOID*) ((UINTN) SecCoreData->TemporaryRamBase + PeiStackSize);\r
-  SecCoreData->PeiTemporaryRamSize    = STACK_SIZE - PeiStackSize;\r
-\r
-  //\r
-  // Load the PEI Core from a Firmware Volume\r
-  //\r
-  Status = SecWinNtPeiLoadFile (\r
-            PeiCorePe32File,\r
-            &PeiImageAddress,\r
-            &PeiCoreSize,\r
-            &PeiCoreEntryPoint\r
-            );\r
-  if (EFI_ERROR (Status)) {\r
-    return ;\r
-  }\r
-  \r
-  //\r
-  // Transfer control to the PEI Core\r
-  //\r
-  PeiSwitchStacks (\r
-    (SWITCH_STACK_ENTRY_POINT) (UINTN) PeiCoreEntryPoint,\r
-    SecCoreData,\r
-    (VOID *) (UINTN) ((EFI_PEI_PPI_DESCRIPTOR *) &gPrivateDispatchTable),\r
-    NULL,\r
-    TopOfStack\r
-    );\r
-  //\r
-  // If we get here, then the PEI Core returned.  This is an error\r
-  //\r
-  return ;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeiAutoScan (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  *MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This service is called from Index == 0 until it returns EFI_UNSUPPORTED.\r
-  It allows discontinuous memory regions to be supported by the emulator.\r
-  It uses gSystemMemory[] and gSystemMemoryCount that were created by\r
-  parsing PcdWinNtMemorySizeForSecMain value.\r
-  The size comes from the Pcd value and the address comes from the memory space \r
-  with ReadWrite and Execute attributes allocated by VirtualAlloc() API.\r
-\r
-Arguments:\r
-  Index      - Which memory region to use\r
-  MemoryBase - Return Base address of memory region\r
-  MemorySize - Return size in bytes of the memory region\r
-\r
-Returns:\r
-  EFI_SUCCESS - If memory region was mapped\r
-  EFI_UNSUPPORTED - If Index is not supported\r
-\r
---*/\r
-{\r
-  if (Index >= gSystemMemoryCount) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Allocate enough memory space for emulator \r
-  //\r
-  gSystemMemory[Index].Memory = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (gSystemMemory[Index].Size), MEM_COMMIT, PAGE_EXECUTE_READWRITE);\r
-  if (gSystemMemory[Index].Memory == 0) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-  \r
-  *MemoryBase = gSystemMemory[Index].Memory;\r
-  *MemorySize = gSystemMemory[Index].Size;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-VOID *\r
-EFIAPI\r
-SecWinNtWinNtThunkAddress (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Since the SEC is the only Windows program in stack it must export\r
-  an interface to do Win API calls. That's what the WinNtThunk address\r
-  is for. gWinNt is initialized in WinNtThunk.c.\r
-\r
-Arguments:\r
-  InterfaceSize - sizeof (EFI_WIN_NT_THUNK_PROTOCOL);\r
-  InterfaceBase - Address of the gWinNt global\r
-\r
-Returns:\r
-  EFI_SUCCESS - Data returned\r
-\r
---*/\r
-{\r
-  return gWinNt;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeiLoadFile (\r
-  IN  VOID                    *Pe32Data,\r
-  IN  EFI_PHYSICAL_ADDRESS    *ImageAddress,\r
-  IN  UINT64                  *ImageSize,\r
-  IN  EFI_PHYSICAL_ADDRESS    *EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Loads and relocates a PE/COFF image into memory.\r
-\r
-Arguments:\r
-  Pe32Data         - The base address of the PE/COFF file that is to be loaded and relocated\r
-  ImageAddress     - The base address of the relocated PE/COFF image\r
-  ImageSize        - The size of the relocated PE/COFF image\r
-  EntryPoint       - The entry point of the relocated PE/COFF image\r
-\r
-Returns:\r
-  EFI_SUCCESS   - The file was loaded and relocated\r
-  EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file\r
-\r
---*/\r
-{\r
-  EFI_STATUS                            Status;\r
-  PE_COFF_LOADER_IMAGE_CONTEXT          ImageContext;\r
-\r
-  ZeroMem (&ImageContext, sizeof (ImageContext));\r
-  ImageContext.Handle     = Pe32Data;\r
-\r
-  ImageContext.ImageRead  = (PE_COFF_LOADER_READ_FILE) SecImageRead;\r
-\r
-  Status                  = PeCoffLoaderGetImageInfo (&ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Allocate space in NT (not emulator) memory with ReadWrite and Execute attribute. \r
-  // Extra space is for alignment\r
-  //\r
-  ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (ImageContext.ImageSize + (ImageContext.SectionAlignment * 2)), MEM_COMMIT, PAGE_EXECUTE_READWRITE);\r
-  if (ImageContext.ImageAddress == 0) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-  //\r
-  // Align buffer on section boundary\r
-  //\r
-  ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
-  ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1);\r
-\r
-  Status = PeCoffLoaderLoadImage (&ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = SecNt32PeCoffRelocateImage (&ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // BugBug: Flush Instruction Cache Here when CPU Lib is ready\r
-  //\r
-\r
-  *ImageAddress = ImageContext.ImageAddress;\r
-  *ImageSize    = ImageContext.ImageSize;\r
-  *EntryPoint   = ImageContext.EntryPoint;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtFdAddress (\r
-  IN     UINTN                 Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,\r
-  IN OUT UINT64                *FdSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Return the FD Size and base address. Since the FD is loaded from a\r
-  file into Windows memory only the SEC will know it's address.\r
-\r
-Arguments:\r
-  Index  - Which FD, starts at zero.\r
-  FdSize - Size of the FD in bytes\r
-  FdBase - Start address of the FD. Assume it points to an FV Header\r
-\r
-Returns:\r
-  EFI_SUCCESS     - Return the Base address and size of the FV\r
-  EFI_UNSUPPORTED - Index does not map to an FD in the system\r
-\r
---*/\r
-{\r
-  if (Index >= gFdInfoCount) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  *FdBase = gFdInfo[Index].Address;\r
-  *FdSize = gFdInfo[Index].Size;\r
-\r
-  if (*FdBase == 0 && *FdSize == 0) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecImageRead (\r
-  IN     VOID    *FileHandle,\r
-  IN     UINTN   FileOffset,\r
-  IN OUT UINTN   *ReadSize,\r
-  OUT    VOID    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file\r
-\r
-Arguments:\r
-  FileHandle - The handle to the PE/COFF file\r
-  FileOffset - The offset, in bytes, into the file to read\r
-  ReadSize   - The number of bytes to read from the file starting at FileOffset\r
-  Buffer     - A pointer to the buffer to read the data into.\r
-\r
-Returns:\r
-  EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset\r
-\r
---*/\r
-{\r
-  CHAR8 *Destination8;\r
-  CHAR8 *Source8;\r
-  UINTN Length;\r
-\r
-  Destination8  = Buffer;\r
-  Source8       = (CHAR8 *) ((UINTN) FileHandle + FileOffset);\r
-  Length        = *ReadSize;\r
-  while (Length--) {\r
-    *(Destination8++) = *(Source8++);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-CHAR16 *\r
-AsciiToUnicode (\r
-  IN  CHAR8   *Ascii,\r
-  IN  UINTN   *StrLen OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Convert the passed in Ascii string to Unicode.\r
-  Optionally return the length of the strings.\r
-\r
-Arguments:\r
-  Ascii   - Ascii string to convert\r
-  StrLen  - Length of string\r
-\r
-Returns:\r
-  Pointer to malloc'ed Unicode version of Ascii\r
-\r
---*/\r
-{\r
-  UINTN   Index;\r
-  CHAR16  *Unicode;\r
-\r
-  //\r
-  // Allocate a buffer for unicode string\r
-  //\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++)\r
-    ;\r
-  Unicode = malloc ((Index + 1) * sizeof (CHAR16));\r
-  if (Unicode == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  for (Index = 0; Ascii[Index] != '\0'; Index++) {\r
-    Unicode[Index] = (CHAR16) Ascii[Index];\r
-  }\r
-\r
-  Unicode[Index] = '\0';\r
-\r
-  if (StrLen != NULL) {\r
-    *StrLen = Index;\r
-  }\r
-\r
-  return Unicode;\r
-}\r
-\r
-UINTN\r
-CountSeparatorsInString (\r
-  IN  CONST CHAR16   *String,\r
-  IN  CHAR16         Separator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Count the number of separators in String\r
-\r
-Arguments:\r
-  String    - String to process\r
-  Separator - Item to count\r
-\r
-Returns:\r
-  Number of Separator in String\r
-\r
---*/\r
-{\r
-  UINTN Count;\r
-\r
-  for (Count = 0; *String != '\0'; String++) {\r
-    if (*String == Separator) {\r
-      Count++;\r
-    }\r
-  }\r
-\r
-  return Count;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-SecNt32PeCoffRelocateImage (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext\r
-  )\r
-{\r
-  EFI_STATUS        Status;\r
-  VOID              *DllEntryPoint;\r
-  CHAR16            *DllFileName;\r
-  HMODULE           Library;\r
-  UINTN             Index;\r
-\r
-\r
-  Status = PeCoffLoaderRelocateImage (ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // We could not relocated the image in memory properly\r
-    //\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // If we load our own PE COFF images the Windows debugger can not source\r
-  //  level debug our code. If a valid PDB pointer exists usw it to load\r
-  //  the *.dll file as a library using Windows* APIs. This allows \r
-  //  source level debug. The image is still loaded and relocated\r
-  //  in the Framework memory space like on a real system (by the code above),\r
-  //  but the entry point points into the DLL loaded by the code bellow. \r
-  //\r
-\r
-  DllEntryPoint = NULL;\r
-\r
-  //\r
-  // Load the DLL if it's not an EBC image.\r
-  //\r
-  if ((ImageContext->PdbPointer != NULL) &&\r
-      (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {\r
-    //\r
-    // Convert filename from ASCII to Unicode\r
-    //\r
-    DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);\r
-\r
-    //\r
-    // Check that we have a valid filename\r
-    //\r
-    if (Index < 5 || DllFileName[Index - 4] != '.') {\r
-      free (DllFileName);\r
-\r
-      //\r
-      // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-      // The image will run, but we just can't source level debug. If we\r
-      // return an error the image will not run.\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // Replace .PDB with .DLL on the filename\r
-    //\r
-    DllFileName[Index - 3]  = 'D';\r
-    DllFileName[Index - 2]  = 'L';\r
-    DllFileName[Index - 1]  = 'L';\r
-\r
-    //\r
-    // Load the .DLL file into the user process's address space for source \r
-    // level debug\r
-    //\r
-    Library = LoadLibraryEx (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);\r
-    if (Library != NULL) {\r
-      //\r
-      // InitializeDriver is the entry point we put in all our EFI DLL's. The\r
-      // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the \r
-      // normal DLL entry point of DllMain, and prevents other modules that are\r
-      // referenced in side the DllFileName from being loaded. There is no error \r
-      // checking as the we can point to the PE32 image loaded by Tiano. This \r
-      // step is only needed for source level debugging\r
-      //\r
-      DllEntryPoint = (VOID *) (UINTN) GetProcAddress (Library, "InitializeDriver");\r
-\r
-    }\r
-\r
-    if ((Library != NULL) && (DllEntryPoint != NULL)) {\r
-      ImageContext->EntryPoint  = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;\r
-      SecPrint ("LoadLibraryEx (%S,\n               NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName);\r
-    } else {\r
-      SecPrint ("WARNING: No source level debug %S. \n", DllFileName);\r
-    }\r
-\r
-    free (DllFileName);\r
-  }\r
-\r
-  //\r
-  // Never return an error if PeCoffLoaderRelocateImage() succeeded.\r
-  // The image will run, but we just can't source level debug. If we\r
-  // return an error the image will not run.\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-\r
-VOID\r
-_ModuleEntryPoint (\r
-  VOID\r
-  )\r
-{\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecTemporaryRamSupport (\r
-  IN CONST EFI_PEI_SERVICES   **PeiServices,\r
-  IN EFI_PHYSICAL_ADDRESS     TemporaryMemoryBase,\r
-  IN EFI_PHYSICAL_ADDRESS     PermanentMemoryBase,\r
-  IN UINTN                    CopySize\r
-  )\r
-{\r
-  //\r
-  // Migrate the whole temporary memory to permanent memory.\r
-  // \r
-  CopyMem (\r
-    (VOID*)(UINTN)PermanentMemoryBase, \r
-    (VOID*)(UINTN)TemporaryMemoryBase, \r
-    CopySize\r
-    );\r
-\r
-  //\r
-  // SecSwitchStack function must be invoked after the memory migration\r
-  // immediately, also we need fixup the stack change caused by new call into \r
-  // permanent memory.\r
-  // \r
-  SecSwitchStack (\r
-    (UINT32) TemporaryMemoryBase,\r
-    (UINT32) PermanentMemoryBase\r
-    );\r
-\r
-  //\r
-  // We need *not* fix the return address because currently, \r
-  // The PeiCore is executed in flash.\r
-  //\r
-\r
-  //\r
-  // Simulate to invalid temporary memory, terminate temporary memory\r
-  // \r
-  //ZeroMem ((VOID*)(UINTN)TemporaryMemoryBase, CopySize);\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/Nt32Pkg/Sec/SecMain.h b/Nt32Pkg/Sec/SecMain.h
deleted file mode 100644 (file)
index 09d4e36..0000000
+++ /dev/null
@@ -1,553 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-\r
-Module Name:\r
-  SecMain.h\r
-\r
-Abstract:\r
-  Include file for Windows API based SEC\r
-\r
-**/\r
-\r
-#include <stdio.h>\r
-#include <PiPei.h>\r
-#include <WinNtPeim.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/PeCoffLib.h>\r
-#include <Ppi/NtPeiLoadFile.h>\r
-#include <Ppi/NtAutoscan.h>\r
-#include <Ppi/NtThunk.h>\r
-#include <Ppi/StatusCode.h>\r
-#include <Ppi/NtFwh.h>\r
-#include <Ppi/TemporaryRamSupport.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-\r
-#include <IndustryStandard/PeImage.h>\r
-\r
-#define STACK_SIZE                0x20000      \r
-\r
-typedef struct {\r
-  EFI_PHYSICAL_ADDRESS  Address;\r
-  UINT64                Size;\r
-} NT_FD_INFO;\r
-\r
-typedef struct {\r
-  EFI_PHYSICAL_ADDRESS  Memory;\r
-  UINT64                Size;\r
-} NT_SYSTEM_MEMORY;\r
-\r
-#define MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE 0x100\r
-\r
-typedef struct {\r
-  CHAR8   *PdbPointer;\r
-  VOID    *ModHandle;\r
-} PDB_NAME_TO_MOD_HANDLE;\r
-\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeiLoadFile (\r
-  VOID                  *Pe32Data,  // TODO: add IN/OUT modifier to Pe32Data\r
-  EFI_PHYSICAL_ADDRESS  *ImageAddress,  // TODO: add IN/OUT modifier to ImageAddress\r
-  UINT64                *ImageSize,  // TODO: add IN/OUT modifier to ImageSize\r
-  EFI_PHYSICAL_ADDRESS  *EntryPoint  // TODO: add IN/OUT modifier to EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Pe32Data      - TODO: add argument description\r
-  ImageAddress  - TODO: add argument description\r
-  ImageSize     - TODO: add argument description\r
-  EntryPoint    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeiAutoScan (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  *MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Index       - TODO: add argument description\r
-  MemoryBase  - TODO: add argument description\r
-  MemorySize  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-VOID *\r
-EFIAPI\r
-SecWinNtWinNtThunkAddress (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  InterfaceSize - TODO: add argument description\r
-  InterfaceBase - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtWinNtFwhAddress (\r
-  IN OUT UINT64                *FwhSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FwhBase\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FwhSize - TODO: add argument description\r
-  FwhBase - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecPeiReportStatusCode (\r
-  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN CONST EFI_GUID                 * CallerId,\r
-  IN CONST EFI_STATUS_CODE_DATA     * Data OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PeiServices - TODO: add argument description\r
-  CodeType    - TODO: add argument description\r
-  Value       - TODO: add argument description\r
-  Instance    - TODO: add argument description\r
-  CallerId    - TODO: add argument description\r
-  Data        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-INTN\r
-EFIAPI\r
-main (\r
-  IN  INTN  Argc,\r
-  IN  CHAR8 **Argv,\r
-  IN  CHAR8 **Envp\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Argc  - TODO: add argument description\r
-  Argv  - TODO: add argument description\r
-  Envp  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-WinNtOpenFile (\r
-  CHAR16                *FileName,\r
-  UINT32                MapSize,\r
-  DWORD                 CreationDispostion,\r
-  EFI_PHYSICAL_ADDRESS  *BaseAddress,\r
-  UINT64                *Length\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FileName            - TODO: add argument description\r
-  MapSize             - TODO: add argument description\r
-  CreationDispostion  - TODO: add argument description\r
-  BaseAddress         - TODO: add argument description\r
-  Length              - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-SecLoadFromCore (\r
-  IN  UINTN   LargestRegion,\r
-  IN  UINTN   LargestRegionSize,\r
-  IN  UINTN   BootFirmwareVolumeBase,\r
-  IN  VOID    *PeiCoreFile\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  LargestRegion           - TODO: add argument description\r
-  LargestRegionSize       - TODO: add argument description\r
-  BootFirmwareVolumeBase  - TODO: add argument description\r
-  PeiCoreFile             - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecLoadFile (\r
-  IN  VOID                    *Pe32Data,\r
-  IN  EFI_PHYSICAL_ADDRESS    *ImageAddress,\r
-  IN  UINT64                  *ImageSize,\r
-  IN  EFI_PHYSICAL_ADDRESS    *EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Pe32Data      - TODO: add argument description\r
-  ImageAddress  - TODO: add argument description\r
-  ImageSize     - TODO: add argument description\r
-  EntryPoint    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindPeiCore (\r
-  IN  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  OUT VOID                        **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FwVolHeader - TODO: add argument description\r
-  Pe32Data    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE             SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SearchType  - TODO: add argument description\r
-  FwVolHeader - TODO: add argument description\r
-  FileHeader  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE      SectionType,\r
-  IN EFI_FFS_FILE_HEADER   *FfsFileHeader,\r
-  IN OUT VOID              **SectionData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SectionType   - TODO: add argument description\r
-  FfsFileHeader - TODO: add argument description\r
-  SectionData   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeCoffLoaderLoadAsDll (\r
-  IN CHAR8    *PdbFileName,\r
-  IN VOID     **ImageEntryPoint,\r
-  OUT VOID    **ModHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PdbFileName     - TODO: add argument description\r
-  ImageEntryPoint - TODO: add argument description\r
-  ModHandle       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtPeCoffLoaderFreeLibrary (\r
-  OUT VOID    *ModHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ModHandle - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecWinNtFdAddress (\r
-  IN     UINTN                 Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,\r
-  IN OUT UINT64                *FdSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Index   - TODO: add argument description\r
-  FdBase  - TODO: add argument description\r
-  FdSize  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-GetImageReadFunction (\r
-  IN PE_COFF_LOADER_IMAGE_CONTEXT          *ImageContext,\r
-  IN EFI_PHYSICAL_ADDRESS                  *TopOfMemory\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageContext  - TODO: add argument description\r
-  TopOfMemory   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecImageRead (\r
-  IN     VOID    *FileHandle,\r
-  IN     UINTN   FileOffset,\r
-  IN OUT UINTN   *ReadSize,\r
-  OUT    VOID    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FileHandle  - TODO: add argument description\r
-  FileOffset  - TODO: add argument description\r
-  ReadSize    - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-CHAR16                            *\r
-AsciiToUnicode (\r
-  IN  CHAR8   *Ascii,\r
-  IN  UINTN   *StrLen OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Ascii   - TODO: add argument description\r
-  StrLen  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-CountSeparatorsInString (\r
-  IN  CONST CHAR16   *String,\r
-  IN  CHAR16   Separator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  String    - TODO: add argument description\r
-  Separator - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecTemporaryRamSupport (\r
-  IN CONST EFI_PEI_SERVICES   **PeiServices,\r
-  IN EFI_PHYSICAL_ADDRESS     TemporaryMemoryBase,\r
-  IN EFI_PHYSICAL_ADDRESS     PermanentMemoryBase,\r
-  IN UINTN                    CopySize\r
-  );\r
-\r
-\r
-extern EFI_WIN_NT_THUNK_PROTOCOL  *gWinNt;\r
diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf
deleted file mode 100644 (file)
index 2a68284..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-## @file\r
-# Entry Point of NT32 Emulator\r
-#\r
-# Main executable file of NT32 Emulator that loads PEI core after initialization finished.\r
-#\r
-#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = SecMain\r
-  FILE_GUID                      = 4b837b03-6587-4d19-b82b-edfad836c0a0\r
-  MODULE_TYPE                    = USER_DEFINED\r
-  VERSION_STRING                 = 1.0\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  SecMain.h\r
-  WinNtThunk.c\r
-  FwVol.c\r
-  SecMain.c\r
-\r
-[Sources.ia32]\r
-  Stack.asm\r
-\r
-[Sources.x64]\r
-  StackX64.asm\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  DebugLib\r
-  PcdLib\r
-  PrintLib\r
-  BaseMemoryLib\r
-  BaseLib\r
-  PeCoffLib\r
-  ReportStatusCodeLib\r
-\r
-[Ppis]\r
-  gNtPeiLoadFilePpiGuid                         # PPI ALWAYS_PRODUCED\r
-  gEfiPeiStatusCodePpiGuid                      # PPI ALWAYS_PRODUCED\r
-  gNtFwhPpiGuid                                 # PPI ALWAYS_PRODUCED\r
-  gPeiNtAutoScanPpiGuid                         # PPI ALWAYS_PRODUCED\r
-  gPeiNtThunkPpiGuid                            # PPI ALWAYS_PRODUCED\r
-  gEfiTemporaryRamSupportPpiGuid\r
-\r
-[Pcd]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtBootMode\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack\r
-\r
-[BuildOptions]\r
-  MSFT:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2015_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2015x86_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2017_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
-  MSFT:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h\r
-  MSFT:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi\r
-  MSFT:*_*_IA32_ASMLINK_FLAGS       == /link /nologo /tiny\r
-\r
-  MSFT:*_*_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2015_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2015x86_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_VS2017_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
-  MSFT:*_*_X64_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
-  MSFT:*_*_X64_PP_FLAGS == /nologo /E /TC /FIAutoGen.h\r
-  MSFT:*_*_X64_ASM_FLAGS == /nologo /W3 /WX /c /Cx /Zd /W0 /Zi\r
-  MSFT:*_*_X64_ASMLINK_FLAGS       == /link /nologo\r
-\r
-  INTEL:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"C:\Program Files\Intel\Compiler\C++\9.1\IA32\Lib" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib\r
-  INTEL:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
-  INTEL:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h\r
-  INTEL:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi\r
-  INTEL:*_*_IA32_ASMLINK_FLAGS       == /link /nologo /tiny\r
diff --git a/Nt32Pkg/Sec/Stack.asm b/Nt32Pkg/Sec/Stack.asm
deleted file mode 100644 (file)
index 90fa2b2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-; SPDX-License-Identifier: BSD-2-Clause-Patent\r
-;\r
-; Module Name:\r
-;\r
-;   Stack.asm\r
-;\r
-; Abstract:\r
-;\r
-;   Switch the stack from temporary memory to permenent memory.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .586p\r
-    .model  flat,C\r
-    .code\r
-    \r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; SecSwitchStack (\r
-;   UINT32   TemporaryMemoryBase,\r
-;   UINT32   PermenentMemoryBase\r
-;   );\r
-;------------------------------------------------------------------------------    \r
-SecSwitchStack   PROC\r
-    ;\r
-    ; Save three register: eax, ebx, ecx\r
-    ;\r
-    push  eax\r
-    push  ebx\r
-    push  ecx\r
-    push  edx\r
-    \r
-    ;\r
-    ; !!CAUTION!! this function address's is pushed into stack after\r
-    ; migration of whole temporary memory, so need save it to permenent\r
-    ; memory at first!\r
-    ;\r
-    \r
-    mov   ebx, [esp + 20]          ; Save the first parameter\r
-    mov   ecx, [esp + 24]          ; Save the second parameter\r
-    \r
-    ;\r
-    ; Save this function's return address into permenent memory at first.\r
-    ; Then, Fixup the esp point to permenent memory\r
-    ;\r
-    mov   eax, esp\r
-    sub   eax, ebx\r
-    add   eax, ecx\r
-    mov   edx, dword ptr [esp]         ; copy pushed register's value to permenent memory\r
-    mov   dword ptr [eax], edx    \r
-    mov   edx, dword ptr [esp + 4]\r
-    mov   dword ptr [eax + 4], edx    \r
-    mov   edx, dword ptr [esp + 8]\r
-    mov   dword ptr [eax + 8], edx    \r
-    mov   edx, dword ptr [esp + 12]\r
-    mov   dword ptr [eax + 12], edx    \r
-    mov   edx, dword ptr [esp + 16]    ; Update this function's return address into permenent memory\r
-    mov   dword ptr [eax + 16], edx    \r
-    mov   esp, eax                     ; From now, esp is pointed to permenent memory\r
-        \r
-    ;\r
-    ; Fixup the ebp point to permenent memory\r
-    ;\r
-    mov   eax, ebp\r
-    sub   eax, ebx\r
-    add   eax, ecx\r
-    mov   ebp, eax                ; From now, ebp is pointed to permenent memory\r
-    \r
-    ;\r
-    ; Fixup callee's ebp point for PeiDispatch\r
-    ;\r
-    mov   eax, dword ptr [ebp]\r
-    sub   eax, ebx\r
-    add   eax, ecx\r
-    mov   dword ptr [ebp], eax    ; From now, Temporary's PPI caller's stack is in permenent memory\r
-    \r
-    pop   edx\r
-    pop   ecx\r
-    pop   ebx\r
-    pop   eax\r
-    ret\r
-SecSwitchStack   ENDP\r
-\r
-    END\r
diff --git a/Nt32Pkg/Sec/StackX64.asm b/Nt32Pkg/Sec/StackX64.asm
deleted file mode 100644 (file)
index 565acfa..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
-; SPDX-License-Identifier: BSD-2-Clause-Patent\r
-;\r
-; Module Name:\r
-;\r
-;   Stack.asm\r
-;\r
-; Abstract:\r
-;\r
-;   Switch the stack from temporary memory to permenent memory.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-    \r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; SecSwitchStack (\r
-;   UINT32   TemporaryMemoryBase,\r
-;   UINT32   PermenentMemoryBase\r
-;   );\r
-;------------------------------------------------------------------------------    \r
-SecSwitchStack   PROC\r
-    mov [rsp + 08h], rcx\r
-    mov [rsp + 10h], rdx\r
-\r
-    ;\r
-    ; Save three register: eax, ebx, ecx\r
-    ;\r
-    push  rax\r
-    push  rbx\r
-    push  rcx\r
-    push  rdx\r
-    \r
-    ;\r
-    ; !!CAUTION!! this function address's is pushed into stack after\r
-    ; migration of whole temporary memory, so need save it to permenent\r
-    ; memory at first!\r
-    ;\r
-    \r
-    mov   rbx, [rsp + 28h]          ; Save the first parameter\r
-    mov   rcx, [rsp + 30h]          ; Save the second parameter\r
-    \r
-    ;\r
-    ; Save this function's return address into permenent memory at first.\r
-    ; Then, Fixup the esp point to permenent memory\r
-    ;\r
-    mov   rax, rsp\r
-    sub   rax, rbx\r
-    add   rax, rcx\r
-    mov   rdx, qword ptr [rsp]         ; copy pushed register's value to permenent memory\r
-    mov   qword ptr [rax], rdx    \r
-    mov   rdx, qword ptr [rsp + 8]\r
-    mov   qword ptr [rax + 8], rdx    \r
-    mov   rdx, qword ptr [rsp + 10h]\r
-    mov   qword ptr [rax + 10h], rdx    \r
-    mov   rdx, qword ptr [rsp + 18h]\r
-    mov   qword ptr [rax + 18h], rdx    \r
-    mov   rdx, qword ptr [rsp + 20h]    ; Update this function's return address into permenent memory\r
-    mov   qword ptr [rax + 20h], rdx    \r
-    mov   rsp, rax                     ; From now, esp is pointed to permenent memory\r
-        \r
-    ;\r
-    ; Fixup the ebp point to permenent memory\r
-    ;\r
-    mov   rax, rbp\r
-    sub   rax, rbx\r
-    add   rax, rcx\r
-    mov   rbp, rax                ; From now, ebp is pointed to permenent memory\r
-    \r
-    pop   rdx\r
-    pop   rcx\r
-    pop   rbx\r
-    pop   rax\r
-    ret\r
-SecSwitchStack   ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; PeiSwitchStacks (\r
-;   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-;   IN      VOID                      *Context1,  OPTIONAL\r
-;   IN      VOID                      *Context2,  OPTIONAL\r
-;   IN      VOID                      *Context3,  OPTIONAL\r
-;   IN      VOID                      *NewStack\r
-;   )\r
-;------------------------------------------------------------------------------\r
-PeiSwitchStacks   PROC\r
-    mov  rax, rcx\r
-    mov  rcx, rdx\r
-    mov  rdx, r8\r
-    mov  r8, r9\r
-    mov  rsp, [rsp + 28h]\r
-    sub  rsp, 20h\r
-    call rax\r
-    jmp $\r
-    ret\r
-PeiSwitchStacks   ENDP\r
-\r
-    END\r
diff --git a/Nt32Pkg/Sec/WinNtThunk.c b/Nt32Pkg/Sec/WinNtThunk.c
deleted file mode 100644 (file)
index c65b906..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtThunk.c\r
-\r
-Abstract:\r
-\r
-  Since the SEC is the only windows program in our emulation we \r
-  must use a Tiano mechanism to export Win32 APIs to other modules.\r
-  This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.\r
-\r
-  The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL\r
-  will cause an error in initializing the array if all the member functions\r
-  are not added. It looks like adding a element to end and not initializing\r
-  it may cause the table to be initaliized with the members at the end being\r
-  set to zero. This is bad as jumping to zero will case the NT32 to crash.\r
-  \r
-  All the member functions in mWinNtThunkTable are Win32\r
-  API calls, so please reference Microsoft documentation. \r
-\r
-\r
-  gWinNt is a a public exported global that contains the initialized\r
-  data.\r
-\r
-**/\r
-\r
-#include "SecMain.h"\r
-\r
-//\r
-// This pragma is needed for all the DLL entry points to be asigned to the array.\r
-//  if warning 4232 is not dissabled a warning will be generated as a DLL entry\r
-//  point could be modified dynamically. The SEC does not do that, so we must\r
-//  disable the warning so we can compile the SEC. The previous method was to\r
-//  asign each element in code. The disadvantage to that approach is it's harder\r
-//  to tell if all the elements have been initialized properly.\r
-//\r
-#pragma warning(disable : 4232)\r
-#pragma warning(disable : 4996)\r
-\r
-#if __INTEL_COMPILER\r
-#pragma warning ( disable : 144 )  \r
-#endif\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = {\r
-  EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE,\r
-  GetProcAddress,\r
-  GetTickCount,\r
-  LoadLibraryEx,\r
-  FreeLibrary,\r
-  SetPriorityClass,\r
-  SetThreadPriority,\r
-  Sleep,\r
-  SuspendThread,\r
-  GetCurrentThread,\r
-  GetCurrentThreadId,\r
-  GetCurrentProcess,\r
-  CreateThread,\r
-  TerminateThread,\r
-  SendMessage,\r
-  ExitThread,\r
-  ResumeThread,\r
-  DuplicateHandle,\r
-  InitializeCriticalSection,\r
-  EnterCriticalSection,\r
-  LeaveCriticalSection,\r
-  DeleteCriticalSection,\r
-  TlsAlloc,\r
-  TlsFree,\r
-  TlsSetValue,\r
-  TlsGetValue,\r
-  CreateSemaphore,\r
-  WaitForSingleObject,\r
-  ReleaseSemaphore,\r
-  CreateConsoleScreenBuffer,\r
-  FillConsoleOutputAttribute,\r
-  FillConsoleOutputCharacter,\r
-  GetConsoleCursorInfo,\r
-  GetNumberOfConsoleInputEvents,\r
-  PeekConsoleInput,\r
-  ScrollConsoleScreenBuffer,\r
-  ReadConsoleInput,\r
-  SetConsoleActiveScreenBuffer,\r
-  SetConsoleCursorInfo,\r
-  SetConsoleCursorPosition,\r
-  SetConsoleScreenBufferSize,\r
-  SetConsoleTitleW,\r
-  WriteConsoleInput,\r
-  WriteConsoleOutput,\r
-  CreateFile,\r
-  DeviceIoControl,\r
-  CreateDirectory,\r
-  RemoveDirectory,\r
-  GetFileAttributes,\r
-  SetFileAttributes,\r
-  CreateFileMapping,\r
-  CloseHandle,\r
-  DeleteFile,\r
-  FindFirstFile,\r
-  FindNextFile,\r
-  FindClose,\r
-  FlushFileBuffers,\r
-  GetEnvironmentVariable,\r
-  GetLastError,\r
-  SetErrorMode,\r
-  GetStdHandle,\r
-  MapViewOfFileEx,\r
-  ReadFile,\r
-  SetEndOfFile,\r
-  SetFilePointer,\r
-  WriteFile,\r
-  GetFileInformationByHandle,\r
-  GetDiskFreeSpace,\r
-  GetDiskFreeSpaceEx,\r
-  MoveFile,\r
-  SetFileTime,\r
-  SystemTimeToFileTime,\r
-  LocalFileTimeToFileTime,\r
-  FileTimeToLocalFileTime,\r
-  FileTimeToSystemTime,\r
-  GetSystemTime,\r
-  SetSystemTime,\r
-  GetLocalTime,\r
-  SetLocalTime,\r
-  GetTimeZoneInformation,\r
-  SetTimeZoneInformation,\r
-  timeSetEvent,\r
-  timeKillEvent,\r
-  ClearCommError,\r
-  EscapeCommFunction,\r
-  GetCommModemStatus,\r
-  GetCommState,\r
-  SetCommState,\r
-  PurgeComm,\r
-  SetCommTimeouts,\r
-  ExitProcess,\r
-  _snwprintf,\r
-  GetDesktopWindow,\r
-  GetForegroundWindow,\r
-  CreateWindowEx,\r
-  ShowWindow,\r
-  UpdateWindow,\r
-  DestroyWindow,\r
-  InvalidateRect,\r
-  GetWindowDC,\r
-  GetClientRect,\r
-  AdjustWindowRect,\r
-  SetDIBitsToDevice,\r
-  BitBlt,\r
-  GetDC,\r
-  ReleaseDC,\r
-  RegisterClassEx,\r
-  UnregisterClass,\r
-  BeginPaint,\r
-  EndPaint,\r
-  PostQuitMessage,\r
-  DefWindowProc,\r
-  LoadIcon,\r
-  LoadCursor,\r
-  GetStockObject,\r
-  SetViewportOrgEx,\r
-  SetWindowOrgEx,\r
-  MoveWindow,\r
-  GetWindowRect,\r
-  GetMessage,\r
-  TranslateMessage,\r
-  DispatchMessage,\r
-  GetProcessHeap,\r
-  HeapAlloc,\r
-  HeapFree,\r
-  QueryPerformanceCounter,\r
-  QueryPerformanceFrequency\r
-};\r
-\r
-#pragma warning(default : 4996)\r
-#pragma warning(default : 4232)\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL *gWinNt = &mWinNtThunkTable;\r
diff --git a/Nt32Pkg/SnpNt32Dxe/ComponentName.c b/Nt32Pkg/SnpNt32Dxe/ComponentName.c
deleted file mode 100644 (file)
index 2f4efd0..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-\r
-**/\r
-\r
-#include "SnpNt32.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gSnpNt32DriverComponentName = {\r
-  SnpNt32DriverComponentNameGetDriverName,\r
-  SnpNt32DriverComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSnpNt32DriverComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SnpNt32DriverComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SnpNt32DriverComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSnpNt32DriverNameTable[] = {\r
-  {\r
-    "eng;en",\r
-    L"SNP NT32 Driver"\r
-  },\r
-  {\r
-    NULL,\r
-    NULL\r
-  }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mSnpNt32DriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gSnpNt32DriverComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
deleted file mode 100644 (file)
index 88c2e22..0000000
+++ /dev/null
@@ -1,1480 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  SnpNt32.c\r
-\r
-Abstract:\r
-\r
--**/\r
-\r
-#include "SnpNt32.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding = {\r
-  SnpNt32DriverBindingSupported,\r
-  SnpNt32DriverBindingStart,\r
-  SnpNt32DriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-SNPNT32_GLOBAL_DATA         gSnpNt32GlobalData = {\r
-  SNP_NT32_DRIVER_SIGNATURE,  //  Signature\r
-  {\r
-    NULL,\r
-    NULL\r
-  },                          //  InstanceList\r
-  NULL,                       //  WinNtThunk\r
-  NULL,                       //  NetworkLibraryHandle\r
-  {\r
-    0\r
-  },                          //  NtNetUtilityTable\r
-  {\r
-    0,\r
-    0,\r
-    EfiLockUninitialized\r
-  },                          //  Lock\r
-  //\r
-  //  Private functions\r
-  //\r
-  SnpNt32InitializeGlobalData,            //  InitializeGlobalData\r
-  SnpNt32InitializeInstanceData,          //  InitializeInstanceData\r
-  SnpNt32CloseInstance                    //  CloseInstance\r
-};\r
-\r
-/**\r
-  Changes the state of a network interface from "stopped" to "started".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Start (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  );\r
-  \r
-/**\r
-  Changes the state of a network interface from "started" to "stopped".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Stop (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  );\r
-  \r
-/**\r
-  Resets a network adapter and allocates the transmit and receive buffers \r
-  required by the network interface; optionally, also requests allocation \r
-  of additional transmit and receive buffers.\r
-\r
-  @param  This              Protocol instance pointer.\r
-  @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-  @param  ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Initialize (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINTN                       ExtraRxBufferSize OPTIONAL,\r
-  IN UINTN                       ExtraTxBufferSize OPTIONAL\r
-  );\r
-  \r
-/**\r
-  Resets a network adapter and re-initializes it with the parameters that were \r
-  provided in the previous call to Initialize().  \r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ExtendedVerification Indicates that the driver may perform a more\r
-                               exhaustive verification operation of the device\r
-                               during reset.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Reset (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL  *This,\r
-  IN BOOLEAN                      ExtendedVerification\r
-  );\r
-\r
-/**\r
-  Resets a network adapter and leaves it in a state that is safe for \r
-  another driver to initialize.\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Shutdown (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  );\r
-\r
-/**\r
-  Manages the multicast receive filters of a network interface.\r
-\r
-  @param  This               Protocol instance pointer.\r
-  @param  EnableBits         A bit mask of receive filters to enable on the network interface.\r
-  @param  DisableBits        A bit mask of receive filters to disable on the network interface.\r
-  @param  ResetMcastFilter   Set to TRUE to reset the contents of the multicast receive\r
-                             filters on the network interface to their default values.\r
-  @param  McastFilterCount   Number of multicast HW MAC addresses in the new\r
-                             MCastFilter list. This value must be less than or equal to\r
-                             the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
-                             field is optional if ResetMCastFilter is TRUE.\r
-  @param  McastFilter        A pointer to a list of new multicast receive filter HW MAC\r
-                             addresses. This list will replace any existing multicast\r
-                             HW MAC address list. This field is optional if\r
-                             ResetMCastFilter is TRUE.\r
-\r
-  @retval EFI_SUCCESS           The multicast receive filter list was updated.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32ReceiveFilters (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINT32                      EnableBits,\r
-  IN UINT32                      DisableBits,\r
-  IN BOOLEAN                     ResetMcastFilter,\r
-  IN UINTN                       McastFilterCount OPTIONAL,\r
-  IN EFI_MAC_ADDRESS             *McastFilter     OPTIONAL\r
-  );\r
-\r
-/**\r
-  Modifies or resets the current station address, if supported.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  Reset        Flag used to reset the station address to the network interfaces\r
-                       permanent address.\r
-  @param  NewMacAddr   New station address to be used for the network interface.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32StationAddress (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     Reset,\r
-  IN EFI_MAC_ADDRESS             *NewMacAddr OPTIONAL\r
-  );\r
-\r
-/**\r
-  Resets or collects the statistics on a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  Reset           Set to TRUE to reset the statistics for the network interface.\r
-  @param  StatisticsSize  On input the size, in bytes, of StatisticsTable. On\r
-                          output the size, in bytes, of the resulting table of\r
-                          statistics.\r
-  @param  StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
-                          contains the statistics.\r
-\r
-  @retval EFI_SUCCESS           The statistics were collected from the network interface.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Statistics (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL  * This,\r
-  IN BOOLEAN                      Reset,\r
-  IN OUT UINTN                    *StatisticsSize OPTIONAL,\r
-  OUT EFI_NETWORK_STATISTICS      *StatisticsTable OPTIONAL\r
-  );\r
-  \r
-/**\r
-  Converts a multicast IP address to a multicast HW MAC address.\r
-  \r
-  @param  This  Protocol instance pointer.\r
-  @param  Ipv6  Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
-                to FALSE if the multicast IP address is IPv4 [RFC 791].\r
-  @param  Ip    The multicast IP address that is to be converted to a multicast\r
-                HW MAC address.\r
-  @param  Mac   The multicast HW MAC address that is to be generated from IP.\r
-\r
-  @retval EFI_SUCCESS           The multicast IP address was mapped to the multicast\r
-                                HW MAC address.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32McastIptoMac (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     Ipv6,\r
-  IN EFI_IP_ADDRESS              *Ip,\r
-  OUT EFI_MAC_ADDRESS            *Mac\r
-  );\r
-\r
-/**\r
-  Performs read and write operations on the NVRAM device attached to a \r
-  network interface.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  ReadOrWrite  TRUE for read operations, FALSE for write operations.\r
-  @param  Offset       Byte offset in the NVRAM device at which to start the read or\r
-                       write operation. This must be a multiple of NvRamAccessSize and\r
-                       less than NvRamSize.\r
-  @param  BufferSize   The number of bytes to read or write from the NVRAM device.\r
-                       This must also be a multiple of NvramAccessSize.\r
-  @param  Buffer       A pointer to the data buffer.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Nvdata (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     ReadOrWrite,\r
-  IN UINTN                       Offset,\r
-  IN UINTN                       BufferSize,\r
-  IN OUT VOID                    *Buffer\r
-  );\r
-\r
-/**\r
-  Reads the current interrupt status and recycled transmit buffer status from \r
-  a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  InterruptStatus A pointer to the bit mask of the currently active interrupts\r
-                          If this is NULL, the interrupt status will not be read from\r
-                          the device. If this is not NULL, the interrupt status will\r
-                          be read from the device. When the  interrupt status is read,\r
-                          it will also be cleared. Clearing the transmit  interrupt\r
-                          does not empty the recycled transmit buffer array.\r
-  @param  TxBuffer        Recycled transmit buffer address. The network interface will\r
-                          not transmit if its internal recycled transmit buffer array\r
-                          is full. Reading the transmit buffer does not clear the\r
-                          transmit interrupt. If this is NULL, then the transmit buffer\r
-                          status will not be read. If there are no transmit buffers to\r
-                          recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32GetStatus (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  OUT UINT32                     *InterruptStatus,\r
-  OUT VOID                       **TxBuffer\r
-  );\r
-\r
-/**\r
-  Places a packet in the transmit queue of a network interface.\r
-\r
-  @param  This       Protocol instance pointer.\r
-  @param  HeaderSize The size, in bytes, of the media header to be filled in by\r
-                     the Transmit() function. If HeaderSize is non-zero, then it\r
-                     must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
-                     and Protocol parameters must not be NULL.\r
-  @param  BufferSize The size, in bytes, of the entire packet (media header and\r
-                     data) to be transmitted through the network interface.\r
-  @param  Buffer     A pointer to the packet (media header followed by data) to be\r
-                     transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
-                     then the media header in Buffer must already be filled in by the\r
-                     caller. If HeaderSize is non-zero, then the media header will be\r
-                     filled in by the Transmit() function.\r
-  @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter\r
-                     is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
-                     This->Mode->CurrentAddress is used for the source HW MAC address.\r
-  @param  DestAddr   The destination HW MAC address. If HeaderSize is zero, then this\r
-                     parameter is ignored.\r
-  @param  Protocol   The type of header to build. If HeaderSize is zero, then this\r
-                     parameter is ignored. See RFC 1700, section "Ether Types", for\r
-                     examples.\r
-\r
-  @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Transmit (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINTN                       HeaderSize,\r
-  IN UINTN                       BufferSize,\r
-  IN VOID                        *Buffer,\r
-  IN EFI_MAC_ADDRESS             *SrcAddr OPTIONAL,\r
-  IN EFI_MAC_ADDRESS             *DestAddr OPTIONAL,\r
-  IN UINT16                      *Protocol OPTIONAL\r
-  );\r
-\r
-/**\r
-  Receives a packet from a network interface.\r
-\r
-  @param  This             Protocol instance pointer.\r
-  @param  HeaderSize       The size, in bytes, of the media header received on the network\r
-                           interface. If this parameter is NULL, then the media header size\r
-                           will not be returned.\r
-  @param  BuffSize         On entry, the size, in bytes, of Buffer. On exit, the size, in\r
-                           bytes, of the packet that was received on the network interface.\r
-  @param  Buffer           A pointer to the data buffer to receive both the media header and\r
-                           the data.\r
-  @param  SourceAddr       The source HW MAC address. If this parameter is NULL, the\r
-                           HW MAC source address will not be extracted from the media\r
-                           header.\r
-  @param  DestinationAddr  The destination HW MAC address. If this parameter is NULL,\r
-                           the HW MAC destination address will not be extracted from the\r
-                           media header.\r
-  @param  Protocol         The media header type. If this parameter is NULL, then the\r
-                           protocol will not be extracted from the media header. See\r
-                           RFC 1700 section "Ether Types" for examples.\r
-\r
-  @retval  EFI_SUCCESS           The received data was stored in Buffer, and BufferSize has\r
-                                 been updated to the number of bytes received.\r
-  @retval  EFI_NOT_READY         The network interface is too busy to accept this transmit\r
-                                 request.\r
-  @retval  EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
-  @retval  EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval  EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Receive (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  OUT UINTN                      *HeaderSize,\r
-  IN OUT UINTN                   *BuffSize,\r
-  OUT VOID                       *Buffer,\r
-  OUT EFI_MAC_ADDRESS            *SourceAddr,\r
-  OUT EFI_MAC_ADDRESS            *DestinationAddr,\r
-  OUT UINT16                     *Protocol\r
-  );\r
-\r
-SNPNT32_INSTANCE_DATA gSnpNt32InstanceTemplate = {\r
-  SNP_NT32_INSTANCE_SIGNATURE,            //  Signature\r
-  {\r
-    NULL,\r
-    NULL\r
-  },                                      //  Entry\r
-  NULL,                                   //  RecycledTxBuf\r
-  0,                                      //  RecycledTxBufCount\r
-  32,                                     //  MaxRecycledTxBuf\r
-  NULL,                                   //  GlobalData\r
-  NULL,                                   //  DeviceHandle\r
-  NULL,                                   //  DevicePath\r
-  {                                       //  Snp\r
-    EFI_SIMPLE_NETWORK_PROTOCOL_REVISION, //  Revision\r
-    SnpNt32Start,                         //  Start\r
-    SnpNt32Stop,                          //  Stop\r
-    SnpNt32Initialize,                    //  Initialize\r
-    SnpNt32Reset,                         //  Reset\r
-    SnpNt32Shutdown,                      //  Shutdown\r
-    SnpNt32ReceiveFilters,                //  ReceiveFilters\r
-    SnpNt32StationAddress,                //  StationAddress\r
-    SnpNt32Statistics,                    //  Statistics\r
-    SnpNt32McastIptoMac,                  //  MCastIpToMac\r
-    SnpNt32Nvdata,                        //  NvData\r
-    SnpNt32GetStatus,                     //  GetStatus\r
-    SnpNt32Transmit,                      //  Transmit\r
-    SnpNt32Receive,                       //  Receive\r
-    NULL,                                 //  WaitForPacket\r
-    NULL                                  //  Mode\r
-  },\r
-  {                                       //  Mode\r
-    EfiSimpleNetworkInitialized,          //  State\r
-    NET_ETHER_ADDR_LEN,                   //  HwAddressSize\r
-    NET_ETHER_HEADER_SIZE,                //  MediaHeaderSize\r
-    1500,                                 //  MaxPacketSize\r
-    0,                                    //  NvRamSize\r
-    0,                                    //  NvRamAccessSize\r
-    0,                                    //  ReceiveFilterMask\r
-    0,                                    //  ReceiveFilterSetting\r
-    MAX_MCAST_FILTER_CNT,                 //  MaxMCastFilterCount\r
-    0,                                    //  MCastFilterCount\r
-    {\r
-      0\r
-    },                                    //  MCastFilter\r
-    {\r
-      0\r
-    },                                    //  CurrentAddress\r
-    {\r
-      0\r
-    },                                    //  BroadcastAddress\r
-    {\r
-      0\r
-    },                                    //  PermanentAddress\r
-    NET_IFTYPE_ETHERNET,                  //  IfType\r
-    FALSE,                                //  MacAddressChangeable\r
-    FALSE,                                //  MultipleTxSupported\r
-    TRUE,                                 //  MediaPresentSupported\r
-    TRUE                                  //  MediaPresent\r
-  },\r
-  {\r
-    0\r
-  }                                       //  InterfaceInfo\r
-};\r
-\r
-/**\r
-  Test to see if this driver supports ControllerHandle. This service\r
-  is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
-\r
-  @param  This                Protocol instance pointer.\r
-  @param  ControllerHandle    Handle of device to test\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
-                              device to start.\r
-\r
-  @retval EFI_SUCCESS         This driver supports this device\r
-  @retval EFI_UNSUPPORTED     This driver does not support this device\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  )\r
-{\r
-\r
-  SNPNT32_GLOBAL_DATA   *GlobalData;\r
-  LIST_ENTRY            *Entry;\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-\r
-  GlobalData = &gSnpNt32GlobalData;\r
-\r
-  NET_LIST_FOR_EACH (Entry, &GlobalData->InstanceList) {\r
-\r
-    Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);\r
-\r
-    if (Instance->DeviceHandle == ControllerHandle) {\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-  }\r
-\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  Start this driver on ControllerHandle. This service is called by the\r
-  EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ControllerHandle     Handle of device to bind driver to\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
-                               device to start.\r
-\r
-  @retval EFI_SUCCESS          Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Stop this driver on ControllerHandle. This service is called by the\r
-  EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
-  \r
-  @param  This              Protocol instance pointer.\r
-  @param  ControllerHandle  Handle of device to stop driver on\r
-  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
-                            children is zero stop the entire bus driver.\r
-  @param  ChildHandleBuffer List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCESS       Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Changes the state of a network interface from "stopped" to "started".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Start (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Changes the state of a network interface from "started" to "stopped".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Stop (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Resets a network adapter and allocates the transmit and receive buffers \r
-  required by the network interface; optionally, also requests allocation \r
-  of additional transmit and receive buffers.\r
-\r
-  @param  This              Protocol instance pointer.\r
-  @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-  @param  ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Initialize (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINTN                       ExtraRxBufferSize OPTIONAL,\r
-  IN UINTN                       ExtraTxBufferSize OPTIONAL\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Resets a network adapter and re-initializes it with the parameters that were \r
-  provided in the previous call to Initialize().  \r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ExtendedVerification Indicates that the driver may perform a more\r
-                               exhaustive verification operation of the device\r
-                               during reset.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Reset (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL  *This,\r
-  IN BOOLEAN                      ExtendedVerification\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Resets a network adapter and leaves it in a state that is safe for \r
-  another driver to initialize.\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Shutdown (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Manages the multicast receive filters of a network interface.\r
-\r
-  @param  This               Protocol instance pointer.\r
-  @param  EnableBits         A bit mask of receive filters to enable on the network interface.\r
-  @param  DisableBits        A bit mask of receive filters to disable on the network interface.\r
-  @param  ResetMcastFilter   Set to TRUE to reset the contents of the multicast receive\r
-                             filters on the network interface to their default values.\r
-  @param  McastFilterCount   Number of multicast HW MAC addresses in the new\r
-                             MCastFilter list. This value must be less than or equal to\r
-                             the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
-                             field is optional if ResetMCastFilter is TRUE.\r
-  @param  McastFilter        A pointer to a list of new multicast receive filter HW MAC\r
-                             addresses. This list will replace any existing multicast\r
-                             HW MAC address list. This field is optional if\r
-                             ResetMCastFilter is TRUE.\r
-\r
-  @retval EFI_SUCCESS           The multicast receive filter list was updated.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32ReceiveFilters (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINT32                      EnableBits,\r
-  IN UINT32                      DisableBits,\r
-  IN BOOLEAN                     ResetMcastFilter,\r
-  IN UINTN                       McastFilterCount OPTIONAL,\r
-  IN EFI_MAC_ADDRESS             *McastFilter     OPTIONAL\r
-  )\r
-{\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-  SNPNT32_GLOBAL_DATA   *GlobalData;\r
-  INT32                 ReturnValue;\r
-\r
-  Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
-\r
-  GlobalData  = Instance->GlobalData;\r
-\r
-  if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
-  ReturnValue = GlobalData->NtNetUtilityTable.SetReceiveFilter (\r
-                                                Instance->InterfaceInfo.InterfaceIndex,\r
-                                                EnableBits,\r
-                                                (UINT32)McastFilterCount,\r
-                                                McastFilter\r
-                                                );\r
-\r
-  EfiReleaseLock (&GlobalData->Lock);\r
-\r
-  if (ReturnValue <= 0) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Modifies or resets the current station address, if supported.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  Reset        Flag used to reset the station address to the network interfaces\r
-                       permanent address.\r
-  @param  NewMacAddr   New station address to be used for the network interface.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32StationAddress (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     Reset,\r
-  IN EFI_MAC_ADDRESS             *NewMacAddr OPTIONAL\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
-  Resets or collects the statistics on a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  Reset           Set to TRUE to reset the statistics for the network interface.\r
-  @param  StatisticsSize  On input the size, in bytes, of StatisticsTable. On\r
-                          output the size, in bytes, of the resulting table of\r
-                          statistics.\r
-  @param  StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
-                          contains the statistics.\r
-\r
-  @retval EFI_SUCCESS           The statistics were collected from the network interface.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Statistics (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL  * This,\r
-  IN BOOLEAN                      Reset,\r
-  IN OUT UINTN                    *StatisticsSize OPTIONAL,\r
-  OUT EFI_NETWORK_STATISTICS      *StatisticsTable OPTIONAL\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
-  Converts a multicast IP address to a multicast HW MAC address.\r
-\r
-  @param  This Protocol instance pointer.\r
-  @param  Ipv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
-               to FALSE if the multicast IP address is IPv4 [RFC 791].\r
-  @param  Ip   The multicast IP address that is to be converted to a multicast\r
-               HW MAC address.\r
-  @param  Mac  The multicast HW MAC address that is to be generated from IP.\r
-\r
-  @retval EFI_SUCCESS           The multicast IP address was mapped to the multicast\r
-                                HW MAC address.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32McastIptoMac (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     Ipv6,\r
-  IN EFI_IP_ADDRESS              *Ip,\r
-  OUT EFI_MAC_ADDRESS            *Mac\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  Performs read and write operations on the NVRAM device attached to a \r
-  network interface.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  ReadOrWrite  TRUE for read operations, FALSE for write operations.\r
-  @param  Offset       Byte offset in the NVRAM device at which to start the read or\r
-                       write operation. This must be a multiple of NvRamAccessSize and\r
-                       less than NvRamSize.\r
-  @param  BufferSize   The number of bytes to read or write from the NVRAM device.\r
-                       This must also be a multiple of NvramAccessSize.\r
-  @param  Buffer       A pointer to the data buffer.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Nvdata (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN BOOLEAN                     ReadOrWrite,\r
-  IN UINTN                       Offset,\r
-  IN UINTN                       BufferSize,\r
-  IN OUT VOID                    *Buffer\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current interrupt status and recycled transmit buffer status from \r
-  a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  InterruptStatus A pointer to the bit mask of the currently active interrupts\r
-                          If this is NULL, the interrupt status will not be read from\r
-                          the device. If this is not NULL, the interrupt status will\r
-                          be read from the device. When the  interrupt status is read,\r
-                          it will also be cleared. Clearing the transmit  interrupt\r
-                          does not empty the recycled transmit buffer array.\r
-  @param  TxBuffer        Recycled transmit buffer address. The network interface will\r
-                          not transmit if its internal recycled transmit buffer array\r
-                          is full. Reading the transmit buffer does not clear the\r
-                          transmit interrupt. If this is NULL, then the transmit buffer\r
-                          status will not be read. If there are no transmit buffers to\r
-                          recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32GetStatus (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  OUT UINT32                     *InterruptStatus,\r
-  OUT VOID                       **TxBuffer\r
-  )\r
-{\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-\r
-  Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
-\r
-  if (TxBuffer != NULL) {\r
-    if (Instance->RecycledTxBufCount != 0) {\r
-      Instance->RecycledTxBufCount --;\r
-      *((UINT8 **) TxBuffer)    = (UINT8 *) (UINTN)Instance->RecycledTxBuf[Instance->RecycledTxBufCount];\r
-    } else {\r
-      *((UINT8 **) TxBuffer)    = NULL;\r
-    }\r
-  }\r
-\r
-  if (InterruptStatus != NULL) {\r
-    *InterruptStatus = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Places a packet in the transmit queue of a network interface.\r
-\r
-  @param  This       Protocol instance pointer.\r
-  @param  HeaderSize The size, in bytes, of the media header to be filled in by\r
-                     the Transmit() function. If HeaderSize is non-zero, then it\r
-                     must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
-                     and Protocol parameters must not be NULL.\r
-  @param  BufferSize The size, in bytes, of the entire packet (media header and\r
-                     data) to be transmitted through the network interface.\r
-  @param  Buffer     A pointer to the packet (media header followed by data) to be\r
-                     transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
-                     then the media header in Buffer must already be filled in by the\r
-                     caller. If HeaderSize is non-zero, then the media header will be\r
-                     filled in by the Transmit() function.\r
-  @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter\r
-                     is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
-                     This->Mode->CurrentAddress is used for the source HW MAC address.\r
-  @param  DestAddr   The destination HW MAC address. If HeaderSize is zero, then this\r
-                     parameter is ignored.\r
-  @param  Protocol   The type of header to build. If HeaderSize is zero, then this\r
-                     parameter is ignored. See RFC 1700, section "Ether Types", for\r
-                     examples.\r
-\r
-  @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Transmit (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  IN UINTN                       HeaderSize,\r
-  IN UINTN                       BufferSize,\r
-  IN VOID                        *Buffer,\r
-  IN EFI_MAC_ADDRESS             *SrcAddr OPTIONAL,\r
-  IN EFI_MAC_ADDRESS             *DestAddr OPTIONAL,\r
-  IN UINT16                      *Protocol OPTIONAL\r
-  )\r
-{\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-  SNPNT32_GLOBAL_DATA   *GlobalData;\r
-  INT32                 ReturnValue;\r
-  UINT64                *Tmp;\r
-\r
-  Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
-\r
-  GlobalData  = Instance->GlobalData;\r
-\r
-  if ((HeaderSize != 0) && (SrcAddr == NULL)) {\r
-    SrcAddr = &Instance->Mode.CurrentAddress;\r
-  }\r
-\r
-  if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
-  ReturnValue = GlobalData->NtNetUtilityTable.Transmit (\r
-                                                Instance->InterfaceInfo.InterfaceIndex,\r
-                                                (UINT32)HeaderSize,\r
-                                                (UINT32)BufferSize,\r
-                                                Buffer,\r
-                                                SrcAddr,\r
-                                                DestAddr,\r
-                                                Protocol\r
-                                                );\r
-\r
-  EfiReleaseLock (&GlobalData->Lock);\r
-\r
-  if (ReturnValue < 0) {\r
-    return EFI_DEVICE_ERROR;\r
-  } else {\r
-    if ((Instance->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT) >= SNP_MAX_TX_BUFFER_NUM) {\r
-      return EFI_NOT_READY;\r
-    }\r
-\r
-    if (Instance->RecycledTxBufCount < Instance->MaxRecycledTxBuf) {\r
-      Instance->RecycledTxBuf[Instance->RecycledTxBufCount] = (UINT64) Buffer;\r
-      Instance->RecycledTxBufCount ++;\r
-    } else {\r
-      Tmp = AllocatePool (sizeof (UINT64) * (Instance->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT));\r
-      if (Tmp == NULL) {\r
-        return EFI_DEVICE_ERROR;\r
-      }\r
-      CopyMem (Tmp, Instance->RecycledTxBuf, sizeof (UINT64) * Instance->RecycledTxBufCount);\r
-      FreePool (Instance->RecycledTxBuf);\r
-      Instance->RecycledTxBuf    =  Tmp;\r
-      Instance->MaxRecycledTxBuf += SNP_TX_BUFFER_INCREASEMENT;\r
-    }\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Receives a packet from a network interface.\r
-\r
-  @param  This             Protocol instance pointer.\r
-  @param  HeaderSize       The size, in bytes, of the media header received on the network\r
-                           interface. If this parameter is NULL, then the media header size\r
-                           will not be returned.\r
-  @param  BuffSize         On entry, the size, in bytes, of Buffer. On exit, the size, in\r
-                           bytes, of the packet that was received on the network interface.\r
-  @param  Buffer           A pointer to the data buffer to receive both the media header and\r
-                           the data.\r
-  @param  SourceAddr       The source HW MAC address. If this parameter is NULL, the\r
-                           HW MAC source address will not be extracted from the media\r
-                           header.\r
-  @param  DestinationAddr  The destination HW MAC address. If this parameter is NULL,\r
-                           the HW MAC destination address will not be extracted from the\r
-                           media header.\r
-  @param  Protocol         The media header type. If this parameter is NULL, then the\r
-                           protocol will not be extracted from the media header. See\r
-                           RFC 1700 section "Ether Types" for examples.\r
-\r
-  @retval  EFI_SUCCESS           The received data was stored in Buffer, and BufferSize has\r
-                                 been updated to the number of bytes received.\r
-  @retval  EFI_NOT_READY         The network interface is too busy to accept this transmit\r
-                                 request.\r
-  @retval  EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
-  @retval  EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval  EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Receive (\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
-  OUT UINTN                      *HeaderSize,\r
-  IN OUT UINTN                   *BuffSize,\r
-  OUT VOID                       *Buffer,\r
-  OUT EFI_MAC_ADDRESS            *SourceAddr,\r
-  OUT EFI_MAC_ADDRESS            *DestinationAddr,\r
-  OUT UINT16                     *Protocol\r
-  )\r
-{\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-  SNPNT32_GLOBAL_DATA   *GlobalData;\r
-  INT32                 ReturnValue;\r
-  UINTN                 BufSize;\r
-  \r
-  BufSize     = *BuffSize;\r
-\r
-  Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
-\r
-  GlobalData  = Instance->GlobalData;\r
-\r
-  ASSERT (GlobalData->NtNetUtilityTable.Receive != NULL);\r
-\r
-  if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
-  ReturnValue = GlobalData->NtNetUtilityTable.Receive (\r
-                                                Instance->InterfaceInfo.InterfaceIndex,\r
-                                                BuffSize,\r
-                                                Buffer\r
-                                                );\r
-\r
-  EfiReleaseLock (&GlobalData->Lock);\r
-\r
-  if (ReturnValue < 0) {\r
-    if (ReturnValue == -100) {\r
-      return EFI_BUFFER_TOO_SMALL;\r
-    }\r
-\r
-    return EFI_DEVICE_ERROR;\r
-  } else if (ReturnValue == 0) {\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
-  if (HeaderSize != NULL) {\r
-    *HeaderSize = 14;\r
-  }\r
-\r
-  if (SourceAddr != NULL) {\r
-    ZeroMem (SourceAddr, sizeof (EFI_MAC_ADDRESS));\r
-    CopyMem (SourceAddr, ((UINT8 *) Buffer) + 6, 6);\r
-  }\r
-\r
-  if (DestinationAddr != NULL) {\r
-    ZeroMem (DestinationAddr, sizeof (EFI_MAC_ADDRESS));\r
-    CopyMem (DestinationAddr, ((UINT8 *) Buffer), 6);\r
-  }\r
-\r
-  if (Protocol != NULL) {\r
-    *Protocol = NTOHS (*((UINT16 *) (((UINT8 *) Buffer) + 12)));\r
-  }\r
-\r
-  return (*BuffSize <= BufSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL; \r
-}\r
-\r
-/**\r
-  Initialize the driver's global data.\r
-\r
-  @param  This                  Pointer to the global context data.\r
-\r
-  @retval EFI_SUCCESS           The global data is initialized.\r
-  @retval EFI_NOT_FOUND         The required DLL is not found.\r
-  @retval EFI_DEVICE_ERROR      Error initialize network utility library.\r
-  @retval EFI_OUT_OF_RESOURCES  Out of resource.\r
-  @retval other                 Other errors.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32InitializeGlobalData (\r
-  IN OUT SNPNT32_GLOBAL_DATA *This\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-  CHAR16                *DllFileNameU;\r
-  UINT32                Index;\r
-  INT32                 ReturnValue;\r
-  BOOLEAN               NetUtilityLibInitDone;\r
-  NT_NET_INTERFACE_INFO NetInterfaceInfoBuffer[MAX_INTERFACE_INFO_NUMBER];\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-  LIST_ENTRY            *Entry;\r
-  UINT32                InterfaceCount;\r
-\r
-  ASSERT (This != NULL);\r
-\r
-  NetUtilityLibInitDone = FALSE;\r
-  InterfaceCount        = MAX_INTERFACE_INFO_NUMBER;\r
-\r
-  InitializeListHead (&This->InstanceList);\r
-  EfiInitializeLock (&This->Lock, TPL_CALLBACK);\r
-\r
-  //\r
-  //  Get the WinNT thunk\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiWinNtThunkProtocolGuid, NULL, (VOID **)&This->WinNtThunk);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  ASSERT (This->WinNtThunk != NULL);\r
-\r
-  DllFileNameU = NETWORK_LIBRARY_NAME_U;\r
-\r
-  //\r
-  //  Load network utility library\r
-  //\r
-  This->NetworkLibraryHandle = This->WinNtThunk->LoadLibraryEx (DllFileNameU, NULL, 0);\r
-\r
-  if (NULL == This->NetworkLibraryHandle) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  This->NtNetUtilityTable.Initialize = (NT_NET_INITIALIZE) This->WinNtThunk->GetProcAddress (\r
-                                                                               This->NetworkLibraryHandle,\r
-                                                                               NETWORK_LIBRARY_INITIALIZE\r
-                                                                               );\r
-\r
-  if (NULL == This->NtNetUtilityTable.Initialize) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-\r
-  This->NtNetUtilityTable.Finalize = (NT_NET_FINALIZE) This->WinNtThunk->GetProcAddress (\r
-                                                                           This->NetworkLibraryHandle,\r
-                                                                           NETWORK_LIBRARY_FINALIZE\r
-                                                                           );\r
-\r
-  if (NULL == This->NtNetUtilityTable.Finalize) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-\r
-  This->NtNetUtilityTable.SetReceiveFilter = (NT_NET_SET_RECEIVE_FILTER) This->WinNtThunk->GetProcAddress (\r
-                                                                                             This->NetworkLibraryHandle,\r
-                                                                                             NETWORK_LIBRARY_SET_RCV_FILTER\r
-                                                                                             );\r
-\r
-  if (NULL == This->NtNetUtilityTable.SetReceiveFilter) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-\r
-  This->NtNetUtilityTable.Receive = (NT_NET_RECEIVE) This->WinNtThunk->GetProcAddress (\r
-                                                                         This->NetworkLibraryHandle,\r
-                                                                         NETWORK_LIBRARY_RECEIVE\r
-                                                                         );\r
-\r
-  if (NULL == This->NtNetUtilityTable.Receive) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-\r
-  This->NtNetUtilityTable.Transmit = (NT_NET_TRANSMIT) This->WinNtThunk->GetProcAddress (\r
-                                                                           This->NetworkLibraryHandle,\r
-                                                                           NETWORK_LIBRARY_TRANSMIT\r
-                                                                           );\r
-\r
-  if (NULL == This->NtNetUtilityTable.Transmit) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-  //\r
-  //  Initialize the network utility library\r
-  //  And enumerate the interfaces in NT32 host\r
-  //\r
-  ReturnValue = This->NtNetUtilityTable.Initialize (&InterfaceCount, &NetInterfaceInfoBuffer[0]);\r
-  if (ReturnValue <= 0) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto ErrorReturn;\r
-  }\r
-\r
-  NetUtilityLibInitDone = TRUE;\r
-\r
-  if (InterfaceCount == 0) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto ErrorReturn;\r
-  }\r
-  //\r
-  //  Create fake SNP instances\r
-  //\r
-  for (Index = 0; Index < InterfaceCount; Index++) {\r
-\r
-    Instance = AllocateZeroPool (sizeof (SNPNT32_INSTANCE_DATA));\r
-\r
-    if (NULL == Instance) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto ErrorReturn;\r
-    }\r
-    //\r
-    //  Copy the content from a template\r
-    //\r
-    CopyMem (Instance, &gSnpNt32InstanceTemplate, sizeof (SNPNT32_INSTANCE_DATA));\r
-\r
-    //\r
-    // Allocate the RecycledTxBuf.\r
-    //\r
-    Instance->RecycledTxBuf = AllocatePool (sizeof (UINT64) * Instance->MaxRecycledTxBuf);\r
-    if (Instance->RecycledTxBuf == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    //\r
-    //  Set the interface information.\r
-    //\r
-    CopyMem (&Instance->InterfaceInfo, &NetInterfaceInfoBuffer[Index], sizeof(Instance->InterfaceInfo));\r
-    //\r
-    //  Initialize this instance\r
-    //\r
-    Status = This->InitializeInstanceData (This, Instance);\r
-    if (EFI_ERROR (Status)) {\r
-\r
-      gBS->FreePool (Instance);\r
-      goto ErrorReturn;\r
-    }\r
-    //\r
-    //  Insert this instance into the instance list\r
-    //\r
-    InsertTailList (&This->InstanceList, &Instance->Entry);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-ErrorReturn:\r
-\r
-  while (!IsListEmpty (&This->InstanceList)) {\r
-\r
-    Entry     = This->InstanceList.ForwardLink;\r
-\r
-    Instance  = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);\r
-\r
-    RemoveEntryList (Entry);\r
-\r
-    This->CloseInstance (This, Instance);\r
-    gBS->FreePool (Instance);\r
-  }\r
-\r
-  if (NetUtilityLibInitDone) {\r
-\r
-    ASSERT (This->WinNtThunk != NULL);\r
-\r
-    if (This->NtNetUtilityTable.Finalize != NULL) {\r
-      This->NtNetUtilityTable.Finalize ();\r
-      This->NtNetUtilityTable.Finalize = NULL;\r
-    }\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Initialize the snpnt32 driver instance.\r
-\r
-  @param  This                  Pointer to the SnpNt32 global data.\r
-  @param  Instance              Pointer to the instance context data.\r
-\r
-  @retval EFI_SUCCESS           The driver instance is initialized.\r
-  @retval other                 Initialization errors.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32InitializeInstanceData (\r
-  IN SNPNT32_GLOBAL_DATA        *This,\r
-  IN OUT SNPNT32_INSTANCE_DATA  *Instance\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-  EFI_DEV_PATH  EndNode;\r
-  EFI_DEV_PATH  Node;\r
-\r
-  Instance->GlobalData  = This;\r
-  Instance->Snp.Mode    = &Instance->Mode;\r
-  //\r
-  //  Set broadcast address\r
-  //\r
-  SetMem (&Instance->Mode.BroadcastAddress, sizeof (EFI_MAC_ADDRESS), 0xFF);\r
-\r
-  //\r
-  //  Copy Current/PermanentAddress MAC address\r
-  //\r
-  CopyMem (&Instance->Mode.CurrentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.CurrentAddress));\r
-  CopyMem (&Instance->Mode.PermanentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.PermanentAddress));\r
-\r
-  //\r
-  //  Since the fake SNP is based on a real NIC, to avoid conflict with the host\r
-  //  NIC network stack, we use a different MAC address.\r
-  //  So just change the last byte of the MAC address for the real NIC.\r
-  //\r
-  Instance->Mode.CurrentAddress.Addr[NET_ETHER_ADDR_LEN - 1]++;\r
-\r
-  //\r
-  //  Create a fake device path for the instance\r
-  //\r
-  ZeroMem (&Node, sizeof (Node));\r
-\r
-  Node.DevPath.Type     = MESSAGING_DEVICE_PATH;\r
-  Node.DevPath.SubType  = MSG_MAC_ADDR_DP;\r
-  SetDevicePathNodeLength (&Node.DevPath, sizeof (MAC_ADDR_DEVICE_PATH));\r
-\r
-  CopyMem (\r
-    &Node.MacAddr.MacAddress,\r
-    &Instance->Mode.CurrentAddress,\r
-    NET_ETHER_ADDR_LEN\r
-    );\r
-\r
-  Node.MacAddr.IfType = Instance->Mode.IfType;\r
-\r
-  SetDevicePathEndNode (&EndNode.DevPath);\r
-\r
-  Instance->DevicePath = AppendDevicePathNode (\r
-                           &EndNode.DevPath,\r
-                           &Node.DevPath\r
-                           );\r
-\r
-  //\r
-  //  Create a fake device handle for the fake SNP\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Instance->DeviceHandle,\r
-                  &gEfiSimpleNetworkProtocolGuid,\r
-                  &Instance->Snp,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  Instance->DevicePath,\r
-                  NULL\r
-                  );\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Close the SnpNt32 driver instance.\r
-\r
-  @param  This                  Pointer to the SnpNt32 global data.\r
-  @param  Instance              Pointer to the instance context data.\r
-\r
-  @retval EFI_SUCCESS           The instance is closed.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32CloseInstance (\r
-  IN SNPNT32_GLOBAL_DATA        *This,\r
-  IN OUT SNPNT32_INSTANCE_DATA  *Instance\r
-  )\r
-{\r
-  ASSERT (This != NULL);\r
-  ASSERT (Instance != NULL);\r
-\r
-  gBS->UninstallMultipleProtocolInterfaces (\r
-         Instance->DeviceHandle,\r
-         &gEfiSimpleNetworkProtocolGuid,\r
-         &Instance->Snp,\r
-         &gEfiDevicePathProtocolGuid,\r
-         Instance->DevicePath,\r
-         NULL\r
-         );\r
-\r
-  if (Instance->DevicePath != NULL) {\r
-    gBS->FreePool (Instance->DevicePath);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Unloads an image.\r
-\r
-  @param  ImageHandle           Handle that identifies the image to be unloaded.\r
-\r
-  @retval EFI_SUCCESS           The image has been unloaded.\r
-  @return Exit code from the image's unload handler\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32Unload (\r
-  IN EFI_HANDLE  ImageHandle\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-  SNPNT32_GLOBAL_DATA   *This;\r
-  LIST_ENTRY            *Entry;\r
-  SNPNT32_INSTANCE_DATA *Instance;\r
-\r
-  This    = &gSnpNt32GlobalData;\r
-\r
-  Status  = NetLibDefaultUnload (ImageHandle);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  while (!IsListEmpty (&This->InstanceList)) {\r
-    //\r
-    //  Walkthrough the interfaces and remove all the SNP instance\r
-    //\r
-    Entry     = This->InstanceList.ForwardLink;\r
-\r
-    Instance  = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);\r
-\r
-    RemoveEntryList (Entry);\r
-\r
-    This->CloseInstance (This, Instance);\r
-    gBS->FreePool (Instance);\r
-  }\r
-\r
-  if (This->NtNetUtilityTable.Finalize != NULL) {\r
-    This->NtNetUtilityTable.Finalize ();\r
-  }\r
-\r
-  This->WinNtThunk->FreeLibrary (This->NetworkLibraryHandle);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  This is the declaration of an EFI image entry point. This entry point is\r
-  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
-  both device drivers and bus drivers.\r
-\r
-  @param  ImageHandle           The firmware allocated handle for the UEFI image.\r
-  @param  SystemTable           A pointer to the EFI System Table.\r
-\r
-  @retval EFI_SUCCESS           The operation completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
-\r
-**/\r
-EFI_STATUS\r
-InitializeSnpNt32Driver (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-{\r
-\r
-  EFI_STATUS  Status;\r
-\r
-  //\r
-  // Install the Driver Protocols\r
-  //\r
-\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gSnpNt32DriverBinding,\r
-             ImageHandle,\r
-             &gSnpNt32DriverComponentName,\r
-             &gSnpNt32DriverComponentName2\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  //  Initialize the global data\r
-  //\r
-  Status = SnpNt32InitializeGlobalData (&gSnpNt32GlobalData);\r
-  if (EFI_ERROR (Status)) {\r
-    SnpNt32Unload (ImageHandle);\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
deleted file mode 100644 (file)
index 9939c6b..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  SnpNt32.h\r
-\r
-Abstract:\r
-\r
--**/\r
-\r
-#ifndef _SNP_NT32_H_\r
-#define _SNP_NT32_H_\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Protocol/SimpleNetwork.h>\r
-#include <Protocol/DevicePath.h>\r
-#include <Protocol/WinNtThunk.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/NetLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-typedef struct _SNPNT32_GLOBAL_DATA  SNPNT32_GLOBAL_DATA;\r
-typedef struct _SNPNT32_INSTANCE_DATA SNPNT32_INSTANCE_DATA;\r
-\r
-#define NETWORK_LIBRARY_NAME_U          L"SnpNt32Io.dll"\r
-\r
-#define NETWORK_LIBRARY_INITIALIZE      "SnpInitialize"\r
-#define NETWORK_LIBRARY_FINALIZE        "SnpFinalize"\r
-#define NETWORK_LIBRARY_SET_RCV_FILTER  "SnpSetReceiveFilter"\r
-#define NETWORK_LIBRARY_RECEIVE         "SnpReceive"\r
-#define NETWORK_LIBRARY_TRANSMIT        "SnpTransmit"\r
-\r
-#pragma pack(1)\r
-typedef struct _NT_NET_INTERFACE_INFO {\r
-  UINT32          InterfaceIndex;\r
-  EFI_MAC_ADDRESS MacAddr;\r
-} NT_NET_INTERFACE_INFO;\r
-#pragma pack()\r
-\r
-#define NET_ETHER_HEADER_SIZE     14\r
-\r
-#define MAX_INTERFACE_INFO_NUMBER 16\r
-#define MAX_FILE_NAME_LENGTH      280\r
-\r
-#define SNP_MAX_TX_BUFFER_NUM         65536\r
-#define SNP_TX_BUFFER_INCREASEMENT    32\r
-\r
-\r
-\r
-\r
-//\r
-//  Functions in Net Library\r
-//\r
-typedef\r
-INT32\r
-(*NT_NET_INITIALIZE) (\r
-  IN OUT  UINT32                *InterfaceCount,\r
-  IN OUT  NT_NET_INTERFACE_INFO * InterfaceInfoBuffer\r
-  );\r
-\r
-typedef\r
-INT32\r
-(*NT_NET_FINALIZE) (\r
-  VOID\r
-  );\r
-\r
-typedef\r
-INT32\r
-(*NT_NET_SET_RECEIVE_FILTER) (\r
-  IN  UINT32                        Index,\r
-  IN  UINT32                        EnableFilter,\r
-  IN  UINT32                        MCastFilterCnt,\r
-  IN  EFI_MAC_ADDRESS               * MCastFilter\r
-  );\r
-\r
-typedef\r
-INT32\r
-(*NT_NET_RECEIVE) (\r
-  IN      UINT32                        Index,\r
-  IN OUT  UINT32                        *BufferSize,\r
-  OUT     VOID                          *Buffer\r
-  );\r
-\r
-typedef\r
-INT32\r
-(*NT_NET_TRANSMIT) (\r
-  IN  UINT32                        Index,\r
-  IN  UINT32                        HeaderSize,\r
-  IN  UINT32                        BufferSize,\r
-  IN  VOID                          *Buffer,\r
-  IN  EFI_MAC_ADDRESS               * SrcAddr,\r
-  IN  EFI_MAC_ADDRESS               * DestAddr,\r
-  IN  UINT16                        *Protocol\r
-  );\r
-\r
-typedef struct _NT_NET_UTILITY_TABLE {\r
-  NT_NET_INITIALIZE         Initialize;\r
-  NT_NET_FINALIZE           Finalize;\r
-  NT_NET_SET_RECEIVE_FILTER SetReceiveFilter;\r
-  NT_NET_RECEIVE            Receive;\r
-  NT_NET_TRANSMIT           Transmit;\r
-} NT_NET_UTILITY_TABLE;\r
-\r
-//\r
-//  Private functions\r
-//\r
-typedef\r
-EFI_STATUS\r
-(*SNPNT32_INITIALIZE_GLOBAL_DATA) (\r
-  IN SNPNT32_GLOBAL_DATA * This\r
-  );\r
-\r
-typedef\r
-EFI_STATUS\r
-(*SNPNT32_INITIALIZE_INSTANCE_DATA) (\r
-  IN SNPNT32_GLOBAL_DATA    * This,\r
-  IN SNPNT32_INSTANCE_DATA  * Instance\r
-  );\r
-\r
-typedef\r
-EFI_STATUS\r
-(*SNPNT32_CLOSE_INSTANCE) (\r
-  IN SNPNT32_GLOBAL_DATA    * This,\r
-  IN SNPNT32_INSTANCE_DATA  * Instance\r
-  );\r
-\r
-//\r
-//  Global data for this driver\r
-//\r
-#define SNP_NT32_DRIVER_SIGNATURE SIGNATURE_32 ('W', 'S', 'N', 'P')\r
-\r
-struct _SNPNT32_GLOBAL_DATA {\r
-  UINT32                            Signature;\r
-\r
-  //\r
-  //  List for all the fake SNP instance\r
-  //\r
-  LIST_ENTRY                        InstanceList;\r
-\r
-  EFI_WIN_NT_THUNK_PROTOCOL         *WinNtThunk;\r
-  HMODULE                           NetworkLibraryHandle;\r
-\r
-  NT_NET_UTILITY_TABLE              NtNetUtilityTable;\r
-\r
-  EFI_LOCK                          Lock;\r
-\r
-  //\r
-  //  Private functions\r
-  //\r
-  SNPNT32_INITIALIZE_GLOBAL_DATA    InitializeGlobalData;\r
-  SNPNT32_INITIALIZE_INSTANCE_DATA  InitializeInstanceData;\r
-  SNPNT32_CLOSE_INSTANCE            CloseInstance;\r
-};\r
-\r
-//\r
-//  Instance data for each fake SNP instance\r
-//\r
-#define SNP_NT32_INSTANCE_SIGNATURE SIGNATURE_32 ('w', 'S', 'N', 'P')\r
-\r
-struct _SNPNT32_INSTANCE_DATA {\r
-  UINT32                      Signature;\r
-\r
-  //\r
-  //  List entry use for linking with other instance\r
-  //\r
-  LIST_ENTRY                  Entry;\r
-\r
-  //\r
-  // Array of the recycled transmit buffer address.\r
-  //\r
-  UINT64                      *RecycledTxBuf;\r
-\r
-  //\r
-  // Current number of recycled buffer pointers in RecycledTxBuf.\r
-  //\r
-  UINT32                      RecycledTxBufCount;\r
-\r
-  //\r
-  // The maximum number of recycled buffer pointers in RecycledTxBuf.\r
-  //\r
-  UINT32                      MaxRecycledTxBuf;\r
-\r
-  SNPNT32_GLOBAL_DATA         *GlobalData;\r
-\r
-  EFI_HANDLE                  DeviceHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL    *DevicePath;\r
-\r
-  EFI_SIMPLE_NETWORK_PROTOCOL Snp;\r
-  EFI_SIMPLE_NETWORK_MODE     Mode;\r
-\r
-  NT_NET_INTERFACE_INFO       InterfaceInfo;\r
-\r
-  //\r
-  //  Private functions\r
-  //\r
-};\r
-\r
-#define SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS(a) \\r
-  CR ( \\r
-  a, \\r
-  SNPNT32_INSTANCE_DATA, \\r
-  Snp, \\r
-  SNP_NT32_INSTANCE_SIGNATURE \\r
-  )\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL    gSnpNt32DriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL    gSnpNt32DriverComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL   gSnpNt32DriverComponentName2;\r
-\r
-/**\r
-  Test to see if this driver supports ControllerHandle. This service\r
-  is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
-\r
-  @param  This                Protocol instance pointer.\r
-  @param  ControllerHandle    Handle of device to test\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
-                              device to start.\r
-\r
-  @retval EFI_SUCCESS         This driver supports this device\r
-  @retval EFI_UNSUPPORTED     This driver does not support this device\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  );\r
-\r
-/**\r
-  Start this driver on ControllerHandle. This service is called by the\r
-  EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ControllerHandle     Handle of device to bind driver to\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
-                               device to start.\r
-\r
-  @retval EFI_SUCCESS          Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  );\r
-\r
-/**\r
-  Stop this driver on ControllerHandle. This service is called by the\r
-  EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
-  \r
-  @param  This              Protocol instance pointer.\r
-  @param  ControllerHandle  Handle of device to stop driver on\r
-  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
-                            children is zero stop the entire bus driver.\r
-  @param  ChildHandleBuffer List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCESS       Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SnpNt32DriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  );\r
-\r
-/**\r
-  Initialize the driver's global data.\r
-\r
-  @param  This                  Pointer to the global context data.\r
-\r
-  @retval EFI_SUCCESS           The global data is initialized.\r
-  @retval EFI_NOT_FOUND         The required DLL is not found.\r
-  @retval EFI_DEVICE_ERROR      Error initialize network utility library.\r
-  @retval EFI_OUT_OF_RESOURCES  Out of resource.\r
-  @retval other                 Other errors.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32InitializeGlobalData (\r
-  IN OUT SNPNT32_GLOBAL_DATA *This\r
-  );\r
-\r
-/**\r
-  Initialize the snpnt32 driver instance.\r
-\r
-  @param  This                  Pointer to the SnpNt32 global data.\r
-  @param  Instance              Pointer to the instance context data.\r
-\r
-  @retval EFI_SUCCESS           The driver instance is initialized.\r
-  @retval other                 Initialization errors.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32InitializeInstanceData (\r
-  IN SNPNT32_GLOBAL_DATA        *This,\r
-  IN OUT SNPNT32_INSTANCE_DATA  *Instance\r
-  );\r
-\r
-/**\r
-  Close the SnpNt32 driver instance.\r
-\r
-  @param  This                  Pointer to the SnpNt32 global data.\r
-  @param  Instance              Pointer to the instance context data.\r
-\r
-  @retval EFI_SUCCESS           The instance is closed.\r
-\r
-**/\r
-EFI_STATUS\r
-SnpNt32CloseInstance (\r
-  IN SNPNT32_GLOBAL_DATA        *This,\r
-  IN OUT SNPNT32_INSTANCE_DATA  *Instance\r
-  );\r
-\r
-#endif\r
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf b/Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
deleted file mode 100644 (file)
index 38758b1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file\r
-# Component name for module SnpNt32Dxe\r
-#\r
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = SnpNt32Dxe\r
-  FILE_GUID                      = D0893F05-B06D-4161-B947-9BE9B85AC3A1\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeSnpNt32Driver\r
-  UNLOAD_IMAGE                   = SnpNt32Unload\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  SnpNt32.h\r
-  SnpNt32.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  UefiDriverEntryPoint\r
-  NetLib\r
-\r
-[Protocols]\r
-  gEfiSimpleNetworkProtocolGuid                 # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiWinNtThunkProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
diff --git a/Nt32Pkg/StallPei/Stall.c b/Nt32Pkg/StallPei/Stall.c
deleted file mode 100644 (file)
index 69b99cc..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/**@file\r
-  EFI_PEI_STALL implementation for NT32 simulation environment.\r
-  \r
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-#include "WinNtPeim.h"\r
-\r
-#include <Ppi/NtThunk.h>\r
-#include <Ppi/Stall.h>\r
-#include <Library/DebugLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI \r
-Stall (\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
-  IN CONST EFI_PEI_STALL_PPI    *This,\r
-  IN UINTN                      Microseconds\r
-  );\r
-  \r
-EFI_PEI_STALL_PPI mStallPpi = {1000, Stall};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListStall[1] = {\r
-  {\r
-    (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-    &gEfiPeiStallPpiGuid,\r
-    &mStallPpi\r
-  }\r
-};\r
-\r
-\r
-/**\r
-  PEIM's entry point.\r
-  \r
-  This routine installs the simulation instance of EFI_PEI_STALL_PPI based\r
-  on Win API Sleep().\r
-  \r
-  @param  FileHandle  Handle of the file being invoked. \r
-  @param  PeiServices Describes the list of possible PEI Services.\r
-\r
-  @retval  EFI_SUCCESS   The PEIM executed normally.\r
-  @retval  !EFI_SUCCESS  The PEIM failed to execute normally.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeStall (\r
-  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  Status = (*PeiServices)->InstallPpi (PeiServices, &mPpiListStall[0]);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  The Stall() function provides a blocking stall for at least the number \r
-  of microseconds stipulated in the final argument of the API.\r
-\r
-  @param  PeiServices    An indirect pointer to the PEI Services Table\r
-                         published by the PEI Foundation.\r
-  @param  This           Pointer to the local data for the interface.\r
-  @param  Microseconds   Number of microseconds for which to stall.\r
-\r
-  @retval EFI_SUCCESS    The service provided at least the required delay.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI \r
-Stall (\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
-  IN CONST EFI_PEI_STALL_PPI    *This,\r
-  IN UINTN                      Microseconds\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  PEI_NT_THUNK_PPI          *PeiNtService;\r
-  EFI_WIN_NT_THUNK_PROTOCOL *NtThunk;\r
-  \r
-  Status = (**PeiServices).LocatePpi (\r
-                            (const EFI_PEI_SERVICES **)PeiServices,\r
-                            &gPeiNtThunkPpiGuid,\r
-                            0,                  \r
-                            NULL,\r
-                            (VOID**)&PeiNtService\r
-                            );\r
-  ASSERT_EFI_ERROR (Status);\r
-    \r
-  //\r
-  // Calculate the time to sleep.  Win API smallest unit to sleep is 1 millisec\r
-  // so micro second units need be divided by 1000 to convert to ms\r
-  //\r
-  NtThunk = (EFI_WIN_NT_THUNK_PROTOCOL*) PeiNtService->NtThunk();\r
-  NtThunk->Sleep ((DWORD)((Microseconds + 999) / 1000)); \r
-  \r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/StallPei/StallPei.inf b/Nt32Pkg/StallPei/StallPei.inf
deleted file mode 100644 (file)
index 7fb083d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file\r
-# EFI_PEI_STALL implementation for NT32 simulation environment.\r
-#\r
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Stall\r
-  FILE_GUID                      = 6807217E-E8DE-42d0-91D9-60AECED7420D\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeStall\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  Stall.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-[Ppis]\r
-  gEfiPeiStallPpiGuid                           ## PRODUCES\r
-  gPeiNtThunkPpiGuid                            ## CONSUMES\r
-  \r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/Nt32Pkg/TimerDxe/Timer.c b/Nt32Pkg/TimerDxe/Timer.c
deleted file mode 100644 (file)
index f3e1e32..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  Timer.c\r
-\r
-Abstract:\r
-\r
-  NT Emulation Timer Architectural Protocol Driver as defined in DXE CIS\r
-\r
-  This Timer module uses an NT Thread to simulate the timer-tick driven\r
-  timer service.  In the future, the Thread creation should possibly be \r
-  abstracted by the CPU architectural protocol\r
-\r
-**/\r
-\r
-#include "Timer.h"\r
-\r
-//\r
-// Pointer to the CPU Architectural Protocol instance\r
-//\r
-EFI_CPU_ARCH_PROTOCOL   *mCpu;\r
-\r
-//\r
-// The Timer Architectural Protocol that this driver produces\r
-//\r
-EFI_TIMER_ARCH_PROTOCOL mTimer = {\r
-  WinNtTimerDriverRegisterHandler,\r
-  WinNtTimerDriverSetTimerPeriod,\r
-  WinNtTimerDriverGetTimerPeriod,\r
-  WinNtTimerDriverGenerateSoftInterrupt\r
-};\r
-\r
-//\r
-// Define a global that we can use to shut down the NT timer thread when\r
-// the timer is canceled.\r
-//\r
-BOOLEAN                 mCancelTimerThread = FALSE;\r
-\r
-//\r
-// The notification function to call on every timer interrupt\r
-//\r
-EFI_TIMER_NOTIFY        mTimerNotifyFunction = NULL;\r
-\r
-//\r
-// The current period of the timer interrupt\r
-//\r
-UINT64                  mTimerPeriod;\r
-\r
-//\r
-// The thread handle for this driver\r
-//\r
-HANDLE                  mNtMainThreadHandle;\r
-\r
-//\r
-// The timer value from the last timer interrupt\r
-//\r
-UINT32                  mNtLastTick;\r
-\r
-//\r
-// Critical section used to update varibles shared between the main thread and\r
-// the timer interrupt thread.\r
-//\r
-CRITICAL_SECTION        mNtCriticalSection;\r
-\r
-//\r
-// Worker Functions\r
-//\r
-UINT                    mMMTimerThreadID = 0;\r
-\r
-VOID\r
-CALLBACK\r
-MMTimerThread (\r
-  UINT  wTimerID,\r
-  UINT  msg,\r
-  DWORD dwUser,\r
-  DWORD dw1,\r
-  DWORD dw2\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  wTimerID  - TODO: add argument description\r
-  msg       - TODO: add argument description\r
-  dwUser    - TODO: add argument description\r
-  dw1       - TODO: add argument description\r
-  dw2       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_TPL           OriginalTPL;\r
-  UINT32            CurrentTick;\r
-  UINT32            Delta;\r
-  EFI_TIMER_NOTIFY  CallbackFunction;\r
-  BOOLEAN           InterruptState;\r
-\r
-  if (!mCancelTimerThread) {\r
-  \r
-    //\r
-    // Suspend the main thread until we are done.\r
-    // Enter the critical section before suspending\r
-    // and leave the critical section after resuming\r
-    // to avoid deadlock between main and timer thread.\r
-    //\r
-    gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-    gWinNt->SuspendThread (mNtMainThreadHandle);\r
-\r
-    //\r
-    // If the timer thread is being canceled, then bail immediately.\r
-    // We check again here because there's a small window of time from when\r
-    // this thread was kicked off and when we suspended the main thread above.\r
-    //\r
-    if (mCancelTimerThread) {\r
-      gWinNt->ResumeThread (mNtMainThreadHandle);\r
-      gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-      gWinNt->timeKillEvent (wTimerID);\r
-      mMMTimerThreadID = 0;\r
-      return ;\r
-    }\r
-\r
-    mCpu->GetInterruptState (mCpu, &InterruptState);\r
-    while (!InterruptState) {\r
-      //\r
-      //  Resume the main thread\r
-      //\r
-      gWinNt->ResumeThread (mNtMainThreadHandle);\r
-      gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-      //\r
-      //  Wait for interrupts to be enabled.\r
-      //\r
-      mCpu->GetInterruptState (mCpu, &InterruptState);\r
-      while (!InterruptState) {\r
-        gWinNt->Sleep (1);\r
-        mCpu->GetInterruptState (mCpu, &InterruptState);\r
-      }\r
-       \r
-      //\r
-      //  Suspend the main thread until we are done\r
-      //\r
-      gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-      gWinNt->SuspendThread (mNtMainThreadHandle);\r
-      mCpu->GetInterruptState (mCpu, &InterruptState);\r
-    }\r
-\r
-    //\r
-    //  Get the current system tick\r
-    //\r
-    CurrentTick = gWinNt->GetTickCount ();\r
-    Delta       = CurrentTick - mNtLastTick;\r
-    mNtLastTick = CurrentTick;\r
-\r
-    //\r
-    //  If delay was more then 1 second, ignore it (probably debugging case)\r
-    //\r
-    if (Delta < 1000) {\r
-\r
-      OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
-\r
-      //\r
-      //  Inform the firmware of an "timer interrupt".  The time\r
-      //  expired since the last call is 10,000 times the number\r
-      //  of ms.  (or 100ns units)\r
-      //\r
-      CallbackFunction = mTimerNotifyFunction;\r
-\r
-      //\r
-      // Only invoke the callback function if a Non-NULL handler has been\r
-      // registered. Assume all other handlers are legal.\r
-      //\r
-      if (CallbackFunction != NULL) {\r
-        CallbackFunction ((UINT64) (Delta * 10000));\r
-      }\r
-\r
-      gBS->RestoreTPL (OriginalTPL);\r
-\r
-    }\r
-\r
-    //\r
-    //  Resume the main thread\r
-    //\r
-    gWinNt->ResumeThread (mNtMainThreadHandle);\r
-    gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-  } else {\r
-    gWinNt->timeKillEvent (wTimerID);\r
-    mMMTimerThreadID = 0;\r
-  }\r
-\r
-}\r
-\r
-UINT\r
-CreateNtTimer (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-   It is used to emulate a platform \r
-  timer-driver interrupt handler.  \r
-\r
-Returns:\r
-\r
-  Timer ID\r
-\r
---*/\r
-// TODO: function comment is missing 'Arguments:'\r
-{\r
-  UINT32  SleepCount;\r
-\r
-  //\r
-  //  Set our thread priority higher than the "main" thread.\r
-  //\r
-  gWinNt->SetThreadPriority (\r
-            gWinNt->GetCurrentThread (),\r
-            THREAD_PRIORITY_HIGHEST\r
-            );\r
-\r
-  //\r
-  //  Calc the appropriate interval\r
-  //\r
-  gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-  SleepCount = (UINT32) (mTimerPeriod + 5000) / 10000;\r
-  gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-  return gWinNt->timeSetEvent (\r
-                  SleepCount,\r
-                  0,\r
-                  MMTimerThread,\r
-                  (DWORD_PTR) NULL,\r
-                  TIME_PERIODIC | TIME_KILL_SYNCHRONOUS | TIME_CALLBACK_FUNCTION\r
-                  );\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL           *This,\r
-  IN EFI_TIMER_NOTIFY                  NotifyFunction\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function registers the handler NotifyFunction so it is called every time \r
-  the timer interrupt fires.  It also passes the amount of time since the last \r
-  handler call to the NotifyFunction.  If NotifyFunction is NULL, then the \r
-  handler is unregistered.  If the handler is registered, then EFI_SUCCESS is \r
-  returned.  If the CPU does not support registering a timer interrupt handler, \r
-  then EFI_UNSUPPORTED is returned.  If an attempt is made to register a handler \r
-  when a handler is already registered, then EFI_ALREADY_STARTED is returned.  \r
-  If an attempt is made to unregister a handler when a handler is not registered, \r
-  then EFI_INVALID_PARAMETER is returned.  If an error occurs attempting to \r
-  register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
-  is returned.\r
-\r
-Arguments:\r
-\r
-  This           - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  NotifyFunction - The function to call when a timer interrupt fires.  This \r
-                   function executes at TPL_HIGH_LEVEL.  The DXE Core will \r
-                   register a handler for the timer interrupt, so it can know \r
-                   how much time has passed.  This information is used to \r
-                   signal timer based events.  NULL will unregister the handler.\r
-\r
-Returns: \r
-\r
-  EFI_SUCCESS           - The timer handler was registered.\r
-\r
-  EFI_UNSUPPORTED       - The platform does not support timer interrupts.\r
-\r
-  EFI_ALREADY_STARTED   - NotifyFunction is not NULL, and a handler is already \r
-                          registered.\r
-\r
-  EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not \r
-                          previously registered.\r
-\r
-  EFI_DEVICE_ERROR      - The timer handler could not be registered.\r
-\r
---*/\r
-{\r
-  //\r
-  // Check for invalid parameters\r
-  //\r
-  if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  //\r
-  // Use Critical Section to update the notification function that is\r
-  // used from the timer interrupt thread.\r
-  //\r
-  gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-\r
-  mTimerNotifyFunction = NotifyFunction;\r
-\r
-  gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverSetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                   TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function adjusts the period of timer interrupts to the value specified \r
-  by TimerPeriod.  If the timer period is updated, then the selected timer \r
-  period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned.  If \r
-  the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.  \r
-  If an error occurs while attempting to update the timer period, then the \r
-  timer hardware will be put back in its state prior to this call, and \r
-  EFI_DEVICE_ERROR is returned.  If TimerPeriod is 0, then the timer interrupt \r
-  is disabled.  This is not the same as disabling the CPU's interrupts.  \r
-  Instead, it must either turn off the timer hardware, or it must adjust the \r
-  interrupt controller so that a CPU interrupt is not generated when the timer \r
-  interrupt fires. \r
-\r
-Arguments:\r
-\r
-  This        - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  TimerPeriod - The rate to program the timer interrupt in 100 nS units.  If \r
-                the timer hardware is not programmable, then EFI_UNSUPPORTED is \r
-                returned.  If the timer is programmable, then the timer period \r
-                will be rounded up to the nearest timer period that is supported \r
-                by the timer hardware.  If TimerPeriod is set to 0, then the \r
-                timer interrupts will be disabled.\r
-\r
-Returns: \r
-\r
-  EFI_SUCCESS      - The timer period was changed.\r
-\r
-  EFI_UNSUPPORTED  - The platform cannot change the period of the timer interrupt.\r
-\r
-  EFI_DEVICE_ERROR - The timer period could not be changed due to a device error.\r
-\r
---*/\r
-{\r
-\r
-  //\r
-  // If TimerPeriod is 0, then the timer thread should be canceled\r
-  //\r
-  if (TimerPeriod == 0) {\r
-    //\r
-    // Cancel the timer thread\r
-    //\r
-    gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-\r
-    mCancelTimerThread = TRUE;\r
-\r
-    gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-    //\r
-    // Wait for the timer thread to exit\r
-    //\r
-\r
-    if (mMMTimerThreadID) {\r
-      gWinNt->timeKillEvent (mMMTimerThreadID);\r
-    }\r
-\r
-    mMMTimerThreadID = 0;\r
-\r
-    //\r
-    // Update the timer period\r
-    //\r
-    gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-\r
-    mTimerPeriod = TimerPeriod;\r
-\r
-    gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-    //\r
-    // NULL out the thread handle so it will be re-created if the timer is enabled again\r
-    //\r
-\r
-  } else if ((TimerPeriod > TIMER_MINIMUM_VALUE) && (TimerPeriod < TIMER_MAXIMUM_VALUE)) {\r
-    //\r
-    // If the TimerPeriod is valid, then create and/or adjust the period of the timer thread\r
-    //\r
-    gWinNt->EnterCriticalSection (&mNtCriticalSection);\r
-\r
-    mTimerPeriod        = TimerPeriod;\r
-\r
-    mCancelTimerThread  = FALSE;\r
-\r
-    gWinNt->LeaveCriticalSection (&mNtCriticalSection);\r
-\r
-    //\r
-    //  Get the starting tick location if we are just starting the timer thread\r
-    //\r
-    mNtLastTick = gWinNt->GetTickCount ();\r
-\r
-    if (mMMTimerThreadID) {\r
-      gWinNt->timeKillEvent (mMMTimerThreadID);\r
-    }\r
-\r
-    mMMTimerThreadID  = 0;\r
-\r
-    mMMTimerThreadID  = CreateNtTimer ();\r
-\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL            *This,\r
-  OUT UINT64                            *TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function retrieves the period of timer interrupts in 100 ns units, \r
-  returns that value in TimerPeriod, and returns EFI_SUCCESS.  If TimerPeriod \r
-  is NULL, then EFI_INVALID_PARAMETER is returned.  If a TimerPeriod of 0 is \r
-  returned, then the timer is currently disabled.\r
-\r
-Arguments:\r
-\r
-  This        - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  TimerPeriod - A pointer to the timer period to retrieve in 100 ns units.  If \r
-                0 is returned, then the timer is currently disabled.\r
-\r
-Returns: \r
-\r
-  EFI_SUCCESS           - The timer period was returned in TimerPeriod.\r
-\r
-  EFI_INVALID_PARAMETER - TimerPeriod is NULL.\r
-\r
---*/\r
-{\r
-  if (TimerPeriod == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *TimerPeriod = mTimerPeriod;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverGenerateSoftInterrupt (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function generates a soft timer interrupt. If the platform does not support soft \r
-  timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
-  If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
-  service, then a soft timer interrupt will be generated. If the timer interrupt is \r
-  enabled when this service is called, then the registered handler will be invoked. The \r
-  registered handler should not be able to distinguish a hardware-generated timer \r
-  interrupt from a software-generated timer interrupt.\r
-\r
-Arguments:\r
-\r
-  This  -  The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-Returns: \r
-\r
-  EFI_SUCCESS       - The soft timer interrupt was generated.\r
-\r
-  EFI_UNSUPPORTED   - The platform does not support the generation of soft timer interrupts.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Timer Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Timer Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-  \r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       Result;\r
-  EFI_HANDLE  Handle;\r
-  EFI_HANDLE  hSourceProcessHandle;\r
-  EFI_HANDLE  hSourceHandle;\r
-  EFI_HANDLE  hTargetProcessHandle;\r
-  //\r
-  // Make sure the Timer Architectural Protocol is not already installed in the system\r
-  //\r
-  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiTimerArchProtocolGuid);\r
-\r
-  //\r
-  // Get the CPU Architectural Protocol instance\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&mCpu);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  //  Get our handle so the timer tick thread can suspend\r
-  //\r
-  hSourceProcessHandle = gWinNt->GetCurrentProcess ();\r
-  hSourceHandle        = gWinNt->GetCurrentThread ();\r
-  hTargetProcessHandle = gWinNt->GetCurrentProcess ();\r
-  Result = gWinNt->DuplicateHandle (\r
-                    hSourceProcessHandle,\r
-                    hSourceHandle,\r
-                    hTargetProcessHandle,\r
-                    &mNtMainThreadHandle,\r
-                    0,\r
-                    FALSE,\r
-                    DUPLICATE_SAME_ACCESS\r
-                    );\r
-  if (Result == 0) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Initialize Critical Section used to update variables shared between the main\r
-  // thread and the timer interrupt thread.\r
-  //\r
-  gWinNt->InitializeCriticalSection (&mNtCriticalSection);\r
-\r
-  //\r
-  // Start the timer thread at the default timer period\r
-  //\r
-  Status = mTimer.SetTimerPeriod (&mTimer, DEFAULT_TIMER_TICK_DURATION);\r
-  if (EFI_ERROR (Status)) {\r
-    gWinNt->DeleteCriticalSection (&mNtCriticalSection);\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Install the Timer Architectural Protocol onto a new handle\r
-  //\r
-  Handle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  &gEfiTimerArchProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mTimer\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // Cancel the timer\r
-    //\r
-    mTimer.SetTimerPeriod (&mTimer, 0);\r
-    gWinNt->DeleteCriticalSection (&mNtCriticalSection);\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/TimerDxe/Timer.h b/Nt32Pkg/TimerDxe/Timer.h
deleted file mode 100644 (file)
index 71af119..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  Timer.h\r
-\r
-Abstract:\r
-\r
-  NT Emulation Architectural Protocol Driver as defined in Tiano.\r
-  This Timer module uses an NT Thread to simulate the timer-tick driven\r
-  timer service.\r
-\r
-**/\r
-\r
-#ifndef _TIMER_H_\r
-#define _TIMER_H_\r
-\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/Timer.h>\r
-#include <Protocol/Cpu.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-\r
-//\r
-// Legal timer value range in 100 ns units\r
-//\r
-#define TIMER_MINIMUM_VALUE 0\r
-#define TIMER_MAXIMUM_VALUE (0x100000000 - 1)\r
-\r
-//\r
-// Default timer value in 100 ns units (10 ms)\r
-//\r
-#define DEFAULT_TIMER_TICK_DURATION 100000\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN EFI_TIMER_NOTIFY         NotifyFunction\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This            - TODO: add argument description\r
-  NotifyFunction  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverSetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                   TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TimerPeriod - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL   *This,\r
-  OUT UINT64                   *TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TimerPeriod - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtTimerDriverGenerateSoftInterrupt (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/TimerDxe/TimerDxe.inf b/Nt32Pkg/TimerDxe/TimerDxe.inf
deleted file mode 100644 (file)
index 9c5aaa1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file\r
-# NT Emulation Timer Architectural Protocol Driver as defined in DXE CIS\r
-#\r
-# This Timer module uses an NT Thread to simulate the timer-tick driven\r
-#  timer service. In the future, the Thread creation should possibly be\r
-#  abstracted by the CPU architectural protocol\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Timer\r
-  FILE_GUID                      = C3811036-710B-4E39-8CF1-0AF9BE3A8198\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = WinNtTimerDriverInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  Timer.c\r
-  Timer.h\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  WinNtLib\r
-  UefiDriverEntryPoint\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiCpuArchProtocolGuid                       # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiTimerArchProtocolGuid                     # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[Depex]\r
-  gEfiCpuArchProtocolGuid\r
-  
\ No newline at end of file
diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c
deleted file mode 100644 (file)
index cd3777a..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  WinNtAutoscan.c\r
-\r
-Abstract:\r
-  This PEIM to abstract memory auto-scan in a Windows NT environment.\r
-\r
-Revision History\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-#include <WinNtPeim.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/NtAutoscan.h>\r
-#include <Ppi/ReadOnlyVariable2.h>\r
-\r
-#include <Guid/MemoryTypeInformation.h>\r
-\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
-  { EfiReservedMemoryType,  0x0004 },\r
-  { EfiRuntimeServicesCode, 0x0040 },\r
-  { EfiRuntimeServicesData, 0x0040 },\r
-  { EfiBootServicesCode,    0x0300 },\r
-  { EfiBootServicesData,    0x1000 },\r
-  { EfiMaxMemoryType,       0      }\r
-};\r
-\r
-/**\r
-   Validate variable data for the MemoryTypeInformation. \r
-\r
-   @param MemoryData       Variable data.\r
-   @param MemoryDataSize   Variable data length.\r
-   \r
-   @return TRUE            The variable data is valid.\r
-   @return FALSE           The variable data is invalid.\r
-\r
-**/\r
-BOOLEAN\r
-ValidateMemoryTypeInfoVariable (\r
-  IN EFI_MEMORY_TYPE_INFORMATION      *MemoryData,\r
-  IN UINTN                            MemoryDataSize\r
-  )\r
-{\r
-  UINTN                       Count;\r
-  UINTN                       Index;\r
-\r
-  // Check the input parameter.\r
-  if (MemoryData == NULL) {\r
-    return FALSE;\r
-  }\r
-\r
-  // Get Count\r
-  Count = MemoryDataSize / sizeof (*MemoryData);\r
-\r
-  // Check Size\r
-  if (Count * sizeof(*MemoryData) != MemoryDataSize) {\r
-    return FALSE;\r
-  }\r
-\r
-  // Check last entry type filed.\r
-  if (MemoryData[Count - 1].Type != EfiMaxMemoryType) {\r
-    return FALSE;\r
-  }\r
-\r
-  // Check the type filed.\r
-  for (Index = 0; Index < Count - 1; Index++) {\r
-    if (MemoryData[Index].Type >= EfiMaxMemoryType) {\r
-      return FALSE;\r
-    }\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeWinNtAutoScan (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Perform a call-back into the SEC simulator to get a memory value\r
-\r
-Arguments:\r
-  FfsHeader   - General purpose data available to every PEIM\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
-  PEI_NT_AUTOSCAN_PPI         *PeiNtService;\r
-  UINT64                      MemorySize;\r
-  EFI_PHYSICAL_ADDRESS        MemoryBase;\r
-  UINTN                       Index;\r
-  EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
-  EFI_PEI_READ_ONLY_VARIABLE2_PPI       *Variable;\r
-  UINTN                                 DataSize;\r
-  EFI_MEMORY_TYPE_INFORMATION           MemoryData [EfiMaxMemoryType + 1];\r
-\r
-\r
-  DEBUG ((EFI_D_ERROR, "NT 32 Autoscan PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the PEI NT Autoscan PPI\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-             &gPeiNtAutoScanPpiGuid, // GUID\r
-             0,                      // INSTANCE\r
-             &PpiDescriptor,         // EFI_PEI_PPI_DESCRIPTOR\r
-             (VOID**)&PeiNtService           // PPI\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Index = 0;\r
-  do {\r
-    Status = PeiNtService->NtAutoScan (Index, &MemoryBase, &MemorySize);\r
-    if (!EFI_ERROR (Status)) {\r
-      Attributes =\r
-        (\r
-          EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
-          EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
-          EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE\r
-        );\r
-\r
-      if (Index == 0) {\r
-        //\r
-        // Register the memory with the PEI Core\r
-        //\r
-        Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
-        ASSERT_EFI_ERROR (Status);\r
-\r
-        Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED;\r
-      }\r
-      \r
-      BuildResourceDescriptorHob (\r
-        EFI_RESOURCE_SYSTEM_MEMORY,\r
-        Attributes,\r
-        MemoryBase,\r
-        MemorySize\r
-        );\r
-    }\r
-    Index++;\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  //\r
-  // Build the CPU hob with 52-bit addressing and 16-bits of IO space.\r
-  //\r
-  BuildCpuHob (52, 16);\r
-\r
-  //\r
-  // Build GUIDed Hob that contains the Memory Type Information array\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-             &gEfiPeiReadOnlyVariable2PpiGuid,\r
-             0,\r
-             NULL,\r
-             (VOID **)&Variable\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  DataSize = sizeof (MemoryData);\r
-  Status = Variable->GetVariable (\r
-                       Variable,\r
-                       EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,\r
-                       &gEfiMemoryTypeInformationGuid,\r
-                       NULL,\r
-                       &DataSize,\r
-                       &MemoryData\r
-                       );\r
-  if (EFI_ERROR (Status) || !ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) {\r
-    //\r
-    // Create Memory Type Information HOB\r
-    //\r
-    BuildGuidDataHob (\r
-      &gEfiMemoryTypeInformationGuid,\r
-      mDefaultMemoryTypeInformation,\r
-      sizeof(mDefaultMemoryTypeInformation)\r
-      );\r
-  } else {\r
-    //\r
-    // Create Memory Type Information HOB\r
-    //\r
-    BuildGuidDataHob (\r
-      &gEfiMemoryTypeInformationGuid,\r
-      MemoryData,\r
-      DataSize\r
-      );\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf
deleted file mode 100644 (file)
index 30d67c0..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-## @file\r
-# Component description file for WinNtAutoScan module\r
-#\r
-# This module abstracts memory auto-scan in a Windows NT environment.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtAutoScan\r
-  FILE_GUID                      = BE0FEABA-3443-4919-9F3A-2D4216329EA9\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeWinNtAutoScan\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  WinNtAutoScan.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-  PeiServicesLib\r
-\r
-[Ppis]\r
-  gPeiNtAutoScanPpiGuid                         # PPI ALWAYS_CONSUMED\r
-  gEfiPeiReadOnlyVariable2PpiGuid               # PPI ALWAYS_CONSUMED\r
-\r
-[Guids]\r
-  gEfiMemoryTypeInformationGuid\r
-  \r
-[Depex]\r
-  gPeiNtAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid AND gEfiPeiReadOnlyVariable2PpiGuid\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/ComponentName.c b/Nt32Pkg/WinNtBlockIoDxe/ComponentName.c
deleted file mode 100644 (file)
index 5c28e32..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-\r
-#include "WinNtBlockIo.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gWinNtBlockIoComponentName = {\r
-  WinNtBlockIoComponentNameGetDriverName,\r
-  WinNtBlockIoComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtBlockIoComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtBlockIoComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtBlockIoComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtBlockIoDriverNameTable[] = {\r
-  { "eng;en", L"Windows Block I/O Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mWinNtBlockIoDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gWinNtBlockIoComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-             &gEfiWinNtIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gWinNtBlockIoComponentName)\r
-           );\r
-}\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c b/Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c
deleted file mode 100644 (file)
index 8969e5e..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  DriverConfiguration.c\r
-\r
-Abstract:\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/BlockIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-\r
-#include "WinNtBlockIo.h"\r
-\r
-//\r
-// EFI Driver Configuration Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  CHAR8                                                  *Language,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationOptionsValid (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  UINT32                                                 DefaultType,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-//\r
-// EFI Driver Configuration Protocol\r
-//\r
-EFI_DRIVER_CONFIGURATION_PROTOCOL gWinNtBlockIoDriverConfiguration = {\r
-  WinNtBlockIoDriverConfigurationSetOptions,\r
-  WinNtBlockIoDriverConfigurationOptionsValid,\r
-  WinNtBlockIoDriverConfigurationForceDefaults,\r
-  LANGUAGESUPPORTED\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  CHAR8                                                  *Language,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Allows the user to set controller specific options for a controller that a\r
-    driver is currently managing.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to set options on.\r
-    ChildHandle      - The handle of the child controller to set options on.  This\r
-                       is an optional parameter that may be NULL.  It will be NULL\r
-                       for device drivers, and for a bus drivers that wish to set\r
-                       options for the bus controller.  It will not be NULL for a\r
-                       bus driver that wishes to set options for one of its child\r
-                       controllers.\r
-    Language         - A pointer to a three character ISO 639-2 language identifier.\r
-                       This is the language of the user interface that should be\r
-                       presented to the user, and it must match one of the languages\r
-                       specified in SupportedLanguages.  The number of languages\r
-                       supported by a driver is up to the driver writer.\r
-    ActionRequired   - A pointer to the action that the calling agent is required\r
-                       to perform when this function returns.  See "Related\r
-                       Definitions" for a list of the actions that the calling\r
-                       agent is required to perform prior to accessing\r
-                       ControllerHandle again.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully set the\r
-                            configuration options for the controller specified\r
-                            by ControllerHandle..\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support setting\r
-                            configuration options for the controller specified by\r
-                            ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to set the\r
-                            configuration options for the controller specified\r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to set the\r
-                            configuration options for the controller specified\r
-                            by ControllerHandle and ChildHandle.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguage;\r
-\r
-  SupportedLanguage = This->SupportedLanguages;\r
-\r
-  Status            = EFI_UNSUPPORTED;\r
-  while (*SupportedLanguage != 0) {\r
-    if (AsciiStrnCmp (Language, SupportedLanguage, 3) == 0) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-\r
-    SupportedLanguage += 3;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationOptionsValid (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Tests to see if a controller's current configuration options are valid.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to test if it's current\r
-                       configuration options are valid.\r
-    ChildHandle      - The handle of the child controller to test if it's current\r
-                       configuration options are valid.  This is an optional\r
-                       parameter that may be NULL.  It will be NULL for device\r
-                       drivers.  It will also be NULL for a bus drivers that wish\r
-                       to test the configuration options for the bus controller.\r
-                       It will not be NULL for a bus driver that wishes to test\r
-                       configuration options for one of its child controllers.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and\r
-                            ChildHandle that is being managed by the driver\r
-                            specified by This has a valid set of  configuration\r
-                            options.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently\r
-                            managing the controller specified by ControllerHandle\r
-                            and ChildHandle.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and\r
-                            ChildHandle that is being managed by the driver\r
-                            specified by This has an invalid set of configuration\r
-                            options.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  UINT32                                                 DefaultType,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Forces a driver to set the default configuration options for a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to force default configuration options on.\r
-    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.\r
-    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.\r
-    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.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the configuration type specified by DefaultType.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c b/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c
deleted file mode 100644 (file)
index aebb744..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  DriverDiagnostics.c\r
-\r
-Abstract:\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/BlockIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-\r
-#include "WinNtBlockIo.h"\r
-\r
-//\r
-// EFI Driver Diagnostics Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  );\r
-\r
-//\r
-// EFI Driver Diagnostics Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS_PROTOCOL gWinNtBlockIoDriverDiagnostics = {\r
-  WinNtBlockIoDriverDiagnosticsRunDiagnostics,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Driver Diagnostics 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gWinNtBlockIoDriverDiagnostics2 = {\r
-  (EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) WinNtBlockIoDriverDiagnosticsRunDiagnostics,\r
-  "en"\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Runs diagnostics on a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to run diagnostics on.\r
-    ChildHandle      - The handle of the child controller to run diagnostics on\r
-                       This is an optional parameter that may be NULL.  It will\r
-                       be NULL for device drivers.  It will also be NULL for a\r
-                       bus drivers that wish to run diagnostics on the bus\r
-                       controller.  It will not be NULL for a bus driver that\r
-                       wishes to run diagnostics on one of its child controllers.\r
-    DiagnosticType   - Indicates type of diagnostics to perform on the controller\r
-                       specified by ControllerHandle and ChildHandle.   See\r
-                       "Related Definitions" for the list of supported types.\r
-    Language         - A pointer to a three character ISO 639-2 language\r
-                       identifier or a Null-terminated ASCII string array indicating\r
-                       the language.  This is the language in which the optional\r
-                       error message should be returned in Buffer, and it must\r
-                       match one of the languages specified in SupportedLanguages.\r
-                       The number of languages supported by a driver is up to\r
-                       the driver writer.\r
-    ErrorType        - A GUID that defines the format of the data returned in\r
-                       Buffer.\r
-    BufferSize       - The size, in bytes, of the data returned in Buffer.\r
-    Buffer           - A buffer that contains a Null-terminated Unicode string\r
-                       plus some additional data whose format is defined by\r
-                       ErrorType.  Buffer is allocated by this function with\r
-                       AllocatePool(), and it is the caller's responsibility\r
-                       to free it with a call to FreePool().\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and\r
-                            ChildHandle passed the diagnostic.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid\r
-                            EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ErrorType is NULL.\r
-    EFI_INVALID_PARAMETER - BufferType is NULL.\r
-    EFI_INVALID_PARAMETER - Buffer is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support\r
-                            running diagnostics for the controller specified\r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            type of diagnostic specified by DiagnosticType.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to complete\r
-                            the diagnostics.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to return\r
-                            the status information in ErrorType, BufferSize,\r
-                            and Buffer.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and\r
-                            ChildHandle did not pass the diagnostic.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguages;\r
-  BOOLEAN               Iso639Language;\r
-  BOOLEAN               Found;\r
-  UINTN                 Index;\r
-\r
-  if (Language         == NULL ||\r
-      ErrorType        == NULL ||\r
-      Buffer           == NULL ||\r
-      ControllerHandle == NULL ||\r
-      BufferSize       == NULL) {\r
-\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  SupportedLanguages = This->SupportedLanguages;\r
-  Iso639Language = (BOOLEAN)(This == &gWinNtBlockIoDriverDiagnostics);\r
-  //\r
-  // Make sure Language is in the set of Supported Languages\r
-  //\r
-  Found = FALSE;\r
-  while (*SupportedLanguages != 0) {\r
-    if (Iso639Language) {\r
-      if (CompareMem (Language, SupportedLanguages, 3) == 0) {\r
-        Found = TRUE;\r
-        break;\r
-      }\r
-      SupportedLanguages += 3;\r
-    } else {\r
-      for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);\r
-      if ((AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) && (Language[Index] == 0)) {\r
-        Found = TRUE;\r
-        break;\r
-      }\r
-      SupportedLanguages += Index;\r
-      for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);\r
-    }\r
-  }\r
-  //\r
-  // If Language is not a member of SupportedLanguages, then return EFI_UNSUPPORTED\r
-  //\r
-  if (!Found) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  *ErrorType  = NULL;\r
-  *BufferSize = 0;\r
-  if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {\r
-    *ErrorType  = &gEfiBlockIoProtocolGuid;\r
-    *BufferSize = 0x60;\r
-    *Buffer = AllocatePool ((UINTN) (*BufferSize));\r
-    CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  \r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
deleted file mode 100644 (file)
index 3eb9bee..0000000
+++ /dev/null
@@ -1,1125 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtBlockIo.c\r
-\r
-Abstract:\r
-\r
-  Produce block IO abstractions for real devices on your PC using Win32 APIs.\r
-  The configuration of what devices to mount or emulate comes from NT\r
-  environment variables. The variables must be visible to the Microsoft*\r
-  Developer Studio for them to work.\r
-\r
-  <F>ixed       - Fixed disk like a hard drive.\r
-  <R>emovable   - Removable media like a floppy or CD-ROM.\r
-  Read <O>nly   - Write protected device.\r
-  Read <W>rite  - Read write device.\r
-  <block count> - Decimal number of blocks a device supports.\r
-  <block size>  - Decimal number of bytes per block.\r
-\r
-  NT envirnonment variable contents. '<' and '>' are not part of the variable,\r
-  they are just used to make this help more readable. There should be no\r
-  spaces between the ';'. Extra spaces will break the variable. A '!' is\r
-  used to seperate multiple devices in a variable.\r
-\r
-  EFI_WIN_NT_VIRTUAL_DISKS =\r
-    <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
-  EFI_WIN_NT_PHYSICAL_DISKS =\r
-    <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
-  Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                 media device.\r
-\r
-    Thus a 20 MB emulated hard drive would look like:\r
-    EFI_WIN_NT_VIRTUAL_DISKS=FW;40960;512\r
-\r
-    A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-    EFI_WIN_NT_VIRTUAL_DISKS=RW;1440;1024\r
-\r
-  Physical Disks: These devices use NT to open a real device in your system\r
-\r
-    Thus a 120 MB floppy would look like:\r
-    EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-    Thus a standard CD-ROM floppy would look like:\r
-    EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/BlockIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include "WinNtBlockIo.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gWinNtBlockIoDriverBinding = {\r
-  WinNtBlockIoDriverBindingSupported,\r
-  WinNtBlockIoDriverBindingStart,\r
-  WinNtBlockIoDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-/**\r
-  The user Entry Point for module WinNtBlockIo. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtBlockIo(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Install driver model protocol(s).\r
-  //\r
-  Status = EfiLibInstallAllDriverProtocols2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gWinNtBlockIoDriverBinding,\r
-             ImageHandle,\r
-             &gWinNtBlockIoComponentName,\r
-             &gWinNtBlockIoComponentName2,\r
-             NULL,\r
-             NULL,\r
-             &gWinNtBlockIoDriverDiagnostics,\r
-             &gWinNtBlockIoDriverDiagnostics2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Make sure the WinNtThunkProtocol is valid\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if (WinNtIo->WinNtThunk->Signature == EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE) {\r
-\r
-    //\r
-    // Check the GUID to see if this is a handle type the driver supports\r
-    //\r
-    if (CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtVirtualDisksGuid) ||\r
-        CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtPhysicalDisksGuid) ) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiWinNtIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_WIN_NT_IO_PROTOCOL      *WinNtIo;\r
-  WIN_NT_RAW_DISK_DEVICE_TYPE DiskType;\r
-  UINT16                      Buffer[FILENAME_BUFFER_SIZE];\r
-  CHAR16                      *Str;\r
-  BOOLEAN                     RemovableMedia;\r
-  BOOLEAN                     WriteProtected;\r
-  UINTN                       NumberOfBlocks;\r
-  UINTN                       BlockSize;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Set DiskType\r
-  //\r
-  if (CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtVirtualDisksGuid)) {\r
-    DiskType = EfiWinNtVirtualDisks;\r
-  } else if (CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtPhysicalDisksGuid)) {\r
-    DiskType = EfiWinNtPhysicalDisks;\r
-  } else {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  Status  = EFI_NOT_FOUND;\r
-  Str     = WinNtIo->EnvString;\r
-  if (DiskType == EfiWinNtVirtualDisks) {\r
-    WinNtIo->WinNtThunk->SPrintf (\r
-                          Buffer,\r
-                          sizeof (Buffer),\r
-                          L"Diskfile%d",\r
-                          WinNtIo->InstanceNumber\r
-                          );\r
-  } else {\r
-    if (*Str >= 'A' && *Str <= 'Z' || *Str >= 'a' && *Str <= 'z') {\r
-      WinNtIo->WinNtThunk->SPrintf (Buffer, sizeof (Buffer), L"\\\\.\\%c:", *Str);\r
-    } else {\r
-      WinNtIo->WinNtThunk->SPrintf (Buffer, sizeof (Buffer), L"\\\\.\\PHYSICALDRIVE%c", *Str);\r
-    }\r
-\r
-    Str++;\r
-    if (*Str != ':') {\r
-      Status = EFI_NOT_FOUND;\r
-      goto Done;\r
-    }\r
-\r
-    Str++;\r
-  }\r
-\r
-  if (*Str == 'R' || *Str == 'F') {\r
-    RemovableMedia = (BOOLEAN) (*Str == 'R');\r
-    Str++;\r
-    if (*Str == 'O' || *Str == 'W') {\r
-      WriteProtected  = (BOOLEAN) (*Str == 'O');\r
-      Str             = GetNextElementPastTerminator (Str, ';');\r
-\r
-      NumberOfBlocks  = StrDecimalToUintn (Str);\r
-      if (NumberOfBlocks != 0) {\r
-        Str       = GetNextElementPastTerminator (Str, ';');\r
-        BlockSize = StrDecimalToUintn (Str);\r
-        if (BlockSize != 0) {\r
-          //\r
-          // If we get here the variable is valid so do the work.\r
-          //\r
-          Status = WinNtBlockIoCreateMapping (\r
-                    WinNtIo,\r
-                    Handle,\r
-                    Buffer,\r
-                    WriteProtected,\r
-                    RemovableMedia,\r
-                    NumberOfBlocks,\r
-                    BlockSize,\r
-                    DiskType\r
-                    );\r
-\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  EFI_STATUS              Status;\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);\r
-\r
-  //\r
-  // BugBug: If we need to kick people off, we need to make Uninstall Close the handles.\r
-  //         We could pass in our image handle or FLAG our open to be closed via\r
-  //         Unistall (== to saying any CloseProtocol will close our open)\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Private->EfiHandle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  &Private->BlockIo,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-\r
-    //\r
-    // Shut down our device\r
-    //\r
-    Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
-\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-CHAR16 *\r
-GetNextElementPastTerminator (\r
-  IN  CHAR16  *EnvironmentVariable,\r
-  IN  CHAR16  Terminator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Worker function to parse environment variables.\r
-\r
-Arguments:\r
-  EnvironmentVariable - Envirnment variable to parse.\r
-\r
-  Terminator          - Terminator to parse for.\r
-\r
-Returns:\r
-\r
-  Pointer to next eliment past the first occurence of Terminator or the '\0'\r
-  at the end of the string.\r
-\r
---*/\r
-{\r
-  CHAR16  *Ptr;\r
-\r
-  for (Ptr = EnvironmentVariable; *Ptr != '\0'; Ptr++) {\r
-    if (*Ptr == Terminator) {\r
-      Ptr++;\r
-      break;\r
-    }\r
-  }\r
-\r
-  return Ptr;\r
-}\r
-\r
-EFI_STATUS\r
-WinNtBlockIoCreateMapping (\r
-  IN EFI_WIN_NT_IO_PROTOCOL             *WinNtIo,\r
-  IN EFI_HANDLE                         EfiDeviceHandle,\r
-  IN CHAR16                             *Filename,\r
-  IN BOOLEAN                            ReadOnly,\r
-  IN BOOLEAN                            RemovableMedia,\r
-  IN UINTN                              NumberOfBlocks,\r
-  IN UINTN                              BlockSize,\r
-  IN WIN_NT_RAW_DISK_DEVICE_TYPE        DeviceType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  WinNtIo         - TODO: add argument description\r
-  EfiDeviceHandle - TODO: add argument description\r
-  Filename        - TODO: add argument description\r
-  ReadOnly        - TODO: add argument description\r
-  RemovableMedia  - TODO: add argument description\r
-  NumberOfBlocks  - TODO: add argument description\r
-  BlockSize       - TODO: add argument description\r
-  DeviceType      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-  UINTN                   Index;\r
-\r
-  WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS);\r
-\r
-  Private = AllocatePool (sizeof (WIN_NT_BLOCK_IO_PRIVATE));\r
-  ASSERT (Private != NULL);\r
-\r
-  EfiInitializeLock (&Private->Lock, TPL_NOTIFY);\r
-\r
-  Private->WinNtThunk = WinNtIo->WinNtThunk;\r
-\r
-  Private->Signature  = WIN_NT_BLOCK_IO_PRIVATE_SIGNATURE;\r
-  Private->LastBlock  = NumberOfBlocks - 1;\r
-  Private->BlockSize  = BlockSize;\r
-\r
-  for (Index = 0; Filename[Index] != 0; Index++) {\r
-    Private->Filename[Index] = Filename[Index];\r
-  }\r
-\r
-  Private->Filename[Index]      = 0;\r
-\r
-  Private->ReadMode             = GENERIC_READ | (ReadOnly ? 0 : GENERIC_WRITE);\r
-  Private->ShareMode            = FILE_SHARE_READ | FILE_SHARE_WRITE;\r
-\r
-  Private->NumberOfBlocks       = NumberOfBlocks;\r
-  Private->DeviceType           = DeviceType;\r
-  Private->NtHandle             = INVALID_HANDLE_VALUE;\r
-\r
-  Private->ControllerNameTable  = NULL;\r
-\r
-  AddUnicodeString2 (\r
-    "eng",\r
-    gWinNtBlockIoComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    Private->Filename,\r
-    TRUE\r
-    );\r
-  AddUnicodeString2 (\r
-    "en",\r
-    gWinNtBlockIoComponentName2.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    Private->Filename,\r
-    FALSE\r
-    );\r
-\r
-\r
-  BlockIo = &Private->BlockIo;\r
-  BlockIo->Revision = EFI_BLOCK_IO_PROTOCOL_REVISION;\r
-  BlockIo->Media = &Private->Media;\r
-  BlockIo->Media->BlockSize = (UINT32)Private->BlockSize;\r
-  BlockIo->Media->LastBlock = Private->NumberOfBlocks - 1;\r
-  BlockIo->Media->MediaId = 0;;\r
-\r
-  BlockIo->Reset = WinNtBlockIoResetBlock;\r
-  BlockIo->ReadBlocks = WinNtBlockIoReadBlocks;\r
-  BlockIo->WriteBlocks = WinNtBlockIoWriteBlocks;\r
-  BlockIo->FlushBlocks = WinNtBlockIoFlushBlocks;\r
-\r
-  BlockIo->Media->ReadOnly = ReadOnly;\r
-  BlockIo->Media->RemovableMedia = RemovableMedia;\r
-  BlockIo->Media->LogicalPartition = FALSE;\r
-  BlockIo->Media->MediaPresent = TRUE;\r
-  BlockIo->Media->WriteCaching = FALSE;\r
-\r
-  if (DeviceType == EfiWinNtVirtualDisks) {\r
-    BlockIo->Media->IoAlign = 1;\r
-\r
-    //\r
-    // Create a file to use for a virtual disk even if it does not exist.\r
-    //\r
-    Private->OpenMode = OPEN_ALWAYS;\r
-  } else if (DeviceType == EfiWinNtPhysicalDisks) {\r
-    //\r
-    // Physical disk and floppy devices require 4 byte alignment.\r
-    //\r
-    BlockIo->Media->IoAlign = 4;\r
-\r
-    //\r
-    // You can only open a physical device if it exists.\r
-    //\r
-    Private->OpenMode = OPEN_EXISTING;\r
-  } else {\r
-    ASSERT (FALSE);\r
-  }\r
-\r
-  Private->EfiHandle  = EfiDeviceHandle;\r
-  Status              = WinNtBlockIoOpenDevice (Private);\r
-  if (!EFI_ERROR (Status)) {\r
-\r
-    Status = gBS->InstallMultipleProtocolInterfaces (\r
-                    &Private->EfiHandle,\r
-                    &gEfiBlockIoProtocolGuid,\r
-                    &Private->BlockIo,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      FreePool (Private);\r
-    }\r
-\r
-    DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename));\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-WinNtBlockIoOpenDevice (\r
-  WIN_NT_BLOCK_IO_PRIVATE                 *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  UINT64                FileSize;\r
-  UINT64                EndOfFile;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  BlockIo = &Private->BlockIo;\r
-  EfiAcquireLock (&Private->Lock);\r
-\r
-  //\r
-  // If the device is already opened, close it\r
-  //\r
-  if (Private->NtHandle != INVALID_HANDLE_VALUE) {\r
-    BlockIo->Reset (BlockIo, FALSE);\r
-  }\r
-\r
-  //\r
-  // Open the device\r
-  //\r
-  Private->NtHandle = Private->WinNtThunk->CreateFile (\r
-                                            Private->Filename,\r
-                                            (DWORD)Private->ReadMode,\r
-                                            (DWORD)Private->ShareMode,\r
-                                            NULL,\r
-                                            (DWORD)Private->OpenMode,\r
-                                            0,\r
-                                            NULL\r
-                                            );\r
-\r
-  Status = Private->WinNtThunk->GetLastError ();\r
-\r
-  if (Private->NtHandle == INVALID_HANDLE_VALUE) {\r
-    DEBUG ((EFI_D_INFO, "PlOpenBlock: Could not open %s, %x\n", Private->Filename, Private->WinNtThunk->GetLastError ()));\r
-    BlockIo->Media->MediaPresent  = FALSE;\r
-    Status                        = EFI_NO_MEDIA;\r
-    goto Done;\r
-  }\r
-\r
-  if (!BlockIo->Media->MediaPresent) {\r
-    //\r
-    // BugBug: try to emulate if a CD appears - notify drivers to check it out\r
-    //\r
-    BlockIo->Media->MediaPresent = TRUE;\r
-    EfiReleaseLock (&Private->Lock);\r
-    EfiAcquireLock (&Private->Lock);\r
-  }\r
-\r
-  //\r
-  // get the size of the file\r
-  //\r
-  Status = SetFilePointer64 (Private, 0, &FileSize, FILE_END);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    FileSize = MultU64x32 (Private->NumberOfBlocks, (UINT32)Private->BlockSize);\r
-    if (Private->DeviceType == EfiWinNtVirtualDisks) {\r
-      DEBUG ((EFI_D_ERROR, "PlOpenBlock: Could not get filesize of %s\n", Private->Filename));\r
-      Status = EFI_UNSUPPORTED;\r
-      goto Done;\r
-    }\r
-  }\r
-\r
-  if (Private->NumberOfBlocks == 0) {\r
-    Private->NumberOfBlocks = DivU64x32 (FileSize, (UINT32)Private->BlockSize);\r
-  }\r
-\r
-  EndOfFile = MultU64x32 (Private->NumberOfBlocks, (UINT32)Private->BlockSize);\r
-\r
-  if (FileSize != EndOfFile) {\r
-    //\r
-    // file is not the proper size, change it\r
-    //\r
-    DEBUG ((EFI_D_INIT, "PlOpenBlock: Initializing block device: %hs\n", Private->Filename));\r
-\r
-    //\r
-    // first set it to 0\r
-    //\r
-    SetFilePointer64 (Private, 0, NULL, FILE_BEGIN);\r
-    Private->WinNtThunk->SetEndOfFile (Private->NtHandle);\r
-\r
-    //\r
-    // then set it to the needed file size (OS will zero fill it)\r
-    //\r
-    SetFilePointer64 (Private, EndOfFile, NULL, FILE_BEGIN);\r
-    Private->WinNtThunk->SetEndOfFile (Private->NtHandle);\r
-  }\r
-\r
-  DEBUG ((EFI_D_INIT, "%HPlOpenBlock: opened %s%N\n", Private->Filename));\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    if (Private->NtHandle != INVALID_HANDLE_VALUE) {\r
-      BlockIo->Reset (BlockIo, FALSE);\r
-    }\r
-  }\r
-\r
-  EfiReleaseLock (&Private->Lock);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-WinNtBlockIoError (\r
-  IN WIN_NT_BLOCK_IO_PRIVATE      *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  EFI_STATUS            Status;\r
-  BOOLEAN               ReinstallBlockIoFlag;\r
-\r
-  BlockIo = &Private->BlockIo;\r
-\r
-  switch (Private->WinNtThunk->GetLastError ()) {\r
-\r
-  case ERROR_NOT_READY:\r
-    Status                        = EFI_NO_MEDIA;\r
-    BlockIo->Media->ReadOnly      = FALSE;\r
-    BlockIo->Media->MediaPresent  = FALSE;\r
-    ReinstallBlockIoFlag          = FALSE;\r
-    break;\r
-\r
-  case ERROR_WRONG_DISK:\r
-    BlockIo->Media->ReadOnly      = FALSE;\r
-    BlockIo->Media->MediaPresent  = TRUE;\r
-    BlockIo->Media->MediaId += 1;\r
-    ReinstallBlockIoFlag  = TRUE;\r
-    Status                = EFI_MEDIA_CHANGED;\r
-    break;\r
-\r
-  case ERROR_WRITE_PROTECT:\r
-    BlockIo->Media->ReadOnly  = TRUE;\r
-    ReinstallBlockIoFlag      = FALSE;\r
-    Status                    = EFI_WRITE_PROTECTED;\r
-    break;\r
-\r
-  default:\r
-    ReinstallBlockIoFlag  = FALSE;\r
-    Status                = EFI_DEVICE_ERROR;\r
-    break;\r
-  }\r
-\r
-  if (ReinstallBlockIoFlag) {\r
-    BlockIo->Reset (BlockIo, FALSE);\r
-\r
-    gBS->ReinstallProtocolInterface (\r
-          Private->EfiHandle,\r
-          &gEfiBlockIoProtocolGuid,\r
-          BlockIo,\r
-          BlockIo\r
-          );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-WinNtBlockIoReadWriteCommon (\r
-  IN  WIN_NT_BLOCK_IO_PRIVATE     *Private,\r
-  IN UINT32                       MediaId,\r
-  IN EFI_LBA                      Lba,\r
-  IN UINTN                        BufferSize,\r
-  IN VOID                         *Buffer,\r
-  IN CHAR8                        *CallerName\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private     - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-  CallerName  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_NO_MEDIA - TODO: Add description for return value\r
-  EFI_MEDIA_CHANGED - TODO: Add description for return value\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-  EFI_BAD_BUFFER_SIZE - TODO: Add description for return value\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       BlockSize;\r
-  UINT64      LastBlock;\r
-  INT64       DistanceToMove;\r
-  UINT64      DistanceMoved;\r
-\r
-  if (Private->NtHandle == INVALID_HANDLE_VALUE) {\r
-    Status = WinNtBlockIoOpenDevice (Private);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  if (!Private->Media.MediaPresent) {\r
-    DEBUG ((EFI_D_INIT, "%s: No Media\n", CallerName));\r
-    return EFI_NO_MEDIA;\r
-  }\r
-\r
-  if (Private->Media.MediaId != MediaId) {\r
-    return EFI_MEDIA_CHANGED;\r
-  }\r
-\r
-  if ((UINTN) Buffer % Private->Media.IoAlign != 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Verify buffer size\r
-  //\r
-  BlockSize = Private->BlockSize;\r
-  if (BufferSize == 0) {\r
-    DEBUG ((EFI_D_INIT, "%s: Zero length read\n", CallerName));\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if ((BufferSize % BlockSize) != 0) {\r
-    DEBUG ((EFI_D_INIT, "%s: Invalid read size\n", CallerName));\r
-    return EFI_BAD_BUFFER_SIZE;\r
-  }\r
-\r
-  LastBlock = Lba + (BufferSize / BlockSize) - 1;\r
-  if (LastBlock > Private->LastBlock) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: Attempted to read off end of device\n"));\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Seek to End of File\r
-  //\r
-  DistanceToMove = MultU64x32 (Lba, (UINT32)BlockSize);\r
-  Status = SetFilePointer64 (Private, DistanceToMove, &DistanceMoved, FILE_BEGIN);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_INIT, "WriteBlocks: SetFilePointer failed\n"));\r
-    return WinNtBlockIoError (Private);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoReadBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  OUT VOID                  *Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Read BufferSize bytes from Lba into Buffer.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    MediaId    - Id of the media, changes every time the media is replaced.\r
-    Lba        - The starting Logical Block Address to read from\r
-    BufferSize - Size of Buffer, must be a multiple of device block size.\r
-    Buffer     - Buffer containing read data\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The data was read correctly from the device.\r
-    EFI_DEVICE_ERROR      - The device reported an error while performing the read.\r
-    EFI_NO_MEDIA          - There is no media in the device.\r
-    EFI_MEDIA_CHANGED     - The MediaId does not matched the current device.\r
-    EFI_BAD_BUFFER_SIZE   - The Buffer was not a multiple of the block size of the\r
-                            device.\r
-    EFI_INVALID_PARAMETER - The read request contains device addresses that are not\r
-                            valid for the device.\r
-\r
---*/\r
-{\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-  BOOL                    Flag;\r
-  EFI_STATUS              Status;\r
-  DWORD                   BytesRead;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status  = WinNtBlockIoReadWriteCommon (Private, MediaId, Lba, BufferSize, Buffer, "WinNtReadBlocks");\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  Flag = Private->WinNtThunk->ReadFile (Private->NtHandle, Buffer, (DWORD) BufferSize, (LPDWORD) &BytesRead, NULL);\r
-  if (!Flag || (BytesRead != BufferSize)) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: ReadFile failed. (%d)\n", Private->WinNtThunk->GetLastError ()));\r
-    Status = WinNtBlockIoError (Private);\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // If we wrote then media is present.\r
-  //\r
-  This->Media->MediaPresent = TRUE;\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoWriteBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  IN VOID                   *Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Write BufferSize bytes from Lba into Buffer.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    MediaId    - Id of the media, changes every time the media is replaced.\r
-    Lba        - The starting Logical Block Address to read from\r
-    BufferSize - Size of Buffer, must be a multiple of device block size.\r
-    Buffer     - Buffer containing read data\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The data was written correctly to the device.\r
-    EFI_WRITE_PROTECTED   - The device can not be written to.\r
-    EFI_DEVICE_ERROR      - The device reported an error while performing the write.\r
-    EFI_NO_MEDIA          - There is no media in the device.\r
-    EFI_MEDIA_CHNAGED     - The MediaId does not matched the current device.\r
-    EFI_BAD_BUFFER_SIZE   - The Buffer was not a multiple of the block size of the\r
-                            device.\r
-    EFI_INVALID_PARAMETER - The write request contains a LBA that is not\r
-                            valid for the device.\r
-\r
---*/\r
-{\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-  UINTN                   BytesWritten;\r
-  BOOL                    Flag;\r
-  BOOL                    Locked;\r
-  EFI_STATUS              Status;\r
-  EFI_TPL                 OldTpl;\r
-  UINTN                   BytesReturned;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status  = WinNtBlockIoReadWriteCommon (Private, MediaId, Lba, BufferSize, Buffer, "WinNtWriteBlocks");\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // According the Windows requirement, first need to lock the volume before \r
-  // write to it.\r
-  //\r
-  if (Private->DeviceType == EfiWinNtPhysicalDisks) {\r
-    Locked = Private->WinNtThunk->DeviceIoControl (Private->NtHandle, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &BytesReturned, NULL);\r
-    if (Locked == 0) {\r
-      DEBUG ((EFI_D_INIT, "ReadBlocks: Lock volume failed. (%d)\n", Private->WinNtThunk->GetLastError ()));\r
-      Status = WinNtBlockIoError (Private);\r
-      goto Done;\r
-    }\r
-  } else {\r
-    Locked = 0;\r
-  }\r
-  Flag = Private->WinNtThunk->WriteFile (Private->NtHandle, Buffer, (DWORD) BufferSize, (LPDWORD) &BytesWritten, NULL);\r
-  if (Locked != 0) {\r
-    Private->WinNtThunk->DeviceIoControl (Private->NtHandle, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &BytesReturned, NULL);\r
-  }\r
-  if (!Flag || (BytesWritten != BufferSize)) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: WriteFile failed. (%d)\n", Private->WinNtThunk->GetLastError ()));\r
-    Status = WinNtBlockIoError (Private);\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // If the write succeeded, we are not write protected and media is present.\r
-  //\r
-  This->Media->MediaPresent = TRUE;\r
-  This->Media->ReadOnly     = FALSE;\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoFlushBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Flush the Block Device.\r
-\r
-  Arguments:\r
-    This             - Protocol instance pointer.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - All outstanding data was written to the device\r
-    EFI_DEVICE_ERROR - The device reported an error while writting back the data\r
-    EFI_NO_MEDIA     - There is no media in the device.\r
-\r
---*/\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoResetBlock (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN BOOLEAN                ExtendedVerification\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reset the Block Device.\r
-\r
-  Arguments:\r
-    This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform diagnostics on reset.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The device was reset.\r
-    EFI_DEVICE_ERROR      - The device is not functioning properly and could\r
-                            not be reset.\r
-\r
---*/\r
-{\r
-  WIN_NT_BLOCK_IO_PRIVATE *Private;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (Private->NtHandle != INVALID_HANDLE_VALUE) {\r
-    Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
-    Private->NtHandle = INVALID_HANDLE_VALUE;\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-SetFilePointer64 (\r
-  IN  WIN_NT_BLOCK_IO_PRIVATE    *Private,\r
-  IN  INT64                      DistanceToMove,\r
-  OUT UINT64                     *NewFilePointer,\r
-  IN  DWORD                      MoveMethod\r
-  )\r
-/*++\r
-\r
-This function extends the capability of SetFilePointer to accept 64 bit parameters\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    Private - add argument and description to function comment\r
-// TODO:    DistanceToMove - add argument and description to function comment\r
-// TODO:    NewFilePointer - add argument and description to function comment\r
-// TODO:    MoveMethod - add argument and description to function comment\r
-{\r
-  EFI_STATUS    Status;\r
-  LARGE_INTEGER LargeInt;\r
-\r
-  LargeInt.QuadPart = DistanceToMove;\r
-  Status            = EFI_SUCCESS;\r
-\r
-  LargeInt.LowPart = Private->WinNtThunk->SetFilePointer (\r
-                                            Private->NtHandle,\r
-                                            LargeInt.LowPart,\r
-                                            &LargeInt.HighPart,\r
-                                            MoveMethod\r
-                                            );\r
-\r
-  if (LargeInt.LowPart == -1 && Private->WinNtThunk->GetLastError () != NO_ERROR) {\r
-    Status = EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (NewFilePointer != NULL) {\r
-    *NewFilePointer = LargeInt.QuadPart;\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.h b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.h
deleted file mode 100644 (file)
index b0fd31a..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtBlockIo.h\r
-\r
-Abstract:\r
-\r
-  Produce block IO abstractions for real devices on your PC using Win32 APIs.\r
-  The configuration of what devices to mount or emulate comes from NT \r
-  environment variables. The variables must be visible to the Microsoft* \r
-  Developer Studio for them to work.\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
-**/\r
-\r
-#ifndef _WIN_NT_BLOCK_IO_H_\r
-#define _WIN_NT_BLOCK_IO_H_\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/BlockIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#define FILENAME_BUFFER_SIZE  80\r
-\r
-//\r
-// Language supported for driverconfiguration protocol\r
-//\r
-#define LANGUAGESUPPORTED "eng"\r
-\r
-typedef enum {\r
-  EfiWinNtVirtualDisks,\r
-  EfiWinNtPhysicalDisks,\r
-  EifWinNtMaxTypeDisks\r
-} WIN_NT_RAW_DISK_DEVICE_TYPE;\r
-\r
-#define WIN_NT_BLOCK_IO_PRIVATE_SIGNATURE SIGNATURE_32 ('N', 'T', 'b', 'k')\r
-typedef struct {\r
-  UINTN                       Signature;\r
-\r
-  EFI_LOCK                    Lock;\r
-\r
-  CHAR16                      Filename[FILENAME_BUFFER_SIZE];\r
-  UINTN                       ReadMode;\r
-  UINTN                       ShareMode;\r
-  UINTN                       OpenMode;\r
-\r
-  HANDLE                      NtHandle;\r
-  WIN_NT_RAW_DISK_DEVICE_TYPE DeviceType;\r
-\r
-  UINT64                      LastBlock;\r
-  UINTN                       BlockSize;\r
-  UINT64                      NumberOfBlocks;\r
-\r
-  EFI_HANDLE                  EfiHandle;\r
-  EFI_BLOCK_IO_PROTOCOL       BlockIo;\r
-  EFI_BLOCK_IO_MEDIA          Media;\r
-\r
-  EFI_UNICODE_STRING_TABLE    *ControllerNameTable;\r
-\r
-  EFI_WIN_NT_THUNK_PROTOCOL   *WinNtThunk;\r
-\r
-} WIN_NT_BLOCK_IO_PRIVATE;\r
-\r
-#define WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, WIN_NT_BLOCK_IO_PRIVATE, BlockIo, WIN_NT_BLOCK_IO_PRIVATE_SIGNATURE)\r
-\r
-#define LIST_BUFFER_SIZE  512\r
-\r
-//\r
-// Block I/O Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL         gWinNtBlockIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL         gWinNtBlockIoComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL        gWinNtBlockIoComponentName2;\r
-extern EFI_DRIVER_CONFIGURATION_PROTOCOL   gWinNtBlockIoDriverConfiguration;\r
-extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL     gWinNtBlockIoDriverDiagnostics;\r
-extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL    gWinNtBlockIoDriverDiagnostics2;\r
-\r
-//\r
-// EFI Driver Binding Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Block IO protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoReadBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  OUT VOID                  *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoWriteBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  IN VOID                   *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoFlushBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoResetBlock (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN BOOLEAN                ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Private Worker functions\r
-//\r
-EFI_STATUS\r
-WinNtBlockIoCreateMapping (\r
-  IN EFI_WIN_NT_IO_PROTOCOL             *WinNtIo,\r
-  IN EFI_HANDLE                         EfiDeviceHandle,\r
-  IN CHAR16                             *Filename,\r
-  IN BOOLEAN                            ReadOnly,\r
-  IN BOOLEAN                            RemovableMedia,\r
-  IN UINTN                              NumberOfBlocks,\r
-  IN UINTN                              BlockSize,\r
-  IN WIN_NT_RAW_DISK_DEVICE_TYPE        DeviceType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  WinNtIo         - TODO: add argument description\r
-  EfiDeviceHandle - TODO: add argument description\r
-  Filename        - TODO: add argument description\r
-  ReadOnly        - TODO: add argument description\r
-  RemovableMedia  - TODO: add argument description\r
-  NumberOfBlocks  - TODO: add argument description\r
-  BlockSize       - TODO: add argument description\r
-  DeviceType      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-WinNtBlockIoReadWriteCommon (\r
-  IN  WIN_NT_BLOCK_IO_PRIVATE *Private,\r
-  IN UINT32                   MediaId,\r
-  IN EFI_LBA                  Lba,\r
-  IN UINTN                    BufferSize,\r
-  IN VOID                     *Buffer,\r
-  IN CHAR8                    *CallerName\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private     - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-  CallerName  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-WinNtBlockIoError (\r
-  IN WIN_NT_BLOCK_IO_PRIVATE      *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-WinNtBlockIoOpenDevice (\r
-  WIN_NT_BLOCK_IO_PRIVATE         *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-CHAR16                                    *\r
-GetNextElementPastTerminator (\r
-  IN  CHAR16  *EnvironmentVariable,\r
-  IN  CHAR16  Terminator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  EnvironmentVariable - TODO: add argument description\r
-  Terminator          - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-\r
-\r
-EFI_STATUS\r
-SetFilePointer64 (\r
-  IN  WIN_NT_BLOCK_IO_PRIVATE    *Private,\r
-  IN  INT64                      DistanceToMove,\r
-  OUT UINT64                     *NewFilePointer,\r
-  IN  DWORD                      MoveMethod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private         - TODO: add argument description\r
-  DistanceToMove  - TODO: add argument description\r
-  NewFilePointer  - TODO: add argument description\r
-  MoveMethod      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-Atoi (\r
-  CHAR16  *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf
deleted file mode 100644 (file)
index b7ba665..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-## @file\r
-# Block Io driver\r
-#\r
-# Produce block IO abstractions for real devices on your PC using Win32 APIs.\r
-#  The configuration of what devices to mount or emulate comes from NT\r
-#  environment variables. The variables must be visible to the Microsoft*\r
-#  Developer Studio for them to work.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtBlockIo\r
-  FILE_GUID                      = F479E147-A125-11d4-BCFC-0080C73C8881\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeWinNtBlockIo\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gWinNtBlockIoDriverBinding                   \r
-#  COMPONENT_NAME                =  gWinNtBlockIoComponentName                   \r
-#  DRIVER_DIAG                   =  gWinNtBlockIoDriverDiagnostics               \r
-#\r
-\r
-[Sources]\r
-  DriverDiagnostics.c\r
-  DriverConfiguration.c\r
-  ComponentName.c\r
-  WinNtBlockIo.c\r
-  WinNtBlockIo.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiWinNtPhysicalDisksGuid                    # SOMETIMES_CONSUMED\r
-  gEfiWinNtVirtualDisksGuid                     # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiBlockIoProtocolGuid                       # PROTOCOL BY_START\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL TO_START\r
-\r
diff --git a/Nt32Pkg/WinNtBusDriverDxe/ComponentName.c b/Nt32Pkg/WinNtBusDriverDxe/ComponentName.c
deleted file mode 100644 (file)
index 70e9545..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-\r
-#include "WinNtBusDriver.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gWinNtBusDriverComponentName = {\r
-  WinNtBusDriverComponentNameGetDriverName,\r
-  WinNtBusDriverComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtBusDriverComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtBusDriverComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtBusDriverComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtBusDriverNameTable[] = {\r
-  { "eng;en", L"Windows Bus Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mWinNtBusDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gWinNtBusDriverComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo;\r
-  WIN_NT_IO_DEVICE        *Private;\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gWinNtBusDriverBinding.DriverBindingHandle,\r
-             &gEfiWinNtThunkProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // This is a bus driver, so ChildHandle can not be NULL.\r
-  //\r
-  if (ChildHandle == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Status = EfiTestChildHandle (\r
-             ControllerHandle,\r
-             ChildHandle,\r
-             &gEfiWinNtThunkProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ChildHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  gWinNtBusDriverBinding.DriverBindingHandle,\r
-                  ChildHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_IO_DEVICE_FROM_THIS (WinNtIo);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gWinNtBusDriverComponentName)\r
-           );\r
-}\r
diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c
deleted file mode 100644 (file)
index f4b7e1b..0000000
+++ /dev/null
@@ -1,799 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtBusDriver.c\r
-\r
-Abstract:\r
-\r
-This following section documents the envirnoment variables for the Win NT\r
-build.  These variables are used to define the (virtual) hardware\r
-configuration of the NT environment\r
-\r
-A ! can be used to seperate multiple instances in a variable. Each\r
-instance represents a seperate hardware device.\r
-\r
-EFI_WIN_NT_PHYSICAL_DISKS - maps to drives on your system\r
-EFI_WIN_NT_VIRTUAL_DISKS  - maps to a device emulated by a file\r
-EFI_WIN_NT_FILE_SYSTEM    - mouts a directory as a file system\r
-EFI_WIN_NT_CONSOLE        - make a logical comand line window (only one!)\r
-EFI_WIN_NT_GOP            - Builds GOP Windows of Width and Height\r
-EFI_WIN_NT_SERIAL_PORT    - maps physical serial ports\r
-\r
- <F>ixed       - Fixed disk like a hard drive.\r
- <R>emovable   - Removable media like a floppy or CD-ROM.\r
- Read <O>nly   - Write protected device.\r
- Read <W>rite  - Read write device.\r
- <block count> - Decimal number of blocks a device supports.\r
- <block size>  - Decimal number of bytes per block.\r
-\r
- NT envirnonment variable contents. '<' and '>' are not part of the variable,\r
- they are just used to make this help more readable. There should be no\r
- spaces between the ';'. Extra spaces will break the variable. A '!' is\r
- used to seperate multiple devices in a variable.\r
-\r
- EFI_WIN_NT_VIRTUAL_DISKS =\r
-   <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- EFI_WIN_NT_PHYSICAL_DISKS =\r
-   <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                media device.\r
-\r
-   Thus a 20 MB emulated hard drive would look like:\r
-   EFI_WIN_NT_VIRTUAL_DISKS=FW;40960;512\r
-\r
-   A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-   EFI_WIN_NT_VIRTUAL_DISKS=RW;1440;1024\r
-\r
- Physical Disks: These devices use NT to open a real device in your system\r
-\r
-   Thus a 120 MB floppy would look like:\r
-   EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-   Thus a standard CD-ROM floppy would look like:\r
-   EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
- EFI_WIN_NT_FILE_SYSTEM =\r
-   <directory path>[!...]\r
-\r
-   Mounting the two directories C:\FOO and C:\BAR would look like:\r
-   EFI_WIN_NT_FILE_SYSTEM=c:\foo!c:\bar\r
-\r
- EFI_WIN_NT_CONSOLE =\r
-   <window title>\r
-\r
-   Declaring a text console window with the title "My EFI Console" woild look like:\r
-   EFI_WIN_NT_CONSOLE=My EFI Console\r
-\r
- EFI_WIN_NT_GOP =\r
-   <width> <height>[!...]\r
-\r
-   Declaring a two GOP windows with resolutions of 800x600 and 1024x768 would look like:\r
-   Example : EFI_WIN_NT_GOP=800 600!1024 768\r
-\r
- EFI_WIN_NT_SERIAL_PORT =\r
-   <port name>[!...]\r
-\r
-   Declaring two serial ports on COM1 and COM2 would look like:\r
-   Example : EFI_WIN_NT_SERIAL_PORT=COM1!COM2\r
-\r
- EFI_WIN_NT_PASS_THROUGH =\r
-   <BaseAddress>;<Bus#>;<Device#>;<Function#>\r
-\r
-   Declaring a base address of 0xE0000000 (used for PCI Express devices)\r
-   and having NT32 talk to a device located at bus 0, device 1, function 0:\r
-   Example : EFI_WIN_NT_PASS_THROUGH=E000000;0;1;0\r
-\r
----*/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include "WinNtBusDriver.h"\r
-\r
-extern EFI_GUID gWinNtBusDriverGuid;\r
-//\r
-// DriverBinding protocol global\r
-//\r
-EFI_DRIVER_BINDING_PROTOCOL           gWinNtBusDriverBinding = {\r
-  WinNtBusDriverBindingSupported,\r
-  WinNtBusDriverBindingStart,\r
-  WinNtBusDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-#define NT_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(NT_PCD_ENTRY))\r
-\r
-//\r
-// Table to map NT Environment variable to the GUID that should be in\r
-// device path.\r
-//\r
-NT_PCD_ENTRY  mPcdEnvironment[] = {\r
-  PcdToken(PcdWinNtConsole),       &gEfiWinNtConsoleGuid,\r
-  PcdToken(PcdWinNtGop),           &gEfiWinNtGopGuid,\r
-  PcdToken(PcdWinNtSerialPort),    &gEfiWinNtSerialPortGuid,\r
-  PcdToken(PcdWinNtFileSystem),    &gEfiWinNtFileSystemGuid,\r
-  PcdToken(PcdWinNtVirtualDisk),   &gEfiWinNtVirtualDisksGuid,\r
-  PcdToken(PcdWinNtPhysicalDisk),  &gEfiWinNtPhysicalDisksGuid\r
-};\r
-\r
-/**\r
-  The user Entry Point for module WinNtBusDriver. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-\r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtBusDriver(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Install driver model protocol(s).\r
-  //\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gWinNtBusDriverBinding,\r
-             ImageHandle,\r
-             &gWinNtBusDriverComponentName,\r
-             &gWinNtBusDriverComponentName2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
-VOID *\r
-AllocateMemory (\r
-  IN  UINTN   Size\r
-  )\r
-{\r
-  VOID        *Buffer;\r
-\r
-  Buffer = AllocatePool (Size);\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return Buffer;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
-**/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ControllerHandle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-  EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
-  UINTN                     Index;\r
-\r
-  //\r
-  // Check the contents of the first Device Path Node of RemainingDevicePath to make sure\r
-  // it is a legal Device Path Node for this bus driver's children.\r
-  //\r
-  if (RemainingDevicePath != NULL) {\r
-    //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
-    // if yes, go on checking other conditions\r
-    //\r
-    if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath isn't the End of Device Path Node,\r
-      // check its validation\r
-      //\r
-      if (RemainingDevicePath->Type != HARDWARE_DEVICE_PATH ||\r
-          RemainingDevicePath->SubType != HW_VENDOR_DP ||\r
-          DevicePathNodeLength(RemainingDevicePath) != sizeof(WIN_NT_VENDOR_DEVICE_PATH_NODE)) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-  \r
-      for (Index = 0; Index < NT_PCD_ARRAY_SIZE; Index++) {\r
-        if (CompareGuid (&((VENDOR_DEVICE_PATH *) RemainingDevicePath)->Guid, mPcdEnvironment[Index].DevicePathGuid)) {\r
-          break;\r
-        }\r
-      }\r
-  \r
-      if (Index >= NT_PCD_ARRAY_SIZE) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtThunkProtocolGuid,\r
-                  (VOID **) &WinNtThunk,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiWinNtThunkProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  //\r
-  // Open the EFI Device Path protocol needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Since we call through WinNtThunk we need to make sure it's valid\r
-  //\r
-  Status = EFI_SUCCESS;\r
-  if (WinNtThunk->Signature != EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE) {\r
-    Status = EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Close protocol, don't use device path protocol in the Support() function\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiDevicePathProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ControllerHandle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_WIN_NT_THUNK_PROTOCOL       *WinNtThunk;\r
-  EFI_DEVICE_PATH_PROTOCOL        *ParentDevicePath;\r
-  WIN_NT_BUS_DEVICE               *WinNtBusDevice;\r
-  WIN_NT_IO_DEVICE                *WinNtDevice;\r
-  UINTN                           Index;\r
-  CHAR16                          *StartString;\r
-  CHAR16                          *SubString;\r
-  UINT16                          Count;\r
-  UINTN                           StringSize;\r
-  UINT16                          ComponentName[MAX_NT_ENVIRNMENT_VARIABLE_LENGTH];\r
-  WIN_NT_VENDOR_DEVICE_PATH_NODE  *Node;\r
-  BOOLEAN                         CreateDevice;\r
-  CHAR16                          *TempStr;\r
-  CHAR16                          *PcdTempStr;\r
-  UINTN                           TempStrSize;\r
-\r
-  Status = EFI_UNSUPPORTED;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtThunkProtocolGuid,\r
-                  (VOID **) &WinNtThunk,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  if (Status != EFI_ALREADY_STARTED) {\r
-    WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));\r
-    if (WinNtBusDevice == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    WinNtBusDevice->Signature           = WIN_NT_BUS_DEVICE_SIGNATURE;\r
-    WinNtBusDevice->ControllerNameTable = NULL;\r
-\r
-    AddUnicodeString2 (\r
-      "eng",\r
-      gWinNtBusDriverComponentName.SupportedLanguages,\r
-      &WinNtBusDevice->ControllerNameTable,\r
-      L"Windows Bus Controller",\r
-      TRUE\r
-      );\r
-    AddUnicodeString2 (\r
-      "en",\r
-      gWinNtBusDriverComponentName2.SupportedLanguages,\r
-      &WinNtBusDevice->ControllerNameTable,\r
-      L"Windows Bus Controller",\r
-      FALSE\r
-      );\r
-\r
-\r
-    Status = gBS->InstallMultipleProtocolInterfaces (\r
-                    &ControllerHandle,\r
-                    &gWinNtBusDriverGuid,\r
-                    WinNtBusDevice,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
-      FreePool (WinNtBusDevice);\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Loop on the Variable list. Parse each variable to produce a set of handles that\r
-  // represent virtual hardware devices.\r
-  //\r
-  for (Index = 0; Index < NT_PCD_ARRAY_SIZE; Index++) {\r
-    PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
-    ASSERT (PcdTempStr != NULL);\r
-\r
-    TempStrSize = StrLen (PcdTempStr);\r
-    TempStr = AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16)));\r
-    StrCpy (TempStr, PcdTempStr);\r
-\r
-    StartString = TempStr;\r
-\r
-    //\r
-    // Parse the envirnment variable into sub strings using '!' as a delimator.\r
-    // Each substring needs it's own handle to be added to the system. This code\r
-    // does not understand the sub string. Thats the device drivers job.\r
-    //\r
-    Count = 0;\r
-    while (*StartString != '\0') {\r
-\r
-      //\r
-      // Find the end of the sub string\r
-      //\r
-      SubString = StartString;\r
-      while (*SubString != '\0' && *SubString != '!') {\r
-        SubString++;\r
-      }\r
-\r
-      if (*SubString == '!') {\r
-        //\r
-        // Replace token with '\0' to make sub strings. If this is the end\r
-        //  of the string SubString will already point to NULL.\r
-        //\r
-        *SubString = '\0';\r
-        SubString++;\r
-      }\r
-\r
-      CreateDevice = TRUE;\r
-      if (RemainingDevicePath != NULL) {\r
-        CreateDevice  = FALSE;\r
-        //\r
-        // Check if RemainingDevicePath is the End of Device Path Node, \r
-        // if yes, don't create any child device \r
-        //\r
-        if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-          //\r
-          // If RemainingDevicePath isn't the End of Device Path Node,\r
-          // check its validation\r
-          //\r
-          Node          = (WIN_NT_VENDOR_DEVICE_PATH_NODE *) RemainingDevicePath;\r
-          if (Node->VendorDevicePath.Header.Type == HARDWARE_DEVICE_PATH &&\r
-              Node->VendorDevicePath.Header.SubType == HW_VENDOR_DP &&\r
-              DevicePathNodeLength (&Node->VendorDevicePath.Header) == sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)\r
-              ) {\r
-            if (CompareGuid (&Node->VendorDevicePath.Guid, mPcdEnvironment[Index].DevicePathGuid) &&\r
-                Node->Instance == Count\r
-                ) {\r
-              CreateDevice = TRUE;\r
-            }\r
-          }\r
-        }\r
-      }\r
-\r
-      if (CreateDevice) {\r
-\r
-        //\r
-        // Allocate instance structure, and fill in parent information.\r
-        //\r
-        WinNtDevice = AllocateMemory (sizeof (WIN_NT_IO_DEVICE));\r
-        if (WinNtDevice == NULL) {\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        WinNtDevice->Handle             = NULL;\r
-        WinNtDevice->ControllerHandle   = ControllerHandle;\r
-        WinNtDevice->ParentDevicePath   = ParentDevicePath;\r
-\r
-        WinNtDevice->WinNtIo.WinNtThunk = WinNtThunk;\r
-\r
-        //\r
-        // Plus 2 to account for the NULL at the end of the Unicode string\r
-        //\r
-        StringSize = (UINTN) ((UINT8 *) SubString - (UINT8 *) StartString) + sizeof (CHAR16);\r
-        WinNtDevice->WinNtIo.EnvString = AllocateMemory (StringSize);\r
-        if (WinNtDevice->WinNtIo.EnvString != NULL) {\r
-          CopyMem (WinNtDevice->WinNtIo.EnvString, StartString, StringSize);\r
-        }\r
-\r
-        WinNtDevice->ControllerNameTable = NULL;\r
-\r
-        WinNtThunk->SPrintf (ComponentName, sizeof (ComponentName), L"%s", WinNtDevice->WinNtIo.EnvString);\r
-\r
-        WinNtDevice->DevicePath = WinNtBusCreateDevicePath (\r
-                                    ParentDevicePath,\r
-                                    mPcdEnvironment[Index].DevicePathGuid,\r
-                                    Count\r
-                                    );\r
-        if (WinNtDevice->DevicePath == NULL) {\r
-          FreePool (WinNtDevice);\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        AddUnicodeString2 (\r
-          "eng",\r
-          gWinNtBusDriverComponentName.SupportedLanguages,\r
-          &WinNtDevice->ControllerNameTable,\r
-          ComponentName,\r
-          TRUE\r
-          );\r
-        AddUnicodeString2 (\r
-          "en",\r
-          gWinNtBusDriverComponentName2.SupportedLanguages,\r
-          &WinNtDevice->ControllerNameTable,\r
-          ComponentName,\r
-          FALSE\r
-          );\r
-\r
-\r
-        WinNtDevice->WinNtIo.TypeGuid       = mPcdEnvironment[Index].DevicePathGuid;\r
-        WinNtDevice->WinNtIo.InstanceNumber = Count;\r
-\r
-        WinNtDevice->Signature              = WIN_NT_IO_DEVICE_SIGNATURE;\r
-\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &WinNtDevice->Handle,\r
-                        &gEfiDevicePathProtocolGuid,\r
-                        WinNtDevice->DevicePath,\r
-                        &gEfiWinNtIoProtocolGuid,\r
-                        &WinNtDevice->WinNtIo,\r
-                        NULL\r
-                        );\r
-        if (EFI_ERROR (Status)) {\r
-          FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-          FreePool (WinNtDevice);\r
-        } else {\r
-          //\r
-          // Open For Child Device\r
-          //\r
-          Status = gBS->OpenProtocol (\r
-                          ControllerHandle,\r
-                          &gEfiWinNtThunkProtocolGuid,\r
-                          (VOID **) &WinNtThunk,\r
-                          This->DriverBindingHandle,\r
-                          WinNtDevice->Handle,\r
-                          EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-                          );\r
-        }\r
-      }\r
-\r
-      //\r
-      // Parse Next sub string. This will point to '\0' if we are at the end.\r
-      //\r
-      Count++;\r
-      StartString = SubString;\r
-    }\r
-\r
-    FreePool (TempStr);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-    None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ControllerHandle - add argument and description to function comment\r
-// TODO:    NumberOfChildren - add argument and description to function comment\r
-// TODO:    ChildHandleBuffer - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                Status;\r
-  UINTN                     Index;\r
-  BOOLEAN                   AllChildrenStopped;\r
-  EFI_WIN_NT_IO_PROTOCOL    *WinNtIo;\r
-  WIN_NT_BUS_DEVICE         *WinNtBusDevice;\r
-  WIN_NT_IO_DEVICE          *WinNtDevice;\r
-  EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
-\r
-  //\r
-  // Complete all outstanding transactions to Controller.\r
-  // Don't allow any new transaction to Controller to be started.\r
-  //\r
-\r
-  if (NumberOfChildren == 0) {\r
-    //\r
-    // Close the bus driver\r
-    //\r
-    Status = gBS->OpenProtocol (\r
-                    ControllerHandle,\r
-                    &gWinNtBusDriverGuid,\r
-                    (VOID **) &WinNtBusDevice,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-          ControllerHandle,\r
-          &gWinNtBusDriverGuid,\r
-          WinNtBusDevice,\r
-          NULL\r
-          );\r
-\r
-    FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
-\r
-    FreePool (WinNtBusDevice);\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtThunkProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  AllChildrenStopped = TRUE;\r
-\r
-  for (Index = 0; Index < NumberOfChildren; Index++) {\r
-\r
-    Status = gBS->OpenProtocol (\r
-                    ChildHandleBuffer[Index],\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    (VOID **) &WinNtIo,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (!EFI_ERROR (Status)) {\r
-\r
-      WinNtDevice = WIN_NT_IO_DEVICE_FROM_THIS (WinNtIo);\r
-\r
-      Status = gBS->CloseProtocol (\r
-                      ControllerHandle,\r
-                      &gEfiWinNtThunkProtocolGuid,\r
-                      This->DriverBindingHandle,\r
-                      WinNtDevice->Handle\r
-                      );\r
-\r
-      Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                      WinNtDevice->Handle,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      WinNtDevice->DevicePath,\r
-                      &gEfiWinNtIoProtocolGuid,\r
-                      &WinNtDevice->WinNtIo,\r
-                      NULL\r
-                      );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        gBS->OpenProtocol (\r
-              ControllerHandle,\r
-              &gEfiWinNtThunkProtocolGuid,\r
-              (VOID **) &WinNtThunk,\r
-              This->DriverBindingHandle,\r
-              WinNtDevice->Handle,\r
-              EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-              );\r
-      } else {\r
-        //\r
-        // Close the child handle\r
-        //\r
-        FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-        FreePool (WinNtDevice);\r
-      }\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      AllChildrenStopped = FALSE;\r
-    }\r
-  }\r
-\r
-  if (!AllChildrenStopped) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-WinNtBusCreateDevicePath (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *RootDevicePath,\r
-  IN  EFI_GUID                  *Guid,\r
-  IN  UINT16                    InstanceNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Create a device path node using Guid and InstanceNumber and append it to\r
-  the passed in RootDevicePath\r
-\r
-Arguments:\r
-  RootDevicePath - Root of the device path to return.\r
-\r
-  Guid           - GUID to use in vendor device path node.\r
-\r
-  InstanceNumber - Instance number to use in the vendor device path. This\r
-                    argument is needed to make sure each device path is unique.\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_PATH_PROTOCOL\r
-\r
---*/\r
-{\r
-  WIN_NT_VENDOR_DEVICE_PATH_NODE  DevicePath;\r
-\r
-  DevicePath.VendorDevicePath.Header.Type     = HARDWARE_DEVICE_PATH;\r
-  DevicePath.VendorDevicePath.Header.SubType  = HW_VENDOR_DP;\r
-  SetDevicePathNodeLength (&DevicePath.VendorDevicePath.Header, sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE));\r
-\r
-  //\r
-  // The GUID defines the Class\r
-  //\r
-  CopyMem (&DevicePath.VendorDevicePath.Guid, Guid, sizeof (EFI_GUID));\r
-\r
-  //\r
-  // Add an instance number so we can make sure there are no Device Path\r
-  // duplication.\r
-  //\r
-  DevicePath.Instance = InstanceNumber;\r
-\r
-  return AppendDevicePathNode (\r
-          RootDevicePath,\r
-          (EFI_DEVICE_PATH_PROTOCOL *) &DevicePath\r
-          );\r
-}\r
diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.h b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.h
deleted file mode 100644 (file)
index dac61a6..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtBusDriver.h\r
-\r
-Abstract:\r
-\r
-This following section documents the envirnoment variables for the Win NT\r
-build.  These variables are used to define the (virtual) hardware\r
-configuration of the NT environment\r
-\r
-A ! can be used to seperate multiple instances in a variable. Each\r
-instance represents a seperate hardware device.\r
-\r
-EFI_WIN_NT_PHYSICAL_DISKS - maps to drives on your system\r
-EFI_WIN_NT_VIRTUAL_DISKS  - maps to a device emulated by a file\r
-EFI_WIN_NT_FILE_SYSTEM    - mouts a directory as a file system\r
-EFI_WIN_NT_CONSOLE        - make a logical comand line window (only one!)\r
-EFI_WIN_NT_GOP            - Builds GOP Windows of Width and Height\r
-EFI_WIN_NT_SERIAL_PORT    - maps physical serial ports\r
-EFI_WIN_NT_PASS_THRU      - associates a device with our PCI support\r
-\r
- <F>ixed       - Fixed disk like a hard drive.\r
- <R>emovable   - Removable media like a floppy or CD-ROM.\r
- Read <O>nly   - Write protected device.\r
- Read <W>rite  - Read write device.\r
- <block count> - Decimal number of blocks a device supports.\r
- <block size>  - Decimal number of bytes per block.\r
-\r
- NT envirnonment variable contents. '<' and '>' are not part of the variable,\r
- they are just used to make this help more readable. There should be no\r
- spaces between the ';'. Extra spaces will break the variable. A '!' is\r
- used to seperate multiple devices in a variable.\r
-\r
- EFI_WIN_NT_VIRTUAL_DISKS =\r
-   <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- EFI_WIN_NT_PHYSICAL_DISKS =\r
-   <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                media device.\r
-\r
-   Thus a 20 MB emulated hard drive would look like:\r
-   EFI_WIN_NT_VIRTUAL_DISKS=FW;40960;512\r
-\r
-   A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-   EFI_WIN_NT_VIRTUAL_DISKS=RW;1440;1024\r
-\r
- Physical Disks: These devices use NT to open a real device in your system\r
-\r
-   Thus a 120 MB floppy would look like:\r
-   EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-   Thus a standard CD-ROM floppy would look like:\r
-   EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
- EFI_WIN_NT_FILE_SYSTEM =\r
-   <directory path>[!...]\r
-\r
-   Mounting the two directories C:\FOO and C:\BAR would look like:\r
-   EFI_WIN_NT_FILE_SYSTEM=c:\foo!c:\bar\r
-\r
- EFI_WIN_NT_CONSOLE =\r
-   <window title>\r
-\r
-   Declaring a text console window with the title "My EFI Console" woild look like:\r
-   EFI_WIN_NT_CONSOLE=My EFI Console\r
-\r
- EFI_WIN_NT_GOP =\r
-   <width> <height>[!...]\r
-\r
-   Declaring a two GOP windows with resolutions of 800x600 and 1024x768 would look like:\r
-   Example : EFI_WIN_NT_GOP=800 600!1024 768\r
-\r
- EFI_WIN_NT_SERIAL_PORT =\r
-   <port name>[!...]\r
-\r
-   Declaring two serial ports on COM1 and COM2 would look like:\r
-   Example : EFI_WIN_NT_SERIAL_PORT=COM1!COM2\r
-\r
- EFI_WIN_NT_PASS_THROUGH =\r
-   <BaseAddress>;<Bus#>;<Device#>;<Function#>\r
-\r
-   Declaring a base address of 0xE0000000 (used for PCI Express devices)\r
-   and having NT32 talk to a device located at bus 0, device 1, function 0:\r
-   Example : EFI_WIN_NT_PASS_THROUGH=E000000;0;1;0\r
-\r
----*/\r
-\r
-#ifndef __NT_BUS_DRIVER_H__\r
-#define __NT_BUS_DRIVER_H__\r
-\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-//\r
-// WinNt Bus Driver Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gWinNtBusDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gWinNtBusDriverComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gWinNtBusDriverComponentName2;\r
-\r
-//\r
-// WinNt Bus Controller Structure\r
-//\r
-#define WIN_NT_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'B', 'D')\r
-\r
-typedef struct {\r
-  UINT64                    Signature;\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-} WIN_NT_BUS_DEVICE;\r
-\r
-//\r
-// WinNt Child Device Controller Structure\r
-//\r
-#define WIN_NT_IO_DEVICE_SIGNATURE  SIGNATURE_32 ('N', 'T', 'V', 'D')\r
-\r
-typedef struct {\r
-  UINT64                    Signature;\r
-  EFI_HANDLE                Handle;\r
-  EFI_WIN_NT_IO_PROTOCOL    WinNtIo;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-\r
-  //\r
-  // Private data about the parent\r
-  //\r
-  EFI_HANDLE                ControllerHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-\r
-} WIN_NT_IO_DEVICE;\r
-\r
-#define WIN_NT_IO_DEVICE_FROM_THIS(a) \\r
-  CR(a, WIN_NT_IO_DEVICE, WinNtIo, WIN_NT_IO_DEVICE_SIGNATURE)\r
-\r
-//\r
-// This is the largest env variable we can parse\r
-//\r
-#define MAX_NT_ENVIRNMENT_VARIABLE_LENGTH 512\r
-\r
-typedef struct {\r
-  UINTN               Token;\r
-  EFI_GUID            *DevicePathGuid;\r
-} NT_PCD_ENTRY;\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH  VendorDevicePath;\r
-  UINT32              Instance;\r
-} WIN_NT_VENDOR_DEVICE_PATH_NODE;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoInitialize (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
-**/\r
-;\r
-\r
-//\r
-// Driver Binding Protocol function prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Handle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     ParentHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  ParentHandle        - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBusDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// WinNt Bus Driver private worker functions\r
-//\r
-EFI_DEVICE_PATH_PROTOCOL  *\r
-WinNtBusCreateDevicePath (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *RootDevicePath,\r
-  IN  EFI_GUID                  *Guid,\r
-  IN  UINT16                    InstanceNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  RootDevicePath  - TODO: add argument description\r
-  Guid            - TODO: add argument description\r
-  InstanceNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-\r
-#endif\r
diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf
deleted file mode 100644 (file)
index a39ee30..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-## @file\r
-# Win NT Bus driver\r
-#\r
-# This following section documents the envirnoment variables for the Win NT\r
-#  build. These variables are used to define the (virtual) hardware\r
-#  configuration of the NT environment\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtBusDriverDxe\r
-  FILE_GUID                      = BD7E9A27-D6C5-416a-B245-5F507D95B2BD\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeWinNtBusDriver\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gWinNtBusDriverBinding\r
-#  COMPONENT_NAME                =  gWinNtBusDriverComponentName\r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  WinNtBusDriver.c\r
-  WinNtBusDriver.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  PcdLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiWinNtConsoleGuid                          # ALWAYS_CONSUMED\r
-  gEfiWinNtGopGuid                              # ALWAYS_CONSUMED\r
-  gEfiWinNtSerialPortGuid                       # ALWAYS_CONSUMED\r
-  gEfiWinNtFileSystemGuid                       # ALWAYS_CONSUMED\r
-  gEfiWinNtPhysicalDisksGuid                    # ALWAYS_CONSUMED\r
-  gEfiWinNtVirtualDisksGuid                     # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gWinNtBusDriverGuid                           # PROTOCOL BY_START\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL BY_START\r
-  gEfiWinNtThunkProtocolGuid                    # PROTOCOL TO_START\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL BY_START\r
-\r
-\r
-[Pcd]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole\r
-\r
diff --git a/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf b/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
deleted file mode 100644 (file)
index 9e0ae24..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file\r
-# Component description file for WinNtFwh module\r
-#\r
-# This PEIM will produce the HOB to describe Firmware Volume, Firmware Devices\r
-#  on the NT32 emulator.\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtFirmwareVolumePei\r
-  FILE_GUID                      = F0384FFD-8633-452f-9010-F6B7D2EAE2F1\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = PeimInitializeWinNtFwh\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  WinntFwh.c\r
-\r
-[Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-  PcdLib  \r
-\r
-[Ppis]\r
-  gNtFwhPpiGuid                                 # PPI ALWAYS_CONSUMED\r
-\r
-[Pcd]\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-\r
-[Depex]\r
-  gNtFwhPpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid\r
diff --git a/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c b/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c
deleted file mode 100644 (file)
index f489bb7..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-  WinNtFwh.c\r
-    \r
-Abstract:\r
-  PEIM to abstract construction of firmware volume in a Windows NT environment.\r
-\r
-Revision History\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-#include <WinNtPeim.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/NtFwh.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeWinNtFwh (\r
-  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Perform a call-back into the SEC simulator to get address of the Firmware Hub\r
-\r
-Arguments:\r
-  FfsHeader   - Ffs Header available to every PEIM\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
-  NT_FWH_PPI                  *FwhPpi;\r
-  EFI_PHYSICAL_ADDRESS        FdBase;\r
-  EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;\r
-  UINT64                      FdSize;\r
-  UINTN                       Index;\r
-\r
-  DEBUG ((EFI_D_ERROR, "NT 32 Firmware Volume PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the Fwh Information PPI\r
-  //\r
-  Status = (**PeiServices).LocatePpi (\r
-                            (const EFI_PEI_SERVICES **)PeiServices,\r
-                            &gNtFwhPpiGuid, // GUID\r
-                            0,              // INSTANCE\r
-                            &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
-                            (VOID**)&FwhPpi         // PPI\r
-                            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Index = 0;\r
-  do {\r
-    //\r
-    // Get information about all the FD's in the system\r
-    //\r
-    Status = FwhPpi->NtFwh (Index, &FdBase, &FdSize);\r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // Assume the FD starts with an FV header\r
-      //\r
-      FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) FdBase;\r
-\r
-      //\r
-      // Make an FV Hob for the first FV in the FD\r
-      //\r
-      BuildFvHob (FdBase, FvHeader->FvLength);\r
-\r
-      if (Index == 0) {\r
-        //\r
-        // Assume the first FD was produced by the NT32.DSC\r
-        //  All these strange offests are needed to keep in\r
-        //  sync with the FlashMap and NT32.dsc file\r
-        //\r
-        BuildResourceDescriptorHob (\r
-          EFI_RESOURCE_FIRMWARE_DEVICE,\r
-          (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),\r
-          FdBase,\r
-          ( \r
-            FvHeader->FvLength + \r
-            PcdGet32 (PcdFlashNvStorageVariableSize) +\r
-            PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-            PcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-            PcdGet32 (PcdWinNtFlashNvStorageEventLogSize)\r
-          )\r
-          );\r
-        //\r
-        // Hard code the address of the spare block and variable services.\r
-        //  Assume it's a hard coded offset from FV0 in FD0.\r
-        //\r
-        FdSize  = \r
-          PcdGet32 (PcdFlashNvStorageVariableSize) +\r
-          PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-          PcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-          PcdGet32 (PcdWinNtFlashNvStorageEventLogSize);\r
-\r
-        BuildFvHob (FdBase + PcdGet32 (PcdWinNtFlashNvStorageVariableBase), FdSize);\r
-      } else {\r
-        //\r
-        // For other FD's just map them in.\r
-        //\r
-        BuildResourceDescriptorHob (\r
-          EFI_RESOURCE_FIRMWARE_DEVICE,\r
-          (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),\r
-          FdBase,\r
-          FdSize\r
-          );\r
-      }\r
-    }\r
-\r
-    Index++;\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/WinNtFlashMapPei/FlashMap.c b/Nt32Pkg/WinNtFlashMapPei/FlashMap.c
deleted file mode 100644 (file)
index cbb92a8..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  FlashMap.c\r
-   \r
-Abstract:\r
-\r
-  PEIM to build GUIDed HOBs for platform specific flash map\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-\r
-#include <WinNtPeim.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/NtFwh.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeFlashMap (\r
-  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Build GUIDed HOBs for platform specific flash map\r
-  \r
-Arguments:\r
-  FfsHeader   - A pointer to the EFI_FFS_FILE_HEADER structure.\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  EFI_STATUS\r
-\r
---*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  NT_FWH_PPI              *NtFwhPpi;\r
-  EFI_PHYSICAL_ADDRESS    FdBase;\r
-  UINT64                  FdSize;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-\r
-  DEBUG ((EFI_D_ERROR, "NT 32 Flash Map PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the Fwh Information PPI\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-            &gNtFwhPpiGuid, // GUID\r
-            0,              // INSTANCE\r
-            &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
-            (VOID**)&NtFwhPpi       // PPI\r
-            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Assume that FD0 contains the Flash map.\r
-  //\r
-  Status = NtFwhPpi->NtFwh (0, &FdBase, &FdSize);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Relocate the base of FV region \r
-  // \r
-  if (FdBase >= BASE_4GB) {\r
-    PcdSet64 (PcdFlashNvStorageVariableBase64, PcdGet32 (PcdWinNtFlashNvStorageVariableBase) + (UINT64) FdBase);\r
-    PcdSet64 (PcdFlashNvStorageFtwWorkingBase64, PcdGet32 (PcdWinNtFlashNvStorageFtwWorkingBase) + (UINT64) FdBase);\r
-    PcdSet64 (PcdFlashNvStorageFtwSpareBase64, PcdGet32 (PcdWinNtFlashNvStorageFtwSpareBase) + (UINT64) FdBase);\r
-  } else {\r
-    PcdSet32 (PcdFlashNvStorageVariableBase, PcdGet32 (PcdWinNtFlashNvStorageVariableBase) + (UINT32) FdBase);\r
-    PcdSet32 (PcdFlashNvStorageFtwWorkingBase, PcdGet32 (PcdWinNtFlashNvStorageFtwWorkingBase) + (UINT32) FdBase);\r
-    PcdSet32 (PcdFlashNvStorageFtwSpareBase, PcdGet32 (PcdWinNtFlashNvStorageFtwSpareBase) + (UINT32) FdBase);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf b/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf
deleted file mode 100644 (file)
index b52438e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-## @file\r
-# Component description file for FlashMap PEI module\r
-#\r
-# This module installs FlashMap PPI which is used to get flash layout information.\r
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtFlashMapPei\r
-  FILE_GUID                      = 681F3771-6F1D-42DE-9AA2-F82BBCDBC5F9\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeFlashMap\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
-#\r
-\r
-[Sources]\r
-  FlashMap.c\r
-\r
-[Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  PcdLib\r
-  PeiServicesLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-[Ppis]\r
-  gNtFwhPpiGuid                                 # PPI ALWAYS_CONSUMED\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64\r
-\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase\r
-  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase\r
-\r
-[Depex]\r
-  gNtFwhPpiGuid\r
diff --git a/Nt32Pkg/WinNtGopDxe/ComponentName.c b/Nt32Pkg/WinNtGopDxe/ComponentName.c
deleted file mode 100644 (file)
index 873b88b..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/GraphicsOutput.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include "WinNtGop.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gWinNtGopComponentName = {\r
-  WinNtGopComponentNameGetDriverName,\r
-  WinNtGopComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtGopComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtGopComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtGopComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtGopDriverNameTable[] = {\r
-  { "eng;en", L"Windows GOP Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mWinNtGopDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gWinNtGopComponentName)\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS                   Status;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
-  GOP_PRIVATE_DATA             *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gWinNtGopDriverBinding.DriverBindingHandle,\r
-             &gEfiWinNtIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  (VOID **) &GraphicsOutput,\r
-                  gWinNtGopDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (GraphicsOutput);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gWinNtGopComponentName)\r
-           );\r
-}\r
diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGop.h b/Nt32Pkg/WinNtGopDxe/WinNtGop.h
deleted file mode 100644 (file)
index fbf1e0b..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtGop.h\r
-\r
-Abstract:\r
-\r
-  Private data for the Gop driver that is bound to the WinNt Thunk protocol\r
-\r
-\r
-**/\r
-\r
-#ifndef _WIN_NT_GOP_H_\r
-#define _WIN_NT_GOP_H_\r
-\r
-\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/SimpleTextInEx.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/GraphicsOutput.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-//\r
-// WM_SYSKEYDOWN/WM_SYSKEYUP Notification\r
-// lParam\r
-// bit 24: Specifies whether the key is an extended key,\r
-// such as the right-hand ALT and CTRL keys that appear on\r
-// an enhanced 101- or 102-key keyboard.\r
-// The value is 1 if it is an extended key; otherwise, it is 0.\r
-// bit 29:Specifies the context code.\r
-// The value is 1 if the ALT key is down while the key is pressed/released;\r
-// it is 0 if the WM_SYSKEYDOWN message is posted to the active window\r
-// because no window has the keyboard focus.\r
-#define GOP_EXTENDED_KEY         (0x1 << 24)\r
-#define GOP_ALT_KEY_PRESSED      (0x1 << 29)\r
-\r
-#define KEYBOARD_TIMER_INTERVAL         200000  // 0.02s\r
-\r
-#define MAX_Q 256\r
-\r
-typedef struct {\r
-  UINTN             Front;\r
-  UINTN             Rear;\r
-  EFI_KEY_DATA      Q[MAX_Q];\r
-  CRITICAL_SECTION  Cs;\r
-} GOP_QUEUE_FIXED;\r
-\r
-#define WIN_NT_GOP_CLASS_NAME       L"WinNtGopWindow"\r
-\r
-#define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('S', 'g', 'o', 'N')\r
-\r
-#define WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('W', 'g', 'S', 'n')\r
-\r
-typedef struct _WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY {\r
-  UINTN                                 Signature;\r
-  EFI_KEY_DATA                          KeyData;\r
-  EFI_KEY_NOTIFY_FUNCTION               KeyNotificationFn;\r
-  LIST_ENTRY                            NotifyEntry;\r
-} WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY;\r
-\r
-#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r
-\r
-typedef struct {\r
-  UINT32                     HorizontalResolution;\r
-  UINT32                     VerticalResolution;\r
-  UINT32                     ColorDepth;\r
-  UINT32                     RefreshRate;\r
-} GOP_MODE_DATA;\r
-\r
-typedef struct {\r
-  UINT64                        Signature;\r
-\r
-  EFI_HANDLE                    Handle;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL  GraphicsOutput;\r
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL   SimpleTextIn;\r
-\r
-  EFI_WIN_NT_THUNK_PROTOCOL     *WinNtThunk;\r
-\r
-  EFI_UNICODE_STRING_TABLE      *ControllerNameTable;\r
-\r
-  //\r
-  // GOP Private Data for QueryMode ()\r
-  //\r
-  GOP_MODE_DATA                 *ModeData;\r
-\r
-  //\r
-  // GOP Private Data knowing when to start hardware\r
-  //\r
-  BOOLEAN                       HardwareNeedsStarting;\r
-\r
-  CHAR16                        *WindowName;\r
-  CHAR16                        Buffer[160];\r
-\r
-  HANDLE                        ThreadInited; // Semaphore\r
-  HANDLE                        ThreadHandle; // Thread\r
-  DWORD                         ThreadId;\r
-\r
-  HWND                          WindowHandle;\r
-  WNDCLASSEX                    WindowsClass;\r
-\r
-  //\r
-  // This screen is used to redraw the scree when windows events happen. It's\r
-  // updated in the main thread and displayed in the windows thread.\r
-  //\r
-  BITMAPV4HEADER                *VirtualScreenInfo;\r
-  RGBQUAD                       *VirtualScreen;\r
-\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;\r
-\r
-  //\r
-  // Keyboard Queue used by Simple Text In.\r
-  // QueueForRead:   WinProc thread adds, and main thread removes.\r
-  // QueueForNotify: WinProc thread adds, and timer thread removes.\r
-  //\r
-  GOP_QUEUE_FIXED               QueueForRead;\r
-  GOP_QUEUE_FIXED               QueueForNotify;\r
-\r
-  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx;\r
-  EFI_KEY_STATE                     KeyState;\r
-  LIST_ENTRY                        NotifyList;\r
-  BOOLEAN                           LeftShift;\r
-  BOOLEAN                           RightShift;\r
-  BOOLEAN                           LeftAlt;\r
-  BOOLEAN                           RightAlt;\r
-  BOOLEAN                           LeftCtrl;\r
-  BOOLEAN                           RightCtrl;\r
-  BOOLEAN                           LeftLogo;\r
-  BOOLEAN                           RightLogo;\r
-  BOOLEAN                           Menu;\r
-  BOOLEAN                           SysReq;\r
-  BOOLEAN                           NumLock;\r
-  BOOLEAN                           ScrollLock;\r
-  BOOLEAN                           CapsLock;\r
-  BOOLEAN                           IsPartialKeySupport;\r
-  EFI_EVENT                         TimerEvent;\r
-} GOP_PRIVATE_DATA;\r
-\r
-#define GOP_PRIVATE_DATA_FROM_THIS(a)  \\r
-         CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)\r
-\r
-#define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a)  \\r
-         CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)\r
-\r
-#define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a)  \\r
-         CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)\r
-\r
-//\r
-// Global Protocol Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gWinNtGopDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gWinNtGopComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gWinNtGopComponentName2;\r
-\r
-\r
-//\r
-// Gop Hardware abstraction internal worker functions\r
-//\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  WinNtIo              TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopSupported (\r
-  IN  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private              TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopConstructor (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private              TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopDestructor (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  );\r
-\r
-//\r
-// UEFI 2.0 driver model prototypes for Win NT GOP\r
-//\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  ImageHandle          TODO: add argument description\r
-  @param  SystemTable          TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopInitialize (\r
-  IN EFI_HANDLE            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE      *SystemTable\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  This                 TODO: add argument description\r
-  @param  Handle               TODO: add argument description\r
-  @param  RemainingDevicePath  TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  This                 TODO: add argument description\r
-  @param  Handle               TODO: add argument description\r
-  @param  RemainingDevicePath  TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  This                 TODO: add argument description\r
-  @param  Handle               TODO: add argument description\r
-  @param  NumberOfChildren     TODO: add argument description\r
-  @param  ChildHandleBuffer    TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private              TODO: add argument description\r
-  @param  Key                  TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateAddKey (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  EFI_INPUT_KEY       Key\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private              TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopInitializeSimpleTextInForWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  );\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private              TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopDestroySimpleTextInForWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  );\r
-\r
-\r
-\r
-#endif\r
diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c b/Nt32Pkg/WinNtGopDxe/WinNtGopDriver.c
deleted file mode 100644 (file)
index a2138d0..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtGopDriver.c\r
-\r
-Abstract:\r
-\r
-  This file implements the UEFI Device Driver model requirements for GOP\r
-\r
-  GOP is short hand for Graphics Output Protocol.\r
-\r
-\r
-**/\r
-#include "WinNtGop.h"\r
-\r
-EFI_STATUS\r
-FreeNotifyList (\r
-  IN OUT LIST_ENTRY           *ListHead\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  ListHead   - The list head\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Free the notify list successfully\r
-  EFI_INVALID_PARAMETER - ListHead is invalid.\r
-\r
---*/\r
-{\r
-  WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NotifyNode;\r
-\r
-  if (ListHead == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  while (!IsListEmpty (ListHead)) {\r
-    NotifyNode = CR (\r
-                   ListHead->ForwardLink, \r
-                   WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY, \r
-                   NotifyEntry, \r
-                   WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
-                   );\r
-    RemoveEntryList (ListHead->ForwardLink);\r
-    gBS->FreePool (NotifyNode);\r
-  }\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding = {\r
-  WinNtGopDriverBindingSupported,\r
-  WinNtGopDriverBindingStart,\r
-  WinNtGopDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-/**\r
-  The user Entry Point for module WinNtGop. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtGop(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Install driver model protocol(s).\r
-  //\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gWinNtGopDriverBinding,\r
-             ImageHandle,\r
-             &gWinNtGopComponentName,\r
-             &gWinNtGopComponentName2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = WinNtGopSupported (WinNtIo);\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiWinNtIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-{\r
-  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo;\r
-  EFI_STATUS              Status;\r
-  GOP_PRIVATE_DATA        *Private;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Allocate Private context data for SGO inteface.\r
-  //\r
-  Private = NULL;\r
-  Private = AllocatePool (sizeof (GOP_PRIVATE_DATA));\r
-  if (Private == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-  //\r
-  // Set up context record\r
-  //\r
-  Private->Signature            = GOP_PRIVATE_DATA_SIGNATURE;\r
-  Private->Handle               = Handle;\r
-  Private->WinNtThunk           = WinNtIo->WinNtThunk;\r
-\r
-  Private->ControllerNameTable  = NULL;\r
-\r
-  AddUnicodeString2 (\r
-    "eng",\r
-    gWinNtGopComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    TRUE\r
-    );\r
-  AddUnicodeString2 (\r
-    "en",\r
-    gWinNtGopComponentName2.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    FALSE\r
-    );\r
-\r
-\r
-  Private->WindowName = WinNtIo->EnvString;\r
-\r
-  Status              = WinNtGopConstructor (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Publish the Gop interface to the world\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Private->Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  &Private->GraphicsOutput,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  &gEfiSimpleTextInputExProtocolGuid,\r
-                  &Private->SimpleTextInEx,\r
-                  NULL\r
-                  );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    if (Private != NULL) {\r
-      //\r
-      // On Error Free back private data\r
-      //\r
-      if (Private->ControllerNameTable != NULL) {\r
-        FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      }\r
-\r
-      if (Private->SimpleTextIn.WaitForKey != NULL) {\r
-        gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-      }\r
-      if (Private->SimpleTextInEx.WaitForKeyEx != NULL) {\r
-        gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
-      }\r
-      FreeNotifyList (&Private->NotifyList);\r
-      FreePool (Private);\r
-    }\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    NumberOfChildren - add argument and description to function comment\r
-// TODO:    ChildHandleBuffer - add argument and description to function comment\r
-// TODO:    EFI_NOT_STARTED - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-{\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
-  EFI_STATUS                   Status;\r
-  GOP_PRIVATE_DATA             *Private;\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  (VOID **) &GraphicsOutput,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // If the GOP interface does not exist the driver is not started\r
-    //\r
-    return EFI_NOT_STARTED;\r
-  }\r
-\r
-  //\r
-  // Get our private context information\r
-  //\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (GraphicsOutput);\r
-\r
-  //\r
-  // Remove the SGO interface from the system\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Private->Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  &Private->GraphicsOutput,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  &gEfiSimpleTextInputExProtocolGuid,\r
-                  &Private->SimpleTextInEx,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Shutdown the hardware\r
-    //\r
-    Status = WinNtGopDestructor (Private);\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-    Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-    ASSERT_EFI_ERROR (Status);\r
-    Status = gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
-    ASSERT_EFI_ERROR (Status);\r
-    FreeNotifyList (&Private->NotifyList);\r
-\r
-    gBS->FreePool (Private);\r
-\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf b/Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf
deleted file mode 100644 (file)
index 3218f9c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-## @file\r
-# Gop Driver\r
-#\r
-# GOP is short hand for UEFI Graphics Output protocol.\r
-#  This file is a verision of GopIo the uses WinNtThunk system calls as an IO\r
-#  abstraction. For a PCI device WinNtIo would be replaced with\r
-#  a PCI IO abstraction that abstracted a specific PCI device.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtGopDxe\r
-  FILE_GUID                      = 29b3c4c6-e5aa-49e4-8ce0-2772f782ddc2\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeWinNtGop\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gWinNtGopDriverBinding                       \r
-#  COMPONENT_NAME                =  gWinNtGopComponentName                       \r
-#\r
-\r
-[Sources]\r
-  WinNtGopDriver.c\r
-  ComponentName.c\r
-  WinNtGop.h\r
-  WinNtGopInput.c\r
-  WinNtGopScreen.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 # SOMETIMES_CONSUMED  Create Event: EVENT_GROUP_GUID\r
-  gEfiWinNtGopGuid                              # ALWAYS_CONSUMED\r
-\r
-[Protocols]\r
-  gEfiGraphicsOutputProtocolGuid                # PROTOCOL BY_START\r
-  gEfiSimpleTextInProtocolGuid                  # PROTOCOL BY_START\r
-  gEfiSimpleTextInputExProtocolGuid             # PROTOCOL BY_START\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL TO_START\r
diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGopInput.c b/Nt32Pkg/WinNtGopDxe/WinNtGopInput.c
deleted file mode 100644 (file)
index 2e11ac1..0000000
+++ /dev/null
@@ -1,1057 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtGopInput.c\r
-\r
-Abstract:\r
-\r
-  This file produces the Simple Text In for an Gop window.\r
-\r
-  This stuff is linked at the hip to the Window, since the window\r
-  processing is done in a thread kicked off in WinNtGopImplementation.c\r
-\r
-  Since the window information is processed in an other thread we need\r
-  a keyboard Queue to pass data about. The Simple Text In code just\r
-  takes data off the Queue. The WinProc message loop takes keyboard input\r
-  and places it in the Queue.\r
-\r
-\r
-**/\r
-\r
-\r
-#include "WinNtGop.h"\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateCreateQ (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  GOP_QUEUE_FIXED     *Queue\r
-  )\r
-{\r
-  Private->WinNtThunk->InitializeCriticalSection (&Queue->Cs);\r
-  Queue->Front = 0;\r
-  Queue->Rear  = 0;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateDestroyQ (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  GOP_QUEUE_FIXED     *Queue\r
-  )\r
-{\r
-  Queue->Front = 0;\r
-  Queue->Rear  = 0;\r
-  Private->WinNtThunk->DeleteCriticalSection (&Queue->Cs);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-  @param  Key                   TODO: add argument description\r
-\r
-  @retval EFI_NOT_READY         TODO: Add description for return value\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateAddQ (\r
-  IN GOP_PRIVATE_DATA     *Private,\r
-  IN GOP_QUEUE_FIXED      *Queue,\r
-  IN EFI_KEY_DATA         *KeyData\r
-  )\r
-{\r
-  Private->WinNtThunk->EnterCriticalSection (&Queue->Cs);\r
-\r
-  if ((Queue->Rear + 1) % MAX_Q == Queue->Front) {\r
-    Private->WinNtThunk->LeaveCriticalSection (&Queue->Cs);\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
-  CopyMem (&Queue->Q[Queue->Rear], KeyData, sizeof (EFI_KEY_DATA));\r
-  Queue->Rear           = (Queue->Rear + 1) % MAX_Q;\r
-\r
-  Private->WinNtThunk->LeaveCriticalSection (&Queue->Cs);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-  @param  Key                   TODO: add argument description\r
-\r
-  @retval EFI_NOT_READY         TODO: Add description for return value\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateDeleteQ (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  GOP_QUEUE_FIXED     *Queue,\r
-  OUT EFI_KEY_DATA        *Key\r
-  )\r
-{\r
-  Private->WinNtThunk->EnterCriticalSection (&Queue->Cs);\r
-\r
-  if (Queue->Front == Queue->Rear) {\r
-    Private->WinNtThunk->LeaveCriticalSection (&Queue->Cs);\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
-  CopyMem (Key, &Queue->Q[Queue->Front], sizeof (EFI_KEY_DATA));\r
-  Queue->Front  = (Queue->Front + 1) % MAX_Q;\r
-\r
-  if (Key->Key.ScanCode == SCAN_NULL && Key->Key.UnicodeChar == CHAR_NULL) {\r
-    if (!Private->IsPartialKeySupport) {\r
-      //\r
-      // If partial keystrok is not enabled, don't return the partial keystroke.\r
-      //\r
-      Private->WinNtThunk->LeaveCriticalSection (&Queue->Cs);\r
-      ZeroMem (Key, sizeof (EFI_KEY_DATA));\r
-      return EFI_NOT_READY;\r
-    }\r
-  }\r
-  Private->WinNtThunk->LeaveCriticalSection (&Queue->Cs);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-\r
-  @retval EFI_NOT_READY         TODO: Add description for return value\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateCheckQ (\r
-  IN  GOP_QUEUE_FIXED     *Queue\r
-  )\r
-{\r
-  if (Queue->Front == Queue->Rear) {\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-BOOLEAN\r
-GopPrivateIsKeyRegistered (\r
-  IN EFI_KEY_DATA  *RegsiteredData,\r
-  IN EFI_KEY_DATA  *InputData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  RegsiteredData    - A pointer to a buffer that is filled in with the keystroke\r
-                      state data for the key that was registered.\r
-  InputData         - A pointer to a buffer that is filled in with the keystroke\r
-                      state data for the key that was pressed.\r
-\r
-Returns:\r
-  TRUE              - Key be pressed matches a registered key.\r
-  FLASE             - Match failed.\r
-\r
---*/\r
-{\r
-  ASSERT (RegsiteredData != NULL && InputData != NULL);\r
-\r
-  if ((RegsiteredData->Key.ScanCode    != InputData->Key.ScanCode) ||\r
-      (RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar)) {\r
-    return FALSE;\r
-  }\r
-\r
-  //\r
-  // Assume KeyShiftState/KeyToggleState = 0 in Registered key data means these state could be ignored.\r
-  //\r
-  if (RegsiteredData->KeyState.KeyShiftState != 0 &&\r
-      RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState) {\r
-    return FALSE;\r
-  }\r
-  if (RegsiteredData->KeyState.KeyToggleState != 0 &&\r
-      RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState) {\r
-    return FALSE;\r
-  }\r
-\r
-  return TRUE;\r
-\r
-}\r
-\r
-\r
-VOID\r
-GopPrivateInvokeRegisteredFunction (\r
-  IN GOP_PRIVATE_DATA                     *Private,\r
-  IN EFI_KEY_DATA                         *KeyData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function updates the status light of NumLock, ScrollLock and CapsLock.\r
-\r
-Arguments:\r
-\r
-  Private       - The private structure of WinNt Gop device.\r
-  KeyData       - A pointer to a buffer that is filled in with the keystroke\r
-                  state data for the key that was pressed.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - The status light is updated successfully.\r
-\r
---*/\r
-{\r
-  LIST_ENTRY                          *Link;\r
-  WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY  *CurrentNotify;\r
-\r
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {\r
-    CurrentNotify = CR (\r
-                      Link,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY,\r
-                      NotifyEntry,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
-                      );\r
-    if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {\r
-      CurrentNotify->KeyNotificationFn (KeyData);\r
-    }\r
-  }\r
-}\r
-\r
-VOID\r
-WinNtGopSimpleTextInTimerHandler (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-  EFI_KEY_DATA      KeyData;\r
-\r
-  Private = (GOP_PRIVATE_DATA *)Context;\r
-  while (GopPrivateDeleteQ (Private, &Private->QueueForNotify, &KeyData) == EFI_SUCCESS) {\r
-    GopPrivateInvokeRegisteredFunction (Private, &KeyData);\r
-  }\r
-}\r
-\r
-/**\r
-  Initialize the key state.\r
-\r
-  @param  Private               The GOP_PRIVATE_DATA instance.\r
-  @param  KeyState              A pointer to receive the key state information.\r
-**/\r
-VOID\r
-InitializeKeyState (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  EFI_KEY_STATE       *KeyState\r
-  )\r
-{\r
-  KeyState->KeyShiftState  = EFI_SHIFT_STATE_VALID;\r
-  KeyState->KeyToggleState = EFI_TOGGLE_STATE_VALID;\r
-\r
-  //\r
-  // Record Key shift state and toggle state\r
-  //\r
-  if (Private->LeftCtrl) {\r
-    KeyState->KeyShiftState  |= EFI_LEFT_CONTROL_PRESSED;\r
-  }\r
-  if (Private->RightCtrl) {\r
-    KeyState->KeyShiftState  |= EFI_RIGHT_CONTROL_PRESSED;\r
-  }\r
-  if (Private->LeftAlt) {\r
-    KeyState->KeyShiftState  |= EFI_LEFT_ALT_PRESSED;\r
-  }\r
-  if (Private->RightAlt) {\r
-    KeyState->KeyShiftState  |= EFI_RIGHT_ALT_PRESSED;\r
-  }\r
-  if (Private->LeftShift) {\r
-    KeyState->KeyShiftState  |= EFI_LEFT_SHIFT_PRESSED;\r
-  }\r
-  if (Private->RightShift) {\r
-    KeyState->KeyShiftState  |= EFI_RIGHT_SHIFT_PRESSED;\r
-  }\r
-  if (Private->LeftLogo) {\r
-    KeyState->KeyShiftState  |= EFI_LEFT_LOGO_PRESSED;\r
-  }\r
-  if (Private->RightLogo) {\r
-    KeyState->KeyShiftState  |= EFI_RIGHT_LOGO_PRESSED;\r
-  }\r
-  if (Private->Menu) {\r
-    KeyState->KeyShiftState  |= EFI_MENU_KEY_PRESSED;\r
-  }\r
-  if (Private->SysReq) {\r
-    KeyState->KeyShiftState  |= EFI_SYS_REQ_PRESSED;\r
-  }\r
-  if (Private->CapsLock) {\r
-    KeyState->KeyToggleState |= EFI_CAPS_LOCK_ACTIVE;\r
-  }\r
-  if (Private->NumLock) {\r
-    KeyState->KeyToggleState |= EFI_NUM_LOCK_ACTIVE;\r
-  }\r
-  if (Private->ScrollLock) {\r
-    KeyState->KeyToggleState |= EFI_SCROLL_LOCK_ACTIVE;\r
-  }\r
-  if (Private->IsPartialKeySupport) {\r
-    KeyState->KeyToggleState |= EFI_KEY_STATE_EXPOSED;\r
-  }\r
-}\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-  @param  Key                   TODO: add argument description\r
-\r
-  @retval EFI_NOT_READY         TODO: Add description for return value\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-GopPrivateAddKey (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  EFI_INPUT_KEY       Key\r
-  )\r
-{\r
-  EFI_KEY_DATA            KeyData;\r
-\r
-  KeyData.Key = Key;\r
-  InitializeKeyState (Private, &KeyData.KeyState);\r
-\r
-  //\r
-  // Convert Ctrl+[1-26] to Ctrl+[A-Z]\r
-  //\r
-  if ((Private->LeftCtrl || Private->RightCtrl) &&\r
-      (KeyData.Key.UnicodeChar >= 1) && (KeyData.Key.UnicodeChar <= 26)\r
-     ) {\r
-    if ((Private->LeftShift || Private->RightShift) == Private->CapsLock) {\r
-      KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar + L'a' - 1);\r
-    } else {\r
-      KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar + L'A' - 1);\r
-    }\r
-  }\r
-\r
-  //\r
-  // Unmask the Shift bit for printable char\r
-  //\r
-  if (((KeyData.Key.UnicodeChar >= L'a') && (KeyData.Key.UnicodeChar <= L'z')) ||\r
-      ((KeyData.Key.UnicodeChar >= L'A') && (KeyData.Key.UnicodeChar <= L'Z'))\r
-     ) {\r
-    KeyData.KeyState.KeyShiftState &= ~(EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED);\r
-  }\r
-\r
-  GopPrivateAddQ (Private, &Private->QueueForNotify, &KeyData);\r
-\r
-  GopPrivateAddQ (Private, &Private->QueueForRead, &KeyData);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-GopPrivateUpdateStatusLight (\r
-  IN GOP_PRIVATE_DATA                     *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function updates the status light of NumLock, ScrollLock and CapsLock.\r
-\r
-Arguments:\r
-\r
-  Private       - The private structure of WinNt console In/Out.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - The status light is updated successfully.\r
-\r
---*/\r
-{\r
-  //\r
-  // BUGBUG:Only SendInput/keybd_event function can toggle\r
-  // NumLock, CapsLock and ScrollLock keys.\r
-  // Neither of these functions is included in EFI_WIN_NT_THUNK_PROTOCOL.\r
-  // Thus, return immediately without operation.\r
-  //\r
-  return EFI_SUCCESS;\r
-\r
-}\r
-\r
-\r
-EFI_STATUS\r
-GopPrivateResetWorker (\r
-  IN GOP_PRIVATE_DATA                     *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function is a worker function for SimpleTextIn/SimpleTextInEx.Reset().\r
-\r
-Arguments:\r
-\r
-  Private     - WinNT GOP private structure\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - Reset successfully\r
-\r
---*/\r
-{\r
-  EFI_KEY_DATA      KeyData;\r
-  EFI_TPL           OldTpl;\r
-\r
-  //\r
-  // Enter critical section\r
-  //\r
-  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  //\r
-  // A reset is draining the Queue\r
-  //\r
-  while (GopPrivateDeleteQ (Private, &Private->QueueForRead, &KeyData) == EFI_SUCCESS)\r
-    ;\r
-  while (GopPrivateDeleteQ (Private, &Private->QueueForNotify, &KeyData) == EFI_SUCCESS)\r
-    ;\r
-\r
-  Private->LeftShift               = FALSE;\r
-  Private->RightShift              = FALSE;\r
-  Private->LeftAlt                 = FALSE;\r
-  Private->RightAlt                = FALSE;\r
-  Private->LeftCtrl                = FALSE;\r
-  Private->RightCtrl               = FALSE;\r
-  Private->LeftLogo                = FALSE;\r
-  Private->RightLogo               = FALSE;\r
-  Private->Menu                    = FALSE;\r
-  Private->SysReq                  = FALSE;\r
-\r
-  Private->CapsLock                = FALSE;\r
-  Private->NumLock                 = FALSE;\r
-  Private->ScrollLock              = FALSE;\r
-  Private->IsPartialKeySupport     = FALSE;\r
-\r
-  Private->KeyState.KeyShiftState  = EFI_SHIFT_STATE_VALID;\r
-  Private->KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;\r
-\r
-  //\r
-  // Leave critical section and return\r
-  //\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-GopPrivateReadKeyStrokeWorker (\r
-  IN GOP_PRIVATE_DATA                   *Private,\r
-  OUT EFI_KEY_DATA                      *KeyData\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can\r
-    be used to test for existance of a keystroke via WaitForEvent () call.\r
-\r
-  Arguments:\r
-    Private    - The private structure of WinNt Gop device.\r
-    KeyData    - A pointer to a buffer that is filled in with the keystroke\r
-                 state data for the key that was pressed.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The keystroke information was returned.\r
-    EFI_NOT_READY         - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR      - The keystroke information was not returned due to\r
-                            hardware errors.\r
-    EFI_INVALID_PARAMETER - KeyData is NULL.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_TPL                         OldTpl;\r
-\r
-  if (KeyData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Enter critical section\r
-  //\r
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  //\r
-  // Call hot key callback before telling caller there is a key available\r
-  //\r
-  WinNtGopSimpleTextInTimerHandler (NULL, Private);\r
-\r
-  ZeroMem (&KeyData->Key, sizeof (KeyData->Key));\r
-  InitializeKeyState (Private, &KeyData->KeyState);\r
-\r
-  Status  = GopPrivateCheckQ (&Private->QueueForRead);\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // If a Key press exists try and read it.\r
-    //\r
-    Status = GopPrivateDeleteQ (Private, &Private->QueueForRead, KeyData);\r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // If partial keystroke is not enabled, check whether it is value key. If not return\r
-      // EFI_NOT_READY.\r
-      //\r
-      if (!Private->IsPartialKeySupport) {\r
-        if (KeyData->Key.ScanCode == SCAN_NULL && KeyData->Key.UnicodeChar == CHAR_NULL) {\r
-          Status = EFI_NOT_READY;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Leave critical section and return\r
-  //\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-\r
-}\r
-\r
-\r
-//\r
-// Simple Text In implementation.\r
-//\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  This                  TODO: add argument description\r
-  @param  ExtendedVerification  TODO: add argument description\r
-\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInReset (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  IN BOOLEAN                              ExtendedVerification\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);\r
-\r
-  return GopPrivateResetWorker (Private);\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  This                  TODO: add argument description\r
-  @param  Key                   TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInReadKeyStroke (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  OUT EFI_INPUT_KEY                       *Key\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-  EFI_STATUS        Status;\r
-  EFI_KEY_DATA      KeyData;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);\r
-  //\r
-  // Considering if the partial keystroke is enabled, there maybe a partial\r
-  // keystroke in the queue, so here skip the partial keystroke and get the\r
-  // next key from the queue\r
-  //\r
-  while (1) {\r
-    Status = GopPrivateReadKeyStrokeWorker (Private, &KeyData);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-    if (KeyData.Key.ScanCode == SCAN_NULL && KeyData.Key.UnicodeChar == CHAR_NULL) {\r
-      continue;\r
-    }\r
-    //\r
-    // Convert Ctrl+[A-Z] to Ctrl+[1-26]\r
-    //\r
-    if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {\r
-      if ((KeyData.Key.UnicodeChar >= L'a') && (KeyData.Key.UnicodeChar <= L'z')) {\r
-        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'a' + 1);\r
-      } else if ((KeyData.Key.UnicodeChar >= L'A') && (KeyData.Key.UnicodeChar <= L'Z')) {\r
-        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'A' + 1);\r
-      }\r
-    }\r
-    CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));\r
-    return EFI_SUCCESS;\r
-  }  \r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Event                 TODO: add argument description\r
-  @param  Context               TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-WinNtGopSimpleTextInWaitForKey (\r
-  IN EFI_EVENT          Event,\r
-  IN VOID               *Context\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-  EFI_STATUS        Status;\r
-  EFI_TPL           OldTpl;\r
-  EFI_KEY_DATA      KeyData;\r
-\r
-  Private = (GOP_PRIVATE_DATA *) Context;\r
-\r
-  //\r
-  // Enter critical section\r
-  //\r
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  //\r
-  // Call hot key callback before telling caller there is a key available\r
-  //\r
-  WinNtGopSimpleTextInTimerHandler (NULL, Private);\r
-  \r
-  //\r
-  // WaitforKey doesn't suppor the partial key.\r
-  // Considering if the partial keystroke is enabled, there maybe a partial\r
-  // keystroke in the queue, so here skip the partial keystroke and get the\r
-  // next key from the queue\r
-  //\r
-  while (1) {\r
-    Status  = GopPrivateCheckQ (&Private->QueueForRead);\r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // If a there is a key in the queue and it is not partial keystroke,  signal event.\r
-      //\r
-      if (Private->QueueForRead.Q[Private->QueueForRead.Front].Key.ScanCode == SCAN_NULL &&\r
-        Private->QueueForRead.Q[Private->QueueForRead.Front].Key.UnicodeChar == CHAR_NULL) {\r
-        GopPrivateDeleteQ (Private,&Private->QueueForRead,&KeyData);\r
-        continue;\r
-      }\r
-      gBS->SignalEvent (Event);\r
-    } else {\r
-      //\r
-      // We need to sleep or NT will schedule this thread with such high\r
-      // priority that WinProc thread will never run and we will not see\r
-      // keyboard input. This Sleep makes the syste run 10x faster, so don't\r
-      // remove it.\r
-      //\r
-      Private->WinNtThunk->Sleep (1);\r
-    }\r
-    break;\r
-  }\r
-\r
-  //\r
-  // Leave critical section and return\r
-  //\r
-  gBS->RestoreTPL (OldTpl);\r
-}\r
-\r
-//\r
-// Simple Text Input Ex protocol functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInExResetEx (\r
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN BOOLEAN                            ExtendedVerification\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reset the input device and optionaly run diagnostics\r
-\r
-  Arguments:\r
-    This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform diagnostics on reset.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The device was reset.\r
-\r
---*/\r
-{\r
-  GOP_PRIVATE_DATA *Private;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
-\r
-  return GopPrivateResetWorker (Private);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInExReadKeyStrokeEx (\r
-  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-  OUT EFI_KEY_DATA                      *KeyData\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can\r
-    be used to test for existance of a keystroke via WaitForEvent () call.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    KeyData    - A pointer to a buffer that is filled in with the keystroke\r
-                 state data for the key that was pressed.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The keystroke information was returned.\r
-    EFI_NOT_READY         - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR      - The keystroke information was not returned due to\r
-                            hardware errors.\r
-    EFI_INVALID_PARAMETER - KeyData is NULL.\r
-\r
---*/\r
-{\r
-  GOP_PRIVATE_DATA *Private;\r
-\r
-  if (KeyData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
-\r
-  return GopPrivateReadKeyStrokeWorker (Private, KeyData);\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInExSetState (\r
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN EFI_KEY_TOGGLE_STATE               *KeyToggleState\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Set certain state for the input device.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    KeyToggleState        - A pointer to the EFI_KEY_TOGGLE_STATE to set the\r
-                            state for the input device.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The device state was set successfully.\r
-    EFI_DEVICE_ERROR      - The device is not functioning correctly and could\r
-                            not have the setting adjusted.\r
-    EFI_UNSUPPORTED       - The device does not have the ability to set its state.\r
-    EFI_INVALID_PARAMETER - KeyToggleState is NULL.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  GOP_PRIVATE_DATA                *Private;\r
-\r
-  if (KeyToggleState == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
-\r
-  if (((Private->KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID) ||\r
-      ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private->ScrollLock          = FALSE;\r
-  Private->NumLock             = FALSE;\r
-  Private->CapsLock            = FALSE;\r
-  Private->IsPartialKeySupport = FALSE;\r
-\r
-  if ((*KeyToggleState & EFI_SCROLL_LOCK_ACTIVE) == EFI_SCROLL_LOCK_ACTIVE) {\r
-    Private->ScrollLock = TRUE;\r
-  }\r
-  if ((*KeyToggleState & EFI_NUM_LOCK_ACTIVE) == EFI_NUM_LOCK_ACTIVE) {\r
-    Private->NumLock = TRUE;\r
-  }\r
-  if ((*KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == EFI_CAPS_LOCK_ACTIVE) {\r
-    Private->CapsLock = TRUE;\r
-  }\r
-  if ((*KeyToggleState & EFI_KEY_STATE_EXPOSED) == EFI_KEY_STATE_EXPOSED) {\r
-    Private->IsPartialKeySupport = TRUE;\r
-  }\r
-\r
-  Status = GopPrivateUpdateStatusLight (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Private->KeyState.KeyToggleState = *KeyToggleState;\r
-  return EFI_SUCCESS;\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInExRegisterKeyNotify (\r
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN EFI_KEY_DATA                       *KeyData,\r
-  IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,\r
-  OUT VOID                              **NotifyHandle\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Register a notification function for a particular keystroke for the input device.\r
-\r
-  Arguments:\r
-    This                    - Protocol instance pointer.\r
-    KeyData                 - A pointer to a buffer that is filled in with the keystroke\r
-                              information data for the key that was pressed.\r
-    KeyNotificationFunction - Points to the function to be called when the key\r
-                              sequence is typed specified by KeyData.\r
-    NotifyHandle            - Points to the unique handle assigned to the registered notification.\r
-\r
-  Returns:\r
-    EFI_SUCCESS             - The notification function was registered successfully.\r
-    EFI_OUT_OF_RESOURCES    - Unable to allocate resources for necesssary data structures.\r
-    EFI_INVALID_PARAMETER   - KeyData or NotifyHandle is NULL.\r
-\r
---*/\r
-{\r
-  GOP_PRIVATE_DATA                   *Private;\r
-  WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *CurrentNotify;\r
-  LIST_ENTRY                         *Link;\r
-  WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NewNotify;\r
-\r
-  if (KeyData == NULL || KeyNotificationFunction == NULL || NotifyHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
-\r
-  //\r
-  // Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.\r
-  //\r
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {\r
-    CurrentNotify = CR (\r
-                      Link,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY,\r
-                      NotifyEntry,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
-                      );\r
-    if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {\r
-      if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {\r
-        *NotifyHandle = CurrentNotify;\r
-        return EFI_SUCCESS;\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Allocate resource to save the notification function\r
-  //\r
-  NewNotify = (WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *) AllocateZeroPool (sizeof (WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY));\r
-  if (NewNotify == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  NewNotify->Signature         = WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE;\r
-  NewNotify->KeyNotificationFn = KeyNotificationFunction;\r
-  CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));\r
-  InsertTailList (&Private->NotifyList, &NewNotify->NotifyEntry);\r
-\r
-  *NotifyHandle = NewNotify;\r
-\r
-  return EFI_SUCCESS;\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSimpleTextInExUnregisterKeyNotify (\r
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN VOID                               *NotificationHandle\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Remove a registered notification function from a particular keystroke.\r
-\r
-  Arguments:\r
-    This                    - Protocol instance pointer.\r
-    NotificationHandle      - The handle of the notification function being unregistered.\r
-\r
-  Returns:\r
-    EFI_SUCCESS             - The notification function was unregistered successfully.\r
-    EFI_INVALID_PARAMETER   - The NotificationHandle is invalid.\r
-\r
---*/\r
-{\r
-  GOP_PRIVATE_DATA                   *Private;\r
-  LIST_ENTRY                         *Link;\r
-  WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *CurrentNotify;\r
-\r
-  if (NotificationHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
-\r
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {\r
-    CurrentNotify = CR (\r
-                      Link,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY,\r
-                      NotifyEntry,\r
-                      WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
-                      );\r
-    if (CurrentNotify == NotificationHandle) {\r
-      //\r
-      // Remove the notification function from NotifyList and free resources\r
-      //\r
-      RemoveEntryList (&CurrentNotify->NotifyEntry);\r
-\r
-      gBS->FreePool (CurrentNotify);\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Can not find the specified Notification Handle\r
-  //\r
-  return EFI_INVALID_PARAMETER;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopInitializeSimpleTextInForWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  GopPrivateCreateQ (Private, &Private->QueueForRead);\r
-  GopPrivateCreateQ (Private, &Private->QueueForNotify);\r
-\r
-  //\r
-  // Initialize Simple Text In protoocol\r
-  //\r
-  Private->SimpleTextIn.Reset         = WinNtGopSimpleTextInReset;\r
-  Private->SimpleTextIn.ReadKeyStroke = WinNtGopSimpleTextInReadKeyStroke;\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_WAIT,\r
-                  TPL_NOTIFY,\r
-                  WinNtGopSimpleTextInWaitForKey,\r
-                  Private,\r
-                  &Private->SimpleTextIn.WaitForKey\r
-                  );\r
-\r
-\r
-  Private->SimpleTextInEx.Reset               = WinNtGopSimpleTextInExResetEx;\r
-  Private->SimpleTextInEx.ReadKeyStrokeEx     = WinNtGopSimpleTextInExReadKeyStrokeEx;\r
-  Private->SimpleTextInEx.SetState            = WinNtGopSimpleTextInExSetState;\r
-  Private->SimpleTextInEx.RegisterKeyNotify   = WinNtGopSimpleTextInExRegisterKeyNotify;\r
-  Private->SimpleTextInEx.UnregisterKeyNotify = WinNtGopSimpleTextInExUnregisterKeyNotify;\r
-\r
-  Private->SimpleTextInEx.Reset (&Private->SimpleTextInEx, FALSE);\r
-\r
-  InitializeListHead (&Private->NotifyList);\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_WAIT,\r
-                  TPL_NOTIFY,\r
-                  WinNtGopSimpleTextInWaitForKey,\r
-                  Private,\r
-                  &Private->SimpleTextInEx.WaitForKeyEx\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Create the Timer to trigger hot key notifications\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
-                  TPL_NOTIFY,\r
-                  WinNtGopSimpleTextInTimerHandler,\r
-                  Private,\r
-                  &Private->TimerEvent\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = gBS->SetTimer (\r
-                  Private->TimerEvent,\r
-                  TimerPeriodic,\r
-                  KEYBOARD_TIMER_INTERVAL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private               TODO: add argument description\r
-\r
-  @retval EFI_SUCCESS           TODO: Add description for return value\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopDestroySimpleTextInForWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private\r
-  )\r
-{\r
-  gBS->CloseEvent (Private->TimerEvent);\r
-\r
-  GopPrivateDestroyQ (Private, &Private->QueueForRead);\r
-  GopPrivateDestroyQ (Private, &Private->QueueForNotify);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtGopDxe/WinNtGopScreen.c b/Nt32Pkg/WinNtGopDxe/WinNtGopScreen.c
deleted file mode 100644 (file)
index 992a1b2..0000000
+++ /dev/null
@@ -1,1163 +0,0 @@
-/** @file\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-    WinNtGopScreen.c\r
-\r
-Abstract:\r
-\r
-  This file produces the graphics abstration of GOP. It is called by\r
-  WinNtGopDriver.c file which deals with the UEFI 2.0 driver model.\r
-  This file just does graphics.\r
-\r
-\r
-**/\r
-\r
-#include "WinNtGop.h"\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;\r
-DWORD                     mTlsIndex         = TLS_OUT_OF_INDEXES;\r
-DWORD                     mTlsIndexUseCount = 0;  // lets us know when we can free mTlsIndex.\r
-EFI_EVENT          mGopScreenExitBootServicesEvent;\r
-GOP_MODE_DATA mGopModeData[] = {\r
-    {800, 600, 0, 0},\r
-    {640, 480, 0, 0},\r
-    {720, 400, 0, 0},\r
-    {1024, 768, 0, 0},\r
-    {1280, 1024, 0, 0}\r
-    };\r
-\r
-EFI_STATUS\r
-WinNtGopStartWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  UINT32              HorizontalResolution,\r
-  IN  UINT32              VerticalResolution,\r
-  IN  UINT32              ColorDepth,\r
-  IN  UINT32              RefreshRate\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-KillNtGopThread (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  );\r
-\r
-BOOLEAN\r
-WinNtGopConvertParamToEfiKeyShiftState (\r
-  IN  GOP_PRIVATE_DATA  *Private,\r
-  IN  WPARAM            *wParam,\r
-  IN  LPARAM            *lParam,\r
-  IN  BOOLEAN           Flag\r
-  )\r
-{\r
-  switch (*wParam) {\r
-  //\r
-  // BUGBUG: Only GetAsyncKeyState() and GetKeyState() can distinguish\r
-  // left and right Ctrl, and Shift key.\r
-  // Neither of the two is defined in EFI_WIN_NT_THUNK_PROTOCOL.\r
-  // Therefor, we can not set the correct Shift state here.\r
-  //\r
-  case VK_SHIFT:\r
-    if ((*lParam & GOP_EXTENDED_KEY) == GOP_EXTENDED_KEY) {\r
-        Private->RightShift = Flag;\r
-      } else {\r
-        Private->LeftShift = Flag;\r
-      }\r
-    return TRUE;\r
-\r
-  case VK_LSHIFT:\r
-    Private->LeftShift = Flag;\r
-    return TRUE;\r
-\r
-  case VK_RSHIFT:\r
-    Private->RightShift = Flag;\r
-    return TRUE;\r
-\r
-  case VK_CONTROL:\r
-    if ((*lParam & GOP_EXTENDED_KEY) == GOP_EXTENDED_KEY) {\r
-        Private->RightCtrl= Flag;\r
-      } else {\r
-        Private->LeftCtrl = Flag;\r
-      }\r
-    return TRUE;\r
-\r
-  case VK_LCONTROL:\r
-    Private->LeftCtrl = Flag;\r
-    return TRUE;\r
-\r
-  case VK_RCONTROL:\r
-    Private->RightCtrl = Flag;\r
-    return TRUE;\r
-\r
-  case VK_LWIN:\r
-    Private->LeftLogo   = Flag;\r
-    return TRUE;\r
-\r
-  case VK_RWIN:\r
-    Private->RightLogo  = Flag;\r
-    return TRUE;\r
-\r
-  case VK_APPS:\r
-    Private->Menu       = Flag;\r
-    return TRUE;\r
-  //\r
-  // BUGBUG: PrintScreen/SysRq can not trigger WM_KEYDOWN message,\r
-  // so SySReq shift state is not supported here.\r
-  //\r
-  case VK_PRINT:\r
-    Private->SysReq     = Flag;\r
-    return TRUE;\r
-  //\r
-  // For Alt Keystroke.\r
-  //\r
-  case VK_MENU:\r
-    if ((*lParam & GOP_EXTENDED_KEY) == GOP_EXTENDED_KEY) {\r
-        Private->RightAlt = Flag;\r
-      } else {\r
-        Private->LeftAlt = Flag;\r
-      }\r
-    return TRUE;\r
-\r
-  default:\r
-    return FALSE;\r
-  }\r
-}\r
-\r
-BOOLEAN\r
-WinNtGopConvertParamToEfiKey (\r
-  IN  GOP_PRIVATE_DATA  *Private,\r
-  IN  WPARAM            *wParam,\r
-  IN  LPARAM            *lParam,\r
-  IN  EFI_INPUT_KEY     *Key\r
-  )\r
-{\r
-  BOOLEAN Flag;\r
-  Flag = FALSE;\r
-  switch (*wParam) {\r
-  case VK_HOME:       Key->ScanCode = SCAN_HOME;      Flag = TRUE; break;\r
-  case VK_END:        Key->ScanCode = SCAN_END;       Flag = TRUE; break;\r
-  case VK_LEFT:       Key->ScanCode = SCAN_LEFT;      Flag = TRUE; break;\r
-  case VK_RIGHT:      Key->ScanCode = SCAN_RIGHT;     Flag = TRUE; break;\r
-  case VK_UP:         Key->ScanCode = SCAN_UP;        Flag = TRUE; break;\r
-  case VK_DOWN:       Key->ScanCode = SCAN_DOWN;      Flag = TRUE; break;\r
-  case VK_DELETE:     Key->ScanCode = SCAN_DELETE;    Flag = TRUE; break;\r
-  case VK_INSERT:     Key->ScanCode = SCAN_INSERT;    Flag = TRUE; break;\r
-  case VK_PRIOR:      Key->ScanCode = SCAN_PAGE_UP;   Flag = TRUE; break;\r
-  case VK_NEXT:       Key->ScanCode = SCAN_PAGE_DOWN; Flag = TRUE; break;\r
-  case VK_ESCAPE:     Key->ScanCode = SCAN_ESC;       Flag = TRUE; break;\r
-\r
-  case VK_F1:         Key->ScanCode = SCAN_F1;    Flag = TRUE;     break;\r
-  case VK_F2:         Key->ScanCode = SCAN_F2;    Flag = TRUE;     break;\r
-  case VK_F3:         Key->ScanCode = SCAN_F3;    Flag = TRUE;     break;\r
-  case VK_F4:         Key->ScanCode = SCAN_F4;    Flag = TRUE;     break;\r
-  case VK_F5:         Key->ScanCode = SCAN_F5;    Flag = TRUE;     break;\r
-  case VK_F6:         Key->ScanCode = SCAN_F6;    Flag = TRUE;     break;\r
-  case VK_F7:         Key->ScanCode = SCAN_F7;    Flag = TRUE;     break;\r
-  case VK_F8:         Key->ScanCode = SCAN_F8;    Flag = TRUE;     break;\r
-  case VK_F9:         Key->ScanCode = SCAN_F9;    Flag = TRUE;     break;\r
-  case VK_F11:        Key->ScanCode = SCAN_F11;   Flag = TRUE;     break;\r
-  case VK_F12:        Key->ScanCode = SCAN_F12;   Flag = TRUE;     break;\r
-\r
-  case VK_F13:        Key->ScanCode = SCAN_F13;   Flag = TRUE;     break;\r
-  case VK_F14:        Key->ScanCode = SCAN_F14;   Flag = TRUE;     break;\r
-  case VK_F15:        Key->ScanCode = SCAN_F15;   Flag = TRUE;     break;\r
-  case VK_F16:        Key->ScanCode = SCAN_F16;   Flag = TRUE;     break;\r
-  case VK_F17:        Key->ScanCode = SCAN_F17;   Flag = TRUE;     break;\r
-  case VK_F18:        Key->ScanCode = SCAN_F18;   Flag = TRUE;     break;\r
-  case VK_F19:        Key->ScanCode = SCAN_F19;   Flag = TRUE;     break;\r
-  case VK_F20:        Key->ScanCode = SCAN_F20;   Flag = TRUE;     break;\r
-  case VK_F21:        Key->ScanCode = SCAN_F21;   Flag = TRUE;     break;\r
-  case VK_F22:        Key->ScanCode = SCAN_F22;   Flag = TRUE;     break;\r
-  case VK_F23:        Key->ScanCode = SCAN_F23;   Flag = TRUE;     break;\r
-  case VK_F24:        Key->ScanCode = SCAN_F24;   Flag = TRUE;     break;\r
-  case VK_PAUSE:      Key->ScanCode = SCAN_PAUSE; Flag = TRUE;     break;\r
-\r
-  //\r
-  // Set toggle state\r
-  //\r
-  case VK_NUMLOCK:\r
-    Private->NumLock    = (BOOLEAN)(!Private->NumLock);\r
-    Flag = TRUE;\r
-    break;\r
-  case VK_SCROLL:\r
-    Private->ScrollLock = (BOOLEAN)(!Private->ScrollLock);\r
-    Flag = TRUE;\r
-    break;\r
-  case VK_CAPITAL:\r
-    Private->CapsLock   = (BOOLEAN)(!Private->CapsLock);\r
-    Flag = TRUE;\r
-    break;\r
-  }\r
-  \r
-  return (WinNtGopConvertParamToEfiKeyShiftState (Private, wParam, lParam, TRUE)) == TRUE ? TRUE : Flag;\r
-}\r
-\r
-\r
-//\r
-// GOP Protocol Member Functions\r
-//\r
-\r
-\r
-/**\r
-  Graphics Output protocol interface to get video mode\r
-\r
-  @param  This                   Protocol instance pointer.\r
-  @param  ModeNumber             The mode number to return information on.\r
-  @param  Info                   Caller allocated buffer that returns information\r
-                                 about ModeNumber.\r
-  @param  SizeOfInfo             A pointer to the size, in bytes, of the Info\r
-                                 buffer.\r
-\r
-  @retval EFI_SUCCESS            Mode information returned.\r
-  @retval EFI_BUFFER_TOO_SMALL   The Info buffer was too small.\r
-  @retval EFI_DEVICE_ERROR       A hardware error occurred trying to retrieve the\r
-                                 video mode.\r
-  @retval EFI_NOT_STARTED        Video display is not initialized. Call SetMode ()\r
-  @retval EFI_INVALID_PARAMETER  One of the input args was NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopQuerytMode (\r
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,\r
-  IN  UINT32                                ModeNumber,\r
-  OUT UINTN                                 *SizeOfInfo,\r
-  OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (Info == NULL || SizeOfInfo == NULL || (UINTN) ModeNumber >= This->Mode->MaxMode) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));\r
-  if (*Info == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
-\r
-  (*Info)->Version = 0;\r
-  (*Info)->HorizontalResolution = Private->ModeData[ModeNumber].HorizontalResolution;\r
-  (*Info)->VerticalResolution   = Private->ModeData[ModeNumber].VerticalResolution;\r
-  (*Info)->PixelFormat = PixelBltOnly;\r
-  (*Info)->PixelsPerScanLine = (*Info)->HorizontalResolution;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Graphics Output protocol interface to set video mode\r
-\r
-  @param  This                   Protocol instance pointer.\r
-  @param  ModeNumber             The mode number to be set.\r
-\r
-  @retval EFI_SUCCESS            Graphics mode was changed.\r
-  @retval EFI_DEVICE_ERROR       The device had an error and could not complete the\r
-                                 request.\r
-  @retval EFI_UNSUPPORTED        ModeNumber is not supported by this device.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopSetMode (\r
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL * This,\r
-  IN  UINT32                       ModeNumber\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  GOP_PRIVATE_DATA              *Private;\r
-  GOP_MODE_DATA *ModeData;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL Fill;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *NewFillLine;\r
-  RECT                          Rect;\r
-  UINTN                         Size;\r
-  UINTN                         Width;\r
-  UINTN                         Height;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (ModeNumber >= This->Mode->MaxMode) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  ModeData = &Private->ModeData[ModeNumber];\r
-  This->Mode->Mode = ModeNumber;\r
-  Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;\r
-  Private->GraphicsOutput.Mode->Info->VerticalResolution = ModeData->VerticalResolution;\r
-  Private->GraphicsOutput.Mode->Info->PixelsPerScanLine = ModeData->HorizontalResolution;\r
-\r
-  if (Private->HardwareNeedsStarting) {\r
-    Status = WinNtGopStartWindow (\r
-              Private,\r
-              ModeData->HorizontalResolution,\r
-              ModeData->VerticalResolution,\r
-              ModeData->ColorDepth,\r
-              ModeData->RefreshRate\r
-              );\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-\r
-    Private->HardwareNeedsStarting = FALSE;\r
-  } else {\r
-    //\r
-    // Change the resolution and resize of the window\r
-    //\r
-\r
-    //\r
-    // Free the old buffer. We do not save the content of the old buffer since the\r
-    // screen is to be cleared anyway. Clearing the screen is required by the EFI spec.\r
-    // See UEFI spec -EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode()\r
-    //\r
-    Private->WinNtThunk->HeapFree (Private->WinNtThunk->GetProcessHeap (), 0, Private->VirtualScreenInfo);\r
-\r
-    //\r
-    // Allocate DIB frame buffer directly from NT for performance enhancement\r
-    // This buffer is the virtual screen/frame buffer. This buffer is not the\r
-    // same a a frame buffer. The first row of this buffer will be the bottom\r
-    // line of the image. This is an artifact of the way we draw to the screen.\r
-    //\r
-    Size = ModeData->HorizontalResolution * ModeData->VerticalResolution * sizeof (RGBQUAD) + sizeof (BITMAPV4HEADER);\r
-    Private->VirtualScreenInfo = Private->WinNtThunk->HeapAlloc (\r
-                                                        Private->WinNtThunk->GetProcessHeap (),\r
-                                                        HEAP_ZERO_MEMORY,\r
-                                                        Size\r
-                                                        );\r
-\r
-    //\r
-    // Update the virtual screen info data structure\r
-    //\r
-    Private->VirtualScreenInfo->bV4Size           = sizeof (BITMAPV4HEADER);\r
-    Private->VirtualScreenInfo->bV4Width          = ModeData->HorizontalResolution;\r
-    Private->VirtualScreenInfo->bV4Height         = ModeData->VerticalResolution;\r
-    Private->VirtualScreenInfo->bV4Planes         = 1;\r
-    Private->VirtualScreenInfo->bV4BitCount       = 32;\r
-    //\r
-    // uncompressed\r
-    //\r
-    Private->VirtualScreenInfo->bV4V4Compression  = BI_RGB;\r
-\r
-    //\r
-    // The rest of the allocated memory block is the virtual screen buffer\r
-    //\r
-    Private->VirtualScreen = (RGBQUAD *) (Private->VirtualScreenInfo + 1);\r
-\r
-    //\r
-    // Use the AdjuctWindowRect fuction to calculate the real width and height\r
-    // of the new window including the border and caption\r
-    //\r
-    Rect.left   = 0;\r
-    Rect.top    = 0;\r
-    Rect.right  = ModeData->HorizontalResolution;\r
-    Rect.bottom = ModeData->VerticalResolution;\r
-\r
-    Private->WinNtThunk->AdjustWindowRect (&Rect, WS_OVERLAPPEDWINDOW, 0);\r
-\r
-    Width   = Rect.right - Rect.left;\r
-    Height  = Rect.bottom - Rect.top;\r
-\r
-    //\r
-    // Retrieve the original window position information\r
-    //\r
-    Private->WinNtThunk->GetWindowRect (Private->WindowHandle, &Rect);\r
-\r
-    //\r
-    // Adjust the window size\r
-    //\r
-    Private->WinNtThunk->MoveWindow (Private->WindowHandle, Rect.left, Rect.top, (INT32)Width, (INT32)Height, TRUE);\r
-\r
-  }\r
-\r
-  NewFillLine = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution);\r
-  if (NewFillLine == NULL) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (Private->FillLine != NULL) {\r
-    FreePool (Private->FillLine);\r
-  }\r
-\r
-  Private->FillLine             = NewFillLine;\r
-\r
-  Fill.Red                      = 0x00;\r
-  Fill.Green                    = 0x00;\r
-  Fill.Blue                     = 0x00;\r
-  This->Blt (\r
-          This,\r
-          &Fill,\r
-          EfiBltVideoFill,\r
-          0,\r
-          0,\r
-          0,\r
-          0,\r
-          ModeData->HorizontalResolution,\r
-          ModeData->VerticalResolution,\r
-          ModeData->HorizontalResolution * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
-          );\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Blt pixels from the rectangle (Width X Height) formed by the BltBuffer\r
-  onto the graphics screen starting a location (X, Y). (0, 0) is defined as\r
-  the upper left hand side of the screen. (X, Y) can be outside of the\r
-  current screen geometry and the BltBuffer will be cliped when it is\r
-  displayed. X and Y can be negative or positive. If Width or Height is\r
-  bigger than the current video screen the image will be clipped.\r
-\r
-  @param  This                   Protocol instance pointer.\r
-  @param  X                      X location on graphics screen.\r
-  @param  Y                      Y location on the graphics screen.\r
-  @param  Width                  Width of BltBuffer.\r
-  @param  Height                 Hight of BltBuffer\r
-  @param  BltOperation           Operation to perform on BltBuffer and video memory\r
-  @param  BltBuffer              Buffer containing data to blt into video buffer.\r
-                                 This  buffer has a size of\r
-                                 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
-  @param  SourceX                If the BltOperation is a EfiCopyBlt this is the\r
-                                 source of the copy. For other BLT operations this\r
-                                 argument is not used.\r
-  @param  SourceX                If the BltOperation is a EfiCopyBlt this is the\r
-                                 source of the copy. For other BLT operations this\r
-                                 argument is not used.\r
-\r
-  @retval EFI_SUCCESS            The palette is updated with PaletteArray.\r
-  @retval EFI_INVALID_PARAMETER  BltOperation is not valid.\r
-  @retval EFI_DEVICE_ERROR       A hardware error occured writting to the video\r
-                                 buffer.\r
-\r
-**/\r
-// TODO:    SourceY - add argument and description to function comment\r
-// TODO:    DestinationX - add argument and description to function comment\r
-// TODO:    DestinationY - add argument and description to function comment\r
-// TODO:    Delta - add argument and description to function comment\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtGopBlt (\r
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL                   *This,\r
-  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL                           *BltBuffer, OPTIONAL\r
-  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION                   BltOperation,\r
-  IN  UINTN                                   SourceX,\r
-  IN  UINTN                                   SourceY,\r
-  IN  UINTN                                   DestinationX,\r
-  IN  UINTN                                   DestinationY,\r
-  IN  UINTN                                   Width,\r
-  IN  UINTN                                   Height,\r
-  IN  UINTN                                   Delta         OPTIONAL\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA              *Private;\r
-  EFI_TPL                       OriginalTPL;\r
-  UINTN                         DstY;\r
-  UINTN                         SrcY;\r
-  RGBQUAD                       *VScreen;\r
-  RGBQUAD                       *VScreenSrc;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;\r
-  UINTN                         Index;\r
-  RECT                          Rect;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillPixel;\r
-  UINT32                        VerticalResolution;\r
-  UINT32                        HorizontalResolution;\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if ((BltOperation < 0) || (BltOperation >= EfiGraphicsOutputBltOperationMax)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Width == 0 || Height == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // If Delta is zero, then the entire BltBuffer is being used, so Delta\r
-  // is the number of bytes in each row of BltBuffer.  Since BltBuffer is Width pixels size,\r
-  // the number of bytes in each row can be computed.\r
-  //\r
-  if (Delta == 0) {\r
-    Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r
-  }\r
-\r
-  //\r
-  // We need to fill the Virtual Screen buffer with the blt data.\r
-  // The virtual screen is upside down, as the first row is the bootom row of\r
-  // the image.\r
-  //\r
-  VerticalResolution = This->Mode->Info->VerticalResolution;\r
-  HorizontalResolution = This->Mode->Info->HorizontalResolution;\r
-  if (BltOperation == EfiBltVideoToBltBuffer) {\r
-\r
-    //\r
-    // Video to BltBuffer: Source is Video, destination is BltBuffer\r
-    //\r
-    if (SourceY + Height > VerticalResolution) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (SourceX + Width > HorizontalResolution) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-    //\r
-    // We have to raise to TPL Notify, so we make an atomic write the frame buffer.\r
-    // We would not want a timer based event (Cursor, ...) to come in while we are\r
-    // doing this operation.\r
-    //\r
-    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-    for (SrcY = SourceY, DstY = DestinationY; DstY < (Height + DestinationY); SrcY++, DstY++) {\r
-      Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) ((UINT8 *) BltBuffer + (DstY * Delta) + DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-      VScreen = &Private->VirtualScreen[(VerticalResolution - SrcY - 1) * HorizontalResolution + SourceX];\r
-      CopyMem (Blt, VScreen, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * Width);\r
-    }\r
-  } else {\r
-    //\r
-    // BltBuffer to Video: Source is BltBuffer, destination is Video\r
-    //\r
-    if (DestinationY + Height > VerticalResolution) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (DestinationX + Width > HorizontalResolution) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    //\r
-    // We have to raise to TPL Notify, so we make an atomic write the frame buffer.\r
-    // We would not want a timer based event (Cursor, ...) to come in while we are\r
-    // doing this operation.\r
-    //\r
-    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-    if (BltOperation == EfiBltVideoFill) {\r
-      FillPixel = BltBuffer;\r
-      for (Index = 0; Index < Width; Index++) {\r
-        Private->FillLine[Index] = *FillPixel;\r
-      }\r
-    }\r
-\r
-    for (Index = 0; Index < Height; Index++) {\r
-      if (DestinationY <= SourceY) {\r
-        SrcY  = SourceY + Index;\r
-        DstY  = DestinationY + Index;\r
-      } else {\r
-        SrcY  = SourceY + Height - Index - 1;\r
-        DstY  = DestinationY + Height - Index - 1;\r
-      }\r
-\r
-      VScreen = &Private->VirtualScreen[(VerticalResolution - DstY - 1) * HorizontalResolution + DestinationX];\r
-      switch (BltOperation) {\r
-      case EfiBltBufferToVideo:\r
-        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) ((UINT8 *) BltBuffer + (SrcY * Delta) + SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-        CopyMem (VScreen, Blt, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-        break;\r
-\r
-      case EfiBltVideoToVideo:\r
-        VScreenSrc = &Private->VirtualScreen[(VerticalResolution - SrcY - 1) * HorizontalResolution + SourceX];\r
-        CopyMem (VScreen, VScreenSrc, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-        break;\r
-\r
-      case EfiBltVideoFill:\r
-        CopyMem (VScreen, Private->FillLine, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-        break;\r
-      }\r
-    }\r
-  }\r
-\r
-  if (BltOperation != EfiBltVideoToBltBuffer) {\r
-    //\r
-    // Mark the area we just blted as Invalid so WM_PAINT will update.\r
-    //\r
-    Rect.left   = (LONG)DestinationX;\r
-    Rect.top    = (LONG)DestinationY;\r
-    Rect.right  = (LONG)(DestinationX + Width);\r
-    Rect.bottom = (LONG)(DestinationY + Height);\r
-    Private->WinNtThunk->InvalidateRect (Private->WindowHandle, &Rect, FALSE);\r
-\r
-    //\r
-    // Send the WM_PAINT message to the thread that is drawing the window. We\r
-    // are in the main thread and the window drawing is in a child thread.\r
-    // There is a child thread per window. We have no CriticalSection or Mutex\r
-    // since we write the data and the other thread displays the data. While\r
-    // we may miss some data for a short period of time this is no different than\r
-    // a write combining on writes to a frame buffer.\r
-    //\r
-\r
-    Private->WinNtThunk->UpdateWindow (Private->WindowHandle);\r
-  }\r
-\r
-  gBS->RestoreTPL (OriginalTPL);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-//\r
-// Construction and Destruction functions\r
-//\r
-\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    WinNtIo - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-EFI_STATUS\r
-WinNtGopSupported (\r
-  IN  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo\r
-  )\r
-{\r
-  //\r
-  // Check to see if the IO abstraction represents a device type we support.\r
-  //\r
-  // This would be replaced a check of PCI subsystem ID, etc.\r
-  //\r
-  if (!CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtGopGuid)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  Win32 Windows event handler.\r
-\r
-  See Win32 Book\r
-\r
-  @return See Win32 Book\r
-\r
-**/\r
-// TODO:    hwnd - add argument and description to function comment\r
-// TODO:    iMsg - add argument and description to function comment\r
-// TODO:    wParam - add argument and description to function comment\r
-// TODO:    lParam - add argument and description to function comment\r
-LRESULT\r
-CALLBACK\r
-WinNtGopThreadWindowProc (\r
-  IN  HWND    hwnd,\r
-  IN  UINT    iMsg,\r
-  IN  WPARAM  wParam,\r
-  IN  LPARAM  lParam\r
-  )\r
-{\r
-  GOP_PRIVATE_DATA  *Private;\r
-  UINTN             Size;\r
-  HDC               Handle;\r
-  PAINTSTRUCT       PaintStruct;\r
-  LPARAM            Index;\r
-  EFI_INPUT_KEY     Key;\r
-  BOOLEAN           AltIsPress;\r
-\r
-  //\r
-  // BugBug - if there are two instances of this DLL in memory (such as is\r
-  // the case for ERM), the correct instance of this function may not be called.\r
-  // This also means that the address of the mTlsIndex value will be wrong, and\r
-  // the value may be wrong too.\r
-  //\r
-\r
-\r
-  //\r
-  // Use mTlsIndex global to get a Thread Local Storage version of Private.\r
-  // This works since each Gop protocol has a unique Private data instance and\r
-  // a unique thread.\r
-  //\r
-  AltIsPress = FALSE;\r
-  Private = mWinNt->TlsGetValue (mTlsIndex);\r
-  ASSERT (NULL != Private);\r
-\r
-  switch (iMsg) {\r
-  case WM_CREATE:\r
-    Size = Private->GraphicsOutput.Mode->Info->HorizontalResolution * Private->GraphicsOutput.Mode->Info->VerticalResolution * sizeof (RGBQUAD);\r
-\r
-    //\r
-    // Allocate DIB frame buffer directly from NT for performance enhancement\r
-    // This buffer is the virtual screen/frame buffer. This buffer is not the\r
-    // same a a frame buffer. The first fow of this buffer will be the bottom\r
-    // line of the image. This is an artifact of the way we draw to the screen.\r
-    //\r
-    Private->VirtualScreenInfo = Private->WinNtThunk->HeapAlloc (\r
-                                                        Private->WinNtThunk->GetProcessHeap (),\r
-                                                        HEAP_ZERO_MEMORY,\r
-                                                        Size\r
-                                                        );\r
-\r
-    Private->VirtualScreenInfo->bV4Size           = sizeof (BITMAPV4HEADER);\r
-    Private->VirtualScreenInfo->bV4Width          = Private->GraphicsOutput.Mode->Info->HorizontalResolution;\r
-    Private->VirtualScreenInfo->bV4Height         = Private->GraphicsOutput.Mode->Info->VerticalResolution;\r
-    Private->VirtualScreenInfo->bV4Planes         = 1;\r
-    Private->VirtualScreenInfo->bV4BitCount       = 32;\r
-    //\r
-    // uncompressed\r
-    //\r
-    Private->VirtualScreenInfo->bV4V4Compression  = BI_RGB;\r
-    Private->VirtualScreen = (RGBQUAD *) (Private->VirtualScreenInfo + 1);\r
-    return 0;\r
-\r
-  case WM_PAINT:\r
-    //\r
-    // I have not found a way to convert hwnd into a Private context. So for\r
-    // now we use this API to convert hwnd to Private data.\r
-    //\r
-\r
-    Handle = mWinNt->BeginPaint (hwnd, &PaintStruct);\r
-\r
-    mWinNt->SetDIBitsToDevice (\r
-              Handle,                                     // Destination Device Context\r
-              0,                                          // Destination X - 0\r
-              0,                                          // Destination Y - 0\r
-              Private->GraphicsOutput.Mode->Info->HorizontalResolution,              // Width\r
-              Private->GraphicsOutput.Mode->Info->VerticalResolution,                // Height\r
-              0,                                          // Source X\r
-              0,                                          // Source Y\r
-              0,                                          // DIB Start Scan Line\r
-              Private->GraphicsOutput.Mode->Info->VerticalResolution,                // Number of scan lines\r
-              Private->VirtualScreen,                     // Address of array of DIB bits\r
-              (BITMAPINFO *) Private->VirtualScreenInfo,  // Address of structure with bitmap info\r
-              DIB_RGB_COLORS                              // RGB or palette indexes\r
-              );\r
-\r
-    mWinNt->EndPaint (hwnd, &PaintStruct);\r
-    return 0;\r
-\r
-  //\r
-  // F10 and the ALT key do not create a WM_KEYDOWN message, thus this special case\r
-  // WM_SYSKEYDOWN is posted when F10 is pressed or\r
-  // holds down ALT key and then presses another key.\r
-  //\r
-  case WM_SYSKEYDOWN:\r
-\r
-    Key.ScanCode    = 0;\r
-    Key.UnicodeChar = CHAR_NULL;\r
-    switch (wParam) {\r
-    case VK_F10:\r
-      Key.ScanCode    = SCAN_F10;\r
-      Key.UnicodeChar = CHAR_NULL;\r
-      GopPrivateAddKey (Private, Key);\r
-      return 0;\r
-    }\r
-\r
-    //\r
-    // If ALT or ALT + modifier key is pressed.\r
-    //\r
-    if (WinNtGopConvertParamToEfiKey (Private, &wParam, &lParam, &Key)) {\r
-      if (Key.ScanCode != 0){\r
-        //\r
-        // If ALT is pressed with other ScanCode.\r
-        // Always revers the left Alt for simple.\r
-        //\r
-        Private->LeftAlt = TRUE;\r
-      }\r
-      GopPrivateAddKey (Private, Key);\r
-      //\r
-      // When Alt is released there is no windoes message, so \r
-      // clean it after using it.\r
-      //\r
-      Private->RightAlt = FALSE;\r
-      Private->LeftAlt  = FALSE;\r
-      return 0;\r
-    }\r
-    AltIsPress = TRUE;\r
-\r
-  case WM_CHAR:    \r
-    //\r
-    // The ESC key also generate WM_CHAR.\r
-    //\r
-    if (wParam == 0x1B) {\r
-           return 0;\r
-    }    \r
-\r
-    if (AltIsPress == TRUE) {\r
-      //\r
-      // If AltIsPress is true that means the Alt key is pressed.\r
-      //\r
-      Private->LeftAlt = TRUE;\r
-    }\r
-    for (Index = 0; Index < (lParam & 0xffff); Index++) {\r
-      if (wParam != 0) {\r
-        Key.UnicodeChar = (CHAR16) wParam;\r
-        Key.ScanCode    = SCAN_NULL;     \r
-        GopPrivateAddKey (Private, Key);    \r
-      }\r
-    }\r
-    if (AltIsPress == TRUE) {\r
-      //\r
-      // When Alt is released there is no windoes message, so \r
-      // clean it after using it.\r
-      //\r
-      Private->LeftAlt  = FALSE;\r
-      Private->RightAlt = FALSE;\r
-    }\r
-    return 0;\r
-\r
-  case WM_SYSKEYUP:\r
-    //\r
-    // ALT is pressed with another key released\r
-    //\r
-    WinNtGopConvertParamToEfiKeyShiftState (Private, &wParam, &lParam, FALSE);\r
-    return 0;\r
-\r
-  case WM_KEYDOWN:\r
-    Key.ScanCode    = SCAN_NULL;\r
-    Key.UnicodeChar = CHAR_NULL;\r
-    //\r
-    // A value key press will cause a WM_KEYDOWN first, then cause a WM_CHAR\r
-    // So if there is no modifier key updated, skip the WM_KEYDOWN even.\r
-    //\r
-    if (WinNtGopConvertParamToEfiKey (Private, &wParam, &lParam, &Key)) {\r
-      //\r
-      // Support the partial keystroke, add all keydown event into the queue.\r
-      //\r
-      GopPrivateAddKey (Private, Key);\r
-    }\r
-    return 0;\r
-\r
-  case WM_KEYUP:\r
-    WinNtGopConvertParamToEfiKeyShiftState (Private, &wParam, &lParam, FALSE);\r
-    return 0;\r
-\r
-  case WM_CLOSE:\r
-    //\r
-    // This close message is issued by user, core is not aware of this,\r
-    // so don't release the window display resource, just hide the window.\r
-    //\r
-    Private->WinNtThunk->ShowWindow (Private->WindowHandle, SW_HIDE);\r
-    return 0;\r
-\r
-  case WM_DESTROY:\r
-    mWinNt->DestroyWindow (hwnd);\r
-    mWinNt->PostQuitMessage (0);\r
-\r
-    mWinNt->HeapFree (Private->WinNtThunk->GetProcessHeap (), 0, Private->VirtualScreenInfo);\r
-\r
-    mWinNt->ExitThread (0);\r
-    return 0;\r
-\r
-  default:\r
-    break;\r
-  };\r
-\r
-  return mWinNt->DefWindowProc (hwnd, iMsg, wParam, lParam);\r
-}\r
-\r
-\r
-/**\r
-  This thread simulates the end of WinMain () aplication. Each Winow nededs\r
-  to process it's events. The messages are dispatched to\r
-  WinNtGopThreadWindowProc ().\r
-  Be very careful sine WinNtGopThreadWinMain () and WinNtGopThreadWindowProc ()\r
-  are running in a seperate thread. We have to do this to process the events.\r
-\r
-  @param  lpParameter            Handle of window to manage.\r
-\r
-  @return if a WM_QUIT message is returned exit.\r
-\r
-**/\r
-DWORD\r
-WINAPI\r
-WinNtGopThreadWinMain (\r
-  LPVOID    lpParameter\r
-  )\r
-{\r
-  MSG               Message;\r
-  GOP_PRIVATE_DATA  *Private;\r
-  RECT              Rect;\r
-\r
-  Private = (GOP_PRIVATE_DATA *) lpParameter;\r
-  ASSERT (NULL != Private);\r
-\r
-  //\r
-  // Since each thread has unique private data, save the private data in Thread\r
-  // Local Storage slot. Then the shared global mTlsIndex can be used to get\r
-  // thread specific context.\r
-  //\r
-  Private->WinNtThunk->TlsSetValue (mTlsIndex, Private);\r
-\r
-  Private->ThreadId                   = Private->WinNtThunk->GetCurrentThreadId ();\r
-\r
-  Private->WindowsClass.cbSize        = sizeof (WNDCLASSEX);\r
-  Private->WindowsClass.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;\r
-  Private->WindowsClass.lpfnWndProc   = WinNtGopThreadWindowProc;\r
-  Private->WindowsClass.cbClsExtra    = 0;\r
-  Private->WindowsClass.cbWndExtra    = 0;\r
-  Private->WindowsClass.hInstance     = NULL;\r
-  Private->WindowsClass.hIcon         = Private->WinNtThunk->LoadIcon (NULL, IDI_APPLICATION);\r
-  Private->WindowsClass.hCursor       = Private->WinNtThunk->LoadCursor (NULL, IDC_ARROW);\r
-  Private->WindowsClass.hbrBackground = (HBRUSH)(UINTN)COLOR_WINDOW;\r
-  Private->WindowsClass.lpszMenuName  = NULL;\r
-  Private->WindowsClass.lpszClassName = WIN_NT_GOP_CLASS_NAME;\r
-  Private->WindowsClass.hIconSm       = Private->WinNtThunk->LoadIcon (NULL, IDI_APPLICATION);\r
-\r
-  //\r
-  // This call will fail after the first time, but thats O.K. since we only need\r
-  // WIN_NT_GOP_CLASS_NAME to exist to create the window.\r
-  //\r
-  // Note: Multiple instances of this DLL will use the same instance of this\r
-  // Class, including the callback function, unless the Class is unregistered and\r
-  // successfully registered again.\r
-  //\r
-  Private->WinNtThunk->RegisterClassEx (&Private->WindowsClass);\r
-\r
-  //\r
-  // Setting Rect values to allow for the AdjustWindowRect to provide\r
-  // us the correct sizes for the client area when doing the CreateWindowEx\r
-  //\r
-  Rect.top    = 0;\r
-  Rect.bottom = Private->GraphicsOutput.Mode->Info->VerticalResolution;\r
-  Rect.left   = 0;\r
-  Rect.right  = Private->GraphicsOutput.Mode->Info->HorizontalResolution;\r
-\r
-  Private->WinNtThunk->AdjustWindowRect (&Rect, WS_OVERLAPPEDWINDOW, 0);\r
-\r
-  Private->WindowHandle = Private->WinNtThunk->CreateWindowEx (\r
-                                                0,\r
-                                                WIN_NT_GOP_CLASS_NAME,\r
-                                                Private->WindowName,\r
-                                                WS_OVERLAPPEDWINDOW,\r
-                                                CW_USEDEFAULT,\r
-                                                CW_USEDEFAULT,\r
-                                                Rect.right - Rect.left,\r
-                                                Rect.bottom - Rect.top,\r
-                                                NULL,\r
-                                                NULL,\r
-                                                NULL,\r
-                                                (VOID **)&Private\r
-                                                );\r
-\r
-  //\r
-  // The reset of this thread is the standard winows program. We need a sperate\r
-  // thread since we must process the message loop to make windows act like\r
-  // windows.\r
-  //\r
-\r
-  Private->WinNtThunk->ShowWindow (Private->WindowHandle, SW_SHOW);\r
-  Private->WinNtThunk->UpdateWindow (Private->WindowHandle);\r
-\r
-  //\r
-  // Let the main thread get some work done\r
-  //\r
-  Private->WinNtThunk->ReleaseSemaphore (Private->ThreadInited, 1, NULL);\r
-\r
-  //\r
-  // This is the message loop that all Windows programs need.\r
-  //\r
-  while (Private->WinNtThunk->GetMessage (&Message, Private->WindowHandle, 0, 0)) {\r
-    Private->WinNtThunk->TranslateMessage (&Message);\r
-    Private->WinNtThunk->DispatchMessage (&Message);\r
-  }\r
-\r
-  return (DWORD)Message.wParam;\r
-}\r
-\r
-\r
-/**\r
-  TODO: Add function description\r
-\r
-  @param  Private                TODO: add argument description\r
-  @param  HorizontalResolution   TODO: add argument description\r
-  @param  VerticalResolution     TODO: add argument description\r
-  @param  ColorDepth             TODO: add argument description\r
-  @param  RefreshRate            TODO: add argument description\r
-\r
-  @return TODO: add return values\r
-\r
-**/\r
-EFI_STATUS\r
-WinNtGopStartWindow (\r
-  IN  GOP_PRIVATE_DATA    *Private,\r
-  IN  UINT32              HorizontalResolution,\r
-  IN  UINT32              VerticalResolution,\r
-  IN  UINT32              ColorDepth,\r
-  IN  UINT32              RefreshRate\r
-  )\r
-{\r
-  EFI_STATUS          Status;\r
-  DWORD               NewThreadId;\r
-\r
-  mWinNt  = Private->WinNtThunk;\r
-\r
-  //\r
-  // Initialize a Thread Local Storge variable slot. We use TLS to get the\r
-  // correct Private data instance into the windows thread.\r
-  //\r
-  if (mTlsIndex == TLS_OUT_OF_INDEXES) {\r
-    ASSERT (0 == mTlsIndexUseCount);\r
-    mTlsIndex = Private->WinNtThunk->TlsAlloc ();\r
-  }\r
-\r
-  //\r
-  // always increase the use count!\r
-  //\r
-  mTlsIndexUseCount++;\r
-\r
-  //\r
-  // Register to be notified on exit boot services so we can destroy the window.\r
-  //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
-                  KillNtGopThread,\r
-                  Private,\r
-                  &gEfiEventExitBootServicesGuid,\r
-                  &mGopScreenExitBootServicesEvent\r
-                  );\r
-\r
-  Private->ThreadInited = Private->WinNtThunk->CreateSemaphore (NULL, 0, 1, NULL);\r
-  Private->ThreadHandle = Private->WinNtThunk->CreateThread (\r
-                                                NULL,\r
-                                                0,\r
-                                                WinNtGopThreadWinMain,\r
-                                                (VOID *) Private,\r
-                                                0,\r
-                                                &NewThreadId\r
-                                                );\r
-\r
-  //\r
-  // The other thread has entered the windows message loop so we can\r
-  // continue our initialization.\r
-  //\r
-  Private->WinNtThunk->WaitForSingleObject (Private->ThreadInited, INFINITE);\r
-  Private->WinNtThunk->CloseHandle (Private->ThreadInited);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    Private - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-EFI_STATUS\r
-WinNtGopConstructor (\r
-  GOP_PRIVATE_DATA    *Private\r
-  )\r
-{\r
-  Private->ModeData = mGopModeData;\r
-\r
-  Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode;\r
-  Private->GraphicsOutput.SetMode = WinNtGopSetMode;\r
-  Private->GraphicsOutput.Blt            = WinNtGopBlt;\r
-\r
-  //\r
-  // Allocate buffer for Graphics Output Protocol mode information\r
-  //\r
-  Private->GraphicsOutput.Mode = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));\r
-  if (Private->GraphicsOutput.Mode == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-  Private->GraphicsOutput.Mode->Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));\r
-  if (Private->GraphicsOutput.Mode->Info == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA);\r
-  //\r
-  // Till now, we have no idea about the window size.\r
-  //\r
-  Private->GraphicsOutput.Mode->Mode = GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER;\r
-  Private->GraphicsOutput.Mode->Info->Version = 0;\r
-  Private->GraphicsOutput.Mode->Info->HorizontalResolution = 0;\r
-  Private->GraphicsOutput.Mode->Info->VerticalResolution = 0;\r
-  Private->GraphicsOutput.Mode->Info->PixelFormat = PixelBltOnly;\r
-  Private->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
-  Private->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) NULL;\r
-  Private->GraphicsOutput.Mode->FrameBufferSize = 0;\r
-\r
-  Private->HardwareNeedsStarting  = TRUE;\r
-  Private->FillLine               = NULL;\r
-\r
-  WinNtGopInitializeSimpleTextInForWindow (Private);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-\r
-\r
-  @return None\r
-\r
-**/\r
-// TODO:    Private - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-EFI_STATUS\r
-WinNtGopDestructor (\r
-  GOP_PRIVATE_DATA     *Private\r
-  )\r
-{\r
-  if (!Private->HardwareNeedsStarting) {\r
-    //\r
-    // BugBug: Shutdown GOP Hardware and any child devices.\r
-    //\r
-    Private->WinNtThunk->SendMessage (Private->WindowHandle, WM_DESTROY, 0, 0);\r
-    Private->WinNtThunk->CloseHandle (Private->ThreadHandle);\r
-\r
-    mTlsIndexUseCount--;\r
-\r
-    //\r
-    // The callback function for another window could still be called,\r
-    // so we need to make sure there are no more users of mTlsIndex.\r
-    //\r
-    if (0 == mTlsIndexUseCount) {\r
-      ASSERT (TLS_OUT_OF_INDEXES != mTlsIndex);\r
-\r
-      Private->WinNtThunk->TlsFree (mTlsIndex);\r
-      mTlsIndex = TLS_OUT_OF_INDEXES;\r
-\r
-      Private->WinNtThunk->UnregisterClass (\r
-                              Private->WindowsClass.lpszClassName,\r
-                              Private->WindowsClass.hInstance\r
-                              );\r
-    }\r
-\r
-    WinNtGopDestroySimpleTextInForWindow (Private);\r
-  }\r
-\r
-  //\r
-  // Free graphics output protocol occupied resource\r
-  //\r
-  if (Private->GraphicsOutput.Mode != NULL) {\r
-    if (Private->GraphicsOutput.Mode->Info != NULL) {\r
-      FreePool (Private->GraphicsOutput.Mode->Info);\r
-    }\r
-    FreePool (Private->GraphicsOutput.Mode);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  This is the GOP screen's callback notification function for exit-boot-services.\r
-  All we do here is call WinNtGopDestructor().\r
-\r
-  @param  Event                  not used\r
-  @param  Context                pointer to the Private structure.\r
-\r
-  @return None.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-KillNtGopThread (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  WinNtGopDestructor (Context);\r
-}\r
diff --git a/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c b/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c
deleted file mode 100644 (file)
index 20bd719..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/** @file\r
-  OEM hook status code handler driver which produces general handler and hook it\r
-  onto the DXE status code router.\r
-\r
-  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <WinNtDxe.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/ReportStatusCodeHandler.h>\r
-\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/OemHookStatusCodeLib.h>\r
-\r
-/**\r
-  Entry point of OEM hook status code handler driver.\r
-\r
-  This function is the entry point of this OEM hook status code handler driver.\r
-  It initializes registers OEM status code handler.\r
-\r
-  @param  ImageHandle       The firmware allocated handle for the EFI image.\r
-  @param  SystemTable       A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtOemHookStatusCodeHandlerDxeEntry (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_RSC_HANDLER_PROTOCOL  *RscHandlerProtocol;\r
-\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiRscHandlerProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &RscHandlerProtocol\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  OemHookStatusCodeInitialize ();\r
-\r
-  RscHandlerProtocol->Register (OemHookStatusCodeReport, TPL_HIGH_LEVEL);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf b/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf
deleted file mode 100644 (file)
index fb0c0e1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file\r
-# OEM hook status code handler driver which produces general handler and hook it\r
-# onto the DXE status code router.\r
-#\r
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtOemHookStatusCodeHandlerDxe\r
-  FILE_GUID                      = CA4233AD-847E-4E5D-AD3F-21CABFE5E23C\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = WinNtOemHookStatusCodeHandlerDxeEntry\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION\r
-#\r
-\r
-[Sources]\r
-  WinNtOemHookStatusCodeHandlerDxe.c\r
-\r
-\r
-[Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  DebugLib\r
-  UefiDriverEntryPoint\r
-  UefiBootServicesTableLib\r
-  OemHookStatusCodeLib\r
-\r
-[Protocols]\r
-  gEfiRscHandlerProtocolGuid                    ## CONSUMES\r
-\r
-[Depex]\r
-  gEfiRscHandlerProtocolGuid\r
diff --git a/Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.c b/Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.c
deleted file mode 100644 (file)
index 11fb720..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file\r
-  OEM hook status code handler PEIM which produces general handler and hook it\r
-  onto the PEI status code router.\r
-\r
-  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <WinNtPeim.h>\r
-\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/ReportStatusCodeHandler.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/OemHookStatusCodeLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeReportWrapper (\r
-  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
-  IN       EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN       EFI_STATUS_CODE_VALUE    Value,\r
-  IN       UINT32                   Instance,\r
-  IN CONST EFI_GUID                 *CallerId, OPTIONAL\r
-  IN CONST EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
-  )\r
-{\r
-  return OemHookStatusCodeReport (\r
-           CodeType,\r
-           Value,\r
-           Instance,\r
-           (EFI_GUID *) CallerId,\r
-           (EFI_STATUS_CODE_DATA *) Data\r
-           );\r
-}\r
-\r
-/**\r
-  Entry point of OEM hook status code handler PEIM.\r
-  \r
-  This function is the entry point of this OEM hook status code handler PEIM.\r
-  It initializes and registers OEM status code handler.\r
-\r
-  @param  FileHandle  Handle of the file being invoked.\r
-  @param  PeiServices Describes the list of possible PEI Services.\r
-\r
-  @retval EFI_SUCESS  The entry point executes successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtOemHookStatusCodeHandlerPeiEntry (\r
-  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices\r
-  )\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_RSC_HANDLER_PPI     *RscHandlerPpi;\r
-\r
-  Status = PeiServicesLocatePpi (\r
-             &gEfiPeiRscHandlerPpiGuid,\r
-             0,\r
-             NULL,\r
-             (VOID **) &RscHandlerPpi\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  OemHookStatusCodeInitialize ();\r
-\r
-  Status = RscHandlerPpi->Register (OemHookStatusCodeReportWrapper);                     \r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf b/Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf
deleted file mode 100644 (file)
index ece1424..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file\r
-# OEM hook status code handler PEIM which produces general handler and hook it\r
-# onto the PEI status code router.\r
-#\r
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
-# SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtOemHookStatusCodeHandlerPei\r
-  FILE_GUID                      = D233D6BD-F1B1-425A-BF45-5CAF2B88EDDC\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = WinNtOemHookStatusCodeHandlerPeiEntry\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  WinNtOemHookStatusCodeHandlerPei.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  PeimEntryPoint\r
-  PeiServicesLib\r
-  DebugLib\r
-  OemHookStatusCodeLib\r
-\r
-[Ppis]\r
-  gEfiPeiRscHandlerPpiGuid                      ## CONSUMES\r
-\r
-[Depex]\r
-  gEfiPeiRscHandlerPpiGuid\r
diff --git a/Nt32Pkg/WinNtSerialIoDxe/ComponentName.c b/Nt32Pkg/WinNtSerialIoDxe/ComponentName.c
deleted file mode 100644 (file)
index 3902243..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-**/\r
-\r
-#include "WinNtSerialIo.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gWinNtSerialIoComponentName = {\r
-  WinNtSerialIoComponentNameGetDriverName,\r
-  WinNtSerialIoComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtSerialIoComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtSerialIoComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtSerialIoComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtSerialIoDriverNameTable[] = {\r
-  { "eng;en", L"Windows Serial I/O Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mWinNtSerialIoDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gWinNtSerialIoComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_SERIAL_IO_PROTOCOL        *SerialIo;\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gWinNtSerialIoDriverBinding.DriverBindingHandle,\r
-             &gEfiWinNtIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // This is a bus driver, so ChildHandle must not be NULL.\r
-  //\r
-  if (ChildHandle == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Status = EfiTestChildHandle (\r
-             ControllerHandle,\r
-             ChildHandle,\r
-             &gEfiWinNtIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ChildHandle,\r
-                  &gEfiSerialIoProtocolGuid,\r
-                  (VOID **) &SerialIo,\r
-                  gWinNtSerialIoDriverBinding.DriverBindingHandle,\r
-                  ChildHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (SerialIo);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gWinNtSerialIoComponentName)\r
-           );\r
-}\r
diff --git a/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c b/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c
deleted file mode 100644 (file)
index 96167d5..0000000
+++ /dev/null
@@ -1,1701 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtSerialIo.c\r
-\r
-Abstract:\r
-\r
-  Our DriverBinding member functions operate on the handles\r
-  created by the NT Bus driver.\r
-\r
-  Handle(1) - WinNtIo - DevicePath(1)\r
-\r
-  If a serial port is added to the system this driver creates a new handle.\r
-  The new handle is required, since the serial device must add an UART device\r
-  pathnode.\r
-\r
-  Handle(2) - SerialIo - DevicePath(1)\UART\r
-\r
-  The driver then adds a gEfiWinNtSerialPortGuid as a protocol to Handle(1).\r
-  The instance data for this protocol is the private data used to create\r
-  Handle(2).\r
-\r
-  Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort\r
-\r
-  If the driver is unloaded Handle(2) is removed from the system and\r
-  gEfiWinNtSerialPortGuid is removed from Handle(1).\r
-\r
-  Note: Handle(1) is any handle created by the Win NT Bus driver that is passed\r
-  into the DriverBinding member functions of this driver. This driver requires\r
-  a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and\r
-  the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid.\r
-\r
-  If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is\r
-  loaded on the device.\r
-\r
-**/\r
-\r
-#include "WinNtSerialIo.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gWinNtSerialIoDriverBinding = {\r
-  WinNtSerialIoDriverBindingSupported,\r
-  WinNtSerialIoDriverBindingStart,\r
-  WinNtSerialIoDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-//\r
-// List of supported baud rate\r
-//\r
-UINT64 mBaudRateCurrentSupport[] = {50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200, 38400, 57600, 115200, SERIAL_PORT_MAX_BAUD_RATE + 1};\r
-\r
-/**\r
-  Check the device path node whether it's the Flow Control node or not.\r
-\r
-  @param[in] FlowControl    The device path node to be checked.\r
-  \r
-  @retval TRUE              It's the Flow Control node.\r
-  @retval FALSE             It's not.\r
-\r
-**/\r
-BOOLEAN\r
-IsUartFlowControlNode (\r
-  IN UART_FLOW_CONTROL_DEVICE_PATH *FlowControl\r
-  )\r
-{\r
-  return (BOOLEAN) (\r
-           (DevicePathType (FlowControl) == MESSAGING_DEVICE_PATH) &&\r
-           (DevicePathSubType (FlowControl) == MSG_VENDOR_DP) &&\r
-           (CompareGuid (&FlowControl->Guid, &gEfiUartDevicePathGuid))\r
-           );\r
-}\r
-\r
-/**\r
-  Check the device path node whether it contains Flow Control node or not.\r
-\r
-  @param[in] DevicePath     The device path to be checked.\r
-  \r
-  @retval TRUE              It contains the Flow Control node.\r
-  @retval FALSE             It doesn't.\r
-\r
-**/\r
-BOOLEAN\r
-ContainsFlowControl (\r
-  IN EFI_DEVICE_PATH_PROTOCOL      *DevicePath\r
-  )\r
-{\r
-  while (!IsDevicePathEnd (DevicePath)) {\r
-    if (IsUartFlowControlNode ((UART_FLOW_CONTROL_DEVICE_PATH *) DevicePath)) {\r
-      return TRUE;\r
-    }\r
-    DevicePath = NextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  The user Entry Point for module WinNtSerialIo. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtSerialIo(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Install driver model protocol(s).\r
-  //\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gWinNtSerialIoDriverBinding,\r
-             ImageHandle,\r
-             &gWinNtSerialIoComponentName,\r
-             &gWinNtSerialIoComponentName2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_DEVICE_PATH_PROTOCOL            *ParentDevicePath;\r
-  EFI_WIN_NT_IO_PROTOCOL              *WinNtIo;\r
-  UART_DEVICE_PATH                    *UartNode;\r
-  EFI_DEVICE_PATH_PROTOCOL            *DevicePath;\r
-  UART_FLOW_CONTROL_DEVICE_PATH       *FlowControlNode;\r
-  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
-  UINTN                               EntryCount;\r
-  UINTN                               Index;\r
-  BOOLEAN                             RemainingDevicePathContainsFlowControl; \r
-\r
-  //\r
-  // Check RemainingDevicePath validation\r
-  //\r
-  if (RemainingDevicePath != NULL) {\r
-    //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
-    // if yes, go on checking other conditions\r
-    //\r
-    if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath isn't the End of Device Path Node,\r
-      // check its validation\r
-      //\r
-      Status = EFI_UNSUPPORTED;\r
-\r
-      UartNode  = (UART_DEVICE_PATH *) RemainingDevicePath;\r
-      if (UartNode->Header.Type != MESSAGING_DEVICE_PATH ||\r
-          UartNode->Header.SubType != MSG_UART_DP ||\r
-          DevicePathNodeLength((EFI_DEVICE_PATH_PROTOCOL *)UartNode) != sizeof(UART_DEVICE_PATH)) {\r
-        goto Error;\r
-      }\r
-      if ( UartNode->BaudRate > SERIAL_PORT_MAX_BAUD_RATE) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->Parity < NoParity || UartNode->Parity > SpaceParity) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->DataBits < 5 || UartNode->DataBits > 8) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->StopBits < OneStopBit || UartNode->StopBits > TwoStopBits) {\r
-        goto Error;\r
-      }\r
-      if ((UartNode->DataBits == 5) && (UartNode->StopBits == TwoStopBits)) {\r
-        goto Error;\r
-      }\r
-      if ((UartNode->DataBits >= 6) && (UartNode->DataBits <= 8) && (UartNode->StopBits == OneFiveStopBits)) {\r
-        goto Error;\r
-      }\r
-\r
-      FlowControlNode = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (UartNode);\r
-      if (IsUartFlowControlNode (FlowControlNode)) {\r
-        //\r
-        // If the second node is Flow Control Node,\r
-        //   return error when it request other than hardware flow control.\r
-        //\r
-        if ((FlowControlNode->FlowControlMap & ~UART_FLOW_CONTROL_HARDWARE) != 0) {\r
-          goto Error;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    if (RemainingDevicePath == NULL || IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath is NULL or is the End of Device Path Node\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // When the driver has produced device path with flow control node but RemainingDevicePath only contains UART node,\r
-    //   return unsupported, and vice versa.\r
-    //\r
-    Status = gBS->OpenProtocolInformation (\r
-                    Handle,\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    &OpenInfoBuffer,\r
-                    &EntryCount\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    //\r
-    // See if RemainingDevicePath has a Flow Control device path node\r
-    //\r
-    RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath);\r
-    \r
-    for (Index = 0; Index < EntryCount; Index++) {\r
-      if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
-        Status = gBS->OpenProtocol (\r
-                        OpenInfoBuffer[Index].ControllerHandle,\r
-                        &gEfiDevicePathProtocolGuid,\r
-                        (VOID **) &DevicePath,\r
-                        This->DriverBindingHandle,\r
-                        Handle,\r
-                        EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                        );\r
-        if (!EFI_ERROR (Status)) {\r
-          if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) {\r
-            Status = EFI_UNSUPPORTED;\r
-          }\r
-        }\r
-        break;\r
-      }\r
-    }\r
-    FreePool (OpenInfoBuffer);\r
-    return Status;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiWinNtIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  //\r
-  // Open the EFI Device Path protocol needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close protocol, don't use device path protocol in the Support() function\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiDevicePathProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  //\r
-  // Make sure that the WinNt Thunk Protocol is valid\r
-  //\r
-  if (WinNtIo->WinNtThunk->Signature != EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Check the GUID to see if this is a handle type the driver supports\r
-  //\r
-  if (!CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtSerialPortGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Error;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-Error:\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_WIN_NT_IO_PROTOCOL              *WinNtIo;\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA       *Private;\r
-  HANDLE                              NtHandle;\r
-  UART_DEVICE_PATH                    UartNode;\r
-  EFI_DEVICE_PATH_PROTOCOL            *ParentDevicePath;\r
-  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
-  UINTN                               EntryCount;\r
-  UINTN                               Index;\r
-  EFI_SERIAL_IO_PROTOCOL              *SerialIo;\r
-  UART_DEVICE_PATH                    *Uart;\r
-  UINT32                              FlowControlMap;\r
-  UART_FLOW_CONTROL_DEVICE_PATH       *FlowControl;\r
-  EFI_DEVICE_PATH_PROTOCOL            *TempDevicePath;\r
-  UINT32                              Control;\r
-\r
-  Private   = NULL;\r
-  NtHandle  = INVALID_HANDLE_VALUE;\r
-\r
-  //\r
-  // Get the Parent Device Path\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Grab the IO abstraction we need to get any work done\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-    return Status;\r
-  }\r
-\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-\r
-    if (RemainingDevicePath == NULL || IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath is NULL or is the End of Device Path Node\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    //\r
-    // Make sure a child handle does not already exist.  This driver can only\r
-    // produce one child per serial port.\r
-    //\r
-    Status = gBS->OpenProtocolInformation (\r
-                    Handle,\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    &OpenInfoBuffer,\r
-                    &EntryCount\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    Status = EFI_ALREADY_STARTED;\r
-    for (Index = 0; Index < EntryCount; Index++) {\r
-      if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
-        Status = gBS->OpenProtocol (\r
-                        OpenInfoBuffer[Index].ControllerHandle,\r
-                        &gEfiSerialIoProtocolGuid,\r
-                        (VOID **) &SerialIo,\r
-                        This->DriverBindingHandle,\r
-                        Handle,\r
-                        EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                        );\r
-        if (!EFI_ERROR (Status)) {\r
-          Uart   = (UART_DEVICE_PATH *) RemainingDevicePath;\r
-          Status = SerialIo->SetAttributes (\r
-                               SerialIo,\r
-                               Uart->BaudRate,\r
-                               SerialIo->Mode->ReceiveFifoDepth,\r
-                               SerialIo->Mode->Timeout,\r
-                               (EFI_PARITY_TYPE) Uart->Parity,\r
-                               Uart->DataBits,\r
-                               (EFI_STOP_BITS_TYPE) Uart->StopBits\r
-                               );\r
-          FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Uart);\r
-          if (!EFI_ERROR (Status) && IsUartFlowControlNode (FlowControl)) {\r
-            Status = SerialIo->GetControl (SerialIo, &Control);\r
-            if (!EFI_ERROR (Status)) {\r
-              if (FlowControl->FlowControlMap == UART_FLOW_CONTROL_HARDWARE) {\r
-                Control |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-              } else {\r
-                Control &= ~EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-              }\r
-              //\r
-              // Clear the bits that are not allowed to pass to SetControl\r
-              //\r
-              Control &= (EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_READY |\r
-                          EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE | EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE | \r
-                          EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE);\r
-              Status = SerialIo->SetControl (SerialIo, Control);\r
-            }\r
-          }\r
-        }\r
-        break;\r
-      }\r
-    }\r
-\r
-    FreePool (OpenInfoBuffer);\r
-    return Status;\r
-  }\r
-\r
-  FlowControl    = NULL;\r
-  FlowControlMap = 0;\r
-  if (RemainingDevicePath == NULL) {\r
-    //\r
-    // Build the device path by appending the UART node to the ParentDevicePath\r
-    // from the WinNtIo handle. The Uart setings are zero here, since\r
-    // SetAttribute() will update them to match the default setings.\r
-    //\r
-    ZeroMem (&UartNode, sizeof (UART_DEVICE_PATH));\r
-    UartNode.Header.Type     = MESSAGING_DEVICE_PATH;\r
-    UartNode.Header.SubType  = MSG_UART_DP;\r
-    SetDevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) &UartNode, sizeof (UART_DEVICE_PATH));\r
-\r
-  } else if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-    //\r
-    // If RemainingDevicePath isn't the End of Device Path Node, \r
-    // only scan the specified device by RemainingDevicePath\r
-    //\r
-    //\r
-    // Match the configuration of the RemainingDevicePath. IsHandleSupported()\r
-    // already checked to make sure the RemainingDevicePath contains settings\r
-    // that we can support.\r
-    //\r
-    CopyMem (&UartNode, RemainingDevicePath, sizeof (UART_DEVICE_PATH));\r
-    FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (RemainingDevicePath);\r
-    if (IsUartFlowControlNode (FlowControl)) {\r
-      FlowControlMap = FlowControl->FlowControlMap;\r
-    } else {\r
-      FlowControl    = NULL;\r
-    }\r
-\r
-  } else {\r
-    //\r
-    // If RemainingDevicePath is the End of Device Path Node,\r
-    // skip enumerate any device and return EFI_SUCESSS\r
-    // \r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Check to see if we can access the hardware device. If it's Open in NT we\r
-  // will not get access.\r
-  //\r
-  NtHandle = WinNtIo->WinNtThunk->CreateFile (\r
-                                    WinNtIo->EnvString,\r
-                                    GENERIC_READ | GENERIC_WRITE,\r
-                                    0,\r
-                                    NULL,\r
-                                    OPEN_EXISTING,\r
-                                    0,\r
-                                    NULL\r
-                                    );\r
-  if (NtHandle == INVALID_HANDLE_VALUE) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Construct Private data\r
-  //\r
-  Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));\r
-  if (Private == NULL) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // This signature must be valid before any member function is called\r
-  //\r
-  Private->Signature              = WIN_NT_SERIAL_IO_PRIVATE_DATA_SIGNATURE;\r
-  Private->NtHandle               = NtHandle;\r
-  Private->ControllerHandle       = Handle;\r
-  Private->Handle                 = NULL;\r
-  Private->WinNtThunk             = WinNtIo->WinNtThunk;\r
-  Private->ParentDevicePath       = ParentDevicePath;\r
-  Private->ControllerNameTable    = NULL;\r
-\r
-  Private->SoftwareLoopbackEnable = FALSE;\r
-  Private->HardwareLoopbackEnable = FALSE;\r
-  Private->HardwareFlowControl    = (BOOLEAN) (FlowControlMap == UART_FLOW_CONTROL_HARDWARE);\r
-  Private->Fifo.First             = 0;\r
-  Private->Fifo.Last              = 0;\r
-  Private->Fifo.Surplus           = SERIAL_MAX_BUFFER_SIZE;\r
-\r
-  CopyMem (&Private->UartDevicePath, &UartNode, sizeof (UART_DEVICE_PATH));\r
-\r
-  AddUnicodeString2 (\r
-    "eng",\r
-    gWinNtSerialIoComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    TRUE\r
-    );\r
-  AddUnicodeString2 (\r
-    "en",\r
-    gWinNtSerialIoComponentName2.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    FALSE\r
-    );\r
-\r
-\r
-  Private->SerialIo.Revision      = SERIAL_IO_INTERFACE_REVISION;\r
-  Private->SerialIo.Reset         = WinNtSerialIoReset;\r
-  Private->SerialIo.SetAttributes = WinNtSerialIoSetAttributes;\r
-  Private->SerialIo.SetControl    = WinNtSerialIoSetControl;\r
-  Private->SerialIo.GetControl    = WinNtSerialIoGetControl;\r
-  Private->SerialIo.Write         = WinNtSerialIoWrite;\r
-  Private->SerialIo.Read          = WinNtSerialIoRead;\r
-  Private->SerialIo.Mode          = &Private->SerialIoMode;\r
-\r
-  //\r
-  // Build the device path by appending the UART node to the ParentDevicePath\r
-  // from the WinNtIo handle. The Uart setings are zero here, since\r
-  // SetAttribute() will update them to match the current setings.\r
-  //\r
-  Private->DevicePath = AppendDevicePathNode (\r
-                          ParentDevicePath,\r
-                          (EFI_DEVICE_PATH_PROTOCOL *) &Private->UartDevicePath\r
-                          );\r
-  //\r
-  // Only produce the FlowControl node when remaining device path has it\r
-  //\r
-  if (FlowControl != NULL) {\r
-    TempDevicePath = Private->DevicePath;\r
-    if (TempDevicePath != NULL) {\r
-      Private->DevicePath = AppendDevicePathNode (\r
-                              TempDevicePath,\r
-                              (EFI_DEVICE_PATH_PROTOCOL *) FlowControl\r
-                              );\r
-      FreePool (TempDevicePath);\r
-    }\r
-  }\r
-  if (Private->DevicePath == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Fill in Serial I/O Mode structure based on either the RemainingDevicePath or defaults.\r
-  //\r
-  Private->SerialIoMode.ControlMask       = SERIAL_CONTROL_MASK;\r
-  Private->SerialIoMode.Timeout           = SERIAL_TIMEOUT_DEFAULT;\r
-  Private->SerialIoMode.BaudRate          = Private->UartDevicePath.BaudRate;\r
-  Private->SerialIoMode.ReceiveFifoDepth  = SERIAL_FIFO_DEFAULT;\r
-  Private->SerialIoMode.DataBits          = Private->UartDevicePath.DataBits;\r
-  Private->SerialIoMode.Parity            = Private->UartDevicePath.Parity;\r
-  Private->SerialIoMode.StopBits          = Private->UartDevicePath.StopBits;\r
-\r
-  //\r
-  // Issue a reset to initialize the COM port\r
-  //\r
-  Status = Private->SerialIo.Reset (&Private->SerialIo);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Create new child handle\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Private->Handle,\r
-                  &gEfiSerialIoProtocolGuid,\r
-                  &Private->SerialIo,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  Private->DevicePath,\r
-                  NULL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Open For Child Device\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  Private->Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-Error:\r
-  //\r
-  // Use the Stop() function to free all resources allocated in Start()\r
-  //\r
-  if (Private != NULL) {\r
-    if (Private->Handle != NULL) {\r
-      This->Stop (This, Handle, 1, &Private->Handle);\r
-    } else {\r
-      if (NtHandle != INVALID_HANDLE_VALUE) {\r
-        Private->WinNtThunk->CloseHandle (NtHandle);\r
-      }\r
-\r
-      if (Private->DevicePath != NULL) {\r
-        FreePool (Private->DevicePath);\r
-      }\r
-\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-      FreePool (Private);\r
-    }\r
-  }\r
-\r
-  This->Stop (This, Handle, 0, NULL);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS                    Status;\r
-  UINTN                         Index;\r
-  BOOLEAN                       AllChildrenStopped;\r
-  EFI_SERIAL_IO_PROTOCOL        *SerialIo;\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  EFI_WIN_NT_IO_PROTOCOL        *WinNtIo;\r
-\r
-  //\r
-  // Complete all outstanding transactions to Controller.\r
-  // Don't allow any new transaction to Controller to be started.\r
-  //\r
-\r
-  if (NumberOfChildren == 0) {\r
-    //\r
-    // Close the bus driver\r
-    //\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiDevicePathProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-    return Status;\r
-  }\r
-\r
-  AllChildrenStopped = TRUE;\r
-\r
-  for (Index = 0; Index < NumberOfChildren; Index++) {\r
-    Status = gBS->OpenProtocol (\r
-                    ChildHandleBuffer[Index],\r
-                    &gEfiSerialIoProtocolGuid,\r
-                    (VOID **) &SerialIo,\r
-                    This->DriverBindingHandle,\r
-                    Handle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (!EFI_ERROR (Status)) {\r
-      Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (SerialIo);\r
-\r
-      ASSERT (Private->Handle == ChildHandleBuffer[Index]);\r
-\r
-      Status = gBS->CloseProtocol (\r
-                      Handle,\r
-                      &gEfiWinNtIoProtocolGuid,\r
-                      This->DriverBindingHandle,\r
-                      ChildHandleBuffer[Index]\r
-                      );\r
-\r
-      Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                      ChildHandleBuffer[Index],\r
-                      &gEfiSerialIoProtocolGuid,\r
-                      &Private->SerialIo,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      Private->DevicePath,\r
-                      NULL\r
-                      );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        gBS->OpenProtocol (\r
-              Handle,\r
-              &gEfiWinNtIoProtocolGuid,\r
-              (VOID **) &WinNtIo,\r
-              This->DriverBindingHandle,\r
-              ChildHandleBuffer[Index],\r
-              EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-              );\r
-      } else {\r
-        Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
-\r
-        FreePool (Private->DevicePath);\r
-\r
-        FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-        FreePool (Private);\r
-      }\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      AllChildrenStopped = FALSE;\r
-    }\r
-  }\r
-\r
-  if (!AllChildrenStopped) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-//\r
-// Serial IO Protocol member functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoReset (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Private->WinNtThunk->PurgeComm (\r
-                        Private->NtHandle,\r
-                        PURGE_TXCLEAR | PURGE_RXCLEAR\r
-                        );\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return This->SetAttributes (\r
-                This,\r
-                This->Mode->BaudRate,\r
-                This->Mode->ReceiveFifoDepth,\r
-                This->Mode->Timeout,\r
-                (EFI_PARITY_TYPE)This->Mode->Parity,\r
-                (UINT8) This->Mode->DataBits,\r
-                (EFI_STOP_BITS_TYPE)This->Mode->StopBits\r
-                );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoSetAttributes (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT64                 BaudRate,\r
-  IN UINT32                 ReceiveFifoDepth,\r
-  IN UINT32                 Timeout,\r
-  IN EFI_PARITY_TYPE        Parity,\r
-  IN UINT8                  DataBits,\r
-  IN EFI_STOP_BITS_TYPE     StopBits\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function is used to set the attributes.\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.\r
-  BaudRate          - The Baud rate of the serial device.\r
-  ReceiveFifoDepth  - The request depth of fifo on receive side.\r
-  Timeout           - the request timeout for a single charact.\r
-  Parity            - The type of parity used in serial device.\r
-  DataBits          - Number of deata bits used in serial device.\r
-  StopBits          - Number of stop bits used in serial device.\r
-\r
-Returns:\r
-  Status code\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS                    Status;\r
-  UINTN                         Index;  \r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  COMMTIMEOUTS                  PortTimeOuts;\r
-  DWORD                         ConvertedTime;\r
-  BOOL                          Result;\r
-  UART_DEVICE_PATH              *Uart;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  //  Some of our arguments have defaults if a null value is passed in, and\r
-  //   we must set the default values if a null argument is passed in.\r
-  //\r
-  if (BaudRate == 0) {\r
-    BaudRate = PcdGet64 (PcdUartDefaultBaudRate);\r
-  }\r
-\r
-  if (ReceiveFifoDepth == 0) {\r
-    ReceiveFifoDepth = SERIAL_FIFO_DEFAULT;\r
-  }\r
-\r
-  if (Timeout == 0) {\r
-    Timeout = SERIAL_TIMEOUT_DEFAULT;\r
-  }\r
-\r
-  if (Parity == DefaultParity) {\r
-    Parity = (EFI_PARITY_TYPE) (PcdGet8 (PcdUartDefaultParity));\r
-  }\r
-\r
-  if (DataBits == 0) {\r
-    DataBits = PcdGet8 (PcdUartDefaultDataBits);\r
-  }\r
-\r
-  if (StopBits == DefaultStopBits) {\r
-    StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits);\r
-  }\r
-\r
-  //\r
-  // Make sure all parameters are valid\r
-  //\r
-  if ((BaudRate > SERIAL_PORT_MAX_BAUD_RATE) || (BaudRate < SERIAL_PORT_MIN_BAUD_RATE)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  //The lower baud rate supported by the serial device will be selected without exceeding the unsupported BaudRate parameter\r
-  // \r
-  \r
-  for (Index = 1; Index < (ARRAY_SIZE (mBaudRateCurrentSupport)); Index++) {\r
-    if (BaudRate < mBaudRateCurrentSupport[Index]) {\r
-      BaudRate = mBaudRateCurrentSupport[Index-1];\r
-      break;\r
-      }\r
-  }\r
-\r
-  if ((ReceiveFifoDepth < 1) || (ReceiveFifoDepth > SERIAL_PORT_MAX_RECEIVE_FIFO_DEPTH)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Timeout < SERIAL_PORT_MIN_TIMEOUT) || (Timeout > SERIAL_PORT_MAX_TIMEOUT)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Parity < NoParity) || (Parity > SpaceParity)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((StopBits < OneStopBit) || (StopBits > TwoStopBits)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Now we only support DataBits=7,8.\r
-  //\r
-  if ((DataBits < 7) || (DataBits > 8)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  //\r
-  // Now we only support DataBits=7,8.\r
-  // for DataBits = 6,7,8, StopBits can not set OneFiveStopBits.\r
-  //\r
-  if (StopBits == OneFiveStopBits) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }  \r
-  \r
-  //\r
-  // See if the new attributes already match the current attributes\r
-  //\r
-  if (Private->UartDevicePath.BaudRate       == BaudRate         &&\r
-      Private->UartDevicePath.DataBits       == DataBits         &&\r
-      Private->UartDevicePath.Parity         == Parity           &&\r
-      Private->UartDevicePath.StopBits       == StopBits         &&\r
-      Private->SerialIoMode.ReceiveFifoDepth == ReceiveFifoDepth &&\r
-      Private->SerialIoMode.Timeout          == Timeout             ) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  //\r
-  //  Get current values from NT\r
-  //\r
-  ZeroMem (&Private->NtDCB, sizeof (DCB));\r
-  Private->NtDCB.DCBlength = sizeof (DCB);\r
-\r
-  if (!Private->WinNtThunk->GetCommState (Private->NtHandle, &Private->NtDCB)) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialSetAttributes: GetCommState %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Map EFI com setting to NT\r
-  //\r
-  Private->NtDCB.BaudRate         = ConvertBaud2Nt (BaudRate);\r
-  Private->NtDCB.ByteSize         = ConvertData2Nt (DataBits);\r
-  Private->NtDCB.Parity           = ConvertParity2Nt (Parity);\r
-  Private->NtDCB.StopBits         = ConvertStop2Nt (StopBits);\r
-\r
-  Private->NtDCB.fBinary          = TRUE;\r
-  Private->NtDCB.fParity          = Private->NtDCB.Parity == NOPARITY ? FALSE : TRUE;\r
-  Private->NtDCB.fOutxCtsFlow     = FALSE;\r
-  Private->NtDCB.fOutxDsrFlow     = FALSE;\r
-  Private->NtDCB.fDtrControl      = DTR_CONTROL_ENABLE;\r
-  Private->NtDCB.fDsrSensitivity  = FALSE;\r
-  Private->NtDCB.fOutX            = FALSE;\r
-  Private->NtDCB.fInX             = FALSE;\r
-  Private->NtDCB.fRtsControl      = RTS_CONTROL_ENABLE;\r
-  Private->NtDCB.fNull            = FALSE;\r
-\r
-  //\r
-  //  Set new values\r
-  //\r
-  Result = Private->WinNtThunk->SetCommState (Private->NtHandle, &Private->NtDCB);\r
-  if (!Result) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialSetAttributes: SetCommState %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  //  Set com port read/write timeout values\r
-  //\r
-  ConvertedTime = ConvertTime2Nt (Timeout);\r
-  PortTimeOuts.ReadIntervalTimeout = MAXDWORD;\r
-  PortTimeOuts.ReadTotalTimeoutMultiplier = 0;\r
-  PortTimeOuts.ReadTotalTimeoutConstant = ConvertedTime;\r
-  PortTimeOuts.WriteTotalTimeoutMultiplier = ConvertedTime == 0 ? 1 : ConvertedTime;\r
-  PortTimeOuts.WriteTotalTimeoutConstant = 0;\r
-\r
-  if (!Private->WinNtThunk->SetCommTimeouts (Private->NtHandle, &PortTimeOuts)) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialSetAttributes: SetCommTimeouts %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  //  Update mode\r
-  //\r
-  Private->SerialIoMode.BaudRate          = BaudRate;\r
-  Private->SerialIoMode.ReceiveFifoDepth  = ReceiveFifoDepth;\r
-  Private->SerialIoMode.Timeout           = Timeout;\r
-  Private->SerialIoMode.Parity            = Parity;\r
-  Private->SerialIoMode.DataBits          = DataBits;\r
-  Private->SerialIoMode.StopBits          = StopBits;\r
-\r
-  //\r
-  // See if Device Path Node has actually changed\r
-  //\r
-  if (Private->UartDevicePath.BaudRate     == BaudRate &&\r
-      Private->UartDevicePath.DataBits     == DataBits &&\r
-      Private->UartDevicePath.Parity       == Parity   &&\r
-      Private->UartDevicePath.StopBits     == StopBits    ) {\r
-    gBS->RestoreTPL(Tpl);\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Update the device path\r
-  //\r
-  Private->UartDevicePath.BaudRate  = BaudRate;\r
-  Private->UartDevicePath.DataBits  = DataBits;\r
-  Private->UartDevicePath.Parity    = (UINT8) Parity;\r
-  Private->UartDevicePath.StopBits  = (UINT8) StopBits;\r
-\r
-  Status = EFI_SUCCESS;\r
-  if (Private->Handle != NULL) {\r
-    Uart = (UART_DEVICE_PATH *) (\r
-             (UINTN) Private->DevicePath\r
-             + GetDevicePathSize (Private->ParentDevicePath)\r
-             - END_DEVICE_PATH_LENGTH\r
-             );\r
-    CopyMem (Uart, &Private->UartDevicePath, sizeof (UART_DEVICE_PATH));\r
-    Status = gBS->ReinstallProtocolInterface (\r
-                    Private->Handle,\r
-                    &gEfiDevicePathProtocolGuid,\r
-                    Private->DevicePath,\r
-                    Private->DevicePath\r
-                    );\r
-  }\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoSetControl (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT32                 Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  BOOL                          Result;\r
-  DCB                           Dcb;\r
-  EFI_TPL                       Tpl;\r
-  UART_FLOW_CONTROL_DEVICE_PATH *FlowControl;\r
-  EFI_STATUS                    Status;\r
-\r
-  //\r
-  // first determine the parameter is invalid\r
-  //\r
-  if (Control & (~(EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_READY |\r
-                   EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE | EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE | \r
-                   EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE))) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Result  = Private->WinNtThunk->GetCommState (Private->NtHandle, &Dcb);\r
-\r
-  if (!Result) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialSetControl: GetCommState %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Dcb.fRtsControl                 = RTS_CONTROL_DISABLE;\r
-  Dcb.fDtrControl                 = DTR_CONTROL_DISABLE;\r
-  Private->HardwareFlowControl    = FALSE;\r
-  Private->SoftwareLoopbackEnable = FALSE;\r
-  Private->HardwareLoopbackEnable = FALSE;\r
-\r
-  if (Control & EFI_SERIAL_REQUEST_TO_SEND) {\r
-    Dcb.fRtsControl = RTS_CONTROL_ENABLE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_DATA_TERMINAL_READY) {\r
-    Dcb.fDtrControl = DTR_CONTROL_ENABLE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) {\r
-    Private->HardwareFlowControl = TRUE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) {\r
-    Private->SoftwareLoopbackEnable = TRUE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) {\r
-    Private->HardwareLoopbackEnable = TRUE;\r
-  }\r
-\r
-  Result = Private->WinNtThunk->SetCommState (\r
-                                  Private->NtHandle,\r
-                                  &Dcb\r
-                                  );\r
-\r
-  if (!Result) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialSetControl: SetCommState %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-  if (Private->Handle != NULL) {\r
-    FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) (\r
-                    (UINTN) Private->DevicePath\r
-                    + GetDevicePathSize (Private->ParentDevicePath)\r
-                    - END_DEVICE_PATH_LENGTH\r
-                    + sizeof (UART_DEVICE_PATH)\r
-                    );\r
-    if (IsUartFlowControlNode (FlowControl) &&\r
-        ((FlowControl->FlowControlMap == UART_FLOW_CONTROL_HARDWARE) ^ Private->HardwareFlowControl)) {\r
-      //\r
-      // Flow Control setting is changed, need to reinstall device path protocol\r
-      //\r
-      FlowControl->FlowControlMap = Private->HardwareFlowControl ? UART_FLOW_CONTROL_HARDWARE : 0;\r
-      Status = gBS->ReinstallProtocolInterface (\r
-                      Private->Handle,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      Private->DevicePath,\r
-                      Private->DevicePath\r
-                      );\r
-    }\r
-  }\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoGetControl (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  OUT UINT32                  *Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  DWORD                         ModemStatus;\r
-  DWORD                         Errors;\r
-  UINT32                        Bits;\r
-  DCB                           Dcb;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  //  Get modem status\r
-  //\r
-  if (!Private->WinNtThunk->GetCommModemStatus (Private->NtHandle, &ModemStatus)) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Bits = 0;\r
-  if (ModemStatus & MS_CTS_ON) {\r
-    Bits |= EFI_SERIAL_CLEAR_TO_SEND;\r
-  }\r
-\r
-  if (ModemStatus & MS_DSR_ON) {\r
-    Bits |= EFI_SERIAL_DATA_SET_READY;\r
-  }\r
-\r
-  if (ModemStatus & MS_RING_ON) {\r
-    Bits |= EFI_SERIAL_RING_INDICATE;\r
-  }\r
-\r
-  if (ModemStatus & MS_RLSD_ON) {\r
-    Bits |= EFI_SERIAL_CARRIER_DETECT;\r
-  }\r
-\r
-  //\r
-  // Get ctrl status\r
-  //\r
-  if (!Private->WinNtThunk->GetCommState (Private->NtHandle, &Dcb)) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialGetControl: GetCommState %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (Dcb.fDtrControl == DTR_CONTROL_ENABLE) {\r
-    Bits |= EFI_SERIAL_DATA_TERMINAL_READY;\r
-  }\r
-\r
-  if (Dcb.fRtsControl == RTS_CONTROL_ENABLE) {\r
-    Bits |= EFI_SERIAL_REQUEST_TO_SEND;\r
-  }\r
-\r
-  if (Private->HardwareFlowControl) {\r
-    Bits |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-  }\r
-\r
-  if (Private->SoftwareLoopbackEnable) {\r
-    Bits |= EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE;\r
-  }\r
-\r
-  if (Private->HardwareLoopbackEnable) {\r
-    Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
-  }\r
-\r
-  //\r
-  //  Get input buffer status\r
-  //\r
-  if (!Private->WinNtThunk->ClearCommError (Private->NtHandle, &Errors, &Private->NtComStatus)) {\r
-    Private->NtError = Private->WinNtThunk->GetLastError ();\r
-    DEBUG ((EFI_D_ERROR, "SerialGetControl: ClearCommError %d\n", Private->NtError));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (Private->NtComStatus.cbInQue == 0) {\r
-    Bits |= EFI_SERIAL_INPUT_BUFFER_EMPTY;\r
-  }\r
-\r
-  *Control = Bits;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoWrite (\r
-  IN EFI_SERIAL_IO_PROTOCOL   *This,\r
-  IN OUT UINTN                *BufferSize,\r
-  IN VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  UINT8                         *ByteBuffer;\r
-  UINTN                         TotalBytesWritten;\r
-  DWORD                         BytesToGo;\r
-  DWORD                         BytesWritten;\r
-  BOOL                          Result;\r
-  UINT32                        Index;\r
-  UINT32                        Control;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl               = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private           = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  ByteBuffer        = (UINT8 *) Buffer;\r
-  TotalBytesWritten = 0;\r
-\r
-  if (Private->SoftwareLoopbackEnable || Private->HardwareLoopbackEnable) {\r
-    for (Index = 0; Index < *BufferSize; Index++) {\r
-      if (IsaSerialFifoAdd (&Private->Fifo, ByteBuffer[Index]) == EFI_SUCCESS) {\r
-        TotalBytesWritten++;\r
-      } else {\r
-        break;\r
-      }\r
-    }\r
-  } else {\r
-    BytesToGo = (DWORD) (*BufferSize);\r
-\r
-    do {\r
-      if (Private->HardwareFlowControl) {\r
-        //\r
-        // Send RTS\r
-        //\r
-        WinNtSerialIoGetControl (&Private->SerialIo, &Control);\r
-        Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
-        WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
-      }\r
-\r
-      //\r
-      //  Do the write\r
-      //\r
-      Result = Private->WinNtThunk->WriteFile (\r
-                                      Private->NtHandle,\r
-                                      &ByteBuffer[TotalBytesWritten],\r
-                                      BytesToGo,\r
-                                      &BytesWritten,\r
-                                      NULL\r
-                                      );\r
-\r
-      if (Private->HardwareFlowControl) {\r
-        //\r
-        // Assert RTS\r
-        //\r
-        WinNtSerialIoGetControl (&Private->SerialIo, &Control);\r
-        Control &= ~ (UINT32) EFI_SERIAL_REQUEST_TO_SEND;\r
-        WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
-      }\r
-\r
-      TotalBytesWritten += BytesWritten;\r
-      BytesToGo -= BytesWritten;\r
-      if (!Result) {\r
-        Private->NtError = Private->WinNtThunk->GetLastError ();\r
-        DEBUG ((EFI_D_ERROR, "SerialWrite: FileWrite %d\n", Private->NtError));\r
-        *BufferSize = TotalBytesWritten;\r
-        gBS->RestoreTPL (Tpl);\r
-        return EFI_DEVICE_ERROR;\r
-      }\r
-    } while (BytesToGo > 0);\r
-  }\r
-\r
-  *BufferSize = TotalBytesWritten;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoRead (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  IN  OUT UINTN               *BufferSize,\r
-  OUT VOID                    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA *Private;\r
-  BOOL                          Result;\r
-  DWORD                         BytesRead;\r
-  EFI_STATUS                    Status;\r
-  UINT32                        Index;\r
-  UINT8                         Data;\r
-  UINT32                        Control;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  //  Do the read\r
-  //\r
-  if (Private->SoftwareLoopbackEnable || Private->HardwareLoopbackEnable) {\r
-    for (Index = 0, BytesRead = 0; Index < *BufferSize; Index++) {\r
-      if (IsaSerialFifoRemove (&Private->Fifo, &Data) == EFI_SUCCESS) {\r
-        ((UINT8 *) Buffer)[Index] = Data;\r
-        BytesRead++;\r
-      } else {\r
-        break;\r
-      }\r
-    }\r
-  } else {\r
-    if (Private->HardwareFlowControl) {\r
-      WinNtSerialIoGetControl (&Private->SerialIo, &Control);\r
-      Control |= EFI_SERIAL_DATA_TERMINAL_READY;\r
-      WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
-    }\r
-\r
-    Result = Private->WinNtThunk->ReadFile (\r
-                                    Private->NtHandle,\r
-                                    Buffer,\r
-                                    (DWORD) *BufferSize,\r
-                                    &BytesRead,\r
-                                    NULL\r
-                                    );\r
-\r
-    if (Private->HardwareFlowControl) {\r
-      WinNtSerialIoGetControl (&Private->SerialIo, &Control);\r
-      Control &= ~ (UINT32) EFI_SERIAL_DATA_TERMINAL_READY;\r
-      WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
-    }\r
-\r
-    if (!Result) {\r
-      Private->NtError = Private->WinNtThunk->GetLastError ();\r
-      gBS->RestoreTPL (Tpl);\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-  }\r
-\r
-  if (BytesRead != *BufferSize) {\r
-    Status = EFI_TIMEOUT;\r
-  } else {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-  *BufferSize = (UINTN) BytesRead;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-BOOLEAN\r
-IsaSerialFifoFull (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Detect whether specific FIFO is full or not\r
-\r
-  Arguments:\r
-  Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-\r
-  Returns:\r
-  TRUE:  the FIFO is full\r
-  FALSE: the FIFO is not full\r
-\r
---*/\r
-{\r
-  if (Fifo->Surplus == 0) {\r
-    return TRUE;\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-BOOLEAN\r
-IsaSerialFifoEmpty (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Detect whether specific FIFO is empty or not\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-\r
-  Returns:\r
-    TRUE:  the FIFO is empty\r
-    FALSE: the FIFO is not empty\r
-\r
---*/\r
-{\r
-  if (Fifo->Surplus == SERIAL_MAX_BUFFER_SIZE) {\r
-    return TRUE;\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-EFI_STATUS\r
-IsaSerialFifoAdd (\r
-  IN SERIAL_DEV_FIFO *Fifo,\r
-  IN UINT8           Data\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Add data to specific FIFO\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8: the data added to FIFO\r
-\r
-  Returns:\r
-    EFI_SUCCESS:  Add data to specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full\r
-\r
---*/\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-{\r
-  //\r
-  // if FIFO full can not add data\r
-  //\r
-  if (IsaSerialFifoFull (Fifo)) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // FIFO is not full can add data\r
-  //\r
-  Fifo->Data[Fifo->Last] = Data;\r
-  Fifo->Surplus--;\r
-  Fifo->Last++;\r
-  if (Fifo->Last >= SERIAL_MAX_BUFFER_SIZE) {\r
-    Fifo->Last = 0;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-IsaSerialFifoRemove (\r
-  IN  SERIAL_DEV_FIFO *Fifo,\r
-  OUT UINT8           *Data\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Remove data from specific FIFO\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8*: the data removed from FIFO\r
-\r
-  Returns:\r
-    EFI_SUCCESS:  Remove data from specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty\r
-\r
---*/\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-{\r
-  //\r
-  // if FIFO is empty, no data can remove\r
-  //\r
-  if (IsaSerialFifoEmpty (Fifo)) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // FIFO is not empty, can remove data\r
-  //\r
-  *Data = Fifo->Data[Fifo->First];\r
-  Fifo->Surplus++;\r
-  Fifo->First++;\r
-  if (Fifo->First >= SERIAL_MAX_BUFFER_SIZE) {\r
-    Fifo->First = 0;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.h b/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.h
deleted file mode 100644 (file)
index 2dc91d8..0000000
+++ /dev/null
@@ -1,533 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtSerialIo.h\r
-\r
-Abstract:\r
-\r
-\r
-**/\r
-\r
-#ifndef _WIN_NT_SERIAL_IO_\r
-#define _WIN_NT_SERIAL_IO_\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-\r
-#define SERIAL_MAX_BUFFER_SIZE  256\r
-#define TIMEOUT_STALL_INTERVAL  10\r
-\r
-typedef struct {\r
-  UINT32  First;\r
-  UINT32  Last;\r
-  UINT32  Surplus;\r
-  UINT8   Data[SERIAL_MAX_BUFFER_SIZE];\r
-} SERIAL_DEV_FIFO;\r
-\r
-#define WIN_NT_SERIAL_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('N', 'T', 's', 'i')\r
-typedef struct {\r
-  UINT64                    Signature;\r
-\r
-  //\r
-  // Protocol data for the new handle we are going to add\r
-  //\r
-  EFI_HANDLE                Handle;\r
-  EFI_SERIAL_IO_PROTOCOL    SerialIo;\r
-  EFI_SERIAL_IO_MODE        SerialIoMode;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-\r
-  //\r
-  // Private Data\r
-  //\r
-  EFI_HANDLE                ControllerHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-  UART_DEVICE_PATH          UartDevicePath;\r
-  EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
-\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-\r
-  //\r
-  // Private NT type Data;\r
-  //\r
-  HANDLE                    NtHandle;\r
-  DCB                       NtDCB;\r
-  DWORD                     NtError;\r
-  COMSTAT                   NtComStatus;\r
-\r
-  BOOLEAN                   SoftwareLoopbackEnable;\r
-  BOOLEAN                   HardwareFlowControl;\r
-  BOOLEAN                   HardwareLoopbackEnable;\r
-\r
-  SERIAL_DEV_FIFO           Fifo;\r
-\r
-} WIN_NT_SERIAL_IO_PRIVATE_DATA;\r
-\r
-#define WIN_NT_SERIAL_IO_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, WIN_NT_SERIAL_IO_PRIVATE_DATA, SerialIo, WIN_NT_SERIAL_IO_PRIVATE_DATA_SIGNATURE)\r
-\r
-//\r
-// Global Protocol Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gWinNtSerialIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gWinNtSerialIoComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gWinNtSerialIoComponentName2;\r
-\r
-//\r
-// Macros to convert EFI serial types to NT serial types.\r
-//\r
-\r
-//\r
-// one second\r
-//\r
-#define SERIAL_TIMEOUT_DEFAULT  (1000 * 1000) \r
-#define SERIAL_BAUD_DEFAULT     115200\r
-#define SERIAL_FIFO_DEFAULT     14\r
-#define SERIAL_DATABITS_DEFAULT 8\r
-#define SERIAL_PARITY_DEFAULT   DefaultParity\r
-#define SERIAL_STOPBITS_DEFAULT DefaultStopBits\r
-\r
-#define SERIAL_CONTROL_MASK     (EFI_SERIAL_CLEAR_TO_SEND                | \\r
-                                 EFI_SERIAL_DATA_SET_READY               | \\r
-                                 EFI_SERIAL_RING_INDICATE                | \\r
-                                 EFI_SERIAL_CARRIER_DETECT               | \\r
-                                 EFI_SERIAL_REQUEST_TO_SEND              | \\r
-                                 EFI_SERIAL_DATA_TERMINAL_READY          | \\r
-                                 EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE     | \\r
-                                 EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE     | \\r
-                                 EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE | \\r
-                                 EFI_SERIAL_INPUT_BUFFER_EMPTY)\r
-\r
-#define ConvertBaud2Nt(x)       (DWORD) x\r
-#define ConvertData2Nt(x)       (BYTE) x\r
-\r
-#define ConvertParity2Nt(x)              \\r
-    (BYTE) (                             \\r
-    x == DefaultParity ? NOPARITY    :   \\r
-    x == NoParity      ? NOPARITY    :   \\r
-    x == EvenParity    ? EVENPARITY  :   \\r
-    x == OddParity     ? ODDPARITY   :   \\r
-    x == MarkParity    ? MARKPARITY  :   \\r
-    x == SpaceParity   ? SPACEPARITY : 0 \\r
-    )\r
-\r
-#define ConvertStop2Nt(x)                 \\r
-    (BYTE) (                                \\r
-    x == DefaultParity   ? ONESTOPBIT   :   \\r
-    x == OneFiveStopBits ? ONE5STOPBITS :   \\r
-    x == TwoStopBits     ? TWOSTOPBITS  : 0 \\r
-    )\r
-\r
-#define ConvertTime2Nt(x) ((x) / 1000)\r
-\r
-//\r
-// 115400 baud with rounding errors\r
-//\r
-#define SERIAL_PORT_MAX_BAUD_RATE 115400  \r
-\r
-#define SERIAL_PORT_MIN_BAUD_RATE           50\r
-#define SERIAL_PORT_MAX_RECEIVE_FIFO_DEPTH  16\r
-\r
-#define SERIAL_PORT_MIN_TIMEOUT             1         // 1 uS\r
-#define SERIAL_PORT_MAX_TIMEOUT             100000000 // 100 seconds\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtSerialIo (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoReset (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoSetAttributes (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT64                 BaudRate,\r
-  IN UINT32                 ReceiveFifoDepth,\r
-  IN UINT32                 Timeout,\r
-  IN EFI_PARITY_TYPE        Parity,\r
-  IN UINT8                  DataBits,\r
-  IN EFI_STOP_BITS_TYPE     StopBits\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  BaudRate          - TODO: add argument description\r
-  ReceiveFifoDepth  - TODO: add argument description\r
-  Timeout           - TODO: add argument description\r
-  Parity            - TODO: add argument description\r
-  DataBits          - TODO: add argument description\r
-  StopBits          - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoSetControl (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT32                 Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoGetControl (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  OUT UINT32                  *Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoWrite (\r
-  IN EFI_SERIAL_IO_PROTOCOL   *This,\r
-  IN OUT UINTN                *BufferSize,\r
-  IN VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSerialIoRead (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  IN  OUT UINTN               *BufferSize,\r
-  OUT VOID                    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-IsaSerialFifoFull (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-IsaSerialFifoEmpty (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialFifoAdd (\r
-  IN SERIAL_DEV_FIFO *Fifo,\r
-  IN UINT8           Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-  Data  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialFifoRemove (\r
-  IN  SERIAL_DEV_FIFO *Fifo,\r
-  OUT UINT8           *Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-  Data  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialReceiveTransmit (\r
-  WIN_NT_SERIAL_IO_PRIVATE_DATA     *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf b/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf
deleted file mode 100644 (file)
index 812cf78..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-## @file\r
-# Serial I/O driver\r
-#\r
-# Our DriverBinding member functions operate on the handles\r
-#  created by the NT Bus drive\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtSerialIoDxe\r
-  FILE_GUID                      = 6B41B553-A649-11d4-BD02-0080C73C8881\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = InitializeWinNtSerialIo\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gWinNtSerialIoDriverBinding                  \r
-#  COMPONENT_NAME                =  gWinNtSerialIoComponentName                  \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  WinNtSerialIo.c\r
-  WinNtSerialIo.h\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-[Guids]\r
-  gEfiWinNtSerialPortGuid                       # ALWAYS_CONSUMED\r
-  gEfiUartDevicePathGuid\r
-\r
-[Protocols]\r
-  gEfiSerialIoProtocolGuid                      # PROTOCOL BY_START\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL TO_START\r
-\r
-[Pcd]\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1\r
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1\r
-\r
diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/ComponentName.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/ComponentName.c
deleted file mode 100644 (file)
index 3dc115e..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-**/\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/FileSystemVolumeLabelInfo.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Guid/FileInfo.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Guid/FileSystemInfo.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include "WinNtSimpleFileSystem.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gWinNtSimpleFileSystemComponentName = {\r
-  WinNtSimpleFileSystemComponentNameGetDriverName,\r
-  WinNtSimpleFileSystemComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtSimpleFileSystemComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtSimpleFileSystemComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtSimpleFileSystemComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtSimpleFileSystemDriverNameTable[] = {\r
-  {\r
-    "eng;en",\r
-    L"Windows Simple File System Driver"\r
-  },\r
-  {\r
-    NULL,\r
-    NULL\r
-  }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mWinNtSimpleFileSystemDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gWinNtSimpleFileSystemComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL   *SimpleFileSystem;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gWinNtSimpleFileSystemDriverBinding.DriverBindingHandle,\r
-             &gEfiWinNtIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  (VOID **) &SimpleFileSystem,\r
-                  gWinNtSimpleFileSystemDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gWinNtSimpleFileSystemComponentName)\r
-           );\r
-}\r
diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c
deleted file mode 100644 (file)
index f13f82e..0000000
+++ /dev/null
@@ -1,2928 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtSimpleFileSystem.c\r
-\r
-Abstract:\r
-\r
-  Produce Simple File System abstractions for directories on your PC using Win32 APIs.\r
-  The configuration of what devices to mount or emulate comes from NT\r
-  environment variables. The variables must be visible to the Microsoft*\r
-  Developer Studio for them to work.\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Guid/FileSystemVolumeLabelInfo.h>\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Guid/FileInfo.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Guid/FileSystemInfo.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include "WinNtSimpleFileSystem.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gWinNtSimpleFileSystemDriverBinding = {\r
-  WinNtSimpleFileSystemDriverBindingSupported,\r
-  WinNtSimpleFileSystemDriverBindingStart,\r
-  WinNtSimpleFileSystemDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-/**\r
-  The user Entry Point for module WinNtSimpleFileSystem. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtSimpleFileSystem(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Install driver model protocol(s).\r
-  //\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gWinNtSimpleFileSystemDriverBinding,\r
-             ImageHandle,\r
-             &gWinNtSimpleFileSystemComponentName,\r
-             &gWinNtSimpleFileSystemComponentName2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
-CHAR16 *\r
-EfiStrChr (\r
-  IN CHAR16   *Str,\r
-  IN CHAR16   Chr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Locate the first occurance of a character in a string.\r
-\r
-Arguments:\r
-\r
-  Str - Pointer to NULL terminated unicode string.\r
-  Chr - Character to locate.\r
-\r
-Returns:\r
-\r
-  If Str is NULL, then NULL is returned.\r
-  If Chr is not contained in Str, then NULL is returned.\r
-  If Chr is contained in Str, then a pointer to the first occurance of Chr in Str is returned.\r
-\r
---*/\r
-{\r
-  if (Str == NULL) {\r
-    return Str;\r
-  }\r
-\r
-  while (*Str != '\0' && *Str != Chr) {\r
-    ++Str;\r
-  }\r
-\r
-  return (*Str == Chr) ? Str : NULL;\r
-}\r
-\r
-BOOLEAN\r
-IsZero (\r
-  IN VOID   *Buffer,\r
-  IN UINTN  Length\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Buffer  - TODO: add argument description\r
-  Length  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  if (Buffer == NULL || Length == 0) {\r
-    return FALSE;\r
-  }\r
-\r
-  if (*(UINT8 *) Buffer != 0) {\r
-    return FALSE;\r
-  }\r
-\r
-  if (Length > 1) {\r
-    if (!CompareMem (Buffer, (UINT8 *) Buffer + 1, Length - 1)) {\r
-      return FALSE;\r
-    }\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-VOID\r
-CutPrefix (\r
-  IN  CHAR16  *Str,\r
-  IN  UINTN   Count\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Str   - TODO: add argument description\r
-  Count - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  CHAR16  *Pointer;\r
-\r
-  if (StrLen (Str) < Count) {\r
-    ASSERT (0);\r
-  }\r
-\r
-  if (Count != 0) {\r
-    for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
-      *Pointer = *(Pointer + Count);\r
-    }\r
-    *Pointer = *(Pointer + Count);\r
-  }\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check to see if the driver supports a given controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to test.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         - The device specified by ControllerHandle and RemainingDevicePath is supported by the driver\r
-                        specified by This.\r
-\r
-  EFI_ALREADY_STARTED - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        the driver specified by This.\r
-\r
-  EFI_ACCESS_DENIED   - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        a different driver or an application that requires exclusive access.\r
-\r
-  EFI_UNSUPPORTED     - The device specified by ControllerHandle and RemainingDevicePath is not supported by the\r
-                        driver specified by This.\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_WIN_NT_IO_PROTOCOL  *WinNtIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Make sure GUID is for a File System handle.\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if (CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtFileSystemGuid)) {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiWinNtIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Starts a device controller or a bus controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to start.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The device or bus controller has been started.\r
-\r
-  EFI_DEVICE_ERROR      - The device could not be started due to a device failure.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The request could not be completed due to lack of resources.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_WIN_NT_IO_PROTOCOL            *WinNtIo;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-\r
-  Private = NULL;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &WinNtIo,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Validate GUID\r
-  //\r
-  if (!CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtFileSystemGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  Private = AllocatePool (sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE));\r
-  if (Private == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-\r
-    goto Done;\r
-  }\r
-\r
-  Private->Signature  = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE;\r
-  Private->WinNtThunk = WinNtIo->WinNtThunk;\r
-\r
-  Private->FilePath = WinNtIo->EnvString;\r
-\r
-  Private->VolumeLabel = AllocatePool (StrSize (L"EFI_EMULATED"));\r
-  if (Private->VolumeLabel == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  StrCpy (Private->VolumeLabel, L"EFI_EMULATED");\r
-\r
-  Private->SimpleFileSystem.Revision    = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION;\r
-  Private->SimpleFileSystem.OpenVolume  = WinNtSimpleFileSystemOpenVolume;\r
-\r
-  Private->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS);\r
-\r
-  Private->ControllerNameTable = NULL;\r
-\r
-  AddUnicodeString2 (\r
-    "eng",\r
-    gWinNtSimpleFileSystemComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    TRUE\r
-    );\r
-  AddUnicodeString2 (\r
-    "en",\r
-    gWinNtSimpleFileSystemComponentName2.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WinNtIo->EnvString,\r
-    FALSE\r
-    );\r
-\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  &Private->SimpleFileSystem,\r
-                  NULL\r
-                  );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    if (Private != NULL) {\r
-\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-      FreePool (Private);\r
-    }\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle  - A handle to the device to be stopped.\r
-\r
-  NumberOfChildren  - The number of child device handles in ChildHandleBuffer.\r
-\r
-  ChildHandleBuffer - An array of child device handles to be freed.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - The device has been stopped.\r
-\r
-  EFI_DEVICE_ERROR  - The device could not be stopped due to a device failure.\r
-\r
---*/\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL   *SimpleFileSystem;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  (VOID **) &SimpleFileSystem,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);\r
-\r
-  //\r
-  // Uninstall the Simple File System Protocol from ControllerHandle\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  &Private->SimpleFileSystem,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = gBS->CloseProtocol (\r
-                    ControllerHandle,\r
-                    &gEfiWinNtIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle\r
-                    );\r
-  }\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemOpenVolume (\r
-  IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL  *This,\r
-  OUT EFI_FILE_PROTOCOL               **Root\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open the root directory on a volume.\r
-\r
-Arguments:\r
-\r
-  This  - A pointer to the volume to open.\r
-\r
-  Root  - A pointer to storage for the returned opened file handle of the root directory.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The volume was opened.\r
-\r
-  EFI_UNSUPPORTED       - The volume does not support the requested file system type.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The file volume could not be opened due to lack of resources.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-  WIN_NT_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_TPL                           OldTpl;\r
-  CHAR16                            *TempFileName;\r
-  UINTN                             Size;\r
-\r
-  if (This == NULL || Root == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private     = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  PrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
-  if (PrivateFile == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  PrivateFile->FileName = AllocatePool (StrSize (Private->FilePath));\r
-  if (PrivateFile->FileName == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  PrivateFile->FilePath = AllocatePool (StrSize (Private->FilePath));\r
-  if (PrivateFile->FilePath == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  StrCpy (PrivateFile->FilePath, Private->FilePath);\r
-  StrCpy (PrivateFile->FileName, PrivateFile->FilePath);\r
-  PrivateFile->Signature            = WIN_NT_EFI_FILE_PRIVATE_SIGNATURE;\r
-  PrivateFile->WinNtThunk           = Private->WinNtThunk;\r
-  PrivateFile->SimpleFileSystem     = This;\r
-  PrivateFile->IsRootDirectory      = TRUE;\r
-  PrivateFile->IsDirectoryPath      = TRUE;\r
-  PrivateFile->IsOpenedByRead       = TRUE;\r
-  PrivateFile->EfiFile.Revision     = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION;\r
-  PrivateFile->EfiFile.Open         = WinNtSimpleFileSystemOpen;\r
-  PrivateFile->EfiFile.Close        = WinNtSimpleFileSystemClose;\r
-  PrivateFile->EfiFile.Delete       = WinNtSimpleFileSystemDelete;\r
-  PrivateFile->EfiFile.Read         = WinNtSimpleFileSystemRead;\r
-  PrivateFile->EfiFile.Write        = WinNtSimpleFileSystemWrite;\r
-  PrivateFile->EfiFile.GetPosition  = WinNtSimpleFileSystemGetPosition;\r
-  PrivateFile->EfiFile.SetPosition  = WinNtSimpleFileSystemSetPosition;\r
-  PrivateFile->EfiFile.GetInfo      = WinNtSimpleFileSystemGetInfo;\r
-  PrivateFile->EfiFile.SetInfo      = WinNtSimpleFileSystemSetInfo;\r
-  PrivateFile->EfiFile.Flush        = WinNtSimpleFileSystemFlush;\r
-  PrivateFile->IsValidFindBuf       = FALSE;\r
-\r
-  //\r
-  // Set DirHandle\r
-  //\r
-  PrivateFile->DirHandle = PrivateFile->WinNtThunk->CreateFile (\r
-                                                      PrivateFile->FilePath,\r
-                                                      GENERIC_READ,\r
-                                                      FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                      NULL,\r
-                                                      OPEN_EXISTING,\r
-                                                      FILE_FLAG_BACKUP_SEMANTICS,\r
-                                                      NULL\r
-                                                      );\r
-\r
-  if (PrivateFile->DirHandle == INVALID_HANDLE_VALUE) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Find the first file under it\r
-  //\r
-  Size  = StrSize (PrivateFile->FilePath);\r
-  Size += StrSize (L"\\*");\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  Size,\r
-                  (VOID **)&TempFileName\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  StrCpy (TempFileName, PrivateFile->FilePath);\r
-  StrCat (TempFileName, L"\\*");\r
-\r
-  PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &PrivateFile->FindBuf);\r
-  FreePool (TempFileName);\r
-\r
-  if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-    PrivateFile->IsValidFindBuf = FALSE;\r
-  } else {\r
-    PrivateFile->IsValidFindBuf = TRUE;\r
-  }\r
-  *Root = &PrivateFile->EfiFile;\r
-\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    if (PrivateFile) {\r
-      if (PrivateFile->FileName) {\r
-        FreePool (PrivateFile->FileName);\r
-      }\r
-\r
-      if (PrivateFile->FilePath) {\r
-        FreePool (PrivateFile->FilePath);\r
-      }\r
-\r
-      FreePool (PrivateFile);\r
-    }\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Count the number of Leading Dot in FileNameToken.\r
-\r
-  @param FileNameToken  A string representing a token in the path name.\r
-\r
-  @return  UINTN             The number of leading dot in the name.\r
-\r
-**/\r
-UINTN\r
-CountLeadingDots (\r
-  IN CONST CHAR16 * FileNameToken\r
-  )\r
-{\r
-  UINTN          Num;\r
-\r
-  Num = 0;\r
-  while (*FileNameToken == L'.') {\r
-    Num++;\r
-    FileNameToken++;\r
-  }\r
-  \r
-  return Num;\r
-}\r
-\r
-BOOLEAN \r
-IsFileNameTokenValid (\r
-  IN CONST CHAR16 * FileNameToken\r
-  )\r
-{\r
-  UINTN Num;\r
-  if (StrStr (FileNameToken, L"/") != NULL) {\r
-    //\r
-    // No L'/' in file name.\r
-    //\r
-    return FALSE;\r
-  } else {\r
-    //\r
-    // If Token has all dot, the number should not exceed 2\r
-    //\r
-    Num = CountLeadingDots (FileNameToken);\r
-\r
-    if (Num == StrLen (FileNameToken)) {\r
-      //\r
-      // If the FileNameToken only contains a number of L'.'.\r
-      //\r
-      if (Num > 2) {\r
-        return FALSE;\r
-      }\r
-    }\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  Return the first string token found in the indirect pointer a String named by FileName.\r
-\r
-  On input, FileName is a indirect pointer pointing to a String.\r
-  On output, FileName is a updated to point to the next character after the first\r
-  found L"\" or NULL if there is no L"\" found.\r
-\r
-  @param FileName  A indirect pointer pointing to a FileName.\r
-\r
-  @return  Token      The first string token found before a L"\".\r
-\r
-**/\r
-CHAR16 *\r
-GetNextFileNameToken (\r
-  IN OUT CONST CHAR16 ** FileName \r
-  )\r
-{\r
-  CHAR16 *SlashPos;\r
-  CHAR16 *Token;\r
-  UINTN  Offset;\r
-  ASSERT (**FileName != L'\\');\r
-  ASSERT (**FileName != L'\0');\r
-\r
-  SlashPos = StrStr (*FileName, L"\\");\r
-  if (SlashPos == NULL) {\r
-    Token = AllocateCopyPool (StrSize(*FileName), *FileName);\r
-    *FileName = NULL;\r
-  } else {\r
-    Offset = SlashPos - *FileName;\r
-    Token = AllocateZeroPool ((Offset + 1) * sizeof (CHAR16));\r
-    StrnCpy (Token, *FileName, Offset);\r
-    //\r
-    // Point *FileName to the next character after L'\'.\r
-    //\r
-    *FileName = *FileName + Offset + 1;\r
-    //\r
-    // If *FileName is an empty string, then set *FileName to NULL\r
-    //\r
-    if (**FileName == L'\0') {\r
-      *FileName = NULL;\r
-    }\r
-  }\r
-\r
-  return Token;\r
-}\r
-\r
-/**\r
-  Check if a FileName contains only Valid Characters.\r
-\r
-  If FileName contains only a single L'\', return TRUE.\r
-  If FileName contains two adjacent L'\', return FALSE.\r
-  If FileName conatins L'/' , return FALSE.\r
-  If FielName contains more than two dots seperated with other FileName characters\r
-  by L'\', return FALSE. For example, L'.\...\filename.txt' is invalid path name. But L'..TwoDots\filename.txt' is valid path name.\r
-\r
-  @param FileName  The File Name String to check.\r
-\r
-  @return  TRUE        FileName only contains valid characters.\r
-  @return  FALSE       FileName contains at least one invalid character.\r
-\r
-**/\r
-\r
-BOOLEAN\r
-IsFileNameValid (\r
-  IN CONST CHAR16 *FileName \r
-  )\r
-{\r
-  CHAR16       *Token;\r
-  BOOLEAN      Valid;\r
-\r
-  //\r
-  // If FileName is just L'\', then it is a valid pathname. \r
-  //\r
-  if (StrCmp (FileName, L"\\") == 0) {\r
-    return TRUE;\r
-  }\r
-  //\r
-  // We don't support two or more adjacent L'\'.\r
-  //\r
-  if (StrStr (FileName, L"\\\\") != NULL) {\r
-    return FALSE;\r
-  }\r
-\r
-  //\r
-  // Is FileName has a leading L"\", skip to next character.\r
-  //\r
-  if (FileName [0] == L'\\') {\r
-    FileName++;\r
-  }\r
-\r
-  do {\r
-    Token = GetNextFileNameToken (&FileName);\r
-    Valid = IsFileNameTokenValid (Token);\r
-    FreePool (Token);\r
-    \r
-    if (!Valid)\r
-      return FALSE;\r
-  } while (FileName != NULL);\r
-\r
-  return TRUE;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemOpen (\r
-  IN  EFI_FILE_PROTOCOL  *This,\r
-  OUT EFI_FILE_PROTOCOL  **NewHandle,\r
-  IN  CHAR16             *FileName,\r
-  IN  UINT64             OpenMode,\r
-  IN  UINT64             Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open a file relative to the source file location.\r
-\r
-Arguments:\r
-\r
-  This        - A pointer to the source file location.\r
-\r
-  NewHandle   - Pointer to storage for the new file handle.\r
-\r
-  FileName    - Pointer to the file name to be opened.\r
-\r
-  OpenMode    - File open mode information.\r
-\r
-  Attributes  - File creation attributes.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file was opened.\r
-\r
-  EFI_NOT_FOUND         - The file could not be found in the volume.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The volume or file is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources were available to open the file.\r
-\r
-  EFI_VOLUME_FULL       - There is not enough space left to create the new file.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  WIN_NT_EFI_FILE_PRIVATE           *PrivateFile;\r
-  WIN_NT_EFI_FILE_PRIVATE           *NewPrivateFile;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  EFI_STATUS                        Status;\r
-  CHAR16                            *RealFileName;\r
-  CHAR16                            *TempFileName;\r
-  CHAR16                            *ParseFileName;\r
-  CHAR16                            *GuardPointer;\r
-  CHAR16                            TempChar;\r
-  DWORD                             LastError;\r
-  UINTN                             Count;\r
-  BOOLEAN                           LoopFinish;\r
-  UINTN                             InfoSize;\r
-  EFI_FILE_INFO                     *Info;\r
-  UINTN                             Size;\r
-\r
-  //\r
-  // Check for obvious invalid parameters.\r
-  //\r
-  if (This == NULL || NewHandle == NULL || FileName == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  switch (OpenMode) {\r
-  case EFI_FILE_MODE_CREATE | EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE:\r
-    if (Attributes &~EFI_FILE_VALID_ATTR) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (Attributes & EFI_FILE_READ_ONLY) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-  //\r
-  // fall through\r
-  //\r
-  case EFI_FILE_MODE_READ:\r
-  case EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE:\r
-    break;\r
-\r
-  default:\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Init local variables\r
-  //\r
-  PrivateFile     = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot     = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-  NewPrivateFile  = NULL;\r
-\r
-  //\r
-  // Allocate buffer for FileName as the passed in FileName may be read only\r
-  //\r
-  TempFileName = AllocatePool (StrSize (FileName));\r
-  if (TempFileName == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-  StrCpy (TempFileName, FileName);\r
-  FileName = TempFileName;\r
-\r
-  if (FileName[StrLen (FileName) - 1] == L'\\') {\r
-    FileName[StrLen (FileName) - 1]  = 0;\r
-  }\r
-\r
-  //\r
-  // If file name does not equal to "." or ".." and not trailed with "\..",\r
-  // then we trim the leading/trailing blanks and trailing dots\r
-  //\r
-  if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0 && \r
-    ((StrLen (FileName) >= 3) ? (StrCmp (&FileName[StrLen (FileName) - 3], L"\\..") != 0) : TRUE)) {\r
-    //\r
-    // Trim leading blanks\r
-    //\r
-    Count = 0;\r
-    for (TempFileName = FileName;\r
-      *TempFileName != 0 && *TempFileName == L' ';\r
-      TempFileName++) {\r
-      Count++;\r
-    }\r
-    CutPrefix (FileName, Count);\r
-    //\r
-    // Trim trailing blanks\r
-    //\r
-    for (TempFileName = FileName + StrLen (FileName) - 1;\r
-      TempFileName >= FileName && (*TempFileName == L' ');\r
-      TempFileName--) {\r
-      ;\r
-    }\r
-    *(TempFileName + 1) = 0;\r
-  }\r
-\r
-  //\r
-  // Attempt to open the file\r
-  //\r
-  NewPrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
-  if (NewPrivateFile == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
-\r
-  NewPrivateFile->FilePath = AllocatePool (StrSize (PrivateFile->FileName));\r
-  if (NewPrivateFile->FilePath == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    StrCpy (NewPrivateFile->FilePath, PrivateFile->FileName);\r
-  } else {\r
-    StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath);\r
-  }\r
-\r
-  Size = StrSize (NewPrivateFile->FilePath);\r
-  Size += StrSize (L"\\");\r
-  Size += StrSize (FileName);\r
-  NewPrivateFile->FileName = AllocatePool (Size);\r
-  if (NewPrivateFile->FileName == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  if (*FileName == L'\\') {\r
-    StrCpy (NewPrivateFile->FileName, PrivateRoot->FilePath);\r
-    StrCat (NewPrivateFile->FileName, L"\\");\r
-    StrCat (NewPrivateFile->FileName, FileName + 1);\r
-  } else {\r
-    StrCpy (NewPrivateFile->FileName, NewPrivateFile->FilePath);\r
-    if (StrCmp (FileName, L"") != 0) {\r
-      //\r
-      // In case the filename becomes empty, especially after trimming dots and blanks\r
-      //\r
-      StrCat (NewPrivateFile->FileName, L"\\");\r
-      StrCat (NewPrivateFile->FileName, FileName);\r
-    }\r
-  }\r
-\r
-  if (!IsFileNameValid (NewPrivateFile->FileName)) {\r
-    Status = EFI_NOT_FOUND;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Get rid of . and .., except leading . or ..\r
-  //\r
-\r
-  //\r
-  // GuardPointer protect simplefilesystem root path not be destroyed\r
-  //\r
-  GuardPointer  = NewPrivateFile->FileName + StrLen (PrivateRoot->FilePath);\r
-\r
-  LoopFinish    = FALSE;\r
-\r
-  while (!LoopFinish) {\r
-\r
-    LoopFinish = TRUE;\r
-\r
-    for (ParseFileName = GuardPointer; *ParseFileName; ParseFileName++) {\r
-      if (*ParseFileName == L'.' &&\r
-          (*(ParseFileName + 1) == 0 || *(ParseFileName + 1) == L'\\') &&\r
-          *(ParseFileName - 1) == L'\\'\r
-          ) {\r
-\r
-        //\r
-        // cut \.\r
-        //\r
-        CutPrefix (ParseFileName - 1, 2);\r
-        LoopFinish = FALSE;\r
-        break;\r
-      }\r
-\r
-      if (*ParseFileName == L'.' &&\r
-          *(ParseFileName + 1) == L'.' &&\r
-          (*(ParseFileName + 2) == 0 || *(ParseFileName + 2) == L'\\') &&\r
-          *(ParseFileName - 1) == L'\\'\r
-          ) {\r
-\r
-        ParseFileName--;\r
-        Count = 3;\r
-\r
-        while (ParseFileName != GuardPointer) {\r
-          ParseFileName--;\r
-          Count++;\r
-          if (*ParseFileName == L'\\') {\r
-            break;\r
-          }\r
-        }\r
-\r
-        //\r
-        // cut \.. and its left directory\r
-        //\r
-        CutPrefix (ParseFileName, Count);\r
-        LoopFinish = FALSE;\r
-        break;\r
-      }\r
-    }\r
-  }\r
-\r
-  RealFileName = NewPrivateFile->FileName;\r
-  while (EfiStrChr (RealFileName, L'\\') != NULL) {\r
-    RealFileName = EfiStrChr (RealFileName, L'\\') + 1;\r
-  }\r
-\r
-  TempChar = 0;\r
-  if (RealFileName != NewPrivateFile->FileName) {\r
-    TempChar            = *(RealFileName - 1);\r
-    *(RealFileName - 1) = 0;\r
-    }\r
-  \r
-  FreePool (NewPrivateFile->FilePath);\r
-  NewPrivateFile->FilePath = NULL;\r
-  NewPrivateFile->FilePath = AllocatePool (StrSize (NewPrivateFile->FileName));\r
-  if (NewPrivateFile->FilePath == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  StrCpy (NewPrivateFile->FilePath, NewPrivateFile->FileName);\r
-  if (TempChar != 0) {\r
-    *(RealFileName - 1)             = TempChar;\r
-  }\r
-\r
-  NewPrivateFile->IsRootDirectory = FALSE;\r
-\r
-  //\r
-  // Test whether file or directory\r
-  //\r
-  if (OpenMode & EFI_FILE_MODE_CREATE) {\r
-    if (Attributes & EFI_FILE_DIRECTORY) {\r
-      NewPrivateFile->IsDirectoryPath = TRUE;\r
-    } else {\r
-      NewPrivateFile->IsDirectoryPath = FALSE;\r
-    }\r
-  } else {\r
-    NewPrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-    NewPrivateFile->LHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                            NewPrivateFile->FileName,\r
-                                                            GENERIC_READ,\r
-                                                            FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                            NULL,\r
-                                                            OPEN_EXISTING,\r
-                                                            0,\r
-                                                            NULL\r
-                                                            );\r
-\r
-    if (NewPrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
-      NewPrivateFile->IsDirectoryPath = FALSE;\r
-      NewPrivateFile->WinNtThunk->CloseHandle (NewPrivateFile->LHandle);\r
-    } else {\r
-      NewPrivateFile->IsDirectoryPath = TRUE;\r
-    }\r
-\r
-    NewPrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-  }\r
-\r
-  if (OpenMode & EFI_FILE_MODE_WRITE) {\r
-    NewPrivateFile->IsOpenedByRead = FALSE;\r
-  } else {\r
-    NewPrivateFile->IsOpenedByRead = TRUE;\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-\r
-  //\r
-  // deal with directory\r
-  //\r
-  if (NewPrivateFile->IsDirectoryPath) {\r
-\r
-    Size  = StrSize (NewPrivateFile->FileName);\r
-    Size += StrSize (L"\\*");\r
-    TempFileName = AllocatePool (Size);\r
-    if (TempFileName == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (TempFileName, NewPrivateFile->FileName);\r
-\r
-    if ((OpenMode & EFI_FILE_MODE_CREATE)) {\r
-      //\r
-      // Create a directory\r
-      //\r
-      if (!NewPrivateFile->WinNtThunk->CreateDirectory (TempFileName, NULL)) {\r
-\r
-        LastError = PrivateFile->WinNtThunk->GetLastError ();\r
-        if (LastError != ERROR_ALREADY_EXISTS) {\r
-          FreePool (TempFileName);\r
-          Status = EFI_ACCESS_DENIED;\r
-          goto Done;\r
-        }\r
-      }\r
-    }\r
-\r
-    NewPrivateFile->DirHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                              TempFileName,\r
-                                                              NewPrivateFile->IsOpenedByRead ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE),\r
-                                                              FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                              NULL,\r
-                                                              OPEN_EXISTING,\r
-                                                              FILE_FLAG_BACKUP_SEMANTICS,\r
-                                                              NULL\r
-                                                              );\r
-\r
-    if (NewPrivateFile->DirHandle == INVALID_HANDLE_VALUE) {\r
-\r
-      NewPrivateFile->DirHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                                TempFileName,\r
-                                                                GENERIC_READ,\r
-                                                                FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                                NULL,\r
-                                                                OPEN_EXISTING,\r
-                                                                FILE_FLAG_BACKUP_SEMANTICS,\r
-                                                                NULL\r
-                                                                );\r
-\r
-      if (NewPrivateFile->DirHandle != INVALID_HANDLE_VALUE) {\r
-        NewPrivateFile->WinNtThunk->CloseHandle (NewPrivateFile->DirHandle);\r
-        NewPrivateFile->DirHandle = INVALID_HANDLE_VALUE;\r
-        Status                    = EFI_ACCESS_DENIED;\r
-      } else {\r
-        Status = EFI_NOT_FOUND;\r
-      }\r
-\r
-      FreePool (TempFileName);\r
-      goto Done;\r
-    }\r
-\r
-    //\r
-    // Find the first file under it\r
-    //\r
-    StrCat (TempFileName, L"\\*");\r
-    NewPrivateFile->LHandle = NewPrivateFile->WinNtThunk->FindFirstFile (TempFileName, &NewPrivateFile->FindBuf);\r
-    FreePool (TempFileName);\r
-\r
-    if (NewPrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-      NewPrivateFile->IsValidFindBuf = FALSE;\r
-    } else {\r
-      NewPrivateFile->IsValidFindBuf = TRUE;\r
-    }\r
-  } else {\r
-    //\r
-    // deal with file\r
-    //\r
-    if (!NewPrivateFile->IsOpenedByRead) {\r
-      NewPrivateFile->LHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                              NewPrivateFile->FileName,\r
-                                                              GENERIC_READ | GENERIC_WRITE,\r
-                                                              FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                              NULL,\r
-                                                              (OpenMode & EFI_FILE_MODE_CREATE) ? OPEN_ALWAYS : OPEN_EXISTING,\r
-                                                              0,\r
-                                                              NULL\r
-                                                              );\r
-\r
-      if (NewPrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-        NewPrivateFile->LHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                                NewPrivateFile->FileName,\r
-                                                                GENERIC_READ,\r
-                                                                FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                                NULL,\r
-                                                                OPEN_EXISTING,\r
-                                                                0,\r
-                                                                NULL\r
-                                                                );\r
-\r
-        if (NewPrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-          Status = EFI_NOT_FOUND;\r
-        } else {\r
-          Status = EFI_ACCESS_DENIED;\r
-          NewPrivateFile->WinNtThunk->CloseHandle (NewPrivateFile->LHandle);\r
-          NewPrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-        }\r
-      }\r
-    } else {\r
-      NewPrivateFile->LHandle = NewPrivateFile->WinNtThunk->CreateFile (\r
-                                                              NewPrivateFile->FileName,\r
-                                                              GENERIC_READ,\r
-                                                              FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                              NULL,\r
-                                                              OPEN_EXISTING,\r
-                                                              0,\r
-                                                              NULL\r
-                                                              );\r
-\r
-      if (NewPrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-        Status = EFI_NOT_FOUND;\r
-      }\r
-    }\r
-  }\r
-\r
-  if ((OpenMode & EFI_FILE_MODE_CREATE) && Status == EFI_SUCCESS) {\r
-    //\r
-    // Set the attribute\r
-    //\r
-    InfoSize  = 0;\r
-    Info      = NULL;\r
-\r
-    Status    = WinNtSimpleFileSystemGetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, &InfoSize, Info);\r
-\r
-    if (Status != EFI_BUFFER_TOO_SMALL) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    Info = AllocatePool (InfoSize);\r
-    if (Info == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    Status = WinNtSimpleFileSystemGetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, &InfoSize, Info);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      FreePool (Info);\r
-      goto Done;\r
-    }\r
-\r
-    Info->Attribute = Attributes;\r
-\r
-    WinNtSimpleFileSystemSetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, InfoSize, Info);\r
-    FreePool (Info);\r
-  }\r
-\r
-Done:\r
-  FreePool (FileName);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    if (NewPrivateFile) {\r
-      if (NewPrivateFile->FileName) {\r
-        FreePool (NewPrivateFile->FileName);\r
-      }\r
-\r
-      if (NewPrivateFile->FilePath) {\r
-        FreePool (NewPrivateFile->FilePath);\r
-      }\r
-\r
-      FreePool (NewPrivateFile);\r
-    }\r
-  } else {\r
-    *NewHandle = &NewPrivateFile->EfiFile;\r
-    if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) {\r
-     NewPrivateFile->IsRootDirectory = TRUE;\r
-    }   \r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemClose (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close the specified file handle.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The file handle has been closed.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
-    if (PrivateFile->IsDirectoryPath) {\r
-      PrivateFile->WinNtThunk->FindClose (PrivateFile->LHandle);\r
-    } else {\r
-      PrivateFile->WinNtThunk->CloseHandle (PrivateFile->LHandle);\r
-    }\r
-\r
-    PrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-  }\r
-\r
-  if (PrivateFile->IsDirectoryPath && PrivateFile->DirHandle != INVALID_HANDLE_VALUE) {\r
-    PrivateFile->WinNtThunk->CloseHandle (PrivateFile->DirHandle);\r
-    PrivateFile->DirHandle = INVALID_HANDLE_VALUE;\r
-  }\r
-\r
-  if (PrivateFile->FileName) {\r
-    FreePool (PrivateFile->FileName);\r
-  }\r
-\r
-  if (PrivateFile->FilePath) {\r
-    FreePool (PrivateFile->FilePath);\r
-  }\r
-\r
-  FreePool (PrivateFile);\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDelete (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close and delete a file.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS             - The file handle was closed and deleted.\r
-\r
-  EFI_WARN_DELETE_FAILURE - The handle was closed but could not be deleted.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status      = EFI_WARN_DELETE_FAILURE;\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
-      PrivateFile->WinNtThunk->FindClose (PrivateFile->LHandle);\r
-    }\r
-\r
-    if (PrivateFile->DirHandle != INVALID_HANDLE_VALUE) {\r
-      PrivateFile->WinNtThunk->CloseHandle (PrivateFile->DirHandle);\r
-      PrivateFile->DirHandle = INVALID_HANDLE_VALUE;\r
-    }\r
-\r
-    if (PrivateFile->WinNtThunk->RemoveDirectory (PrivateFile->FileName)) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-  } else {\r
-    PrivateFile->WinNtThunk->CloseHandle (PrivateFile->LHandle);\r
-    PrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-\r
-    if (!PrivateFile->IsOpenedByRead) {\r
-      if (PrivateFile->WinNtThunk->DeleteFile (PrivateFile->FileName)) {\r
-        Status = EFI_SUCCESS;\r
-      }\r
-    }\r
-  }\r
-\r
-  FreePool (PrivateFile->FileName);\r
-  FreePool (PrivateFile->FilePath);\r
-  FreePool (PrivateFile);\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-VOID\r
-WinNtSystemTimeToEfiTime (\r
-  IN SYSTEMTIME             *SystemTime,\r
-  IN TIME_ZONE_INFORMATION  *TimeZone,\r
-  OUT EFI_TIME              *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SystemTime  - TODO: add argument description\r
-  TimeZone    - TODO: add argument description\r
-  Time        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  Time->Year        = (UINT16) SystemTime->wYear;\r
-  Time->Month       = (UINT8) SystemTime->wMonth;\r
-  Time->Day         = (UINT8) SystemTime->wDay;\r
-  Time->Hour        = (UINT8) SystemTime->wHour;\r
-  Time->Minute      = (UINT8) SystemTime->wMinute;\r
-  Time->Second      = (UINT8) SystemTime->wSecond;\r
-  Time->Nanosecond  = (UINT32) SystemTime->wMilliseconds * 1000000;\r
-  Time->TimeZone    = (INT16) TimeZone->Bias;\r
-\r
-  if (TimeZone->StandardDate.wMonth) {\r
-    Time->Daylight = EFI_TIME_ADJUST_DAYLIGHT;\r
-  }\r
-}\r
-\r
-/**\r
-  Convert the FileTime to EfiTime.\r
-\r
-  @param PrivateFile  Pointer to WIN_NT_EFI_FILE_PRIVATE.\r
-  @param TimeZone     Pointer to the current time zone.\r
-  @param FileTime     Pointer to file time.\r
-  @param EfiTime      Pointer to EFI time.\r
-**/\r
-VOID\r
-WinNtFileTimeToEfiTime (  \r
-  IN CONST WIN_NT_EFI_FILE_PRIVATE *PrivateFile,\r
-  IN       TIME_ZONE_INFORMATION   *TimeZone,\r
-  IN CONST FILETIME                *FileTime,\r
-  OUT      EFI_TIME                *EfiTime\r
-  )\r
-{\r
-  FILETIME                         TempFileTime;\r
-  SYSTEMTIME                       SystemTime;\r
-\r
-  PrivateFile->WinNtThunk->FileTimeToLocalFileTime (FileTime, &TempFileTime);\r
-  PrivateFile->WinNtThunk->FileTimeToSystemTime (&TempFileTime, &SystemTime);\r
-  WinNtSystemTimeToEfiTime (&SystemTime, TimeZone, EfiTime);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemRead (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read data from a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to a returned open file handle.\r
-\r
-  BufferSize  - On input, the size of the Buffer.  On output, the number of bytes stored in the Buffer.\r
-\r
-  Buffer      - Pointer to the first byte of the read Buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was read.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The supplied buffer size was too small to store the current directory entry.\r
-                          *BufferSize has been updated with the size needed to complete the request.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_STATUS              Status;\r
-  UINTN                   Size;\r
-  UINTN                   NameSize;\r
-  UINTN                   ResultSize;\r
-  UINTN                   Index;\r
-  EFI_FILE_INFO           *Info;\r
-  WCHAR                   *pw;\r
-  TIME_ZONE_INFORMATION   TimeZone;\r
-  EFI_FILE_INFO           *FileInfo;\r
-  UINT64                  Pos;\r
-  UINT64                  FileSize;\r
-  UINTN                   FileInfoSize;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL || BufferSize == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  if (!PrivateFile->IsDirectoryPath) {\r
-\r
-    if (This->GetPosition (This, &Pos) != EFI_SUCCESS) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO;\r
-    FileInfo = AllocatePool (FileInfoSize);\r
-\r
-    Status = This->GetInfo (\r
-                    This,\r
-                    &gEfiFileInfoGuid,\r
-                    &FileInfoSize,\r
-                    FileInfo\r
-                    );\r
-\r
-    if (Status == EFI_BUFFER_TOO_SMALL) {\r
-      FreePool (FileInfo);\r
-      FileInfo = AllocatePool (FileInfoSize);\r
-      Status = This->GetInfo (\r
-                      This,\r
-                      &gEfiFileInfoGuid,\r
-                      &FileInfoSize,\r
-                      FileInfo\r
-                      );\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    FileSize = FileInfo->FileSize;\r
-\r
-    FreePool (FileInfo);\r
-\r
-    if (Pos >= FileSize) {\r
-      *BufferSize = 0;\r
-      if (Pos == FileSize) {\r
-        Status = EFI_SUCCESS;\r
-        goto Done;\r
-      } else {\r
-        Status = EFI_DEVICE_ERROR;\r
-        goto Done;\r
-      }\r
-    }\r
-\r
-    Status = PrivateFile->WinNtThunk->ReadFile (\r
-                                        PrivateFile->LHandle,\r
-                                        Buffer,\r
-                                        (DWORD)*BufferSize,\r
-                                        (LPDWORD)BufferSize,\r
-                                        NULL\r
-                                        ) ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Read on a directory.  Perform a find next\r
-  //\r
-  if (!PrivateFile->IsValidFindBuf) {\r
-    *BufferSize = 0;\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  Size        = SIZE_OF_EFI_FILE_INFO;\r
-\r
-  NameSize    = StrSize (PrivateFile->FindBuf.cFileName);\r
-\r
-  ResultSize  = Size + NameSize;\r
-\r
-  Status      = EFI_BUFFER_TOO_SMALL;\r
-\r
-  if (*BufferSize >= ResultSize) {\r
-    Status  = EFI_SUCCESS;\r
-\r
-    Info    = Buffer;\r
-    ZeroMem (Info, ResultSize);\r
-\r
-    Info->Size = ResultSize;\r
-\r
-    PrivateFile->WinNtThunk->GetTimeZoneInformation (&TimeZone);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &PrivateFile->FindBuf.ftCreationTime, &Info->CreateTime);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &PrivateFile->FindBuf.ftLastAccessTime, &Info->LastAccessTime);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &PrivateFile->FindBuf.ftLastWriteTime, &Info->ModificationTime);\r
-\r
-    Info->FileSize      = PrivateFile->FindBuf.nFileSizeLow;\r
-\r
-    Info->PhysicalSize  = PrivateFile->FindBuf.nFileSizeLow;\r
-\r
-    if (PrivateFile->FindBuf.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) {\r
-      Info->Attribute |= EFI_FILE_ARCHIVE;\r
-    }\r
-\r
-    if (PrivateFile->FindBuf.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) {\r
-      Info->Attribute |= EFI_FILE_HIDDEN;\r
-    }\r
-\r
-    if (PrivateFile->FindBuf.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) {\r
-      Info->Attribute |= EFI_FILE_SYSTEM;\r
-    }\r
-\r
-    if (PrivateFile->FindBuf.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {\r
-      Info->Attribute |= EFI_FILE_READ_ONLY;\r
-    }\r
-\r
-    if (PrivateFile->FindBuf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {\r
-      Info->Attribute |= EFI_FILE_DIRECTORY;\r
-    }\r
-\r
-    NameSize  = NameSize / sizeof (WCHAR);\r
-\r
-    pw        = (WCHAR *) (((CHAR8 *) Buffer) + Size);\r
-\r
-    for (Index = 0; Index < NameSize; Index++) {\r
-      pw[Index] = PrivateFile->FindBuf.cFileName[Index];\r
-    }\r
-\r
-    if (PrivateFile->WinNtThunk->FindNextFile (PrivateFile->LHandle, &PrivateFile->FindBuf)) {\r
-      PrivateFile->IsValidFindBuf = TRUE;\r
-    } else {\r
-      PrivateFile->IsValidFindBuf = FALSE;\r
-    }\r
-  }\r
-\r
-  *BufferSize = ResultSize;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemWrite (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  IN     VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Write data to a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to an opened file handle.\r
-\r
-  BufferSize  - On input, the number of bytes in the Buffer to write to the file.  On output, the number of bytes\r
-                of data written to the file.\r
-\r
-  Buffer      - Pointer to the first by of data in the buffer to write to the file.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was written to the file.\r
-\r
-  EFI_UNSUPPORTED       - Writes to an open directory are not supported.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_STATUS              Status;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL || BufferSize == NULL || Buffer == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsOpenedByRead) {\r
-    Status = EFI_ACCESS_DENIED;\r
-    goto Done;\r
-  }\r
-\r
-  Status = PrivateFile->WinNtThunk->WriteFile (\r
-                                      PrivateFile->LHandle,\r
-                                      Buffer,\r
-                                      (DWORD)*BufferSize,\r
-                                      (LPDWORD)BufferSize,\r
-                                      NULL\r
-                                      ) ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-\r
-  //\r
-  // bugbug: need to access windows error reporting\r
-  //\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemSetPosition (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN UINT64             Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - The byte position from the start of the file to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been changed.\r
-\r
-  EFI_UNSUPPORTED - The seek request for non-zero is not supported for directories.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  UINT32                  PosLow;\r
-  UINT32                  PosHigh;\r
-  CHAR16                  *FileName;\r
-  EFI_TPL                 OldTpl;\r
-  UINTN                   Size;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    if (Position != 0) {\r
-      Status = EFI_UNSUPPORTED;\r
-      goto Done;\r
-    }\r
-\r
-    Size  = StrSize (PrivateFile->FileName);\r
-    Size += StrSize (L"\\*");\r
-    FileName = AllocatePool (Size);\r
-    if (FileName == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (FileName, PrivateFile->FileName);\r
-    StrCat (FileName, L"\\*");\r
-\r
-    if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
-      PrivateFile->WinNtThunk->FindClose (PrivateFile->LHandle);\r
-    }\r
-\r
-    PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (FileName, &PrivateFile->FindBuf);\r
-\r
-    if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-      PrivateFile->IsValidFindBuf = FALSE;\r
-    } else {\r
-      PrivateFile->IsValidFindBuf = TRUE;\r
-    }\r
-\r
-    FreePool (FileName);\r
-\r
-    Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
-  } else {\r
-    if (Position == (UINT64) -1) {\r
-      PosLow = PrivateFile->WinNtThunk->SetFilePointer (PrivateFile->LHandle, (ULONG) 0, NULL, FILE_END);\r
-    } else {\r
-      PosHigh = (UINT32) RShiftU64 (Position, 32);\r
-\r
-      PosLow  = PrivateFile->WinNtThunk->SetFilePointer (PrivateFile->LHandle, (ULONG) Position, (PLONG)&PosHigh, FILE_BEGIN);\r
-    }\r
-\r
-    Status = (PosLow == 0xFFFFFFFF) ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
-  }\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemGetPosition (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT UINT64              *Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - Pointer to storage for the current position.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been reported.\r
-\r
-  EFI_UNSUPPORTED - Not valid for directories.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  WIN_NT_EFI_FILE_PRIVATE *PrivateFile;\r
-  INT32                   PositionHigh;\r
-  UINT64                  PosHigh64;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL || Position == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  PrivateFile   = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  PositionHigh  = 0;\r
-  PosHigh64     = 0;\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-\r
-  } else {\r
-\r
-    PositionHigh = 0;\r
-    *Position = PrivateFile->WinNtThunk->SetFilePointer (\r
-                                           PrivateFile->LHandle,\r
-                                           0,\r
-                                           (PLONG)&PositionHigh,\r
-                                           FILE_CURRENT\r
-                                           );\r
-\r
-    Status = *Position == 0xffffffff ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    PosHigh64 = PositionHigh;\r
-    *Position += LShiftU64 (PosHigh64, 32);\r
-  }\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-WinNtSimpleFileSystemFileInfo (\r
-  IN     WIN_NT_EFI_FILE_PRIVATE  *PrivateFile,\r
-  IN OUT UINTN                    *BufferSize,\r
-  OUT    VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PrivateFile - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  UINTN                       Size;\r
-  UINTN                       NameSize;\r
-  UINTN                       ResultSize;\r
-  EFI_FILE_INFO               *Info;\r
-  BY_HANDLE_FILE_INFORMATION  FileInfo;\r
-  CHAR16                      *RealFileName;\r
-  CHAR16                      *TempPointer;\r
-  TIME_ZONE_INFORMATION       TimeZone;\r
-\r
-  Size        = SIZE_OF_EFI_FILE_INFO;\r
-\r
-  RealFileName  = PrivateFile->FileName;\r
-  TempPointer   = RealFileName;\r
-  while (*TempPointer) {\r
-    if (*TempPointer == '\\') {\r
-      RealFileName = TempPointer + 1;\r
-    }\r
-\r
-    TempPointer++;\r
-  }\r
-  NameSize = StrSize (RealFileName);\r
-\r
-  ResultSize = Size + NameSize; \r
-\r
-  Status      = EFI_BUFFER_TOO_SMALL;\r
-  if (*BufferSize >= ResultSize) {\r
-    Status  = EFI_SUCCESS;\r
-\r
-    Info    = Buffer;\r
-    ZeroMem (Info, ResultSize);\r
-\r
-    Info->Size = ResultSize;\r
-    PrivateFile->WinNtThunk->GetFileInformationByHandle (\r
-                              PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,\r
-                              &FileInfo\r
-                              );\r
-    Info->FileSize      = FileInfo.nFileSizeLow;\r
-    Info->PhysicalSize  = Info->FileSize;\r
-\r
-    PrivateFile->WinNtThunk->GetTimeZoneInformation (&TimeZone);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &FileInfo.ftCreationTime, &Info->CreateTime);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &FileInfo.ftLastAccessTime, &Info->LastAccessTime);\r
-    WinNtFileTimeToEfiTime (PrivateFile, &TimeZone, &FileInfo.ftLastWriteTime, &Info->ModificationTime);\r
-\r
-    if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) {\r
-      Info->Attribute |= EFI_FILE_ARCHIVE;\r
-    }\r
-\r
-    if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) {\r
-      Info->Attribute |= EFI_FILE_HIDDEN;\r
-    }\r
-\r
-    if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {\r
-      Info->Attribute |= EFI_FILE_READ_ONLY;\r
-    }\r
-\r
-    if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) {\r
-      Info->Attribute |= EFI_FILE_SYSTEM;\r
-    }\r
-\r
-    if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {\r
-      Info->Attribute |= EFI_FILE_DIRECTORY;\r
-    }\r
-\r
-    if (PrivateFile->IsDirectoryPath) {\r
-      Info->Attribute |= EFI_FILE_DIRECTORY;\r
-    }\r
-\r
-    if (PrivateFile->IsRootDirectory) {\r
-      *((CHAR8 *) Buffer + Size) = 0;\r
-    } else {\r
-      CopyMem ((CHAR8 *) Buffer + Size, RealFileName, NameSize);\r
-    }\r
-  }\r
-\r
-  *BufferSize = ResultSize;\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemGetInfo (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN     EFI_GUID           *InformationType,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID describing the type of information to be returned.\r
-\r
-  BufferSize      - On input, the size of the information buffer.  On output, the number of bytes written to the\r
-                    information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The requested information has been written into the buffer.\r
-\r
-  EFI_UNSUPPORTED       - The InformationType is not known.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The buffer size was too small to contain the requested information.  The buffer size has\r
-                          been updated with the size needed to complete the requested operation.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  WIN_NT_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_FILE_SYSTEM_INFO              *FileSystemInfoBuffer;\r
-  UINT32                            SectorsPerCluster;\r
-  UINT32                            BytesPerSector;\r
-  UINT32                            FreeClusters;\r
-  UINT32                            TotalClusters;\r
-  UINT32                            BytesPerCluster;\r
-  CHAR16                            *DriveName;\r
-  BOOLEAN                           DriveNameFound;\r
-  BOOL                              NtStatus;\r
-  UINTN                             Index;\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  EFI_TPL                           OldTpl;\r
-\r
-  if (This == NULL || InformationType == NULL || BufferSize == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-\r
-  Status      = EFI_UNSUPPORTED;\r
-\r
-  if (CompareGuid (InformationType, &gEfiFileInfoGuid)) {\r
-    Status = WinNtSimpleFileSystemFileInfo (PrivateFile, BufferSize, Buffer);\r
-  }\r
-\r
-  if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {\r
-    if (*BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel)) {\r
-      *BufferSize = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-      Status = EFI_BUFFER_TOO_SMALL;\r
-      goto Done;\r
-    }\r
-\r
-    FileSystemInfoBuffer            = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
-    FileSystemInfoBuffer->Size      = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-    FileSystemInfoBuffer->ReadOnly  = FALSE;\r
-\r
-    //\r
-    // Try to get the drive name\r
-    //\r
-    DriveNameFound  = FALSE;\r
-    DriveName = AllocatePool (StrSize (PrivateFile->FilePath) + 1);\r
-    if (DriveName == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (DriveName, PrivateFile->FilePath);\r
-    for (Index = 0; DriveName[Index] != 0 && DriveName[Index] != ':'; Index++) {\r
-      ;\r
-    }\r
-\r
-    if (DriveName[Index] == ':') {\r
-      DriveName[Index + 1]  = '\\';\r
-      DriveName[Index + 2]  = 0;\r
-      DriveNameFound        = TRUE;\r
-    } else if (DriveName[0] == '\\' && DriveName[1] == '\\') {\r
-      for (Index = 2; DriveName[Index] != 0 && DriveName[Index] != '\\'; Index++) {\r
-        ;\r
-      }\r
-\r
-      if (DriveName[Index] == '\\') {\r
-        DriveNameFound = TRUE;\r
-        for (Index++; DriveName[Index] != 0 && DriveName[Index] != '\\'; Index++) {\r
-          ;\r
-        }\r
-\r
-        DriveName[Index]      = '\\';\r
-        DriveName[Index + 1]  = 0;\r
-      }\r
-    }\r
-\r
-    //\r
-    // Try GetDiskFreeSpace first\r
-    //\r
-    NtStatus = PrivateFile->WinNtThunk->GetDiskFreeSpace (\r
-                                          DriveNameFound ? DriveName : NULL,\r
-                                          (LPDWORD)&SectorsPerCluster,\r
-                                          (LPDWORD)&BytesPerSector,\r
-                                          (LPDWORD)&FreeClusters,\r
-                                          (LPDWORD)&TotalClusters\r
-                                          );\r
-    if (DriveName) {\r
-      FreePool (DriveName);\r
-    }\r
-\r
-    if (NtStatus) {\r
-      //\r
-      // Succeeded\r
-      //\r
-      BytesPerCluster                   = BytesPerSector * SectorsPerCluster;\r
-      FileSystemInfoBuffer->VolumeSize  = MultU64x32 (TotalClusters, BytesPerCluster);\r
-      FileSystemInfoBuffer->FreeSpace   = MultU64x32 (FreeClusters, BytesPerCluster);\r
-      FileSystemInfoBuffer->BlockSize   = BytesPerCluster;\r
-\r
-    } else {\r
-      //\r
-      // try GetDiskFreeSpaceEx then\r
-      //\r
-      FileSystemInfoBuffer->BlockSize = 0;\r
-      NtStatus = PrivateFile->WinNtThunk->GetDiskFreeSpaceEx (\r
-                                            PrivateFile->FilePath,\r
-                                            (PULARGE_INTEGER) (&FileSystemInfoBuffer->FreeSpace),\r
-                                            (PULARGE_INTEGER) (&FileSystemInfoBuffer->VolumeSize),\r
-                                            NULL\r
-                                            );\r
-      if (!NtStatus) {\r
-        Status = EFI_DEVICE_ERROR;\r
-        goto Done;\r
-      }\r
-    }\r
-\r
-    StrCpy ((CHAR16 *) FileSystemInfoBuffer->VolumeLabel, PrivateRoot->VolumeLabel);\r
-    *BufferSize = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-    Status      = EFI_SUCCESS;\r
-  }\r
-\r
-  if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
-    if (*BufferSize < StrSize (PrivateRoot->VolumeLabel)) {\r
-      *BufferSize = StrSize (PrivateRoot->VolumeLabel);\r
-      Status = EFI_BUFFER_TOO_SMALL;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy ((CHAR16 *) Buffer, PrivateRoot->VolumeLabel);\r
-    *BufferSize = StrSize (PrivateRoot->VolumeLabel);\r
-    Status      = EFI_SUCCESS;\r
-  }\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemSetInfo (\r
-  IN EFI_FILE_PROTOCOL*This,\r
-  IN EFI_GUID         *InformationType,\r
-  IN UINTN            BufferSize,\r
-  IN VOID             *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID identifying the type of information to set.\r
-\r
-  BufferSize      - Number of bytes of data in the information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of data in the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file or volume information has been updated.\r
-\r
-  EFI_UNSUPPORTED       - The information identifier is not recognised.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
-  EFI_BAD_BUFFER_SIZE   - The buffer size is smaller than the type indicated by InformationType.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  WIN_NT_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_FILE_INFO                     *OldFileInfo;\r
-  EFI_FILE_INFO                     *NewFileInfo;\r
-  EFI_STATUS                        Status;\r
-  UINTN                             OldInfoSize;\r
-  INTN                              NtStatus;\r
-  UINT32                            NewAttr;\r
-  UINT32                            OldAttr;\r
-  CHAR16                            *OldFileName;\r
-  CHAR16                            *NewFileName;\r
-  CHAR16                            *TempFileName;\r
-  CHAR16                            *CharPointer;\r
-  BOOLEAN                           AttrChangeFlag;\r
-  BOOLEAN                           NameChangeFlag;\r
-  BOOLEAN                           SizeChangeFlag;\r
-  BOOLEAN                           TimeChangeFlag;\r
-  UINT64                            CurPos;\r
-  SYSTEMTIME                        NewCreationSystemTime;\r
-  SYSTEMTIME                        NewLastAccessSystemTime;\r
-  SYSTEMTIME                        NewLastWriteSystemTime;\r
-  FILETIME                          NewCreationFileTime;\r
-  FILETIME                          NewLastAccessFileTime;\r
-  FILETIME                          NewLastWriteFileTime;\r
-  WIN32_FIND_DATA                   FindBuf;\r
-  EFI_FILE_SYSTEM_INFO              *NewFileSystemInfo;\r
-  EFI_TPL                           OldTpl;\r
-  UINTN                             Size;\r
-\r
-  //\r
-  // Check for invalid parameters.\r
-  //\r
-  if (This == NULL || InformationType == NULL || BufferSize == 0 || Buffer == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  //\r
-  // Initialise locals.\r
-  //\r
-  PrivateFile               = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot               = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-\r
-  Status                    = EFI_UNSUPPORTED;\r
-  OldFileInfo               = NewFileInfo = NULL;\r
-  OldFileName               = NewFileName = NULL;\r
-  AttrChangeFlag = NameChangeFlag = SizeChangeFlag = TimeChangeFlag = FALSE;\r
-\r
-  //\r
-  // Set file system information.\r
-  //\r
-  if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {\r
-    NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
-    if (BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (NewFileSystemInfo->VolumeLabel)) {\r
-      Status = EFI_BAD_BUFFER_SIZE;\r
-      goto Done;\r
-    }\r
-\r
-\r
-    FreePool (PrivateRoot->VolumeLabel);\r
-    PrivateRoot->VolumeLabel = AllocatePool (StrSize (NewFileSystemInfo->VolumeLabel));\r
-    if (PrivateRoot->VolumeLabel == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (PrivateRoot->VolumeLabel, NewFileSystemInfo->VolumeLabel);\r
-\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set volume label information.\r
-  //\r
-  if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
-    if (BufferSize < StrSize (PrivateRoot->VolumeLabel)) {\r
-      Status = EFI_BAD_BUFFER_SIZE;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (PrivateRoot->VolumeLabel, (CHAR16 *) Buffer);\r
-\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  if (!CompareGuid (InformationType, &gEfiFileInfoGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  if (BufferSize < SIZE_OF_EFI_FILE_INFO) {\r
-    Status = EFI_BAD_BUFFER_SIZE;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set file/directory information.\r
-  //\r
-\r
-  //\r
-  // Check for invalid set file information parameters.\r
-  //\r
-  NewFileInfo = (EFI_FILE_INFO *) Buffer;\r
-\r
-  if ((NewFileInfo->Size <= SIZE_OF_EFI_FILE_INFO) ||\r
-      (NewFileInfo->Attribute &~(EFI_FILE_VALID_ATTR)) ||\r
-      (sizeof (UINTN) == 4 && NewFileInfo->Size > 0xFFFFFFFF)\r
-      ) {\r
-    Status = EFI_INVALID_PARAMETER;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // bugbug: - This is not safe.  We need something like EfiStrMaxSize()\r
-  // that would have an additional parameter that would be the size\r
-  // of the string array just in case there are no NULL characters in\r
-  // the string array.\r
-  //\r
-  //\r
-  // Get current file information so we can determine what kind\r
-  // of change request this is.\r
-  //\r
-  OldInfoSize = 0;\r
-  Status      = WinNtSimpleFileSystemFileInfo (PrivateFile, &OldInfoSize, NULL);\r
-\r
-  if (Status != EFI_BUFFER_TOO_SMALL) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  OldFileInfo = AllocatePool (OldInfoSize);\r
-  if (OldFileInfo == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  Status = WinNtSimpleFileSystemFileInfo (PrivateFile, &OldInfoSize, OldFileInfo);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  OldFileName = AllocatePool (StrSize (PrivateFile->FileName));\r
-  if (OldFileName == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Done;\r
-  }\r
-\r
-  StrCpy (OldFileName, PrivateFile->FileName);\r
-\r
-  //\r
-  // Make full pathname from new filename and rootpath.\r
-  //\r
-  if (NewFileInfo->FileName[0] == '\\') {\r
-    Size  = StrSize (PrivateRoot->FilePath);\r
-    Size += StrSize (L"\\");\r
-    Size += StrSize (NewFileInfo->FileName);\r
-    NewFileName = AllocatePool (Size);\r
-    if (NewFileName == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (NewFileName, PrivateRoot->FilePath);\r
-    StrCat (NewFileName, L"\\");\r
-    StrCat (NewFileName, NewFileInfo->FileName + 1);\r
-  } else {\r
-    Size  = StrSize (PrivateFile->FilePath);\r
-    Size += StrSize (L"\\");\r
-    Size += StrSize (NewFileInfo->FileName);\r
-    NewFileName = AllocatePool (Size);\r
-    if (NewFileName == NULL) {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (NewFileName, PrivateFile->FilePath);\r
-    StrCat (NewFileName, L"\\");\r
-    StrCat (NewFileName, NewFileInfo->FileName);\r
-  }\r
-\r
-  //\r
-  // Is there an attribute change request?\r
-  //\r
-  if (NewFileInfo->Attribute != OldFileInfo->Attribute) {\r
-    if ((NewFileInfo->Attribute & EFI_FILE_DIRECTORY) != (OldFileInfo->Attribute & EFI_FILE_DIRECTORY)) {\r
-      Status = EFI_INVALID_PARAMETER;\r
-      goto Done;\r
-    }\r
-\r
-    AttrChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a name change request?\r
-  // bugbug: - Need EfiStrCaseCmp()\r
-  //\r
-  if (StrCmp (NewFileInfo->FileName, OldFileInfo->FileName)) {\r
-    NameChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a size change request?\r
-  //\r
-  if (NewFileInfo->FileSize != OldFileInfo->FileSize) {\r
-    SizeChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a time stamp change request?\r
-  //\r
-  if (!IsZero (&NewFileInfo->CreateTime, sizeof (EFI_TIME)) &&\r
-      CompareMem (&NewFileInfo->CreateTime, &OldFileInfo->CreateTime, sizeof (EFI_TIME))\r
-        ) {\r
-    TimeChangeFlag = TRUE;\r
-  } else if (!IsZero (&NewFileInfo->LastAccessTime, sizeof (EFI_TIME)) &&\r
-           CompareMem (&NewFileInfo->LastAccessTime, &OldFileInfo->LastAccessTime, sizeof (EFI_TIME))\r
-            ) {\r
-    TimeChangeFlag = TRUE;\r
-  } else if (!IsZero (&NewFileInfo->ModificationTime, sizeof (EFI_TIME)) &&\r
-           CompareMem (&NewFileInfo->ModificationTime, &OldFileInfo->ModificationTime, sizeof (EFI_TIME))\r
-            ) {\r
-    TimeChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // All done if there are no change requests being made.\r
-  //\r
-  if (!(AttrChangeFlag || NameChangeFlag || SizeChangeFlag || TimeChangeFlag)) {\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set file or directory information.\r
-  //\r
-  OldAttr = PrivateFile->WinNtThunk->GetFileAttributes (OldFileName);\r
-\r
-  //\r
-  // Name change.\r
-  //\r
-  if (NameChangeFlag) {\r
-    //\r
-    // Close the handles first\r
-    //\r
-    if (PrivateFile->IsOpenedByRead) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    for (CharPointer = NewFileName; *CharPointer != 0 && *CharPointer != L'/'; CharPointer++) {\r
-    }\r
-\r
-    if (*CharPointer != 0) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
-      if (PrivateFile->IsDirectoryPath) {\r
-        PrivateFile->WinNtThunk->FindClose (PrivateFile->LHandle);\r
-      } else {\r
-        PrivateFile->WinNtThunk->CloseHandle (PrivateFile->LHandle);\r
-        PrivateFile->LHandle = INVALID_HANDLE_VALUE;\r
-      }\r
-    }\r
-\r
-    if (PrivateFile->IsDirectoryPath && PrivateFile->DirHandle != INVALID_HANDLE_VALUE) {\r
-      PrivateFile->WinNtThunk->CloseHandle (PrivateFile->DirHandle);\r
-      PrivateFile->DirHandle = INVALID_HANDLE_VALUE;\r
-    }\r
-\r
-    NtStatus = PrivateFile->WinNtThunk->MoveFile (OldFileName, NewFileName);\r
-\r
-    if (NtStatus) {\r
-      //\r
-      // modify file name\r
-      //\r
-      FreePool (PrivateFile->FileName);\r
-\r
-      PrivateFile->FileName = AllocatePool (StrSize (NewFileName));\r
-      if (PrivateFile->FileName == NULL) {\r
-        Status = EFI_OUT_OF_RESOURCES;\r
-        goto Done;\r
-      }\r
-\r
-      StrCpy (PrivateFile->FileName, NewFileName);\r
-\r
-      Size  =  StrSize (NewFileName);\r
-      Size += StrSize (L"\\*");\r
-      TempFileName = AllocatePool (Size);\r
-\r
-      StrCpy (TempFileName, NewFileName);\r
-\r
-      if (!PrivateFile->IsDirectoryPath) {\r
-       PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (\r
-                                                          TempFileName,\r
-                                                          PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,\r
-                                                          FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                          NULL,\r
-                                                          OPEN_EXISTING,\r
-                                                          0,\r
-                                                          NULL\r
-                                                          );\r
-\r
-        FreePool (TempFileName);\r
-\r
-        //\r
-        //  Flush buffers just in case\r
-        //\r
-        if (PrivateFile->WinNtThunk->FlushFileBuffers (PrivateFile->LHandle) == 0) {\r
-          Status = EFI_DEVICE_ERROR;\r
-          goto Done;\r
-        }\r
-      } else {\r
-        PrivateFile->DirHandle = PrivateFile->WinNtThunk->CreateFile (\r
-                                                            TempFileName,\r
-                                                            PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,\r
-                                                            FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                            NULL,\r
-                                                            OPEN_EXISTING,\r
-                                                            FILE_FLAG_BACKUP_SEMANTICS,\r
-                                                            NULL\r
-                                                            );\r
-\r
-        StrCat (TempFileName, L"\\*");\r
-        PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);\r
-\r
-        FreePool (TempFileName);\r
-      }\r
-    } else {\r
-      Status    = EFI_ACCESS_DENIED;\r
-Reopen: ;\r
-\r
-      NtStatus  = PrivateFile->WinNtThunk->SetFileAttributes (OldFileName, OldAttr);\r
-\r
-      if (!NtStatus) {\r
-        goto Done;\r
-      }\r
-\r
-      Size =  StrSize (OldFileName);\r
-      Size += StrSize (L"\\*");\r
-      TempFileName = AllocatePool (Size);\r
-\r
-      StrCpy (TempFileName, OldFileName);\r
-\r
-      if (!PrivateFile->IsDirectoryPath) {\r
-        PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (\r
-                                                          TempFileName,\r
-                                                          PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,\r
-                                                          FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                          NULL,\r
-                                                          OPEN_EXISTING,\r
-                                                          0,\r
-                                                          NULL\r
-                                                          );\r
-      } else {\r
-        PrivateFile->DirHandle = PrivateFile->WinNtThunk->CreateFile (\r
-                                                            TempFileName,\r
-                                                            PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,\r
-                                                            FILE_SHARE_READ | FILE_SHARE_WRITE,\r
-                                                            NULL,\r
-                                                            OPEN_EXISTING,\r
-                                                            FILE_FLAG_BACKUP_SEMANTICS,\r
-                                                            NULL\r
-                                                            );\r
-\r
-        StrCat (TempFileName, L"\\*");\r
-        PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);\r
-      }\r
-\r
-      FreePool (TempFileName);\r
-\r
-      goto Done;\r
-\r
-    }\r
-  }\r
-\r
-  //\r
-  //  Size change\r
-  //\r
-  if (SizeChangeFlag) {\r
-    if (PrivateFile->IsDirectoryPath) {\r
-      Status = EFI_UNSUPPORTED;\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->IsOpenedByRead || OldFileInfo->Attribute & EFI_FILE_READ_ONLY) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    Status = This->GetPosition (This, &CurPos);\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    Status = This->SetPosition (This, NewFileInfo->FileSize);\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->WinNtThunk->SetEndOfFile (PrivateFile->LHandle) == 0) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    Status = This->SetPosition (This, CurPos);\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Time change\r
-  //\r
-  if (TimeChangeFlag) {\r
-\r
-    NewCreationSystemTime.wYear         = NewFileInfo->CreateTime.Year;\r
-    NewCreationSystemTime.wMonth        = NewFileInfo->CreateTime.Month;\r
-    NewCreationSystemTime.wDay          = NewFileInfo->CreateTime.Day;\r
-    NewCreationSystemTime.wHour         = NewFileInfo->CreateTime.Hour;\r
-    NewCreationSystemTime.wMinute       = NewFileInfo->CreateTime.Minute;\r
-    NewCreationSystemTime.wSecond       = NewFileInfo->CreateTime.Second;\r
-    NewCreationSystemTime.wMilliseconds = 0;\r
-\r
-    if (!PrivateFile->WinNtThunk->SystemTimeToFileTime (\r
-                                    &NewCreationSystemTime,\r
-                                    &NewCreationFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
-                                    &NewCreationFileTime,\r
-                                    &NewCreationFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    NewLastAccessSystemTime.wYear         = NewFileInfo->LastAccessTime.Year;\r
-    NewLastAccessSystemTime.wMonth        = NewFileInfo->LastAccessTime.Month;\r
-    NewLastAccessSystemTime.wDay          = NewFileInfo->LastAccessTime.Day;\r
-    NewLastAccessSystemTime.wHour         = NewFileInfo->LastAccessTime.Hour;\r
-    NewLastAccessSystemTime.wMinute       = NewFileInfo->LastAccessTime.Minute;\r
-    NewLastAccessSystemTime.wSecond       = NewFileInfo->LastAccessTime.Second;\r
-    NewLastAccessSystemTime.wMilliseconds = 0;\r
-\r
-    if (!PrivateFile->WinNtThunk->SystemTimeToFileTime (\r
-                                    &NewLastAccessSystemTime,\r
-                                    &NewLastAccessFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
-                                    &NewLastAccessFileTime,\r
-                                    &NewLastAccessFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    NewLastWriteSystemTime.wYear          = NewFileInfo->ModificationTime.Year;\r
-    NewLastWriteSystemTime.wMonth         = NewFileInfo->ModificationTime.Month;\r
-    NewLastWriteSystemTime.wDay           = NewFileInfo->ModificationTime.Day;\r
-    NewLastWriteSystemTime.wHour          = NewFileInfo->ModificationTime.Hour;\r
-    NewLastWriteSystemTime.wMinute        = NewFileInfo->ModificationTime.Minute;\r
-    NewLastWriteSystemTime.wSecond        = NewFileInfo->ModificationTime.Second;\r
-    NewLastWriteSystemTime.wMilliseconds  = 0;\r
-\r
-    if (!PrivateFile->WinNtThunk->SystemTimeToFileTime (\r
-                                    &NewLastWriteSystemTime,\r
-                                    &NewLastWriteFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
-                                    &NewLastWriteFileTime,\r
-                                    &NewLastWriteFileTime\r
-                                    )) {\r
-      goto Done;\r
-    }\r
-\r
-    if (!PrivateFile->WinNtThunk->SetFileTime (\r
-                                    PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,\r
-                                    &NewCreationFileTime,\r
-                                    &NewLastAccessFileTime,\r
-                                    &NewLastWriteFileTime\r
-                                    )) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-  }\r
-\r
-  //\r
-  // No matter about AttrChangeFlag, Attribute must be set.\r
-  // Because operation before may cause attribute change.\r
-  //\r
-  NewAttr = OldAttr;\r
-\r
-  if (NewFileInfo->Attribute & EFI_FILE_ARCHIVE) {\r
-    NewAttr |= FILE_ATTRIBUTE_ARCHIVE;\r
-  } else {\r
-    NewAttr &= ~FILE_ATTRIBUTE_ARCHIVE;\r
-  }\r
-\r
-  if (NewFileInfo->Attribute & EFI_FILE_HIDDEN) {\r
-    NewAttr |= FILE_ATTRIBUTE_HIDDEN;\r
-  } else {\r
-    NewAttr &= ~FILE_ATTRIBUTE_HIDDEN;\r
-  }\r
-\r
-  if (NewFileInfo->Attribute & EFI_FILE_SYSTEM) {\r
-    NewAttr |= FILE_ATTRIBUTE_SYSTEM;\r
-  } else {\r
-    NewAttr &= ~FILE_ATTRIBUTE_SYSTEM;\r
-  }\r
-\r
-  if (NewFileInfo->Attribute & EFI_FILE_READ_ONLY) {\r
-    NewAttr |= FILE_ATTRIBUTE_READONLY;\r
-  } else {\r
-    NewAttr &= ~FILE_ATTRIBUTE_READONLY;\r
-  }\r
-\r
-  NtStatus = PrivateFile->WinNtThunk->SetFileAttributes (NewFileName, NewAttr);\r
-\r
-  if (!NtStatus) {\r
-    Status    = EFI_DEVICE_ERROR;\r
-    goto Reopen;\r
-  }\r
-\r
-Done:\r
-  if (OldFileInfo != NULL) {\r
-    FreePool (OldFileInfo);\r
-  }\r
-\r
-  if (OldFileName != NULL) {\r
-    FreePool (OldFileName);\r
-  }\r
-\r
-  if (NewFileName != NULL) {\r
-    FreePool (NewFileName);\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemFlush (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Flush all modified data to the media.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to an opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data has been flushed.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures have been corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  BY_HANDLE_FILE_INFORMATION  FileInfo;\r
-  WIN_NT_EFI_FILE_PRIVATE     *PrivateFile;\r
-  EFI_STATUS                  Status;\r
-  EFI_TPL                     OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsOpenedByRead) {\r
-    Status = EFI_ACCESS_DENIED;\r
-    goto Done;\r
-  }\r
-\r
-  PrivateFile->WinNtThunk->GetFileInformationByHandle (PrivateFile->LHandle, &FileInfo);\r
-\r
-  if (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {\r
-    Status = EFI_ACCESS_DENIED;\r
-    goto Done;\r
-  }\r
-\r
-  Status = PrivateFile->WinNtThunk->FlushFileBuffers (PrivateFile->LHandle) ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-  //\r
-  // bugbug: - Use Windows error reporting.\r
-  //\r
-}\r
-\r
-\r
diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.h b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.h
deleted file mode 100644 (file)
index 5675e02..0000000
+++ /dev/null
@@ -1,587 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtSimpleFileSystem.h\r
-\r
-Abstract:\r
-\r
-  Produce Simple File System abstractions for a directory on your PC using Win32 APIs.\r
-  The configuration of what devices to mount or emulate comes from NT \r
-  environment variables. The variables must be visible to the Microsoft* \r
-  Developer Studio for them to work.\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
-**/\r
-\r
-#ifndef _WIN_NT_SIMPLE_FILE_SYSTEM_H_\r
-#define _WIN_NT_SIMPLE_FILE_SYSTEM_H_\r
-\r
-\r
-#define WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE SIGNATURE_32 ('N', 'T', 'f', 's')\r
-\r
-typedef struct {\r
-  UINTN                           Signature;\r
-  EFI_WIN_NT_THUNK_PROTOCOL       *WinNtThunk;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFileSystem;\r
-  CHAR16                          *FilePath;\r
-  CHAR16                          *VolumeLabel;\r
-  EFI_UNICODE_STRING_TABLE        *ControllerNameTable;\r
-} WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE;\r
-\r
-#define WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE, \\r
-      SimpleFileSystem, \\r
-      WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-#define WIN_NT_EFI_FILE_PRIVATE_SIGNATURE SIGNATURE_32 ('l', 'o', 'f', 's')\r
-\r
-//\r
-// Bit definitions for EFI_TIME.Daylight\r
-//\r
-#define EFI_TIME_ADJUST_DAYLIGHT  0x01\r
-#define EFI_TIME_IN_DAYLIGHT      0x02\r
-\r
-typedef struct {\r
-  UINTN                           Signature;\r
-  EFI_WIN_NT_THUNK_PROTOCOL       *WinNtThunk;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;\r
-  EFI_FILE_PROTOCOL               EfiFile;\r
-  HANDLE                          LHandle;\r
-  HANDLE                          DirHandle;\r
-  BOOLEAN                         IsRootDirectory;\r
-  BOOLEAN                         IsDirectoryPath;\r
-  BOOLEAN                         IsOpenedByRead;\r
-  CHAR16                          *FilePath;\r
-  WCHAR                           *FileName;\r
-  BOOLEAN                         IsValidFindBuf;\r
-  WIN32_FIND_DATA                 FindBuf;\r
-} WIN_NT_EFI_FILE_PRIVATE;\r
-\r
-#define WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      WIN_NT_EFI_FILE_PRIVATE, \\r
-      EfiFile, \\r
-      WIN_NT_EFI_FILE_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-//\r
-// Global Protocol Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gWinNtSimpleFileSystemDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gWinNtSimpleFileSystemComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gWinNtSimpleFileSystemComponentName2;\r
-\r
-//\r
-// Driver Binding protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check to see if the driver supports a given controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to test.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         - The device specified by ControllerHandle and RemainingDevicePath is supported by the driver\r
-                        specified by This.\r
-\r
-  EFI_ALREADY_STARTED - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        the driver specified by This.\r
-\r
-  EFI_ACCESS_DENIED   - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        a different driver or an application that requires exclusive access.\r
-\r
-  EFI_UNSUPPORTED     - The device specified by ControllerHandle and RemainingDevicePath is not supported by the\r
-                        driver specified by This.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Starts a device controller or a bus controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to start.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The device or bus controller has been started.\r
-\r
-  EFI_DEVICE_ERROR      - The device could not be started due to a device failure.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The request could not be completed due to lack of resources.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle  - A handle to the device to be stopped.\r
-\r
-  NumberOfChildren  - The number of child device handles in ChildHandleBuffer.\r
-\r
-  ChildHandleBuffer - An array of child device handles to be freed.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - The device has been stopped.\r
-\r
-  EFI_DEVICE_ERROR  - The device could not be stopped due to a device failure.\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Simple File System protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemOpenVolume (\r
-  IN  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r
-  OUT EFI_FILE_PROTOCOL               **Root\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open the root directory on a volume.\r
-\r
-Arguments:\r
-\r
-  This  - A pointer to the volume to open.\r
-\r
-  Root  - A pointer to storage for the returned opened file handle of the root directory.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The volume was opened.\r
-\r
-  EFI_UNSUPPORTED       - The volume does not support the requested file system type.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The file volume could not be opened due to lack of resources.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemOpen (\r
-  IN  EFI_FILE_PROTOCOL  *This,\r
-  OUT EFI_FILE_PROTOCOL  **NewHandle,\r
-  IN  CHAR16             *FileName,\r
-  IN  UINT64             OpenMode,\r
-  IN  UINT64             Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open a file relative to the source file location.\r
-\r
-Arguments:\r
-\r
-  This        - A pointer to the source file location.\r
-\r
-  NewHandle   - Pointer to storage for the new file handle.\r
-\r
-  FileName    - Pointer to the file name to be opened.\r
-\r
-  OpenMode    - File open mode information.\r
-\r
-  Attributes  - File creation attributes.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file was opened.\r
-\r
-  EFI_NOT_FOUND         - The file could not be found in the volume.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The volume or file is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources were available to open the file.\r
-\r
-  EFI_VOLUME_FULL       - There is not enough space left to create the new file.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemClose (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close the specified file handle.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The file handle has been closed.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemDelete (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close and delete a file.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS             - The file handle was closed and deleted.\r
-\r
-  EFI_WARN_DELETE_FAILURE - The handle was closed but could not be deleted.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemRead (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read data from a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to a returned open file handle.\r
-\r
-  BufferSize  - On input, the size of the Buffer.  On output, the number of bytes stored in the Buffer.\r
-\r
-  Buffer      - Pointer to the first byte of the read Buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was read.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The supplied buffer size was too small to store the current directory entry.\r
-                          *BufferSize has been updated with the size needed to complete the request.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemWrite (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  IN     VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Write data to a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to an opened file handle.\r
-\r
-  BufferSize  - On input, the number of bytes in the Buffer to write to the file.  On output, the number of bytes\r
-                of data written to the file.\r
-\r
-  Buffer      - Pointer to the first by of data in the buffer to write to the file.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was written to the file.\r
-\r
-  EFI_UNSUPPORTED       - Writes to an open directory are not supported.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemSetPosition (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN UINT64             Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - The byte position from the start of the file to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been changed.\r
-\r
-  EFI_UNSUPPORTED - The seek request for non-zero is not supported for directories.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemGetPosition (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT UINT64              *Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - Pointer to storage for the current position.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been reported.\r
-\r
-  EFI_UNSUPPORTED - Not valid for directories.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemGetInfo (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN     EFI_GUID           *InformationType,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID describing the type of information to be returned.\r
-\r
-  BufferSize      - On input, the size of the information buffer.  On output, the number of bytes written to the\r
-                    information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The requested information has been written into the buffer.\r
-\r
-  EFI_UNSUPPORTED       - The InformationType is not known.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The buffer size was too small to contain the requested information.  The buffer size has\r
-                          been updated with the size needed to complete the requested operation.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemSetInfo (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN EFI_GUID           *InformationType,\r
-  IN UINTN              BufferSize,\r
-  IN VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID identifying the type of information to set.\r
-\r
-  BufferSize      - Number of bytes of data in the information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of data in the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file or volume information has been updated.\r
-\r
-  EFI_UNSUPPORTED       - The information identifier is not recognised.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
-  EFI_BAD_BUFFER_SIZE   - The buffer size is smaller than the type indicated by InformationType.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtSimpleFileSystemFlush (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Flush all modified data to the media.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to an opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data has been flushed.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures have been corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-;\r
-\r
-#endif /* _WIN_NT_SIMPLE_FILE_SYSTEM_H_ */\r
-\r
-/* eof - WinNtSimpleFileSystem.h */\r
diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf
deleted file mode 100644 (file)
index 167cbb4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-## @file\r
-# Simple filesystem driver\r
-#\r
-# Produce Simple File System abstractions for directories on your PC using Win32 APIs.\r
-#  The configuration of what devices to mount or emulate comes from NT\r
-#  environment variables. The variables must be visible to the Microsoft*\r
-#  Developer Studio for them to work.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtSimpleFileSystemDxe\r
-  FILE_GUID                      = 9C25E18B-76BA-43da-A132-DBB0997CEFEF\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeWinNtSimpleFileSystem\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gWinNtSimpleFileSystemDriverBinding          \r
-#  COMPONENT_NAME                =  gWinNtSimpleFileSystemComponentName          \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  WinNtSimpleFileSystem.c\r
-  WinNtSimpleFileSystem.h\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiFileSystemVolumeLabelInfoIdGuid           # SOMETIMES_CONSUMED\r
-  gEfiFileInfoGuid                              # SOMETIMES_CONSUMED\r
-  gEfiFileSystemInfoGuid                        # SOMETIMES_CONSUMED\r
-  gEfiWinNtFileSystemGuid                       # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiSimpleFileSystemProtocolGuid              # PROTOCOL BY_START\r
-  gEfiWinNtIoProtocolGuid                       # PROTOCOL TO_START\r
-\r
diff --git a/Nt32Pkg/WinNtThunkDxe/WinNtThunk.c b/Nt32Pkg/WinNtThunkDxe/WinNtThunk.c
deleted file mode 100644 (file)
index e2985ed..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtThunk.c\r
-\r
-Abstract:\r
-\r
-  Produce WinNtThunk protocol and it's associated device path and controller \r
-  state protocols. WinNtThunk is to the NT emulation environment as \r
-  PCI_ROOT_BRIGE is to real hardware. The WinNtBusDriver is the child of this\r
-  driver.\r
-\r
-  Since we are a root hardware abstraction we do not install a Driver Binding\r
-  protocol on this handle. This driver can only support one one WinNtThunk protocol\r
-  in the system, since the device path is hard coded.\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/WinNtLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include "WinNtThunk.h"\r
-\r
-//\r
-// WinNtThunk Device Path Protocol Instance\r
-//\r
-WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath = {\r
-  {\r
-    HARDWARE_DEVICE_PATH,\r
-    HW_VENDOR_DP,\r
-    (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-    (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r
-    EFI_WIN_NT_THUNK_PROTOCOL_GUID,\r
-  },\r
-  {\r
-    END_DEVICE_PATH_TYPE,\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    END_DEVICE_PATH_LENGTH,\r
-    0\r
-  }\r
-};\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeWinNtThunk (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Install WinNtThunk Protocol and it's associated Device Path protocol\r
-\r
-Arguments:\r
-  (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-  EFI_SUCEESS - WinNtThunk protocol is added or error status from \r
-                gBS->InstallMultiProtocolInterfaces().\r
-\r
---*/\r
-// TODO:    ImageHandle - add argument and description to function comment\r
-// TODO:    SystemTable - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  ControllerHandle;\r
-\r
-  ControllerHandle = NULL;\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &ControllerHandle,\r
-                  &gEfiWinNtThunkProtocolGuid,\r
-                  gWinNt,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  &mWinNtThunkDevicePath,\r
-                  NULL\r
-                  );\r
-\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h b/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h
deleted file mode 100644 (file)
index dd4536d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  WinNtThunk.h\r
-\r
-Abstract:\r
-\r
-**/\r
-\r
-#ifndef _WIN_NT_THUNK_H_\r
-#define _WIN_NT_THUNK_H_\r
-\r
-// TODO: add protective #ifndef\r
-\r
-\r
-//\r
-// WinNtThunk Device Path Protocol Instance Type\r
-//\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH        Vendor;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} WIN_NT_THUNK_DEVICE_PATH;\r
-\r
-#endif\r
diff --git a/Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf b/Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf
deleted file mode 100644 (file)
index fa1d097..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file\r
-# A DXE driver to produce EFI_WIN_NT_THUNK_PROTOCOL\r
-#\r
-# EFI_WIN_NT_THUNK_PROTOCOL is a table of pointers to various Windows APIs used by various drivers to accomplish certain task in an NT32 emulator.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtThunkDxe\r
-  FILE_GUID                      = 0C95A916-A006-11d4-BCFA-0080C73C8881\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeWinNtThunk\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  WinNtThunk.c\r
-  WinNtThunk.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  WinNtLib\r
-  UefiDriverEntryPoint\r
-\r
-[Protocols]\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiWinNtThunkProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[depex]\r
-  TRUE
\ No newline at end of file
diff --git a/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c b/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c
deleted file mode 100644 (file)
index d63a5b6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-    WinNtStuff.c\r
-    \r
-Abstract:\r
-\r
-    Tiano PEIM to abstract construction of firmware volume in a Windows NT environment.\r
-\r
-Revision History\r
-\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-#include <WinNtPeim.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtThunk.h>\r
-#include <Ppi/NtThunk.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeWinNtThunkPPIToProtocolPeim (\r
-  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform a call-back into the SEC simulator to get NT Stuff\r
-\r
-Arguments:\r
-\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    FfsHeader - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-  PEI_NT_THUNK_PPI        *PeiNtService;\r
-  VOID                    *Ptr;\r
-\r
-  DEBUG ((EFI_D_ERROR, "NT 32 WinNT Stuff PEIM Loaded\n"));\r
-\r
-  Status = (**PeiServices).LocatePpi (\r
-                            (const EFI_PEI_SERVICES **)PeiServices,\r
-                            &gPeiNtThunkPpiGuid,  // GUID\r
-                            0,                    // INSTANCE\r
-                            &PpiDescriptor,       // EFI_PEI_PPI_DESCRIPTOR\r
-                            (VOID**)&PeiNtService         // PPI\r
-                            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Ptr = PeiNtService->NtThunk ();\r
-\r
-  BuildGuidDataHob (\r
-    &gEfiWinNtThunkProtocolGuid,         // Guid\r
-    &Ptr,                                // Buffer\r
-    sizeof (VOID *)                      // Sizeof Buffer\r
-    );\r
-  return Status;\r
-}\r
diff --git a/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf b/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf
deleted file mode 100644 (file)
index af8043c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file\r
-# Stuff driver\r
-#\r
-# Tiano PEIM to abstract construction of firmware volume in a Windows NT environment.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = WinNtThunkPPIToProtocolPei\r
-  FILE_GUID                      = D3AAD8DC-3A48-46ac-B1C7-28A9D3CF6755\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeWinNtThunkPPIToProtocolPeim\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  WinNtThunkPPIToProtocol.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  Nt32Pkg/Nt32Pkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-\r
-[Protocols]\r
-  gEfiWinNtThunkProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
-\r
-\r
-[Ppis]\r
-  gPeiNtThunkPpiGuid                            # PPI ALWAYS_CONSUMED\r
-\r
-[depex]\r
-  gPeiNtThunkPpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid
\ No newline at end of file