Ask Experts Questions for FREE Help !
Ask
    sisakhar's Avatar
    sisakhar Posts: 1, Reputation: 1
    New Member
     
    #1

    Oct 4, 2011, 09:28 AM
    IOCTL_STORAGE_QUERY_PROPERTY failing on non-boot hard drive?
    Hi,
    I have C++ Code that query HD property of all drives connected to the system. The code sends IOCTL_STORAGE_QUERY_PROPERTY, with DeviceIOControl function. This code works great on Windows XP, however on Windows Server 2008 SP2 (64 bit), it fails with error code 87. I am able to read device properties from \\.\PhysicalDrive0 - boot drive, but not from any other drives. I have 3 hd connected, all SAS drives.

    Here is the code. Please help.

    HANDLE hdl=drive_handle;
    DWORD bytesRet;
    DWORD outSize;
    DWORD error;
    STORAGE_PROPERTY_QUERY input;
    STORAGE_DEVICE_DESCRIPTOR *output;

    Memset(&input, 0, sizeof(input));

    input.PropertyId = StorageDeviceProperty;
    input.QueryType = PropertyExistsQuery;

    if(!DeviceIoControl(hdl,
    IOCTL_STORAGE_QUERY_PROPERTY,
    &input,
    sizeof(STORAGE_PROPERTY_QUERY),
    NULL,
    0,
    &bytesRet,
    NULL))
    {
    error = GetLastError();
    tsVerbose(1,"Failed to storage property query, error %d", error);
    return FALSE;
    }

Check out some similar questions!

Failing hard drive [ 12 Answers ]

I recently replaced my old HDD (Seagate 80GB 7200 RPM IDE)with new one Seagate 500GB 7200 RPM SATA (ST3500418AS) I use the speed fan S.M.A.R.T. to check my HDD status it shows fitness & performance of my HDD above 92-93% But now for past 4 days its fitness keep reducing and now it's at 29%...

Intsalled Hard Drive - Freezing at Boot Up [ 6 Answers ]

I though I had it, but... I have a Compaq Presario 5333cl desktop with an Seagate 80GB HD (IDE). Running Windows XP SP2. Am using Casper XP 3.0 cloning software, which works within Windows. Installed and successfully cloned a new WD 320GB HD in disk #2 position. Both drives set to cable...

Boot computer and wipe off hard drive to sell [ 3 Answers ]

I have a software to wipe off the hard drive of my computer but I don't know how to boot it so that I can use the software. I do not want to reinstall anything because I am going to sell it. thank you

How to boot new hard drive [ 2 Answers ]

I tried to defrag. My hard drive but it would stop with an error message each time, I run norton disk doctor ,the result was no errors. So I decided to change the hard drive with an old drive that I used to used as my master drive in another computer but when I installed it ,the computer would...

Boot linux from an external hard drive dual boot? [ 1 Answers ]

Can I boot linex from an external hard drive dual boot. How do I do it ?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.