ntdll: The large integer functions are 32-bit only.

This commit is contained in:
Alexandre Julliard 2009-08-24 12:50:11 +02:00
parent 3f7d342cfa
commit 4964374570
9 changed files with 68 additions and 82 deletions

View File

@ -550,8 +550,7 @@ VOID WINAPI GetSystemTimeAsFileTime(
static void TIME_ClockTimeToFileTime(clock_t unix_time, LPFILETIME filetime)
{
long clocksPerSec = sysconf(_SC_CLK_TCK);
ULONGLONG secs = RtlEnlargedUnsignedMultiply( unix_time, 10000000 );
secs = RtlExtendedLargeIntegerDivide( secs, clocksPerSec, NULL );
ULONGLONG secs = (ULONGLONG)unix_time * 10000000 / clocksPerSec;
filetime->dwLowDateTime = (DWORD)secs;
filetime->dwHighDateTime = (DWORD)(secs >> 32);
}

View File

@ -1822,7 +1822,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
if (info->LastAccessTime.QuadPart || info->LastWriteTime.QuadPart)
{
ULONGLONG sec, nsec;
struct timeval tv[2];
if (!info->LastAccessTime.QuadPart || !info->LastWriteTime.QuadPart)
@ -1838,15 +1837,17 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
}
if (info->LastAccessTime.QuadPart)
{
sec = RtlLargeIntegerDivide( info->LastAccessTime.QuadPart, 10000000, &nsec );
ULONGLONG sec = info->LastAccessTime.QuadPart / 10000000;
UINT nsec = info->LastAccessTime.QuadPart % 10000000;
tv[0].tv_sec = sec - SECS_1601_TO_1970;
tv[0].tv_usec = (UINT)nsec / 10;
tv[0].tv_usec = nsec / 10;
}
if (info->LastWriteTime.QuadPart)
{
sec = RtlLargeIntegerDivide( info->LastWriteTime.QuadPart, 10000000, &nsec );
ULONGLONG sec = info->LastWriteTime.QuadPart / 10000000;
UINT nsec = info->LastWriteTime.QuadPart % 10000000;
tv[1].tv_sec = sec - SECS_1601_TO_1970;
tv[1].tv_usec = (UINT)nsec / 10;
tv[1].tv_usec = nsec / 10;
}
if (futimes( fd, tv ) == -1) io->u.Status = FILE_GetNtStatus();
}

View File

@ -26,6 +26,8 @@
#include "windef.h"
#include "winternl.h"
#ifndef _WIN64
/*
* Note: we use LONGLONG instead of LARGE_INTEGER, because
* the latter is a structure and the calling convention for
@ -373,6 +375,7 @@ LONGLONG WINAPI RtlExtendedMagicDivide(
} /* if */
}
#endif /* _WIN64 */
/******************************************************************************
* RtlLargeIntegerToChar [NTDLL.@]
@ -507,6 +510,8 @@ NTSTATUS WINAPI RtlInt64ToUnicodeString(
}
#ifdef __i386__
/******************************************************************************
* _alldiv (NTDLL.@)
*
@ -595,3 +600,5 @@ ULONGLONG WINAPI _aullrem( ULONGLONG a, ULONGLONG b )
{
return a % b;
}
#endif /* __i386__ */

View File

@ -84,18 +84,6 @@ LONGLONG CDECL NTDLL__ftol(double fl)
}
#endif /* !defined(__GNUC__) && defined(__i386__) */
/*********************************************************************
* _ftol (NTDLL.@)
* VERSION
* [!i386]
*/
#ifndef __i386__
LONG CDECL NTDLL__ftol(double fl)
{
return (LONG) fl;
}
#endif /* !defined(__i386__) */
/*********************************************************************
* _CIpow (NTDLL.@)
* VERSION
@ -129,19 +117,6 @@ double CDECL NTDLL__CIpow(double x,double y)
}
#endif /* !defined(__GNUC__) && defined(__i386__) */
/*********************************************************************
* _CIpow (NTDLL.@)
* VERSION
* [!i386]
*/
#ifndef __i386__
double CDECL NTDLL__CIpow(double x,double y)
{
return pow(x,y);
}
#endif /* !defined(__i386__) */
/*********************************************************************
* wine_get_version (NTDLL.@)
*/

View File

