mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
win: Add bootstrap[c].exe for sandbox integration (see #3824)
Replace cef_sandbox.lib usage with bootstrap executables. See the SandboxSetup Wiki page for details.
This commit is contained in:
@@ -51,7 +51,7 @@ class MainMessageLoopExternalPumpWin : public MainMessageLoopExternalPump {
|
||||
};
|
||||
|
||||
MainMessageLoopExternalPumpWin::MainMessageLoopExternalPumpWin() {
|
||||
HINSTANCE hInstance = GetModuleHandle(nullptr);
|
||||
HINSTANCE hInstance = GetCodeModuleHandle();
|
||||
const wchar_t* const kClassName = L"CEFMainTargetHWND";
|
||||
|
||||
WNDCLASSEX wcex = {};
|
||||
|
@@ -8,13 +8,14 @@
|
||||
#include "include/cef_stream.h"
|
||||
#include "include/wrapper/cef_byte_read_handler.h"
|
||||
#include "include/wrapper/cef_stream_resource_handler.h"
|
||||
#include "tests/shared/browser/util_win.h"
|
||||
|
||||
namespace client {
|
||||
|
||||
namespace {
|
||||
|
||||
bool LoadBinaryResource(int binaryId, DWORD& dwSize, LPBYTE& pBytes) {
|
||||
HINSTANCE hInst = GetModuleHandle(nullptr);
|
||||
HINSTANCE hInst = GetCodeModuleHandle();
|
||||
HRSRC hRes =
|
||||
FindResource(hInst, MAKEINTRESOURCE(binaryId), MAKEINTRESOURCE(256));
|
||||
if (hRes) {
|
||||
|
@@ -44,7 +44,7 @@ WNDPROC SetWndProcPtr(HWND hWnd, WNDPROC wndProc) {
|
||||
std::wstring GetResourceString(UINT id) {
|
||||
#define MAX_LOADSTRING 100
|
||||
TCHAR buff[MAX_LOADSTRING] = {0};
|
||||
LoadString(::GetModuleHandle(nullptr), id, buff, MAX_LOADSTRING);
|
||||
LoadString(GetCodeModuleHandle(), id, buff, MAX_LOADSTRING);
|
||||
return buff;
|
||||
}
|
||||
|
||||
@@ -191,4 +191,13 @@ float GetDeviceScaleFactor() {
|
||||
return scale_factor;
|
||||
}
|
||||
|
||||
HINSTANCE GetCodeModuleHandle() {
|
||||
HMODULE hModule = nullptr;
|
||||
CHECK(::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
|
||||
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
reinterpret_cast<LPCWSTR>(GetCodeModuleHandle),
|
||||
&hModule));
|
||||
return hModule;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
@@ -40,6 +40,10 @@ bool IsKeyDown(WPARAM wparam);
|
||||
// return 2.0.
|
||||
float GetDeviceScaleFactor();
|
||||
|
||||
// Returns the module handle that contains this code. When built as a DLL this
|
||||
// will be the DLL handle instead of the EXE handle.
|
||||
HINSTANCE GetCodeModuleHandle();
|
||||
|
||||
} // namespace client
|
||||
|
||||
#endif // CEF_TESTS_SHARED_BROWSER_UTIL_WIN_H_
|
||||
|
Reference in New Issue
Block a user