42 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
80 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
115 if (Result ==
NULL) {
119 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
120 *Result = (INT32)Operand;
154 RETURN_STATUS Status;
156 if (Result ==
NULL) {
160 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
162 *Result = (UINT32)Operand;
165 *Result = UINT32_ERROR;
202 if (Result ==
NULL) {
206 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
207 *Result = (UINT32)Operand;
241 if (Result ==
NULL) {
245 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
246 *Result = (INT64)Operand;
280 if (Result ==
NULL) {
284 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
288 *Result = (
INTN)Operand;
319 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
353 if (Result ==
NULL) {
357 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
394 RETURN_STATUS Status;
396 if (Result ==
NULL) {
400 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
401 if ((UINT32)(Augend + Addend) >= Augend) {
402 *Result = (Augend + Addend);
405 *Result = UINTN_ERROR;
412 return SafeUint64Add ((UINT64)Augend, (UINT64)Addend, (UINT64 *)Result);
444 RETURN_STATUS Status;
446 if (Result ==
NULL) {
450 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
451 if (Minuend >= Subtrahend) {
452 *Result = (Minuend - Subtrahend);
455 *Result = UINTN_ERROR;
462 return SafeUint64Sub ((UINT64)Minuend, (UINT64)Subtrahend, (UINT64 *)Result);
494 UINT64 IntermediateResult;
496 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
497 IntermediateResult = ((UINT64)Multiplicand) *((UINT64)Multiplier);
502 return SafeUint64Mult ((UINT64)Multiplicand, (UINT64)Multiplier, (UINT64 *)Result);
534 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
538 return SafeInt64Add ((INT64)Augend, (INT64)Addend, (INT64 *)Result);
570 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
571 return SafeInt64ToIntn (((INT64)Minuend) - ((INT64)Subtrahend), Result);
574 return SafeInt64Sub ((INT64)Minuend, (INT64)Subtrahend, (INT64 *)Result);
606 if (
sizeof (
UINTN) ==
sizeof (UINT32)) {
607 return SafeInt64ToIntn (((INT64)Multiplicand) *((INT64)Multiplier), Result);
610 return SafeInt64Mult ((INT64)Multiplicand, (INT64)Multiplier, (INT64 *)Result);
#define RETURN_BUFFER_TOO_SMALL
#define RETURN_INVALID_PARAMETER
RETURN_STATUS EFIAPI SafeInt64ToInt32(IN INT64 Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeUint32ToInt32(IN UINT32 Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUint32(IN INT32 Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUint64(IN INT32 Operand, OUT UINT64 *Result)
RETURN_STATUS EFIAPI SafeInt64ToUint32(IN INT64 Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeInt64Mult(IN INT64 Multiplicand, IN INT64 Multiplier, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeUint64Sub(IN UINT64 Minuend, IN UINT64 Subtrahend, OUT UINT64 *Result)
RETURN_STATUS EFIAPI SafeUint64Add(IN UINT64 Augend, IN UINT64 Addend, OUT UINT64 *Result)
RETURN_STATUS EFIAPI SafeUint64Mult(IN UINT64 Multiplicand, IN UINT64 Multiplier, OUT UINT64 *Result)
RETURN_STATUS EFIAPI SafeInt64Add(IN INT64 Augend, IN INT64 Addend, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeInt64ToUint64(IN INT64 Operand, OUT UINT64 *Result)
RETURN_STATUS EFIAPI SafeUint64ToInt64(IN UINT64 Operand, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeUint64ToUint32(IN UINT64 Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeInt64Sub(IN INT64 Minuend, IN INT64 Subtrahend, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUint32ToIntn(IN UINT32 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnAdd(IN UINTN Augend, IN UINTN Addend, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnToInt32(IN INTN Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeUintnMult(IN UINTN Multiplicand, IN UINTN Multiplier, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnToUint32(IN INTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeUintnToUint32(IN UINTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeIntnMult(IN INTN Multiplicand, IN INTN Multiplier, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnToInt64(IN UINTN Operand, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUintn(IN INT32 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnAdd(IN INTN Augend, IN INTN Addend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeInt64ToUintn(IN INT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUintnSub(IN UINTN Minuend, IN UINTN Subtrahend, OUT UINTN *Result)