@ -145,7 +145,7 @@
@ stdcall NtCreateTimer(ptr long ptr long)
@ stub NtCreateToken
# @ stub NtCreateWaitablePort
@ stdcall -arch=i386,sparc,alpha,powerpc NtCurrentTeb()
@ stdcall -arch=win32 NtCurrentTeb()
# @ stub NtDebugActiveProcess
# @ stub NtDebugContinue
@ stdcall NtDelayExecution(long ptr)
@ -457,13 +457,13 @@
# @ stub RtlComputePrivatizedDllName_U
@ stub RtlConsoleMultiByteToUnicodeN
@ stub RtlConvertExclusiveToShared
@ stdcall -ret64 RtlConvertLongToLargeInteger(long)
@ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long)
# @ stub RtlConvertPropertyToVariant
@ stub RtlConvertSharedToExclusive
@ stdcall RtlConvertSidToUnicodeString(ptr ptr long)
# @ stub RtlConvertToAutoInheritSecurityObject
@ stub RtlConvertUiListToApiList
@ stdcall -ret64 RtlConvertUlongToLargeInteger(long)
@ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long)
# @ stub RtlConvertVariantToProperty
@ stdcall RtlCopyLuid(ptr ptr)
@ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr)
@ -546,9 +546,9 @@
# @ stub RtlEnableEarlyCriticalSectionEventCreation
@ stdcall RtlEncodePointer(ptr)
# @ stub RtlEncodeSystemPointer
@ stdcall -ret64 RtlEnlargedIntegerMultiply(long long)
@ stdcall RtlEnlargedUnsignedDivide(double long ptr)
@ stdcall -ret64 RtlEnlargedUnsignedMultiply(long long)
@ stdcall -arch=win32 -ret64 RtlEnlargedIntegerMultiply(long long)
@ stdcall -arch=win32 RtlEnlargedUnsignedDivide(double long ptr)
@ stdcall -arch=win32 -ret64 RtlEnlargedUnsignedMultiply(long long)
@ stdcall RtlEnterCriticalSection(ptr)
@ stub RtlEnumProcessHeaps
@ stub RtlEnumerateGenericTable
@ -568,9 +568,9 @@
@ stdcall RtlExitUserThread(long)
@ stdcall RtlExpandEnvironmentStrings_U(ptr ptr ptr ptr)
@ stub RtlExtendHeap
@ stdcall -ret64 RtlExtendedIntegerMultiply(double long)
@ stdcall -ret64 RtlExtendedLargeIntegerDivide(double long ptr)
@ stdcall -ret64 RtlExtendedMagicDivide(double double long)
@ stdcall -arch=win32 -ret64 RtlExtendedIntegerMultiply(double long)
@ stdcall -arch=win32 -ret64 RtlExtendedLargeIntegerDivide(double long ptr)
@ stdcall -arch=win32 -ret64 RtlExtendedMagicDivide(double double long)
@ stdcall RtlFillMemory(ptr long long)
@ stdcall RtlFillMemoryUlong(ptr long long)
@ stub RtlFinalReleaseOutOfProcessMemoryStream
@ -711,13 +711,13 @@
# @ stub RtlIsThreadWithinLoaderCallout
@ stdcall RtlIsValidHandle(ptr ptr)
@ stdcall RtlIsValidIndexHandle(ptr long ptr)
@ stdcall -ret64 RtlLargeIntegerAdd(double double)
@ stdcall -ret64 RtlLargeIntegerArithmeticShift(double long)
@ stdcall -ret64 RtlLargeIntegerDivide(double double ptr)
@ stdcall -ret64 RtlLargeIntegerNegate(double)
@ stdcall -ret64 RtlLargeIntegerShiftLeft(double long)
@ stdcall -ret64 RtlLargeIntegerShiftRight(double long)
@ stdcall -ret64 RtlLargeIntegerSubtract(double double)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerAdd(double double)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerArithmeticShift(double long)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerDivide(double double ptr)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerNegate(double)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerShiftLeft(double long)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerShiftRight(double long)
@ stdcall -arch=win32 -ret64 RtlLargeIntegerSubtract(double double)
@ stdcall RtlLargeIntegerToChar(ptr long long ptr)
@ stdcall RtlLeaveCriticalSection(ptr)
@ stdcall RtlLengthRequiredSid(long)
@ -1232,7 +1232,7 @@
@ stdcall ZwYieldExecution() NtYieldExecution
# @ stub _CIcos
# @ stub _CIlog
@ cdecl -private _CIpow() NTDLL__CIpow
@ cdecl -private -arch=i386 _CIpow() NTDLL__CIpow
# @ stub _CIsin
# @ stub _CIsqrt
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr)
@ -1240,21 +1240,21 @@
# @ stub __iscsym
# @ stub __iscsymf
# @ stub __toascii
@ stdcall -private -ret64 _alldiv(double double)
@ stdcall -private -arch=i386 -ret64 _alldiv(double double)
# @ stub _alldvrm
@ stdcall -private -ret64 _allmul(double double)
@ stdcall -private -i386 -norelay _alloca_probe()
@ stdcall -private -ret64 _allrem(double double)
@ stdcall -private -arch=i386 -ret64 _allmul(double double)
@ stdcall -private -arch=i386 -norelay _alloca_probe()
@ stdcall -private -arch=i386 -ret64 _allrem(double double)
# @ stub _allshl
# @ stub _allshr
@ cdecl -private -ret64 _atoi64(str)
@ stdcall -private -ret64 _aulldiv(double double)
@ stdcall -private -arch=i386 -ret64 _aulldiv(double double)
# @ stub _aulldvrm
@ stdcall -private -ret64 _aullrem(double double)
@ stdcall -private -arch=i386 -ret64 _aullrem(double double)
# @ stub _aullshr
@ stdcall -private -i386 -norelay _chkstk()
@ stdcall -private -arch=i386 -norelay _chkstk()
@ stub _fltused
@ cdecl -private -ret64 _ftol() NTDLL__ftol
@ cdecl -private -arch=i386 -ret64 _ftol() NTDLL__ftol
@ cdecl -private _i64toa(double ptr long)
@ cdecl -private _i64tow(double ptr long)
@ cdecl -private _itoa(long ptr long)

