Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1ac2b1e3
Commit
1ac2b1e3
authored
Nov 25, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 25, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now passing event with --use-event to let programs starting with
digits being run.
parent
3f089a19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
wineconsole.c
programs/wineconsole/wineconsole.c
+9
-2
console.c
win32/console.c
+7
-7
No files found.
programs/wineconsole/wineconsole.c
View file @
1ac2b1e3
...
...
@@ -443,11 +443,18 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPCSTR lpCmdLine)
return
done
;
}
static
BOOL
WINECON_HasEvent
(
LPCSTR
ptr
,
unsigned
*
evt
)
{
while
(
*
ptr
==
' '
||
*
ptr
==
'\t'
)
ptr
++
;
if
(
strncmp
(
ptr
,
"--use-event="
,
12
))
return
FALSE
;
return
sscanf
(
ptr
+
12
,
"%d"
,
evt
)
==
1
;
}
/******************************************************************
* WINECON_WinMain
*
* wineconsole can either be started as:
* wineconsole
<int>
used when a new console is created (AllocConsole)
* wineconsole
--use-event=<int>
used when a new console is created (AllocConsole)
* wineconsole <pgm> <arguments> used to start the program <pgm> from the command line in
* a freshly created console
*/
...
...
@@ -458,7 +465,7 @@ int PASCAL WINECON_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPCSTR lpCmdLine, U
unsigned
evt
;
/* case of wineconsole <evt>, signal process that created us that we're up and running */
if
(
sscanf
(
lpCmdLine
,
"%d"
,
&
evt
)
==
1
)
if
(
WINECON_HasEvent
(
lpCmdLine
,
&
evt
)
)
{
if
(
!
(
data
=
WINECON_Init
(
hInst
,
0
)))
return
0
;
ret
=
SetEvent
((
HANDLE
)
evt
);
...
...
win32/console.c
View file @
1ac2b1e3
...
...
@@ -85,14 +85,14 @@ static BOOL start_console_renderer(void)
/* first try environment variable */
if
((
p
=
getenv
(
"WINECONSOLE"
))
!=
NULL
)
{
if
(
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s %d"
,
p
,
hEvent
)
>
0
&&
if
(
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s
-- --use-event=
%d"
,
p
,
hEvent
)
>
0
&&
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
ERR
(
"Couldn't launch Wine console from WINECONSOLE env var... trying default access
\n
"
);
}
/* then the regular installation dir */
if
(
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s %d"
,
BINDIR
"/wineconsole"
,
hEvent
)
>
0
&&
if
(
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s
-- --use-event=
%d"
,
BINDIR
"/wineconsole"
,
hEvent
)
>
0
&&
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
...
...
@@ -104,10 +104,10 @@ static BOOL start_console_renderer(void)
if
((
p
=
strrchr
(
strcpy
(
path
,
full_argv0
),
'/'
)))
{
p
++
;
sprintf
(
p
,
"wineconsole %d"
,
hEvent
);
sprintf
(
p
,
"wineconsole
-- --use-event=
%d"
,
hEvent
);
if
(
CreateProcessA
(
NULL
,
path
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
sprintf
(
p
,
"programs/wineconsole/wineconsole %d"
,
hEvent
);
sprintf
(
p
,
"programs/wineconsole/wineconsole
-- --use-event=
%d"
,
hEvent
);
if
(
CreateProcessA
(
NULL
,
path
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
}
...
...
@@ -127,10 +127,10 @@ static BOOL start_console_renderer(void)
if
((
p
=
strrchr
(
path
,
'/'
)))
{
p
++
;
sprintf
(
p
,
"wineconsole %d"
,
hEvent
);
sprintf
(
p
,
"wineconsole
-- --use-event=
%d"
,
hEvent
);
if
(
CreateProcessA
(
NULL
,
path
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
sprintf
(
p
,
"programs/wineconsole/wineconsole %d"
,
hEvent
);
sprintf
(
p
,
"programs/wineconsole/wineconsole
-- --use-event=
%d"
,
hEvent
);
if
(
CreateProcessA
(
NULL
,
path
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
}
...
...
@@ -140,7 +140,7 @@ static BOOL start_console_renderer(void)
}
/* then try the regular PATH */
sprintf
(
buffer
,
"wineconsole %d
\n
"
,
hEvent
);
sprintf
(
buffer
,
"wineconsole
-- --use-event=
%d
\n
"
,
hEvent
);
if
(
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
goto
succeed
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment