1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 // make sure we only ever spawn one thread
11 DWORD WINAPI
CrashingThread(LPVOID lpParameter
) {
12 // not a very friendly DLL
13 volatile int* x
= (int*)0x0;
18 BOOL WINAPI
DllMain(HANDLE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
) {
20 // we have to crash on another thread because LoadLibrary() will
21 // catch memory access errors and return failure to the calling process
22 CreateThread(nullptr, // default security attributes
23 0, // use default stack size
24 CrashingThread
, // thread function name
25 nullptr, // argument to thread function
26 0, // use default creation flags
27 &tid
); // returns the thread identifier