symbolic kexts and kernel patcher

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2020-04-27 18:16:43 +03:00
parent f78d6dbb7c
commit a621438d7c
121 changed files with 513 additions and 375 deletions

View File

@ -399,7 +399,7 @@ GraphicsConsoleControllerDriverStart (
// //
// Initialize the Graphics Console device instance // Initialize the Graphics Console device instance
// //
Private = AllocateCopyPool ( Private = AllocateCopyPool(
sizeof (GRAPHICS_CONSOLE_DEV), sizeof (GRAPHICS_CONSOLE_DEV),
&mGraphicsConsoleDevTemplate &mGraphicsConsoleDevTemplate
); );
@ -1791,7 +1791,7 @@ DrawUnicodeWeightAtCursorN (
Blt->Width = (UINT16) (Private->ModeData[This->Mode->Mode].GopWidth); Blt->Width = (UINT16) (Private->ModeData[This->Mode->Mode].GopWidth);
Blt->Height = (UINT16) (Private->ModeData[This->Mode->Mode].GopHeight); Blt->Height = (UINT16) (Private->ModeData[This->Mode->Mode].GopHeight);
String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight); String = AllocateCopyPool((Count + 1) * sizeof (CHAR16), UnicodeWeight);
if (String == NULL) { if (String == NULL) {
FreePool(Blt); FreePool(Blt);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -351,7 +351,7 @@ InstallAcpiTable (
// //
// Install the ACPI table // Install the ACPI table
// //
AcpiTableBufferConst = AllocateCopyPool (AcpiTableBufferSize,AcpiTableBuffer); AcpiTableBufferConst = AllocateCopyPool(AcpiTableBufferSize,AcpiTableBuffer);
*TableKey = 0; *TableKey = 0;
Status = SetAcpiTable ( Status = SetAcpiTable (
AcpiTableInstance, AcpiTableInstance,

View File

@ -784,7 +784,7 @@ BOpt_GetLegacyOptions (
sizeof (DescString), sizeof (DescString),
DescString DescString
); );
NewLegacyDevContext->Description = AllocateCopyPool (StrSize (DescString), DescString); NewLegacyDevContext->Description = AllocateCopyPool(StrSize (DescString), DescString);
if (NULL == NewLegacyDevContext->Description) { if (NULL == NewLegacyDevContext->Description) {
break; break;
} }

View File

@ -180,7 +180,7 @@ BootThisFile (
Option = (BDS_COMMON_OPTION *) AllocatePool (sizeof (BDS_COMMON_OPTION)); Option = (BDS_COMMON_OPTION *) AllocatePool (sizeof (BDS_COMMON_OPTION));
ASSERT (Option != NULL); ASSERT (Option != NULL);
Option->Description = (CHAR16 *) AllocateCopyPool (StrSize (FileContext->FileName), FileContext->FileName); Option->Description = (CHAR16 *) AllocateCopyPool(StrSize (FileContext->FileName), FileContext->FileName);
Option->DevicePath = FileContext->DevicePath; Option->DevicePath = FileContext->DevicePath;
Option->LoadOptionsSize = 0; Option->LoadOptionsSize = 0;
Option->LoadOptions = NULL; Option->LoadOptions = NULL;

View File

@ -318,7 +318,7 @@ ExtractDisplayedHiiFormFromHiiHandle (
if (CompareGuid (SetupClassGuid, ClassGuid)) { if (CompareGuid (SetupClassGuid, ClassGuid)) {
CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID)); CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID)); CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
*FormSetGuid = AllocateCopyPool (sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid); *FormSetGuid = AllocateCopyPool(sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid);
ASSERT (*FormSetGuid != NULL); ASSERT (*FormSetGuid != NULL);
FreePool(HiiPackageList); FreePool(HiiPackageList);
return TRUE; return TRUE;
@ -328,7 +328,7 @@ ExtractDisplayedHiiFormFromHiiHandle (
} else { } else {
CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID)); CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID)); CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
*FormSetGuid = AllocateCopyPool (sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid); *FormSetGuid = AllocateCopyPool(sizeof (EFI_GUID), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid);
ASSERT (*FormSetGuid != NULL); ASSERT (*FormSetGuid != NULL);
FreePool(HiiPackageList); FreePool(HiiPackageList);
return TRUE; return TRUE;
@ -479,7 +479,7 @@ AddIdToMacDeviceList (
} else { } else {
mMacDeviceList.MaxListLen += MAX_MAC_ADDRESS_NODE_LIST_LEN; mMacDeviceList.MaxListLen += MAX_MAC_ADDRESS_NODE_LIST_LEN;
if (mMacDeviceList.CurListLen != 0) { if (mMacDeviceList.CurListLen != 0) {
TempDeviceList = (MENU_INFO_ITEM *)AllocateCopyPool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen, (VOID *)mMacDeviceList.NodeList); TempDeviceList = (MENU_INFO_ITEM *)AllocateCopyPool(sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen, (VOID *)mMacDeviceList.NodeList);
} else { } else {
TempDeviceList = (MENU_INFO_ITEM *)AllocatePool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen); TempDeviceList = (MENU_INFO_ITEM *)AllocatePool (sizeof (MENU_INFO_ITEM) * mMacDeviceList.MaxListLen);
} }

View File

@ -414,7 +414,7 @@ InitializeFrontPage (
if (mLanguageString == NULL){ if (mLanguageString == NULL){
mLanguageString = GetEfiGlobalVariable (L"PlatformLangCodes"); mLanguageString = GetEfiGlobalVariable (L"PlatformLangCodes");
if (mLanguageString == NULL) { if (mLanguageString == NULL) {
mLanguageString = AllocateCopyPool ( mLanguageString = AllocateCopyPool(
AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)), AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),
(CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes) (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)
); );

View File

@ -630,7 +630,7 @@ HotkeyInsertList (
// //
// Need an extra hotkey for shift key on right // Need an extra hotkey for shift key on right
// //
HotkeyRight = AllocateCopyPool (sizeof (BDS_HOTKEY_OPTION), HotkeyLeft); HotkeyRight = AllocateCopyPool(sizeof (BDS_HOTKEY_OPTION), HotkeyLeft);
if (HotkeyRight == NULL) { if (HotkeyRight == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -423,7 +423,7 @@ DxeMain (
VectorInfo ++; VectorInfo ++;
Index ++; Index ++;
} }
VectorInfo = AllocateCopyPool (sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList); VectorInfo = AllocateCopyPool(sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList);
// ASSERT (VectorInfo != NULL); // ASSERT (VectorInfo != NULL);
if (!VectorInfo) return; if (!VectorInfo) return;
Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo); Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo);

View File

@ -642,7 +642,7 @@ NotifyFwVolBlock (
// //
// No FwVol protocol on the handle so create a new one // No FwVol protocol on the handle so create a new one
// //
FvDevice = AllocateCopyPool (sizeof (FV_DEVICE), &mFvDevice); FvDevice = AllocateCopyPool(sizeof (FV_DEVICE), &mFvDevice);
if (FvDevice == NULL) { if (FvDevice == NULL) {
return; return;
} }

View File

@ -502,7 +502,7 @@ ProduceFVBProtocolOnBuffer (
// //
// Allocate EFI_FW_VOL_BLOCK_DEVICE // Allocate EFI_FW_VOL_BLOCK_DEVICE
// //
FvbDev = AllocateCopyPool (sizeof (EFI_FW_VOL_BLOCK_DEVICE), &mFwVolBlock); FvbDev = AllocateCopyPool(sizeof (EFI_FW_VOL_BLOCK_DEVICE), &mFwVolBlock);
if (FvbDev == NULL) { if (FvbDev == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -555,7 +555,7 @@ ProduceFVBProtocolOnBuffer (
// //
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH // FV does not contains extension header, then produce MEMMAP_DEVICE_PATH
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool(sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool(FvbDev); FreePool(FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -566,7 +566,7 @@ ProduceFVBProtocolOnBuffer (
// //
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH // FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool(sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool(FvbDev); FreePool(FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -2306,7 +2306,7 @@ CoreInitializeGcdServices (
// //
// Initialize the GCD Memory Space Map // Initialize the GCD Memory Space Map
// //
Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate); Entry = AllocateCopyPool(sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate);
// ASSERT (Entry != NULL); // ASSERT (Entry != NULL);
if (!Entry) { if (!Entry) {
return EFI_NOT_AVAILABLE_YET; return EFI_NOT_AVAILABLE_YET;
@ -2321,7 +2321,7 @@ CoreInitializeGcdServices (
// //
// Initialize the GCD I/O Space Map // Initialize the GCD I/O Space Map
// //
Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate); Entry = AllocateCopyPool(sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate);
// ASSERT (Entry != NULL); // ASSERT (Entry != NULL);
if (!Entry) { if (!Entry) {
return EFI_NOT_AVAILABLE_YET; return EFI_NOT_AVAILABLE_YET;
@ -2466,7 +2466,7 @@ CoreInitializeGcdServices (
// //
// Relocate HOB List to an allocated pool buffer. // Relocate HOB List to an allocated pool buffer.
// //
NewHobList = AllocateCopyPool ( NewHobList = AllocateCopyPool(
(UINTN)PhitHob->EfiFreeMemoryBottom - (UINTN)(*HobStart), (UINTN)PhitHob->EfiFreeMemoryBottom - (UINTN)(*HobStart),
*HobStart *HobStart
); );

View File

@ -1162,7 +1162,7 @@ InitInterruptDescriptorTable (
// //
// Save original IDT entry and IDT entry count. // Save original IDT entry and IDT entry count.
// //
mOrigIdtEntry = AllocateCopyPool (OldIdtPtr.Limit + 1, (VOID *) OldIdtPtr.Base); mOrigIdtEntry = AllocateCopyPool(OldIdtPtr.Limit + 1, (VOID *) OldIdtPtr.Base);
// ASSERT (mOrigIdtEntry != NULL); // ASSERT (mOrigIdtEntry != NULL);
mOrigIdtEntryCount = (UINT16) OldIdtSize; mOrigIdtEntryCount = (UINT16) OldIdtSize;
} else { } else {

View File

@ -453,7 +453,7 @@
</dict> </dict>
<dict> <dict>
<key>Comment</key> <key>Comment</key>
<string>Lapci panic patch example</string> <string>Lapic panic patch example</string>
<key>MatchOS</key> <key>MatchOS</key>
<string>All</string> <string>All</string>
<key>Disabled</key> <key>Disabled</key>
@ -473,6 +473,26 @@
<key>RangeFind</key> <key>RangeFind</key>
<integer>200</integer> <integer>200</integer>
</dict> </dict>
<dict>
<key>Comment</key>
<string>Symbolic patch example got lapic panic</string>
<key>MatchOS</key>
<string>All</string>
<key>Disabled</key>
<true/>
<key>Procedure</key>
<string>_lapic_interrupt</string>
<key>Find</key>
<data>6AAA//+DAAAAAAAA</data>
<key>MaskFind</key>
<data>/wAA////AAAAAP//</data>
<key>Replace</key>
<data>6AAA//8xwJCQkJCQ</data>
<key>MaskReplace</key>
<data>/wAA////////////</data>
<key>RangeFind</key>
<integer>200</integer>
</dict>
</array> </array>
<key>#ForceKextsToLoad</key> <key>#ForceKextsToLoad</key>
<array> <array>

View File

@ -751,7 +751,7 @@ AtaAtapiPassThruStart (
// //
// Allocate a buffer to store the ATA_ATAPI_PASS_THRU_INSTANCE data structure // Allocate a buffer to store the ATA_ATAPI_PASS_THRU_INSTANCE data structure
// //
Instance = AllocateCopyPool (sizeof (ATA_ATAPI_PASS_THRU_INSTANCE), &gAtaAtapiPassThruInstanceTemplate); Instance = AllocateCopyPool(sizeof (ATA_ATAPI_PASS_THRU_INSTANCE), &gAtaAtapiPassThruInstanceTemplate);
if (Instance == NULL) { if (Instance == NULL) {
goto ErrorExit; goto ErrorExit;
} }
@ -1076,7 +1076,7 @@ CreateNewDeviceInfo (
// DBG(L"Creating DeviceInfo for Chan=%d dev=%d type=%a\n", Port, PortMultiplier, DeviceType == EfiIdeCdrom ? "cdrom " : "harddisk"); // DBG(L"Creating DeviceInfo for Chan=%d dev=%d type=%a\n", Port, PortMultiplier, DeviceType == EfiIdeCdrom ? "cdrom " : "harddisk");
if (IdentifyData != NULL) { if (IdentifyData != NULL) {
// DBG(L" IdentifyData copied\n"); // DBG(L" IdentifyData copied\n");
DeviceInfo->IdentifyData = AllocateCopyPool (sizeof (EFI_IDENTIFY_DATA), IdentifyData); DeviceInfo->IdentifyData = AllocateCopyPool(sizeof (EFI_IDENTIFY_DATA), IdentifyData);
if (DeviceInfo->IdentifyData == NULL) { if (DeviceInfo->IdentifyData == NULL) {
FreePool(DeviceInfo); FreePool(DeviceInfo);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -1672,7 +1672,7 @@ AtaPassThruBuildDevicePath (
} }
if (Instance->Mode == EfiAtaIdeMode) { if (Instance->Mode == EfiAtaIdeMode) {
DevicePathNode = AllocateCopyPool (sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -1680,7 +1680,7 @@ AtaPassThruBuildDevicePath (
DevicePathNode->Atapi.SlaveMaster = (UINT8) PortMultiplierPort; DevicePathNode->Atapi.SlaveMaster = (UINT8) PortMultiplierPort;
DevicePathNode->Atapi.Lun = 0; DevicePathNode->Atapi.Lun = 0;
} else { } else {
DevicePathNode = AllocateCopyPool (sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2338,7 +2338,7 @@ ExtScsiPassThruBuildDevicePath (
} }
if (Instance->Mode == EfiAtaIdeMode) { if (Instance->Mode == EfiAtaIdeMode) {
DevicePathNode = AllocateCopyPool (sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2347,7 +2347,7 @@ ExtScsiPassThruBuildDevicePath (
DevicePathNode->Atapi.SlaveMaster = PortMultiplier; DevicePathNode->Atapi.SlaveMaster = PortMultiplier;
DevicePathNode->Atapi.Lun = (UINT16) Lun; DevicePathNode->Atapi.Lun = (UINT16) Lun;
} else { } else {
DevicePathNode = AllocateCopyPool (sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -380,7 +380,7 @@ RegisterAtaDevice (
// //
// Allocate ATA device from the template. // Allocate ATA device from the template.
// //
AtaDevice = AllocateCopyPool (sizeof (ATA_DEVICE), &gAtaDeviceTemplate); AtaDevice = AllocateCopyPool(sizeof (ATA_DEVICE), &gAtaDeviceTemplate);
if (AtaDevice == NULL) { if (AtaDevice == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;

View File

@ -152,7 +152,7 @@ AtaDevicePassThru (
} }
CopyMem (Packet->Asb, AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK)); CopyMem (Packet->Asb, AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK));
Packet->Acb = AllocateCopyPool (sizeof (EFI_ATA_COMMAND_BLOCK), &AtaDevice->Acb); Packet->Acb = AllocateCopyPool(sizeof (EFI_ATA_COMMAND_BLOCK), &AtaDevice->Acb);
} else { } else {
Packet = &AtaDevice->Packet; Packet = &AtaDevice->Packet;
Packet->Asb = AtaDevice->Asb; Packet->Asb = AtaDevice->Asb;

View File

@ -537,7 +537,7 @@ SerialControllerDriverStart (
// //
// Initialize the serial device instance // Initialize the serial device instance
// //
SerialDevice = AllocateCopyPool (sizeof (SERIAL_DEV), &gSerialDevTempate); SerialDevice = AllocateCopyPool(sizeof (SERIAL_DEV), &gSerialDevTempate);
if (SerialDevice == NULL) { if (SerialDevice == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Error; goto Error;

View File

@ -668,7 +668,7 @@ SetKeyboardLayoutEvent (
UsbNsKey->Signature = USB_NS_KEY_SIGNATURE; UsbNsKey->Signature = USB_NS_KEY_SIGNATURE;
UsbNsKey->KeyCount = KeyCount; UsbNsKey->KeyCount = KeyCount;
UsbNsKey->NsKey = AllocateCopyPool ( UsbNsKey->NsKey = AllocateCopyPool(
(KeyCount + 1) * sizeof (EFI_KEY_DESCRIPTOR), (KeyCount + 1) * sizeof (EFI_KEY_DESCRIPTOR),
KeyDescriptor KeyDescriptor
); );

View File

@ -360,7 +360,7 @@ Returns:
); );
} }
DirEnt->FileString = AllocateCopyPool (StrSize (LfnBuffer), LfnBuffer); DirEnt->FileString = AllocateCopyPool(StrSize (LfnBuffer), LfnBuffer);
} }
STATIC STATIC
@ -1203,7 +1203,7 @@ Returns:
} }
DirEnt->Signature = FAT_DIRENT_SIGNATURE; DirEnt->Signature = FAT_DIRENT_SIGNATURE;
DirEnt->FileString = AllocateCopyPool (StrSize (FileName), FileName); DirEnt->FileString = AllocateCopyPool(StrSize (FileName), FileName);
if (DirEnt->FileString == NULL) { if (DirEnt->FileString == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;

View File

@ -1630,7 +1630,7 @@ BiosVideoCheckForVbe (
// Set EDID Discovered Data // Set EDID Discovered Data
// //
BiosVideoPrivate->EdidDiscovered.SizeOfEdid = VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE; BiosVideoPrivate->EdidDiscovered.SizeOfEdid = VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE;
BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool ( BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool(
VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE, VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE,
BiosVideoPrivate->VbeEdidDataBlock BiosVideoPrivate->VbeEdidDataBlock
); );
@ -1662,7 +1662,7 @@ BiosVideoCheckForVbe (
// Copy EDID Override Data to EDID Active Data // Copy EDID Override Data to EDID Active Data
// //
BiosVideoPrivate->EdidActive.SizeOfEdid = (UINT32) EdidActiveDataSize; BiosVideoPrivate->EdidActive.SizeOfEdid = (UINT32) EdidActiveDataSize;
BiosVideoPrivate->EdidActive.Edid = (UINT8 *) AllocateCopyPool ( BiosVideoPrivate->EdidActive.Edid = (UINT8 *) AllocateCopyPool(
EdidActiveDataSize, EdidActiveDataSize,
EdidActiveDataBlock EdidActiveDataBlock
); );

View File

@ -1635,7 +1635,7 @@ BiosVideoCheckForVbe (
// Set EDID Discovered Data // Set EDID Discovered Data
// //
BiosVideoPrivate->EdidDiscovered.SizeOfEdid = VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE; BiosVideoPrivate->EdidDiscovered.SizeOfEdid = VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE;
BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool ( BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool(
VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE, VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE,
BiosVideoPrivate->VbeEdidDataBlock BiosVideoPrivate->VbeEdidDataBlock
); );
@ -1667,7 +1667,7 @@ BiosVideoCheckForVbe (
// Copy EDID Override Data to EDID Active Data // Copy EDID Override Data to EDID Active Data
// //
BiosVideoPrivate->EdidActive.SizeOfEdid = (UINT32) EdidActiveDataSize; BiosVideoPrivate->EdidActive.SizeOfEdid = (UINT32) EdidActiveDataSize;
BiosVideoPrivate->EdidActive.Edid = (UINT8 *) AllocateCopyPool ( BiosVideoPrivate->EdidActive.Edid = (UINT8 *) AllocateCopyPool(
EdidActiveDataSize, EdidActiveDataSize,
EdidActiveDataBlock EdidActiveDataBlock
); );

View File

@ -700,7 +700,7 @@ BdsLibVariableToOption (
} }
Option->Signature = BDS_LOAD_OPTION_SIGNATURE; Option->Signature = BDS_LOAD_OPTION_SIGNATURE;
Option->DevicePath = AllocateCopyPool (GetDevicePathSize (DevicePath), DevicePath); Option->DevicePath = AllocateCopyPool(GetDevicePathSize (DevicePath), DevicePath);
// ASSERT(Option->DevicePath != NULL); // ASSERT(Option->DevicePath != NULL);
if (!Option->DevicePath) { if (!Option->DevicePath) {
FreePool(Option); FreePool(Option);
@ -709,7 +709,7 @@ BdsLibVariableToOption (
// CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath)); // CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath));
Option->Attribute = Attribute; Option->Attribute = Attribute;
Option->Description = AllocateCopyPool (StrSize (Description), Description); Option->Description = AllocateCopyPool(StrSize (Description), Description);
// ASSERT(Option->Description != NULL); // ASSERT(Option->Description != NULL);
if (!Option->Description) { if (!Option->Description) {
FreePool(Option); FreePool(Option);
@ -717,7 +717,7 @@ BdsLibVariableToOption (
} }
// CopyMem (Option->Description, Description, StrSize (Description)); // CopyMem (Option->Description, Description, StrSize (Description));
Option->LoadOptions = AllocateCopyPool (LoadOptionsSize, LoadOptions); Option->LoadOptions = AllocateCopyPool(LoadOptionsSize, LoadOptions);
// ASSERT(Option->LoadOptions != NULL); // ASSERT(Option->LoadOptions != NULL);
if (!Option->LoadOptions) { if (!Option->LoadOptions) {
FreePool(Option); FreePool(Option);

View File

@ -264,7 +264,7 @@ UINT8* VideoBiosPatchGetEdid (VOID)
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
DBG(" size=%d", EdidProtocol->SizeOfEdid); DBG(" size=%d", EdidProtocol->SizeOfEdid);
if (EdidProtocol->SizeOfEdid > 0) { if (EdidProtocol->SizeOfEdid > 0) {
Edid = AllocateCopyPool (EdidProtocol->SizeOfEdid, EdidProtocol->Edid); Edid = AllocateCopyPool(EdidProtocol->SizeOfEdid, EdidProtocol->Edid);
} }
} }
DBG(" %a\n", Edid != NULL ? "found" : "not found"); DBG(" %a\n", Edid != NULL ? "found" : "not found");

View File

@ -762,7 +762,7 @@ DumpCapsuleFromDisk (
} }
if ((FileInfo->Attribute & (EFI_FILE_SYSTEM | EFI_FILE_ARCHIVE)) != 0) { if ((FileInfo->Attribute & (EFI_FILE_SYSTEM | EFI_FILE_ARCHIVE)) != 0) {
FileInfoBuffer[Index++] = AllocateCopyPool ((UINTN)FileInfo->Size, FileInfo); FileInfoBuffer[Index++] = AllocateCopyPool((UINTN)FileInfo->Size, FileInfo);
} }
Status = FileHandleFindNextFile (DirHandle, FileInfo, &NoFile); Status = FileHandleFindNextFile (DirHandle, FileInfo, &NoFile);

View File

@ -279,7 +279,7 @@ UiCreateLanguageMenu (
// //
GetEfiGlobalVariable2 (L"PlatformLangCodes", (VOID**)&gLanguageString, NULL); GetEfiGlobalVariable2 (L"PlatformLangCodes", (VOID**)&gLanguageString, NULL);
if (gLanguageString == NULL) { if (gLanguageString == NULL) {
gLanguageString = AllocateCopyPool ( gLanguageString = AllocateCopyPool(
AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)), AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),
(CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes) (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)
); );

View File

@ -1600,7 +1600,7 @@ CreateNewDevice (
} }
if (IdentifyData != NULL) { if (IdentifyData != NULL) {
DeviceData->IdentifyData = AllocateCopyPool (sizeof (ATA_IDENTIFY_DATA), IdentifyData); DeviceData->IdentifyData = AllocateCopyPool(sizeof (ATA_IDENTIFY_DATA), IdentifyData);
if (DeviceData->IdentifyData == NULL) { if (DeviceData->IdentifyData == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -504,7 +504,7 @@ AhciAtaPassThruGetDevicePath (
Private = GET_AHCI_PEIM_HC_PRIVATE_DATA_FROM_THIS_PASS_THRU (This); Private = GET_AHCI_PEIM_HC_PRIVATE_DATA_FROM_THIS_PASS_THRU (This);
*DevicePathLength = Private->DevicePathLength; *DevicePathLength = Private->DevicePathLength;
*DevicePath = AllocateCopyPool (Private->DevicePathLength, Private->DevicePath); *DevicePath = AllocateCopyPool(Private->DevicePathLength, Private->DevicePath);
if (*DevicePath == NULL) { if (*DevicePath == NULL) {
*DevicePathLength = 0; *DevicePathLength = 0;
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -753,7 +753,7 @@ AtaAtapiPassThruStart (
// //
// Allocate a buffer to store the ATA_ATAPI_PASS_THRU_INSTANCE data structure // Allocate a buffer to store the ATA_ATAPI_PASS_THRU_INSTANCE data structure
// //
Instance = AllocateCopyPool (sizeof (ATA_ATAPI_PASS_THRU_INSTANCE), &gAtaAtapiPassThruInstanceTemplate); Instance = AllocateCopyPool(sizeof (ATA_ATAPI_PASS_THRU_INSTANCE), &gAtaAtapiPassThruInstanceTemplate);
if (Instance == NULL) { if (Instance == NULL) {
goto ErrorExit; goto ErrorExit;
} }
@ -1077,7 +1077,7 @@ CreateNewDeviceInfo (
DeviceInfo->Type = DeviceType; DeviceInfo->Type = DeviceType;
if (IdentifyData != NULL) { if (IdentifyData != NULL) {
DeviceInfo->IdentifyData = AllocateCopyPool (sizeof (EFI_IDENTIFY_DATA), IdentifyData); DeviceInfo->IdentifyData = AllocateCopyPool(sizeof (EFI_IDENTIFY_DATA), IdentifyData);
if (DeviceInfo->IdentifyData == NULL) { if (DeviceInfo->IdentifyData == NULL) {
FreePool(DeviceInfo); FreePool(DeviceInfo);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -1675,7 +1675,7 @@ AtaPassThruBuildDevicePath (
} }
if (Instance->Mode == EfiAtaIdeMode) { if (Instance->Mode == EfiAtaIdeMode) {
DevicePathNode = AllocateCopyPool (sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -1683,7 +1683,7 @@ AtaPassThruBuildDevicePath (
DevicePathNode->Atapi.SlaveMaster = (UINT8) PortMultiplierPort; DevicePathNode->Atapi.SlaveMaster = (UINT8) PortMultiplierPort;
DevicePathNode->Atapi.Lun = 0; DevicePathNode->Atapi.Lun = 0;
} else { } else {
DevicePathNode = AllocateCopyPool (sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2332,7 +2332,7 @@ ExtScsiPassThruBuildDevicePath (
} }
if (Instance->Mode == EfiAtaIdeMode) { if (Instance->Mode == EfiAtaIdeMode) {
DevicePathNode = AllocateCopyPool (sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (ATAPI_DEVICE_PATH), &mAtapiDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2341,7 +2341,7 @@ ExtScsiPassThruBuildDevicePath (
DevicePathNode->Atapi.SlaveMaster = PortMultiplier; DevicePathNode->Atapi.SlaveMaster = PortMultiplier;
DevicePathNode->Atapi.Lun = (UINT16) Lun; DevicePathNode->Atapi.Lun = (UINT16) Lun;
} else { } else {
DevicePathNode = AllocateCopyPool (sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (SATA_DEVICE_PATH), &mSataDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -255,7 +255,7 @@ RegisterAtaDevice (
// //
// Allocate ATA device from the template. // Allocate ATA device from the template.
// //
AtaDevice = AllocateCopyPool (sizeof (ATA_DEVICE), &gAtaDeviceTemplate); AtaDevice = AllocateCopyPool(sizeof (ATA_DEVICE), &gAtaDeviceTemplate);
if (AtaDevice == NULL) { if (AtaDevice == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;

View File

@ -133,7 +133,7 @@ AtaDevicePassThru (
} }
CopyMem (Packet->Asb, AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK)); CopyMem (Packet->Asb, AtaDevice->Asb, sizeof (EFI_ATA_STATUS_BLOCK));
Packet->Acb = AllocateCopyPool (sizeof (EFI_ATA_COMMAND_BLOCK), &AtaDevice->Acb); Packet->Acb = AllocateCopyPool(sizeof (EFI_ATA_COMMAND_BLOCK), &AtaDevice->Acb);
} else { } else {
Packet = &AtaDevice->Packet; Packet = &AtaDevice->Packet;
Packet->Asb = AtaDevice->Asb; Packet->Asb = AtaDevice->Asb;

View File

@ -967,7 +967,7 @@ RegisterI2cDevice (
// Build the device context for current I2C device. // Build the device context for current I2C device.
// //
I2cDeviceContext = NULL; I2cDeviceContext = NULL;
I2cDeviceContext = AllocateCopyPool (sizeof (I2C_DEVICE_CONTEXT), &gI2cDeviceContextTemplate); I2cDeviceContext = AllocateCopyPool(sizeof (I2C_DEVICE_CONTEXT), &gI2cDeviceContextTemplate);
ASSERT (I2cDeviceContext != NULL); ASSERT (I2cDeviceContext != NULL);
if (I2cDeviceContext == NULL) { if (I2cDeviceContext == NULL) {
continue; continue;

View File

@ -130,7 +130,7 @@ IsaBusCreateChild (
Private = ISA_BUS_PRIVATE_DATA_FROM_THIS (This); Private = ISA_BUS_PRIVATE_DATA_FROM_THIS (This);
Child = AllocateCopyPool (sizeof (mIsaBusChildPrivateTemplate), &mIsaBusChildPrivateTemplate); Child = AllocateCopyPool(sizeof (mIsaBusChildPrivateTemplate), &mIsaBusChildPrivateTemplate);
if (Child == NULL) { if (Child == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -317,7 +317,7 @@ IsaBusDriverBindingStart (
return Status; return Status;
} }
Private = AllocateCopyPool (sizeof (mIsaBusPrivateTemplate), &mIsaBusPrivateTemplate); Private = AllocateCopyPool(sizeof (mIsaBusPrivateTemplate), &mIsaBusPrivateTemplate);
ASSERT (Private != NULL); ASSERT (Private != NULL);
Private->IsaHcHandle = Controller; Private->IsaHcHandle = Controller;

View File

@ -657,7 +657,7 @@ NvmePassThruGetDevicePath (
Private = GET_NVME_PEIM_HC_PRIVATE_DATA_FROM_THIS_NVME_PASSTHRU (This); Private = GET_NVME_PEIM_HC_PRIVATE_DATA_FROM_THIS_NVME_PASSTHRU (This);
*DevicePathLength = Private->DevicePathLength; *DevicePathLength = Private->DevicePathLength;
*DevicePath = AllocateCopyPool (Private->DevicePathLength, Private->DevicePath); *DevicePath = AllocateCopyPool(Private->DevicePathLength, Private->DevicePath);
if (*DevicePath == NULL) { if (*DevicePath == NULL) {
*DevicePathLength = 0; *DevicePathLength = 0;
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -445,7 +445,7 @@ CreateSerialDevice (
// //
// Initialize the serial device instance // Initialize the serial device instance
// //
SerialDevice = AllocateCopyPool (sizeof (SERIAL_DEV), &gSerialDevTemplate); SerialDevice = AllocateCopyPool(sizeof (SERIAL_DEV), &gSerialDevTemplate);
ASSERT (SerialDevice != NULL); ASSERT (SerialDevice != NULL);
SerialDevice->SerialIo.Mode = &(SerialDevice->SerialMode); SerialDevice->SerialIo.Mode = &(SerialDevice->SerialMode);

View File

@ -593,7 +593,7 @@ SdMmcPciHcDriverBindingStart (
goto Done; goto Done;
} }
Private = AllocateCopyPool (sizeof (SD_MMC_HC_PRIVATE_DATA), &gSdMmcPciHcTemplate); Private = AllocateCopyPool(sizeof (SD_MMC_HC_PRIVATE_DATA), &gSdMmcPciHcTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;
@ -1224,7 +1224,7 @@ SdMmcPassThruBuildDevicePath (
} }
if (Private->Slot[Slot].CardType == SdCardType) { if (Private->Slot[Slot].CardType == SdCardType) {
SdNode = AllocateCopyPool (sizeof (SD_DEVICE_PATH), &mSdDpTemplate); SdNode = AllocateCopyPool(sizeof (SD_DEVICE_PATH), &mSdDpTemplate);
if (SdNode == NULL) { if (SdNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -1232,7 +1232,7 @@ SdMmcPassThruBuildDevicePath (
*DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) SdNode; *DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) SdNode;
} else if (Private->Slot[Slot].CardType == EmmcCardType) { } else if (Private->Slot[Slot].CardType == EmmcCardType) {
EmmcNode = AllocateCopyPool (sizeof (EMMC_DEVICE_PATH), &mEmmcDpTemplate); EmmcNode = AllocateCopyPool(sizeof (EMMC_DEVICE_PATH), &mEmmcDpTemplate);
if (EmmcNode == NULL) { if (EmmcNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -589,7 +589,7 @@ UfsHcDriverBindingStart (
return Status; return Status;
} }
Private = AllocateCopyPool (sizeof (UFS_HOST_CONTROLLER_PRIVATE_DATA), &gUfsHcTemplate); Private = AllocateCopyPool(sizeof (UFS_HOST_CONTROLLER_PRIVATE_DATA), &gUfsHcTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;

View File

@ -719,7 +719,7 @@ InitializeEmmcBlockIoPeim (
continue; continue;
} }
Private = AllocateCopyPool (sizeof (EMMC_PEIM_HC_PRIVATE_DATA), &gEmmcHcPrivateTemplate); Private = AllocateCopyPool(sizeof (EMMC_PEIM_HC_PRIVATE_DATA), &gEmmcHcPrivateTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
break; break;

View File

@ -566,7 +566,7 @@ InitializeSdBlockIoPeim (
continue; continue;
} }
Private = AllocateCopyPool (sizeof (SD_PEIM_HC_PRIVATE_DATA), &gSdHcPrivateTemplate); Private = AllocateCopyPool(sizeof (SD_PEIM_HC_PRIVATE_DATA), &gSdHcPrivateTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
break; break;

View File

@ -338,7 +338,7 @@ DiscoverSdDevice (
// //
// Allocate buffer to store SD_DEVICE private data. // Allocate buffer to store SD_DEVICE private data.
// //
Device = AllocateCopyPool (sizeof (SD_DEVICE), &mSdDeviceTemplate); Device = AllocateCopyPool(sizeof (SD_DEVICE), &mSdDeviceTemplate);
if (Device == NULL) { if (Device == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Error; goto Error;

View File

@ -1073,7 +1073,7 @@ InitializeUfsBlockIoPeim (
break; break;
} }
Private = AllocateCopyPool (sizeof (UFS_PEIM_HC_PRIVATE_DATA), &gUfsHcPeimTemplate); Private = AllocateCopyPool(sizeof (UFS_PEIM_HC_PRIVATE_DATA), &gUfsHcPeimTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
break; break;

View File

@ -420,7 +420,7 @@ UfsPassThruBuildDevicePath (
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
DevicePathNode = AllocateCopyPool (sizeof (UFS_DEVICE_PATH), &mUfsDevicePathTemplate); DevicePathNode = AllocateCopyPool(sizeof (UFS_DEVICE_PATH), &mUfsDevicePathTemplate);
if (DevicePathNode == NULL) { if (DevicePathNode == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -857,7 +857,7 @@ UfsPassThruDriverBindingStart (
// //
// Initialize Ufs Pass Thru private data for managed UFS Host Controller. // Initialize Ufs Pass Thru private data for managed UFS Host Controller.
// //
Private = AllocateCopyPool (sizeof (UFS_PASS_THRU_PRIVATE_DATA), &gUfsPassThruTemplate); Private = AllocateCopyPool(sizeof (UFS_PASS_THRU_PRIVATE_DATA), &gUfsPassThruTemplate);
if (Private == NULL) { if (Private == NULL) {
DEBUG ((DEBUG_ERROR, "Unable to allocate Ufs Pass Thru private data\n")); DEBUG ((DEBUG_ERROR, "Unable to allocate Ufs Pass Thru private data\n"));
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;

View File

@ -660,7 +660,7 @@ SetKeyboardLayoutEvent (
UsbNsKey->Signature = USB_NS_KEY_SIGNATURE; UsbNsKey->Signature = USB_NS_KEY_SIGNATURE;
UsbNsKey->KeyCount = KeyCount; UsbNsKey->KeyCount = KeyCount;
UsbNsKey->NsKey = AllocateCopyPool ( UsbNsKey->NsKey = AllocateCopyPool(
(KeyCount + 1) * sizeof (EFI_KEY_DESCRIPTOR), (KeyCount + 1) * sizeof (EFI_KEY_DESCRIPTOR),
KeyDescriptor KeyDescriptor
); );

View File

@ -440,7 +440,7 @@ DxeMain (
VectorInfo ++; VectorInfo ++;
Index ++; Index ++;
} }
VectorInfo = AllocateCopyPool (sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList); VectorInfo = AllocateCopyPool(sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList);
ASSERT (VectorInfo != NULL); ASSERT (VectorInfo != NULL);
Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo); Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo);
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);

View File

@ -488,7 +488,7 @@ FvCheck (
// And then, the cached file buffer can be also used for FvReadFile. // And then, the cached file buffer can be also used for FvReadFile.
// //
WholeFileSize = IS_FFS_FILE2 (CacheFfsHeader) ? FFS_FILE2_SIZE (CacheFfsHeader): FFS_FILE_SIZE (CacheFfsHeader); WholeFileSize = IS_FFS_FILE2 (CacheFfsHeader) ? FFS_FILE2_SIZE (CacheFfsHeader): FFS_FILE_SIZE (CacheFfsHeader);
CacheFfsHeader = AllocateCopyPool (WholeFileSize, CacheFfsHeader); CacheFfsHeader = AllocateCopyPool(WholeFileSize, CacheFfsHeader);
if (CacheFfsHeader == NULL) { if (CacheFfsHeader == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;
@ -658,7 +658,7 @@ NotifyFwVolBlock (
// //
// No FwVol protocol on the handle so create a new one // No FwVol protocol on the handle so create a new one
// //
FvDevice = AllocateCopyPool (sizeof (FV_DEVICE), &mFvDevice); FvDevice = AllocateCopyPool(sizeof (FV_DEVICE), &mFvDevice);
if (FvDevice == NULL) { if (FvDevice == NULL) {
return; return;
} }

View File

@ -329,7 +329,7 @@ FvReadFile (
// Cache FFS file to memory buffer. // Cache FFS file to memory buffer.
// //
WholeFileSize = IS_FFS_FILE2 (FfsHeader) ? FFS_FILE2_SIZE (FfsHeader): FFS_FILE_SIZE (FfsHeader); WholeFileSize = IS_FFS_FILE2 (FfsHeader) ? FFS_FILE2_SIZE (FfsHeader): FFS_FILE_SIZE (FfsHeader);
FfsHeader = AllocateCopyPool (WholeFileSize, FfsHeader); FfsHeader = AllocateCopyPool(WholeFileSize, FfsHeader);
if (FfsHeader == NULL) { if (FfsHeader == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -503,7 +503,7 @@ ProduceFVBProtocolOnBuffer (
// //
// Allocate EFI_FW_VOL_BLOCK_DEVICE // Allocate EFI_FW_VOL_BLOCK_DEVICE
// //
FvbDev = AllocateCopyPool (sizeof (EFI_FW_VOL_BLOCK_DEVICE), &mFwVolBlock); FvbDev = AllocateCopyPool(sizeof (EFI_FW_VOL_BLOCK_DEVICE), &mFwVolBlock);
if (FvbDev == NULL) { if (FvbDev == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -559,7 +559,7 @@ ProduceFVBProtocolOnBuffer (
// //
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH // FV does not contains extension header, then produce MEMMAP_DEVICE_PATH
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool(sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool(FvbDev); FreePool(FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -570,7 +570,7 @@ ProduceFVBProtocolOnBuffer (
// //
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH // FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH
// //
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool(sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
if (FvbDev->DevicePath == NULL) { if (FvbDev->DevicePath == NULL) {
FreePool(FvbDev); FreePool(FvbDev);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -2426,7 +2426,7 @@ CoreInitializeGcdServices (
// //
// Initialize the GCD Memory Space Map // Initialize the GCD Memory Space Map
// //
Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate); Entry = AllocateCopyPool(sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate);
ASSERT (Entry != NULL); ASSERT (Entry != NULL);
Entry->EndAddress = LShiftU64 (1, SizeOfMemorySpace) - 1; Entry->EndAddress = LShiftU64 (1, SizeOfMemorySpace) - 1;
@ -2438,7 +2438,7 @@ CoreInitializeGcdServices (
// //
// Initialize the GCD I/O Space Map // Initialize the GCD I/O Space Map
// //
Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate); Entry = AllocateCopyPool(sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate);
ASSERT (Entry != NULL); ASSERT (Entry != NULL);
Entry->EndAddress = LShiftU64 (1, SizeOfIoSpace) - 1; Entry->EndAddress = LShiftU64 (1, SizeOfIoSpace) - 1;
@ -2643,7 +2643,7 @@ CoreInitializeGcdServices (
// because the memory resource found in CoreInitializeMemoryServices() // because the memory resource found in CoreInitializeMemoryServices()
// may have not enough remaining resource for HOB List. // may have not enough remaining resource for HOB List.
// //
NewHobList = AllocateCopyPool ( NewHobList = AllocateCopyPool(
(UINTN) PhitHob->EfiFreeMemoryBottom - (UINTN) (*HobStart), (UINTN) PhitHob->EfiFreeMemoryBottom - (UINTN) (*HobStart),
*HobStart *HobStart
); );

View File

@ -606,7 +606,7 @@ MemoryProfileInit (
mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_ENABLE; mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_ENABLE;
} }
mMemoryProfileDriverPathSize = PcdGetSize (PcdMemoryProfileDriverPath); mMemoryProfileDriverPathSize = PcdGetSize (PcdMemoryProfileDriverPath);
mMemoryProfileDriverPath = AllocateCopyPool (mMemoryProfileDriverPathSize, PcdGetPtr (PcdMemoryProfileDriverPath)); mMemoryProfileDriverPath = AllocateCopyPool(mMemoryProfileDriverPathSize, PcdGetPtr (PcdMemoryProfileDriverPath));
mMemoryProfileContextPtr = &mMemoryProfileContext; mMemoryProfileContextPtr = &mMemoryProfileContext;
RegisterDxeCore (HobStart, &mMemoryProfileContext); RegisterDxeCore (HobStart, &mMemoryProfileContext);

View File

@ -179,7 +179,7 @@ AddImageStruct(
mImageStruct[mImageStructCount].EntryPoint = EntryPoint; mImageStruct[mImageStructCount].EntryPoint = EntryPoint;
if (PdbString != NULL) { if (PdbString != NULL) {
PdbStringSize = AsciiStrSize(PdbString); PdbStringSize = AsciiStrSize(PdbString);
mImageStruct[mImageStructCount].PdbString = AllocateCopyPool (PdbStringSize, PdbString); mImageStruct[mImageStructCount].PdbString = AllocateCopyPool(PdbStringSize, PdbString);
if (mImageStruct[mImageStructCount].PdbString != NULL) { if (mImageStruct[mImageStructCount].PdbString != NULL) {
mImageStruct[mImageStructCount].PdbStringSize = (UINT16) PdbStringSize; mImageStruct[mImageStructCount].PdbStringSize = (UINT16) PdbStringSize;
} }
@ -1215,7 +1215,7 @@ SmiHandlerProfileRegisterHandler (
} else if (CompareGuid (HandlerGuid, &gEfiSmmSwDispatch2ProtocolGuid)) { } else if (CompareGuid (HandlerGuid, &gEfiSmmSwDispatch2ProtocolGuid)) {
SmiHandler->Context = ConvertSmiHandlerSwContext (Context, ContextSize, &SmiHandler->ContextSize); SmiHandler->Context = ConvertSmiHandlerSwContext (Context, ContextSize, &SmiHandler->ContextSize);
} else { } else {
SmiHandler->Context = AllocateCopyPool (ContextSize, Context); SmiHandler->Context = AllocateCopyPool(ContextSize, Context);
} }
} }
if (SmiHandler->Context == NULL) { if (SmiHandler->Context == NULL) {

View File

@ -671,7 +671,7 @@ SmramProfileInit (
mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_ENABLE; mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_ENABLE;
} }
mSmramProfileDriverPathSize = PcdGetSize (PcdMemoryProfileDriverPath); mSmramProfileDriverPathSize = PcdGetSize (PcdMemoryProfileDriverPath);
mSmramProfileDriverPath = AllocateCopyPool (mSmramProfileDriverPathSize, PcdGetPtr (PcdMemoryProfileDriverPath)); mSmramProfileDriverPath = AllocateCopyPool(mSmramProfileDriverPathSize, PcdGetPtr (PcdMemoryProfileDriverPath));
mSmramProfileContextPtr = &mSmramProfileContext; mSmramProfileContextPtr = &mSmramProfileContext;
RegisterSmmCore (&mSmramProfileContext); RegisterSmmCore (&mSmramProfileContext);

View File

@ -381,7 +381,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )

View File

@ -392,7 +392,7 @@ ExtractFileNameFromDevicePath (
} }
Length = StrLen(LastMatch); Length = StrLen(LastMatch);
FileName = AllocateCopyPool ((Length + 1) * sizeof(CHAR16), LastMatch); FileName = AllocateCopyPool((Length + 1) * sizeof(CHAR16), LastMatch);
if (FileName != NULL) { if (FileName != NULL) {
*(FileName + Length) = 0; *(FileName + Length) = 0;
} }

View File

@ -461,7 +461,7 @@ LibGetToken (
String = HiiGetString (HiiHandle, Token, NULL); String = HiiGetString (HiiHandle, Token, NULL);
if (String == NULL) { if (String == NULL) {
String = AllocateCopyPool (StrSize (mLibUnknownString), mLibUnknownString); String = AllocateCopyPool(StrSize (mLibUnknownString), mLibUnknownString);
ASSERT (String != NULL); ASSERT (String != NULL);
} }

View File

@ -67,7 +67,7 @@ ValidateCapsuleNameCapsuleIntegrity (
// If strings are not aligned on a 16-bit boundary, reallocate memory for it. // If strings are not aligned on a 16-bit boundary, reallocate memory for it.
// //
if (((UINTN) CapsuleNameBufStart & BIT0) != 0) { if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize, CapsuleNameBufStart); CapsuleNameBufStart = AllocateCopyPool(CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize, CapsuleNameBufStart);
if (CapsuleNameBufStart == NULL) { if (CapsuleNameBufStart == NULL) {
return NULL; return NULL;
} }
@ -574,7 +574,7 @@ GetEfiSysPartitionFromActiveBootOption(
// Return the OptionNumber of the boot option where EFI system partition is got from // Return the OptionNumber of the boot option where EFI system partition is got from
// //
if (*LoadOptionNumber == NULL) { if (*LoadOptionNumber == NULL) {
*LoadOptionNumber = AllocateCopyPool (sizeof(UINT16), (UINT16 *) &BootOptionBuf[Index].OptionNumber); *LoadOptionNumber = AllocateCopyPool(sizeof(UINT16), (UINT16 *) &BootOptionBuf[Index].OptionNumber);
if (*LoadOptionNumber == NULL) { if (*LoadOptionNumber == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
} }

View File

@ -717,7 +717,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
InternalAllocateCopyPool ( InternalAllocateCopyPool(
IN EFI_MEMORY_TYPE PoolType, IN EFI_MEMORY_TYPE PoolType,
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
@ -754,14 +754,14 @@ InternalAllocateCopyPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiBootServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiBootServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -801,7 +801,7 @@ AllocateRuntimeCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -841,7 +841,7 @@ AllocateReservedCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiReservedMemoryType, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiReservedMemoryType, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),

View File

@ -2468,7 +2468,7 @@ NetLibDetectMedia (
ResetMCastFilters = TRUE; ResetMCastFilters = TRUE;
MCastFilterCount = Snp->Mode->MCastFilterCount; MCastFilterCount = Snp->Mode->MCastFilterCount;
if (MCastFilterCount != 0) { if (MCastFilterCount != 0) {
MCastFilter = AllocateCopyPool ( MCastFilter = AllocateCopyPool(
MCastFilterCount * sizeof (EFI_MAC_ADDRESS), MCastFilterCount * sizeof (EFI_MAC_ADDRESS),
Snp->Mode->MCastFilter Snp->Mode->MCastFilter
); );

View File

@ -648,7 +648,7 @@ LibIsSupportedFileType (
return TRUE; return TRUE;
} }
TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType); TmpStr = AllocateCopyPool(StrSize (InputFileType), InputFileType);
ASSERT(TmpStr != NULL); ASSERT(TmpStr != NULL);
LibToLowerString(TmpStr); LibToLowerString(TmpStr);
@ -964,7 +964,7 @@ LibGetFileHandleFromDevicePath (
*DeviceHandle = Handle; *DeviceHandle = Handle;
if (IsDevicePathEnd(DevicePathNode)) { if (IsDevicePathEnd(DevicePathNode)) {
*ParentFileName = AllocateCopyPool (StrSize (L"\\"), L"\\"); *ParentFileName = AllocateCopyPool(StrSize (L"\\"), L"\\");
*RetFileHandle = FileHandle; *RetFileHandle = FileHandle;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -1009,7 +1009,7 @@ LibGetFileHandleFromDevicePath (
0 0
); );
if (*ParentFileName == NULL) { if (*ParentFileName == NULL) {
*ParentFileName = AllocateCopyPool (StrSize (((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName), ((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName); *ParentFileName = AllocateCopyPool(StrSize (((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName), ((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName);
} else { } else {
TempPath = LibAppendFileName (*ParentFileName, ((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName); TempPath = LibAppendFileName (*ParentFileName, ((FILEPATH_DEVICE_PATH *) DevicePathNode)->PathName);
if (TempPath == NULL) { if (TempPath == NULL) {
@ -1495,7 +1495,7 @@ ChooseFile (
gFileExplorerPrivate.RetDevicePath = NULL; gFileExplorerPrivate.RetDevicePath = NULL;
gFileExplorerPrivate.ChooseHandler = ChooseHandler; gFileExplorerPrivate.ChooseHandler = ChooseHandler;
if (FileType != NULL) { if (FileType != NULL) {
gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), FileType); gFileExplorerPrivate.FileType = AllocateCopyPool(StrSize (FileType), FileType);
ASSERT(gFileExplorerPrivate.FileType != NULL); ASSERT(gFileExplorerPrivate.FileType != NULL);
LibToLowerString(gFileExplorerPrivate.FileType); LibToLowerString(gFileExplorerPrivate.FileType);
} else { } else {

View File

@ -721,7 +721,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
InternalAllocateCopyPool ( InternalAllocateCopyPool(
IN EFI_MEMORY_TYPE PoolType, IN EFI_MEMORY_TYPE PoolType,
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
@ -758,14 +758,14 @@ InternalAllocateCopyPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -805,7 +805,7 @@ AllocateRuntimeCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -1092,7 +1092,7 @@ PiSmmCoreMemoryAllocationLibConstructor (
// Move the SmramRanges data from BootServicesData to SMRAM. // Move the SmramRanges data from BootServicesData to SMRAM.
// //
BootServicesData = mSmmCoreMemoryAllocLibSmramRanges; BootServicesData = mSmmCoreMemoryAllocLibSmramRanges;
mSmmCoreMemoryAllocLibSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocateCopyPool (Size, (VOID *) BootServicesData); mSmmCoreMemoryAllocLibSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocateCopyPool(Size, (VOID *) BootServicesData);
ASSERT (mSmmCoreMemoryAllocLibSmramRanges != NULL); ASSERT (mSmmCoreMemoryAllocLibSmramRanges != NULL);
// //

View File

@ -247,7 +247,7 @@ CreateUserVariableNode (
UserVariableNameNode = AllocateZeroPool (sizeof (*UserVariableNameNode)); UserVariableNameNode = AllocateZeroPool (sizeof (*UserVariableNameNode));
ASSERT (UserVariableNameNode != NULL); ASSERT (UserVariableNameNode != NULL);
UserVariableNameNode->Signature = USER_VARIABLE_NAME_NODE_SIGNATURE; UserVariableNameNode->Signature = USER_VARIABLE_NAME_NODE_SIGNATURE;
UserVariableNameNode->Name = AllocateCopyPool (VarNameSize, VarName); UserVariableNameNode->Name = AllocateCopyPool(VarNameSize, VarName);
UserVariableNameNode->Attributes = Attributes; UserVariableNameNode->Attributes = Attributes;
UserVariableNameNode->DataSize = DataSize; UserVariableNameNode->DataSize = DataSize;
UserVariableNameNode->Index = Index; UserVariableNameNode->Index = Index;

View File

@ -804,7 +804,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
InternalAllocateCopyPool ( InternalAllocateCopyPool(
IN EFI_MEMORY_TYPE PoolType, IN EFI_MEMORY_TYPE PoolType,
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
@ -842,14 +842,14 @@ InternalAllocateCopyPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -890,7 +890,7 @@ AllocateRuntimeCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),

View File

@ -2290,7 +2290,7 @@ EfiBootManagerRefreshAllBootOption (
// Mark the boot option as added by BDS by setting OptionalData to a special GUID // Mark the boot option as added by BDS by setting OptionalData to a special GUID
// //
for (Index = 0; Index < BootOptionCount; Index++) { for (Index = 0; Index < BootOptionCount; Index++) {
BootOptions[Index].OptionalData = AllocateCopyPool (sizeof (EFI_GUID), &mBmAutoCreateBootOptionGuid); BootOptions[Index].OptionalData = AllocateCopyPool(sizeof (EFI_GUID), &mBmAutoCreateBootOptionGuid);
BootOptions[Index].OptionalDataSize = sizeof (EFI_GUID); BootOptions[Index].OptionalDataSize = sizeof (EFI_GUID);
} }

View File

@ -245,7 +245,7 @@ BmGetDescriptionFromDiskInfo (
return NULL; return NULL;
} }
Description = AllocateCopyPool (StrSize (Description), Description); Description = AllocateCopyPool(StrSize (Description), Description);
} }
return Description; return Description;
@ -538,7 +538,7 @@ BmGetLoadFileDescription (
} }
if (Description != NULL) { if (Description != NULL) {
return AllocateCopyPool (StrSize (Description), Description); return AllocateCopyPool(StrSize (Description), Description);
} }
return NULL; return NULL;
@ -704,7 +704,7 @@ BmGetMiscDescription (
break; break;
} }
return AllocateCopyPool (StrSize (Description), Description); return AllocateCopyPool(StrSize (Description), Description);
} }
/** /**

View File

@ -94,7 +94,7 @@ BmGetControllerName (
} }
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
return AllocateCopyPool (StrSize (ControllerName), ControllerName); return AllocateCopyPool(StrSize (ControllerName), ControllerName);
} else { } else {
return ConvertDevicePathToText ( return ConvertDevicePathToText (
DevicePathFromHandle (ChildHandle != NULL ? ChildHandle : ControllerHandle), DevicePathFromHandle (ChildHandle != NULL ? ChildHandle : ControllerHandle),

View File

@ -451,7 +451,7 @@ BmGetActiveConsoleIn (
EFI_OPEN_PROTOCOL_TEST_PROTOCOL EFI_OPEN_PROTOCOL_TEST_PROTOCOL
); );
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
Handles = AllocateCopyPool (sizeof (EFI_HANDLE), &gST->ConsoleInHandle); Handles = AllocateCopyPool(sizeof (EFI_HANDLE), &gST->ConsoleInHandle);
if (Handles != NULL) { if (Handles != NULL) {
*Count = 1; *Count = 1;
} }
@ -805,7 +805,7 @@ EfiBootManagerRegisterContinueKeyOption (
VA_END (Args); VA_END (Args);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
mBmContinueKeyOption = AllocateCopyPool (sizeof (EFI_BOOT_MANAGER_KEY_OPTION), &KeyOption); mBmContinueKeyOption = AllocateCopyPool(sizeof (EFI_BOOT_MANAGER_KEY_OPTION), &KeyOption);
ASSERT (mBmContinueKeyOption != NULL); ASSERT (mBmContinueKeyOption != NULL);
if (mBmHotkeyServiceStarted) { if (mBmHotkeyServiceStarted) {
BmProcessKeyOption (mBmContinueKeyOption); BmProcessKeyOption (mBmContinueKeyOption);

View File

@ -497,10 +497,10 @@ EfiBootManagerInitializeLoadOption (
Option->OptionNumber = OptionNumber; Option->OptionNumber = OptionNumber;
Option->OptionType = OptionType; Option->OptionType = OptionType;
Option->Attributes = Attributes; Option->Attributes = Attributes;
Option->Description = AllocateCopyPool (StrSize (Description), Description); Option->Description = AllocateCopyPool(StrSize (Description), Description);
Option->FilePath = DuplicateDevicePath (FilePath); Option->FilePath = DuplicateDevicePath (FilePath);
if (OptionalData != NULL) { if (OptionalData != NULL) {
Option->OptionalData = AllocateCopyPool (OptionalDataSize, OptionalData); Option->OptionalData = AllocateCopyPool(OptionalDataSize, OptionalData);
Option->OptionalDataSize = OptionalDataSize; Option->OptionalDataSize = OptionalDataSize;
} }

View File

@ -200,7 +200,7 @@ BmSetMemoryTypeInformationVariable (
return; return;
} }
VariableSize = GET_GUID_HOB_DATA_SIZE (GuidHob); VariableSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
PreviousMemoryTypeInformation = AllocateCopyPool (VariableSize, GET_GUID_HOB_DATA (GuidHob)); PreviousMemoryTypeInformation = AllocateCopyPool(VariableSize, GET_GUID_HOB_DATA (GuidHob));
if (PreviousMemoryTypeInformation == NULL) { if (PreviousMemoryTypeInformation == NULL) {
return; return;
} }

View File

@ -73,7 +73,7 @@ HiiSetString (
// //
// Allocate a copy of the SupportLanguages string that passed in // Allocate a copy of the SupportLanguages string that passed in
// //
AllocatedLanguages = AllocateCopyPool (AsciiStrSize (SupportedLanguages), SupportedLanguages); AllocatedLanguages = AllocateCopyPool(AsciiStrSize (SupportedLanguages), SupportedLanguages);
} }
// //

View File

@ -710,7 +710,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
InternalAllocateCopyPool ( InternalAllocateCopyPool(
IN EFI_MEMORY_TYPE PoolType, IN EFI_MEMORY_TYPE PoolType,
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
@ -747,14 +747,14 @@ InternalAllocateCopyPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiBootServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiBootServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -794,7 +794,7 @@ AllocateRuntimeCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),
@ -834,7 +834,7 @@ AllocateReservedCopyPool (
{ {
VOID *NewBuffer; VOID *NewBuffer;
NewBuffer = InternalAllocateCopyPool (EfiReservedMemoryType, AllocationSize, Buffer); NewBuffer = InternalAllocateCopyPool(EfiReservedMemoryType, AllocationSize, Buffer);
if (NewBuffer != NULL) { if (NewBuffer != NULL) {
MemoryProfileLibRecord ( MemoryProfileLibRecord (
(PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0),

View File

@ -231,7 +231,7 @@ InstallAcpiTable (
// //
// Install the ACPI table // Install the ACPI table
// //
AcpiTableBufferConst = AllocateCopyPool (AcpiTableBufferSize,AcpiTableBuffer); AcpiTableBufferConst = AllocateCopyPool(AcpiTableBufferSize,AcpiTableBuffer);
*TableKey = 0; *TableKey = 0;
Status = AddTableToList ( Status = AddTableToList (
AcpiTableInstance, AcpiTableInstance,

View File

@ -320,7 +320,7 @@ SetBootLogo2 (
// //
// Allocate new logo buffer // Allocate new logo buffer
// //
mLogoBltBuffer = AllocateCopyPool (BufferSize, BltBuffer); mLogoBltBuffer = AllocateCopyPool(BufferSize, BltBuffer);
if (mLogoBltBuffer == NULL) { if (mLogoBltBuffer == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -396,7 +396,7 @@ GraphicsConsoleControllerDriverStart (
// //
// Initialize the Graphics Console device instance // Initialize the Graphics Console device instance
// //
Private = AllocateCopyPool ( Private = AllocateCopyPool(
sizeof (GRAPHICS_CONSOLE_DEV), sizeof (GRAPHICS_CONSOLE_DEV),
&mGraphicsConsoleDevTemplate &mGraphicsConsoleDevTemplate
); );
@ -1777,7 +1777,7 @@ DrawUnicodeWeightAtCursorN (
Blt->Width = (UINT16) (Private->ModeData[This->Mode->Mode].GopWidth); Blt->Width = (UINT16) (Private->ModeData[This->Mode->Mode].GopWidth);
Blt->Height = (UINT16) (Private->ModeData[This->Mode->Mode].GopHeight); Blt->Height = (UINT16) (Private->ModeData[This->Mode->Mode].GopHeight);
String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight); String = AllocateCopyPool((Count + 1) * sizeof (CHAR16), UnicodeWeight);
if (String == NULL) { if (String == NULL) {
FreePool(Blt); FreePool(Blt);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -55,7 +55,7 @@ GraphicsOutputQueryMode (
} }
*SizeOfInfo = This->Mode->SizeOfInfo; *SizeOfInfo = This->Mode->SizeOfInfo;
*Info = AllocateCopyPool (*SizeOfInfo, This->Mode->Info); *Info = AllocateCopyPool(*SizeOfInfo, This->Mode->Info);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -422,7 +422,7 @@ GraphicsOutputDriverBindingStart (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
Private = AllocateCopyPool (sizeof (mGraphicsOutputInstanceTemplate), &mGraphicsOutputInstanceTemplate); Private = AllocateCopyPool(sizeof (mGraphicsOutputInstanceTemplate), &mGraphicsOutputInstanceTemplate);
if (Private == NULL) { if (Private == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto CloseProtocols; goto CloseProtocols;

View File

@ -312,7 +312,7 @@ InitializeTerminalConsoleTextMode (
ASSERT (TextModeCount != NULL); ASSERT (TextModeCount != NULL);
TextModeData = AllocateCopyPool (sizeof (mTerminalConsoleModeData), mTerminalConsoleModeData); TextModeData = AllocateCopyPool(sizeof (mTerminalConsoleModeData), mTerminalConsoleModeData);
if (TextModeData == NULL) { if (TextModeData == NULL) {
return NULL; return NULL;
} }
@ -597,7 +597,7 @@ TerminalDriverBindingStart (
// //
// Initialize the Terminal Dev // Initialize the Terminal Dev
// //
TerminalDevice = AllocateCopyPool (sizeof (TERMINAL_DEV), &mTerminalDevTemplate); TerminalDevice = AllocateCopyPool(sizeof (TERMINAL_DEV), &mTerminalDevTemplate);
if (TerminalDevice == NULL) { if (TerminalDevice == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto CloseProtocols; goto CloseProtocols;

View File

@ -160,7 +160,7 @@ DiskIoDriverBindingStart (
// //
// Initialize the Disk IO device instance. // Initialize the Disk IO device instance.
// //
Instance = AllocateCopyPool (sizeof (DISK_IO_PRIVATE_DATA), &gDiskIoPrivateDataTemplate); Instance = AllocateCopyPool(sizeof (DISK_IO_PRIVATE_DATA), &gDiskIoPrivateDataTemplate);
if (Instance == NULL) { if (Instance == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit; goto ErrorExit;

View File

@ -140,7 +140,7 @@ RamDiskDxeEntryPoint (
// //
// Create a private data structure. // Create a private data structure.
// //
ConfigPrivate = AllocateCopyPool (sizeof (RAM_DISK_CONFIG_PRIVATE_DATA), &mRamDiskConfigPrivateDataTemplate); ConfigPrivate = AllocateCopyPool(sizeof (RAM_DISK_CONFIG_PRIVATE_DATA), &mRamDiskConfigPrivateDataTemplate);
if (ConfigPrivate == NULL) { if (ConfigPrivate == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -617,7 +617,7 @@ RamDiskRegister (
// //
// Create a new RAM disk instance and initialize its private data // Create a new RAM disk instance and initialize its private data
// //
PrivateData = AllocateCopyPool ( PrivateData = AllocateCopyPool(
sizeof (RAM_DISK_PRIVATE_DATA), sizeof (RAM_DISK_PRIVATE_DATA),
&mRamDiskPrivateDataTemplate &mRamDiskPrivateDataTemplate
); );
@ -633,7 +633,7 @@ RamDiskRegister (
// //
// Generate device path information for the registered RAM disk // Generate device path information for the registered RAM disk
// //
RamDiskDevNode = AllocateCopyPool ( RamDiskDevNode = AllocateCopyPool(
sizeof (MEDIA_RAM_DISK_DEVICE_PATH), sizeof (MEDIA_RAM_DISK_DEVICE_PATH),
&mRamDiskDeviceNodeTemplate &mRamDiskDeviceNodeTemplate
); );

View File

@ -482,7 +482,7 @@ DuplicateFid (
) )
{ {
*NewFileIdentifierDesc = *NewFileIdentifierDesc =
(UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool ( (UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool(
(UINTN) GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierDesc); (UINTN) GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierDesc);
} }
@ -503,7 +503,7 @@ DuplicateFe (
OUT VOID **NewFileEntry OUT VOID **NewFileEntry
) )
{ {
*NewFileEntry = AllocateCopyPool (Volume->FileEntrySize, FileEntry); *NewFileEntry = AllocateCopyPool(Volume->FileEntrySize, FileEntry);
} }
/** /**

View File

@ -198,7 +198,7 @@ GetToken (
String = HiiGetString (HiiHandle, Token, NULL); String = HiiGetString (HiiHandle, Token, NULL);
if (String == NULL) { if (String == NULL) {
String = AllocateCopyPool (StrSize (mUnknownString), mUnknownString); String = AllocateCopyPool(StrSize (mUnknownString), mUnknownString);
ASSERT (String != NULL); ASSERT (String != NULL);
} }
@ -2028,7 +2028,7 @@ UpdateHighlightMenuInfo (
if (gHighligthMenuInfo.HLTOpCode != NULL) { if (gHighligthMenuInfo.HLTOpCode != NULL) {
FreePool(gHighligthMenuInfo.HLTOpCode); FreePool(gHighligthMenuInfo.HLTOpCode);
} }
gHighligthMenuInfo.HLTOpCode = AllocateCopyPool (Statement->OpCode->Length, Statement->OpCode); gHighligthMenuInfo.HLTOpCode = AllocateCopyPool(Statement->OpCode->Length, Statement->OpCode);
ASSERT (gHighligthMenuInfo.HLTOpCode != NULL); ASSERT (gHighligthMenuInfo.HLTOpCode != NULL);
gHighligthMenuInfo.HLTIndex = GetIndexInfoForOpcode(Statement->OpCode); gHighligthMenuInfo.HLTIndex = GetIndexInfoForOpcode(Statement->OpCode);
@ -2045,7 +2045,7 @@ UpdateHighlightMenuInfo (
if (gHighligthMenuInfo.TOSOpCode != NULL) { if (gHighligthMenuInfo.TOSOpCode != NULL) {
FreePool(gHighligthMenuInfo.TOSOpCode); FreePool(gHighligthMenuInfo.TOSOpCode);
} }
gHighligthMenuInfo.TOSOpCode = AllocateCopyPool (Statement->OpCode->Length, Statement->OpCode); gHighligthMenuInfo.TOSOpCode = AllocateCopyPool(Statement->OpCode->Length, Statement->OpCode);
ASSERT (gHighligthMenuInfo.TOSOpCode != NULL); ASSERT (gHighligthMenuInfo.TOSOpCode != NULL);
gHighligthMenuInfo.TOSIndex = GetIndexInfoForOpcode(Statement->OpCode); gHighligthMenuInfo.TOSIndex = GetIndexInfoForOpcode(Statement->OpCode);

View File

@ -880,7 +880,7 @@ PasswordProcess (
// Compare two typed-in new passwords // Compare two typed-in new passwords
// //
if (StrCmp (StringPtr, TempString) == 0) { if (StrCmp (StringPtr, TempString) == 0) {
gUserInput->InputValue.Buffer = AllocateCopyPool (Question->CurrentValue.BufferLen, StringPtr); gUserInput->InputValue.Buffer = AllocateCopyPool(Question->CurrentValue.BufferLen, StringPtr);
gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen; gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
gUserInput->InputValue.Type = Question->CurrentValue.Type; gUserInput->InputValue.Type = Question->CurrentValue.Type;
gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL); gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL);
@ -1113,7 +1113,7 @@ ProcessOptions (
// //
gUserInput->SelectedStatement = Question; gUserInput->SelectedStatement = Question;
gMisMatch = TRUE; gMisMatch = TRUE;
ValueArray = AllocateCopyPool (Question->CurrentValue.BufferLen, Question->CurrentValue.Buffer); ValueArray = AllocateCopyPool(Question->CurrentValue.BufferLen, Question->CurrentValue.Buffer);
ASSERT (ValueArray != NULL); ASSERT (ValueArray != NULL);
gUserInput->InputValue.Buffer = ValueArray; gUserInput->InputValue.Buffer = ValueArray;
gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen; gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
@ -1359,7 +1359,7 @@ ProcessOptions (
return Status; return Status;
} }
gUserInput->InputValue.Buffer = AllocateCopyPool (Question->CurrentValue.BufferLen, StringPtr); gUserInput->InputValue.Buffer = AllocateCopyPool(Question->CurrentValue.BufferLen, StringPtr);
gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen; gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
gUserInput->InputValue.Type = Question->CurrentValue.Type; gUserInput->InputValue.Type = Question->CurrentValue.Type;
gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL); gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, gUserInput->InputValue.Value.string, StringPtr, NULL);

View File

@ -372,7 +372,7 @@ DriverHealthManagerGetDriverName (
} }
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
return AllocateCopyPool (StrSize (DriverName), DriverName); return AllocateCopyPool(StrSize (DriverName), DriverName);
} else { } else {
return ConvertDevicePathToText (DevicePathFromHandle (DriverBindingHandle), FALSE, TRUE); return ConvertDevicePathToText (DevicePathFromHandle (DriverBindingHandle), FALSE, TRUE);
} }
@ -499,7 +499,7 @@ DriverHealthManagerGetControllerName (
} }
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
return AllocateCopyPool (StrSize (ControllerName), ControllerName); return AllocateCopyPool(StrSize (ControllerName), ControllerName);
} else { } else {
return ConvertDevicePathToText (DevicePathFromHandle (ChildHandle != NULL ? ChildHandle : ControllerHandle), FALSE, TRUE); return ConvertDevicePathToText (DevicePathFromHandle (ChildHandle != NULL ? ChildHandle : ControllerHandle), FALSE, TRUE);
} }

View File

@ -519,7 +519,7 @@ FvSimpleFileSystemDriverStart (
// If we didn't decide on a volume label, set a fallback one // If we didn't decide on a volume label, set a fallback one
// //
if (Instance->VolumeLabel == NULL) { if (Instance->VolumeLabel == NULL) {
Instance->VolumeLabel = AllocateCopyPool ( Instance->VolumeLabel = AllocateCopyPool(
sizeof (FVFS_FALLBACK_VOLUME_LABEL), sizeof (FVFS_FALLBACK_VOLUME_LABEL),
FVFS_FALLBACK_VOLUME_LABEL FVFS_FALLBACK_VOLUME_LABEL
); );

View File

@ -281,7 +281,7 @@ ExtractKeyword (
} }
*NextString = String + StrLen (String); *NextString = String + StrLen (String);
*Keyword = AllocateCopyPool (StrSize (String), String); *Keyword = AllocateCopyPool(StrSize (String), String);
if (*Keyword == NULL) { if (*Keyword == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -336,7 +336,7 @@ ExtractValue (
} }
*NextString = String + StrLen (String); *NextString = String + StrLen (String);
*Value = AllocateCopyPool (StrSize (String), String); *Value = AllocateCopyPool(StrSize (String), String);
if (*Value == NULL) { if (*Value == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -1345,7 +1345,7 @@ GetStringIdFromRecord (
return KEYWORD_HANDLER_KEYWORD_NOT_FOUND; return KEYWORD_HANDLER_KEYWORD_NOT_FOUND;
} else { } else {
if (*NameSpace == NULL) { if (*NameSpace == NULL) {
*NameSpace = AllocateCopyPool (AsciiStrSize (StringPackage->StringPkgHdr->Language), StringPackage->StringPkgHdr->Language); *NameSpace = AllocateCopyPool(AsciiStrSize (StringPackage->StringPkgHdr->Language), StringPackage->StringPkgHdr->Language);
if (*NameSpace == NULL) { if (*NameSpace == NULL) {
return KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR; return KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
} }
@ -1933,7 +1933,7 @@ GetNameFromId (
NULL NULL
); );
if (BestLanguage == NULL) { if (BestLanguage == NULL) {
BestLanguage = AllocateCopyPool (AsciiStrLen ("en-US"), "en-US"); BestLanguage = AllocateCopyPool(AsciiStrLen ("en-US"), "en-US");
ASSERT (BestLanguage != NULL); ASSERT (BestLanguage != NULL);
} }
@ -2244,7 +2244,7 @@ ExtractValueFromDriver (
*StringEnd = L'\0'; *StringEnd = L'\0';
} }
*ValueElement = AllocateCopyPool (StrSize (StringPtr), StringPtr); *ValueElement = AllocateCopyPool(StrSize (StringPtr), StringPtr);
if (*ValueElement == NULL) { if (*ValueElement == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2339,7 +2339,7 @@ GetStringIdFromDatabase (
if ((DevicePathPkg = Record->PackageList->DevicePathPkg) != NULL) { if ((DevicePathPkg = Record->PackageList->DevicePathPkg) != NULL) {
DestDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) (DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER)); DestDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) (DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER));
DevicePathSize = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) DestDevicePath); DevicePathSize = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) DestDevicePath);
*DevicePath = AllocateCopyPool (DevicePathSize, DestDevicePath); *DevicePath = AllocateCopyPool(DevicePathSize, DestDevicePath);
if (*DevicePath == NULL) { if (*DevicePath == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2632,7 +2632,7 @@ EnumerateAllKeywords (
// //
// Keep the NameSpace string. // Keep the NameSpace string.
// //
LocalNameSpace = AllocateCopyPool (AsciiStrSize (StringPackage->StringPkgHdr->Language), StringPackage->StringPkgHdr->Language); LocalNameSpace = AllocateCopyPool(AsciiStrSize (StringPackage->StringPkgHdr->Language), StringPackage->StringPkgHdr->Language);
if (LocalNameSpace == NULL) { if (LocalNameSpace == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -2860,7 +2860,7 @@ EfiConfigKeywordHandlerSetData (
// //
// Use temp string to avoid changing input string buffer. // Use temp string to avoid changing input string buffer.
// //
TempString = AllocateCopyPool (StrSize (KeywordString), KeywordString); TempString = AllocateCopyPool(StrSize (KeywordString), KeywordString);
ASSERT (TempString != NULL); ASSERT (TempString != NULL);
StringPtr = TempString; StringPtr = TempString;
@ -3158,7 +3158,7 @@ EfiConfigKeywordHandlerGetData (
// Use temp string to avoid changing input string buffer. // Use temp string to avoid changing input string buffer.
// //
if (NameSpaceId != NULL) { if (NameSpaceId != NULL) {
TempString = AllocateCopyPool (StrSize (NameSpaceId), NameSpaceId); TempString = AllocateCopyPool(StrSize (NameSpaceId), NameSpaceId);
ASSERT (TempString != NULL); ASSERT (TempString != NULL);
} }
// //
@ -3187,7 +3187,7 @@ EfiConfigKeywordHandlerGetData (
// //
// Use temp string to avoid changing input string buffer. // Use temp string to avoid changing input string buffer.
// //
TempString = AllocateCopyPool (StrSize (KeywordString), KeywordString); TempString = AllocateCopyPool(StrSize (KeywordString), KeywordString);
ASSERT (TempString != NULL); ASSERT (TempString != NULL);
StringPtr = TempString; StringPtr = TempString;

View File

@ -234,7 +234,7 @@ GenerateSubStr (
ASSERT (String != NULL && SubStr != NULL); ASSERT (String != NULL && SubStr != NULL);
if (Buffer == NULL) { if (Buffer == NULL) {
*SubStr = AllocateCopyPool (StrSize (String), String); *SubStr = AllocateCopyPool(StrSize (String), String);
ASSERT (*SubStr != NULL); ASSERT (*SubStr != NULL);
return; return;
} }
@ -359,7 +359,7 @@ OutputConfigBody (
// //
// It is the last <ConfigResp> of the incoming configuration string. // It is the last <ConfigResp> of the incoming configuration string.
// //
Result = AllocateCopyPool (StrSize (String), String); Result = AllocateCopyPool(StrSize (String), String);
if (Result == NULL) { if (Result == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} else { } else {
@ -372,7 +372,7 @@ OutputConfigBody (
if (Length == 0) { if (Length == 0) {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
Result = AllocateCopyPool (Length * sizeof (CHAR16), String); Result = AllocateCopyPool(Length * sizeof (CHAR16), String);
if (Result == NULL) { if (Result == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -917,7 +917,7 @@ CompareAndMergeDefaultString (
// //
// Copy the content of <ConfigAltResp> which contain current AltConfigHdr in AltCfgResp. // Copy the content of <ConfigAltResp> which contain current AltConfigHdr in AltCfgResp.
// //
ConfigAltResp = AllocateCopyPool (StrSize (*AltCfgResp), *AltCfgResp); ConfigAltResp = AllocateCopyPool(StrSize (*AltCfgResp), *AltCfgResp);
if (ConfigAltResp == NULL) { if (ConfigAltResp == NULL) {
goto Exit; goto Exit;
} }
@ -4744,7 +4744,7 @@ HiiConfigRoutingExtractConfig (
// Process each <ConfigRequest> of <MultiConfigRequest> // Process each <ConfigRequest> of <MultiConfigRequest>
// //
Length = CalculateConfigStringLen (StringPtr); Length = CalculateConfigStringLen (StringPtr);
ConfigRequest = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), StringPtr); ConfigRequest = AllocateCopyPool((Length + 1) * sizeof (CHAR16), StringPtr);
if (ConfigRequest == NULL) { if (ConfigRequest == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;
@ -4835,7 +4835,7 @@ HiiConfigRoutingExtractConfig (
// Not any request block is found. // Not any request block is found.
// //
if (!GetElementsFromRequest(ConfigRequest)) { if (!GetElementsFromRequest(ConfigRequest)) {
AccessResults = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest); AccessResults = AllocateCopyPool(StrSize (ConfigRequest), ConfigRequest);
goto NextConfigString; goto NextConfigString;
} }
} }
@ -5307,7 +5307,7 @@ HiiConfigRoutingRouteConfig (
// Process each <ConfigResp> of <MultiConfigResp> // Process each <ConfigResp> of <MultiConfigResp>
// //
Length = CalculateConfigStringLen (StringPtr); Length = CalculateConfigStringLen (StringPtr);
ConfigResp = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), StringPtr); ConfigResp = AllocateCopyPool((Length + 1) * sizeof (CHAR16), StringPtr);
if (ConfigResp == NULL) { if (ConfigResp == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -2777,7 +2777,7 @@ HiiGetFontInfo (
// //
if (LocalFontHandle == NULL) { if (LocalFontHandle == NULL) {
if (StringInfoOut != NULL) { if (StringInfoOut != NULL) {
*StringInfoOut = AllocateCopyPool (StringInfoOutLen, SystemDefault); *StringInfoOut = AllocateCopyPool(StringInfoOutLen, SystemDefault);
if (*StringInfoOut == NULL) { if (*StringInfoOut == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
LocalFontHandle = NULL; LocalFontHandle = NULL;

View File

@ -287,7 +287,7 @@ InstallFileLoadProtocol (
continue; continue;
} }
if (!IsInPrivateList (&NameGuid)) { if (!IsInPrivateList (&NameGuid)) {
Private = (LOAD_FILE_ON_FV2_PRIVATE_DATA *)AllocateCopyPool (sizeof (mLoadFileOnFv2PrivateDataTemplate), &mLoadFileOnFv2PrivateDataTemplate); Private = (LOAD_FILE_ON_FV2_PRIVATE_DATA *)AllocateCopyPool(sizeof (mLoadFileOnFv2PrivateDataTemplate), &mLoadFileOnFv2PrivateDataTemplate);
ASSERT (Private != NULL); ASSERT (Private != NULL);
Private->Fv = Fv; Private->Fv = Fv;
Private->DevicePath = CreateFileDevicePath (Handle, &NameGuid, UiName); Private->DevicePath = CreateFileDevicePath (Handle, &NameGuid, UiName);

View File

@ -162,7 +162,7 @@ GetPcdName (
// //
// Only need to get the TokenSpaceCName. // Only need to get the TokenSpaceCName.
// //
Name = AllocateCopyPool (AsciiStrSize (TokenSpaceName), TokenSpaceName); Name = AllocateCopyPool(AsciiStrSize (TokenSpaceName), TokenSpaceName);
} else { } else {
// //
// Need to get the full PCD name. // Need to get the full PCD name.

View File

@ -121,7 +121,7 @@ GetPcdName (
// //
// Only need to get the TokenSpaceCName. // Only need to get the TokenSpaceCName.
// //
Name = AllocateCopyPool (AsciiStrSize (TokenSpaceName), TokenSpaceName); Name = AllocateCopyPool(AsciiStrSize (TokenSpaceName), TokenSpaceName);
} else { } else {
// //
// Need to get the full PCD name. // Need to get the full PCD name.

View File

@ -117,7 +117,7 @@ DevicePathToStr (
TRUE TRUE
); );
if (Text == NULL) { if (Text == NULL) {
Text = AllocateCopyPool (sizeof (L"?"), L"?"); Text = AllocateCopyPool(sizeof (L"?"), L"?");
ASSERT (Text != NULL); ASSERT (Text != NULL);
} }
@ -259,7 +259,7 @@ GetImageName (
// //
// Make sure device path node is aligned when accessing it's FV Name Guid field. // Make sure device path node is aligned when accessing it's FV Name Guid field.
// //
AlignedDevPathNode = AllocateCopyPool (DevicePathNodeLength(DevPathNode), DevPathNode); AlignedDevPathNode = AllocateCopyPool(DevicePathNodeLength(DevPathNode), DevPathNode);
// //
// Find the Fv File path // Find the Fv File path

View File

@ -167,7 +167,7 @@ OnigurumaMatch (
// Region beg/end values represent bytes, not characters // Region beg/end values represent bytes, not characters
// //
(*Captures)[Index].Length = (Region->end[Index] - Region->beg[Index]) / sizeof(CHAR16); (*Captures)[Index].Length = (Region->end[Index] - Region->beg[Index]) / sizeof(CHAR16);
(*Captures)[Index].CapturePtr = AllocateCopyPool ( (*Captures)[Index].CapturePtr = AllocateCopyPool(
((*Captures)[Index].Length) * sizeof (CHAR16), ((*Captures)[Index].Length) * sizeof (CHAR16),
(CHAR16*)((UINTN)String + Region->beg[Index]) (CHAR16*)((UINTN)String + Region->beg[Index])
); );

View File

@ -177,7 +177,7 @@ CreateQuestion (
NameValueNode = AllocateZeroPool (sizeof (NAME_VALUE_NODE)); NameValueNode = AllocateZeroPool (sizeof (NAME_VALUE_NODE));
ASSERT (NameValueNode != NULL); ASSERT (NameValueNode != NULL);
NameValueNode->Signature = NAME_VALUE_NODE_SIGNATURE; NameValueNode->Signature = NAME_VALUE_NODE_SIGNATURE;
NameValueNode->Name = AllocateCopyPool (StrSize (Statement->VariableName), Statement->VariableName); NameValueNode->Name = AllocateCopyPool(StrSize (Statement->VariableName), Statement->VariableName);
ASSERT (NameValueNode->Name != NULL); ASSERT (NameValueNode->Name != NULL);
NameValueNode->Value = AllocateZeroPool (0x10); NameValueNode->Value = AllocateZeroPool (0x10);
ASSERT (NameValueNode->Value != NULL); ASSERT (NameValueNode->Value != NULL);
@ -443,7 +443,7 @@ CreateStorage (
Storage->BrowserStorage = BrowserStorage; Storage->BrowserStorage = BrowserStorage;
InitializeConfigHdr (FormSet, Storage); InitializeConfigHdr (FormSet, Storage);
Storage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigHdr), Storage->ConfigHdr); Storage->ConfigRequest = AllocateCopyPool(StrSize (Storage->ConfigHdr), Storage->ConfigHdr);
Storage->SpareStrLen = 0; Storage->SpareStrLen = 0;
return Storage; return Storage;
@ -594,7 +594,7 @@ InitializeRequestElement (
Question->StorageWidth Question->StorageWidth
); );
HiiToLower(RequestElement); HiiToLower(RequestElement);
Question->BlockName = AllocateCopyPool ((StrLen + 1) * sizeof (CHAR16), RequestElement); Question->BlockName = AllocateCopyPool((StrLen + 1) * sizeof (CHAR16), RequestElement);
} else { } else {
StrLen = UnicodeSPrint (RequestElement, 30 * sizeof (CHAR16), L"&%s", Question->VariableName); StrLen = UnicodeSPrint (RequestElement, 30 * sizeof (CHAR16), L"&%s", Question->VariableName);
} }
@ -658,7 +658,7 @@ InitializeRequestElement (
ConfigInfo = AllocateZeroPool(sizeof (FORM_BROWSER_CONFIG_REQUEST)); ConfigInfo = AllocateZeroPool(sizeof (FORM_BROWSER_CONFIG_REQUEST));
ASSERT (ConfigInfo != NULL); ASSERT (ConfigInfo != NULL);
ConfigInfo->Signature = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE; ConfigInfo->Signature = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE;
ConfigInfo->ConfigRequest = AllocateCopyPool (StrSize (FormsetStorage->ConfigHdr), FormsetStorage->ConfigHdr); ConfigInfo->ConfigRequest = AllocateCopyPool(StrSize (FormsetStorage->ConfigHdr), FormsetStorage->ConfigHdr);
ASSERT (ConfigInfo->ConfigRequest != NULL); ASSERT (ConfigInfo->ConfigRequest != NULL);
ConfigInfo->SpareStrLen = 0; ConfigInfo->SpareStrLen = 0;
ConfigInfo->Storage = FormsetStorage->BrowserStorage; ConfigInfo->Storage = FormsetStorage->BrowserStorage;
@ -1340,7 +1340,7 @@ ParseOpCodes (
case EFI_IFR_EQ_ID_VAL_LIST_OP: case EFI_IFR_EQ_ID_VAL_LIST_OP:
CopyMem (&ExpressionOpCode->QuestionId, &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->QuestionId, sizeof (EFI_QUESTION_ID)); CopyMem (&ExpressionOpCode->QuestionId, &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->QuestionId, sizeof (EFI_QUESTION_ID));
CopyMem (&ExpressionOpCode->ListLength, &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->ListLength, sizeof (UINT16)); CopyMem (&ExpressionOpCode->ListLength, &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->ListLength, sizeof (UINT16));
ExpressionOpCode->ValueList = AllocateCopyPool (ExpressionOpCode->ListLength * sizeof (UINT16), &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->ValueList); ExpressionOpCode->ValueList = AllocateCopyPool(ExpressionOpCode->ListLength * sizeof (UINT16), &((EFI_IFR_EQ_ID_VAL_LIST *) OpCodeData)->ValueList);
break; break;
case EFI_IFR_TO_STRING_OP: case EFI_IFR_TO_STRING_OP:
@ -2091,7 +2091,7 @@ ParseOpCodes (
CopyMem (&CurrentDefault->DefaultId, &((EFI_IFR_DEFAULT *) OpCodeData)->DefaultId, sizeof (UINT16)); CopyMem (&CurrentDefault->DefaultId, &((EFI_IFR_DEFAULT *) OpCodeData)->DefaultId, sizeof (UINT16));
if (CurrentDefault->Value.Type == EFI_IFR_TYPE_BUFFER) { if (CurrentDefault->Value.Type == EFI_IFR_TYPE_BUFFER) {
CurrentDefault->Value.BufferLen = (UINT16) (OpCodeLength - OFFSET_OF (EFI_IFR_DEFAULT, Value)); CurrentDefault->Value.BufferLen = (UINT16) (OpCodeLength - OFFSET_OF (EFI_IFR_DEFAULT, Value));
CurrentDefault->Value.Buffer = AllocateCopyPool (CurrentDefault->Value.BufferLen, &((EFI_IFR_DEFAULT *) OpCodeData)->Value); CurrentDefault->Value.Buffer = AllocateCopyPool(CurrentDefault->Value.BufferLen, &((EFI_IFR_DEFAULT *) OpCodeData)->Value);
ASSERT (CurrentDefault->Value.Buffer != NULL); ASSERT (CurrentDefault->Value.Buffer != NULL);
} else { } else {
CopyMem (&CurrentDefault->Value.Value, &((EFI_IFR_DEFAULT *) OpCodeData)->Value, OpCodeLength - OFFSET_OF (EFI_IFR_DEFAULT, Value)); CopyMem (&CurrentDefault->Value.Value, &((EFI_IFR_DEFAULT *) OpCodeData)->Value, OpCodeLength - OFFSET_OF (EFI_IFR_DEFAULT, Value));
@ -2129,7 +2129,7 @@ ParseOpCodes (
} }
CurrentDefault->Value.BufferLen = (UINT16) (OpCodeLength - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value)); CurrentDefault->Value.BufferLen = (UINT16) (OpCodeLength - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
CurrentDefault->Value.Buffer = AllocateCopyPool (CurrentDefault->Value.BufferLen, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Value); CurrentDefault->Value.Buffer = AllocateCopyPool(CurrentDefault->Value.BufferLen, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Value);
ASSERT (CurrentDefault->Value.Buffer != NULL); ASSERT (CurrentDefault->Value.Buffer != NULL);
// //

View File

@ -1033,7 +1033,7 @@ GetToken (
String = HiiGetString (HiiHandle, Token, NULL); String = HiiGetString (HiiHandle, Token, NULL);
if (String == NULL) { if (String == NULL) {
String = AllocateCopyPool (StrSize (mUnknownString), mUnknownString); String = AllocateCopyPool(StrSize (mUnknownString), mUnknownString);
ASSERT (String != NULL); ASSERT (String != NULL);
} }
return (CHAR16 *) String; return (CHAR16 *) String;
@ -1056,7 +1056,7 @@ NewStringCpy (
if (*Dest != NULL) { if (*Dest != NULL) {
FreePool(*Dest); FreePool(*Dest);
} }
*Dest = AllocateCopyPool (StrSize (Src), Src); *Dest = AllocateCopyPool(StrSize (Src), Src);
ASSERT (*Dest != NULL); ASSERT (*Dest != NULL);
} }
@ -1185,7 +1185,7 @@ SetValueByName (
if (Buffer != NULL) { if (Buffer != NULL) {
FreePool(Buffer); FreePool(Buffer);
} }
Buffer = AllocateCopyPool (StrSize (Value), Value); Buffer = AllocateCopyPool(StrSize (Value), Value);
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
if (SetValueTo == GetSetValueWithEditBuffer) { if (SetValueTo == GetSetValueWithEditBuffer) {
Node->EditValue = Buffer; Node->EditValue = Buffer;
@ -3009,7 +3009,7 @@ GetSyncRestoreConfigRequest(
// Need to restore all the fields in the ConfigRequest. // Need to restore all the fields in the ConfigRequest.
// //
if (*Progress == L'G') { if (*Progress == L'G') {
*RestoreConfigRequest = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest); *RestoreConfigRequest = AllocateCopyPool(StrSize (ConfigRequest), ConfigRequest);
ASSERT (*RestoreConfigRequest != NULL); ASSERT (*RestoreConfigRequest != NULL);
return; return;
} }
@ -3935,7 +3935,7 @@ GetOffsetFromConfigResp (
// //
// 2. Change all hex digits in Question->BlockName to lower and compare again. // 2. Change all hex digits in Question->BlockName to lower and compare again.
// //
BlockData = AllocateCopyPool (StrSize(Question->BlockName), Question->BlockName); BlockData = AllocateCopyPool(StrSize(Question->BlockName), Question->BlockName);
ASSERT (BlockData != NULL); ASSERT (BlockData != NULL);
HiiToLower (BlockData); HiiToLower (BlockData);
RequestElement = StrStr (ConfigResp, BlockData); RequestElement = StrStr (ConfigResp, BlockData);
@ -4985,14 +4985,14 @@ IsQuestionValueChanged (
switch (Question->Operand) { switch (Question->Operand) {
case EFI_IFR_ORDERED_LIST_OP: case EFI_IFR_ORDERED_LIST_OP:
BufferWidth = Question->StorageWidth; BufferWidth = Question->StorageWidth;
BackUpBuffer = AllocateCopyPool (BufferWidth, Question->BufferValue); BackUpBuffer = AllocateCopyPool(BufferWidth, Question->BufferValue);
ASSERT (BackUpBuffer != NULL); ASSERT (BackUpBuffer != NULL);
break; break;
case EFI_IFR_STRING_OP: case EFI_IFR_STRING_OP:
case EFI_IFR_PASSWORD_OP: case EFI_IFR_PASSWORD_OP:
BufferWidth = (UINTN) Question->Maximum * sizeof (CHAR16); BufferWidth = (UINTN) Question->Maximum * sizeof (CHAR16);
BackUpBuffer = AllocateCopyPool (BufferWidth, Question->BufferValue); BackUpBuffer = AllocateCopyPool(BufferWidth, Question->BufferValue);
ASSERT (BackUpBuffer != NULL); ASSERT (BackUpBuffer != NULL);
break; break;
@ -5009,14 +5009,14 @@ IsQuestionValueChanged (
switch (Question->Operand) { switch (Question->Operand) {
case EFI_IFR_ORDERED_LIST_OP: case EFI_IFR_ORDERED_LIST_OP:
BufferWidth = Question->StorageWidth; BufferWidth = Question->StorageWidth;
BackUpBuffer2 = AllocateCopyPool (BufferWidth, Question->BufferValue); BackUpBuffer2 = AllocateCopyPool(BufferWidth, Question->BufferValue);
ASSERT (BackUpBuffer2 != NULL); ASSERT (BackUpBuffer2 != NULL);
break; break;
case EFI_IFR_STRING_OP: case EFI_IFR_STRING_OP:
case EFI_IFR_PASSWORD_OP: case EFI_IFR_PASSWORD_OP:
BufferWidth = (UINTN) Question->Maximum * sizeof (CHAR16); BufferWidth = (UINTN) Question->Maximum * sizeof (CHAR16);
BackUpBuffer2 = AllocateCopyPool (BufferWidth, Question->BufferValue); BackUpBuffer2 = AllocateCopyPool(BufferWidth, Question->BufferValue);
ASSERT (BackUpBuffer2 != NULL); ASSERT (BackUpBuffer2 != NULL);
break; break;
@ -5411,7 +5411,7 @@ ConfigRequestAdjust (
} }
if (Storage->ConfigRequest == NULL) { if (Storage->ConfigRequest == NULL) {
Storage->ConfigRequest = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest); Storage->ConfigRequest = AllocateCopyPool(StrSize (ConfigRequest), ConfigRequest);
return TRUE; return TRUE;
} }
@ -5600,7 +5600,7 @@ LoadStorage (
FreePool(Result); FreePool(Result);
} }
Storage->BrowserStorage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigRequest), Storage->ConfigRequest); Storage->BrowserStorage->ConfigRequest = AllocateCopyPool(StrSize (Storage->ConfigRequest), Storage->ConfigRequest);
// //
// Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer. // Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer.
@ -5905,7 +5905,7 @@ GetIfrBinaryData (
// of the Form Package. // of the Form Package.
// //
*BinaryLength = PackageHeader.Length - Offset2; *BinaryLength = PackageHeader.Length - Offset2;
*BinaryData = AllocateCopyPool (*BinaryLength, OpCodeData); *BinaryData = AllocateCopyPool(*BinaryLength, OpCodeData);
FreePool(HiiPackageList); FreePool(HiiPackageList);
@ -6411,7 +6411,7 @@ RegisterHotKey (
HotKey = AllocateZeroPool (sizeof (BROWSER_HOT_KEY)); HotKey = AllocateZeroPool (sizeof (BROWSER_HOT_KEY));
ASSERT (HotKey != NULL); ASSERT (HotKey != NULL);
HotKey->Signature = BROWSER_HOT_KEY_SIGNATURE; HotKey->Signature = BROWSER_HOT_KEY_SIGNATURE;
HotKey->KeyData = AllocateCopyPool (sizeof (EFI_INPUT_KEY), KeyData); HotKey->KeyData = AllocateCopyPool(sizeof (EFI_INPUT_KEY), KeyData);
InsertTailList (&gBrowserHotKeyList, &HotKey->Link); InsertTailList (&gBrowserHotKeyList, &HotKey->Link);
// //
@ -6422,7 +6422,7 @@ RegisterHotKey (
if (HotKey->HelpString != NULL) { if (HotKey->HelpString != NULL) {
FreePool(HotKey->HelpString); FreePool(HotKey->HelpString);
} }
HotKey->HelpString = AllocateCopyPool (StrSize (HelpString), HelpString); HotKey->HelpString = AllocateCopyPool(StrSize (HelpString), HelpString);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -550,7 +550,7 @@ MeasureSmbiosTable (
DEBUG ((DEBUG_INFO, "The Smbios Table size: 0x%x\n", TableLength)); DEBUG ((DEBUG_INFO, "The Smbios Table size: 0x%x\n", TableLength));
DEBUG_CODE (InternalDumpHex ((UINT8 *)(UINTN)SmbiosTableAddress, TableLength);); DEBUG_CODE (InternalDumpHex ((UINT8 *)(UINTN)SmbiosTableAddress, TableLength););
TableAddress = AllocateCopyPool ((UINTN)TableLength, (VOID *)(UINTN)SmbiosTableAddress); TableAddress = AllocateCopyPool((UINTN)TableLength, (VOID *)(UINTN)SmbiosTableAddress);
if (TableAddress == NULL) { if (TableAddress == NULL) {
return ; return ;
} }

View File

@ -324,7 +324,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
); );

View File

@ -214,7 +214,7 @@ ExtractGuidedSectionRegisterHandlers (
// Install the Guided Section GUID configuration table to record the GUID itself. // Install the Guided Section GUID configuration table to record the GUID itself.
// Then the content of the configuration table buffer will be the same as the GUID value itself. // Then the content of the configuration table buffer will be the same as the GUID value itself.
// //
GuidData = AllocateCopyPool (sizeof (GUID), (VOID *) SectionGuid); GuidData = AllocateCopyPool(sizeof (GUID), (VOID *) SectionGuid);
if (GuidData != NULL) { if (GuidData != NULL) {
gBS->InstallConfigurationTable ((EFI_GUID *) SectionGuid, GuidData); gBS->InstallConfigurationTable ((EFI_GUID *) SectionGuid, GuidData);
} }

View File

@ -49,7 +49,7 @@ HstiAipGetInfo (
HstiAip = HSTI_AIP_PRIVATE_DATA_FROM_THIS(This); HstiAip = HSTI_AIP_PRIVATE_DATA_FROM_THIS(This);
*InformationBlock = AllocateCopyPool (HstiAip->HstiSize, HstiAip->Hsti); *InformationBlock = AllocateCopyPool(HstiAip->HstiSize, HstiAip->Hsti);
if (*InformationBlock == NULL) { if (*InformationBlock == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -153,7 +153,7 @@ HstiAipGetSupportedTypes (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
*InfoTypesBuffer = AllocateCopyPool (sizeof(gAdapterInfoPlatformSecurityGuid), &gAdapterInfoPlatformSecurityGuid); *InfoTypesBuffer = AllocateCopyPool(sizeof(gAdapterInfoPlatformSecurityGuid), &gAdapterInfoPlatformSecurityGuid);
if (*InfoTypesBuffer == NULL) { if (*InfoTypesBuffer == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }

View File

@ -290,7 +290,7 @@ HstiLibSetTable (
if (HstiAip == NULL) { if (HstiAip == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
HstiAip->Hsti = AllocateCopyPool (HstiSize, Hsti); HstiAip->Hsti = AllocateCopyPool(HstiSize, Hsti);
if (HstiAip->Hsti == NULL) { if (HstiAip->Hsti == NULL) {
FreePool(HstiAip); FreePool(HstiAip);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -570,7 +570,7 @@ AllocateReservedZeroPool (
**/ **/
VOID * VOID *
InternalAllocateCopyPool ( InternalAllocateCopyPool(
IN EFI_MEMORY_TYPE PoolType, IN EFI_MEMORY_TYPE PoolType,
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
@ -607,7 +607,7 @@ InternalAllocateCopyPool (
**/ **/
VOID * VOID *
EFIAPI EFIAPI
AllocateCopyPool ( AllocateCopyPool(
IN UINTN AllocationSize, IN UINTN AllocationSize,
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
@ -648,7 +648,7 @@ AllocateRuntimeCopyPool (
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
return InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer); return InternalAllocateCopyPool(EfiRuntimeServicesData, AllocationSize, Buffer);
} }
/** /**
@ -675,7 +675,7 @@ AllocateReservedCopyPool (
IN CONST VOID *Buffer IN CONST VOID *Buffer
) )
{ {
return InternalAllocateCopyPool (EfiReservedMemoryType, AllocationSize, Buffer); return InternalAllocateCopyPool(EfiReservedMemoryType, AllocationSize, Buffer);
} }
/** /**

View File

@ -674,12 +674,12 @@ InternalPeiServicesInstallFvInfoPpi (
FvInfoPpi->FvInfo = (VOID *) FvInfo; FvInfoPpi->FvInfo = (VOID *) FvInfo;
FvInfoPpi->FvInfoSize = FvInfoSize; FvInfoPpi->FvInfoSize = FvInfoSize;
if (ParentFvName != NULL) { if (ParentFvName != NULL) {
ParentFvNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFvName); ParentFvNameValue = AllocateCopyPool(sizeof (EFI_GUID), ParentFvName);
ASSERT (ParentFvNameValue != NULL); ASSERT (ParentFvNameValue != NULL);
FvInfoPpi->ParentFvName = ParentFvNameValue; FvInfoPpi->ParentFvName = ParentFvNameValue;
} }
if (ParentFileName != NULL) { if (ParentFileName != NULL) {
ParentFileNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFileName); ParentFileNameValue = AllocateCopyPool(sizeof (EFI_GUID), ParentFileName);
ASSERT (ParentFileNameValue != NULL); ASSERT (ParentFileNameValue != NULL);
FvInfoPpi->ParentFileName = ParentFileNameValue; FvInfoPpi->ParentFileName = ParentFileNameValue;
} }

View File

@ -231,7 +231,7 @@ SmmIoLibInternalEndOfDxeNotify (
MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors); MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors);
mSmmIoLibGcdMemSpace = AllocateCopyPool (NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap); mSmmIoLibGcdMemSpace = AllocateCopyPool(NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap);
ASSERT (mSmmIoLibGcdMemSpace != NULL); ASSERT (mSmmIoLibGcdMemSpace != NULL);
if (mSmmIoLibGcdMemSpace == NULL) { if (mSmmIoLibGcdMemSpace == NULL) {
gBS->FreePool(MemSpaceMap); gBS->FreePool(MemSpaceMap);

View File

@ -435,7 +435,7 @@ SmmMemLibInternalGetUefiMemoryAttributesTable (
Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable); Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable);
if (!EFI_ERROR(Status) && (MemoryAttributesTable != NULL)) { if (!EFI_ERROR(Status) && (MemoryAttributesTable != NULL)) {
MemoryAttributesTableSize = sizeof(EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries; MemoryAttributesTableSize = sizeof(EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries;
mSmmMemLibMemoryAttributesTable = AllocateCopyPool (MemoryAttributesTableSize, MemoryAttributesTable); mSmmMemLibMemoryAttributesTable = AllocateCopyPool(MemoryAttributesTableSize, MemoryAttributesTable);
ASSERT (mSmmMemLibMemoryAttributesTable != NULL); ASSERT (mSmmMemLibMemoryAttributesTable != NULL);
} }
} }

Some files were not shown because too many files have changed in this diff Show More