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
a1957c4d
Commit
a1957c4d
authored
May 24, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
May 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait until child initialized before returning from PROCESS_Create.
parent
6d389b8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
main.c
miscemu/main.c
+2
-4
process.c
scheduler/process.c
+39
-1
No files found.
miscemu/main.c
View file @
a1957c4d
...
...
@@ -104,15 +104,13 @@ void MAIN_EmulatorRun( void )
ExitProcess
(
0
);
}
/* Start message loop for desktop window */
do
while
(
GetNumTasks16
()
>
1
&&
Callout
.
GetMessageA
(
&
msg
,
0
,
0
,
0
)
)
{
if
(
!
Callout
.
GetMessageA
(
&
msg
,
0
,
0
,
0
))
break
;
Callout
.
TranslateMessage
(
&
msg
);
Callout
.
DispatchMessageA
(
&
msg
);
}
while
(
GetNumTasks16
()
>
1
);
}
ExitProcess
(
0
);
}
...
...
scheduler/process.c
View file @
a1957c4d
...
...
@@ -516,6 +516,11 @@ void PROCESS_Start(void)
if
(
pdb
->
flags
&
PDB32_CONSOLE_PROC
)
AllocConsole
();
/* Signal the parent process to continue */
SetEvent
(
pdb
->
load_done_evt
);
CloseHandle
(
pdb
->
load_done_evt
);
pdb
->
load_done_evt
=
INVALID_HANDLE_VALUE
;
/* Now call the entry point */
EnterCriticalSection
(
&
pdb
->
crit_section
);
...
...
@@ -534,7 +539,7 @@ void PROCESS_Start(void)
ExitProcess
(
entry
(
NULL
)
);
error:
ExitProcess
(
1
);
ExitProcess
(
GetLastError
()
);
}
...
...
@@ -549,6 +554,7 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
BOOL
inherit
,
DWORD
flags
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
)
{
HANDLE
load_done_evt
=
INVALID_HANDLE_VALUE
;
DWORD
size
,
commit
;
int
server_thandle
;
struct
new_process_request
req
;
...
...
@@ -592,6 +598,9 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
if
(
pModule
->
module32
)
{
HANDLE
handles
[
2
];
DWORD
exitcode
;
/* Create the main thread */
size
=
PE_HEADER
(
pModule
->
module32
)
->
OptionalHeader
.
SizeOfStackReserve
;
if
(
!
(
thdb
=
THREAD_Create
(
pdb
,
0L
,
size
,
TRUE
,
tsa
,
&
server_thandle
)))
...
...
@@ -609,12 +618,40 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
/* Inherit the env DB from the parent */
if
(
!
PROCESS_InheritEnvDB
(
pdb
,
cmd_line
,
env
,
inherit
,
startup
))
goto
error
;
/* Create the load-done event */
load_done_evt
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
DuplicateHandle
(
GetCurrentProcess
(),
load_done_evt
,
info
->
hProcess
,
&
pdb
->
load_done_evt
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
/* Call USER signal proc */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_CREATE
,
info
->
dwProcessId
,
0
);
/* Set the process module (FIXME: hack) */
pdb
->
module
=
pModule
->
self
;
SYSDEPS_SpawnThread
(
thdb
);
/* Wait until process is initialized (or initialization failed) */
handles
[
0
]
=
info
->
hProcess
;
handles
[
1
]
=
load_done_evt
;
switch
(
WaitForMultipleObjects
(
2
,
handles
,
FALSE
,
INFINITE
)
)
{
default:
ERR_
(
process
)(
"WaitForMultipleObjects failed
\n
"
);
break
;
case
0
:
/* Child initialization code returns error condition as exitcode */
if
(
GetExitCodeProcess
(
info
->
hProcess
,
&
exitcode
)
)
SetLastError
(
exitcode
);
goto
error
;
case
1
:
break
;
}
CloseHandle
(
load_done_evt
);
load_done_evt
=
INVALID_HANDLE_VALUE
;
}
else
/* Create a 16-bit process */
{
...
...
@@ -666,6 +703,7 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
return
pdb
;
error:
if
(
load_done_evt
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
load_done_evt
);
if
(
info
->
hThread
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
info
->
hThread
);
if
(
info
->
hProcess
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
info
->
hProcess
);
PROCESS_FreePDB
(
pdb
);
...
...
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