1. Perfect libraries MSA files

2. Use MemoryAllocationLib to replace gBS memory services in EdkEt32Pkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2517 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2007-03-30 06:15:19 +00:00
parent db29f969a9
commit fa332de749
43 changed files with 893 additions and 1042 deletions

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -201,7 +201,7 @@ Returns:
// //
PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings); PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings);
EfiStatus = Hii->NewPack (Hii, PackageList, &HiiHandle); EfiStatus = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
if (EFI_ERROR (EfiStatus)) { if (EFI_ERROR (EfiStatus)) {
DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus)); DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus));

View File

@ -445,7 +445,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }
@ -487,7 +487,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_FAILED)); TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -634,7 +634,7 @@ BdsCreateOneLegacyBootOption (
); );
BbsItem->BootPriority = 0x00; BbsItem->BootPriority = 0x00;
gBS->FreePool (DevPath); FreePool (DevPath);
return Status; return Status;
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -518,7 +518,7 @@ Returns:
*String *String
); );
gBS->FreePool (HiiHandleBuffer); FreePool (HiiHandleBuffer);
return Status; return Status;
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -849,13 +849,13 @@ Returns:
// //
PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
BmmCallbackInfo->BmmHiiHandle = HiiHandle; BmmCallbackInfo->BmmHiiHandle = HiiHandle;
PackageList = PreparePackages (1, &gBdsStringPackGuid, FEBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, FEBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
BmmCallbackInfo->FeHiiHandle = HiiHandle; BmmCallbackInfo->FeHiiHandle = HiiHandle;

View File

@ -1,5 +1,5 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1679,7 +1679,7 @@ Returns:
--*/ --*/
{ {
if (Buffer != NULL) { if (Buffer != NULL) {
gBS->FreePool (Buffer); FreePool (Buffer);
Buffer = NULL; Buffer = NULL;
} }
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -179,7 +179,8 @@ BootThisFile (
CHAR16 *ExitData; CHAR16 *ExitData;
BDS_COMMON_OPTION *Option; BDS_COMMON_OPTION *Option;
Status = gBS->AllocatePool (EfiBootServicesData, sizeof (BDS_COMMON_OPTION), &Option); Option = AllocatePool (sizeof (BDS_COMMON_OPTION));
Option->Description = FileContext->FileName; Option->Description = FileContext->FileName;
Option->DevicePath = FileContext->DevicePath; Option->DevicePath = FileContext->DevicePath;
Option->LoadOptionsSize = 0; Option->LoadOptionsSize = 0;

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -170,7 +170,7 @@ Returns:
// //
PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, BdsStrings); PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, BdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gBootManagerHandle); Status = Hii->NewPack (Hii, PackageList, &gBootManagerHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// This example does not implement worker functions // This example does not implement worker functions
@ -296,7 +296,7 @@ Returns:
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
ASSERT (gBrowser); ASSERT (gBrowser);

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -120,7 +120,7 @@ Returns:
PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin);
Status = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle); Status = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// This example does not implement worker functions for the NV accessor functions. Only a callback evaluator // This example does not implement worker functions for the NV accessor functions. Only a callback evaluator
@ -157,7 +157,7 @@ Returns:
// //
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData); Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
return Status; return Status;
} }
@ -337,7 +337,7 @@ Returns:
} }
} }
gBS->FreePool (String); FreePool (String);
CreateGotoOpCode ( CreateGotoOpCode (
0x1000, // Device Manager Page 0x1000, // Device Manager Page
@ -391,7 +391,7 @@ Returns:
// //
// Reset Buffer pointer to original location // Reset Buffer pointer to original location
// //
gBS->FreePool (Buffer); FreePool (Buffer);
} }
} }
// //
@ -406,12 +406,12 @@ Returns:
FPCallbackInfo.Data.VideoBIOS = 0; FPCallbackInfo.Data.VideoBIOS = 0;
} else { } else {
FPCallbackInfo.Data.VideoBIOS = VideoOption[0]; FPCallbackInfo.Data.VideoBIOS = VideoOption[0];
gBS->FreePool (VideoOption); FreePool (VideoOption);
} }
ASSERT (FPCallbackInfo.Data.VideoBIOS <= 1); ASSERT (FPCallbackInfo.Data.VideoBIOS <= 1);
Status = gBS->AllocatePool (EfiBootServicesData, 2 * sizeof (IFR_OPTION), &IfrOptionList); IfrOptionList = AllocatePool (2 * sizeof (IFR_OPTION));
if (IfrOptionList != NULL) { if (IfrOptionList != NULL) {
IfrOptionList[0].Flags = EFI_IFR_FLAG_INTERACTIVE; IfrOptionList[0].Flags = EFI_IFR_FLAG_INTERACTIVE;
IfrOptionList[0].Key = SET_VIDEO_BIOS_TYPE_QUESTION_ID + 0x2000; IfrOptionList[0].Key = SET_VIDEO_BIOS_TYPE_QUESTION_ID + 0x2000;
@ -437,7 +437,7 @@ Returns:
UpdateData->DataCount = 4; UpdateData->DataCount = 4;
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData); Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData);
gBS->FreePool (IfrOptionList); FreePool (IfrOptionList);
} }
BootDeviceMngrMenuResetRequired = FALSE; BootDeviceMngrMenuResetRequired = FALSE;
@ -490,8 +490,8 @@ Returns:
gCallbackKey = 4; gCallbackKey = 4;
} }
gBS->FreePool (UpdateData); FreePool (UpdateData);
gBS->FreePool (HiiHandles); FreePool (HiiHandles);
return Status; return Status;
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -136,7 +136,7 @@ Returns:
Lang Lang
); );
gBS->FreePool (LanguageString); FreePool (LanguageString);
gCallbackKey = 2; gCallbackKey = 2;
break; break;
@ -179,7 +179,7 @@ Returns:
(UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data), (UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data),
0 0
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
break; break;
@ -254,7 +254,7 @@ Returns:
Status = Hii->NewPack (Hii, PackageList, &gFrontPageHandle); Status = Hii->NewPack (Hii, PackageList, &gFrontPageHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// There will be only one FormConfig in the system // There will be only one FormConfig in the system
@ -364,11 +364,11 @@ ReInitStrings:
OptionCount++; OptionCount++;
} }
gBS->FreePool (LanguageString); FreePool (LanguageString);
if (ReInitializeStrings) { if (ReInitializeStrings) {
gBS->FreePool (StringBuffer); FreePool (StringBuffer);
gBS->FreePool (OptionList); FreePool (OptionList);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -389,11 +389,11 @@ ReInitStrings:
Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
// //
// gBS->FreePool (OptionList); // FreePool (OptionList);
// //
gBS->FreePool (StringBuffer); FreePool (StringBuffer);
return Status; return Status;
} }
@ -529,11 +529,11 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (*String); FreePool (*String);
*String = GetStringById (STRING_TOKEN (STR_MISSING_STRING)); *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));
} }
gBS->FreePool (HiiHandleBuffer); FreePool (HiiHandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -689,7 +689,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString); GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[0] = TRUE; Find[0] = TRUE;
} }
@ -700,7 +700,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString); GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[1] = TRUE; Find[1] = TRUE;
} }
@ -711,7 +711,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString); GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[2] = TRUE; Find[2] = TRUE;
} }
@ -722,7 +722,7 @@ Returns:
ConvertProcessorToString (ProcessorFrequency, &NewString); ConvertProcessorToString (ProcessorFrequency, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[3] = TRUE; Find[3] = TRUE;
} }
@ -735,7 +735,7 @@ Returns:
&NewString); &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[4] = TRUE; Find[4] = TRUE;
} }
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -326,7 +326,7 @@ Returns:
HiiHandle = 0; HiiHandle = 0;
Hii->NewPack (Hii, PackageList, &HiiHandle); Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
} }
VOID VOID
@ -421,11 +421,11 @@ Returns:
} }
if (LangCodes) { if (LangCodes) {
gBS->FreePool (LangCodes); FreePool (LangCodes);
} }
if (LanguageString != NULL) { if (LanguageString != NULL) {
gBS->FreePool (LanguageString); FreePool (LanguageString);
} }
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -274,7 +274,7 @@ Returns:
&GenMemoryTest &GenMemoryTest
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (Pos); FreePool (Pos);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -291,7 +291,7 @@ Returns:
// do the test, and then the status of EFI_NO_MEDIA will be returned by // do the test, and then the status of EFI_NO_MEDIA will be returned by
// "MemoryTestInit". So it does not need to test memory again, just return. // "MemoryTestInit". So it does not need to test memory again, just return.
// //
gBS->FreePool (Pos); FreePool (Pos);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -300,7 +300,7 @@ Returns:
if (TmpStr != NULL) { if (TmpStr != NULL) {
gST->ConOut->OutputString (gST->ConOut, TmpStr); gST->ConOut->OutputString (gST->ConOut, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
do { do {
@ -317,7 +317,7 @@ Returns:
PrintXY (10, 10, NULL, NULL, TmpStr); PrintXY (10, 10, NULL, NULL, TmpStr);
gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4); gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4);
gST->ConOut->OutputString (gST->ConOut, TmpStr); gST->ConOut->OutputString (gST->ConOut, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
ASSERT (0); ASSERT (0);
@ -333,7 +333,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT)); TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL); BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST)); TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));
@ -346,7 +346,7 @@ Returns:
TestPercent, TestPercent,
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }
@ -365,7 +365,7 @@ Returns:
100, 100,
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0); gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);
@ -389,7 +389,7 @@ Done:
TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED)); TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
StrCat (StrTotalMemory, TmpStr); StrCat (StrTotalMemory, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
gST->ConOut->ClearScreen (gST->ConOut); gST->ConOut->ClearScreen (gST->ConOut);
@ -405,7 +405,7 @@ Done:
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (Pos); FreePool (Pos);
DataSize = sizeof (Value); DataSize = sizeof (Value);
Status = gRT->GetVariable ( Status = gRT->GetVariable (

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -60,7 +60,7 @@ Returns:
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
PackageList = PreparePackages (1, &gBdsStringPackGuid, BdsStrings); PackageList = PreparePackages (1, &gBdsStringPackGuid, BdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gStringPackHandle); Status = Hii->NewPack (Hii, PackageList, &gStringPackHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
} }
return Status; return Status;
@ -112,7 +112,7 @@ Returns:
// //
// Free the old pool // Free the old pool
// //
gBS->FreePool (String); FreePool (String);
// //
// Allocate new pool with correct value // Allocate new pool with correct value

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -148,7 +148,7 @@ WinNtBlockIoDriverDiagnosticsRunDiagnostics (
if (DiagnosticType != EfiDriverDiagnosticTypeStandard) { if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {
*ErrorType = &gEfiBlockIoProtocolGuid; *ErrorType = &gEfiBlockIoProtocolGuid;
*BufferSize = 0x60; *BufferSize = 0x60;
gBS->AllocatePool (EfiBootServicesData, (UINTN) (*BufferSize), Buffer); Buffer = AllocatePool ((UINTN) (*BufferSize));
CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize); CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }

View File

@ -346,7 +346,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@ -430,12 +430,8 @@ Returns:
WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS); WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS);
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_BLOCK_IO_PRIVATE));
EfiBootServicesData, ASSERT (Private != NULL);
sizeof (WIN_NT_BLOCK_IO_PRIVATE),
&Private
);
ASSERT_EFI_ERROR (Status);
EfiInitializeLock (&Private->Lock, EFI_TPL_NOTIFY); EfiInitializeLock (&Private->Lock, EFI_TPL_NOTIFY);
@ -518,7 +514,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename)); DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename));

