TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
#define | MIN_INT64_MAGNITUDE (((UINT64)(- (MIN_INT64 + 1))) + 1) |
Functions | |
RETURN_STATUS EFIAPI | SafeInt8ToUint8 (IN INT8 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt8ToChar8 (IN INT8 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt8ToUint16 (IN INT8 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt8ToUint32 (IN INT8 Operand, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt8ToUintn (IN INT8 Operand, OUT UINTN *Result) |
RETURN_STATUS EFIAPI | SafeInt8ToUint64 (IN INT8 Operand, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint8ToInt8 (IN UINT8 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint8ToChar8 (IN UINT8 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToInt8 (IN INT16 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToChar8 (IN INT16 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToUint8 (IN INT16 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToUint16 (IN INT16 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToUint32 (IN INT16 Operand, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToUintn (IN INT16 Operand, OUT UINTN *Result) |
RETURN_STATUS EFIAPI | SafeInt16ToUint64 (IN INT16 Operand, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint16ToInt8 (IN UINT16 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16ToChar8 (IN UINT16 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16ToUint8 (IN UINT16 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16ToInt16 (IN UINT16 Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToInt8 (IN INT32 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToChar8 (IN INT32 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToUint8 (IN INT32 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToInt16 (IN INT32 Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToUint16 (IN INT32 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToUint32 (IN INT32 Operand, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt32ToUint64 (IN INT32 Operand, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToInt8 (IN UINT32 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToChar8 (IN UINT32 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToUint8 (IN UINT32 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToInt16 (IN UINT32 Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToUint16 (IN UINT32 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint32ToInt32 (IN UINT32 Operand, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToInt8 (IN INTN Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToChar8 (IN INTN Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToUint8 (IN INTN Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToInt16 (IN INTN Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToUint16 (IN INTN Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeIntnToUintn (IN INTN Operand, OUT UINTN *Result) |
RETURN_STATUS EFIAPI | SafeIntnToUint64 (IN INTN Operand, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToInt8 (IN UINTN Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToChar8 (IN UINTN Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToUint8 (IN UINTN Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToInt16 (IN UINTN Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToUint16 (IN UINTN Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToInt32 (IN UINTN Operand, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeUintnToIntn (IN UINTN Operand, OUT INTN *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToInt8 (IN INT64 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToChar8 (IN INT64 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToUint8 (IN INT64 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToInt16 (IN INT64 Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToUint16 (IN INT64 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToInt32 (IN INT64 Operand, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToUint32 (IN INT64 Operand, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt64ToUint64 (IN INT64 Operand, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToInt8 (IN UINT64 Operand, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToChar8 (IN UINT64 Operand, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToUint8 (IN UINT64 Operand, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToInt16 (IN UINT64 Operand, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToUint16 (IN UINT64 Operand, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToInt32 (IN UINT64 Operand, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToUint32 (IN UINT64 Operand, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToIntn (IN UINT64 Operand, OUT INTN *Result) |
RETURN_STATUS EFIAPI | SafeUint64ToInt64 (IN UINT64 Operand, OUT INT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint8Add (IN UINT8 Augend, IN UINT8 Addend, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16Add (IN UINT16 Augend, IN UINT16 Addend, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint32Add (IN UINT32 Augend, IN UINT32 Addend, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeUint64Add (IN UINT64 Augend, IN UINT64 Addend, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint8Sub (IN UINT8 Minuend, IN UINT8 Subtrahend, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16Sub (IN UINT16 Minuend, IN UINT16 Subtrahend, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint32Sub (IN UINT32 Minuend, IN UINT32 Subtrahend, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeUint64Sub (IN UINT64 Minuend, IN UINT64 Subtrahend, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeUint8Mult (IN UINT8 Multiplicand, IN UINT8 Multiplier, OUT UINT8 *Result) |
RETURN_STATUS EFIAPI | SafeUint16Mult (IN UINT16 Multiplicand, IN UINT16 Multiplier, OUT UINT16 *Result) |
RETURN_STATUS EFIAPI | SafeUint32Mult (IN UINT32 Multiplicand, IN UINT32 Multiplier, OUT UINT32 *Result) |
RETURN_STATUS EFIAPI | SafeUint64Mult (IN UINT64 Multiplicand, IN UINT64 Multiplier, OUT UINT64 *Result) |
RETURN_STATUS EFIAPI | SafeInt8Add (IN INT8 Augend, IN INT8 Addend, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeChar8Add (IN CHAR8 Augend, IN CHAR8 Addend, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16Add (IN INT16 Augend, IN INT16 Addend, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32Add (IN INT32 Augend, IN INT32 Addend, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt64Add (IN INT64 Augend, IN INT64 Addend, OUT INT64 *Result) |
RETURN_STATUS EFIAPI | SafeInt8Sub (IN INT8 Minuend, IN INT8 Subtrahend, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeChar8Sub (IN CHAR8 Minuend, IN CHAR8 Subtrahend, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16Sub (IN INT16 Minuend, IN INT16 Subtrahend, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32Sub (IN INT32 Minuend, IN INT32 Subtrahend, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt64Sub (IN INT64 Minuend, IN INT64 Subtrahend, OUT INT64 *Result) |
RETURN_STATUS EFIAPI | SafeInt8Mult (IN INT8 Multiplicand, IN INT8 Multiplier, OUT INT8 *Result) |
RETURN_STATUS EFIAPI | SafeChar8Mult (IN CHAR8 Multiplicand, IN CHAR8 Multiplier, OUT CHAR8 *Result) |
RETURN_STATUS EFIAPI | SafeInt16Mult (IN INT16 Multiplicand, IN INT16 Multiplier, OUT INT16 *Result) |
RETURN_STATUS EFIAPI | SafeInt32Mult (IN INT32 Multiplicand, IN INT32 Multiplier, OUT INT32 *Result) |
RETURN_STATUS EFIAPI | SafeInt64Mult (IN INT64 Multiplicand, IN INT64 Multiplier, OUT INT64 *Result) |
This library provides helper functions to prevent integer overflow during type conversion, addition, subtraction, and multiplication.
Copyright (c) 2017, Microsoft Corporation
All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SafeIntLib.c.
#define MIN_INT64_MAGNITUDE (((UINT64)(- (MIN_INT64 + 1))) + 1) |
Definition at line 19 of file SafeIntLib.c.
CHAR8 Addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3498 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeChar8Mult | ( | IN CHAR8 | Multiplicand, |
IN CHAR8 | Multiplier, | ||
OUT CHAR8 * | Result | ||
) |
CHAR8 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3979 of file SafeIntLib.c.
CHAR8 Subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3742 of file SafeIntLib.c.
INT16 Addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3549 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeInt16Mult | ( | IN INT16 | Multiplicand, |
IN INT16 | Multiplier, | ||
OUT INT16 * | Result | ||
) |
INT16 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 4030 of file SafeIntLib.c.
INT16 Subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3793 of file SafeIntLib.c.
INT16 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 454 of file SafeIntLib.c.
INT16 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 410 of file SafeIntLib.c.
INT16 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 542 of file SafeIntLib.c.
INT16 -> UINT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 586 of file SafeIntLib.c.
INT16 -> UINT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 674 of file SafeIntLib.c.
INT16 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 498 of file SafeIntLib.c.
INT16 -> UINTN conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 630 of file SafeIntLib.c.
INT32 Addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3581 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeInt32Mult | ( | IN INT32 | Multiplicand, |
IN INT32 | Multiplier, | ||
OUT INT32 * | Result | ||
) |
INT32 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 4062 of file SafeIntLib.c.
INT32 Subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3825 of file SafeIntLib.c.
INT32 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 938 of file SafeIntLib.c.
INT32 -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1026 of file SafeIntLib.c.
INT32 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 894 of file SafeIntLib.c.
INT32 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1070 of file SafeIntLib.c.
INT32 -> UINT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1114 of file SafeIntLib.c.
INT32 -> UINT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1158 of file SafeIntLib.c.
INT32 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 982 of file SafeIntLib.c.
INT64 Addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3613 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeInt64Mult | ( | IN INT64 | Multiplicand, |
IN INT64 | Multiplier, | ||
OUT INT64 * | Result | ||
) |
INT64 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 4094 of file SafeIntLib.c.
INT64 Subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3857 of file SafeIntLib.c.
INT64 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2126 of file SafeIntLib.c.
INT64 -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2214 of file SafeIntLib.c.
INT64 -> INT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2302 of file SafeIntLib.c.
INT64 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2082 of file SafeIntLib.c.
INT64 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2258 of file SafeIntLib.c.
INT64 -> UINT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2346 of file SafeIntLib.c.
INT64 -> UINT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2390 of file SafeIntLib.c.
INT64 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2170 of file SafeIntLib.c.
INT8 Addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3466 of file SafeIntLib.c.
INT8 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3947 of file SafeIntLib.c.
INT8 Subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3710 of file SafeIntLib.c.
INT8 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 102 of file SafeIntLib.c.
INT8 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 146 of file SafeIntLib.c.
INT8 -> UINT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 190 of file SafeIntLib.c.
INT8 -> UINT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 278 of file SafeIntLib.c.
INT8 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 58 of file SafeIntLib.c.
INT8 -> UINTN conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 234 of file SafeIntLib.c.
INTN -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1510 of file SafeIntLib.c.
INTN -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1598 of file SafeIntLib.c.
INTN -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1466 of file SafeIntLib.c.
INTN -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1642 of file SafeIntLib.c.
INTN -> UINT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1730 of file SafeIntLib.c.
INTN -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1554 of file SafeIntLib.c.
INTN -> UINTN conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1686 of file SafeIntLib.c.
UINT16 addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2881 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeUint16Mult | ( | IN UINT16 | Multiplicand, |
IN UINT16 | Multiplier, | ||
OUT UINT16 * | Result | ||
) |
UINT16 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3247 of file SafeIntLib.c.
UINT16 subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3069 of file SafeIntLib.c.
UINT16 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 762 of file SafeIntLib.c.
UINT16 -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 850 of file SafeIntLib.c.
UINT16 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 718 of file SafeIntLib.c.
UINT16 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 806 of file SafeIntLib.c.
UINT32 addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2927 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeUint32Mult | ( | IN UINT32 | Multiplicand, |
IN UINT32 | Multiplier, | ||
OUT UINT32 * | Result | ||
) |
UINT32 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3283 of file SafeIntLib.c.
UINT32 subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3115 of file SafeIntLib.c.
UINT32 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1246 of file SafeIntLib.c.
UINT32 -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1334 of file SafeIntLib.c.
UINT32 -> INT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1422 of file SafeIntLib.c.
UINT32 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1202 of file SafeIntLib.c.
UINT32 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1378 of file SafeIntLib.c.
UINT32 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1290 of file SafeIntLib.c.
UINT64 addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2973 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeUint64Mult | ( | IN UINT64 | Multiplicand, |
IN UINT64 | Multiplier, | ||
OUT UINT64 * | Result | ||
) |
UINT64 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3319 of file SafeIntLib.c.
UINT64 subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3161 of file SafeIntLib.c.
UINT64 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2478 of file SafeIntLib.c.
UINT64 -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2566 of file SafeIntLib.c.
UINT64 -> INT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2654 of file SafeIntLib.c.
UINT64 -> INT64 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2786 of file SafeIntLib.c.
UINT64 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2434 of file SafeIntLib.c.
UINT64 -> INTN conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2742 of file SafeIntLib.c.
UINT64 -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2610 of file SafeIntLib.c.
UINT64 -> UINT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2698 of file SafeIntLib.c.
UINT64 -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2522 of file SafeIntLib.c.
UINT8 addition
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Augend | A number to which addend will be added |
[in] | Addend | A number to be added to another |
[out] | Result | Pointer to the result of addition |
RETURN_SUCCESS | Successful addition |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2835 of file SafeIntLib.c.
RETURN_STATUS EFIAPI SafeUint8Mult | ( | IN UINT8 | Multiplicand, |
IN UINT8 | Multiplier, | ||
OUT UINT8 * | Result | ||
) |
UINT8 multiplication
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Multiplicand | A number that is to be multiplied by another |
[in] | Multiplier | A number by which the multiplicand is to be multiplied |
[out] | Result | Pointer to the result of multiplication |
RETURN_SUCCESS | Successful multiplication |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3211 of file SafeIntLib.c.
UINT8 subtraction
Performs the requested operation using the input parameters into a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the requested operation results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Minuend | A number from which another is to be subtracted. |
[in] | Subtrahend | A number to be subtracted from another |
[out] | Result | Pointer to the result of subtraction |
RETURN_SUCCESS | Successful subtraction |
RETURN_BUFFER_TOO_SMALL | Underflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 3023 of file SafeIntLib.c.
UINT8 -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 366 of file SafeIntLib.c.
UINT8 -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 322 of file SafeIntLib.c.
UINTN -> CHAR8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1818 of file SafeIntLib.c.
UINTN -> INT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1906 of file SafeIntLib.c.
UINTN -> INT32 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT32_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1994 of file SafeIntLib.c.
UINTN -> INT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1774 of file SafeIntLib.c.
UINTN -> INTN conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 2038 of file SafeIntLib.c.
UINTN -> UINT16 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT16_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1950 of file SafeIntLib.c.
UINTN -> UINT8 conversion
Converts the value specified by Operand to a value specified by Result type and stores the converted value into the caller allocated output buffer specified by Result. The caller must pass in a Result buffer that is at least as large as the Result type.
If Result is NULL, RETURN_INVALID_PARAMETER is returned.
If the conversion results in an overflow or an underflow condition, then Result is set to UINT8_ERROR and RETURN_BUFFER_TOO_SMALL is returned.
[in] | Operand | Operand to be converted to new type |
[out] | Result | Pointer to the result of conversion |
RETURN_SUCCESS | Successful conversion |
RETURN_BUFFER_TOO_SMALL | Overflow |
RETURN_INVALID_PARAMETER | Result is NULL |
Definition at line 1862 of file SafeIntLib.c.