获取GPT 分区 信息

该博客介绍了如何使用IOCTL_DISK_GET_PARTITION_INFO_EX控制代码从设备中获取磁盘分区的详细信息。它涉及到DeviceIoControl函数的使用,参数解释以及在不同类型的磁盘上支持的情况,特别提到了在64位系统上对GUID分区表(GPT)的支持。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

IOCTL_DISK_GET_PARTITION_INFO_EX control code
Retrieves extended information about the type, size, and nature of a disk partition.
To perform this operation, call the DeviceIoControl function with the following parameters.

BOOL DeviceIoControl(
  (HANDLE) hDevice,                 // handle to a partition
  IOCTL_DISK_GET_PARTITION_INFO_EX, // dwIoControlCode
  NULL,                             // lpInBuffer
  0,                                // nInBufferSize
  (LPVOID) lpOutBuffer,             // output buffer
  (DWORD) nOutBufferSize,           // size of output buffer
  (LPDWORD) lpBytesReturned,        // number of bytes returned
  (LPOVERLAPPED) lpOverlapped       // OVERLAPPED structure
);

Parameters
hDevice
A handle to the disk device from which partition information is retrieved. To retrieve a device handle, call the CreateFile function.
dwIoControlCode
The control code for the operation. Use IOCTL_DISK_GET_PARTITION_INFO_EX for this operation.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值