View File

@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtBlockIo.h</Filename> <Filename>WinNtBlockIo.h</Filename>

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -164,12 +164,8 @@ Returns:
return Status; return Status;
} }
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -214,7 +210,7 @@ Done:
gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);
} }
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@ -300,7 +296,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -280,12 +280,8 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( InputRecord = AllocatePool (sizeof (INPUT_RECORD) * NtEventCount);
EfiBootServicesData, if (InputRecord == NULL) {
sizeof (INPUT_RECORD) * NtEventCount,
&InputRecord
);
if (EFI_ERROR (Status)) {
Status = EFI_NOT_READY; Status = EFI_NOT_READY;
goto Done; goto Done;
} }
@ -315,7 +311,7 @@ Returns:
Done: Done:
if (InputRecord != NULL) { if (InputRecord != NULL) {
gBS->FreePool (InputRecord); FreePool (InputRecord);
} }
return Status; return Status;

View File

@ -43,6 +43,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>Console.h</Filename> <Filename>Console.h</Filename>

View File

@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtGopScreen.c</Filename> <Filename>WinNtGopScreen.c</Filename>

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -125,12 +125,8 @@ WinNtGopDriverBindingStart (
// Allocate Private context data for SGO inteface. // Allocate Private context data for SGO inteface.
// //
Private = NULL; Private = NULL;
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (GOP_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (GOP_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
// //
@ -185,7 +181,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
} }
gBS->FreePool (Private); FreePool (Private);
} }
} }
@ -270,7 +266,7 @@ WinNtGopDriverBindingStop (
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }

