#include "cmd.h"
-#ifdef __REACTOS__
-#include <kernel32/li.h>
-#endif
-
/* flag definitions */
INT c = 0;
INT n = 0;
-#ifndef __REACTOS__
if (num.QuadPart == 0)
-#else
- if (num == 0)
-#endif
{
des[0] = _T('0');
des[1] = _T('\0');
else
{
temp[31] = 0;
-#ifndef __REACTOS__
while (num.QuadPart > 0)
-#else
- while (num > 0)
-#endif
{
if (((c + 1) % (nNumberGroups + 1)) == 0)
temp[30 - c++] = cThousandSeparator;
-#ifndef __REACTOS__
temp[30 - c++] = (TCHAR)(num.QuadPart % 10) + _T('0');
num.QuadPart /= 10;
-#else
- temp[30 - c++] = (TCHAR)(num % 10) + _T('0');
- num /= 10;
-#endif
}
for (n = 0; n <= c; n++)
buffer, ulFiles == 1 ? _T(' ') : _T('s'));
ConvertULargeInteger (bytes, buffer, sizeof(buffer));
-#ifndef __REACTOS__
ConOutPrintf (_T(" %15s byte%c\n"),
buffer, bytes.QuadPart == 1 ? _T(' ') : _T('s'));
-#else
- ConOutPrintf (_T(" %15s byte%c\n"),
- buffer, bytes == 1 ? _T(' ') : _T('s'));
-#endif
if (IncLine (pLine, dwFlags))
return 1;
szRoot[0] = szPath[0];
GetDiskFreeSpace (szRoot, &dwSecPerCl, &dwBytPerSec, &dwFreeCl, &dwTotCl);
-#ifndef __REACTOS__
uliFree.QuadPart = dwSecPerCl * dwBytPerSec * dwFreeCl;
-#else
- uliFree = dwSecPerCl * dwBytPerSec * dwFreeCl;
-#endif
ConvertULargeInteger (uliFree, buffer, sizeof(buffer));
ConOutPrintf (_T(" %15s bytes free\n"), buffer);
}
ULONG dircount = 0;
INT count;
-#ifndef __REACTOS__
bytecount.QuadPart = 0;
-#else
- bytecount = 0;
-#endif
_tcscpy (szFullPath, szPath);
if (szFullPath[_tcslen(szFullPath) - 1] != _T('\\'))
count = 0;
}
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
- bytecount += uliSize;
-#endif
}
else if (dwFlags & DIR_BARE)
{
if (IncLine (pLine, dwFlags))
return 1;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
- bytecount += uliSize;
-#endif
}
else
{
{
ULARGE_INTEGER uliSize;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
-#endif
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %20s"), buffer);
-#ifndef __REACTOS__
bytecount.QuadPart += uliSize.QuadPart;
-#else
- bytecount += uliSize;
-#endif
filecount++;
}
{
ULARGE_INTEGER uliSize;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
-#endif
-
- ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
+ ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %10s "), buffer);
-#ifndef __REACTOS__
bytecount.QuadPart += uliSize.QuadPart;
-#else
- bytecount += uliSize;
-#endif
filecount++;
}
{
recurse_dir_cnt += dircount;
recurse_file_cnt += filecount;
-#ifndef __REACTOS__
recurse_bytes.QuadPart += bytecount.QuadPart;
-#else
- recurse_bytes += bytecount;
-#endif
/* print_summary */
if (PrintSummary (szPath, filecount, dircount, bytecount, pLine, dwFlags))
static INT
DirRecurse (LPTSTR szPath, LPTSTR szSpec, LPINT pLine, DWORD dwFlags)
{
- recurse_dir_cnt = 0L;
- recurse_file_cnt = 0L;
-#ifdef __REACTOS__
- recurse_bytes = 0;
-#else
- recurse_bytes.QuadPart = 0;
-#endif
-
if (!PrintDirectoryHeader (szPath, pLine, dwFlags))
return 1;
dwFlags &= ~DIR_RECURSE;
if (PrintSummary (szPath, recurse_file_cnt,
- recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
+ recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
return 1;
if ((dwFlags & DIR_BARE) == 0)
INT nLine = 0;
+ recurse_dir_cnt = 0L;
+ recurse_file_cnt = 0L;
+ recurse_bytes.QuadPart = 0;
+
/* read the parameters from the DIRCMD environment variable */
if (GetEnvironmentVariable (_T("DIRCMD"), dircmd, 256))
{
DPRINT("Offset:%ld * BytesPerSector:%ld = AdjOffset:%ld:%ld\n",
DeviceExtension->Offset,
DeviceExtension->BytesPerSector,
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(AdjustedOffset),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(AdjustedOffset));
+ (unsigned long) AdjustedOffset.HighPart,
+ (unsigned long) AdjustedOffset.LowPart);
DPRINT("AdjOffset:%ld:%ld + ByteOffset:%ld:%ld = ",
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(AdjustedOffset),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(AdjustedOffset),
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(IrpStack->Parameters.Read.ByteOffset),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(IrpStack->Parameters.Read.ByteOffset));
+ (unsigned long) AdjustedOffset.HighPart,
+ (unsigned long) AdjustedOffset.LowPart,
+ (unsigned long) IrpStack->Parameters.Read.ByteOffset.HighPart,
+ (unsigned long) IrpStack->Parameters.Read.ByteOffset.LowPart);
AdjustedOffset = RtlLargeIntegerAdd(AdjustedOffset,
IrpStack->Parameters.Read.ByteOffset);
DPRINT("AdjOffset:%ld:%ld\n",
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(AdjustedOffset),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(AdjustedOffset));
+ (unsigned long) AdjustedOffset.HighPart,
+ (unsigned long) AdjustedOffset.LowPart);
AdjustedExtent = RtlLargeIntegerAdd(AdjustedOffset,
RtlConvertLongToLargeInteger(IrpStack->Parameters.Read.Length));
DPRINT("AdjOffset:%ld:%ld + Length:%ld = AdjExtent:%ld:%ld\n",
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(AdjustedOffset),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(AdjustedOffset),
+ (unsigned long) AdjustedOffset.HighPart,
+ (unsigned long) AdjustedOffset.LowPart,
IrpStack->Parameters.Read.Length,
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(AdjustedExtent),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(AdjustedExtent));
+ (unsigned long) AdjustedExtent.HighPart,
+ (unsigned long) AdjustedExtent.LowPart);
/* FIXME: this assumption will fail on drives bigger than 1TB */
- LARGE_INTEGER_QUAD_PART(PartitionExtent) = DeviceExtension->Offset + DeviceExtension->Size;
+ PartitionExtent.QuadPart = DeviceExtension->Offset + DeviceExtension->Size;
PartitionExtent = RtlExtendedIntegerMultiply(PartitionExtent,
DeviceExtension->BytesPerSector);
if (RtlLargeIntegerGreaterThan(AdjustedExtent, PartitionExtent) ||
{
DPRINT("Request failed on bad parameters\n",0);
DPRINT("AdjustedExtent=%d:%d PartitionExtent=%d:%d ReadLength=%d\n",
- (unsigned int) GET_LARGE_INTEGER_HIGH_PART(AdjustedExtent),
- (unsigned int) GET_LARGE_INTEGER_LOW_PART(AdjustedExtent),
- (unsigned int) GET_LARGE_INTEGER_HIGH_PART(PartitionExtent),
- (unsigned int) GET_LARGE_INTEGER_LOW_PART(PartitionExtent),
+ (unsigned int) AdjustedExtent.HighPart,
+ (unsigned int) AdjustedExtent.LowPart,
+ (unsigned int) PartitionExtent.HighPart,
+ (unsigned int) PartitionExtent.LowPart,
IrpStack->Parameters.Read.Length);
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
// Start the packet and insert the request in order of sector offset
assert(DeviceExtension->BytesPerSector == 512);
InsertKeyLI = RtlLargeIntegerShiftRight(IrpStack->Parameters.Read.ByteOffset, 9);
- IrpInsertKey = GET_LARGE_INTEGER_LOW_PART(InsertKeyLI);
+ IrpInsertKey = InsertKeyLI.LowPart;
IoStartPacket(DeviceExtension->DeviceObject, Irp, &IrpInsertKey, NULL);
return STATUS_PENDING;
Geometry = (PDISK_GEOMETRY) Irp->AssociatedIrp.SystemBuffer;
Geometry->MediaType = FixedMedia;
// FIXME: should report for RawDevice even on partition
- QUAD_PART(Geometry->Cylinders) = DeviceExtension->Size /
+ Geometry->Cylinders.QuadPart = DeviceExtension->Size /
DeviceExtension->SectorsPerLogCyl;
Geometry->TracksPerCylinder = DeviceExtension->SectorsPerLogTrk /
DeviceExtension->SectorsPerLogCyl;
DeviceExtension->BytesRequested = IrpStack->Parameters.Read.Length;
assert(DeviceExtension->BytesPerSector == 512);
SectorLI = RtlLargeIntegerShiftRight(IrpStack->Parameters.Read.ByteOffset, 9);
- DeviceExtension->StartingSector = GET_LARGE_INTEGER_LOW_PART(SectorLI);
+ DeviceExtension->StartingSector = SectorLI.LowPart;
if (DeviceExtension->BytesRequested > DeviceExtension->BytesPerSector *
IDE_MAX_SECTORS_PER_XFER)
{
if ((i%512)==0)
{
DPRINT("Offset %x\n",
- GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
- SdWriteOffset(GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
+ Stack->Parameters.Write.ByteOffset.LowPart+i);
+ SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i);
}
outb_p(PORT,Buffer[i]);
DbgPrint("%c",Buffer[i]);
for (i=0;i<(Length/512);i++)
{
DPRINT("Offset %x\n",
- GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
- SdWriteOffset(GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
+ Stack->Parameters.Write.ByteOffset.LowPart+i);
+ SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i);
outsb(PORT,Buffer,512);
}
status = STATUS_SUCCESS;
if ((i%512)==0)
{
DPRINT("Offset %d\n",
- GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
- SdWriteOffset(GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset)+i);
+ Stack->Parameters.Write.ByteOffset.LowPart+i);
+ SdWriteOffset(Stack->Parameters.Write.ByteOffset.LowPart+i);
}
Buffer[i]=inb_p(PORT);
}
ULONG sectorSize;
int j;
- DPRINT("VFATReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
- pDeviceObject,DiskSector,Buffer);
+ DPRINT("VFATReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
+ pDeviceObject,DiskSector,Buffer);
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, 0);
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector * BLOCKSIZE);
+ sectorNumber.HighPart = 0;
+ sectorNumber.LowPart = DiskSector * BLOCKSIZE;
-DPRINT("DiskSector:%ld BLKSZ:%ld sectorNumber:%ld:%ld\n",
- (unsigned long) DiskSector,
- (unsigned long) BLOCKSIZE,
- (unsigned long) GET_LARGE_INTEGER_HIGH_PART(sectorNumber),
- (unsigned long) GET_LARGE_INTEGER_LOW_PART(sectorNumber));
+ DPRINT("DiskSector:%ld BLKSZ:%ld sectorNumber:%ld:%ld\n",
+ (unsigned long) DiskSector,
+ (unsigned long) BLOCKSIZE,
+ (unsigned long) sectorNumber.HighPart,
+ (unsigned long) sectorNumber.LowPart);
KeInitializeEvent(&event, NotificationEvent, FALSE);
PULONG mbr;
int j;
- DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
- pDeviceObject,DiskSector,Buffer);
+ DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
+ pDeviceObject,DiskSector,Buffer);
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, 0);
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector * BLOCKSIZE);
+ sectorNumber.HighPart = 0;
+ sectorNumber.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);
return TRUE;
}
-
// FDI->LastAccessTime = 0;
// FDI->LastWriteTime = 0;
// FDI->ChangeTime = 0;
- FDI->AllocationSize = FDI->EndOfFile = inode.i_size;
+ FDI->AllocationSize.QuadPart = FDI->EndOfFile.QuadPart = inode.i_size;
FDI->FileAttributes = 0;
FDI->FileNameLength = dir_entry->name_len;
Ext2ConvertName(FDI->FileName, dir_entry->name, dir_entry->name_len);
FBI->NextEntryOffset = sizeof(FileBothDirectoryInformation) +
dir_entry->name_len + 1;
FBI->FileIndex = FileIndex;
- FBI->AllocationSize = FBI->EndOfFile = inode.i_size;
+ FBI->AllocationSize.QuadPart = FBI->EndOfFile.QuadPart = inode.i_size;
FBI->FileAttributes = 0;
FBI->FileNameLength = dir_entry->name_len;
Ext2ConvertName(FBI->FileName, dir_entry->name, dir_entry->name_len);
{
PEXT2_FCB Fcb;
PVOID TempBuffer;
- ULONG Offset = OffsetL;
+ ULONG Offset = OffsetL.LowPart;
ULONG block;
ULONG Delta;
ULONG i;
{
ULONG Length;
PVOID Buffer;
- ULONG Offset;
+ LARGE_INTEGER Offset;
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
PFILE_OBJECT FileObject = Stack->FileObject;
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
ULONG sectorSize;
PULONG mbr;
- DPRINT("MinixReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
- pDeviceObject,DiskSector,Buffer);
+ DPRINT("MinixReadSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
+ pDeviceObject,DiskSector,Buffer);
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, 0);
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector * BLOCKSIZE);
+ sectorNumber.HighPart = 0;
+ sectorNumber.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);
return FALSE;
}
- RtlCopyMemory(Buffer,mbr,sectorSize);
+ RtlCopyMemory(Buffer,mbr,sectorSize);
ExFreePool(mbr);
return TRUE;
KEVENT event;
NTSTATUS status;
ULONG sectorSize;
+
+ DPRINT("MinixWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
+ pDeviceObject,DiskSector,Buffer);
- DPRINT("MinixWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
- pDeviceObject,DiskSector,Buffer);
-
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, 0);
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector * BLOCKSIZE);
+ sectorNumber.HighPart = 0;
+ sectorNumber.LowPart = DiskSector * BLOCKSIZE;
KeInitializeEvent(&event, NotificationEvent, FALSE);
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
+#include <string.h>
#define NDEBUG
#include <internal/debug.h>
Length = Stack->Parameters.Read.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
- Offset = GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Read.ByteOffset);
+ Offset = Stack->Parameters.Read.ByteOffset.LowPart;
DPRINT("Length %d Buffer %x Offset %x\n",Length,Buffer,Offset);
NTSTATUS status;
ULONG sectorSize;
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector << 9);
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, DiskSector >> 23);
+ sectorNumber.LowPart = DiskSector << 9;
+ sectorNumber.HighPart = DiskSector >> 23;
+
KeInitializeEvent(&event, NotificationEvent, FALSE);
sectorSize = BLOCKSIZE * SectorCount;
DiskSector,
Buffer);
DPRINT("sectorNumber %08lx:%08lx sectorSize %ld\n",
- (unsigned long int)GET_LARGE_INTEGER_HIGH_PART(sectorNumber),
- (unsigned long int)GET_LARGE_INTEGER_LOW_PART(sectorNumber),
+ (unsigned long int)sectorNumber.LowPart,
+ (unsigned long int)sectorNumber.HighPart,
sectorSize);
pDeviceObject,
DiskSector,
Buffer,
- GET_LARGE_INTEGER_HIGH_PART(sectorNumber),
- GET_LARGE_INTEGER_LOW_PART(sectorNumber));
+ sectorNumber.HighPart,
+ sectorNumber.LowPart);
return FALSE;
}
DPRINT("Block request succeeded\n");
NTSTATUS status;
ULONG sectorSize;
- DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
- pDeviceObject,DiskSector,Buffer);
+ DPRINT("VFATWriteSector(pDeviceObject %x, DiskSector %d, Buffer %x)\n",
+ pDeviceObject,DiskSector,Buffer);
- SET_LARGE_INTEGER_LOW_PART(sectorNumber, DiskSector << 9);
- SET_LARGE_INTEGER_HIGH_PART(sectorNumber, DiskSector >> 23);
+ sectorNumber.LowPart = DiskSector << 9;
+ sectorNumber.HighPart = DiskSector >> 23;
KeInitializeEvent(&event, NotificationEvent, FALSE);
AllocSize = ((pFcb->entry.FileSize + DeviceExt->BytesPerCluster - 1) /
DeviceExt->BytesPerCluster) *
DeviceExt->BytesPerCluster;
- LARGE_INTEGER_QUAD_PART(pInfo->AllocationSize) = AllocSize;
+ pInfo->AllocationSize.QuadPart = AllocSize;
pInfo->FileAttributes=pFcb->entry.Attrib;
return STATUS_SUCCESS;
AllocSize = ((pFcb->entry.FileSize + DeviceExt->BytesPerCluster - 1) /
DeviceExt->BytesPerCluster) *
DeviceExt->BytesPerCluster;
- LARGE_INTEGER_QUAD_PART(pInfo->AllocationSize) = AllocSize;
+ pInfo->AllocationSize.QuadPart = AllocSize;
pInfo->FileAttributes=pFcb->entry.Attrib;
// pInfo->EaSize=;
return STATUS_SUCCESS;
AllocSize = ((pFcb->entry.FileSize + DeviceExt->BytesPerCluster - 1) /
DeviceExt->BytesPerCluster) *
DeviceExt->BytesPerCluster;
- LARGE_INTEGER_QUAD_PART(pInfo->AllocationSize) = AllocSize;
+ pInfo->AllocationSize.QuadPart = AllocSize;
pInfo->FileAttributes=pFcb->entry.Attrib;
// pInfo->EaSize=;
for (i=0;i<8 && (pFcb->entry.Filename[i]!=' ') ;i++)
Length = Stack->Parameters.Write.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
- Offset = GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Write.ByteOffset);
+ Offset = Stack->Parameters.Write.ByteOffset.LowPart;
Status = FsdWriteFile(DeviceExt,FileObject,Buffer,Length,Offset);
Length = Stack->Parameters.Read.Length;
Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
- Offset = GET_LARGE_INTEGER_LOW_PART(Stack->Parameters.Read.ByteOffset);
+ Offset = Stack->Parameters.Read.ByteOffset.LowPart;
Status = FsdReadFile(DeviceExt,FileObject,Buffer,Length,Offset,
&LengthRead);
DPRINT("FsdSetPositionInformation()\n");
DPRINT("PositionInfo %x\n", PositionInfo);
- DPRINT("Setting position %d\n",GET_LARGE_INTEGER_LOW_PART(
- PositionInfo->CurrentByteOffset));
+ DPRINT("Setting position %d\n", PositionInfo->CurrentByteOffset.LowPart);
memcpy(&FileObject->CurrentByteOffset,&PositionInfo->CurrentByteOffset,
sizeof(LARGE_INTEGER));
memcpy(&PositionInfo->CurrentByteOffset, &FileObject->CurrentByteOffset,
sizeof(LARGE_INTEGER));
- DPRINT("Getting position %x\n",GET_LARGE_INTEGER_LOW_PART(
- PositionInfo->CurrentByteOffset));
+ DPRINT("Getting position %x\n", PositionInfo->CurrentByteOffset.LowPart);
return(STATUS_SUCCESS);
}
return(STATUS_SUCCESS);
/* dummy entries */
- FsVolumeInfo->VolumeCreationTime.LowPart = 0;
- FsVolumeInfo->VolumeCreationTime.HighPart = 0;
+ FsVolumeInfo->VolumeCreationTime.QuadPart = 0;
FsVolumeInfo->VolumeSerialNumber = 0x01234567;
FsVolumeInfo->SupportsObjects = FALSE;
FsVolumeInfo->VolumeLabelLength = 5;
#include <windows.h>
-#include <ddk/li.h>
-
#include <internal/id.h>
#include <ddk/status.h>
#include <ddk/ntdef.h>
typedef USHORT CSHORT;
+#if 0
typedef struct _TIME {
DWORD LowPart;
LONG HighPart;
} TIME;
+#endif
+
+typedef ULARGE_INTEGER TIME;
#endif
#ifndef _GNU_H_WINDOWS32_STRUCTURES
#define _GNU_H_WINDOWS32_STRUCTURES
-#ifdef COMPILER_LARGE_INTEGERS
+typedef long long int LONGLONG, *PLONGLONG;
+typedef unsigned long long int ULONGLONG, *PULONGLONG;
-typedef long long int LARGE_INTEGER, *PLARGE_INTEGER;
-typedef unsigned long long int ULARGE_INTEGER, *PULARGE_INTEGER;
-
-#else
+typedef union _LARGE_INTEGER
+{
+ struct
+ {
+ DWORD ULowPart;
+ LONG UHighPart;
+ } u;
+ LONGLONG QuadPart;
+} LARGE_INTEGER, *PLARGE_INTEGER;
-typedef struct _LARGE_INTEGER {
- DWORD LowPart;
- LONG HighPart;
-} LARGE_INTEGER, *PLARGE_INTEGER;
+typedef union
+{
+ struct
+ {
+ DWORD ULowPart;
+ DWORD UHighPart;
+ } u;
+ ULONGLONG QuadPart;
+} ULARGE_INTEGER, *PULARGE_INTEGER;
-typedef struct _ULARGE_INTEGER {
- DWORD LowPart;
- DWORD HighPart;
-} ULARGE_INTEGER, *PULARGE_INTEGER;
+#define LowPart u.ULowPart
+#define HighPart u.UHighPart
-#endif
typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *Flink;
return(FALSE);
}
- SET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset, 0);
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset, 0);
+ FilePosition.CurrentByteOffset.QuadPart = 0;
errCode = NtSetInformationFile(FileHandleSource,
&IoStatusBlock,
&FilePosition,
sizeof(FILE_POSITION_INFORMATION),
FilePositionInformation);
- SET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset,
- GET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset) +
- lDistanceToMove);
+ FilePosition.CurrentByteOffset.LowPart += lDistanceToMove;
if (lpDistanceToMoveHigh != NULL)
{
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset,
- GET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset) +
- *lpDistanceToMoveHigh);
+ FilePosition.CurrentByteOffset.HighPart =
+ FilePosition.CurrentByteOffset.HighPart +
+ *lpDistanceToMoveHigh;
}
}
else if (dwMoveMethod == FILE_END)
{
NtQueryInformationFile(hFile,&IoStatusBlock,&FileEndOfFile, sizeof(FILE_END_OF_FILE_INFORMATION),FileEndOfFileInformation);
- SET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset,
- GET_LARGE_INTEGER_LOW_PART(FileEndOfFile.EndOfFile) -
- lDistanceToMove);
+ FilePosition.CurrentByteOffset.LowPart =
+ FileEndOfFile.EndOfFile.LowPart - lDistanceToMove;
if ( lpDistanceToMoveHigh != NULL )
{
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset,
- GET_LARGE_INTEGER_HIGH_PART(FileEndOfFile.EndOfFile) -
- *lpDistanceToMoveHigh);
+ FilePosition.CurrentByteOffset.HighPart =
+ FileEndOfFile.EndOfFile.HighPart - *lpDistanceToMoveHigh;
}
else
{
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset,
- GET_LARGE_INTEGER_HIGH_PART(FileEndOfFile.EndOfFile));
+ FilePosition.CurrentByteOffset.HighPart =
+ FileEndOfFile.EndOfFile.HighPart;
}
}
else if ( dwMoveMethod == FILE_BEGIN )
{
- SET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset,
- lDistanceToMove);
+ FilePosition.CurrentByteOffset.LowPart = lDistanceToMove;
if ( lpDistanceToMoveHigh != NULL )
{
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset,
- *lpDistanceToMoveHigh);
+ FilePosition.CurrentByteOffset.HighPart =
+ *lpDistanceToMoveHigh;
}
else
{
- SET_LARGE_INTEGER_HIGH_PART(FilePosition.CurrentByteOffset,
- 0);
+ FilePosition.CurrentByteOffset.HighPart = 0;
}
}
if (lpDistanceToMoveHigh != NULL)
{
- *lpDistanceToMoveHigh = GET_LARGE_INTEGER_HIGH_PART(
- FilePosition.CurrentByteOffset);
+ *lpDistanceToMoveHigh = FilePosition.CurrentByteOffset.HighPart;
}
- return GET_LARGE_INTEGER_LOW_PART(FilePosition.CurrentByteOffset);
+ return FilePosition.CurrentByteOffset.LowPart;
}
DWORD STDCALL GetFileType(HANDLE hFile)
}
}
if ( lpFileSizeHigh != NULL )
- *lpFileSizeHigh = GET_LARGE_INTEGER_HIGH_PART(FileStandard.AllocationSize);
+ *lpFileSizeHigh = FileStandard.AllocationSize.HighPart;
CloseHandle(hFile);
- return GET_LARGE_INTEGER_LOW_PART(FileStandard.AllocationSize);
+ return FileStandard.AllocationSize.LowPart;
}
DWORD STDCALL GetCompressedFileSizeA(LPCSTR lpFileName,
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 = GET_LARGE_INTEGER_HIGH_PART(FileDirectory.AllocationSize);
- lpFileInformation->nFileSizeLow = GET_LARGE_INTEGER_LOW_PART(FileDirectory.AllocationSize);
+ lpFileInformation->nFileSizeHigh = FileDirectory.AllocationSize.HighPart;
+ lpFileInformation->nFileSizeLow = FileDirectory.AllocationSize.LowPart;
errCode = NtQueryInformationFile(hFile,
&IoStatusBlock,
SetLastError(RtlNtStatusToDosError(errCode));
return FALSE;
}
- lpFileInformation->nFileIndexHigh = GET_LARGE_INTEGER_HIGH_PART(FileInternal.IndexNumber);
- lpFileInformation->nFileIndexLow = GET_LARGE_INTEGER_LOW_PART(FileInternal.IndexNumber);
+ lpFileInformation->nFileIndexHigh = FileInternal.IndexNumber.HighPart;
+ lpFileInformation->nFileIndexLow = FileInternal.IndexNumber.LowPart;
errCode = NtQueryVolumeInformationFile(hFile,
&IoStatusBlock,
// 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>>32;
- lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile;
+ lpFindFileData->nFileSizeHigh = IData->FileInfo.EndOfFile.HighPart;
+ lpFindFileData->nFileSizeLow = IData->FileInfo.EndOfFile.LowPart;
}
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirectoryNameStr;
IO_STATUS_BLOCK IoStatusBlock;
-// DWORD Len = 0;
DPRINT("FindFirstFileW(lpFileName %w, lpFindFileData %x)\n",
lpFileName, lpFindFileData);
lpOverlapped->Internal = STATUS_PENDING;
- SET_LARGE_INTEGER_LOW_PART(Offset, lpOverlapped->Offset);
- SET_LARGE_INTEGER_HIGH_PART(Offset, lpOverlapped->OffsetHigh);
+ Offset.LowPart = lpOverlapped->Offset;
+ Offset.HighPart = lpOverlapped->OffsetHigh;
if ( (dwFlags & LOCKFILE_FAIL_IMMEDIATELY) == LOCKFILE_FAIL_IMMEDIATELY )
LockImmediate = TRUE;
else
LockExclusive = FALSE;
- SET_LARGE_INTEGER_LOW_PART(BytesToLock, nNumberOfBytesToLockLow);
- SET_LARGE_INTEGER_HIGH_PART(BytesToLock, nNumberOfBytesToLockHigh);
+ BytesToLock.LowPart = nNumberOfBytesToLockLow;
+ BytesToLock.HighPart = nNumberOfBytesToLockHigh;
errCode = NtLockFile(hFile,
NULL,
return FALSE;
}
- SET_LARGE_INTEGER_LOW_PART(BytesToUnLock, nNumberOfBytesToUnLockLow);
- SET_LARGE_INTEGER_HIGH_PART(BytesToUnLock, nNumberOfBytesToUnLockHigh);
+ BytesToUnLock.LowPart = nNumberOfBytesToUnLockLow;
+ BytesToUnLock.HighPart = nNumberOfBytesToUnLockHigh;
- SET_LARGE_INTEGER_LOW_PART(StartAddress, lpOverlapped->Offset);
- SET_LARGE_INTEGER_HIGH_PART(StartAddress, lpOverlapped->OffsetHigh);
+ StartAddress.LowPart = lpOverlapped->Offset;
+ StartAddress.HighPart = lpOverlapped->OffsetHigh;
errCode = NtUnlockFile(hFile,
(PIO_STATUS_BLOCK)lpOverlapped,
if (lpOverLapped != NULL )
{
- SET_LARGE_INTEGER_LOW_PART(Offset, lpOverLapped->Offset);
- SET_LARGE_INTEGER_HIGH_PART(Offset, lpOverLapped->OffsetHigh);
+ Offset.LowPart = lpOverLapped->Offset;
+ Offset.HighPart = lpOverLapped->OffsetHigh;
lpOverLapped->Internal = STATUS_PENDING;
hEvent= lpOverLapped->hEvent;
IoStatusBlock = (PIO_STATUS_BLOCK)lpOverLapped;
else
{
IoStatusBlock = &IIosb;
- Offset = NULL;
+ Offset.QuadPart = 0;
}
errCode = NtWriteFile(hFile,
hEvent,
if (lpOverLapped != NULL)
{
- SET_LARGE_INTEGER_LOW_PART(Offset, lpOverLapped->Offset);
- SET_LARGE_INTEGER_HIGH_PART(Offset, lpOverLapped->OffsetHigh);
+ Offset.LowPart = lpOverLapped->Offset;
+ Offset.HighPart = lpOverLapped->OffsetHigh;
lpOverLapped->Internal = STATUS_PENDING;
hEvent = lpOverLapped->hEvent;
IoStatusBlock = (PIO_STATUS_BLOCK)lpOverLapped;
*lpBytesPerSector = FileFsSize.BytesPerSector;
*lpSectorsPerCluster = FileFsSize.SectorsPerAllocationUnit;
- *lpNumberOfFreeClusters = GET_LARGE_INTEGER_LOW_PART(FileFsSize.AvailableAllocationUnits);
- *lpTotalNumberOfClusters = GET_LARGE_INTEGER_LOW_PART(FileFsSize.TotalAllocationUnits);
+ *lpNumberOfFreeClusters = FileFsSize.AvailableAllocationUnits.LowPart;
+ *lpTotalNumberOfClusters = FileFsSize.TotalAllocationUnits.LowPart;
CloseHandle(hFile);
return TRUE;
}
DPRINT("FileFsVolume %p\n", FileFsVolume);
DPRINT("FileFsAttribute %p\n", FileFsAttribute);
-CHECKPOINT;
hFile = CreateFileW(lpRootPathName,
FILE_READ_ATTRIBUTES,
FILE_SHARE_READ|FILE_SHARE_WRITE,
FileFsVolume,
FS_VOLUME_BUFFER_SIZE,
FileFsVolumeInformation);
-CHECKPOINT;
if ( !NT_SUCCESS(errCode) ) {
DPRINT("Status: %x\n", errCode);
CloseHandle(hFile);
SetLastError(RtlNtStatusToDosError(errCode));
return FALSE;
}
-CHECKPOINT;
+
if (lpVolumeSerialNumber)
*lpVolumeSerialNumber = FileFsVolume->VolumeSerialNumber;
-CHECKPOINT;
+
if (lpVolumeNameBuffer)
wcsncpy(lpVolumeNameBuffer, FileFsVolume->VolumeLabel,min(nVolumeNameSize,MAX_PATH));
-// memcpy(lpVolumeNameBuffer, FileFsVolume->VolumeLabel,min(nVolumeNameSize,MAX_PATH));
-CHECKPOINT;
+
errCode = NtQueryVolumeInformationFile(hFile,&IoStatusBlock,FileFsAttribute, FS_ATTRIBUTE_BUFFER_SIZE,FileFsAttributeInformation);
-CHECKPOINT;
if ( !NT_SUCCESS(errCode) ) {
DPRINT("Status: %x\n", errCode);
CloseHandle(hFile);
SetLastError(RtlNtStatusToDosError(errCode));
return FALSE;
}
-CHECKPOINT;
+
if (lpFileSystemFlags)
*lpFileSystemFlags = FileFsAttribute->FileSystemAttributes;
-// memcpy(lpFileSystemFlags,&FileFsAttribute->FileSystemAttributes,sizeof(DWORD));
-CHECKPOINT;
if (lpMaximumComponentLength)
*lpMaximumComponentLength = FileFsAttribute->MaximumComponentNameLength;
-// memcpy(lpMaximumComponentLength, &FileFsAttribute->MaximumComponentNameLength, sizeof(DWORD));
-CHECKPOINT;
if (lpFileSystemNameBuffer)
wcsncpy(lpFileSystemNameBuffer, FileFsAttribute->FileSystemName,min(nFileSystemNameSize,MAX_PATH));
-// memcpy(lpFileSystemNameBuffer, FileFsAttribute->FileSystemName,min(nFileSystemNameSize,MAX_PATH));
-CHECKPOINT;
+
CloseHandle(hFile);
return TRUE;
}
ANSI_STRING AnsiName;
UNICODE_STRING UnicodeName;
- SET_LARGE_INTEGER_LOW_PART(MaximumSize, dwMaximumSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(MaximumSize, dwMaximumSizeHigh);
+ MaximumSize.LowPart = dwMaximumSizeLow;
+ MaximumSize.HighPart = dwMaximumSizeHigh;
RtlInitAnsiString(&AnsiString, lpName);
RtlAnsiStringToUnicodeString(&UnicodeName, &AnsiName, TRUE);
InitializeObjectAttributes(&ObjectAttributes,
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING UnicodeName;
- SET_LARGE_INTEGER_LOW_PART(MaximumSize, dwMaximumSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(MaximumSize, dwMaximumSizeHigh);
+ MaximumSize.LowPart = dwMaximumSizeLow;
+ MaximumSize.HighPart = dwMaximumSizeHigh;
RtlInitUnicodeString(&UnicodeString, lpName);
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeName,
*/
#include <windows.h>
#include <ddk/ntddk.h>
+#include <string.h>
typedef struct __DOSTIME
{
if ( lpFileTime2 == NULL )
return 0;
/*
- if ((GET_LARGE_INTEGER_HIGH_PART(lpFileTime1)) > (GET_LARGE_INTEGER_HIGH_PART(lpFileTime2)) )
+ if (lpFileTime1.HighPart > lpFileTime2.HighPart)
return 1;
- else if ((GET_LARGE_INTEGER_HIGH_PART(lpFileTime1)) < (GET_LARGE_INTEGER_HIGH_PART(lpFileTime2)))
+ else if (lpFileTime1.HighPart < lpFileTime2.HighPart)
return -1;
- else if ((GET_LARGE_INTEGER_LOW_PART(lpFileTime1)) > (GET_LARGE_INTEGER_LOW_PART(lpFileTime2)))
+ else if (lpFileTime1.LowPart > lpFileTime2.LowPart)
return 1;
- else if ((GET_LARGE_INTEGER_LOW_PART(lpFileTime1)) < (GET_LARGE_INTEGER_LOW_PART(lpFileTime2)))
+ else if (lpFileTime1.LowPart < lpFileTime2.LowPart)
return -1;
else
return 0;
)
{
-
-
LARGE_INTEGER FileTime;
LARGE_INTEGER Year;
LARGE_INTEGER Month;
Milliseconds = RtlEnlargedIntegerMultiply(lpSystemTime->wMilliseconds,10000);
- FileTime += RtlLargeIntegerAdd(FileTime,Year);
- FileTime += RtlLargeIntegerAdd(FileTime,Month);
- FileTime += RtlLargeIntegerAdd(FileTime,Day);
- FileTime += RtlLargeIntegerAdd(FileTime,Hour);
- FileTime += RtlLargeIntegerAdd(FileTime,Minute);
- FileTime += RtlLargeIntegerAdd(FileTime,Second);
+ FileTime = RtlLargeIntegerAdd(FileTime,Year);
+ FileTime = RtlLargeIntegerAdd(FileTime,Month);
+ FileTime = RtlLargeIntegerAdd(FileTime,Day);
+ FileTime = RtlLargeIntegerAdd(FileTime,Hour);
+ FileTime = RtlLargeIntegerAdd(FileTime,Minute);
+ FileTime = RtlLargeIntegerAdd(FileTime,Second);
- FileTime = RtlExtendedIntegerMultiply(FileTime,NSPERSEC);
+ FileTime = RtlExtendedIntegerMultiply(FileTime,NSPERSEC);
- FileTime = RtlLargeIntegerAdd(FileTime,Milliseconds);
+ FileTime = RtlLargeIntegerAdd(FileTime,Milliseconds);
memcpy(lpFileTime,&FileTime,sizeof(FILETIME));
dwMinute = RtlLargeIntegerDivide(dwRemHour,LIMINUTE,&dwRemMinute);
dwSecond = RtlLargeIntegerDivide(dwRemMinute,LISECOND,&dwRemSecond);
- lpSystemTime->wHour= (WORD) GET_LARGE_INTEGER_LOW_PART(dwHour);
- lpSystemTime->wMinute= (WORD)GET_LARGE_INTEGER_LOW_PART(dwMinute);
- lpSystemTime->wSecond= (WORD)GET_LARGE_INTEGER_LOW_PART(dwSecond);
- lpSystemTime->wMilliseconds = (WORD)(GET_LARGE_INTEGER_LOW_PART(dwRemSecond)/10000);
+ lpSystemTime->wHour= (WORD)(dwHour.LowPart);
+ lpSystemTime->wMinute= (WORD)(dwMinute.LowPart);
+ lpSystemTime->wSecond= (WORD)(dwSecond.LowPart);
+ lpSystemTime->wMilliseconds = (WORD)(dwRemSecond.LowPart/10000);
if ( lpSystemTime->wSecond > 60 ) {
if (lpSystemTime->wHour > 24 ) {
lpSystemTime->wHour-= 24;
- SET_LARGE_INTEGER_LOW_PART(dwDay,GET_LARGE_INTEGER_LOW_PART(dwDay)+1);
+ dwDay.LowPart = dwDay.LowPart + 1;
}
//FIXME since 1972 some years have a leap second [ aprox 15 out of 20 ]
// if leap year
- lpSystemTime->wYear= 1601 + 1000* (LONG)GET_LARGE_INTEGER_LOW_PART(dwMillenium) + 100 * (LONG)GET_LARGE_INTEGER_LOW_PART(dwCentury) + 4*(LONG)GET_LARGE_INTEGER_LOW_PART(dwFourYear) + (LONG)GET_LARGE_INTEGER_LOW_PART(dwYear);
+ lpSystemTime->wYear = 1601 + 1000* (LONG)dwMillenium.LowPart + 100 * (LONG)dwCentury.LowPart + 4 * (LONG)dwFourYear.LowPart + (LONG)dwYear.LowPart;
if ( (lpSystemTime->wYear % 4 == 0 && lpSystemTime->wYear % 100 != 0) || lpSystemTime->wYear % 400 == 0)
LeapDay = 1;
- if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= 0 && GET_LARGE_INTEGER_LOW_PART(dwDay) < 31 ) {
+ if ( dwDay.LowPart >= 0 && dwDay.LowPart < 31 ) {
lpSystemTime->wMonth = 1;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1;
+ lpSystemTime->wDay = dwDay.LowPart + 1;
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= 31 && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 59 + LeapDay )) {
+ else if ( dwDay.LowPart >= 31 && dwDay.LowPart < ( 59 + LeapDay )) {
lpSystemTime->wMonth = 2;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - 31;
+ lpSystemTime->wDay = dwDay.LowPart + 1 - 31;
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 59 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 90 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 59 + LeapDay ) && dwDay.LowPart < ( 90 + LeapDay ) ) {
lpSystemTime->wMonth = 3;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 59 + LeapDay);
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 59 + LeapDay);
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= 90+ LeapDay && GET_LARGE_INTEGER_LOW_PART(dwDay) < 120 + LeapDay) {
+ else if ( dwDay.LowPart >= 90+ LeapDay && dwDay.LowPart < 120 + LeapDay) {
lpSystemTime->wMonth = 4;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - (31 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - (31 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= 120 + LeapDay && GET_LARGE_INTEGER_LOW_PART(dwDay) < 151 + LeapDay ) {
+ else if ( dwDay.LowPart >= 120 + LeapDay && dwDay.LowPart < 151 + LeapDay ) {
lpSystemTime->wMonth = 5;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - (120 + LeapDay);
+ lpSystemTime->wDay = dwDay.LowPart + 1 - (120 + LeapDay);
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 151 + LeapDay) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 181 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 151 + LeapDay) && dwDay.LowPart < ( 181 + LeapDay ) ) {
lpSystemTime->wMonth = 6;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 151 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 151 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 181 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 212 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 181 + LeapDay ) && dwDay.LowPart < ( 212 + LeapDay ) ) {
lpSystemTime->wMonth = 7;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 181 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 181 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 212 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 243 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 212 + LeapDay ) && dwDay.LowPart < ( 243 + LeapDay ) ) {
lpSystemTime->wMonth = 8;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - (212 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - (212 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 243+ LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 273 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 243+ LeapDay ) && dwDay.LowPart < ( 273 + LeapDay ) ) {
lpSystemTime->wMonth = 9;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 243 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 243 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 273 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 304 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 273 + LeapDay ) && dwDay.LowPart < ( 304 + LeapDay ) ) {
lpSystemTime->wMonth = 10;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 273 + LeapDay);
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 273 + LeapDay);
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 304 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 334 + LeapDay ) ) {
+ else if ( dwDay.LowPart >= ( 304 + LeapDay ) && dwDay.LowPart < ( 334 + LeapDay ) ) {
lpSystemTime->wMonth = 11;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 304 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 304 + LeapDay );
}
- else if ( GET_LARGE_INTEGER_LOW_PART(dwDay) >= ( 334 + LeapDay ) && GET_LARGE_INTEGER_LOW_PART(dwDay) < ( 365 + LeapDay )) {
+ else if ( dwDay.LowPart >= ( 334 + LeapDay ) && dwDay.LowPart < ( 365 + LeapDay )) {
lpSystemTime->wMonth = 12;
- lpSystemTime->wDay = GET_LARGE_INTEGER_LOW_PART(dwDay) + 1 - ( 334 + LeapDay );
+ lpSystemTime->wDay = dwDay.LowPart + 1 - ( 334 + LeapDay );
}
dwDayOfWeek = RtlLargeIntegerDivide(FileTime,LIDAY,&dwRemDay);
- lpSystemTime->wDayOfWeek = 1 + GET_LARGE_INTEGER_LOW_PART(dwDayOfWeek) % 7;
+ lpSystemTime->wDayOfWeek = 1 + dwDayOfWeek.LowPart % 7;
return(NULL);
}
- SET_LARGE_INTEGER_HIGH_PART(FileOffset, 0);
- SET_LARGE_INTEGER_LOW_PART(FileOffset, DosHeader->e_lfanew);
+ FileOffset.HighPart = 0;
+ FileOffset.LowPart = DosHeader->e_lfanew;
Status = NtReadFile(hFile,
NULL,
+ sizeof(IMAGE_SECTION_HEADER) * Headers.FileHeader.NumberOfSections;
BaseAddress = (PVOID)Headers.OptionalHeader.ImageBase;
- LARGE_INTEGER_QUAD_PART(SectionOffset) = 0;
+ SectionOffset.QuadPart = 0;
Status = NtMapViewOfSection(hSection,
hProcess,
&BaseAddress,
return TRUE;
}
-
TIME Interval;
NTSTATUS errCode;
- Interval.LowPart = dwMilliseconds * 1000;
- Interval.HighPart = 0;
+ Interval.LowPart = dwMilliseconds * 1000;
+ Interval.HighPart = 0;
+
errCode = NtDelayExecution(bAlertable,&Interval);
if ( !NT_SUCCESS(errCode) ) {
SetLastError(RtlNtStatusToDosError(errCode));
}
else
{
- SET_LARGE_INTEGER_LOW_PART(Time,dwMilliseconds);
+ Time.LowPart = dwMilliseconds;
TimePtr = &Time;
}
LARGE_INTEGER Time;
DWORD retCode;
- SET_LARGE_INTEGER_LOW_PART(Time,dwMilliseconds);
+ Time.LowPart = dwMilliseconds;
errCode = NtWaitForMultipleObjects (
retCode = RtlNtStatusToDosError(errCode);
SetLastError(retCode);
return retCode;
-
-
}
Sections = (PIMAGE_SECTION_HEADER)SECHDROFFSET(ImageBase);
Base = (ULONG)(Sections[i].VirtualAddress + ImageBase);
- SET_LARGE_INTEGER_HIGH_PART(Offset,0);
- SET_LARGE_INTEGER_LOW_PART(Offset,Sections[i].PointerToRawData);
+ Offset.HighPart = 0;
+ Offset.LowPart = Sections[i].PointerToRawData;
Status = ZwMapViewOfSection(SectionHandle,
ProcessHandle,
(PVOID *)&Base,
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = SignedInteger;
+ RC.QuadPart = SignedInteger;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = UnsignedInteger;
+ RC.QuadPart = UnsignedInteger;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = (LONGLONG) Multiplicand * Multiplier;
+ RC.QuadPart = (LONGLONG) Multiplicand * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = (ULONGLONG) Multiplicand * Multiplier;
+ RC.QuadPart = (ULONGLONG) Multiplicand * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(Multiplicand) *
- Multiplier;
+ RC.QuadPart = Multiplicand.QuadPart * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- RC = LARGE_INTEGER_QUAD_PART(Addend1) +
- LARGE_INTEGER_QUAD_PART(Addend2);
+ RC.QuadPart = Addend1.QuadPart + Addend2.QuadPart;
return RC;
}
LARGE_INTEGER Source,
LARGE_INTEGER Mask)
{
- LARGE_INTEGER_QUAD_PART(*Result) = LARGE_INTEGER_QUAD_PART(Source) &
- LARGE_INTEGER_QUAD_PART(Mask);
+ Result->QuadPart = Source.QuadPart & Mask.QuadPart;
}
BOOLEAN
RtlLargeIntegerEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) ==
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart == Operand2.QuadPart;
#if 0
return Operand1.HighPart == Operand2.HighPart &&
Operand1.LowPart == Operand2.LowPart;
BOOLEAN
RtlLargeIntegerEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) == 0 ;
+ return Operand.QuadPart == 0 ;
}
BOOLEAN
RtlLargeIntegerGreaterThan(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart > Operand2.QuadPart;
#if 0
return Operand1.HighPart > Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
RtlLargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >=
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart >= Operand2.QuadPart;
#if 0
return Operand1.HighPart > Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
BOOLEAN
RtlLargeIntegerGreaterThanOrEqualToZero(LARGE_INTEGER Operand1)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) > 0;
+ return Operand1.QuadPart > 0;
#if 0
return Operand1.HighPart >= 0;
#endif
BOOLEAN
RtlLargeIntegerGreaterThanZero(LARGE_INTEGER Operand1)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >= 0;
+ return Operand1.QuadPart >= 0;
#if 0
return Operand1.HighPart > 0 ||
(Operand1.HighPart == 0 && Operand1.LowPart > 0);
RtlLargeIntegerLessThan(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) <
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart < Operand2.QuadPart;
#if 0
return Operand1.HighPart < Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
RtlLargeIntegerLessThanOrEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) <=
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart <= Operand2.QuadPart;
#if 0
return Operand1.HighPart < Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
BOOLEAN
RtlLargeIntegerLessThanOrEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) <= 0;
+ return Operand.QuadPart <= 0;
#if 0
return Operand.HighPart < 0 ||
(Operand.HighPart == 0 && Operand.LowPart == 0);
BOOLEAN
RtlLargeIntegerLessThanZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) < 0;
+ return Operand.QuadPart < 0;
#if 0
return Operand.HighPart < 0;
#endif
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = - LARGE_INTEGER_QUAD_PART(Subtrahend);
+ RC.QuadPart = - Subtrahend.QuadPart;
return RC;
}
RtlLargeIntegerNotEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) !=
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart != Operand2.QuadPart;
#if 0
return Operand1.LowPart != Operand2.LowPart ||
Operand1.HighPart != Operand2.HighPart;
BOOLEAN
RtlLargeIntegerNotEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) != 0;
+ return Operand.QuadPart != 0;
#if 0
return Operand.LowPart != 0 || Operand.HighPart != 0;
#endif
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(LargeInteger) <<
- ShiftCount;
+ RC.QuadPart = LargeInteger.QuadPart << ShiftCount;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(LargeInteger) >>
- ShiftCount;
+ RC.QuadPart = LargeInteger.QuadPart >> ShiftCount;
return RC;
}
{
LARGE_INTEGER RC;
- RC = LARGE_INTEGER_QUAD_PART(Minuend) - LARGE_INTEGER_QUAD_PART(Subtrahend);
+ RC.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart;
return RC;
}
Ccb->Buffer=ExAllocatePool(NonPagedPool,Dccb->SectorSize);
}
- SET_LARGE_INTEGER_HIGH_PART(Offset, 0);
- SET_LARGE_INTEGER_LOW_PART(Offset, Ccb->BlockNr * Dccb->SectorSize);
+ Offset.LowPart = Ccb->BlockNr * Dccb->SectorSize;
+ Offset.HighPart = 0;
KeInitializeEvent(&Event,NotificationEvent,FALSE);
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
Dccb->DeviceObject,
NTSTATUS Status;
KEVENT Event;
- SET_LARGE_INTEGER_HIGH_PART(Offset, 0);
- SET_LARGE_INTEGER_LOW_PART(Offset, Ccb->BlockNr * Dccb->SectorSize);
+ Offset.LowPart = Ccb->BlockNr * Dccb->SectorSize;
+ Offset.HighPart = 0;
KeInitializeEvent(&Event,NotificationEvent,FALSE);
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE,
Dccb->DeviceObject,
{
return(STATUS_UNSUCCESSFUL);
}
- PhysPageDirectory = (PULONG)
- GET_LARGE_INTEGER_LOW_PART(MmGetPhysicalAddress(PageDirectory));
+ PhysPageDirectory = (PULONG)(MmGetPhysicalAddress(PageDirectory)).LowPart;
KProcess->PageTableDirectory = PhysPageDirectory;
CurrentPageDirectory = (PULONG)PAGEDIRECTORY_MAP;
page_tlb = ADDR_TO_PTE(Address);
if (FreePage && PAGE_MASK(*page_tlb) != 0)
{
- MmFreePage(PAGE_MASK(*page_tlb),1);
+ MmFreePage((PVOID)PAGE_MASK(*page_tlb),1);
}
*page_tlb = 0;
if (Process != NULL && Process != CurrentProcess)
* FUNCTION: Returns the physical address corresponding to a virtual address
*/
{
- PHYSICAL_ADDRESS p = INITIALIZE_LARGE_INTEGER;
+ PHYSICAL_ADDRESS p;
+
+ p.QuadPart = 0;
DPRINT("MmGetPhysicalAddress(vaddr %x)\n", vaddr);
- SET_LARGE_INTEGER_HIGH_PART(p, 0);
- SET_LARGE_INTEGER_LOW_PART(p, PAGE_MASK(*MmGetPageEntry(vaddr)));
+ p.LowPart = PAGE_MASK(*MmGetPageEntry(vaddr));
+ p.HighPart = 0;
return p;
}
}
else
{
- SET_LARGE_INTEGER_LOW_PART(StackPtr->Parameters.Write.ByteOffset, 0);
- SET_LARGE_INTEGER_HIGH_PART(StackPtr->Parameters.Write.ByteOffset, 0);
+ StackPtr->Parameters.Write.ByteOffset.QuadPart = 0;
}
}
}
else
{
- SET_LARGE_INTEGER_LOW_PART(StackPtr->Parameters.Read.ByteOffset,
- 0);
- SET_LARGE_INTEGER_HIGH_PART(StackPtr->Parameters.Read.ByteOffset,
- 0);
+ StackPtr->Parameters.Read.ByteOffset.QuadPart = 0;
}
StackPtr->Parameters.Read.Length = Length;
}
}
else
{
- SET_LARGE_INTEGER_LOW_PART(StackPtr->Parameters.Write.ByteOffset,
- 0);
- SET_LARGE_INTEGER_HIGH_PART(StackPtr->Parameters.Write.ByteOffset,
- 0);
+ StackPtr->Parameters.Write.ByteOffset.QuadPart = 0;
}
StackPtr->Parameters.Write.Length = Length;
}
}
if (FileObject != NULL)
{
- SET_LARGE_INTEGER_LOW_PART(FileObject->CurrentByteOffset,
- GET_LARGE_INTEGER_LOW_PART(FileObject->CurrentByteOffset) +
- Irp->IoStatus.Information);
+ FileObject->CurrentByteOffset.LowPart =
+ FileObject->CurrentByteOffset.LowPart +
+ Irp->IoStatus.Information;
}
}
DPRINT("ByteOffset %x FileObject->CurrentByteOffset %d\n",
ByteOffset,
- GET_LARGE_INTEGER_LOW_PART(FileObject->CurrentByteOffset));
+ FileObject->CurrentByteOffset.LowPart);
if (ByteOffset==NULL)
{
ByteOffset = &(FileObject->CurrentByteOffset);
{
if (PerformanceFreq != NULL)
{
- LARGE_INTEGER_QUAD_PART(*PerformanceFreq) = 0;
+ PerformanceFreq->QuadPart = 0;
}
return *PerformanceFreq;
* 1st of January, 1601.
*/
{
- LARGE_INTEGER_QUAD_PART(*CurrentTime) = system_time;
+ CurrentTime->QuadPart = system_time;
}
NTSTATUS STDCALL NtGetTickCount(PULONG UpTime)
* TickCount (OUT) = Points to storage for the number of ticks
*/
{
- LARGE_INTEGER_QUAD_PART(*TickCount) = KiTimerTicks;
+ TickCount->QuadPart = KiTimerTicks;
}
static void HandleExpiredTimer(PKTIMER current)
Sections = (PIMAGE_SECTION_HEADER)SECHDROFFSET(BlockBuffer);
Base = Sections[i].VirtualAddress + ImageBase;
- SET_LARGE_INTEGER_HIGH_PART(Offset,0);
- SET_LARGE_INTEGER_LOW_PART(Offset,Sections[i].PointerToRawData);
+ Offset.HighPart = 0;
+ Offset.LowPart = Sections[i].PointerToRawData;
Status = ZwMapViewOfSection(NTDllSectionHandle,
ProcessHandle,
(PVOID *)&Base,
CHECKPOINT;
/* Allocate nonpageable memory for driver */
- ModuleLoadBase = ExAllocatePool(NonPagedPool,
- GET_LARGE_INTEGER_LOW_PART(FileStdInfo.EndOfFile));
+ ModuleLoadBase = ExAllocatePool(NonPagedPool,
+ FileStdInfo.EndOfFile.LowPart);
if (ModuleLoadBase == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
Status = ZwReadFile(FileHandle,
0, 0, 0, 0,
ModuleLoadBase,
- GET_LARGE_INTEGER_LOW_PART(FileStdInfo.EndOfFile),
+ FileStdInfo.EndOfFile.LowPart,
0, 0);
if (!NT_SUCCESS(Status))
{
{
PhysicalAddr = MmGetPhysicalAddress(MemoryArea->BaseAddress +
(i*PAGESIZE));
- MmFreePage((PVOID)(ULONG)
- (GET_LARGE_INTEGER_LOW_PART(PhysicalAddr)), 1);
+ MmFreePage((PVOID)(ULONG)(PhysicalAddr.LowPart), 1);
}
}
for (i=0; i<=(MemoryArea->Length/PAGESIZE); i++)
for (i=0;i<(PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGESIZE);i++)
{
Address = Mdl->StartVa + (i*PAGESIZE);
- mdl_pages[i] = GET_LARGE_INTEGER_LOW_PART(MmGetPhysicalAddress(Address));
+ mdl_pages[i] = (MmGetPhysicalAddress(Address)).LowPart;
DPRINT("mdl_pages[i] %x\n",mdl_pages[i]);
}
}
Mdl->MdlFlags = Mdl->MdlFlags | MDL_SOURCE_IS_NONPAGED_POOL;
for (va=0; va<Mdl->Size; va++)
{
- ((PULONG)(Mdl + 1))[va] = GET_LARGE_INTEGER_LOW_PART(
- MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE)));
+ ((PULONG)(Mdl + 1))[va] =
+ (MmGetPhysicalAddress(Mdl->StartVa + (va * PAGESIZE))).LowPart;
}
Mdl->MappedSystemVa = Mdl->StartVa;
}
#include <internal/ntoskrnl.h>
#include <internal/bitops.h>
#include <internal/string.h>
+#include <internal/io.h>
#include <internal/mmhal.h>
MemoryArea->Attributes,
(ULONG)MmAllocPage());
- LARGE_INTEGER_QUAD_PART(Offset) = (Address - MemoryArea->BaseAddress) +
+ Offset.QuadPart = (Address - MemoryArea->BaseAddress) +
MemoryArea->Data.SectionData.ViewOffset;
DPRINT("MemoryArea->Data.SectionData.Section->FileObject %x\n",
}
else
{
- LARGE_INTEGER_QUAD_PART(Section->MaximumSize) = 0xffffffff;
+ Section->MaximumSize.QuadPart = 0xffffffff;
}
Section->SectionPageProtection = SectionPageProtection;
Section->AllocateAttributes = AllocationAttributes;
}
DPRINT("ViewSize %x\n",ViewSize);
- if ((*ViewSize) > GET_LARGE_INTEGER_LOW_PART(Section->MaximumSize))
+ if ((*ViewSize) > Section->MaximumSize.LowPart)
{
- (*ViewSize) = GET_LARGE_INTEGER_LOW_PART(Section->MaximumSize);
+ (*ViewSize) = Section->MaximumSize.LowPart;
}
Status = MmCreateMemoryArea(UserMode,
}
else
{
- Result->Data.SectionData.ViewOffset =
- GET_LARGE_INTEGER_LOW_PART(*SectionOffset);
+ Result->Data.SectionData.ViewOffset = SectionOffset->LowPart;
}
DPRINT("*BaseAddress %x\n",*BaseAddress);
MmSetPage(NULL,
Result + (i * PAGESIZE),
PAGE_READWRITE,
- GET_LARGE_INTEGER_LOW_PART(PhysicalAddress) +
+ PhysicalAddress.LowPart +
(i * PAGESIZE));
}
return((PVOID)Result);
{
DPRINT("Scheduling current thread\n");
KeQueryTickCount(&TickCount);
- CurrentThread->Tcb.LastTick = GET_LARGE_INTEGER_LOW_PART(TickCount);
+ CurrentThread->Tcb.LastTick = TickCount.LowPart;
CurrentThread->Tcb.ThreadState = THREAD_STATE_RUNNING;
KeReleaseSpinLock(&ThreadListLock,irql);
return;
Candidate->Tcb.ThreadState = THREAD_STATE_RUNNING;
KeQueryTickCount(&TickCount);
- CurrentThread->Tcb.LastTick = GET_LARGE_INTEGER_LOW_PART(TickCount);
+ CurrentThread->Tcb.LastTick = TickCount.LowPart;
CurrentThread = Candidate;
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = SignedInteger;
+ RC.QuadPart = SignedInteger;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = UnsignedInteger;
+ RC.QuadPart = UnsignedInteger;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = (LONGLONG) Multiplicand * Multiplier;
+ RC.QuadPart = (LONGLONG) Multiplicand * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = (ULONGLONG) Multiplicand * Multiplier;
+ RC.QuadPart = (ULONGLONG) Multiplicand * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(Multiplicand) *
- Multiplier;
+ RC.QuadPart = Multiplicand.QuadPart * Multiplier;
return RC;
}
{
LARGE_INTEGER RC;
- RC = LARGE_INTEGER_QUAD_PART(Addend1) +
- LARGE_INTEGER_QUAD_PART(Addend2);
+ RC.QuadPart = Addend1.QuadPart + Addend2.QuadPart;
return RC;
}
LARGE_INTEGER Source,
LARGE_INTEGER Mask)
{
- LARGE_INTEGER_QUAD_PART(*Result) = LARGE_INTEGER_QUAD_PART(Source) &
- LARGE_INTEGER_QUAD_PART(Mask);
+ Result->QuadPart = Source.QuadPart & Mask.QuadPart;
}
LARGE_INTEGER RtlLargeIntegerArithmeticShift(LARGE_INTEGER LargeInteger,
LARGE_INTEGER RC;
- RC = LARGE_INTEGER_QUAD_PART(LargeInteger) >> ShiftCount;
+ RC.QuadPart = LargeInteger.QuadPart >> ShiftCount;
asm ("movb %2, %%cl\n\t"
"andb $0x3f, %%cl\n\t"
"movl %3, %%eax\n\t"
"sarl %%cl, %%edx\n\t"
"movl %%eax, %0\n\t"
"movl %%edx, %1\n\t"
- : "=m" (GET_LARGE_INTEGER_LOW_PART(LargeInteger)),
- "=m" (GET_LARGE_INTEGER_HIGH_PART(LargeInteger))
+ : "=m" (LargeInteger.LowPart),
+ "=m" (LargeInteger.HighPart)
: "m" (ShiftCount),
- "0" (GET_LARGE_INTEGER_LOW_PART(LargeInteger)),
- "1" (GET_LARGE_INTEGER_HIGH_PART(LargeInteger))
+ "0" (LargeInteger.LowPart),
+ "1" (LargeInteger.HighPart)
: "eax", "ecx", "edx"
);
RtlLargeIntegerEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) ==
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart == Operand2.QuadPart;
#if 0
return Operand1.HighPart == Operand2.HighPart &&
Operand1.LowPart == Operand2.LowPart;
BOOLEAN
RtlLargeIntegerEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) == 0 ;
+ return Operand.QuadPart == 0 ;
}
BOOLEAN
RtlLargeIntegerGreaterThan(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart > Operand2.QuadPart;
#if 0
return Operand1.HighPart > Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
RtlLargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >=
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart >= Operand2.QuadPart;
#if 0
return Operand1.HighPart > Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
BOOLEAN
RtlLargeIntegerGreaterThanOrEqualToZero(LARGE_INTEGER Operand1)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) > 0;
+ return Operand1.QuadPart >= 0;
#if 0
return Operand1.HighPart >= 0;
#endif
BOOLEAN
RtlLargeIntegerGreaterThanZero(LARGE_INTEGER Operand1)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) >= 0;
+ return Operand1.QuadPart > 0;
#if 0
return Operand1.HighPart > 0 ||
(Operand1.HighPart == 0 && Operand1.LowPart > 0);
RtlLargeIntegerLessThan(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) <
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart < Operand2.QuadPart;
#if 0
return Operand1.HighPart < Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
RtlLargeIntegerLessThanOrEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) <=
- LARGE_INTEGER_QUAD_PART(Operand2);
+ return Operand1.QuadPart <= Operand2.QuadPart;
#if 0
return Operand1.HighPart < Operand2.HighPart ||
(Operand1.HighPart == Operand2.HighPart &&
BOOLEAN
RtlLargeIntegerLessThanOrEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) <= 0;
+ return Operand.QuadPart <= 0;
#if 0
return Operand.HighPart < 0 ||
(Operand.HighPart == 0 && Operand.LowPart == 0);
BOOLEAN
RtlLargeIntegerLessThanZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) < 0;
+ return Operand.QuadPart < 0;
#if 0
return Operand.HighPart < 0;
#endif
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = - LARGE_INTEGER_QUAD_PART(Subtrahend);
+ RC.QuadPart = - Subtrahend.QuadPart;
return RC;
}
RtlLargeIntegerNotEqualTo(LARGE_INTEGER Operand1,
LARGE_INTEGER Operand2)
{
- return LARGE_INTEGER_QUAD_PART(Operand1) !=
- LARGE_INTEGER_QUAD_PART(Operand2);
-#if 0
- return Operand1.LowPart != Operand2.LowPart ||
- Operand1.HighPart != Operand2.HighPart;
-#endif
+ return Operand1.QuadPart != Operand2.QuadPart;
}
BOOLEAN
RtlLargeIntegerNotEqualToZero(LARGE_INTEGER Operand)
{
- return LARGE_INTEGER_QUAD_PART(Operand) != 0;
-#if 0
- return Operand.LowPart != 0 || Operand.HighPart != 0;
-#endif
+ return Operand.QuadPart != 0;
}
LARGE_INTEGER RtlLargeIntegerShiftLeft(LARGE_INTEGER LargeInteger,
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(LargeInteger) <<
- ShiftCount;
+ RC.QuadPart = LargeInteger.QuadPart << ShiftCount;
return RC;
}
{
LARGE_INTEGER RC;
- LARGE_INTEGER_QUAD_PART(RC) = LARGE_INTEGER_QUAD_PART(LargeInteger) >>
- ShiftCount;
+ RC.QuadPart = LargeInteger.QuadPart >> ShiftCount;
return RC;
}
{
LARGE_INTEGER RC;
- RC = LARGE_INTEGER_QUAD_PART(Minuend) - LARGE_INTEGER_QUAD_PART(Subtrahend);
+ RC.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart;
return RC;
}
EXTRA_CFLAGS = -Werror
endif
-DEFINES = -DDBG -DCOMPILER_LARGE_INTEGERS
+DEFINES = -DDBG
ifeq ($(WIN32_LEAN_AND_MEAN),yes)
LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
#include "cmd.h"
-#ifdef __REACTOS__
-#include <kernel32/li.h>
-#endif
-
/* flag definitions */
INT c = 0;
INT n = 0;
-#ifndef __REACTOS__
if (num.QuadPart == 0)
-#else
- if (num == 0)
-#endif
{
des[0] = _T('0');
des[1] = _T('\0');
else
{
temp[31] = 0;
-#ifndef __REACTOS__
while (num.QuadPart > 0)
-#else
- while (num > 0)
-#endif
{
if (((c + 1) % (nNumberGroups + 1)) == 0)
temp[30 - c++] = cThousandSeparator;
-#ifndef __REACTOS__
temp[30 - c++] = (TCHAR)(num.QuadPart % 10) + _T('0');
num.QuadPart /= 10;
-#else
- temp[30 - c++] = (TCHAR)(num % 10) + _T('0');
- num /= 10;
-#endif
}
for (n = 0; n <= c; n++)
buffer, ulFiles == 1 ? _T(' ') : _T('s'));
ConvertULargeInteger (bytes, buffer, sizeof(buffer));
-#ifndef __REACTOS__
ConOutPrintf (_T(" %15s byte%c\n"),
buffer, bytes.QuadPart == 1 ? _T(' ') : _T('s'));
-#else
- ConOutPrintf (_T(" %15s byte%c\n"),
- buffer, bytes == 1 ? _T(' ') : _T('s'));
-#endif
if (IncLine (pLine, dwFlags))
return 1;
szRoot[0] = szPath[0];
GetDiskFreeSpace (szRoot, &dwSecPerCl, &dwBytPerSec, &dwFreeCl, &dwTotCl);
-#ifndef __REACTOS__
uliFree.QuadPart = dwSecPerCl * dwBytPerSec * dwFreeCl;
-#else
- uliFree = dwSecPerCl * dwBytPerSec * dwFreeCl;
-#endif
ConvertULargeInteger (uliFree, buffer, sizeof(buffer));
ConOutPrintf (_T(" %15s bytes free\n"), buffer);
}
ULONG dircount = 0;
INT count;
-#ifndef __REACTOS__
bytecount.QuadPart = 0;
-#else
- bytecount = 0;
-#endif
_tcscpy (szFullPath, szPath);
if (szFullPath[_tcslen(szFullPath) - 1] != _T('\\'))
count = 0;
}
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
- bytecount += uliSize;
-#endif
}
else if (dwFlags & DIR_BARE)
{
if (IncLine (pLine, dwFlags))
return 1;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
bytecount.QuadPart += uliSize.QuadPart;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
- bytecount += uliSize;
-#endif
}
else
{
{
ULARGE_INTEGER uliSize;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
-#endif
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %20s"), buffer);
-#ifndef __REACTOS__
bytecount.QuadPart += uliSize.QuadPart;
-#else
- bytecount += uliSize;
-#endif
filecount++;
}
{
ULARGE_INTEGER uliSize;
-#ifndef __REACTOS__
- uliSize.u.LowPart = file.nFileSizeLow;
- uliSize.u.HighPart = file.nFileSizeHigh;
-#else
- SET_LARGE_INTEGER_LOW_PART(uliSize, file.nFileSizeLow);
- SET_LARGE_INTEGER_HIGH_PART(uliSize, file.nFileSizeHigh);
-#endif
-
- ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
+ uliSize.LowPart = file.nFileSizeLow;
+ uliSize.HighPart = file.nFileSizeHigh;
+ ConvertULargeInteger (uliSize, buffer, sizeof(buffer));
ConOutPrintf (_T(" %10s "), buffer);
-#ifndef __REACTOS__
bytecount.QuadPart += uliSize.QuadPart;
-#else
- bytecount += uliSize;
-#endif
filecount++;
}
{
recurse_dir_cnt += dircount;
recurse_file_cnt += filecount;
-#ifndef __REACTOS__
recurse_bytes.QuadPart += bytecount.QuadPart;
-#else
- recurse_bytes += bytecount;
-#endif
/* print_summary */
if (PrintSummary (szPath, filecount, dircount, bytecount, pLine, dwFlags))
static INT
DirRecurse (LPTSTR szPath, LPTSTR szSpec, LPINT pLine, DWORD dwFlags)
{
- recurse_dir_cnt = 0L;
- recurse_file_cnt = 0L;
-#ifdef __REACTOS__
- recurse_bytes = 0;
-#else
- recurse_bytes.QuadPart = 0;
-#endif
-
if (!PrintDirectoryHeader (szPath, pLine, dwFlags))
return 1;
dwFlags &= ~DIR_RECURSE;
if (PrintSummary (szPath, recurse_file_cnt,
- recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
+ recurse_dir_cnt, recurse_bytes, pLine, dwFlags))
return 1;
if ((dwFlags & DIR_BARE) == 0)
INT nLine = 0;
+ recurse_dir_cnt = 0L;
+ recurse_file_cnt = 0L;
+ recurse_bytes.QuadPart = 0;
+
/* read the parameters from the DIRCMD environment variable */
if (GetEnvironmentVariable (_T("DIRCMD"), dircmd, 256))
{