您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CopyGuid函数代码示例

51自学网 2021-06-01 20:13:46
  C++
这篇教程C++ CopyGuid函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CopyGuid函数的典型用法代码示例。如果您正苦于以下问题:C++ CopyGuid函数的具体用法?C++ CopyGuid怎么用?C++ CopyGuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CopyGuid函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ASSERT

/**  Builds a HOB for a loaded PE32 module.  This function builds a HOB for a loaded PE32 module.  It can only be invoked during PEI phase;  for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.  If ModuleName is NULL, then ASSERT().  If there is no additional space for HOB creation, then ASSERT().  @param  ModuleName              The GUID File Name of the module.  @param  MemoryAllocationModule  The 64 bit physical address of the module.  @param  ModuleLength            The length of the module in bytes.  @param  EntryPoint              The 64 bit physical address of the module's entry point.**/VOIDEFIAPIGlueBuildModuleHob (  IN CONST EFI_GUID         *ModuleName,  IN EFI_PHYSICAL_ADDRESS   MemoryAllocationModule,  IN UINT64                 ModuleLength,  IN EFI_PHYSICAL_ADDRESS   EntryPoint  ){  EFI_HOB_MEMORY_ALLOCATION_MODULE  *Hob;  Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE));  if (Hob == NULL) {    return;  }  CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);  Hob->MemoryAllocationHeader.MemoryBaseAddress = MemoryAllocationModule;  Hob->MemoryAllocationHeader.MemoryLength      = ModuleLength;  Hob->MemoryAllocationHeader.MemoryType        = EfiBootServicesCode;  //  // Zero the reserved space to match HOB spec  //  ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob->MemoryAllocationHeader.Reserved));    CopyGuid (&Hob->ModuleName, ModuleName);  Hob->EntryPoint = EntryPoint;}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:44,


示例2: ASSERT

/**  Builds a HOB for a loaded PE32 module.  This function builds a HOB for a loaded PE32 module.  It can only be invoked during PEI phase;  for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.  If ModuleName is NULL, then ASSERT().  If there is no additional space for HOB creation, then ASSERT().  @param  ModuleName              The GUID File Name of the module.  @param  MemoryAllocationModule  The 64 bit physical address of the module.  @param  ModuleLength            The length of the module in bytes.  @param  EntryPoint              The 64 bit physical address of the module entry point.**/VOIDEFIAPIBuildModuleHob (  IN CONST EFI_GUID         *ModuleName,  IN EFI_PHYSICAL_ADDRESS   MemoryAllocationModule,  IN UINT64                 ModuleLength,  IN EFI_PHYSICAL_ADDRESS   EntryPoint  ){  EFI_HOB_MEMORY_ALLOCATION_MODULE  *Hob;  ASSERT (((MemoryAllocationModule & (EFI_PAGE_SIZE - 1)) == 0) &&          ((ModuleLength & (EFI_PAGE_SIZE - 1)) == 0));  Hob = CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE));  CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);  Hob->MemoryAllocationHeader.MemoryBaseAddress = MemoryAllocationModule;  Hob->MemoryAllocationHeader.MemoryLength      = ModuleLength;  Hob->MemoryAllocationHeader.MemoryType        = EfiBootServicesCode;  //  // Zero the reserved space to match HOB spec  //  ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob->MemoryAllocationHeader.Reserved));    CopyGuid (&Hob->ModuleName, ModuleName);  Hob->EntryPoint = EntryPoint;}
开发者ID:B-Rich,项目名称:edk2,代码行数:44,


示例3: InitializePlatformBootManagerLib

