Skip to content

Commit e3f4220

Browse files
Merge branch 'master' into server-browser
2 parents 0a65012 + 02bc654 commit e3f4220

File tree

3,852 files changed

+721147
-117128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,852 files changed

+721147
-117128
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
macOS:
5454
name: macOS
55-
runs-on: macOS-13
55+
runs-on: macOS-15
5656
steps:
5757
- uses: actions/checkout@v4
5858

@@ -64,7 +64,7 @@ jobs:
6464
run: brew link --overwrite mysql
6565

6666
- name: Run Build
67-
run: ./linux-build.sh --os=macosx
67+
run: ./linux-build.sh
6868

6969
linux:
7070
strategy:
@@ -78,4 +78,4 @@ jobs:
7878
- uses: actions/checkout@v4
7979

8080
- name: Run Build
81-
run: ./linux-build.sh --arch=${{ matrix.architecture }}
81+
run: /docker-entrypoint.sh --arch=${{ matrix.architecture }}

.github/workflows/codeql.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
schedule:
20+
- cron: '19 17 * * 3'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'windows-2025' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: c-cpp
47+
build-mode: none
48+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
# Add any setup steps before running the `github/codeql-action/init` action.
61+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
62+
# or others). This is typically only required for manual builds.
63+
# - name: Setup runtime (example)
64+
# uses: actions/setup-example@v1
65+
66+
# Initializes the CodeQL tools for scanning.
67+
- name: Initialize CodeQL
68+
uses: github/codeql-action/init@v3
69+
with:
70+
languages: ${{ matrix.language }}
71+
build-mode: ${{ matrix.build-mode }}
72+
# If you wish to specify custom queries, you can do so here or in a config file.
73+
# By default, queries listed here will override any specified in a config file.
74+
# Prefix the list here with "+" to use these queries and those in the config file.
75+
76+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77+
# queries: security-extended,security-and-quality
78+
79+
# If the analyze step fails for one of the languages you are analyzing with
80+
# "We were unable to automatically build your code", modify the matrix above
81+
# to set the build mode to "manual" for that language. Then modify this step
82+
# to build your code.
83+
# ℹ️ Command-line programs to run using the OS shell.
84+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
85+
- if: matrix.build-mode == 'manual'
86+
shell: bash
87+
run: |
88+
echo 'If you are using a "manual" build mode for one or more of the' \
89+
'languages you are analyzing, replace this with the commands to build' \
90+
'your code, for example:'
91+
echo ' make bootstrap'
92+
echo ' make release'
93+
exit 1
94+
95+
- name: Perform CodeQL Analysis
96+
uses: github/codeql-action/analyze@v3
97+
with:
98+
category: "/language:${{matrix.language}}"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:v3="urn:schemas-microsoft-com:asm.v3">
3+
<assemblyIdentity type="win32" version="1.0.0.0" processorArchitecture="*" name="CEFLauncher" />
4+
5+
<v3:application>
6+
<windowsSettings>
7+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
8+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
9+
</windowsSettings>
10+
</v3:application>
11+
12+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
13+
<application>
14+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> <!-- Windows 10 and Windows 11 -->
15+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> <!-- Windows 8.1 -->
16+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> <!-- Windows 8 -->
17+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> <!-- Windows 7 -->
18+
</application>
19+
</compatibility>
20+
21+
<dependency optional="yes">
22+
<dependentAssembly>
23+
<!-- Automatically use ComCtl32.dll version 6 or later. -->
24+
<assemblyIdentity
25+
type="win32"
26+
name="Microsoft.Windows.Common-Controls"
27+
version="6.0.0.0"
28+
processorArchitecture="*"
29+
publicKeyToken="6595b64144ccf1df"
30+
language="*" />
31+
</dependentAssembly>
32+
</dependency>
33+
</assembly>

Client/ceflauncher/premake5.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ project "CEFLauncher"
99
vpaths {
1010
["Headers/*"] = "**.h",
1111
["Sources/*"] = "**.cpp",
12+
["Resources/*"] = {"*.rc", "**.ico", "**.xml", "**.manifest"},
1213
["*"] = "premake5.lua"
1314
}
1415

1516
files {
1617
"premake5.lua",
1718
"*.h",
18-
"*.cpp"
19+
"*.cpp",
20+
"*.manifest",
1921
}
2022

2123
filter "architecture:not x86"

Client/ceflauncher_DLL/Main.cpp

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
*
1010
*****************************************************************************/
1111

12+
#define WIN32_NO_STATUS
1213
#define WIN32_LEAN_AND_MEAN
1314
#include <Windows.h>
15+
#undef WIN32_NO_STATUS
16+
#include <ntstatus.h>
17+
#include <winnt.h>
18+
#include <winternl.h>
1419
#include <delayimp.h>
1520
#include "CCefApp.h"
1621
#include <string>
@@ -21,6 +26,8 @@
2126
#pragma comment(lib, "cef_sandbox.lib")
2227
#endif
2328

