mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Check for GDI exhaustion if window creation fails
https://chromium-review.googlesource.com/c/chromium/src/+/2244124
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <windows.h>
|
||||
#include <wtsapi32.h>
|
||||
|
||||
#include "base/win/windows_types.h"
|
||||
#include "base/win/wrapped_window_proc.h"
|
||||
#include "ui/base/win/shell.h"
|
||||
#include "ui/gfx/win/hwnd_util.h"
|
||||
@@ -34,7 +35,7 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
|
||||
// session lock and unlock events.
|
||||
window_ = CreateWindow(MAKEINTATOM(atom_), 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0,
|
||||
instance_, 0);
|
||||
gfx::CheckWindowCreated(window_);
|
||||
gfx::CheckWindowCreated(window_, ::GetLastError());
|
||||
gfx::SetWindowUserData(window_, this);
|
||||
|
||||
// Tel windows we want to be notified with session events
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shell/browser/api/electron_api_system_preferences.h"
|
||||
|
||||
#include "base/win/core_winrt_util.h"
|
||||
#include "base/win/windows_types.h"
|
||||
#include "base/win/wrapped_window_proc.h"
|
||||
#include "shell/common/color_util.h"
|
||||
#include "ui/base/win/shell.h"
|
||||
@@ -209,7 +210,7 @@ void SystemPreferences::InitializeWindow() {
|
||||
// receive broadcast messages like "WM_DWMCOLORIZATIONCOLORCHANGED".
|
||||
window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
|
||||
instance_, 0);
|
||||
gfx::CheckWindowCreated(window_);
|
||||
gfx::CheckWindowCreated(window_, ::GetLastError());
|
||||
gfx::SetWindowUserData(window_, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/win/win_util.h"
|
||||
#include "base/win/windows_types.h"
|
||||
#include "base/win/wrapped_window_proc.h"
|
||||
#include "shell/browser/ui/win/notify_icon.h"
|
||||
#include "ui/events/event_constants.h"
|
||||
@@ -69,7 +70,7 @@ NotifyIconHost::NotifyIconHost() {
|
||||
// "TaskbarCreated".
|
||||
window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
|
||||
instance_, 0);
|
||||
gfx::CheckWindowCreated(window_);
|
||||
gfx::CheckWindowCreated(window_, ::GetLastError());
|
||||
gfx::SetWindowUserData(window_, this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user