Skip to content

Commit 19ed2e3

Browse files
committed
Disable sandbox.
Fix HandleDelayLoadFailureCommon breakpoint by removing Common Controls manifest.
1 parent 2912cb4 commit 19ed2e3

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

cef/app.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#pragma comment(lib, "libcef.lib")
66
#pragma comment(lib, "libcef_dll_wrapper.lib")
7-
#pragma comment(lib, "cef_sandbox.lib")
87

98
#include "app.h"
109
#include <string>

defines.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
#pragma once
66

7+
// #define CEF_USE_SANDBOX 1
8+
// Currently sandbox disabled due to issue. Reported:
9+
// https://magpcss.org/ceforum/viewtopic.php?f=6&t=20037
10+
711
#define WINVER _WIN32_WINNT_WIN10
812
#define _WIN32_WINNT _WIN32_WINNT_WIN10
9-
#define _WIN32_IE _WIN32_IE_IE60SP2
10-
#define _RICHEDIT_VER 0x0200
1113

1214
#define _AMD64_ 1
1315

main.cpp

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
#include "defines.h"
66
#include <Windows.h>
77

8-
#pragma comment(linker, "/manifestdependency:\"type='win32' "\
9-
"name='Microsoft.Windows.Common-Controls' version='6.0.0.0' "\
10-
"processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' "\
11-
"language='*'\"")
8+
#if defined(CEF_USE_SANDBOX)
9+
#pragma comment(lib, "cef_sandbox.lib")
10+
#endif
1211

1312
#include <crtdbg.h> // _ASSERT() macro
1413
#include "resource.h"
1514

15+
#include "include/cef_sandbox_win.h"
16+
1617
#include "main_window.h"
1718
#include "logging.h"
1819
#include "executable.h"
@@ -271,10 +272,17 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
271272
LOGGER_WARNING << "CommandLineToArgvW() failed";
272273
}
273274

275+
// Sandbox support
276+
void* sandbox_info = nullptr;
277+
#ifdef CEF_USE_SANDBOX
278+
CefScopedSandboxInfo scoped_sandbox;
279+
sandbox_info = scoped_sandbox.sandbox_info();
280+
#endif
281+
274282
// CEF subprocesses.
275283
CefMainArgs main_args(hInstance);
276284
CefRefPtr<App> app(new App);
277-
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
285+
int exit_code = CefExecuteProcess(main_args, app.get(), sandbox_info);
278286
if (exit_code >= 0) {
279287
ShutdownLogging();
280288
return exit_code;
@@ -377,10 +385,15 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
377385
cef_settings.remote_debugging_port = remote_debugging_port;
378386
}
379387

380-
// Sandbox support
381-
// cef_settings.no_sandbox = true;
388+
#if defined(CEF_USE_SANDBOX)
389+
LOGGER_INFO << "Sandbox is enabled";
390+
cef_settings.no_sandbox = false;
391+
#else
392+
LOGGER_INFO << "Sandbox is disabled";
393+
cef_settings.no_sandbox = true;
394+
#endif
382395

383-
CefInitialize(main_args, cef_settings, app.get(), NULL);
396+
CefInitialize(main_args, cef_settings, app.get(), sandbox_info);
384397
CreateMainWindow(hInstance, nCmdShow, main_window_title);
385398
CefRunMessageLoop();
386399
CefShutdown();

