I'm use dxgi to capture login screen,and set the process auto startup(use instsrv+srvany). but when I call the code
if (FAILED(hr = pAdapter->EnumOutputs(0, &pOutput)))
{
printf("error:%x\n", hr);
CLEAN_RETURN(hr);
}
the error code is DXGI_ERROR_NOT_CURRENTLY_AVAILABLE(0x887A0022). and OpenInputDesktop return error(1)
if I use PsExec64.exe to run the process(PsExec64.exe -s -d -i dxgiSample.exe),it's ok. so what's problem?
instsrv+srvany
Run your application as a service.
Services run in session 0.
If you call IDXGIAdapter::EnumOutputs()
in a Session 0
process, it returns DXGI_ERROR_NOT_CURRENTLY_AVAILABLE
.
User contributions licensed under CC BY-SA 3.0