Sunday, July 24, 2022

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

Saturday, July 23, 2022

CPP: Windows: GetLogicalDriveStrings

CPP: Windows: GetLogicalDriveStrings

Fills a buffer with strings that specify valid drives in the system.

Notes:
- Tested using Visual Studio 2022 C++ Windows Console template
Reference(s):
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrivestringsw

Friday, July 22, 2022

Python: Convert string to and from base64 format

Python: Convert string to and from base64 format

Base64 encoding is a format that can be used for data transfer in HTML or general data representation as you don't need to escape it. To convert a stream of byte object to base64 and vice versa, use the following example.

Sunday, July 17, 2022

CPP: Windows: Get logical drives

CPP: Windows: Get logical drives

Retrieves a bitmask representing the currently available disk drives.

Notes:
- Tested using Visual Studio 2022 C++ Windows Console template
Reference(s):
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrives

Installing QNX 6.4.1 on Ubuntu 20.04

Installing QNX 6.4.1 on Ubuntu 20.04 Install pre-requisites $: sudo dpkg --add-architecture i386 $: sudo apt update $: sudo apt install li...