Files.inc

This file defines constants, structures, and macros for file management functions of PwnOS.

Includes

See Also

Authors

  • Neil G.  Dickson
Summary
Files.incThis file defines constants, structures, and macros for file management functions of PwnOS.
ATADEVICEINFOThis structure defines a hardware device connected through the ATA controller (mostly harddrives and CD/DVD drives).
PARTITIONINFOThis structure defines a partition on a drive.
PARTITIONINFO_EXTENDEDThis structure defines an extended partition on a drive.
Constants
Partition Type ConstantsThese constants identify partition types.
FILEThis structure defines an open file.
FILE_HARDDRIVEThis structure defines an open file on a harddrive.

ATADEVICEINFO

This structure defines a hardware device connected through the ATA controller (mostly harddrives and CD/DVD drives).

Members

PartitionTypealways PARTITIONTYPE_DRIVE so that it is possible to figure out whether the parent of a partition is another partition or a drive
DeviceNumthe I/O device number, one of the ATA constants of I/O Device Numbers
nSectorsthe number of sectors on the drive
Flagsmiscellaneous flags, from <ATA Driver Flags>
AccessLockLOCKSTRUCT to gain exclusive access to the device
SupportFlagsflags indicating feature support from the ATA Identify Device command’s structure
pPartitionsarray of 4 pointers to PARTITIONINFO structures (or NULL where there is no partition)

PARTITIONINFO

This structure defines a partition on a drive.  Specific partition types each have their own structures with this as a header, e.g.  PARTITIONINFO_EXTENDED and <PARTITIONINFO_NTFS>.

Members

PartitionTypeone of the <Partition Type Constants>, except not PARTITIONTYPE_DRIVE
DeviceNumthe I/O device number of the device containing the partition, one of the I/O Device Numbers
pParentaddress of the parent PARTITIONINFO structure or parent device structure
Flagsmiscellaneous flags, e.g.  PARTITIONINFO_FLAG_BOOTABLE
FirstSectorLBA number of the first sector of the partition
nSectorsnumber of sectors in the partition
Synonymunicode string of up to 4 characters indicating a synonym for this partition, or all 0 if none

PARTITIONINFO_EXTENDED

This structure defines an extended partition on a drive.

Members

Headerthe PARTITIONINFO structure component of this structure
pPartitionsarray of 4 pointers to PARTITIONINFO structures (or NULL where there is no partition)
Summary
Constants
Partition Type ConstantsThese constants identify partition types.

Constants

Partition Type Constants

These constants identify partition types.

Members

PARTITIONTYPE_DRIVEindicates that the structure doesn’t represent a partition, but rather a drive, e.g.  ATADEVICEINFO
PARTITIONTYPE_EXTENDEDindicates that the structure is a PARTITIONINFO_EXTENDED structure
PARTITIONTYPE_NTFSindicates that the structure is a <PARTITIONINFO_NTFS> structure; 4 bytes containing ASCII letters N,T,F,S

FILE

This structure defines an open file.  Files open on different media or partition types have their own structures with this as a header, e.g.  FILE_HARDDRIVE and <FILE_NTFS>.

Members

AccessLockLOCKSTRUCT to gain exclusive access to the file
pFullPathaddress of a zero-terminated, unicode string containing the full path of the file, excluding protocol, drive, and partition
pNamepointer into the full path of the filename without the directories (so it doesn’t need its own allocation)
Protocolone of the <Data Protocol Constants>
Accesssome combination of the <File Access Constants>, indicating the access to the file

FILE_HARDDRIVE

This structure defines an open file on a harddrive.  Files open on different partition types have their own structures with this as a header, e.g.  <FILE_NTFS>.

Members

Headerthe FILE structure component of this structure
pPartitionaddress of the PARTITIONINFO structure for the partition that this file is on
OffsetInFileoffset into the file at which read and write operations will next occur
This file defines constants, structures, and macros for the NTFS driver of PwnOS.
This file defines file management functions of PwnOS.
These constants define numbers identifying each device location.
This structure is the centre of synchronization data in PwnOS, defining the state of an access lock.
This structure defines a partition on a drive.
This structure defines an extended partition on a drive.
This structure defines a hardware device connected through the ATA controller (mostly harddrives and CD/DVD drives).
This structure defines an open file on a harddrive.
This structure defines an open file.