Fix WDK 28000 build and guard reencode settings

This commit is contained in:
Mike Rodriguez committed 2026-12-02 19:57:25 -08:00
1 parent 0a81e9fb56
commit ff7bfdb7a6
4 files changed
+24 -2

No files matched your search

+2
View File
@@ -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
@@ -142,6 +142,23 @@ namespace
return (g_IddCx111Features.load() & static_cast<UINT>(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");
}
@@ -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;
}
@@ -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 <unsigned integer>` 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 <unsigned integer>` 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)