EFI_STATUSEFIAPIInitializePlatformBootManagerLib (  IN EFI_HANDLE        ImageHandle,  IN EFI_SYSTEM_TABLE  *SystemTable  ){  EFI_GUID  *TerminalTypeGuid;  //  // Update UART device path nodes based on UART PCD settings  //  gPciUartDevicePath0.Uart.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);  gPciUartDevicePath0.Uart.DataBits = PcdGet8 (PcdUartDefaultDataBits);  gPciUartDevicePath0.Uart.Parity   = PcdGet8 (PcdUartDefaultParity);  gPciUartDevicePath0.Uart.StopBits = PcdGet8 (PcdUartDefaultStopBits);  gPciUartDevicePath1.Uart.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);  gPciUartDevicePath1.Uart.DataBits = PcdGet8 (PcdUartDefaultDataBits);  gPciUartDevicePath1.Uart.Parity   = PcdGet8 (PcdUartDefaultParity);  gPciUartDevicePath1.Uart.StopBits = PcdGet8 (PcdUartDefaultStopBits);  //  // Update Vendor device path nodes based on terminal type PCD settings  //  switch (PcdGet8 (PcdDefaultTerminalType)) {  case PCANSITYPE:    TerminalTypeGuid = &gEfiPcAnsiGuid;    break;  case VT100TYPE:    TerminalTypeGuid = &gEfiVT100Guid;    break;  case VT100PLUSTYPE:    TerminalTypeGuid = &gEfiVT100PlusGuid;    break;  case VTUTF8TYPE:    TerminalTypeGuid = &gEfiVTUTF8Guid;    break;  case TTYTERMTYPE:    TerminalTypeGuid = &gEfiTtyTermGuid;    break;  default:    TerminalTypeGuid = &gEfiPcAnsiGuid;    break;  }  CopyGuid (&gPciUartDevicePath0.TerminalType.Guid, TerminalTypeGuid);  CopyGuid (&gPciUartDevicePath1.TerminalType.Guid, TerminalTypeGuid);  return EFI_SUCCESS;}
开发者ID:Laurie0131,项目名称:OpenPlatform,代码行数:49,


示例4: SmmAddToDriverList

/**  Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry,  and initilize any state variables. Read the Depex from the FV and store it  in DriverEntry. Pre-process the Depex to set the Before and After state.  The Discovered list is never free'ed and contains booleans that represent the  other possible SMM driver states.  @param  Fv                    Fv protocol, needed to read Depex info out of                                FLASH.  @param  FvHandle              Handle for Fv, needed in the                                EFI_SMM_DRIVER_ENTRY so that the PE image can be                                read out of the FV at a later time.  @param  DriverName            Name of driver to add to mDiscoveredList.  @retval EFI_SUCCESS           If driver was added to the mDiscoveredList.  @retval EFI_ALREADY_STARTED   The driver has already been started. Only one                                DriverName may be active in the system at any one                                time.**/EFI_STATUSSmmAddToDriverList (  IN EFI_FIRMWARE_VOLUME2_PROTOCOL  *Fv,  IN EFI_HANDLE                     FvHandle,  IN EFI_GUID                       *DriverName  ){  EFI_SMM_DRIVER_ENTRY  *DriverEntry;  //  // Create the Driver Entry for the list. ZeroPool initializes lots of variables to  // NULL or FALSE.  //  DriverEntry = AllocateZeroPool (sizeof (EFI_SMM_DRIVER_ENTRY));  ASSERT (DriverEntry != NULL);  DriverEntry->Signature        = EFI_SMM_DRIVER_ENTRY_SIGNATURE;  CopyGuid (&DriverEntry->FileName, DriverName);  DriverEntry->FvHandle         = FvHandle;  DriverEntry->Fv               = Fv;  DriverEntry->FvFileDevicePath = SmmFvToDevicePath (Fv, FvHandle, DriverName);  SmmGetDepexSectionAndPreProccess (DriverEntry);  InsertTailList (&mDiscoveredList, &DriverEntry->Link);  gRequestDispatch = TRUE;  return EFI_SUCCESS;}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:49,


示例5: CreateThunkContextForUefiHiiHandle

/**  This function create a HII_THUNK_CONTEXT for the input UEFI HiiHandle  that is created when a package list registered by a module calling  EFI_HII_DATABASE_PROTOCOL.NewPackageList.  This function records the PackageListGuid of EFI_HII_PACKAGE_LIST_HEADER  into the TagGuid of the created HII_THUNK_CONTEXT.  @param UefiHiiHandle  The UEFI HII Handle.  @return the new created Hii thunk context.**/HII_THUNK_CONTEXT *CreateThunkContextForUefiHiiHandle (    IN  EFI_HII_HANDLE             UefiHiiHandle){    EFI_STATUS            Status;    EFI_GUID              PackageGuid;    HII_THUNK_CONTEXT      *ThunkContext;    ThunkContext = AllocateZeroPool (sizeof (*ThunkContext));    ASSERT (ThunkContext != NULL);    ThunkContext->Signature = HII_THUNK_CONTEXT_SIGNATURE;    Status = AllocateHiiHandle (&ThunkContext->FwHiiHandle);    if (EFI_ERROR (Status)) {        return NULL;    }    ThunkContext->UefiHiiHandle = UefiHiiHandle;    Status = ExtractGuidFromHiiHandle (UefiHiiHandle, &PackageGuid);    ASSERT_EFI_ERROR (Status);    CopyGuid(&ThunkContext->TagGuid, &PackageGuid);    return ThunkContext;}
开发者ID:shivamurthy,项目名称:hikey-edk2,代码行数:40,


示例6: GetFormSetGuid

/**  Get FormSet GUID.  ASSERT if no FormSet Opcode is found.  @param Packages             Form Framework Package.  @param FormSetGuid          Return the FormSet Guid.**/VOIDGetFormSetGuid (    IN  EFI_HII_PACKAGE_HEADER  *Package,    OUT EFI_GUID                *FormSetGuid){    UINTN                         Offset;    EFI_IFR_OP_HEADER             *OpCode;    EFI_IFR_FORM_SET              *FormSet;    Offset = sizeof (EFI_HII_PACKAGE_HEADER);    while (Offset < Package->Length) {        OpCode = (EFI_IFR_OP_HEADER *)((UINT8 *) Package + Offset);        switch (OpCode->OpCode) {        case EFI_IFR_FORM_SET_OP:            FormSet = (EFI_IFR_FORM_SET *) OpCode;            CopyGuid (FormSetGuid, (EFI_GUID *)(VOID *)&FormSet->Guid);            return;        default:            break;        }        Offset += OpCode->Length;    }    //    // A proper IFR must have a formset opcode.    //    ASSERT (FALSE);}
开发者ID:shivamurthy,项目名称:hikey-edk2,代码行数:42,


示例7: RecordCapsuleStatusVariable

/**  Record capsule status variable and to local cache.  @param[in] CapsuleHeader  The capsule image header  @param[in] CapsuleStatus  The capsule process stauts  @retval EFI_SUCCESS          The capsule status variable is recorded.  @retval EFI_OUT_OF_RESOURCES No resource to record the capsule status variable.**/EFI_STATUSRecordCapsuleStatusVariable (  IN EFI_CAPSULE_HEADER                           *CapsuleHeader,  IN EFI_STATUS                                   CapsuleStatus  ){  EFI_CAPSULE_RESULT_VARIABLE_HEADER  CapsuleResultVariable;  EFI_STATUS                          Status;  CapsuleResultVariable.VariableTotalSize = sizeof(CapsuleResultVariable);  CopyGuid (&CapsuleResultVariable.CapsuleGuid, &CapsuleHeader->CapsuleGuid);  ZeroMem(&CapsuleResultVariable.CapsuleProcessed, sizeof(CapsuleResultVariable.CapsuleProcessed));  gRT->GetTime(&CapsuleResultVariable.CapsuleProcessed, NULL);  CapsuleResultVariable.CapsuleStatus = CapsuleStatus;  //  // Save Local Cache  //  Status = WriteNewCapsuleResultVariableCache(&CapsuleResultVariable, sizeof(CapsuleResultVariable));  if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) != 0) {    Status = WriteNewCapsuleResultVariable(&CapsuleResultVariable, sizeof(CapsuleResultVariable));  }  return Status;}
开发者ID:coolstar,项目名称:edk2,代码行数:34,


示例8: GetAllSmmGaugeDataEx

EFIAPIGetAllSmmGaugeDataEx (VOID){  EFI_STATUS                  Status;  EFI_SMM_COMMUNICATE_HEADER  *SmmCommBufferHeader;  SMM_PERF_COMMUNICATE_EX     *SmmPerfCommData;  UINTN                       CommSize;  UINTN                       DataSize;  if (mGaugeDataEx != NULL) {    return mGaugeDataEx;  }  Status = GetCommunicationProtocol ();  if (EFI_ERROR (Status)) {    return NULL;  }  //  // Initialize communicate buffer   //  SmmCommBufferHeader = (EFI_SMM_COMMUNICATE_HEADER *)mSmmPerformanceBuffer;  SmmPerfCommData = (SMM_PERF_COMMUNICATE_EX *)SmmCommBufferHeader->Data;  ZeroMem((UINT8*)SmmPerfCommData, sizeof(SMM_PERF_COMMUNICATE_EX));      CopyGuid (&SmmCommBufferHeader->HeaderGuid, &gSmmPerformanceExProtocolGuid);  SmmCommBufferHeader->MessageLength = sizeof(SMM_PERF_COMMUNICATE_EX);  CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;  //  // Get totol number of SMM gauge entries  //  SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;  Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);  if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) || SmmPerfCommData->NumberOfEntries == 0) {    return NULL;  }  mGaugeNumberOfEntriesEx = SmmPerfCommData->NumberOfEntries;    DataSize = mGaugeNumberOfEntriesEx * sizeof(GAUGE_DATA_ENTRY_EX);  mGaugeDataEx = AllocateZeroPool(DataSize);  ASSERT (mGaugeDataEx != NULL);    //  // Get all SMM gauge data  //    SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_DATA;  SmmPerfCommData->LogEntryKey = 0;  SmmPerfCommData->NumberOfEntries = mGaugeNumberOfEntriesEx;  SmmPerfCommData->GaugeDataEx = mGaugeDataEx;  Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);  if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus)) {    FreePool (mGaugeDataEx);    mGaugeDataEx = NULL;    mGaugeNumberOfEntriesEx = 0;  }   return mGaugeDataEx;}
开发者ID:hsienchieh,项目名称:uefilab,代码行数:60,


示例9: BuildGuidHob

EFIAPIBuildGuidHob (  IN CONST EFI_GUID              *Guid,  IN UINTN                       DataLength  ){  EFI_HOB_GUID_TYPE *Hob;  //  // Make sure Guid is valid  //  ASSERT (Guid != NULL);    //  // Make sure that data length is not too long.  //  ASSERT (DataLength <= (0xffff - sizeof (EFI_HOB_GUID_TYPE)));  Hob = InternalPeiCreateHob (EFI_HOB_TYPE_GUID_EXTENSION, (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + DataLength));  if (Hob == NULL) {    return Hob;  }  CopyGuid (&Hob->Name, Guid);  return Hob + 1;}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:25,


示例10: ASSERT

/**  Builds a HOB for the Stack.  This function builds a HOB for the stack.  It can only be invoked during PEI phase;  for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.    If there is no additional space for HOB creation, then ASSERT().  @param  BaseAddress   The 64 bit physical address of the Stack.  @param  Length        The length of the stack in bytes.**/VOIDEFIAPIBuildStackHob (  IN EFI_PHYSICAL_ADDRESS        BaseAddress,  IN UINT64                      Length  ){  EFI_HOB_MEMORY_ALLOCATION_STACK  *Hob;  ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) &&          ((Length & (EFI_PAGE_SIZE - 1)) == 0));  Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK));  if (Hob == NULL) {    return;  }  CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocStackGuid);  Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;  Hob->AllocDescriptor.MemoryLength      = Length;  Hob->AllocDescriptor.MemoryType        = EfiBootServicesData;  //  // Zero the reserved space to match HOB spec  //  ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));}
开发者ID:FishYu1222,项目名称:edk2,代码行数:40,


示例11: VirtioRngGetInfo

/**  Returns information about the random number generation implementation.  @param[in]     This                 A pointer to the EFI_RNG_PROTOCOL                                      instance.  @param[in,out] RNGAlgorithmListSize On input, the size in bytes of                                      RNGAlgorithmList.                                      On output with a return code of                                      EFI_SUCCESS, the size in bytes of the                                      data returned in RNGAlgorithmList. On                                      output with a return code of                                      EFI_BUFFER_TOO_SMALL, the size of                                      RNGAlgorithmList required to obtain the                                      list.  @param[out] RNGAlgorithmList        A caller-allocated memory buffer filled                                      by the driver with one EFI_RNG_ALGORITHM                                      element for each supported RNG algorithm.                                      The list must not change across multiple                                      calls to the same driver. The first                                      algorithm in the list is the default                                      algorithm for the driver.  @retval EFI_SUCCESS                 The RNG algorithm list was returned                                      successfully.  @retval EFI_UNSUPPORTED             The services is not supported by this                                      driver.  @retval EFI_DEVICE_ERROR            The list of algorithms could not be                                      retrieved due to a hardware or firmware                                      error.  @retval EFI_INVALID_PARAMETER       One or more of the parameters are                                      incorrect.  @retval EFI_BUFFER_TOO_SMALL        The buffer RNGAlgorithmList is too small                                      to hold the result.**/STATICEFI_STATUSEFIAPIVirtioRngGetInfo (  IN      EFI_RNG_PROTOCOL        *This,  IN OUT  UINTN                   *RNGAlgorithmListSize,  OUT     EFI_RNG_ALGORITHM       *RNGAlgorithmList  ){  if (This == NULL || RNGAlgorithmListSize == NULL) {    return EFI_INVALID_PARAMETER;  }  if (*RNGAlgorithmListSize < sizeof (EFI_RNG_ALGORITHM)) {    *RNGAlgorithmListSize = sizeof (EFI_RNG_ALGORITHM);    return EFI_BUFFER_TOO_SMALL;  }  if (RNGAlgorithmList == NULL) {    return EFI_INVALID_PARAMETER;  }  *RNGAlgorithmListSize = sizeof (EFI_RNG_ALGORITHM);  CopyGuid (RNGAlgorithmList, &gEfiRngAlgorithmRaw);  return EFI_SUCCESS;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:62,


示例12: InitCommunicateBuffer

/**  Initialize the communicate buffer using DataSize and Function number.  @param[out]      CommunicateBuffer The communicate buffer. Caller should free it after use.  @param[out]      DataPtr           Points to the data in the communicate buffer. Caller should not free it.  @param[in]       DataSize          The payload size.  @param[in]       Function          The function number used to initialize the communicate header.**/VOIDInitCommunicateBuffer (  OUT     VOID                              **CommunicateBuffer,  OUT     VOID                              **DataPtr,  IN      UINTN                             DataSize,  IN      UINTN                             Function  ){  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;    SMM_FTW_COMMUNICATE_FUNCTION_HEADER       *SmmFtwFunctionHeader;   //  // The whole buffer size: SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE + DataSize.  //  SmmCommunicateHeader = AllocateZeroPool (DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE);  ASSERT (SmmCommunicateHeader != NULL);     //  // Prepare data buffer.  //  CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmFaultTolerantWriteProtocolGuid);  SmmCommunicateHeader->MessageLength = DataSize + SMM_FTW_COMMUNICATE_HEADER_SIZE;   SmmFtwFunctionHeader = (SMM_FTW_COMMUNICATE_FUNCTION_HEADER *) SmmCommunicateHeader->Data;  SmmFtwFunctionHeader->Function = Function;  *CommunicateBuffer = SmmCommunicateHeader;  if (DataPtr != NULL) {    *DataPtr = SmmFtwFunctionHeader->Data;  }  }
开发者ID:etiago,项目名称:vbox,代码行数:40,


示例13: FtwAllocate

/**  Allocates space for the protocol to maintain information about writes.  Since writes must be completed in a fault-tolerant manner and multiple  writes require more resources to be successful, this function  enables the protocol to ensure that enough space exists to track  information about upcoming writes.  @param[in]  This             A pointer to the calling context.  @param[in]  CallerId         The GUID identifying the write.  @param[in]  PrivateDataSize  The size of the caller's private data  that must be                               recorded for each write.  @param[in]  NumberOfWrites   The number of fault tolerant block writes that will                               need to occur.  @retval EFI_SUCCESS          The function completed successfully  @retval EFI_ABORTED          The function could not complete successfully.  @retval EFI_ACCESS_DENIED    Not all allocated writes have been completed.  All                               writes must be completed or aborted before another                               fault tolerant write can occur.**/EFI_STATUSEFIAPIFtwAllocate (  IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL      *This,  IN EFI_GUID                               *CallerId,  IN UINTN                                  PrivateDataSize,  IN UINTN                                  NumberOfWrites  ){  EFI_STATUS                                Status;  UINTN                                     PayloadSize;  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;    SMM_FTW_ALLOCATE_HEADER                   *SmmFtwAllocateHeader;  //  // Initialize the communicate buffer.  //  PayloadSize  = sizeof (SMM_FTW_ALLOCATE_HEADER);  InitCommunicateBuffer ((VOID **)&SmmCommunicateHeader, (VOID **)&SmmFtwAllocateHeader, PayloadSize, FTW_FUNCTION_ALLOCATE);  CopyGuid (&SmmFtwAllocateHeader->CallerId, CallerId);  SmmFtwAllocateHeader->PrivateDataSize = PrivateDataSize;  SmmFtwAllocateHeader->NumberOfWrites  = NumberOfWrites;       //  // Send data to SMM.  //  Status = SendCommunicateBuffer (SmmCommunicateHeader, PayloadSize);  if (!EFI_ERROR( Status)) {    mPrivateDataSize = PrivateDataSize;  }  FreePool (SmmCommunicateHeader);  return Status;}
开发者ID:etiago,项目名称:vbox,代码行数:55,


示例14: ASSERT

/**  Registers handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and EXTRACT_GUIDED_SECTION_DECODE_HANDLER  for a specific GUID section type.  Registers the handlers specified by GetInfoHandler and DecodeHandler with the GUID specified by SectionGuid.  If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED.  If there are not enough resources available to register the handlers  then RETURN_OUT_OF_RESOURCES is returned.    If SectionGuid is NULL, then ASSERT().  If GetInfoHandler is NULL, then ASSERT().  If DecodeHandler is NULL, then ASSERT().  @param[in]  SectionGuid    A pointer to the GUID associated with the the handlers                             of the GUIDed section type being registered.  @param[in]  GetInfoHandler The pointer to a function that examines a GUIDed section and returns the                             size of the decoded buffer and the size of an optional scratch buffer                             required to actually decode the data in a GUIDed section.  @param[in]  DecodeHandler  The pointer to a function that decodes a GUIDed section into a caller                             allocated output buffer.   @retval  RETURN_SUCCESS           The handlers were registered.  @retval  RETURN_OUT_OF_RESOURCES  There are not enough resources available to register the handlers.**/RETURN_STATUSEFIAPIExtractGuidedSectionRegisterHandlers (  IN CONST  GUID                                     *SectionGuid,  IN        EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER  GetInfoHandler,  IN        EXTRACT_GUIDED_SECTION_DECODE_HANDLER    DecodeHandler  ){  UINT32                              Index;  RETURN_STATUS                       Status;  EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;  //  // Check input paramter  //  ASSERT (SectionGuid != NULL);  ASSERT (GetInfoHandler != NULL);  ASSERT (DecodeHandler != NULL);  //  // Get the registered handler information  //  Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);  if (RETURN_ERROR (Status)) {    return Status;  }  //  // Search the match registered GetInfo handler for the input guided section.  //  ASSERT (HandlerInfo != NULL);  for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {    if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {      //      // If the guided handler has been registered before, only update its handler.      //      HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;      HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;      return RETURN_SUCCESS;    }  }  //  // Check the global table is enough to contain new Handler.  //  if (HandlerInfo->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {    return RETURN_OUT_OF_RESOURCES;  }    //  // Register new Handler and guid value.  //  CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);  HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;  HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;  return RETURN_SUCCESS;}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:82,


示例15: FvFillFfsFile

/**  Create entire FFS file.  @param FileHeader      Starting Address of a Buffer that hold the FFS File image.  @param FfsFileBuffer   The source buffer that contains the File Data.  @param BufferSize      The length of FfsFileBuffer.  @param ActualFileSize  Size of FFS file.  @param FileName        The Guid of Ffs File.  @param FileType        The type of the written Ffs File.  @param FileAttributes  The attributes of the written Ffs File.  @retval EFI_INVALID_PARAMETER  File type is not valid.  @retval EFI_SUCCESS            FFS file is successfully created.**/EFI_STATUSFvFillFfsFile (  OUT EFI_FFS_FILE_HEADER   *FileHeader,  IN UINT8                  *FfsFileBuffer,  IN UINTN                  BufferSize,  IN UINTN                  ActualFileSize,  IN EFI_GUID               *FileName,  IN EFI_FV_FILETYPE        FileType,  IN EFI_FV_FILE_ATTRIBUTES FileAttributes  ){  EFI_FFS_FILE_ATTRIBUTES TmpFileAttribute;  EFI_FFS_FILE_HEADER     *TmpFileHeader;  //  // File Type value 0x0E~0xE0 are reserved  //  if ((FileType > EFI_FV_FILETYPE_SMM_CORE) && (FileType < 0xE0)) {    return EFI_INVALID_PARAMETER;  }  TmpFileHeader = (EFI_FFS_FILE_HEADER *) FfsFileBuffer;  //  // First fill all fields ready in FfsFileBuffer  //  CopyGuid (&TmpFileHeader->Name, FileName);  TmpFileHeader->Type = FileType;  //  // Convert the FileAttributes to FFSFileAttributes  //  FvFileAttrib2FfsFileAttrib (FileAttributes, &TmpFileAttribute);  TmpFileHeader->Attributes = TmpFileAttribute;  if (ActualFileSize > 0x00FFFFFF) {    ((EFI_FFS_FILE_HEADER2 *) FileHeader)->ExtendedSize = (UINT32) ActualFileSize;    *(UINT32 *) FileHeader->Size &= 0xFF000000;    FileHeader->Attributes |= FFS_ATTRIB_LARGE_FILE;  } else {    *(UINT32 *) FileHeader->Size &= 0xFF000000;    *(UINT32 *) FileHeader->Size |= ActualFileSize;  }  SetHeaderChecksum (TmpFileHeader);  SetFileChecksum (TmpFileHeader, ActualFileSize);  SetFileState (EFI_FILE_HEADER_CONSTRUCTION, TmpFileHeader);  SetFileState (EFI_FILE_HEADER_VALID, TmpFileHeader);  SetFileState (EFI_FILE_DATA_VALID, TmpFileHeader);  //  // Copy data from FfsFileBuffer to FileHeader(cache)  //  CopyMem (FileHeader, FfsFileBuffer, BufferSize);  return EFI_SUCCESS;}
开发者ID:MattDevo,项目名称:edk2,代码行数:73,


示例16: CoreFindProtocolEntry

/**  Finds the protocol entry for the requested protocol.  The gProtocolDatabaseLock must be owned  @param  Protocol               The ID of the protocol  @param  Create                 Create a new entry if not found  @return Protocol entry**/PROTOCOL_ENTRY  *CoreFindProtocolEntry (  IN EFI_GUID   *Protocol,  IN BOOLEAN    Create  ){  LIST_ENTRY          *Link;  PROTOCOL_ENTRY      *Item;  PROTOCOL_ENTRY      *ProtEntry;  ASSERT_LOCKED(&gProtocolDatabaseLock);  //  // Search the database for the matching GUID  //  ProtEntry = NULL;  for (Link = mProtocolDatabase.ForwardLink;       Link != &mProtocolDatabase;       Link = Link->ForwardLink) {    Item = CR(Link, PROTOCOL_ENTRY, AllEntries, PROTOCOL_ENTRY_SIGNATURE);    if (CompareGuid (&Item->ProtocolID, Protocol)) {      //      // This is the protocol entry      //      ProtEntry = Item;      break;    }  }  //  // If the protocol entry was not found and Create is TRUE, then  // allocate a new entry  //  if ((ProtEntry == NULL) && Create) {    ProtEntry = AllocatePool (sizeof(PROTOCOL_ENTRY));    if (ProtEntry != NULL) {      //      // Initialize new protocol entry structure      //      ProtEntry->Signature = PROTOCOL_ENTRY_SIGNATURE;      CopyGuid ((VOID *)&ProtEntry->ProtocolID, Protocol);      InitializeListHead (&ProtEntry->Protocols);      InitializeListHead (&ProtEntry->Notify);      //      // Add it to protocol database      //      InsertTailList (&mProtocolDatabase, &ProtEntry->AllEntries);    }  }  return ProtEntry;}
开发者ID:kraxel,项目名称:edk2,代码行数:68,


示例17: RecordFmpCapsuleStatusVariable

/**  Record FMP capsule status variable and to local cache.  @param[in] CapsuleHeader  The capsule image header  @param[in] CapsuleStatus  The capsule process stauts  @param[in] PayloadIndex   FMP payload index  @param[in] ImageHeader    FMP image header  @retval EFI_SUCCESS          The capsule status variable is recorded.  @retval EFI_OUT_OF_RESOURCES No resource to record the capsule status variable.**/EFI_STATUSRecordFmpCapsuleStatusVariable (  IN EFI_CAPSULE_HEADER                            *CapsuleHeader,  IN EFI_STATUS                                    CapsuleStatus,  IN UINTN                                         PayloadIndex,  IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER  *ImageHeader  ){  EFI_CAPSULE_RESULT_VARIABLE_HEADER  *CapsuleResultVariableHeader;  EFI_CAPSULE_RESULT_VARIABLE_FMP     *CapsuleResultVariableFmp;  EFI_STATUS                          Status;  UINT8                               *CapsuleResultVariable;  UINT32                              CapsuleResultVariableSize;  CapsuleResultVariable     = NULL;  CapsuleResultVariableSize = sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP);  CapsuleResultVariable     = AllocatePool (CapsuleResultVariableSize);  if (CapsuleResultVariable == NULL) {    return EFI_OUT_OF_RESOURCES;  }  CapsuleResultVariableHeader = (VOID *)CapsuleResultVariable;  CapsuleResultVariableHeader->VariableTotalSize = CapsuleResultVariableSize;  CopyGuid(&CapsuleResultVariableHeader->CapsuleGuid, &CapsuleHeader->CapsuleGuid);  ZeroMem(&CapsuleResultVariableHeader->CapsuleProcessed, sizeof(CapsuleResultVariableHeader->CapsuleProcessed));  gRT->GetTime(&CapsuleResultVariableHeader->CapsuleProcessed, NULL);  CapsuleResultVariableHeader->CapsuleStatus = CapsuleStatus;  CapsuleResultVariableFmp = (VOID *)(CapsuleResultVariable + sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER));  CapsuleResultVariableFmp->Version = 0x1;  CapsuleResultVariableFmp->PayloadIndex = (UINT8)PayloadIndex;  CapsuleResultVariableFmp->UpdateImageIndex = ImageHeader->UpdateImageIndex;  CopyGuid (&CapsuleResultVariableFmp->UpdateImageTypeId, &ImageHeader->UpdateImageTypeId);  //  // Save Local Cache  //  Status = WriteNewCapsuleResultVariableCache(CapsuleResultVariable, CapsuleResultVariableSize);  if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) != 0) {    Status = WriteNewCapsuleResultVariable(CapsuleResultVariable, CapsuleResultVariableSize);  }  FreePool (CapsuleResultVariable);  return Status;}
开发者ID:coolstar,项目名称:edk2,代码行数:55,


示例18: GenerateRandomGuid

/**  Generate a Random GUID.    @param Guid On output, a Random GUID will be filled.**/VOIDGenerateRandomGuid (  OUT           EFI_GUID * Guid  ){  CopyGuid (Guid, &mGuidBase);  mGuidCount++;    *((UINT64 *) Guid) = *((UINT64 *) Guid) + mGuidCount;}
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:16,


示例19: PlatformBootManagerBeforeConsole

/**  Do the platform init, can be customized by OEM/IBV  Possible things that can be done in PlatformBootManagerBeforeConsole:  > Update console variable: 1. include hot-plug devices;  >                          2. Clear ConIn and add SOL for AMT  > Register new Driver#### or Boot####  > Register new Key####: e.g.: F12  > Signal ReadyToLock event  > Authentication action: 1. connect Auth devices;  >                        2. Identify auto logon user.**/VOIDEFIAPIPlatformBootManagerBeforeConsole (  VOID  ){  //  // Signal EndOfDxe PI Event  //  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);  //  // Locate the PCI root bridges and make the PCI bus driver connect each,  // non-recursively. This will produce a number of child handles with PciIo on  // them.  //  FilterAndProcess (&gEfiPciRootBridgeIoProtocolGuid, NULL, Connect);  //  // Find all display class PCI devices (using the handles from the previous  // step), and connect them non-recursively. This should produce a number of  // child handles with GOPs on them.  //  FilterAndProcess (&gEfiPciIoProtocolGuid, IsPciDisplay, Connect);  //  // Now add the device path of all handles with GOP on them to ConOut and  // ErrOut.  //  FilterAndProcess (&gEfiGraphicsOutputProtocolGuid, NULL, AddOutput);  //  // Add the hardcoded short-form USB keyboard device path to ConIn.  //  EfiBootManagerUpdateConsoleVariable (ConIn,    (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, NULL);  //  // Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.  //  ASSERT (FixedPcdGet8 (PcdDefaultTerminalType) == 4);  CopyGuid (&mSerialConsole.TermType.Guid, &gEfiTtyTermGuid);  EfiBootManagerUpdateConsoleVariable (ConIn,    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);  EfiBootManagerUpdateConsoleVariable (ConOut,    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);  EfiBootManagerUpdateConsoleVariable (ErrOut,    (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);  //  // Register platform-specific boot options and keyboard shortcuts.  //  PlatformRegisterOptionsAndKeys ();}
开发者ID:pmj,项目名称:edk2,代码行数:66,


示例20: InternalCreateHashInterfaceHob

/**  This function creates hash interface hob.  @param Identifier    Identifier to create hash interface hob.  @retval hash interface hob.**/HASH_INTERFACE_HOB *InternalCreateHashInterfaceHob (  EFI_GUID      *Identifier  ){  HASH_INTERFACE_HOB LocalHashInterfaceHob;  ZeroMem (&LocalHashInterfaceHob, sizeof(LocalHashInterfaceHob));  CopyGuid (&LocalHashInterfaceHob.Identifier, Identifier);  return BuildGuidDataHob (&mHashLibPeiRouterGuid, &LocalHashInterfaceHob, sizeof(LocalHashInterfaceHob));}
开发者ID:baranee,项目名称:edk2,代码行数:18,


示例21: ExtractGuidedSectionRegisterHandlers

RETURN_STATUSEFIAPIExtractGuidedSectionRegisterHandlers (  IN CONST  GUID                                     *SectionGuid,  IN        EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER  GetInfoHandler,  IN        EXTRACT_GUIDED_SECTION_DECODE_HANDLER    DecodeHandler  ){  PRE_PI_EXTRACT_GUIDED_SECTION_DATA  *SavedData;  UINT32                              Index;  //  // Check input paramter.  //  if (SectionGuid == NULL) {    return RETURN_INVALID_PARAMETER;  }  SavedData = GetSavedData();  //  // Search the match registered GetInfo handler for the input guided section.  //  for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index ++) {    if (CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionGuid)) {      break;    }  }  //  // If the guided handler has been registered before, only update its handler.  //  if (Index < SavedData->NumberOfExtractHandler) {    SavedData->ExtractDecodeHandlerTable [Index] = DecodeHandler;    SavedData->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;    return RETURN_SUCCESS;  }    //  // Check the global table is enough to contain new Handler.  //  if (SavedData->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {    return RETURN_OUT_OF_RESOURCES;  }    //  // Register new Handler and guid value.  //  CopyGuid (&SavedData->ExtractHandlerGuidTable [SavedData->NumberOfExtractHandler], SectionGuid);  SavedData->ExtractDecodeHandlerTable [SavedData->NumberOfExtractHandler] = DecodeHandler;  SavedData->ExtractGetInfoHandlerTable [SavedData->NumberOfExtractHandler++] = GetInfoHandler;    return RETURN_SUCCESS;}
开发者ID:hsienchieh,项目名称:uefilab,代码行数:53,


示例22: SaveLockBox

/**  This function will save confidential information to lockbox.  @param Guid       the guid to identify the confidential information  @param Buffer     the address of the confidential information  @param Length     the length of the confidential information  @retval RETURN_SUCCESS            the information is saved successfully.  @retval RETURN_INVALID_PARAMETER  the Guid is NULL, or Buffer is NULL, or                                    Length is 0  @retval RETURN_ALREADY_STARTED    the requested GUID already exist.  @retval RETURN_OUT_OF_RESOURCES   no enough resource to save the information.  @retval RETURN_ACCESS_DENIED      it is too late to invoke this interface  @retval RETURN_NOT_STARTED        it is too early to invoke this interface  @retval RETURN_UNSUPPORTED        the service is not supported by                                    implementaion.**/RETURN_STATUSEFIAPISaveLockBox (  IN  GUID                        *Guid,  IN  VOID                        *Buffer,  IN  UINTN                       Length  ){  LOCK_BOX_ENTRY *Header;  VOID            *CopyBuffer;  DEBUG ((DEBUG_VERBOSE, "%a: Guid=%g Buffer=%p Length=0x%x/n", __FUNCTION__,    Guid, Buffer, (UINT32) Length));  if (Guid == NULL || Buffer == NULL || Length == 0) {    return RETURN_INVALID_PARAMETER;  }  if (Length > 0xFFFFFFFF) {    return RETURN_OUT_OF_RESOURCES;  }  Header = FindHeaderByGuid (Guid);  if (Header == NULL) {    return RETURN_OUT_OF_RESOURCES;  }  if (Header->Size > 0) {    return RETURN_ALREADY_STARTED;  }  CopyBuffer = AllocateAcpiNvsPool (Length);  if (CopyBuffer == NULL) {    return RETURN_OUT_OF_RESOURCES;  }  //  // overwrite the current terminator header with new metadata  //  CopyGuid (&Header->Guid, Guid);  Header->OrigAddress = (UINTN) Buffer;  Header->CopyAddress = (UINTN) CopyBuffer;  Header->Size        = (UINT32) Length;  Header->Attributes  = 0;  //  // copy contents  //  CopyMem (CopyBuffer, Buffer, Length);  return RETURN_SUCCESS;}
开发者ID:OznOg,项目名称:edk2,代码行数:69,


示例23: MMCBuildDevicePath

EFI_STATUSMMCBuildDevicePath (  IN EFI_MMC_HOST_PROTOCOL     *This,  IN EFI_DEVICE_PATH_PROTOCOL  **DevicePath  ){  EFI_DEVICE_PATH_PROTOCOL    *NewDevicePathNode;  NewDevicePathNode = CreateDeviceNode(HARDWARE_DEVICE_PATH,HW_VENDOR_DP,sizeof(VENDOR_DEVICE_PATH));  CopyGuid(&((VENDOR_DEVICE_PATH*)NewDevicePathNode)->Guid,&mPL180MciDevicePathGuid);  *DevicePath = NewDevicePathNode;  return EFI_SUCCESS;}
开发者ID:FishYu1222,项目名称:edk2,代码行数:13,


示例24: MmCoreFindMmiEntry

EFIAPIMmCoreFindMmiEntry (  IN EFI_GUID  *HandlerType,  IN BOOLEAN   Create  ){  LIST_ENTRY  *Link;  MMI_ENTRY   *Item;  MMI_ENTRY   *MmiEntry;  //  // Search the MMI entry list for the matching GUID  //  MmiEntry = NULL;  for (Link = mMmiEntryList.ForwardLink;       Link != &mMmiEntryList;       Link = Link->ForwardLink) {    Item = CR (Link, MMI_ENTRY, AllEntries, MMI_ENTRY_SIGNATURE);    if (CompareGuid (&Item->HandlerType, HandlerType)) {      //      // This is the MMI entry      //      MmiEntry = Item;      break;    }  }  //  // If the protocol entry was not found and Create is TRUE, then  // allocate a new entry  //  if ((MmiEntry == NULL) && Create) {    MmiEntry = AllocatePool (sizeof (MMI_ENTRY));    if (MmiEntry != NULL) {      //      // Initialize new MMI entry structure      //      MmiEntry->Signature = MMI_ENTRY_SIGNATURE;      CopyGuid ((VOID *)&MmiEntry->HandlerType, HandlerType);      InitializeListHead (&MmiEntry->MmiHandlers);      //      // Add it to MMI entry list      //      InsertTailList (&mMmiEntryList, &MmiEntry->AllEntries);    }  }  return MmiEntry;}
开发者ID:shijunjing,项目名称:edk2,代码行数:50,


示例25: ResetPlatformSpecificGuid

/**  This is a shorthand helper function to reset with a subtype so that  the caller doesn't have to bother with a function that has half a dozen  parameters.  This will generate a reset with status EFI_SUCCESS, a NULL string, and  no custom data. The subtype will be formatted in such a way that it can be  picked up by notification registrations and custom handlers.  NOTE: This call will fail if the architectural ResetSystem underpinnings        are not initialized. For DXE, you can add gEfiResetArchProtocolGuid        to your DEPEX.  @param[in]  ResetSubtype  GUID pointer for the reset subtype to be used.**/VOIDEFIAPIResetPlatformSpecificGuid (  IN CONST  GUID        *ResetSubtype  ){  RESET_UTILITY_GUID_SPECIFIC_RESET_DATA  ResetData;  ResetData.NullTerminator = CHAR_NULL;  CopyGuid (    (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, ResetSubtype)),    ResetSubtype    );  ResetPlatformSpecific (sizeof (ResetData), &ResetData);}
开发者ID:MattDevo,项目名称:edk2,代码行数:31,



注:本文中的CopyGuid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CopyMagickString函数代码示例
C++ CopyFrom函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。