--- /dev/null
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation \r
+All rights reserved. This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution. The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php \r
+ \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \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
+ PeiServices,\r
+ &gPeiNtThunkPpiGuid, // GUID\r
+ 0, // INSTANCE\r
+ &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
+ &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