View File

@ -85,7 +85,6 @@ WinNtGopQuerytMode (
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
) )
{ {
EFI_STATUS Status;
GOP_PRIVATE_DATA *Private; GOP_PRIVATE_DATA *Private;
Private = GOP_PRIVATE_DATA_FROM_THIS (This); Private = GOP_PRIVATE_DATA_FROM_THIS (This);
@ -94,13 +93,9 @@ WinNtGopQuerytMode (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Status = gBS->AllocatePool ( *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
EfiBootServicesData, if (*Info == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), return EFI_OUT_OF_RESOURCES;
Info
);
if (EFI_ERROR (Status)) {
return Status;
} }
*SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
@ -242,17 +237,13 @@ WinNtGopSetMode (
} }
Status = gBS->AllocatePool ( NewFillLine = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution);
EfiBootServicesData, if (NewFillLine == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution,
&NewFillLine
);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (Private->FillLine != NULL) { if (Private->FillLine != NULL) {
gBS->FreePool (Private->FillLine); FreePool (Private->FillLine);
} }
Private->FillLine = NewFillLine; Private->FillLine = NewFillLine;
@ -885,8 +876,6 @@ WinNtGopConstructor (
GOP_PRIVATE_DATA *Private GOP_PRIVATE_DATA *Private
) )
{ {
EFI_STATUS Status;
Private->ModeData = mGopModeData; Private->ModeData = mGopModeData;
Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode; Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode;
@ -896,22 +885,15 @@ WinNtGopConstructor (
// //
// Allocate buffer for Graphics Output Protocol mode information // Allocate buffer for Graphics Output Protocol mode information
// //
Status = gBS->AllocatePool ( Private->GraphicsOutput.Mode = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
EfiBootServicesData, if (Private->GraphicsOutput.Mode == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), return EFI_OUT_OF_RESOURCES;
(VOID **) &Private->GraphicsOutput.Mode
);
if (EFI_ERROR (Status)) {
return Status;
} }
Status = gBS->AllocatePool ( Private->GraphicsOutput.Mode->Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
EfiBootServicesData, if (Private->GraphicsOutput.Mode->Info == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), return EFI_OUT_OF_RESOURCES;
(VOID **) &Private->GraphicsOutput.Mode->Info
);
if (EFI_ERROR (Status)) {
return Status;
} }
Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA); Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA);
// //
// Till now, we have no idea about the window size. // Till now, we have no idea about the window size.
@ -982,9 +964,9 @@ WinNtGopDestructor (
// //
if (Private->GraphicsOutput.Mode != NULL) { if (Private->GraphicsOutput.Mode != NULL) {
if (Private->GraphicsOutput.Mode->Info != NULL) { if (Private->GraphicsOutput.Mode->Info != NULL) {
gBS->FreePool (Private->GraphicsOutput.Mode->Info); FreePool (Private->GraphicsOutput.Mode->Info);
} }
gBS->FreePool (Private->GraphicsOutput.Mode); FreePool (Private->GraphicsOutput.Mode);
} }
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -309,7 +309,7 @@ Returns:
} }
} }
gBS->FreePool (OpenInfoBuffer); FreePool (OpenInfoBuffer);
return Status; return Status;
} }
@ -334,12 +334,8 @@ Returns:
// //
// Construct Private data // Construct Private data
// //
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Error; goto Error;
} }
@ -474,12 +470,12 @@ Error:
} }
if (Private->DevicePath != NULL) { if (Private->DevicePath != NULL) {
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
} }
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
} }
@ -592,11 +588,11 @@ Returns:
} else { } else {
Private->WinNtThunk->CloseHandle (Private->NtHandle); Private->WinNtThunk->CloseHandle (Private->NtHandle);
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
} }
@ -869,7 +865,7 @@ Returns:
} }
if (Private->DevicePath != NULL) { if (Private->DevicePath != NULL) {
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
} }
Private->DevicePath = NewDevicePath; Private->DevicePath = NewDevicePath;

View File

@ -47,6 +47,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword> <Keyword>DevicePathLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtSerialIo.h</Filename> <Filename>WinNtSerialIo.h</Filename>

View File