View File

@ -332,8 +332,7 @@ NTSTATUS WINAPI RtlSystemTimeToLocalTime( const LARGE_INTEGER *SystemTime,
BOOLEAN WINAPI RtlTimeToSecondsSince1970( const LARGE_INTEGER *Time, LPDWORD Seconds )
{
ULONGLONG tmp = ((ULONGLONG)Time->u.HighPart << 32) | Time->u.LowPart;
tmp = RtlLargeIntegerDivide( tmp, TICKSPERSEC, NULL );
tmp -= SECS_1601_TO_1970;
tmp = tmp / TICKSPERSEC - SECS_1601_TO_1970;
if (tmp > 0xffffffff) return FALSE;
*Seconds = (DWORD)tmp;
return TRUE;
@ -355,8 +354,7 @@ BOOLEAN WINAPI RtlTimeToSecondsSince1970( const LARGE_INTEGER *Time, LPDWORD Sec
BOOLEAN WINAPI RtlTimeToSecondsSince1980( const LARGE_INTEGER *Time, LPDWORD Seconds )
{
ULONGLONG tmp = ((ULONGLONG)Time->u.HighPart << 32) | Time->u.LowPart;
tmp = RtlLargeIntegerDivide( tmp, TICKSPERSEC, NULL );
tmp -= SECS_1601_TO_1980;
tmp = tmp / TICKSPERSEC - SECS_1601_TO_1980;
if (tmp > 0xffffffff) return FALSE;
*Seconds = (DWORD)tmp;
return TRUE;
@ -417,15 +415,16 @@ void WINAPI RtlTimeToElapsedTimeFields( const LARGE_INTEGER *Time, PTIME_FIELDS
LONGLONG time;
INT rem;
time = RtlExtendedLargeIntegerDivide( Time->QuadPart, TICKSPERSEC, &rem );
TimeFields->Milliseconds = rem / TICKSPERMSEC;
time = Time->QuadPart / TICKSPERSEC;
TimeFields->Milliseconds = (Time->QuadPart % TICKSPERSEC) / TICKSPERMSEC;
/* time is now in seconds */
TimeFields->Year = 0;
TimeFields->Month = 0;
TimeFields->Day = RtlExtendedLargeIntegerDivide( time, SECSPERDAY, &rem );
TimeFields->Day = time / SECSPERDAY;
/* rem is now the remaining seconds in the last day */
rem = time % SECSPERDAY;
TimeFields->Second = rem % 60;
rem /= 60;
TimeFields->Minute = rem % 60;

View File

@ -397,7 +397,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Seek(
*/
if (dlibMove.QuadPart < 0 && newPosition.QuadPart < -dlibMove.QuadPart) return STG_E_INVALIDFUNCTION;
newPosition.QuadPart = RtlLargeIntegerAdd(newPosition.QuadPart, dlibMove.QuadPart);
newPosition.QuadPart += dlibMove.QuadPart;
if (plibNewPosition) *plibNewPosition = newPosition;
This->currentPosition = newPosition;

View File

@ -522,7 +522,7 @@ static HRESULT WINAPI StgStreamImpl_Seek(
return STG_E_INVALIDFUNCTION;
}
plibNewPosition->QuadPart = RtlLargeIntegerAdd( plibNewPosition->QuadPart, dlibMove.QuadPart );
plibNewPosition->QuadPart += dlibMove.QuadPart;
/*
* tell the caller what we calculated

View File

@ -2264,8 +2264,6 @@ NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UN
NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
@ -2312,9 +2310,6 @@ NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE
NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
@ -2326,9 +2321,6 @@ NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
@ -2401,14 +2393,6 @@ NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRI
NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
@ -2523,6 +2507,27 @@ NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
/* 32-bit only functions */
#ifndef _WIN64
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
#endif
/* Wine internal functions */
NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,