/** @file\r
Provides interface to advanced shell functionality for parsing both handle and protocol database.\r
\r
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
ASSERT_EFI_ERROR(Status);\r
\r
- RetVal = AllocatePool(VersionStringSize);\r
+ RetVal = AllocateZeroPool(VersionStringSize);\r
ASSERT(RetVal != NULL);\r
UnicodeSPrint(RetVal, VersionStringSize, L"0x%08x", DriverEfiVersion->FirmwareVersion);\r
return (RetVal);\r
gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);\r
}\r
}\r
- if (Verbose && Temp != NULL && StrLen(Temp) > 30) {\r
+ if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {\r
Temp2 = NULL;\r
Temp2 = StrnCatGrow(&Temp2, NULL, Temp+(StrLen(Temp) - 30), 30);\r
FreePool(Temp);\r
return (Status);\r
}\r
for (mHandleList.NextIndex = 1 ; mHandleList.NextIndex <= HandleCount ; mHandleList.NextIndex++){\r
- ListWalker = AllocatePool(sizeof(HANDLE_LIST));\r
+ ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST));\r
ASSERT(ListWalker != NULL);\r
ListWalker->TheHandle = HandleBuffer[mHandleList.NextIndex-1];\r
ListWalker->TheIndex = mHandleList.NextIndex;\r
)\r
{\r
HANDLE_LIST *ListWalker;\r
- ASSERT(TheHandle!=NULL);\r
+ if (TheHandle == NULL) {\r
+ return 0;\r
+ }\r
\r
InternalShellInitHandleList();\r
\r
return (ListWalker->TheIndex);\r
}\r
}\r
- ListWalker = AllocatePool(sizeof(HANDLE_LIST));\r
+ ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST));\r
ASSERT(ListWalker != NULL);\r
ListWalker->TheHandle = TheHandle;\r
ListWalker->TheIndex = mHandleList.NextIndex++;\r
//\r
// Allocate a handle buffer for the number of handles that matched the attributes in Mask\r
//\r
- *MatchingHandleBuffer = AllocatePool ((*MatchingHandleCount +1)* sizeof (EFI_HANDLE));\r
+ *MatchingHandleBuffer = AllocateZeroPool ((*MatchingHandleCount +1)* sizeof (EFI_HANDLE));\r
ASSERT(*MatchingHandleBuffer != NULL);\r
\r
for (HandleIndex = 0,*MatchingHandleCount = 0\r
)\r
{\r
EFI_STATUS Status;\r
- UINTN HandleIndex;\r
+// UINTN HandleIndex;\r
UINTN DriverBindingHandleCount;\r
EFI_HANDLE *DriverBindingHandleBuffer;\r
UINTN DriverBindingHandleIndex;\r
UINTN ChildControllerHandleCount;\r
EFI_HANDLE *ChildControllerHandleBuffer;\r
UINTN ChildControllerHandleIndex;\r
- BOOLEAN Found;\r
+// BOOLEAN Found;\r
EFI_HANDLE *HandleBufferForReturn;\r
\r
if (MatchingHandleCount == NULL) {\r
ChildControllerHandleIndex < ChildControllerHandleCount;\r
ChildControllerHandleIndex++\r
) {\r
- Found = FALSE;\r
- for (HandleIndex = 0; HandleBufferForReturn[HandleIndex] != NULL; HandleIndex++) {\r
- if (HandleBufferForReturn[HandleIndex] == ChildControllerHandleBuffer[ChildControllerHandleIndex]) {\r
- Found = TRUE;\r
- break;\r
- }\r
- }\r
-\r
- if (!Found) {\r
- HandleBufferForReturn[(*MatchingHandleCount)++] = ChildControllerHandleBuffer[ChildControllerHandleIndex];\r
- }\r
+// Found = FALSE;\r
+ HandleBufferForReturn[(*MatchingHandleCount)++] = ChildControllerHandleBuffer[ChildControllerHandleIndex];\r
+// for (HandleIndex = 0; HandleBufferForReturn[HandleIndex] != NULL; HandleIndex++) {\r
+// if (HandleBufferForReturn[HandleIndex] == ChildControllerHandleBuffer[ChildControllerHandleIndex]) {\r
+// Found = TRUE;\r
+// break;\r
+// }\r
+// }\r
+\r
+// if (Found) {\r
+// HandleBufferForReturn[(*MatchingHandleCount)++] = ChildControllerHandleBuffer[ChildControllerHandleIndex];\r
+// }\r
}\r
\r
FreePool (ChildControllerHandleBuffer);\r
\r
if (LocalDestinationSize == 0) {\r
// allcoate\r
- *DestinationBuffer = AllocatePool(LocalDestinationFinalSize);\r
+ *DestinationBuffer = AllocateZeroPool(LocalDestinationFinalSize);\r
} else {\r
// reallocate\r
*DestinationBuffer = ReallocatePool(LocalDestinationSize, LocalDestinationFinalSize, *DestinationBuffer);\r
if (ProtocolGuid == NULL) {\r
Status = gBS->LocateHandle(AllHandles, NULL, NULL, &Size, HandleList);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
- HandleList = AllocatePool(Size + sizeof(EFI_HANDLE));\r
+ HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE));\r
if (HandleList == NULL) {\r
return (NULL);\r
}\r
} else {\r
Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)ProtocolGuid, NULL, &Size, HandleList);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
- HandleList = AllocatePool(Size + sizeof(EFI_HANDLE));\r
+ HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE));\r
if (HandleList == NULL) {\r
return (NULL);\r
}\r