|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
*
|
|
Packit Service |
084de1 |
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
* this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
* in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
* https://www.openssl.org/source/license.html
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#include "e_os.h"
|
|
Packit Service |
084de1 |
#include "crypto/cryptlib.h"
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#if defined(_WIN32) || defined(__CYGWIN__)
|
|
Packit Service |
084de1 |
# ifdef __CYGWIN__
|
|
Packit Service |
084de1 |
/* pick DLL_[PROCESS|THREAD]_[ATTACH|DETACH] definitions */
|
|
Packit Service |
084de1 |
# include <windows.h>
|
|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* this has side-effect of _WIN32 getting defined, which otherwise is
|
|
Packit Service |
084de1 |
* mutually exclusive with __CYGWIN__...
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
# endif
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* All we really need to do is remove the 'error' state when a thread
|
|
Packit Service |
084de1 |
* detaches
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
|
Packit Service |
084de1 |
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
switch (fdwReason) {
|
|
Packit Service |
084de1 |
case DLL_PROCESS_ATTACH:
|
|
Packit Service |
084de1 |
OPENSSL_cpuid_setup();
|
|
Packit Service |
084de1 |
break;
|
|
Packit Service |
084de1 |
case DLL_THREAD_ATTACH:
|
|
Packit Service |
084de1 |
break;
|
|
Packit Service |
084de1 |
case DLL_THREAD_DETACH:
|
|
Packit Service |
084de1 |
OPENSSL_thread_stop();
|
|
Packit Service |
084de1 |
break;
|
|
Packit Service |
084de1 |
case DLL_PROCESS_DETACH:
|
|
Packit Service |
084de1 |
break;
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
return TRUE;
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
#endif
|
|
Packit Service |
084de1 |
|