Skip to content

Commit

Permalink
deploy: 1fd480a
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 9, 2024
1 parent 17490f4 commit 4d97868
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 26 deletions.
20 changes: 20 additions & 0 deletions catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,26 @@
"version": "1.0.1"
}
},
"shadowplay-do-not-disable": {
"details": {
"defaultSorting": 0,
"published": 1733774874000,
"rating": 0,
"ratingUsers": 0,
"updated": 1733774874000,
"users": 0
},
"metadata": {
"author": "Temm",
"description": "Prevent Nvidia ShadowPlay from disabling itself",
"github": "https://github.com/leumasme",
"include": [
"nvcontainer.exe"
],
"name": "Shadowplay anti-disable",
"version": "1.0"
}
},
"shrink-address-bar-height": {
"details": {
"defaultSorting": 7590,
Expand Down
3 changes: 3 additions & 0 deletions changelogs/shadowplay-do-not-disable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0 ([Dec 9, 2024](https://github.com/ramensoftware/windhawk-mods/blob/1fd480af6b69fe3339d52712268afa8a87839f7a/mods/shadowplay-do-not-disable.wh.cpp))

Initial release.
61 changes: 61 additions & 0 deletions mods/shadowplay-do-not-disable.wh.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ==WindhawkMod==
// @id shadowplay-do-not-disable
// @name Shadowplay anti-disable
// @description Prevent Nvidia ShadowPlay from disabling itself
// @version 1.0
// @author Temm
// @github https://github.com/leumasme
// @include nvcontainer.exe
// ==/WindhawkMod==

// ==WindhawkModReadme==
/*
# Shadowplay anti-disable
Nvidia ShadowPlay will normally turn off automatically/pause when detecting DRM content playing or when a Window requests to be hidden from screen captures.
This sucks, because ShadowPlay may just randomly turn off because a random window requests to be hidden from screen captures.
No more! This mod disables both of these checks.
Works with both the old "GeForce Experience" as well as the new "NVIDIA App"
![Screenshot](https://i.imgur.com/zdP0nhd.png)
*/
// ==/WindhawkModReadme==

#include <tlhelp32.h>
#include <windhawk_api.h>

BOOL WINAPI GetWindowDisplayAffinity_Hook(IN HWND hWnd, OUT DWORD *pwdAffinity) {
// Drivers try to not record windows that have their Window Display Affinity set to anything other than NONE,
// since those windows request to not be included on screen captures.
// These windows are also hidden (transparent/absent) on normal screenshots and screensharing software, but the way the Nvidia
// driver records, it would also capture these hidden windows - so it just refuses to record instead.
// Block this by just returning NONE affinity.
*pwdAffinity = WDA_NONE;
return TRUE;
}

BOOL WINAPI Module32FirstW(IN HANDLE hSnapshot, IN OUT LPMODULEENTRY32W lpme) {
// Drivers try to detect DRM dll being loaded into browsers by creating a toolhelp module snapshot
// and then iterating over the modules, starting with this function.
// Block this by just not writing the module entry and returning false to indicate no further modules.
return FALSE;
}


BOOL Wh_ModInit() {
Wh_Log(L"Init");

HMODULE hUser32 = GetModuleHandle(L"user32.dll");
void* hookingGetWindowDisplayAffinity = (void*)GetProcAddress(hUser32, "GetWindowDisplayAffinity");
Wh_SetFunctionHook(hookingGetWindowDisplayAffinity, (void*)GetWindowDisplayAffinity_Hook, NULL);

HMODULE hKernel32 = GetModuleHandle(L"kernel32.dll");
void* hookingModule32FirstW = (void*)GetProcAddress(hKernel32, "Module32FirstW");
Wh_SetFunctionHook(hookingModule32FirstW, (void*)Module32FirstW, NULL);

return TRUE;
}

void Wh_ModUninit() {
Wh_Log(L"Uninit");
}
43 changes: 17 additions & 26 deletions updates.atom
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://windhawk.net/</id>
<title>Windhawk Mod Updates</title>
<updated>2024-12-09T15:33:53.000Z</updated>
<updated>2024-12-09T20:07:54.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<link rel="alternate" href="https://windhawk.net/"/>
<subtitle>Updates in the official collection of Windhawk mods</subtitle>
<icon>https://windhawk.net/favicon.ico</icon>
<rights>Ramen Software</rights>
<entry>
<title type="html"><![CDATA[Shadowplay anti-disable 1.0]]></title>
<id>https://windhawk.net/mods/shadowplay-do-not-disable#1fd480af6b69fe3339d52712268afa8a87839f7a</id>
<link href="https://windhawk.net/mods/shadowplay-do-not-disable"/>
<updated>2024-12-09T20:07:54.000Z</updated>
<content type="html"><![CDATA[<h1 id="shadowplayantidisable">Shadowplay anti-disable</h1>
<p>Nvidia ShadowPlay will normally turn off automatically/pause when detecting DRM content playing or when a Window requests to be hidden from screen captures.
This sucks, because ShadowPlay may just randomly turn off because a random window requests to be hidden from screen captures.
No more! This mod disables both of these checks.</p>
<p>Works with both the old "GeForce Experience" as well as the new "NVIDIA App"</p>
<p><img src="https://i.imgur.com/zdP0nhd.png" alt="Screenshot" /></p>]]></content>
<author>
<name>Temm</name>
<uri>https://github.com/leumasme</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Disable Virtual Desktop Transition Animation 1.0]]></title>
<id>https://windhawk.net/mods/disable-virtual-desktop-transition#000110fb95288d15f121807167c826024d9e764e</id>
Expand Down Expand Up @@ -292,29 +308,4 @@ center, etc. to another monitor.</p>
<uri>https://github.com/aubymori</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Per-app Language Preferences 1.0]]></title>
<id>https://windhawk.net/mods/per-app-language-preferences#82900d19c69cbf2ca0a8b7ca6dde2d52084c4bc7</id>
<link href="https://windhawk.net/mods/per-app-language-preferences"/>
<updated>2024-11-13T15:35:40.000Z</updated>
<content type="html"><![CDATA[<h1 id="perapplanguagepreferences">Per-app Language Preferences</h1>
<p>In Windows 11, it is no longer possible to set display languages for specific apps.</p>
<p>This mod allow you to override the preferred language for specific apps using the mod's settings.</p>
<p>Instructions on the settings:</p>
<ul>
<li>The filename pattern is parsed using <a href="https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathmatchspecexw">PathMatchSpecExW</a>. It supports wildcard <code>*</code> <code>?</code>. It also supports multiple semicolon-separated patterns.</li>
<li>The language ID can be found in the <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f">MS-LCID</a> specification. For example, the language ID for English (United States) is 1033.</li>
</ul>
<p>Use cases:</p>
<ul>
<li>You want to use a certain app in another language without affecting your current language, but that app does not provide individual language settings.</li>
<li>A certain app is not compatible with the encoding on your machine and displays corrupt characters, and you want to force it into using English.</li>
</ul>
<p>Note that it changes the language only and does not affect the encoding used in legacy programs. To actually fix corrupt characters issues with legacy programs or games, try using <a href="https://github.com/InWILL/Locale_Remulator">LocaleRemulator</a>.</p>
<p><img src="https://raw.githubusercontent.com/yezhiyi9670/akioi-cdn/refs/heads/master/demo-img/wacom-panel-forced-engligh.png" alt="Wacom panel with corrupt characters, &quot;fixed&quot; by forcing English" /></p>]]></content>
<author>
<name>yezhiyi9670</name>
<uri>https://github.com/yezhiyi9670</uri>
</author>
</entry>
</feed>

0 comments on commit 4d97868

Please sign in to comment.