diff --git a/.github/workflows/ci-validation.yml b/.github/workflows/ci-validation.yml index 859fe09..b1c5079 100644 --- a/.github/workflows/ci-validation.yml +++ b/.github/workflows/ci-validation.yml @@ -57,6 +57,8 @@ jobs: - name: Setup MSBuild uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 + with: + msbuild-architecture: x64 - name: Install the Windows 28000 SDK and WDK shell: pwsh diff --git a/Virtual Display Driver (HDR)/MttVDD/Driver.cpp b/Virtual Display Driver (HDR)/MttVDD/Driver.cpp index 032860a..4d65f80 100644 --- a/Virtual Display Driver (HDR)/MttVDD/Driver.cpp +++ b/Virtual Display Driver (HDR)/MttVDD/Driver.cpp @@ -142,6 +142,23 @@ namespace return (g_IddCx111Features.load() & static_cast(feature)) != 0; } + bool IsPipeClientAdministrator(HANDLE pipe) + { + if (!ImpersonateNamedPipeClient(pipe)) { + return false; + } + + alignas(DWORD) BYTE administrators[SECURITY_MAX_SID_SIZE]; + DWORD sidSize = sizeof(administrators); + BOOL isMember = FALSE; + const bool checked = CreateWellKnownSid(WinBuiltinAdministratorsSid, nullptr, administrators, &sidSize) && + CheckTokenMembership(nullptr, administrators, &isMember); + if (!RevertToSelf()) { + RaiseFailFastException(nullptr, nullptr, 0); + } + return checked && isMember; + } + bool SetDesktopReencodeFrameCount(const std::wstring& value) { if (value.empty() || value.find_first_not_of(L"0123456789") != std::wstring::npos) { @@ -2342,6 +2359,9 @@ void HandleClient(HANDLE hPipe) { !IDD_IS_FUNCTION_AVAILABLE(IddCxSwapChainUpdateStaticDesktopReencodeFrameCount)) { SendToPipe("ERROR IDDCX_REENCODE_UNAVAILABLE"); } + else if (!IsPipeClientAdministrator(hPipe)) { + SendToPipe("ERROR REENCODECOUNT_ACCESS_DENIED"); + } else if (SetDesktopReencodeFrameCount(bufferwstr.substr(17))) { SendToPipe("QUEUED REENCODECOUNT"); } diff --git a/Virtual Display Driver (HDR)/MttVDD/VirtualMonitorI2c.h b/Virtual Display Driver (HDR)/MttVDD/VirtualMonitorI2c.h index 00796e3..1a8185e 100644 --- a/Virtual Display Driver (HDR)/MttVDD/VirtualMonitorI2c.h +++ b/Virtual Display Driver (HDR)/MttVDD/VirtualMonitorI2c.h @@ -117,7 +117,7 @@ private: return false; } std::memcpy(data, reply_.data(), replySize_); - std::fill(data + replySize_, data + size, 0); + std::fill(data + replySize_, data + size, uint8_t{0}); replySize_ = 0; return true; } diff --git a/Virtual Display Driver (HDR)/MttVDD/readme.md b/Virtual Display Driver (HDR)/MttVDD/readme.md index 53b65cf..33f7579 100644 --- a/Virtual Display Driver (HDR)/MttVDD/readme.md +++ b/Virtual Display Driver (HDR)/MttVDD/readme.md @@ -28,4 +28,4 @@ The first three options default to `false`. Restart the driver after changing th Virtual Driver Control 2.0 can remove these XML fields when it saves. To keep the settings across Control saves, use DWORD values in `HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver`. Set `D3D12SWAPCHAIN`, `CUSTOMDISPLAYID`, or `VIRTUALI2C` to `1` to enable them. To disable an override, remove the DWORD and leave the corresponding XML option disabled. Set `STATICDESKTOPREENCODEFRAMECOUNT` to a value from `0` to `2147483647` for the initial count. -In the Control console, `GETIDDCXFEATURES` returns the OS feature mask. `SETREENCODECOUNT ` queues an override for current and subsequent swap chains until the driver restarts. Driver logs report the result of applying the override. [Microsoft’s IddCx 1.11 documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/display/iddcx1-dot-11-updates) +In the Control console, `GETIDDCXFEATURES` returns the OS feature mask. Run Control as an administrator to queue a `SETREENCODECOUNT ` override for current and subsequent swap chains until the driver restarts. Driver logs report the result of applying the override. [Microsoft’s IddCx 1.11 documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/display/iddcx1-dot-11-updates)