*** openssl-1.1.1c.org/crypto/threads_win.c	2019-05-28 22:12:20.000000000 +0900
--- openssl/crypto/threads_win.c	2019-08-15 20:07:00.636008200 +0900
***************
*** 13,18 ****
--- 13,53 ----
  
  #include <openssl/crypto.h>
  
+ #define InitializeCriticalSectionAndSpinCount(a, b) myInitializeCriticalSectionAndSpinCount(a)
+ int myInitializeCriticalSectionAndSpinCount(void *arg)
+ {
+ 	InitializeCriticalSection(arg);
+  	return 1;
+ }
+ 
+ #if 0
+ #define InterlockedCompareExchange(a, b, c) myInterlockedCompareExchange(a, b, c)
+ LONG myInterlockedCompareExchange( 
+      LPLONG volatile Destination,
+      LONG Exchange,
+      LONG Comperand
+ )
+ {
+  	LONG ret = *Destination;
+ 	OutputDebugPrintf("%s: %x\n", __FUNCTION__, ret);
+  	
+  	if (*Destination == Comperand)
+  		ret = InterlockedExchange(Destination, Exchange);
+  	return (ret);
+ }
+  
+ #define InterlockedExchangeAdd(a, b) myInterlockedExchangeAdd(a, b)
+ LONG myInterlockedExchangeAdd(
+    LONG volatile *Addend,
+    LONG          Value
+  )
+ {
+ 	OutputDebugPrintf("%s: %x\n", __FUNCTION__, Value);
+  	while (Value-- > 0) 
+  		InterlockedIncrement(Addend);
+ }
+ #endif
+ 
  #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_WINDOWS)
  
  CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
