Visual studio 6 build fix.
Rein Klazes
wijn at wanadoo.nl
Sun Dec 12 03:37:44 CST 2004
On 10 Dec 2004 15:14:30 +0100, you wrote:
> Rein Klazes <wijn at wanadoo.nl> writes:
>
> > @@ -210,7 +212,12 @@ static int set_process_console( struct p
> > if (process->create_flags & CREATE_NEW_CONSOLE)
> > {
> > /* let the process init do the allocation */
> > - return 1;
> > + /* unless the startup info specifies to use */
> > + /* the io handles in the startup info */
> > + if( !info || !info->data ||
> > + !((((RTL_USER_PROCESS_PARAMETERS *)info->data)->dwFlags) &
> > + STARTF_USESTDHANDLES))
> > + return 1;
>
> The server must not know about the process parameters structure, the
> STARTF_USESTDHANDLES flag has to be handled on the client side.
Is this one acceptable?
If there is still a problem, then I need more hints to what is needed.
Rein.
-------------- next part --------------
--- wine/server/process.c 2004-06-15 07:41:59.000000000 +0200
+++ mywine/server/process.c 2004-12-12 09:38:10.000000000 +0100
@@ -45,6 +45,8 @@
#include "request.h"
#include "console.h"
#include "user.h"
+#include "winreg.h"
+#include "winternl.h"
/* process structure */
@@ -207,12 +209,7 @@ static void set_process_startup_state( s
static int set_process_console( struct process *process, struct thread *parent_thread,
struct startup_info *info, struct init_process_reply *reply )
{
- if (process->create_flags & CREATE_NEW_CONSOLE)
- {
- /* let the process init do the allocation */
- return 1;
- }
- else if (info && !(process->create_flags & DETACHED_PROCESS))
+ if (info && !(process->create_flags & (DETACHED_PROCESS | CREATE_NEW_CONSOLE)))
{
/* FIXME: some better error checking should be done...
* like if hConOut and hConIn are console handles, then they should be on the same
@@ -222,7 +219,7 @@ static int set_process_console( struct p
}
if (info)
{
- if (!info->inherit_all)
+ if (!info->inherit_all && !(process->create_flags & CREATE_NEW_CONSOLE))
{
reply->hstdin = duplicate_handle( parent_thread->process, info->hstdin, process,
0, TRUE, DUPLICATE_SAME_ACCESS );
--- wine/dlls/kernel/console.c 2004-09-15 09:51:46.000000000 +0200
+++ mywine/dlls/kernel/console.c 2004-12-10 16:57:06.000000000 +0100
@@ -1142,22 +1142,29 @@ BOOL WINAPI AllocConsole(void)
if (!start_console_renderer(&siConsole))
goto the_end;
- /* all std I/O handles are inheritable by default */
- sa.nLength = sizeof(sa);
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = TRUE;
-
- handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE,
- 0, &sa, OPEN_EXISTING, 0, 0 );
- if (handle_in == INVALID_HANDLE_VALUE) goto the_end;
-
- handle_out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE,
- 0, &sa, OPEN_EXISTING, 0, 0 );
- if (handle_out == INVALID_HANDLE_VALUE) goto the_end;
-
- if (!DuplicateHandle(GetCurrentProcess(), handle_out, GetCurrentProcess(), &handle_err,
- 0, TRUE, DUPLICATE_SAME_ACCESS))
- goto the_end;
+ if( !(siCurrent.dwFlags & STARTF_USESTDHANDLES) ) {
+ /* all std I/O handles are inheritable by default */
+ sa.nLength = sizeof(sa);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE,
+ 0, &sa, OPEN_EXISTING, 0, 0 );
+ if (handle_in == INVALID_HANDLE_VALUE) goto the_end;
+
+ handle_out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE,
+ 0, &sa, OPEN_EXISTING, 0, 0 );
+ if (handle_out == INVALID_HANDLE_VALUE) goto the_end;
+
+ if (!DuplicateHandle(GetCurrentProcess(), handle_out, GetCurrentProcess(),
+ &handle_err, 0, TRUE, DUPLICATE_SAME_ACCESS))
+ goto the_end;
+ } else {
+ handle_in = siCurrent.hStdInput;
+ handle_out = siCurrent.hStdOutput;
+ handle_err = siCurrent.hStdError;
+ FIXME("handles %p %p %p\n", handle_in, handle_out, handle_err);
+ }
/* NT resets the STD_*_HANDLEs on console alloc */
SetStdHandle(STD_INPUT_HANDLE, handle_in);
More information about the wine-patches
mailing list