C ++ Builder several application skills

zhaozj2021-02-17  51

Access the hard disk directly under 9x In Windows 9x, due to the protection of memory and processes, direct use INT will cause GPFS. In many information, it is said that the way to read and write hard drives directly in Windows is only using VXD. This is not true, in fact, using the Windows9x disclosed API can operate directly to the hard disk. In Microsoft Programmer's Guide To Win95, there is an explanation of how to use VWIN32 call MSDOS system services (Disk Access classes) for Device I / O Control. Defined at five control code: VWIN32_DIOC_DOS_DRIVEINFO (6) INT 21h AX = 730Xh, access VWIN32_DIOC_DOS_INT13 FAT32 file system win95 osr2 and later provided (4) BIOS INT13hVWIN32_DIOC_DOS_INT25 (2) DOS INT25hVWIN32_DIOC_DOS_INT26 (3) DOS INT26hVWIN32_DIOC_DOS_IOCTL (1) DOS Device I / O, (int 21H, AX = 4400h to 4411h) Usage: Use createfile (".// vwin32", 0, 0, null, 0, file_flag_delete_on_close, null); Open vwin32.vxd according to the function the use of register filling the following structure: typedef struct _DIOC_REGISTERS {DWORD reg_EBX; DWORD reg_EDX; DWORD reg_ECX; DWORD reg_EAX; DWORD reg_EDI; DWORD reg_ESI; DWORD reg_Flags;} DIOC_REGISTERS, * PDIOC_REGISTERS; use DeviceIoControl (hDevice, CONTROL_CODE, & reg, sizeof (REG), & REG, SIZEOF (REG), & DWBYTESRETURN, 0); call the MS-DOS disk access function. Finally call CloseHandle (HDEvice);

Determine hard disk space

When installing some software, we will seem that some installer will tell you that you choose the hard disk space, how is this program that determines the hard disk space? GetDiskFreespace is a function that returns a disk size, division, available space, etc. We can use it to achieve your purpose. DWord SectorsperCluster; DWORD BYTESPERSECTOR; DWORD CLUSTERS; DWORD CLUSTERS; GetDiskFreespace (path.c_str (), & sectorspercluster, & lytespector, & freeclusters, & clusters;

How much memory is determined

转载请注明原文地址:https://www.9cbs.com/read-29439.html

New Post(0)