Fixed LARGE_INTEGER hack.

svn path=/trunk/; revision=455
This commit is contained in:
Eric Kohl 1999-05-11 19:32:15 +00:00
parent fc506149ce
commit 76691783b3
29 changed files with 135 additions and 144 deletions

View file

@ -810,8 +810,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
count = 0;
}
uliSize.LowPart = file.nFileSizeLow;
uliSize.HighPart = file.nFileSizeHigh;
uliSize.u.LowPart = file.nFileSizeLow;
uliSize.u.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
}
else if (dwFlags & DIR_BARE)
@ -841,8 +841,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
if (IncLine (pLine, dwFlags))
return 1;
uliSize.LowPart = file.nFileSizeLow;
uliSize.HighPart = file.nFileSizeHigh;
uliSize.u.LowPart = file.nFileSizeLow;
uliSize.u.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
}
else
@ -866,8 +866,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
{
ULARGE_INTEGER uliSize;
uliSize.LowPart = file.nFileSizeLow;
uliSize.HighPart = file.nFileSizeHigh;
uliSize.u.LowPart = file.nFileSizeLow;
uliSize.u.HighPart = file.nFileSizeHigh;
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %20s"), buffer);
@ -918,8 +918,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
{
ULARGE_INTEGER uliSize;
uliSize.LowPart = file.nFileSizeLow;
uliSize.HighPart = file.nFileSizeHigh;
uliSize.u.LowPart = file.nFileSizeLow;
uliSize.u.HighPart = file.nFileSizeHigh;
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %10s "), buffer);
bytecount.QuadPart += uliSize.QuadPart;

View file

@ -1230,7 +1230,7 @@ DPRINT("AdjOffset:%ld:%ld + Length:%ld = AdjExtent:%ld:%ld\n",
// Start the packet and insert the request in order of sector offset
assert(DeviceExtension->BytesPerSector == 512);
InsertKeyLI = RtlLargeIntegerShiftRight(IrpStack->Parameters.Read.ByteOffset, 9);
IrpInsertKey = InsertKeyLI.LowPart;
IrpInsertKey = InsertKeyLI.u.LowPart;
IoStartPacket(DeviceExtension->DeviceObject, Irp, &IrpInsertKey, NULL);
return STATUS_PENDING;
@ -1360,7 +1360,7 @@ IDEStartIo(IN PDEVICE_OBJECT DeviceObject,
DeviceExtension->BytesRequested = IrpStack->Parameters.Read.Length;
assert(DeviceExtension->BytesPerSector == 512);
SectorLI = RtlLargeIntegerShiftRight(IrpStack->Parameters.Read.ByteOffset, 9);
DeviceExtension->StartingSector = SectorLI.LowPart;
DeviceExtension->StartingSector = SectorLI.u.LowPart;
if (DeviceExtension->BytesRequested > DeviceExtension->BytesPerSector *
IDE_MAX_SECTORS_PER_XFER)
{

View file

@ -36,8 +36,8 @@ BOOLEAN Ext2ReadSectors(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("VFATReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
pDeviceObject,DiskSector,Buffer);
sectorNumber.HighPart = 0;
sectorNumber.LowPart = DiskSector * BLOCKSIZE;
sectorNumber.u.HighPart = 0;
sectorNumber.u.LowPart = DiskSector * BLOCKSIZE;
DPRINT("DiskSector:%ld BLKSZ:%ld sectorNumber:%ld:%ld\n",
(unsigned long) DiskSector,
@ -104,8 +104,8 @@ BOOLEAN VFATWriteSectors(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
pDeviceObject,DiskSector,Buffer);
sectorNumber.HighPart = 0;
sectorNumber.LowPart = DiskSector * BLOCKSIZE;
sectorNumber.u.HighPart = 0;
sectorNumber.u.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);

View file

@ -29,7 +29,7 @@ NTSTATUS Ext2ReadFile(PDEVICE_EXTENSION DeviceExt,
{
PEXT2_FCB Fcb;
PVOID TempBuffer;
ULONG Offset = OffsetL.LowPart;
ULONG Offset = OffsetL.u.LowPart;
ULONG block;
ULONG Delta;
ULONG i;

View file

@ -35,8 +35,8 @@ BOOLEAN MinixReadSector(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("MinixReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
pDeviceObject,DiskSector,Buffer);
sectorNumber.HighPart = 0;
sectorNumber.LowPart = DiskSector * BLOCKSIZE;
sectorNumber.u.HighPart = 0;
sectorNumber.u.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);
@ -99,8 +99,8 @@ BOOLEAN MinixWriteSector(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("MinixWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
pDeviceObject,DiskSector,Buffer);
sectorNumber.HighPart = 0;
sectorNumber.LowPart = DiskSector * BLOCKSIZE;
sectorNumber.u.HighPart = 0;
sectorNumber.u.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);

View file

@ -45,7 +45,7 @@ NTSTATUS MinixRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Length = Stack->Parameters.Read.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Offset = Stack->Parameters.Read.ByteOffset.LowPart;
Offset = Stack->Parameters.Read.ByteOffset.u.LowPart;
DPRINT("Length %d Buffer %x Offset %x\n",Length,Buffer,Offset);

View file

@ -30,8 +30,8 @@ BOOLEAN VFATReadSectors(IN PDEVICE_OBJECT pDeviceObject,
NTSTATUS status;
ULONG sectorSize;
sectorNumber.LowPart = DiskSector << 9;
sectorNumber.HighPart = DiskSector >> 23;
sectorNumber.u.LowPart = DiskSector << 9;
sectorNumber.u.HighPart = DiskSector >> 23;
KeInitializeEvent(&event, NotificationEvent, FALSE);
sectorSize = BLOCKSIZE * SectorCount;
@ -82,8 +82,8 @@ BOOLEAN VFATReadSectors(IN PDEVICE_OBJECT pDeviceObject,
pDeviceObject,
DiskSector,
Buffer,
sectorNumber.HighPart,
sectorNumber.LowPart);
sectorNumber.u.HighPart,
sectorNumber.u.LowPart);
return FALSE;
}
DPRINT("Block request succeeded\n");
@ -105,8 +105,8 @@ BOOLEAN VFATWriteSectors(IN PDEVICE_OBJECT pDeviceObject,
DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
pDeviceObject,DiskSector,Buffer);
sectorNumber.LowPart = DiskSector << 9;
sectorNumber.HighPart = DiskSector >> 23;
sectorNumber.u.LowPart = DiskSector << 9;
sectorNumber.u.HighPart = DiskSector >> 23;
KeInitializeEvent(&event, NotificationEvent, FALSE);

View file

@ -1508,7 +1508,7 @@ NTSTATUS FsdWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Length = Stack->Parameters.Write.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Offset = Stack->Parameters.Write.ByteOffset.LowPart;
Offset = Stack->Parameters.Write.ByteOffset.u.LowPart;
Status = FsdWriteFile(DeviceExt,FileObject,Buffer,Length,Offset);
@ -1546,7 +1546,7 @@ NTSTATUS FsdRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Length = Stack->Parameters.Read.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
Offset = Stack->Parameters.Read.ByteOffset.LowPart;
Offset = Stack->Parameters.Read.ByteOffset.u.LowPart;
Status = FsdReadFile(DeviceExt,FileObject,Buffer,Length,Offset,
&LengthRead);

View file

@ -36,25 +36,22 @@ typedef union _LARGE_INTEGER
{
struct
{
DWORD ULowPart;
LONG UHighPart;
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;
typedef union
typedef union _ULARGE_INTEGER
{
struct
{
DWORD ULowPart;
DWORD UHighPart;
DWORD LowPart;
DWORD HighPart;
} u;
ULONGLONG QuadPart;
} ULARGE_INTEGER, *PULARGE_INTEGER;
#define LowPart u.ULowPart
#define HighPart u.UHighPart
typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *Flink;
@ -339,16 +336,11 @@ typedef struct _KEY_EVENT_RECORD {
WORD wRepeatCount;
WORD wVirtualKeyCode;
WORD wVirtualScanCode;
// char AsciiChar;
// char pad;
//#if 0
union {
WCHAR UnicodeChar;
CHAR AsciiChar;
} uChar;
//#endif
DWORD dwControlKeyState;
DWORD dwControlKeyState;
} KEY_EVENT_RECORD PACKED;
typedef struct _COORD {
@ -3926,8 +3918,8 @@ typedef struct _STARTUPINFO {
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFO, *LPSTARTUPINFO;
} STARTUPINFO, *LPSTARTUPINFO;
typedef struct tagSTICKYKEYS {
DWORD cbSize;
DWORD dwFlags;

View file

@ -151,41 +151,41 @@ DWORD STDCALL SetFilePointer(HANDLE hFile,
&FilePosition,
sizeof(FILE_POSITION_INFORMATION),
FilePositionInformation);
FilePosition.CurrentByteOffset.LowPart += lDistanceToMove;
FilePosition.CurrentByteOffset.u.LowPart += lDistanceToMove;
if (lpDistanceToMoveHigh != NULL)
{
FilePosition.CurrentByteOffset.HighPart =
FilePosition.CurrentByteOffset.HighPart +
FilePosition.CurrentByteOffset.u.HighPart =
FilePosition.CurrentByteOffset.u.HighPart +
*lpDistanceToMoveHigh;
}
}
else if (dwMoveMethod == FILE_END)
{
NtQueryInformationFile(hFile,&IoStatusBlock,&FileEndOfFile, sizeof(FILE_END_OF_FILE_INFORMATION),FileEndOfFileInformation);
FilePosition.CurrentByteOffset.LowPart =
FileEndOfFile.EndOfFile.LowPart - lDistanceToMove;
FilePosition.CurrentByteOffset.u.LowPart =
FileEndOfFile.EndOfFile.u.LowPart - lDistanceToMove;
if ( lpDistanceToMoveHigh != NULL )
{
FilePosition.CurrentByteOffset.HighPart =
FileEndOfFile.EndOfFile.HighPart - *lpDistanceToMoveHigh;
FilePosition.CurrentByteOffset.u.HighPart =
FileEndOfFile.EndOfFile.u.HighPart - *lpDistanceToMoveHigh;
}
else
{
FilePosition.CurrentByteOffset.HighPart =
FileEndOfFile.EndOfFile.HighPart;
FilePosition.CurrentByteOffset.u.HighPart =
FileEndOfFile.EndOfFile.u.HighPart;
}
}
else if ( dwMoveMethod == FILE_BEGIN )
{
FilePosition.CurrentByteOffset.LowPart = lDistanceToMove;
FilePosition.CurrentByteOffset.u.LowPart = lDistanceToMove;
if ( lpDistanceToMoveHigh != NULL )
{
FilePosition.CurrentByteOffset.HighPart =
FilePosition.CurrentByteOffset.u.HighPart =
*lpDistanceToMoveHigh;
}
else
{
FilePosition.CurrentByteOffset.HighPart = 0;
FilePosition.CurrentByteOffset.u.HighPart = 0;
}
}
@ -202,9 +202,9 @@ DWORD STDCALL SetFilePointer(HANDLE hFile,
if (lpDistanceToMoveHigh != NULL)
{
*lpDistanceToMoveHigh = FilePosition.CurrentByteOffset.HighPart;
*lpDistanceToMoveHigh = FilePosition.CurrentByteOffset.u.HighPart;
}
return FilePosition.CurrentByteOffset.LowPart;
return FilePosition.CurrentByteOffset.u.LowPart;
}
DWORD STDCALL GetFileType(HANDLE hFile)
@ -240,10 +240,10 @@ DWORD STDCALL GetFileSize(HANDLE hFile,
}
}
if ( lpFileSizeHigh != NULL )
*lpFileSizeHigh = FileStandard.AllocationSize.HighPart;
*lpFileSizeHigh = FileStandard.AllocationSize.u.HighPart;
CloseHandle(hFile);
return FileStandard.AllocationSize.LowPart;
return FileStandard.AllocationSize.u.LowPart;
}
DWORD STDCALL GetCompressedFileSizeA(LPCSTR lpFileName,
@ -321,8 +321,8 @@ WINBOOL STDCALL GetFileInformationByHandle(HANDLE hFile,
memcpy(&lpFileInformation->ftCreationTime,&FileDirectory.CreationTime,sizeof(LARGE_INTEGER));
memcpy(&lpFileInformation->ftLastAccessTime,&FileDirectory.LastAccessTime,sizeof(LARGE_INTEGER));
memcpy(&lpFileInformation->ftLastWriteTime, &FileDirectory.LastWriteTime,sizeof(LARGE_INTEGER));
lpFileInformation->nFileSizeHigh = FileDirectory.AllocationSize.HighPart;
lpFileInformation->nFileSizeLow = FileDirectory.AllocationSize.LowPart;
lpFileInformation->nFileSizeHigh = FileDirectory.AllocationSize.u.HighPart;
lpFileInformation->nFileSizeLow = FileDirectory.AllocationSize.u.LowPart;
errCode = NtQueryInformationFile(hFile,
&IoStatusBlock,
@ -334,8 +334,8 @@ WINBOOL STDCALL GetFileInformationByHandle(HANDLE hFile,
SetLastError(RtlNtStatusToDosError(errCode));
return FALSE;
}
lpFileInformation->nFileIndexHigh = FileInternal.IndexNumber.HighPart;
lpFileInformation->nFileIndexLow = FileInternal.IndexNumber.LowPart;
lpFileInformation->nFileIndexHigh = FileInternal.IndexNumber.u.HighPart;
lpFileInformation->nFileIndexLow = FileInternal.IndexNumber.u.LowPart;
errCode = NtQueryVolumeInformationFile(hFile,
&IoStatusBlock,

View file

@ -61,8 +61,8 @@ static void FileDataToWin32Data(LPWIN32_FIND_DATA lpFindFileData, PKERNEL32_FIND
// memcpy(&lpFindFileData->ftCreationTime,&IData->FileInfo.CreationTime,sizeof(FILETIME));
// memcpy(&lpFindFileData->ftLastAccessTime,&IData->FileInfo.LastAccessTime,sizeof(FILETIME));
// memcpy(&lpFindFileData->ftLastWriteTime,&IData->FileInfo.LastWriteTime,sizeof(FILETIME));
lpFindFileData->nFileSizeHigh = IData->FileInfo.EndOfFile.HighPart;
lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.LowPart;
lpFindFileData->nFileSizeHigh = IData->FileInfo.EndOfFile.u.HighPart;
lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.u.LowPart;
}
WINBOOL STDCALL InternalFindNextFile(HANDLE hFindFile,

View file

@ -69,8 +69,8 @@ LockFileEx(
lpOverlapped->Internal = STATUS_PENDING;
Offset.LowPart = lpOverlapped->Offset;
Offset.HighPart = lpOverlapped->OffsetHigh;
Offset.u.LowPart = lpOverlapped->Offset;
Offset.u.HighPart = lpOverlapped->OffsetHigh;
if ( (dwFlags & LOCKFILE_FAIL_IMMEDIATELY) == LOCKFILE_FAIL_IMMEDIATELY )
LockImmediate = TRUE;
@ -82,8 +82,8 @@ LockFileEx(
else
LockExclusive = FALSE;
BytesToLock.LowPart = nNumberOfBytesToLockLow;
BytesToLock.HighPart = nNumberOfBytesToLockHigh;
BytesToLock.u.LowPart = nNumberOfBytesToLockLow;
BytesToLock.u.HighPart = nNumberOfBytesToLockHigh;
errCode = NtLockFile(hFile,
NULL,
@ -151,11 +151,11 @@ UnlockFileEx(
return FALSE;
}
BytesToUnLock.LowPart = nNumberOfBytesToUnLockLow;
BytesToUnLock.HighPart = nNumberOfBytesToUnLockHigh;
BytesToUnLock.u.LowPart = nNumberOfBytesToUnLockLow;
BytesToUnLock.u.HighPart = nNumberOfBytesToUnLockHigh;
StartAddress.LowPart = lpOverlapped->Offset;
StartAddress.HighPart = lpOverlapped->OffsetHigh;
StartAddress.u.LowPart = lpOverlapped->Offset;
StartAddress.u.HighPart = lpOverlapped->OffsetHigh;
errCode = NtUnlockFile(hFile,
(PIO_STATUS_BLOCK)lpOverlapped,

View file

@ -37,8 +37,8 @@ WINBOOL STDCALL WriteFile(HANDLE hFile,
if (lpOverLapped != NULL )
{
Offset.LowPart = lpOverLapped->Offset;
Offset.HighPart = lpOverLapped->OffsetHigh;
Offset.u.LowPart = lpOverLapped->Offset;
Offset.u.HighPart = lpOverLapped->OffsetHigh;
lpOverLapped->Internal = STATUS_PENDING;
hEvent= lpOverLapped->hEvent;
IoStatusBlock = (PIO_STATUS_BLOCK)lpOverLapped;
@ -88,8 +88,8 @@ WINBOOL STDCALL KERNEL32_ReadFile(HANDLE hFile,
if (lpOverLapped != NULL)
{
Offset.LowPart = lpOverLapped->Offset;
Offset.HighPart = lpOverLapped->OffsetHigh;
Offset.u.LowPart = lpOverLapped->Offset;
Offset.u.HighPart = lpOverLapped->OffsetHigh;
lpOverLapped->Internal = STATUS_PENDING;
hEvent = lpOverLapped->hEvent;
IoStatusBlock = (PIO_STATUS_BLOCK)lpOverLapped;

View file

@ -197,8 +197,8 @@ GetDiskFreeSpaceW(
*lpBytesPerSector = FileFsSize.BytesPerSector;
*lpSectorsPerCluster = FileFsSize.SectorsPerAllocationUnit;
*lpNumberOfFreeClusters = FileFsSize.AvailableAllocationUnits.LowPart;
*lpTotalNumberOfClusters = FileFsSize.TotalAllocationUnits.LowPart;
*lpNumberOfFreeClusters = FileFsSize.AvailableAllocationUnits.u.LowPart;
*lpTotalNumberOfClusters = FileFsSize.TotalAllocationUnits.u.LowPart;
CloseHandle(hFile);
return TRUE;
}
@ -287,7 +287,7 @@ GetDiskFreeSpaceExW(
BytesPerCluster.QuadPart * FileFsSize.AvailableAllocationUnits.QuadPart;
lpTotalNumberOfBytes->QuadPart =
BytesPerCluster.QuadPart * FileFsSize.TotalAllocationUnits.LowPart;
BytesPerCluster.QuadPart * FileFsSize.TotalAllocationUnits.QuadPart;
lpTotalNumberOfFreeBytes->QuadPart =
BytesPerCluster.QuadPart * FileFsSize.AvailableAllocationUnits.QuadPart;

View file

@ -295,10 +295,10 @@ FileTimeToSystemTime(
dwMinute = RtlLargeIntegerDivide(dwRemHour,LIMINUTE,&dwRemMinute);
dwSecond = RtlLargeIntegerDivide(dwRemMinute,LISECOND,&dwRemSecond);
lpSystemTime->wHour= (WORD)(dwHour.LowPart);
lpSystemTime->wMinute= (WORD)(dwMinute.LowPart);
lpSystemTime->wSecond= (WORD)(dwSecond.LowPart);
lpSystemTime->wMilliseconds = (WORD)(dwRemSecond.LowPart/10000);
lpSystemTime->wHour= (WORD)(dwHour.u.LowPart);
lpSystemTime->wMinute= (WORD)(dwMinute.u.LowPart);
lpSystemTime->wSecond= (WORD)(dwSecond.u.LowPart);
lpSystemTime->wMilliseconds = (WORD)(dwRemSecond.u.LowPart/10000);
if ( lpSystemTime->wSecond > 60 ) {
@ -313,13 +313,13 @@ FileTimeToSystemTime(
if (lpSystemTime->wHour > 24 ) {
lpSystemTime->wHour-= 24;
dwDay.LowPart = dwDay.LowPart + 1;
dwDay.u.LowPart = dwDay.u.LowPart + 1;
}
//FIXME since 1972 some years have a leap second [ aprox 15 out of 20 ]
// if leap year
lpSystemTime->wYear = 1601 + 1000* (LONG)dwMillenium.LowPart + 100 * (LONG)dwCentury.LowPart + 4 * (LONG)dwFourYear.LowPart + (LONG)dwYear.LowPart;
lpSystemTime->wYear = 1601 + 1000* (LONG)dwMillenium.u.LowPart + 100 * (LONG)dwCentury.u.LowPart + 4 * (LONG)dwFourYear.u.LowPart + (LONG)dwYear.u.LowPart;
if ( (lpSystemTime->wYear % 4 == 0 && lpSystemTime->wYear % 100 != 0) || lpSystemTime->wYear % 400 == 0)
LeapDay = 1;
@ -328,58 +328,58 @@ FileTimeToSystemTime(
if ( dwDay.LowPart >= 0 && dwDay.LowPart < 31 ) {
if ( dwDay.u.LowPart >= 0 && dwDay.u.LowPart < 31 ) {
lpSystemTime->wMonth = 1;
lpSystemTime->wDay = dwDay.LowPart + 1;
lpSystemTime->wDay = dwDay.u.LowPart + 1;
}
else if ( dwDay.LowPart >= 31 && dwDay.LowPart < ( 59 + LeapDay )) {
else if ( dwDay.u.LowPart >= 31 && dwDay.u.LowPart < ( 59 + LeapDay )) {
lpSystemTime->wMonth = 2;
lpSystemTime->wDay = dwDay.LowPart + 1 - 31;
lpSystemTime->wDay = dwDay.u.LowPart + 1 - 31;
}
else if ( dwDay.LowPart >= ( 59 + LeapDay ) && dwDay.LowPart < ( 90 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 59 + LeapDay ) && dwDay.u.LowPart < ( 90 + LeapDay ) ) {
lpSystemTime->wMonth = 3;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 59 + LeapDay);
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 59 + LeapDay);
}
else if ( dwDay.LowPart >= 90+ LeapDay && dwDay.LowPart < 120 + LeapDay) {
else if ( dwDay.u.LowPart >= 90+ LeapDay && dwDay.u.LowPart < 120 + LeapDay) {
lpSystemTime->wMonth = 4;
lpSystemTime->wDay = dwDay.LowPart + 1 - (31 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - (31 + LeapDay );
}
else if ( dwDay.LowPart >= 120 + LeapDay && dwDay.LowPart < 151 + LeapDay ) {
else if ( dwDay.u.LowPart >= 120 + LeapDay && dwDay.u.LowPart < 151 + LeapDay ) {
lpSystemTime->wMonth = 5;
lpSystemTime->wDay = dwDay.LowPart + 1 - (120 + LeapDay);
lpSystemTime->wDay = dwDay.u.LowPart + 1 - (120 + LeapDay);
}
else if ( dwDay.LowPart >= ( 151 + LeapDay) && dwDay.LowPart < ( 181 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 151 + LeapDay) && dwDay.u.LowPart < ( 181 + LeapDay ) ) {
lpSystemTime->wMonth = 6;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 151 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 151 + LeapDay );
}
else if ( dwDay.LowPart >= ( 181 + LeapDay ) && dwDay.LowPart < ( 212 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 181 + LeapDay ) && dwDay.u.LowPart < ( 212 + LeapDay ) ) {
lpSystemTime->wMonth = 7;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 181 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 181 + LeapDay );
}
else if ( dwDay.LowPart >= ( 212 + LeapDay ) && dwDay.LowPart < ( 243 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 212 + LeapDay ) && dwDay.u.LowPart < ( 243 + LeapDay ) ) {
lpSystemTime->wMonth = 8;
lpSystemTime->wDay = dwDay.LowPart + 1 - (212 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - (212 + LeapDay );
}
else if ( dwDay.LowPart >= ( 243+ LeapDay ) && dwDay.LowPart < ( 273 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 243+ LeapDay ) && dwDay.u.LowPart < ( 273 + LeapDay ) ) {
lpSystemTime->wMonth = 9;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 243 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 243 + LeapDay );
}
else if ( dwDay.LowPart >= ( 273 + LeapDay ) && dwDay.LowPart < ( 304 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 273 + LeapDay ) && dwDay.u.LowPart < ( 304 + LeapDay ) ) {
lpSystemTime->wMonth = 10;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 273 + LeapDay);
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 273 + LeapDay);
}
else if ( dwDay.LowPart >= ( 304 + LeapDay ) && dwDay.LowPart < ( 334 + LeapDay ) ) {
else if ( dwDay.u.LowPart >= ( 304 + LeapDay ) && dwDay.u.LowPart < ( 334 + LeapDay ) ) {
lpSystemTime->wMonth = 11;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 304 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 304 + LeapDay );
}
else if ( dwDay.LowPart >= ( 334 + LeapDay ) && dwDay.LowPart < ( 365 + LeapDay )) {
else if ( dwDay.u.LowPart >= ( 334 + LeapDay ) && dwDay.u.LowPart < ( 365 + LeapDay )) {
lpSystemTime->wMonth = 12;
lpSystemTime->wDay = dwDay.LowPart + 1 - ( 334 + LeapDay );
lpSystemTime->wDay = dwDay.u.LowPart + 1 - ( 334 + LeapDay );
}
dwDayOfWeek = RtlLargeIntegerDivide(FileTime,LIDAY,&dwRemDay);
lpSystemTime->wDayOfWeek = 1 + dwDayOfWeek.LowPart % 7;
lpSystemTime->wDayOfWeek = 1 + dwDayOfWeek.u.LowPart % 7;

View file

@ -303,8 +303,8 @@ HANDLE KERNEL32_MapFile(LPCWSTR lpApplicationName,
return(NULL);
}
FileOffset.HighPart = 0;
FileOffset.LowPart = DosHeader->e_lfanew;
FileOffset.u.LowPart = DosHeader->e_lfanew;
FileOffset.u.HighPart = 0;
Status = NtReadFile(hFile,
NULL,

View file

@ -235,8 +235,7 @@ SleepEx(
TIME Interval;
NTSTATUS errCode;
Interval.LowPart = dwMilliseconds * 1000;
Interval.HighPart = 0;
Interval.QuadPart = dwMilliseconds * 1000;
errCode = NtDelayExecution(bAlertable,&Interval);
if ( !NT_SUCCESS(errCode) ) {

View file

@ -182,8 +182,8 @@ DWORD STDCALL WaitForSingleObjectEx(HANDLE hHandle,
}
else
{
Time.LowPart = dwMilliseconds;
Time.HighPart = 0;
Time.u.LowPart = dwMilliseconds;
Time.u.HighPart = 0;
TimePtr = &Time;
}
@ -222,8 +222,8 @@ WaitForMultipleObjectsEx(
LARGE_INTEGER Time;
DWORD retCode;
Time.LowPart = dwMilliseconds;
Time.HighPart = 0;
Time.u.LowPart = dwMilliseconds;
Time.u.HighPart = 0;
errCode = NtWaitForMultipleObjects (
nCount,

View file

@ -198,8 +198,8 @@ NTSTATUS LdrMapSections(HANDLE ProcessHandle,
Sections = (PIMAGE_SECTION_HEADER)SECHDROFFSET(ImageBase);
Base = (ULONG)(Sections[i].VirtualAddress + ImageBase);
Offset.HighPart = 0;
Offset.LowPart = Sections[i].PointerToRawData;
Offset.u.LowPart = Sections[i].PointerToRawData;
Offset.u.HighPart = 0;
Status = ZwMapViewOfSection(SectionHandle,
ProcessHandle,
(PVOID *)&Base,

View file

@ -170,8 +170,8 @@ static NTSTATUS CbReadBlock(PDCCB Dccb, PCCB Ccb)
Ccb->Buffer=ExAllocatePool(NonPagedPool,Dccb->SectorSize);
}
Offset.LowPart = Ccb->BlockNr * Dccb->SectorSize;
Offset.HighPart = 0;
Offset.u.LowPart = Ccb->BlockNr * Dccb->SectorSize;
Offset.u.HighPart = 0;
KeInitializeEvent(&Event,NotificationEvent,FALSE);
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
Dccb->DeviceObject,
@ -211,8 +211,8 @@ static NTSTATUS CbWriteBlock(PDCCB Dccb, PCCB Ccb)
NTSTATUS Status;
KEVENT Event;
Offset.LowPart = Ccb->BlockNr * Dccb->SectorSize;
Offset.HighPart = 0;
Offset.u.LowPart = Ccb->BlockNr * Dccb->SectorSize;
Offset.u.HighPart = 0;
KeInitializeEvent(&Event,NotificationEvent,FALSE);
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE,
Dccb->DeviceObject,

View file

@ -84,7 +84,7 @@ NTSTATUS MmCopyMmInfo(PEPROCESS Src, PEPROCESS Dest)
{
return(STATUS_UNSUCCESSFUL);
}
PhysPageDirectory = (PULONG)(MmGetPhysicalAddress(PageDirectory)).LowPart;
PhysPageDirectory = (PULONG)(MmGetPhysicalAddress(PageDirectory)).u.LowPart;
KProcess->PageTableDirectory = PhysPageDirectory;
CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP;
@ -256,8 +256,8 @@ PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID vaddr)
DPRINT("MmGetPhysicalAddress(vaddr %x)\n", vaddr);
p.LowPart = PAGE_MASK(*MmGetPageEntry(vaddr));
p.HighPart = 0;
p.u.LowPart = PAGE_MASK(*MmGetPageEntry(vaddr));
p.u.HighPart = 0;
return p;
}

View file

@ -112,8 +112,8 @@ VOID IoReadWriteCompletion(PDEVICE_OBJECT DeviceObject,
}
if (FileObject != NULL)
{
FileObject->CurrentByteOffset.LowPart =
FileObject->CurrentByteOffset.LowPart +
FileObject->CurrentByteOffset.u.LowPart =
FileObject->CurrentByteOffset.u.LowPart +
Irp->IoStatus.Information;
}
}

View file

@ -197,8 +197,8 @@ NTSTATUS LdrLoadImage(HANDLE ProcessHandle, PUNICODE_STRING Filename)
Sections = (PIMAGE_SECTION_HEADER)SECHDROFFSET(BlockBuffer);
Base = Sections[i].VirtualAddress + ImageBase;
Offset.HighPart = 0;
Offset.LowPart = Sections[i].PointerToRawData;
Offset.u.LowPart = Sections[i].PointerToRawData;
Offset.u.HighPart = 0;
Status = ZwMapViewOfSection(NTDllSectionHandle,
ProcessHandle,
(PVOID *)&Base,

View file

@ -166,7 +166,7 @@ LdrLoadDriver(PUNICODE_STRING Filename)
/* Allocate nonpageable memory for driver */
ModuleLoadBase = ExAllocatePool(NonPagedPool,
FileStdInfo.EndOfFile.LowPart);
FileStdInfo.EndOfFile.u.LowPart);
if (ModuleLoadBase == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@ -177,7 +177,7 @@ LdrLoadDriver(PUNICODE_STRING Filename)
Status = ZwReadFile(FileHandle,
0, 0, 0, 0,
ModuleLoadBase,
FileStdInfo.EndOfFile.LowPart,
FileStdInfo.EndOfFile.u.LowPart,
0, 0);
if (!NT_SUCCESS(Status))
{

View file

@ -415,7 +415,7 @@ NTSTATUS MmFreeMemoryArea(PEPROCESS Process,
{
PhysicalAddr = MmGetPhysicalAddress(MemoryArea->BaseAddress +
(i*PAGESIZE));
MmFreePage((PVOID)(ULONG)(PhysicalAddr.LowPart), 1);
MmFreePage((PVOID)(ULONG)(PhysicalAddr.u.LowPart), 1);
}
}
for (i=0; i<=(MemoryArea->Length/PAGESIZE); i++)

View file

@ -147,7 +147,7 @@ VOID MmProbeAndLockPages(PMDL Mdl, KPROCESSOR_MODE AccessMode,
for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGESIZE);i++)
{
Address = Mdl->StartVa + (i*PAGESIZE);
mdl_pages[i] = (MmGetPhysicalAddress(Address)).LowPart;
mdl_pages[i] = (MmGetPhysicalAddress(Address)).u.LowPart;
DPRINT("mdl_pages[i] %x\n",mdl_pages[i]);
}
}
@ -225,7 +225,7 @@ VOID MmBuildMdlForNonPagedPool(PMDL Mdl)
for (va=0; va<Mdl->Size; va++)
{
((PULONG)(Mdl + 1))[va] =
(MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).LowPart;
(MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).u.LowPart;
}
Mdl->MappedSystemVa = Mdl->StartVa;
}

View file

@ -332,9 +332,9 @@ NTSTATUS STDCALL ZwMapViewOfSection(HANDLE SectionHandle,
}
DPRINT("ViewSize %x\n",ViewSize);
if ((*ViewSize) > Section->MaximumSize.LowPart)
if ((*ViewSize) > Section->MaximumSize.u.LowPart)
{
(*ViewSize) = Section->MaximumSize.LowPart;
(*ViewSize) = Section->MaximumSize.u.LowPart;
}
Status = MmCreateMemoryArea(UserMode,
@ -361,7 +361,7 @@ NTSTATUS STDCALL ZwMapViewOfSection(HANDLE SectionHandle,
}
else
{
Result->Data.SectionData.ViewOffset = SectionOffset->LowPart;
Result->Data.SectionData.ViewOffset = SectionOffset->u.LowPart;
}
DPRINT("*BaseAddress %x\n",*BaseAddress);

View file

@ -93,7 +93,7 @@ PVOID MmMapIoSpace(PHYSICAL_ADDRESS PhysicalAddress,
MmSetPage(NULL,
Result + (i * PAGESIZE),
PAGE_READWRITE,
PhysicalAddress.LowPart +
PhysicalAddress.u.LowPart +
(i * PAGESIZE));
}
return((PVOID)Result);

View file

@ -180,7 +180,7 @@ VOID PsDispatchThread(VOID)
{
DPRINT("Scheduling current thread\n");
KeQueryTickCount(&TickCount);
CurrentThread->Tcb.LastTick = TickCount.LowPart;
CurrentThread->Tcb.LastTick = TickCount.u.LowPart;
CurrentThread->Tcb.ThreadState = THREAD_STATE_RUNNING;
KeReleaseSpinLock(&ThreadListLock,irql);
return;
@ -192,7 +192,7 @@ VOID PsDispatchThread(VOID)
Candidate->Tcb.ThreadState = THREAD_STATE_RUNNING;
KeQueryTickCount(&TickCount);
CurrentThread->Tcb.LastTick = TickCount.LowPart;
CurrentThread->Tcb.LastTick = TickCount.u.LowPart;
CurrentThread = Candidate;