BOOL DeviceIoControl( (HANDLE) hDevice, // handle to device of interest IOCTL_DISK_SET_PARTITION_INFO, // dwIoControlCode, control code of // operation to perform (LPVOID) lpInBuffer, // address of input buffer (DWORD) nInBufferSize, // size, in bytes, of input buffer NULL, // lpOutBuffer is not used; must be NULL 0, // nOutBufferSize is not used; // must be zero (LPDWORD) lpBytesReturned, // pointer to variable to receive // output byte count (LPOVERLAPPED) lpOverlapped // pointer to OVERLAPPED structure // for asynchronous operation );
你上这里看看,easy
http://www.codeguru.com/system/DriverService.html
(HANDLE) hDevice, // handle to device of interest
IOCTL_DISK_SET_PARTITION_INFO, // dwIoControlCode, control code of
// operation to perform
(LPVOID) lpInBuffer, // address of input buffer
(DWORD) nInBufferSize, // size, in bytes, of input buffer
NULL, // lpOutBuffer is not used; must be NULL
0, // nOutBufferSize is not used;
// must be zero
(LPDWORD) lpBytesReturned, // pointer to variable to receive
// output byte count
(LPOVERLAPPED) lpOverlapped // pointer to OVERLAPPED structure
// for asynchronous operation
);