diff --git a/reactos/apps/utils/cmd/dir.c b/reactos/apps/utils/cmd/dir.c index 4641ccdac76..0314e73a65e 100644 --- a/reactos/apps/utils/cmd/dir.c +++ b/reactos/apps/utils/cmd/dir.c @@ -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; diff --git a/reactos/drivers/dd/ide/ide.c b/reactos/drivers/dd/ide/ide.c index b25d1c455b9..586af7709dd 100644 --- a/reactos/drivers/dd/ide/ide.c +++ b/reactos/drivers/dd/ide/ide.c @@ -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) { diff --git a/reactos/drivers/fs/ext2/blockdev.c b/reactos/drivers/fs/ext2/blockdev.c index 9687ed29a0f..1b72df6ab62 100644 --- a/reactos/drivers/fs/ext2/blockdev.c +++ b/reactos/drivers/fs/ext2/blockdev.c @@ -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); diff --git a/reactos/drivers/fs/ext2/rw.c b/reactos/drivers/fs/ext2/rw.c index 35e0029da28..33800fc4e63 100644 --- a/reactos/drivers/fs/ext2/rw.c +++ b/reactos/drivers/fs/ext2/rw.c @@ -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; diff --git a/reactos/drivers/fs/minix/blockdev.c b/reactos/drivers/fs/minix/blockdev.c index 28a87d16ea7..8c9372e1dcf 100644 --- a/reactos/drivers/fs/minix/blockdev.c +++ b/reactos/drivers/fs/minix/blockdev.c @@ -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); diff --git a/reactos/drivers/fs/minix/rw.c b/reactos/drivers/fs/minix/rw.c index a879e6f57cd..cbc85d584b8 100644 --- a/reactos/drivers/fs/minix/rw.c +++ b/reactos/drivers/fs/minix/rw.c @@ -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); diff --git a/reactos/drivers/fs/vfat/blockdev.c b/reactos/drivers/fs/vfat/blockdev.c index ad6178db498..e530fa2927b 100644 --- a/reactos/drivers/fs/vfat/blockdev.c +++ b/reactos/drivers/fs/vfat/blockdev.c @@ -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); diff --git a/reactos/drivers/fs/vfat/iface.c b/reactos/drivers/fs/vfat/iface.c index 3ac8deabcb3..89f6d96d1b1 100644 --- a/reactos/drivers/fs/vfat/iface.c +++ b/reactos/drivers/fs/vfat/iface.c @@ -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); diff --git a/reactos/include/structs.h b/reactos/include/structs.h index 1ba89e9bfdc..62a5c4c0180 100644 --- a/reactos/include/structs.h +++ b/reactos/include/structs.h @@ -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; diff --git a/reactos/lib/kernel32/file/file.c b/reactos/lib/kernel32/file/file.c index dd2161efed6..d3bb676ab05 100644 --- a/reactos/lib/kernel32/file/file.c +++ b/reactos/lib/kernel32/file/file.c @@ -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, diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index a2993244255..b109548ad75 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -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, diff --git a/reactos/lib/kernel32/file/lock.c b/reactos/lib/kernel32/file/lock.c index bf4cd8364f8..33ef1b8c04e 100644 --- a/reactos/lib/kernel32/file/lock.c +++ b/reactos/lib/kernel32/file/lock.c @@ -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, diff --git a/reactos/lib/kernel32/file/rw.c b/reactos/lib/kernel32/file/rw.c index b17de4ba30e..a34100b10ca 100644 --- a/reactos/lib/kernel32/file/rw.c +++ b/reactos/lib/kernel32/file/rw.c @@ -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; diff --git a/reactos/lib/kernel32/file/volume.c b/reactos/lib/kernel32/file/volume.c index acb5506a84a..90cb49b28cf 100644 --- a/reactos/lib/kernel32/file/volume.c +++ b/reactos/lib/kernel32/file/volume.c @@ -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; diff --git a/reactos/lib/kernel32/misc/time.c b/reactos/lib/kernel32/misc/time.c index 83fa1212a64..8518f22481d 100644 --- a/reactos/lib/kernel32/misc/time.c +++ b/reactos/lib/kernel32/misc/time.c @@ -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; diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index 547b7ffd81e..d648969d0ea 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -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, diff --git a/reactos/lib/kernel32/process/proc.c b/reactos/lib/kernel32/process/proc.c index 22a574f4bc9..07d3c59dcc0 100644 --- a/reactos/lib/kernel32/process/proc.c +++ b/reactos/lib/kernel32/process/proc.c @@ -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) ) { diff --git a/reactos/lib/kernel32/synch/wait.c b/reactos/lib/kernel32/synch/wait.c index cf3945efdf0..68f892fcdab 100644 --- a/reactos/lib/kernel32/synch/wait.c +++ b/reactos/lib/kernel32/synch/wait.c @@ -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, diff --git a/reactos/lib/ntdll/ldr/utils.c b/reactos/lib/ntdll/ldr/utils.c index 79ba543b70e..e88860a2cc8 100644 --- a/reactos/lib/ntdll/ldr/utils.c +++ b/reactos/lib/ntdll/ldr/utils.c @@ -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, diff --git a/reactos/ntoskrnl/cc/block.c b/reactos/ntoskrnl/cc/block.c index dc653a780a2..6aff5749995 100644 --- a/reactos/ntoskrnl/cc/block.c +++ b/reactos/ntoskrnl/cc/block.c @@ -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, diff --git a/reactos/ntoskrnl/hal/x86/page.c b/reactos/ntoskrnl/hal/x86/page.c index ab82c0173d0..fc48d4fc06e 100644 --- a/reactos/ntoskrnl/hal/x86/page.c +++ b/reactos/ntoskrnl/hal/x86/page.c @@ -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; } diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index 88f5755c8e2..263778789a8 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -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; } } diff --git a/reactos/ntoskrnl/ldr/init.c b/reactos/ntoskrnl/ldr/init.c index c663a1766b7..c7b4bc4c32e 100644 --- a/reactos/ntoskrnl/ldr/init.c +++ b/reactos/ntoskrnl/ldr/init.c @@ -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, diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index b4c95434b7c..16a2c6bbf2d 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -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)) { diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index ecde845d3a8..9c58bab2611 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -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++) diff --git a/reactos/ntoskrnl/mm/mdl.c b/reactos/ntoskrnl/mm/mdl.c index 5599e5a0981..2c05a42d569 100644 --- a/reactos/ntoskrnl/mm/mdl.c +++ b/reactos/ntoskrnl/mm/mdl.c @@ -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; vaSize; va++) { ((PULONG)(Mdl + 1))[va] = - (MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).LowPart; + (MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).u.LowPart; } Mdl->MappedSystemVa = Mdl->StartVa; } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index a48fe57a1f9..15d1fe1956d 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -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); diff --git a/reactos/ntoskrnl/mm/special.c b/reactos/ntoskrnl/mm/special.c index de7a4060e7c..8a6f58dff78 100644 --- a/reactos/ntoskrnl/mm/special.c +++ b/reactos/ntoskrnl/mm/special.c @@ -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); diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 285c7f23087..bb50c05d3b1 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -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;