[host] converted program to a windows hidden/background user app.

NvFBC will not start when running as a service, likely intentional
security of the API to prevent it from being abused.
This commit is contained in:
Geoffrey McRae
2017-11-01 03:23:46 +11:00
parent e935a09441
commit 01b10b3ee1
5 changed files with 32 additions and 162 deletions

View File

@@ -55,13 +55,25 @@ namespace Capture
status.dwVersion = NVFBC_STATUS_VER;
status.dwAdapterIdx = 0;
if (m_fnGetStatusEx(&status) != NVFBC_SUCCESS)
NVFBCRESULT ret = m_fnGetStatusEx(&status);
if (ret != NVFBC_SUCCESS)
{
DEBUG_ERROR("Failed to get NvFBC status");
DeInitialize();
return false;
DEBUG_INFO("Attempting to enable NvFBC");
if (m_fnEnable(NVFBC_STATE_ENABLE) == NVFBC_SUCCESS)
{
DEBUG_INFO("Success, attempting to get status again");
ret = m_fnGetStatusEx(&status);
}
if (ret != NVFBC_SUCCESS)
{
DEBUG_ERROR("Failed to get NvFBC status");
DeInitialize();
return false;
}
}
if (!status.bIsCapturePossible)
{
DEBUG_ERROR("Capture is not possible, unsupported device or driver");