@ -284,12 +284,10 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE), Status = EFI_OUT_OF_RESOURCES;
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -298,14 +296,9 @@ Returns:
Private->FilePath = WinNtIo->EnvString; Private->FilePath = WinNtIo->EnvString;
Private->VolumeLabel = NULL; Private->VolumeLabel = AllocatePool (StrSize (L"EFI_EMULATED"));
Status = gBS->AllocatePool ( if (Private->VolumeLabel == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (L"EFI_EMULATED"),
&Private->VolumeLabel
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -339,7 +332,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
gBS->CloseProtocol ( gBS->CloseProtocol (
@ -431,7 +424,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@ -489,33 +482,21 @@ Returns:
Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This); Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);
PrivateFile = NULL; PrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));
Status = gBS->AllocatePool ( if (PrivateFile == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
sizeof (WIN_NT_EFI_FILE_PRIVATE),
&PrivateFile
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
PrivateFile->FileName = NULL; PrivateFile->FileName = AllocatePool (StrSize (Private->FilePath));
Status = gBS->AllocatePool ( if (PrivateFile->FileName == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (Private->FilePath),
&PrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
PrivateFile->FilePath = NULL; PrivateFile->FilePath = AllocatePool (StrSize (Private->FilePath));
Status = gBS->AllocatePool ( if (PrivateFile->FilePath == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (Private->FilePath),
&PrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -550,14 +531,14 @@ Done:
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (PrivateFile) { if (PrivateFile) {
if (PrivateFile->FileName) { if (PrivateFile->FileName) {
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
} }
if (PrivateFile->FilePath) { if (PrivateFile->FilePath) {
gBS->FreePool (PrivateFile->FilePath); FreePool (PrivateFile->FilePath);
} }
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
} }
} }
@ -675,13 +656,9 @@ Returns:
// //
// Allocate buffer for FileName as the passed in FileName may be read only // Allocate buffer for FileName as the passed in FileName may be read only
// //
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (FileName));
EfiBootServicesData, if (TempFileName == NULL) {
StrSize (FileName), return EFI_OUT_OF_RESOURCES;
&TempFileName
);
if (EFI_ERROR (Status)) {
return Status;
} }
StrCpy (TempFileName, FileName); StrCpy (TempFileName, FileName);
FileName = TempFileName; FileName = TempFileName;
@ -733,27 +710,17 @@ OpenRoot:
// //
// Attempt to open the file // Attempt to open the file
// //
Status = gBS->AllocatePool ( NewPrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));
EfiBootServicesData, if (NewPrivateFile == NULL) {
sizeof (WIN_NT_EFI_FILE_PRIVATE), Status = EFI_OUT_OF_RESOURCES;
&NewPrivateFile
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE)); CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE));
NewPrivateFile->FilePath = NULL; NewPrivateFile->FilePath = AllocatePool (StrSize (PrivateFile->FileName));
if (NewPrivateFile->FilePath == NULL) {
Status = gBS->AllocatePool ( Status = EFI_OUT_OF_RESOURCES;
EfiBootServicesData,
StrSize (PrivateFile->FileName),
&NewPrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -763,14 +730,9 @@ OpenRoot:
StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath); StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath);
} }
NewPrivateFile->FileName = NULL; NewPrivateFile->FileName = AllocatePool (StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName));
Status = gBS->AllocatePool ( if (NewPrivateFile->FileName == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName),
&NewPrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -847,9 +809,9 @@ OpenRoot:
if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) { if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) {
NewPrivateFile->IsRootDirectory = TRUE; NewPrivateFile->IsRootDirectory = TRUE;
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
gBS->FreePool (NewPrivateFile->FileName); FreePool (NewPrivateFile->FileName);
gBS->FreePool (NewPrivateFile); FreePool (NewPrivateFile);
goto OpenRoot; goto OpenRoot;
} }
@ -861,15 +823,11 @@ OpenRoot:
TempChar = *(RealFileName - 1); TempChar = *(RealFileName - 1);
*(RealFileName - 1) = 0; *(RealFileName - 1) = 0;
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
NewPrivateFile->FilePath = NULL; NewPrivateFile->FilePath = NULL;
Status = gBS->AllocatePool ( NewPrivateFile->FilePath = AllocatePool (StrSize (NewPrivateFile->FileName));
EfiBootServicesData, if (NewPrivateFile->FilePath == NULL) {
StrSize (NewPrivateFile->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewPrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -923,13 +881,9 @@ OpenRoot:
// //
if (NewPrivateFile->IsDirectoryPath) { if (NewPrivateFile->IsDirectoryPath) {
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"));
EfiBootServicesData, if (TempFileName == NULL) {
StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"), Status = EFI_OUT_OF_RESOURCES;
&TempFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -943,7 +897,7 @@ OpenRoot:
LastError = PrivateFile->WinNtThunk->GetLastError (); LastError = PrivateFile->WinNtThunk->GetLastError ();
if (LastError != ERROR_ALREADY_EXISTS) { if (LastError != ERROR_ALREADY_EXISTS) {
gBS->FreePool (TempFileName); FreePool (TempFileName);
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
goto Done; goto Done;
} }
@ -1059,13 +1013,9 @@ OpenRoot:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( Info = AllocatePool (InfoSize);
EfiBootServicesData, if (Info == NULL) {
InfoSize, Status = EFI_OUT_OF_RESOURCES;
&Info
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -1081,19 +1031,19 @@ OpenRoot:
} }
Done: ; Done: ;
gBS->FreePool (FileName); FreePool (FileName);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (NewPrivateFile) { if (NewPrivateFile) {
if (NewPrivateFile->FileName) { if (NewPrivateFile->FileName) {
gBS->FreePool (NewPrivateFile->FileName); FreePool (NewPrivateFile->FileName);
} }
if (NewPrivateFile->FilePath) { if (NewPrivateFile->FilePath) {
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
} }
gBS->FreePool (NewPrivateFile); FreePool (NewPrivateFile);
} }
} else { } else {
*NewHandle = &NewPrivateFile->EfiFile; *NewHandle = &NewPrivateFile->EfiFile;
@ -1151,10 +1101,10 @@ Returns:
} }
if (PrivateFile->FileName) { if (PrivateFile->FileName) {
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
} }
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@ -1223,8 +1173,8 @@ Returns:
} }
} }
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@ -1344,11 +1294,7 @@ Returns:
} }
FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO; FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO;
gBS->AllocatePool ( FileInfo = AllocatePool (FileInfoSize);
EfiBootServicesData,
FileInfoSize,
&FileInfo
);
Status = This->GetInfo ( Status = This->GetInfo (
This, This,
@ -1358,12 +1304,8 @@ Returns:
); );
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
gBS->FreePool (FileInfo); FreePool (FileInfo);
gBS->AllocatePool ( FileInfo = AllocatePool (FileInfoSize);
EfiBootServicesData,
FileInfoSize,
&FileInfo
);
Status = This->GetInfo ( Status = This->GetInfo (
This, This,
&gEfiFileInfoGuid, &gEfiFileInfoGuid,
@ -1379,7 +1321,7 @@ Returns:
FileSize = FileInfo->FileSize; FileSize = FileInfo->FileSize;
gBS->FreePool (FileInfo); FreePool (FileInfo);
if (Pos >= FileSize) { if (Pos >= FileSize) {
*BufferSize = 0; *BufferSize = 0;
@ -1628,13 +1570,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( FileName = AllocatePool (StrSize (PrivateFile->FileName) + StrSize (L"\\*"));
EfiBootServicesData, if (FileName == NULL) {
StrSize (PrivateFile->FileName) + StrSize (L"\\*"), Status = EFI_OUT_OF_RESOURCES;
&FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -1653,7 +1591,7 @@ Returns:
PrivateFile->IsValidFindBuf = TRUE; PrivateFile->IsValidFindBuf = TRUE;
} }
gBS->FreePool (FileName); FreePool (FileName);
Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS; Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
} else { } else {
@ -1956,14 +1894,10 @@ Returns:
// //
// Try to get the drive name // Try to get the drive name
// //
DriveName = NULL;
DriveNameFound = FALSE; DriveNameFound = FALSE;
Status = gBS->AllocatePool ( DriveName = AllocatePool (StrSize (PrivateFile->FilePath) + 1);
EfiBootServicesData, if (DriveName == NULL) {
StrSize (PrivateFile->FilePath) + 1, Status = EFI_OUT_OF_RESOURCES;
&DriveName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -2003,7 +1937,7 @@ Returns:
&TotalClusters &TotalClusters
); );
if (DriveName) { if (DriveName) {
gBS->FreePool (DriveName); FreePool (DriveName);
} }
if (NtStatus) { if (NtStatus) {
@ -2161,16 +2095,10 @@ Returns:
NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer; NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer;
gBS->FreePool (PrivateRoot->VolumeLabel); FreePool (PrivateRoot->VolumeLabel);
PrivateRoot->VolumeLabel = AllocatePool (StrSize (NewFileSystemInfo->VolumeLabel));
PrivateRoot->VolumeLabel = NULL; if (PrivateRoot->VolumeLabel == NULL) {
Status = gBS->AllocatePool ( Status = EFI_OUT_OF_RESOURCES;
EfiBootServicesData,
StrSize (NewFileSystemInfo->VolumeLabel),
&PrivateRoot->VolumeLabel
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -2240,9 +2168,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool (EfiBootServicesData, OldInfoSize, &OldFileInfo); OldFileInfo = AllocatePool (OldInfoSize);
if (OldFileInfo == NULL) {
if (EFI_ERROR (Status)) { Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;
} }
@ -2252,13 +2180,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( OldFileName = AllocatePool (StrSize (PrivateFile->FileName));
EfiBootServicesData, if (OldFileName == NULL) {
StrSize (PrivateFile->FileName), Status = EFI_OUT_OF_RESOURCES;
&OldFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -2268,13 +2192,9 @@ Returns:
// Make full pathname from new filename and rootpath. // Make full pathname from new filename and rootpath.
// //
if (NewFileInfo->FileName[0] == '\\') { if (NewFileInfo->FileName[0] == '\\') {
Status = gBS->AllocatePool ( NewFileName = AllocatePool (StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));
EfiBootServicesData, if (NewFileName == NULL) {
StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -2282,13 +2202,9 @@ Returns:
StrCat (NewFileName, L"\\"); StrCat (NewFileName, L"\\");
StrCat (NewFileName, NewFileInfo->FileName + 1); StrCat (NewFileName, NewFileInfo->FileName + 1);
} else { } else {
Status = gBS->AllocatePool ( NewFileName = AllocatePool (StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));
EfiBootServicesData, if (NewFileName == NULL) {
StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@ -2394,30 +2310,22 @@ Returns:
// //
// modify file name // modify file name
// //
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
Status = gBS->AllocatePool ( PrivateFile->FileName = AllocatePool (StrSize (NewFileName));
EfiBootServicesData, if (PrivateFile->FileName == NULL) {
StrSize (NewFileName), Status = EFI_OUT_OF_RESOURCES;
&PrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
StrCpy (PrivateFile->FileName, NewFileName); StrCpy (PrivateFile->FileName, NewFileName);
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (NewFileName) + StrSize (L"\\*"));
EfiBootServicesData,
StrSize (NewFileName) + StrSize (L"\\*"),
&TempFileName
);
StrCpy (TempFileName, NewFileName); StrCpy (TempFileName, NewFileName);
if (!PrivateFile->IsDirectoryPath) { if (!PrivateFile->IsDirectoryPath) {
PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile ( PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (
TempFileName, TempFileName,
PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
@ -2427,7 +2335,7 @@ Returns:
NULL NULL
); );
gBS->FreePool (TempFileName); FreePool (TempFileName);
// //
// Flush buffers just in case // Flush buffers just in case
@ -2450,7 +2358,7 @@ Returns:
StrCat (TempFileName, L"\\*"); StrCat (TempFileName, L"\\*");
PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf); PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);
gBS->FreePool (TempFileName); FreePool (TempFileName);
} }
} else { } else {
Reopen: ; Reopen: ;
@ -2462,11 +2370,7 @@ Reopen: ;
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (OldFileName) + StrSize (L"\\*"));
EfiBootServicesData,
StrSize (OldFileName) + StrSize (L"\\*"),
&TempFileName
);
StrCpy (TempFileName, OldFileName); StrCpy (TempFileName, OldFileName);
@ -2495,7 +2399,7 @@ Reopen: ;
PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf); PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);
} }
gBS->FreePool (TempFileName); FreePool (TempFileName);
goto Done; goto Done;
@ -2637,15 +2541,15 @@ Reopen: ;
Done: Done:
if (OldFileInfo != NULL) { if (OldFileInfo != NULL) {
gBS->FreePool (OldFileInfo); FreePool (OldFileInfo);
} }
if (OldFileName != NULL) { if (OldFileName != NULL) {
gBS->FreePool (OldFileName); FreePool (OldFileName);
} }
if (NewFileName != NULL) { if (NewFileName != NULL) {
gBS->FreePool (NewFileName); FreePool (NewFileName);
} }
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);

View File

@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtSimpleFileSystem.h</Filename> <Filename>WinNtSimpleFileSystem.h</Filename>

View File

@ -43,6 +43,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtUga.h</Filename> <Filename>WinNtUga.h</Filename>

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -137,13 +137,8 @@ Returns:
// //
// Allocate Private context data for SGO inteface. // Allocate Private context data for SGO inteface.
// //
Private = NULL; Private = AllocatePool (sizeof (UGA_PRIVATE_DATA));
Status = gBS->AllocatePool ( if (Private == NULL) {
EfiBootServicesData,
sizeof (UGA_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
// //
@ -198,7 +193,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
} }
gBS->FreePool (Private); FreePool (Private);
} }
} }
@ -287,7 +282,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }

View File

@ -224,17 +224,13 @@ WinNtUgaSetMode (
} }
Status = gBS->AllocatePool ( NewFillLine = AllocatePool (sizeof (EFI_UGA_PIXEL) * HorizontalResolution);
EfiBootServicesData, if (NewFillLine == NULL) {
sizeof (EFI_UGA_PIXEL) * HorizontalResolution,
&NewFillLine
);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (Private->FillLine != NULL) { if (Private->FillLine != NULL) {
gBS->FreePool (Private->FillLine); FreePool (Private->FillLine);
} }
Private->FillLine = NewFillLine; Private->FillLine = NewFillLine;

View File

@ -136,18 +136,11 @@ AllocateMemory (
IN UINTN Size IN UINTN Size
) )
{ {
EFI_STATUS Status;
VOID *Buffer; VOID *Buffer;
Status = gBS->AllocatePool ( Buffer = AllocatePool (Size);
EfiBootServicesData, ASSERT (Buffer != NULL);
Size,
(VOID *)&Buffer
);
if (EFI_ERROR (Status)) {
ASSERT (FALSE);
return NULL;
}
return Buffer; return Buffer;
} }
@ -341,13 +334,9 @@ Returns:
} }
if (Status != EFI_ALREADY_STARTED) { if (Status != EFI_ALREADY_STARTED) {
Status = gBS->AllocatePool ( WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));
EfiBootServicesData, if (WinNtBusDevice == NULL) {
sizeof (WIN_NT_BUS_DEVICE), return EFI_OUT_OF_RESOURCES;
(VOID *) &WinNtBusDevice
);
if (EFI_ERROR (Status)) {
return Status;
} }
WinNtBusDevice->Signature = WIN_NT_BUS_DEVICE_SIGNATURE; WinNtBusDevice->Signature = WIN_NT_BUS_DEVICE_SIGNATURE;
@ -368,7 +357,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
gBS->FreePool (WinNtBusDevice); FreePool (WinNtBusDevice);
return Status; return Status;
} }
} }
@ -464,7 +453,7 @@ Returns:
Count Count
); );
if (WinNtDevice->DevicePath == NULL) { if (WinNtDevice->DevicePath == NULL) {
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -490,7 +479,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
} else { } else {
// //
// Open For Child Device // Open For Child Device
@ -516,7 +505,7 @@ Returns:
StartString = SubString; StartString = SubString;
} }
gBS->FreePool (TempStr); FreePool (TempStr);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@ -588,7 +577,7 @@ Returns:
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
gBS->FreePool (WinNtBusDevice); FreePool (WinNtBusDevice);
gBS->CloseProtocol ( gBS->CloseProtocol (
ControllerHandle, ControllerHandle,
@ -652,7 +641,7 @@ Returns:
// Close the child handle // Close the child handle
// //
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
} }
} }

