--- embedaddon/php/win32/winutil.c 2012/02/21 23:48:06 1.1.1.1 +++ embedaddon/php/win32/winutil.c 2012/05/29 12:34:34 1.1.1.2 @@ -17,12 +17,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: winutil.c,v 1.1.1.1 2012/02/21 23:48:06 misho Exp $ */ +/* $Id: winutil.c,v 1.1.1.2 2012/05/29 12:34:34 misho Exp $ */ #include "php.h" #include -PHPAPI char *php_win_err(int error) +PHPAPI char *php_win32_error_to_msg(int error) { char *buf = NULL; @@ -62,8 +62,10 @@ void php_win32_init_rng_lock() void php_win32_free_rng_lock() { tsrm_mutex_lock(php_lock_win32_cryptoctx); - CryptReleaseContext(hCryptProv, 0); - has_crypto_ctx = 0; + if (has_crypto_ctx == 1) { + CryptReleaseContext(hCryptProv, 0); + has_crypto_ctx = 0; + } tsrm_mutex_unlock(php_lock_win32_cryptoctx); tsrm_mutex_free(php_lock_win32_cryptoctx);