@@ -3543,7 +3543,10 @@ ZEND_EXT_API void zend_jit_unprotect(void)
3543
3543
DWORD old ;
3544
3544
3545
3545
if (!VirtualProtect (dasm_buf , dasm_size , PAGE_READWRITE , & old )) {
3546
- fprintf (stderr , "VirtualProtect() failed\n" );
3546
+ DWORD err = GetLastError ();
3547
+ char * msg = php_win32_error_to_msg (err );
3548
+ fprintf (stderr , "VirtualProtect() failed [%u] %s\n" , err , msg );
3549
+ php_win32_error_msg_free (msg );
3547
3550
}
3548
3551
}
3549
3552
#endif
@@ -3562,7 +3565,10 @@ ZEND_EXT_API void zend_jit_protect(void)
3562
3565
DWORD old ;
3563
3566
3564
3567
if (!VirtualProtect (dasm_buf , dasm_size , PAGE_EXECUTE_READ , & old )) {
3565
- fprintf (stderr , "VirtualProtect() failed\n" );
3568
+ DWORD err = GetLastError ();
3569
+ char * msg = php_win32_error_to_msg (err );
3570
+ fprintf (stderr , "VirtualProtect() failed [%u] %s\n" , err , msg );
3571
+ php_win32_error_msg_free (msg );
3566
3572
}
3567
3573
}
3568
3574
#endif
@@ -3775,13 +3781,19 @@ ZEND_EXT_API int zend_jit_startup(void *buf, size_t size, zend_bool reattached)
3775
3781
DWORD old ;
3776
3782
3777
3783
if (!VirtualProtect (dasm_buf , dasm_size , PAGE_EXECUTE_READWRITE , & old )) {
3778
- fprintf (stderr , "VirtualProtect() failed\n" );
3784
+ DWORD err = GetLastError ();
3785
+ char * msg = php_win32_error_to_msg (err );
3786
+ fprintf (stderr , "VirtualProtect() failed [%u] %s\n" , err , msg );
3787
+ php_win32_error_msg_free (msg );
3779
3788
}
3780
3789
} else {
3781
3790
DWORD old ;
3782
3791
3783
3792
if (!VirtualProtect (dasm_buf , dasm_size , PAGE_EXECUTE_READ , & old )) {
3784
- fprintf (stderr , "VirtualProtect() failed\n" );
3793
+ DWORD err = GetLastError ();
3794
+ char * msg = php_win32_error_to_msg (err );
3795
+ fprintf (stderr , "VirtualProtect() failed [%u] %s\n" , err , msg );
3796
+ php_win32_error_msg_free (msg );
3785
3797
}
3786
3798
}
3787
3799
#endif
0 commit comments