View File

@ -51,6 +51,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword> <Keyword>DevicePathLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtBusDriver.h</Filename> <Filename>WinNtBusDriver.h</Filename>

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -417,12 +417,8 @@ Returns:
CPU_ARCH_PROTOCOL_PRIVATE *Private; CPU_ARCH_PROTOCOL_PRIVATE *Private;
VOID *Registration; VOID *Registration;
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (CPU_ARCH_PROTOCOL_PRIVATE));
EfiBootServicesData, ASSERT (Private != NULL);
sizeof (CPU_ARCH_PROTOCOL_PRIVATE),
&Private
);
ASSERT_EFI_ERROR (Status);
Private->Signature = CPU_ARCH_PROT_PRIVATE_SIGNATURE; Private->Signature = CPU_ARCH_PROT_PRIVATE_SIGNATURE;
Private->Cpu.FlushDataCache = WinNtFlushCpuDataCache; Private->Cpu.FlushDataCache = WinNtFlushCpuDataCache;
@ -656,7 +652,7 @@ Returns:
Status = Hii->NewPack (Hii, PackageList, &StringHandle); Status = Hii->NewPack (Hii, PackageList, &StringHandle);
ASSERT (!EFI_ERROR (Status)); ASSERT (!EFI_ERROR (Status));
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// Store processor version data record to data hub // Store processor version data record to data hub
@ -717,7 +713,7 @@ Returns:
TotalSize TotalSize
); );
gBS->FreePool (RecordBuffer.Raw); FreePool (RecordBuffer.Raw);
} }
gBS->CloseProtocol ( gBS->CloseProtocol (

View File

@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>DxeWinNtLib</OutputFileBasename> <OutputFileBasename>DxeWinNtLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">
<Keyword>WinNtLib</Keyword> <Keyword>WinNtLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -240,7 +240,7 @@ Returns:
BlkIo->Media->BlockSize, BlkIo->Media->BlockSize,
Buffer Buffer
); );
gBS->FreePool (Buffer); FreePool (Buffer);
} }
} }
@ -460,7 +460,7 @@ Returns:
} }
} }
gBS->FreePool (BlockIoBuffer); FreePool (BlockIoBuffer);
return Status; return Status;
} }
@ -532,7 +532,7 @@ Returns:
&BootOptionSize &BootOptionSize
); );
if (NULL == BootOptionVar) { if (NULL == BootOptionVar) {
gBS->FreePool (BootOrder); FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -549,11 +549,11 @@ Returns:
if ((OptionDevicePathSize == DevicePathSize) && if ((OptionDevicePathSize == DevicePathSize) &&
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) { (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize); BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
break; break;
} }
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
} }
@ -565,7 +565,7 @@ Returns:
BootOrder BootOrder
); );
gBS->FreePool (BootOrder); FreePool (BootOrder);
return Status; return Status;
} }
@ -636,7 +636,7 @@ Returns:
&BootOptionSize &BootOptionSize
); );
if (NULL == BootOptionVar) { if (NULL == BootOptionVar) {
gBS->FreePool (BootOrder); FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -652,7 +652,7 @@ Returns:
// //
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) && if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) { (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
continue; continue;
} }
@ -673,7 +673,7 @@ Returns:
// Skip boot option for internal Shell, it's always valid // Skip boot option for internal Shell, it's always valid
// //
(EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) { (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) {
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
continue; continue;
} }
@ -721,7 +721,7 @@ Returns:
BootOrder[Index] = 0xffff; BootOrder[Index] = 0xffff;
} }
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
} }
@ -743,7 +743,7 @@ Returns:
BootOrder BootOrder
); );
gBS->FreePool (BootOrder); FreePool (BootOrder);
return Status; return Status;
} }
@ -877,7 +877,7 @@ Returns:
} }
if (NumberFileSystemHandles) { if (NumberFileSystemHandles) {
gBS->FreePool (FileSystemHandles); FreePool (FileSystemHandles);
} }
// //
// Parse Network Boot Device // Parse Network Boot Device
@ -904,7 +904,7 @@ Returns:
} }
if (NumberLoadFileHandles) { if (NumberLoadFileHandles) {
gBS->FreePool (LoadFileHandles); FreePool (LoadFileHandles);
} }
// //
// Check if we have on flash shell // Check if we have on flash shell
@ -946,7 +946,7 @@ Returns:
} }
if (FvHandleCount) { if (FvHandleCount) {
gBS->FreePool (FvHandleBuffer); FreePool (FvHandleBuffer);
} }
// //
// Make sure every boot only have one time // Make sure every boot only have one time

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -206,7 +206,7 @@ Returns:
} while (DevicePath != NULL); } while (DevicePath != NULL);
if (CopyOfDevicePath != NULL) { if (CopyOfDevicePath != NULL) {
gBS->FreePool (CopyOfDevicePath); FreePool (CopyOfDevicePath);
} }
// //
// All handle with DevicePath exists in the handle database // All handle with DevicePath exists in the handle database
@ -257,7 +257,7 @@ Returns:
Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
} }
gBS->FreePool (HandleBuffer); FreePool (HandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -308,7 +308,7 @@ Returns:
Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
} }
gBS->FreePool (HandleBuffer); FreePool (HandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -250,7 +250,7 @@ Returns:
BdsLibSafeFreePool(Instance); BdsLibSafeFreePool(Instance);
} while (CopyOfDevicePath != NULL); } while (CopyOfDevicePath != NULL);
gBS->FreePool (StartDevicePath); FreePool (StartDevicePath);
if (DeviceExist == FALSE) { if (DeviceExist == FALSE) {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;

View File

@ -249,11 +249,13 @@ Returns:
ZeroMem (OptionName, sizeof (OptionName)); ZeroMem (OptionName, sizeof (OptionName));
TempOptionSize = 0; TempOptionSize = 0;
TempOptionPtr = BdsLibGetVariableAndSize ( TempOptionPtr = BdsLibGetVariableAndSize (
VariableName, VariableName,
&gEfiGlobalVariableGuid, &gEfiGlobalVariableGuid,
&TempOptionSize &TempOptionSize
); );
// //
// Compare with current option variable // Compare with current option variable
// //
@ -290,8 +292,8 @@ Returns:
// //
// Got the option, so just return // Got the option, so just return
// //
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
return EFI_SUCCESS; return EFI_SUCCESS;
} else { } else {
// //
@ -302,7 +304,7 @@ Returns:
} }
} }
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
} }
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath); OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath);
@ -342,12 +344,12 @@ Returns:
OptionPtr OptionPtr
); );
if (EFI_ERROR (Status) || UpdateBootDevicePath) { if (EFI_ERROR (Status) || UpdateBootDevicePath) {
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
return Status; return Status;
} }
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
// //
// Update the option order variable // Update the option order variable
@ -363,13 +365,15 @@ Returns:
OptionOrderPtr OptionOrderPtr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
gBS->FreePool (OptionOrderPtr); FreePool (OptionOrderPtr);
return Status; return Status;
} }
gBS->FreePool (TempOptionPtr); if (TempOptionPtr != NULL) {
gBS->FreePool (OptionOrderPtr); FreePool (TempOptionPtr);
}
FreePool (OptionOrderPtr);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -482,12 +486,12 @@ Returns:
// //
if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) { if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {
InsertTailList (BdsCommonOptionList, &Option->Link); InsertTailList (BdsCommonOptionList, &Option->Link);
gBS->FreePool (Variable); FreePool (Variable);
return Option; return Option;
} }
gBS->FreePool (Variable); FreePool (Variable);
gBS->FreePool (Option); FreePool (Option);
return NULL; return NULL;
} }
@ -553,7 +557,7 @@ Returns:
} }
gBS->FreePool (OptionOrder); FreePool (OptionOrder);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -641,7 +645,7 @@ Returns:
--*/ --*/
{ {
if (Buffer != NULL) { if (Buffer != NULL) {
gBS->FreePool (Buffer); FreePool (Buffer);
Buffer = NULL; Buffer = NULL;
} }
} }
@ -756,11 +760,11 @@ Returns:
// return success // return success
// //
if (CompareMem (Single, DevicePathInst, Size) == 0) { if (CompareMem (Single, DevicePathInst, Size) == 0) {
gBS->FreePool (DevicePathInst); FreePool (DevicePathInst);
return TRUE; return TRUE;
} }
gBS->FreePool (DevicePathInst); FreePool (DevicePathInst);
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
} }
@ -1021,8 +1025,8 @@ Returns:
Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2); Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2);
} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN)); } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
gBS->FreePool (StringBuffer1); FreePool (StringBuffer1);
gBS->FreePool (StringBuffer2); FreePool (StringBuffer2);
// //
// If the user hits the YES Response key, reset // If the user hits the YES Response key, reset
// //

