diff options
Diffstat (limited to 'src/lib/libcrypto/cryptlib.c')
-rw-r--r-- | src/lib/libcrypto/cryptlib.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 24fe123e14..b4449b86d6 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
@@ -731,6 +731,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, | |||
731 | case DLL_THREAD_ATTACH: | 731 | case DLL_THREAD_ATTACH: |
732 | break; | 732 | break; |
733 | case DLL_THREAD_DETACH: | 733 | case DLL_THREAD_DETACH: |
734 | ERR_remove_state(0); | ||
734 | break; | 735 | break; |
735 | case DLL_PROCESS_DETACH: | 736 | case DLL_PROCESS_DETACH: |
736 | break; | 737 | break; |
@@ -742,16 +743,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, | |||
742 | #if defined(_WIN32) && !defined(__CYGWIN__) | 743 | #if defined(_WIN32) && !defined(__CYGWIN__) |
743 | #include <tchar.h> | 744 | #include <tchar.h> |
744 | #include <signal.h> | 745 | #include <signal.h> |
745 | #ifdef __WATCOMC__ | ||
746 | #if defined(_UNICODE) || defined(__UNICODE__) | ||
747 | #define _vsntprintf _vsnwprintf | ||
748 | #else | ||
749 | #define _vsntprintf _vsnprintf | ||
750 | #endif | ||
751 | #endif | ||
752 | #ifdef _MSC_VER | ||
753 | #define alloca _alloca | ||
754 | #endif | ||
755 | 746 | ||
756 | #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 | 747 | #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 |
757 | int OPENSSL_isservice(void) | 748 | int OPENSSL_isservice(void) |
@@ -782,7 +773,11 @@ int OPENSSL_isservice(void) | |||
782 | 773 | ||
783 | if (len>512) return -1; /* paranoia */ | 774 | if (len>512) return -1; /* paranoia */ |
784 | len++,len&=~1; /* paranoia */ | 775 | len++,len&=~1; /* paranoia */ |
776 | #ifdef _MSC_VER | ||
777 | name=(WCHAR *)_alloca(len+sizeof(WCHAR)); | ||
778 | #else | ||
785 | name=(WCHAR *)alloca(len+sizeof(WCHAR)); | 779 | name=(WCHAR *)alloca(len+sizeof(WCHAR)); |
780 | #endif | ||
786 | if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len)) | 781 | if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len)) |
787 | return -1; | 782 | return -1; |
788 | 783 | ||
@@ -827,7 +822,11 @@ void OPENSSL_showfatal (const char *fmta,...) | |||
827 | size_t len_0=strlen(fmta)+1,i; | 822 | size_t len_0=strlen(fmta)+1,i; |
828 | WCHAR *fmtw; | 823 | WCHAR *fmtw; |
829 | 824 | ||
830 | fmtw = (WCHAR *)alloca(len_0*sizeof(WCHAR)); | 825 | #ifdef _MSC_VER |
826 | fmtw = (WCHAR *)_alloca (len_0*sizeof(WCHAR)); | ||
827 | #else | ||
828 | fmtw = (WCHAR *)alloca (len_0*sizeof(WCHAR)); | ||
829 | #endif | ||
831 | if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; } | 830 | if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; } |
832 | 831 | ||
833 | #ifndef OPENSSL_NO_MULTIBYTE | 832 | #ifndef OPENSSL_NO_MULTIBYTE |