summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-06-16 10:20:25 (GMT)
committerPierre Joye <pajoye@php.net>2011-06-16 10:20:25 (GMT)
commitc43276abd6d78a419cd3b3b4f20efe9a133ed603 (patch)
treed8715059f34cf06cd0a876f45dce99a22e6c8d70 /win32
parent6940a320aff3832585666c1ff2bd8b5b38ad71a0 (diff)
downloadphp-c43276abd6d78a419cd3b3b4f20efe9a133ed603.tar.gz
- fix nts build
Diffstat (limited to 'win32')
-rw-r--r--win32/winutil.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/winutil.c b/win32/winutil.c
index b94fcc4..dae0158 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -82,7 +82,10 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{
BOOL ret;
size_t i = 0;
+#ifdef ZTS
tsrm_mutex_lock(php_lock_win32_cryptoctx);
+#endif
+
if (has_crypto_ctx == 0) {
if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) {
/* Could mean that the key container does not exist, let try
@@ -96,7 +99,10 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{
}
}
}
+
+#ifdef ZTS
tsrm_mutex_unlock(php_lock_win32_cryptoctx);
+#endif
if (has_crypto_ctx == 0) {
return FAILURE;