29+
DWORD WINAPI CheckParentProcessAliveness(LPVOID);
30+
2431
int _declspec(dllexport) InitCEF()
2532
{
2633
// Get absolute CEFLauncher.exe path
@@ -46,20 +53,62 @@ int _declspec(dllexport) InitCEF()
4653
sandboxInfo = scopedSandbox.sandbox_info();
4754
#endif
4855

49-
if (HANDLE job = CreateJobObjectW(nullptr, nullptr); job != nullptr)
56+
const HANDLE parentCheckThread = CreateThread(nullptr, 0, CheckParentProcessAliveness, nullptr, 0, nullptr);
57+
58+
const int exitCode = CefExecuteProcess(mainArgs, app, sandboxInfo);
59+
60+
if (parentCheckThread != nullptr)
5061
{
51-
JOBOBJECT_EXTENDED_LIMIT_INFORMATION limits{};
52-
limits.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
62+
TerminateThread(parentCheckThread, 0);
63+
CloseHandle(parentCheckThread);
64+
}
5365

54-
if (SetInformationJobObject(job, JobObjectExtendedLimitInformation, &limits, sizeof(limits)))
55-
{
56-
AssignProcessToJobObject(job, GetCurrentProcess());
57-
}
58-
else
66+
return exitCode;
67+
}
68+
69+
static DWORD WINAPI CheckParentProcessAliveness(LPVOID)
70+
{
71+
NTSTATUS(NTAPI * queryInformation)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG) = nullptr;
72+
73+
if (HMODULE const ntdll = GetModuleHandleW(L"ntdll.dll"); ntdll != nullptr)
74+
{
75+
queryInformation = reinterpret_cast<decltype(queryInformation)>(GetProcAddress(ntdll, "NtQueryInformationProcess"));
76+
}
77+
78+
if (queryInformation == nullptr)
79+
return 1;
80+
81+
PROCESS_BASIC_INFORMATION info{};
82+
83+
ULONG returnLength = 0;
84+
NTSTATUS status = queryInformation(GetCurrentProcess(), ProcessBasicInformation, &info, sizeof(info), &returnLength);
85+
86+
if (!NT_SUCCESS(status) || returnLength < sizeof(PROCESS_BASIC_INFORMATION))
87+
return 2;
88+
89+
const auto parentProcessId = static_cast<DWORD>(reinterpret_cast<ULONG_PTR>(info.Reserved3));
90+
const HANDLE parentProcess = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION, FALSE, parentProcessId);
91+
92+
if (parentProcess == nullptr)
93+
{
94+
if (GetLastError() == ERROR_INVALID_PARAMETER)
95+
ExitProcess(0);
96+
97+
return 3;
98+
}
99+
100+
while (true)
101+
{
102+
DWORD exitCode{};
103+
104+
if (!GetExitCodeProcess(parentProcess, &exitCode) || exitCode != STILL_ACTIVE)
59105
{
60-
CloseHandle(job);
106+
CloseHandle(parentProcess);
107+
ExitProcess(exitCode);
61108
}
109+
110+
Sleep(1000);
62111
}
63112

64-
return CefExecuteProcess(mainArgs, app, sandboxInfo);
113+
return 0;
65114
}

Client/cefweb/CWebApp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRe
2626
if (!pWebCore->GetGPUEnabled())
2727
command_line->AppendSwitch("disable-gpu");
2828

29+
// Disable the AutoDeElevate feature to make launching CEF with Admin privileges work.
30+
// https://github.com/chromiumembedded/cef/issues/3960
31+
// https://chromium-review.googlesource.com/c/chromium/src/+/6515318
32+
command_line->AppendSwitch("do-not-de-elevate");
33+
2934
command_line->AppendSwitch("disable-gpu-compositing"); // always disable this, causes issues with official builds
3035

3136
// command_line->AppendSwitch("disable-d3d11");

Client/cefweb/CWebCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void CWebCore::ProcessInputMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
502502
if ((keyEvent.type == KEYEVENT_CHAR) && isKeyDown(VK_RMENU))
503503
{
504504
HKL current_layout = ::GetKeyboardLayout(0);
505-
SHORT scan_res = ::VkKeyScanExW(wParam, current_layout);
505+
SHORT scan_res = ::VkKeyScanExW(static_cast<WCHAR>(wParam), current_layout);
506506
if ((HIBYTE(scan_res) & (2 | 4)) == (2 | 4))
507507
{
508508
keyEvent.modifiers &= ~(EVENTFLAG_CONTROL_DOWN | EVENTFLAG_ALT_DOWN);

Client/cefweb/CefWeb.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ extern "C" _declspec(dllexport) CWebCoreInterface* InitWebCoreInterface(CCoreInt
2222
// Ensure main thread identification is consistent
2323
IsMainThread();
2424

25+
SetMemoryAllocationFailureHandler();
26+
2527
CWebCore* pWebCore = new CWebCore;
2628
return pWebCore;
2729
}

Client/cefweb/premake5.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ project "Client Webbrowser"
66

77
filter "system:windows"
88
includedirs { "../../vendor/sparsehash/src/windows" }
9-
linkoptions { "/SAFESEH:NO" }
109
buildoptions { "-Zm130" }
1110

1211
filter {}

Client/core/CAdditionalVertexStreamManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,13 @@ SAdditionalStreamInfo* CAdditionalVertexStreamManager::CreateAdditionalStreamInf
466466
declNew->Usage = D3DDECLUSAGE_NORMAL;
467467
declNew->UsageIndex = 0;
468468
if (FAILED(m_pDevice->CreateVertexDeclaration(elements, &info.pVertexDeclaration)))
469-
return false;
469+
return nullptr;
470470

471471
// Create new stream
472472
info.Stride = sizeof(float) * 3;
473473
UINT Size2 = ConvertPTSize(state.decl.VertexBufferDesc1.Size);
474474
if (FAILED(m_pDevice->CreateVertexBuffer(Size2, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &info.pStreamData, NULL)))
475-
return false;
475+
return nullptr;
476476

477477
// Save info
478478
MapSet(m_AdditionalStreamInfoMap, state.stream1.pStreamData, info);

0 commit comments

Comments
 (0)