View File

@ -71,7 +71,7 @@ Returns:
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
} }
gBS->FreePool (OldPool); FreePool (OldPool);
} }
return NewPool; return NewPool;
@ -137,7 +137,7 @@ Returns:
Str->len = strsize - sizeof (UINT16); Str->len = strsize - sizeof (UINT16);
} }
gBS->FreePool (AppendStr); FreePool (AppendStr);
return Str->str; return Str->str;
} }
@ -1059,7 +1059,7 @@ DevicePathToStr (
// //
// Shrink pool used for string allocation // Shrink pool used for string allocation
// //
gBS->FreePool (DevPath); FreePool (DevPath);
Done: Done:
NewSize = (Str.len + 1) * sizeof (CHAR16); NewSize = (Str.len + 1) * sizeof (CHAR16);

View File

@ -20,12 +20,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkGenericBdsLib</OutputFileBasename> <OutputFileBasename>EdkGenericBdsLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER">
<Keyword>EdkGenericBdsLib</Keyword> <Keyword>EdkGenericBdsLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
@ -76,7 +76,6 @@
<Filename>Performance.h</Filename> <Filename>Performance.h</Filename>
<Filename>Performance.c</Filename> <Filename>Performance.c</Filename>
<Filename>BdsMisc.c</Filename> <Filename>BdsMisc.c</Filename>
<Filename SupArchList="IPF">Ipf/ShadowRom.c</Filename>
</SourceFiles> </SourceFiles>
<PackageDependencies> <PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -328,7 +328,7 @@ Returns:
} }
} }
gBS->FreePool (Handles); FreePool (Handles);
// //
// Get inserted performance data // Get inserted performance data

