]> granicus.if.org Git - php/commitdiff
- fix nts build
authorPierre Joye <pajoye@php.net>
Thu, 16 Jun 2011 10:20:25 +0000 (10:20 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 16 Jun 2011 10:20:25 +0000 (10:20 +0000)
win32/winutil.c

index b94fcc482ddb2148e259867ba4e96b0a2e22a27d..dae01584a94e2fa42672b05d0273709a7a5e9e42 100644 (file)
@@ -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;