Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

The function DeviceIoControl( for IOCTL_DISK_GET_DRIVE_LAYOUT ) returns error code 1

$
0
0

Hi,

I have implemented the following function in my cpp code to retrieve information of the disks of a Windows system:-

DeviceIoControl ( hDevice, IOCTL_DISK_GET_DRIVE_LAYOUT, NULL, 0, buffer, (DWORD)dwBytes, (LPDWORD)&dwBytesReturned, (LPOVERLAPPED) NULL);

but it returns error code 1( ERROR_INVALID_FUNCTION) for handful of  windows server but is working fine on a large number of servers.

Can anyone suggest the reason behind this error? Is it machine/registry related?

Thanks in advance.


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>