View File

@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename> <OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="PEI_CORE PEIM">
<Keyword>PeCoffGetEntryPointLib</Keyword> <Keyword>PeCoffGetEntryPointLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">

View File

@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename> <OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE PEIM">
<Keyword>EdkPeCoffLoaderLib</Keyword> <Keyword>EdkPeCoffLoaderLib</Keyword>
</LibraryClass> </LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1252,12 +1252,8 @@ Returns:
// Allocate runtime services data for global variable, which contains // Allocate runtime services data for global variable, which contains
// the private data of all firmware volume block instances // the private data of all firmware volume block instances
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal != NULL);
sizeof (ESAL_FWB_GLOBAL),
&mFvbModuleGlobal
);
ASSERT_EFI_ERROR (Status);
// //
// Calculate the total size for all firmware volume block instances // Calculate the total size for all firmware volume block instances
@ -1306,12 +1302,8 @@ Returns:
// the private data of each FV instance. But in virtual mode or in physical // the private data of each FV instance. But in virtual mode or in physical
// mode, the address of the the physical memory may be different. // mode, the address of the the physical memory may be different.
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);
BufferSize,
&mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]
);
ASSERT_EFI_ERROR (Status);
// //
// Make a virtual copy of the FvInstance pointer. // Make a virtual copy of the FvInstance pointer.
@ -1392,12 +1384,8 @@ Returns:
// //
// Add a FVB Protocol Instance // Add a FVB Protocol Instance
// //
Status = gBS->AllocatePool ( FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));
EfiRuntimeServicesData, ASSERT (FvbDevice != NULL);
sizeof (EFI_FW_VOL_BLOCK_DEVICE),
&FvbDevice
);
ASSERT_EFI_ERROR (Status);
CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE)); CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));
@ -1481,12 +1469,8 @@ Returns:
// //
// Allocate for scratch space, an intermediate buffer for FVB extention // Allocate for scratch space, an intermediate buffer for FVB extention
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] = AllocateRuntimePool (MaxLbaSize);
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] != NULL);
MaxLbaSize,
&mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]
);
ASSERT_EFI_ERROR (Status);
mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]; mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL];