mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
Added some RtlLargeInteger functions.
svn path=/trunk/; revision=770
This commit is contained in:
parent
c52cbf8517
commit
c114003cb5
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: largeint.c,v 1.5 1999/11/09 18:09:00 ekohl Exp $
|
/* $Id: largeint.c,v 1.6 1999/11/15 16:00:19 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <ntdll/ntdll.h>
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -50,6 +50,17 @@ RtlEnlargedIntegerMultiply(LONG Multiplicand,
|
||||||
return RC;
|
return RC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
RtlEnlargedUnsignedDivide(ULARGE_INTEGER Dividend,
|
||||||
|
ULONG Divisor,
|
||||||
|
PULONG Remainder)
|
||||||
|
{
|
||||||
|
if (Remainder)
|
||||||
|
*Remainder = Dividend.QuadPart % Divisor;
|
||||||
|
|
||||||
|
return (ULONG)(Dividend.QuadPart / Divisor);
|
||||||
|
}
|
||||||
|
|
||||||
LARGE_INTEGER
|
LARGE_INTEGER
|
||||||
RtlEnlargedUnsignedMultiply(ULONG Multiplicand,
|
RtlEnlargedUnsignedMultiply(ULONG Multiplicand,
|
||||||
ULONG Multiplier)
|
ULONG Multiplier)
|
||||||
|
@ -72,6 +83,29 @@ RtlExtendedIntegerMultiply(LARGE_INTEGER Multiplicand,
|
||||||
return RC;
|
return RC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LARGE_INTEGER
|
||||||
|
RtlExtendedLargeIntegerDivide(LARGE_INTEGER Dividend,
|
||||||
|
ULONG Divisor,
|
||||||
|
PULONG Remainder)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER RC;
|
||||||
|
|
||||||
|
if (Remainder)
|
||||||
|
*Remainder = Dividend.QuadPart % Divisor;
|
||||||
|
|
||||||
|
RC.QuadPart = Dividend.QuadPart / Divisor;
|
||||||
|
|
||||||
|
return RC;
|
||||||
|
}
|
||||||
|
|
||||||
|
LARGE_INTEGER
|
||||||
|
RtlExtendedMagicDivide(LARGE_INTEGER Dividend,
|
||||||
|
LARGE_INTEGER MagicDivisor,
|
||||||
|
CCHAR ShiftCount)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
LARGE_INTEGER
|
LARGE_INTEGER
|
||||||
RtlLargeIntegerAdd(LARGE_INTEGER Addend1,
|
RtlLargeIntegerAdd(LARGE_INTEGER Addend1,
|
||||||
LARGE_INTEGER Addend2)
|
LARGE_INTEGER Addend2)
|
||||||
|
@ -91,6 +125,29 @@ RtlLargeIntegerAnd(PLARGE_INTEGER Result,
|
||||||
Result->QuadPart = Source.QuadPart & Mask.QuadPart;
|
Result->QuadPart = Source.QuadPart & Mask.QuadPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LARGE_INTEGER
|
||||||
|
RtlLargeIntegerArithmeticShift(LARGE_INTEGER LargeInteger,
|
||||||
|
CCHAR ShiftCount)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER RC;
|
||||||
|
CHAR Shift;
|
||||||
|
|
||||||
|
Shift = ShiftCount % 64;
|
||||||
|
|
||||||
|
if (Shift < 32)
|
||||||
|
{
|
||||||
|
RC.QuadPart = LargeInteger.QuadPart >> Shift;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* copy the sign bit */
|
||||||
|
RC.u.HighPart |= (LargeInteger.u.HighPart & 0x80000000);
|
||||||
|
RC.u.LowPart = LargeInteger.u.HighPart >> Shift;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RC;
|
||||||
|
}
|
||||||
|
|
||||||
LARGE_INTEGER
|
LARGE_INTEGER
|
||||||
RtlLargeIntegerDivide(LARGE_INTEGER Dividend,
|
RtlLargeIntegerDivide(LARGE_INTEGER Dividend,
|
||||||
LARGE_INTEGER Divisor,
|
LARGE_INTEGER Divisor,
|
||||||
|
@ -200,8 +257,11 @@ RtlLargeIntegerShiftLeft(LARGE_INTEGER LargeInteger,
|
||||||
CCHAR ShiftCount)
|
CCHAR ShiftCount)
|
||||||
{
|
{
|
||||||
LARGE_INTEGER RC;
|
LARGE_INTEGER RC;
|
||||||
|
CCHAR Shift;
|
||||||
|
|
||||||
RC.QuadPart = LargeInteger.QuadPart << ShiftCount;
|
Shift = ShiftCount % 64;
|
||||||
|
|
||||||
|
RC.QuadPart = LargeInteger.QuadPart << Shift;
|
||||||
|
|
||||||
return RC;
|
return RC;
|
||||||
}
|
}
|
||||||
|
@ -211,8 +271,11 @@ RtlLargeIntegerShiftRight(LARGE_INTEGER LargeInteger,
|
||||||
CCHAR ShiftCount)
|
CCHAR ShiftCount)
|
||||||
{
|
{
|
||||||
LARGE_INTEGER RC;
|
LARGE_INTEGER RC;
|
||||||
|
CCHAR Shift;
|
||||||
|
|
||||||
RC.QuadPart = LargeInteger.QuadPart >> ShiftCount;
|
Shift = ShiftCount % 64;
|
||||||
|
|
||||||
|
RC.QuadPart = LargeInteger.QuadPart >> Shift;
|
||||||
|
|
||||||
return RC;
|
return RC;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,9 +54,6 @@ STUB(LdrShutdownProcess)
|
||||||
STUB(LdrShutdownThread)
|
STUB(LdrShutdownThread)
|
||||||
STUB(LdrVerifyImageMatchesChecksum)
|
STUB(LdrVerifyImageMatchesChecksum)
|
||||||
STUB(NPXEMULATORTABLE)
|
STUB(NPXEMULATORTABLE)
|
||||||
STUB(NlsAnsiCodePage)
|
|
||||||
STUB(NlsMbCodePageTag)
|
|
||||||
STUB(NlsMbOemCodePageTag)
|
|
||||||
STUB(PfxFindPrefix)
|
STUB(PfxFindPrefix)
|
||||||
STUB(PfxInitialize)
|
STUB(PfxInitialize)
|
||||||
STUB(PfxInsertPrefix)
|
STUB(PfxInsertPrefix)
|
||||||
|
|
Loading…
Reference in a new issue