Skip to main content

Posts

CPP: Windows: GetDiskFreeSpaceExW

CPP: Windows: GetDiskFreeSpaceExW Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread. Notes: - Tested using Visual Studio 2022 (17.2.6) C++ Windows Console template Reference(s): https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskfreespaceexw

CPP: Windows: FindFirstVolumeW

CPP: Windows: FindFirstVolumeW Retrieves the name of a volume on a computer. FindFirstVolume is used to begin scanning the volumes of a computer. See line 85 for sample usage Notes: - Tested using Visual Studio 2022 (17.2.6) C++ Windows Console template Reference(s): https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstvolumew

CPP: Windows: DeviceIoControl

CPP: Windows: DeviceIoControl An application can use the DeviceIoControl function to perform direct input and output operations on, or retrieve information about, a floppy disk drive, hard disk drive, tape drive, or CD-ROM drive. The following example demonstrates how to retrieve information about the first physical drive in the system. It uses the CreateFile function to retrieve the device handle to the first physical drive, and then uses DeviceIoControl with the IOCTL_DISK_GET_DRIVE_GEOMETRY control code to fill a DISK_GEOMETRY structure with information about the drive. Notes: - Tested using Visual Studio 2022 (17.2.6) C++ Windows Console template Reference(s): https://docs.microsoft.com/en-us/windows/win32/devio/calling-deviceiocontrol