a2295926 发表于 2014-3-11 11:13:17

请问各个大虾 如何用DllStructCreate调用双重数据结构

本帖最后由 a2295926 于 2014-3-11 11:25 编辑

目的是 获取gpt盘号,但是基本都用mbr盘,希望各个大虾用mbr做个实例
在下感激不尽,拜托大虾咯!!!!
列如:
函数原型:
BOOL DeviceIoControl(
(HANDLE) hDevice,               // handle to device
IOCTL_DISK_SET_PARTITION_INFO_EX, // dwIoControlCode
(LPVOID) lpInBuffer,            // input buffer
(DWORD) nInBufferSize,            // size of input buffer
NULL,                           // lpOutBuffer
0,                              // nOutBufferSize
(LPDWORD) lpBytesReturned,      // number of bytes returned
(LPOVERLAPPED) lpOverlapped       // OVERLAPPED structure
);


结构1 原型:
typedef struct _PARTITION_INFORMATION_EX {
PARTITION_STYLE PartitionStyle;
LARGE_INTEGER   StartingOffset;
LARGE_INTEGER   PartitionLength;
ULONG         PartitionNumber;
BOOLEAN         RewritePartition;
union {
    PARTITION_INFORMATION_MBR Mbr;
    PARTITION_INFORMATION_GPT Gpt;
};
} PARTITION_INFORMATION_EX, *PPARTITION_INFORMATION_EX;

结构2 第一种 原型
typedef struct _PARTITION_INFORMATION_MBR {
UCHAR   PartitionType;
BOOLEAN BootIndicator;
BOOLEAN RecognizedPartition;
ULONG   HiddenSectors;
} PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR;

结构2 第二种 原型:
typedef struct _PARTITION_INFORMATION_GPT {
GUID    PartitionType;
GUID    PartitionId;
ULONG64 Attributes;
WCHAR   Name;
} PARTITION_INFORMATION_GPT, *PPARTITION_INFORMATION_GPT;


IOCTL控制码(网上找的,我过一些是可以能用的)
IOCTL_STORAGE_CHECK_VERIFY :2D4800
IOCTL_STORAGE_CHECK_VERIFY2 :2D0800
IOCTL_STORAGE_MEDIA_REMOVAL :2D4804
IOCTL_STORAGE_EJECT_MEDIA :2D4808
IOCTL_STORAGE_LOAD_MEDIA :2D480C
IOCTL_STORAGE_LOAD_MEDIA2 :2D080C
IOCTL_STORAGE_RESERVE :2D4810
IOCTL_STORAGE_RELEASE :2D4814
IOCTL_STORAGE_FIND_NEW_DEVICES :2D4818
IOCTL_STORAGE_EJECTION_CONTROL :2D0940
IOCTL_STORAGE_MCN_CONTROL :2D0944
IOCTL_STORAGE_GET_MEDIA_TYPES :2D0C00
IOCTL_STORAGE_GET_MEDIA_TYPES_EX :2D0C04
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER :2D0C10
IOCTL_STORAGE_GET_HOTPLUG_INFO :2D0C14
IOCTL_STORAGE_SET_HOTPLUG_INFO :2DCC18
IOCTL_STORAGE_RESET_BUS :2D5000
IOCTL_STORAGE_RESET_DEVICE :2D5004
IOCTL_STORAGE_BREAK_RESERVATION :2D5014
IOCTL_STORAGE_GET_DEVICE_NUMBER :2D1080
IOCTL_STORAGE_PREDICT_FAILURE :2D1100
IOCTL_STORAGE_READ_CAPACITY :2D5140
IOCTL_DISK_GET_DRIVE_GEOMETRY :70000
IOCTL_DISK_GET_PARTITION_INFO :74004
IOCTL_DISK_SET_PARTITION_INFO :7C008
IOCTL_DISK_GET_DRIVE_LAYOUT :7400C
IOCTL_DISK_SET_DRIVE_LAYOUT :7C010
IOCTL_DISK_VERIFY :70014
IOCTL_DISK_FORMAT_TRACKS :7C018
IOCTL_DISK_REASSIGN_BLOCKS :7C01C
IOCTL_DISK_PERFORMANCE :70020
IOCTL_DISK_IS_WRITABLE :70024
IOCTL_DISK_LOGGING :70028
IOCTL_DISK_FORMAT_TRACKS_EX :7C02C
IOCTL_DISK_HISTOGRAM_STRUCTURE :70030
IOCTL_DISK_HISTOGRAM_DATA :70034
IOCTL_DISK_HISTOGRAM_RESET :70038
IOCTL_DISK_REQUEST_STRUCTURE :7003C
IOCTL_DISK_REQUEST_DATA :70040
IOCTL_DISK_PERFORMANCE_OFF :70060
IOCTL_DISK_CONTROLLER_NUMBER :70044
IOCTL_DISK_GET_PARTITION_INFO_EX :70048
IOCTL_DISK_SET_PARTITION_INFO_EX :7C04C
IOCTL_DISK_GET_DRIVE_LAYOUT_EX :70050
IOCTL_DISK_SET_DRIVE_LAYOUT_EX :7C054
IOCTL_DISK_CREATE_DISK :7C058
IOCTL_DISK_GET_LENGTH_INFO :7405C
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX :700A0
IOCTL_DISK_REASSIGN_BLOCKS_EX :7C0A4
IOCTL_DISK_UPDATE_DRIVE_SIZE :7C0C8
IOCTL_DISK_GROW_PARTITION :7C0D0
IOCTL_DISK_GET_CACHE_INFORMATION :740D4
IOCTL_DISK_SET_CACHE_INFORMATION :7C0D8
IOCTL_DISK_DELETE_DRIVE_LAYOUT :7C100
IOCTL_DISK_UPDATE_PROPERTIES :70140
IOCTL_DISK_FORMAT_DRIVE :7C3CC
IOCTL_DISK_SENSE_DEVICE :703E0
IOCTL_DISK_CHECK_VERIFY :74800
IOCTL_DISK_MEDIA_REMOVAL :74804
IOCTL_DISK_EJECT_MEDIA :74808
IOCTL_DISK_LOAD_MEDIA :7480C
IOCTL_DISK_RESERVE :74810
IOCTL_DISK_RELEASE :74814
IOCTL_DISK_FIND_NEW_DEVICES :74818
IOCTL_DISK_GET_MEDIA_TYPES :70C00
IOCTL_CHANGER_GET_PARAMETERS :304000
IOCTL_CHANGER_GET_STATUS :304004
IOCTL_CHANGER_GET_PRODUCT_DATA :304008
IOCTL_CHANGER_SET_ACCESS :30C010
IOCTL_CHANGER_GET_ELEMENT_STATUS :30C014
IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS :304018
IOCTL_CHANGER_SET_POSITION :30401C
IOCTL_CHANGER_EXCHANGE_MEDIUM :304020
IOCTL_CHANGER_MOVE_MEDIUM :304024
IOCTL_CHANGER_REINITIALIZE_TRANSPORT :304028
IOCTL_CHANGER_QUERY_VOLUME_TAGS :30C02C
IOCTL_SERIAL_LSRMST_INSERT :1B007C
IOCTL_SERENUM_EXPOSE_HARDWARE :370200
IOCTL_SERENUM_REMOVE_HARDWARE :370204
IOCTL_SERENUM_PORT_DESC :370208
IOCTL_SERENUM_GET_PORT_NAME :37020C
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS :560000
IOCTL_VOLUME_IS_CLUSTERED :560030
页: [1]
查看完整版本: 请问各个大虾 如何用DllStructCreate调用双重数据结构