diff options
author | Pierre Joye <pajoye@php.net> | 2011-06-16 10:20:25 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2011-06-16 10:20:25 +0000 |
commit | 0ff4d7d8111d35bfd25b15d66e7f2650d4587289 (patch) | |
tree | a1ef787de4dcaaabcfbc790a88b3e7771c3cdb87 | |
parent | 23c4c46b36c7c64c54ef68d4a55a3a8fe2bd06a6 (diff) | |
download | php-git-0ff4d7d8111d35bfd25b15d66e7f2650d4587289.tar.gz |
- fix nts build
-rw-r--r-- | win32/winutil.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/winutil.c b/win32/winutil.c index 3216ffc837..adc5d1b66b 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; |