locked
Why is ICreateDeviceAccessAsync::GetResult returning E_INVALIDARG?

    Question

  • I am trying to access a custom driver using IO control codes from a Metro app.  I have already done this successfully using a desktop app.  I am doing the following for the Metro app:

    ICreateDeviceAccessAsync *access;
    HRESULT hr = CreateDeviceAccessInstance(IID_IDeviceIoControl, L"\\\\.\\MyDevice", GENERIC_READ | GENERIC_WRITE, &access);
    if (SUCCEEDED(hr))
    {
        hr = access->Start();
        if (SUCCEEDED(hr))
        {
            hr = access->Wait(INFINITE);
            if (SUCCEEDED(hr))
            {
                IDeviceIoControl *control;
                hr = access->GetResult(reinterpret_cast<void **>(&control));
                if (SUCCEEDED(hr))
                {
                }
            }
        }
        access->Release();
    }
    

    The GetResult call is returning E_INVALIDARG.  I have not configured the device metadata for my driver, so I would expect this call to return E_ACCESSDENIED instead.  Why would this call return E_INVALIDARG?

    Tuesday, January 10, 2012 1:35 AM

Answers

All replies