Skip to content

Commit

Permalink
feat: add a switch for forcibly enabling win32k
Browse files Browse the repository at this point in the history
  • Loading branch information
Bush2021 committed Sep 6, 2024
1 parent 0d7967c commit 7008f30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Binary file modified src/chrome++.ini
Binary file not shown.
6 changes: 6 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ bool IsShowPassword() {
kIniPath.c_str()) != 0;
}

// 强制启用 win32k
bool IsWin32K() {
return ::GetPrivateProfileIntW(L"general", L"win32k", 0, kIniPath.c_str()) !=
0;
}

// 保留最后一个标签
bool IsKeepLastTab() {
return ::GetPrivateProfileIntW(L"Tabs", L"keep_last_tab", 1,
Expand Down
6 changes: 4 additions & 2 deletions src/green.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ BOOL WINAPI MyUpdateProcThreadAttribute(
PDWORD64 policy_value_1 = &((PDWORD64)lpValue)[0];
*policy_value_1 &= ~static_cast<DWORD64>(
ProcessCreationMitigationPolicy::BlockNonMicrosoftBinariesAlwaysOn);
// *policy_value_1 &=
// ~PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON;
if (IsWin32K()) {
*policy_value_1 &= static_cast<DWORD64>(
ProcessCreationMitigationPolicy::Win32kSystemCallDisableAlwaysOn);
}
}
return RawUpdateProcThreadAttribute(lpAttributeList, dwFlags, Attribute,
lpValue, cbSize, lpPreviousValue,
Expand Down

0 comments on commit 7008f30

Please sign in to comment.