char *arg_free=NULL, **arg_excp=&arg_free;
char *script_file=NULL, *translated_path = NULL;
#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
- DWORD pl[1];
- int interactive = (GetConsoleProcessList(pl, 1) == 1) && !IsDebuggerPresent();
+ int interactive = php_win32_console_is_own();
#else
int interactive=0;
#endif
}
return result;
}
+
+PHP_WINUTIL_API BOOL php_win32_console_is_own(void)
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) && !IsDebuggerPresent()) {
+ return !csbi.dwCursorPosition.X && !csbi.dwCursorPosition.Y;
+ }
+
+ return FALSE;
+}
+
*/
PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable);
+/* Check, whether the program has its own console. If a process was launched
+ through a GUI, it will have it's own console. For more info see
+ http://support.microsoft.com/kb/99115 */
+PHP_WINUTIL_API BOOL php_win32_console_is_own(void);
+
#endif