]>
Commit | Line | Data |
---|---|---|
b1322259 | 1 | /* |
fecb3aae | 2 | * Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved. |
b1322259 | 3 | * |
0e9725bc | 4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
b1322259 RS |
5 | * this file except in compliance with the License. You can obtain a copy |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
8 | */ | |
9 | ||
d5f9166b | 10 | #include "internal/e_os.h" |
25f2138b | 11 | #include "crypto/cryptlib.h" |
84af71a9 RL |
12 | |
13 | #if defined(_WIN32) || defined(__CYGWIN__) | |
14 | # ifdef __CYGWIN__ | |
15 | /* pick DLL_[PROCESS|THREAD]_[ATTACH|DETACH] definitions */ | |
16 | # include <windows.h> | |
17 | /* | |
18 | * this has side-effect of _WIN32 getting defined, which otherwise is | |
19 | * mutually exclusive with __CYGWIN__... | |
20 | */ | |
21 | # endif | |
22 | ||
23 | /* | |
24 | * All we really need to do is remove the 'error' state when a thread | |
25 | * detaches | |
26 | */ | |
27 | ||
28 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); | |
29 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) | |
30 | { | |
31 | switch (fdwReason) { | |
32 | case DLL_PROCESS_ATTACH: | |
33 | OPENSSL_cpuid_setup(); | |
84af71a9 RL |
34 | break; |
35 | case DLL_THREAD_ATTACH: | |
36 | break; | |
37 | case DLL_THREAD_DETACH: | |
38 | OPENSSL_thread_stop(); | |
39 | break; | |
40 | case DLL_PROCESS_DETACH: | |
41 | break; | |
42 | } | |
26a7d938 | 43 | return TRUE; |
84af71a9 RL |
44 | } |
45 | #endif | |
46 |