MdePkg[all]
1.08
|
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
#define CHAR16_ERROR MAX_UINT16 |
#define INT16_ERROR ((INT16) -1) |
#define INT32_ERROR ((INT32) -1) |
#define INT64_ERROR ((INT64) -1) |
#define INT8_ERROR ((INT8) -1) |
#define INTN_ERROR ((INTN) -1) |
#define SafeChar16Add SafeUint16Add |
#define SafeChar16Mult SafeUint16Mult |
#define SafeChar16Sub SafeUint16Sub |
#define SafeChar16ToChar8 SafeUint16ToChar8 |
#define SafeChar16ToInt16 SafeUint16ToInt16 |
#define SafeChar16ToInt8 SafeUint16ToInt8 |
#define SafeChar16ToUint8 SafeUint16ToUint8 |
#define SafeInt16ToChar16 SafeInt16ToUint16 |
#define SafeInt32ToChar16 SafeInt32ToUint16 |
#define SafeInt64ToChar16 SafeInt64ToUint16 |
#define SafeInt8ToChar16 SafeInt8ToUint16 |
#define SafeIntnToChar16 SafeIntnToUint16 |
#define SafeUint32ToChar16 SafeUint32ToUint16 |
#define SafeUint64ToChar16 SafeUint64ToUint16 |
#define SafeUintnToChar16 SafeUintnToUint16 |
#define UINT16_ERROR MAX_UINT16 |
#define UINT32_ERROR MAX_UINT32 |
#define UINT64_ERROR MAX_UINT64 |
#define UINT8_ERROR MAX_UINT8 |
#define UINTN_ERROR MAX_UINTN |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
INT32 -> 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
INT64 -> 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 |
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 |
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 |
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 |
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 |
INT64 -> 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
INTN 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 INTN_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 |
INTN 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 INTN_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 |
INTN 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 INTN_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 |
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 |
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 |
INTN -> 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 |
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 |
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 |
INTN -> 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
UINT32 -> 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
UINT64 -> 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 |
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 |
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 |
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 |
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 |
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 |
UINTN 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 UINTN_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 |
RETURN_STATUS EFIAPI SafeUintnMult | ( | IN UINTN | Multiplicand, |
IN UINTN | Multiplier, | ||
OUT UINTN * | Result | ||
) |
UINTN 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 UINTN_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 |
UINTN 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 UINTN_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 |
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 |
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 |
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 |
UINTN -> 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 |
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 |
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 |
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 |
UINTN -> 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 |
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 |