win: add comment to help diagnose disallowed windows.h include
Add a comment to windows_h_disallowed.h to give a quick way to find the include path for a disallowed include of Windows.h. Also add an include of windows_h_disallowed.h to content/browser/devtools/protocol/webauthn_handler.cc to give a more useful message than obscure errors about GetUserNameW if Windows.h is included. Bug: 40555612 Change-Id: I4dd948dc9ece10e695fce405ace87c0425724935 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5988431 Reviewed-by: Jesse McKenna <jessemckenna@google.com> Commit-Queue: David Bienvenu <davidbienvenu@chromium.org> Reviewed-by: Danil Somsikov <dsv@chromium.org> Cr-Commit-Position: refs/heads/main@{#1379722}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
9a4c9a9338
commit
15a964db3b
@ -13,6 +13,22 @@
|
||||
// #include "base/win/windows_h_disallowed.h"
|
||||
// #endif // defined(_WINDOWS_)
|
||||
//
|
||||
// If it is not obvious why Windows.h is getting included, a quick way to
|
||||
// determine the #include path is to edit your local Windows.h (e.g.,
|
||||
// third_party\depot_tools\win_toolchain\vs_files\698eb5635a\Windows Kits\10\
|
||||
// Include\10.0.26100.0\um\Windows.h) to add
|
||||
//
|
||||
// #error Windows.h included
|
||||
//
|
||||
// at the top and recompile the file(s) that are unexpectedly including
|
||||
// Windows.h, e.g.,
|
||||
//
|
||||
// autoninja -C out/Default
|
||||
// obj\chrome\browser\devtools\devtools\devtools_window.obj
|
||||
//
|
||||
// That will generate a compile error with the #include path.
|
||||
// Then, undo the change to Windows.h.
|
||||
//
|
||||
// See https://crbug.com/796644 for more historical context.
|
||||
|
||||
#ifndef BASE_WIN_WINDOWS_H_DISALLOWED_H_
|
||||
|
@ -29,6 +29,11 @@
|
||||
#include "device/fido/virtual_fido_device.h"
|
||||
#include "device/fido/virtual_u2f_device.h"
|
||||
|
||||
// This should be after all other #includes.
|
||||
#if defined(_WINDOWS_) // Detect whether windows.h was included.
|
||||
#include "base/win/windows_h_disallowed.h"
|
||||
#endif // defined(_WINDOWS_)
|
||||
|
||||
namespace content::protocol {
|
||||
|
||||
namespace {
|
||||
|
Reference in New Issue
Block a user