mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
1, For Pcd_PPI, UnregistedCallBack should return EFI_INVALID_PARAMETER if Callback function can not be found.
2, PCD_PPI/PROTOCOL should return EFI_INVALID_PARAMETER if size is unmatched git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10276 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2db63cd4fa
commit
8ec8bed439
@ -740,9 +740,15 @@ SetWorker (
|
|||||||
//
|
//
|
||||||
ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);
|
ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);
|
||||||
|
|
||||||
if ((!PtrType) && (*Size != DxePcdGetSize (TokenNumber + 1))) {
|
if (PtrType) {
|
||||||
|
if (*Size > DxePcdGetSize (TokenNumber + 1)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (*Size != DxePcdGetSize (TokenNumber + 1)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// EBC compiler is very choosy. It may report warning about comparison
|
// EBC compiler is very choosy. It may report warning about comparison
|
||||||
|
@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
@retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
|
@retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
|
||||||
@retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
|
@retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
|
||||||
slot left in the CallbackFnTable.
|
slot left in the CallbackFnTable.
|
||||||
|
@retval EFI_INVALID_PARAMETER If the callback function want to be de-registered can not be found.
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
PeiRegisterCallBackWorker (
|
PeiRegisterCallBackWorker (
|
||||||
@ -100,7 +101,7 @@ PeiRegisterCallBackWorker (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Register? EFI_OUT_OF_RESOURCES : EFI_NOT_FOUND;
|
return Register? EFI_OUT_OF_RESOURCES : EFI_INVALID_PARAMETER;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,9 +385,15 @@ SetWorker (
|
|||||||
|
|
||||||
LocalTokenNumber = PeiPcdDb->Init.LocalTokenNumberTable[TokenNumber];
|
LocalTokenNumber = PeiPcdDb->Init.LocalTokenNumberTable[TokenNumber];
|
||||||
|
|
||||||
if ((!PtrType) && (PeiPcdGetSize(TokenNumber + 1) != *Size)) {
|
if (PtrType) {
|
||||||
|
if (*Size > PeiPcdGetSize (TokenNumber + 1)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (*Size != PeiPcdGetSize (TokenNumber + 1)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// We only invoke the callback function for Dynamic Type PCD Entry.
|
// We only invoke the callback function for Dynamic Type PCD Entry.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user