Suppression for crbug/241044.
[chromium-blink-merge.git] / chrome / split_dll_fake_entry.cc
blob3ec8d729f8b478e02649caa389f0d734132ec4af
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include <windows.h>
7 extern "C" {
9 // This entry point and file is used to work around circular dependencies
10 // between the split DLLs. The CRT initialization will fail if done at attach
11 // time. Instead, we defer initialization until after both DLLs are loaded and
12 // then manually call the CRT initialization function (via DoDeferredCrtInit).
14 // ChromeEmptyEntry is the DLL's entry point.
16 BOOL WINAPI _DllMainCRTStartup(HINSTANCE, DWORD, LPVOID);
18 BOOL WINAPI ChromeEmptyEntry(HINSTANCE hinstance,
19 DWORD reason,
20 LPVOID reserved) {
21 if (reason != DLL_PROCESS_ATTACH)
22 _DllMainCRTStartup(hinstance, reason, reserved);
23 return 1;
26 __declspec(dllexport) void __stdcall DoDeferredCrtInit(HINSTANCE hinstance) {
27 _DllMainCRTStartup(hinstance, DLL_PROCESS_ATTACH, NULL);
30 // This function is needed for the linker to succeed. It seems to pick the
31 // CRT lib based on the existence of "DllMain", and since we're renaming that,
32 // it instead chooses the one that links against "main". This function should
33 // never be called.
34 int main() {
35 __debugbreak();