当前位置: 首页>>代码示例>>C++>>正文


C++ EFI_BOOT_SERVICES::CalculateCrc32方法代码示例

本文整理汇总了C++中EFI_BOOT_SERVICES::CalculateCrc32方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BOOT_SERVICES::CalculateCrc32方法的具体用法?C++ EFI_BOOT_SERVICES::CalculateCrc32怎么用?C++ EFI_BOOT_SERVICES::CalculateCrc32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EFI_BOOT_SERVICES的用法示例。


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

示例1:

EFI_STATUS EFIAPI
OvrCalculateCrc32(
	IN VOID				*Data,
	IN UINTN			DataSize,
	OUT UINT32			*Crc32
)
{
	EFI_STATUS			Status;
	Status = gOrgBS.CalculateCrc32(Data, DataSize, Crc32);
	
	// Omit printing this when using append while logging, as it can end up in calling a file operating inside another file operation
	// (some implementations of File functions use CalculateCrc32)
	#if (LOG_TO_FILE <= 2) && (CLEANER_LOG != 1)
	// Better not print this for cleaner logs - reported by XyZ
	PRINT("->CalculateCrc32(%p, %d, 0x%x) = %r\n", Data, DataSize, Crc32, Status);
	#endif
	return Status;
}
开发者ID:jief666,项目名称:clover,代码行数:18,代码来源:BootServices.c

示例2: sizeof

/** Installs our boot services overrides. */
EFI_STATUS EFIAPI
OvrBootServices(EFI_BOOT_SERVICES	*BS)
{
	
	PRINT("Overriding boot services ...\n");
	
	// store orig BS
	CopyMem(&gOrgBS, BS, sizeof(EFI_BOOT_SERVICES));
	
	BS->RaiseTPL = OvrRaiseTPL;
	BS->RestoreTPL = OvrRestoreTPL;
	
	BS->AllocatePages = OvrAllocatePages;
	BS->FreePages = OvrFreePages;
	BS->GetMemoryMap = OvrGetMemoryMap;
	BS->AllocatePool = OvrAllocatePool;
	BS->FreePool = OvrFreePool;
	
	BS->CreateEvent = OvrCreateEvent;
	BS->SetTimer = OvrSetTimer;
	BS->WaitForEvent = OvrWaitForEvent;
	BS->SignalEvent = OvrSignalEvent;
	BS->CloseEvent = OvrCloseEvent;
	BS->CheckEvent = OvrCheckEvent;
	
	BS->InstallProtocolInterface = OvrInstallProtocolInterface;
	BS->ReinstallProtocolInterface = OvrReinstallProtocolInterface;
	BS->UninstallProtocolInterface = OvrUninstallProtocolInterface;

	BS->HandleProtocol = OvrHandleProtocol;
	BS->RegisterProtocolNotify = OvrRegisterProtocolNotify;
	BS->LocateHandle = OvrLocateHandle;
	BS->LocateDevicePath = OvrLocateDevicePath;

	BS->InstallConfigurationTable = OvrInstallConfigurationTable;

	BS->LoadImage = OvrLoadImage;
	BS->StartImage = OvrStartImage;
	BS->Exit = OvrExit;
	BS->UnloadImage = OvrUnloadImage;
	
	BS->ExitBootServices = OvrExitBootServices;
	BS->GetNextMonotonicCount = OvrGetNextMonotonicCount;
	BS->Stall = OvrStall;
	BS->SetWatchdogTimer = OvrSetWatchdogTimer;
	
	BS->ConnectController = OvrConnectController;
	BS->DisconnectController = OvrDisconnectController;

	BS->OpenProtocol = OvrOpenProtocol;
	BS->CloseProtocol = OvrCloseProtocol;
	BS->OpenProtocolInformation = OvrOpenProtocolInformation;
	BS->ProtocolsPerHandle = OvrProtocolsPerHandle;
	BS->LocateHandleBuffer = OvrLocateHandleBuffer;
	BS->LocateProtocol = OvrLocateProtocol;
	BS->InstallMultipleProtocolInterfaces = OvrInstallMultipleProtocolInterfaces;
	BS->UninstallMultipleProtocolInterfaces = OvrUninstallMultipleProtocolInterfaces;
	
	BS->CalculateCrc32 = OvrCalculateCrc32;
	BS->CopyMem = OvrCopyMem;
	BS->SetMem = OvrSetMem;
	BS->CreateEventEx = OvrCreateEventEx;
	
	BS->Hdr.CRC32 = 0;
	// use orig function to avoid our PRINT
	gOrgBS.CalculateCrc32(BS, BS->Hdr.HeaderSize, &BS->Hdr.CRC32);
	PRINT("Boot services overriden!\n");
	
	#if CAPTURE_CONSOLE_OUTPUT >= 1
	PRINT("Overriding console output ...\n");
	#if CAPTURE_CONSOLE_OUTPUT == 2
	PRINT("Preventing any further console output, please wait until booting starts ...\n");
	#endif
	gOrgConOutOutputString = gST->ConOut->OutputString;
	gST->ConOut->OutputString = OvrConOutOutputString;
	PRINT("Console output overriden!\n");
	#endif
	
	return EFI_SUCCESS;
}
开发者ID:jief666,项目名称:clover,代码行数:81,代码来源:BootServices.c


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