phpdesktop-chrome.vcxproj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<ClCompile>
116116
<Optimization>Disabled</Optimization>
117117
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
118-
<PreprocessorDefinitions>WIN32;WIN64;_WINDOWS;STRICT;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<PreprocessorDefinitions>_WIN32;_WIN64;_WINDOWS;STRICT;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
119119
<ExceptionHandling>Sync</ExceptionHandling>
120120
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
121121
<PrecompiledHeader>
@@ -333,17 +333,25 @@
333333
<ClInclude Include="window_utils.h" />
334334
</ItemGroup>
335335
<ItemGroup>
336+
<None Include=".gitattributes" />
336337
<None Include="AUTHORS.txt" />
337338
<None Include="cef\README.txt" />
338339
<None Include="icon.ico" />
339340
<None Include=".gitignore" />
340341
<None Include="icon.png" />
342+
<None Include="README.md" />
341343
<None Include="settings.json">
342344
<FileType>Document</FileType>
343345
</None>
346+
<None Include="www\blenc_encode.php" />
347+
<None Include="www\blenc_myscript.php" />
344348
<None Include="www\cookies.php" />
349+
<None Include="www\dialogs.php" />
345350
<None Include="www\download.php" />
346351
<None Include="www\env-variables.php" />
352+
<None Include="www\error-404.php" />
353+
<None Include="www\error-500.php" />
354+
<None Include="www\execute-command.php" />
347355
<None Include="www\forms.php" />
348356
<None Include="www\google.php" />
349357
<None Include="www\html5-video.php" />
@@ -352,16 +360,24 @@
352360
<None Include="license.txt" />
353361
<None Include="www\javascript-api.php" />
354362
<None Include="www\loading-error.php" />
363+
<None Include="www\mouse-cursor-loading.php" />
355364
<None Include="www\no-cache.php" />
365+
<None Include="www\ob-flush.php" />
366+
<None Include="www\open-folder-in-explorer.php" />
367+
<None Include="www\php-error.php" />
356368
<None Include="www\phpinfo.php" />
357369
<None Include="resource.aps" />
358370
<None Include="www\chrome-version.php" />
359371
<None Include="www\popup.php" />
372+
<None Include="www\pretty-urls.php" />
373+
<None Include="www\request-quota.php" />
360374
<None Include="www\session.php" />
361375
<None Include="www\speech-recognition.php" />
362376
<None Include="www\sqlite.php" />
377+
<None Include="www\style.css" />
363378
<None Include="www\temp-dir.php" />
364379
<None Include="www\upload.php" />
380+
<None Include="www\window-close.php" />
365381
<None Include="www\_pdo.php" />
366382
</ItemGroup>
367383
<ItemGroup>

resource.rc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
1414
// TEXTINCLUDE
1515
//
1616

17-
1 TEXTINCLUDE
17+
1 TEXTINCLUDE
1818
BEGIN
1919
"resource.h\0"
2020
END
2121

22-
2 TEXTINCLUDE
22+
2 TEXTINCLUDE
2323
BEGIN
2424
"\0"
2525
END
2626

27-
3 TEXTINCLUDE
27+
3 TEXTINCLUDE
2828
BEGIN
2929
"\0"
3030
END
@@ -41,14 +41,15 @@ END
4141
// remains consistent on all systems.
4242
IDR_MAINWINDOW ICON "icon.ico"
4343

44+
4445
/////////////////////////////////////////////////////////////////////////////
4546
//
4647
// Version
4748
//
4849

4950
VS_VERSION_INFO VERSIONINFO
50-
FILEVERSION 57,0,0,0
51-
PRODUCTVERSION 57,0,0,0
51+
FILEVERSION 130,0,0,0
52+
PRODUCTVERSION 130,0,0,0
5253
FILEFLAGSMASK 0x3fL
5354
#ifdef _DEBUG
5455
FILEFLAGS 0x1L
@@ -65,12 +66,12 @@ BEGIN
6566
BEGIN
6667
VALUE "CompanyName", "PHP Desktop"
6768
VALUE "FileDescription", "PHP Desktop Chrome"
68-
VALUE "FileVersion", "57.0.0.0"
69+
VALUE "FileVersion", "130.0.0.0"
6970
VALUE "InternalName", "phpdesktop"
7071
VALUE "LegalCopyright", "(c) Czarek Tomczak 2012"
7172
VALUE "OriginalFilename", "phpdesktop-chrome.exe"
7273
VALUE "ProductName", "PHP Desktop Chrome"
73-
VALUE "ProductVersion", "57.0.0.0"
74+
VALUE "ProductVersion", "130.0.0.0"
7475
END
7576
END
7677
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)