103 if (Result ==
NULL) {
107 *Result = (INT32)Operand;
138 RETURN_STATUS Status;
140 if (Result ==
NULL) {
145 *Result = (UINT32)Operand;
148 *Result = UINT32_ERROR;
182 if (Result ==
NULL) {
186 *Result = (UINT32)Operand;
217 if (Result ==
NULL) {
221 *Result = (INT64)Operand;
344 RETURN_STATUS Status;
346 if (Result ==
NULL) {
350 if ((Augend + Addend) >= Augend) {
351 *Result = (Augend + Addend);
354 *Result = UINTN_ERROR;
390 RETURN_STATUS Status;
392 if (Result ==
NULL) {
396 if (Minuend >= Subtrahend) {
397 *Result = (Minuend - Subtrahend);
400 *Result = UINTN_ERROR;
436 UINT64 IntermediateResult;
438 IntermediateResult = ((UINT64)Multiplicand) *((UINT64)Multiplier);
504 return SafeInt64ToIntn (((INT64)Minuend) - ((INT64)Subtrahend), Result);
INT64 EFIAPI MultS64x64(IN INT64 Multiplicand, IN INT64 Multiplier)
#define RETURN_BUFFER_TOO_SMALL
#define RETURN_INVALID_PARAMETER
RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUint32ToIntn(IN UINT32 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnAdd(IN UINTN Augend, IN UINTN Addend, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnToInt32(IN INTN Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeUintnMult(IN UINTN Multiplicand, IN UINTN Multiplier, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnToUint32(IN INTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeUintnToUint32(IN UINTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeIntnMult(IN INTN Multiplicand, IN INTN Multiplier, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnToInt64(IN UINTN Operand, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUintn(IN INT32 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnAdd(IN INTN Augend, IN INTN Addend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeInt64ToUintn(IN INT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUintnSub(IN UINTN Minuend, IN UINTN Subtrahend, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeInt64ToInt32(IN INT64 Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeUint32ToInt32(IN UINT32 Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUint32(IN INT32 Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeInt64ToUint32(IN INT64 Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeUint64ToUint32(IN UINT64 Operand, OUT UINT32 *Result)