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
4526f2ec
Commit
4526f2ec
authored
Mar 16, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Mar 16, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass new arguments (suspend/inherit) to the server.
parent
2f2898b5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
21 deletions
+31
-21
process.h
include/process.h
+6
-4
thread.h
include/thread.h
+3
-2
process.c
scheduler/process.c
+7
-5
thread.c
scheduler/thread.c
+15
-10
No files found.
include/process.h
View file @
4526f2ec
...
...
@@ -112,10 +112,12 @@ extern PDB *PROCESS_Current(void);
extern
BOOL
PROCESS_IsCurrent
(
HANDLE
handle
);
extern
PDB
*
PROCESS_Initial
(
void
);
extern
PDB
*
PROCESS_IdToPDB
(
DWORD
id
);
extern
PDB
*
PROCESS_Create
(
struct
_NE_MODULE
*
pModule
,
LPCSTR
cmd_line
,
LPCSTR
env
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
BOOL
inherit
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
);
extern
PDB
*
PROCESS_Create
(
struct
_NE_MODULE
*
pModule
,
LPCSTR
cmd_line
,
LPCSTR
env
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
);
extern
void
PROCESS_FreePDB
(
PDB
*
pdb
);
extern
void
PROCESS_SuspendOtherThreads
(
void
);
extern
void
PROCESS_ResumeOtherThreads
(
void
);
...
...
include/thread.h
View file @
4526f2ec
...
...
@@ -116,8 +116,9 @@ extern THDB *pCurrentThread;
/* scheduler/thread.c */
extern
THDB
*
THREAD_CreateInitialThread
(
struct
_PDB
*
pdb
);
extern
THDB
*
THREAD_Create
(
struct
_PDB
*
pdb
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
extern
THDB
*
THREAD_Create
(
struct
_PDB
*
pdb
,
DWORD
flags
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
LPSECURITY_ATTRIBUTES
tsa
,
LPSECURITY_ATTRIBUTES
psa
,
int
*
server_thandle
,
int
*
server_phandle
,
LPTHREAD_START_ROUTINE
start_addr
,
LPVOID
param
);
extern
THDB
*
THREAD_Current
(
void
);
...
...
scheduler/process.c
View file @
4526f2ec
...
...
@@ -285,9 +285,10 @@ BOOL PROCESS_Init(void)
* Create a new process database and associated info.
*/
PDB
*
PROCESS_Create
(
NE_MODULE
*
pModule
,
LPCSTR
cmd_line
,
LPCSTR
env
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
BOOL
inherit
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
)
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
)
{
DWORD
size
,
commit
;
int
server_thandle
,
server_phandle
;
...
...
@@ -326,8 +327,9 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
size
=
PE_HEADER
(
pModule
->
module32
)
->
OptionalHeader
.
SizeOfStackReserve
;
else
size
=
0
;
if
(
!
(
thdb
=
THREAD_Create
(
pdb
,
size
,
hInstance
==
0
,
&
server_thandle
,
&
server_phandle
,
NULL
,
NULL
)))
if
(
!
(
thdb
=
THREAD_Create
(
pdb
,
0L
,
size
,
hInstance
==
0
,
tsa
,
psa
,
&
server_thandle
,
&
server_phandle
,
NULL
,
NULL
)))
goto
error
;
info
->
hThread
=
server_thandle
;
info
->
hProcess
=
server_phandle
;
...
...
scheduler/thread.c
View file @
4526f2ec
...
...
@@ -94,7 +94,8 @@ THDB *THREAD_IdToTHDB( DWORD id )
* Initialization of a newly created THDB.
*/
static
BOOL
THREAD_InitTHDB
(
THDB
*
thdb
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
int
*
server_thandle
,
int
*
server_phandle
)
LPSECURITY_ATTRIBUTES
tsa
,
LPSECURITY_ATTRIBUTES
psa
,
int
*
server_thandle
,
int
*
server_phandle
)
{
DWORD
old_prot
;
...
...
@@ -137,7 +138,8 @@ static BOOL THREAD_InitTHDB( THDB *thdb, DWORD stack_size, BOOL alloc_stack16,
/* Create the thread socket */
if
(
CLIENT_NewThread
(
thdb
,
server_thandle
,
server_phandle
))
goto
error
;
if
(
CLIENT_NewThread
(
thdb
,
tsa
,
psa
,
server_thandle
,
server_phandle
))
goto
error
;
/* Create the thread event */
...
...
@@ -246,7 +248,8 @@ THDB *THREAD_CreateInitialThread( PDB *pdb )
/* Now proceed with normal initialization */
if
(
!
THREAD_InitTHDB
(
&
initial_thdb
,
0
,
TRUE
,
NULL
,
NULL
))
return
NULL
;
if
(
!
THREAD_InitTHDB
(
&
initial_thdb
,
0
,
TRUE
,
NULL
,
NULL
,
NULL
,
NULL
))
return
NULL
;
return
&
initial_thdb
;
}
...
...
@@ -254,7 +257,8 @@ THDB *THREAD_CreateInitialThread( PDB *pdb )
/***********************************************************************
* THREAD_Create
*/
THDB
*
THREAD_Create
(
PDB
*
pdb
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
THDB
*
THREAD_Create
(
PDB
*
pdb
,
DWORD
flags
,
DWORD
stack_size
,
BOOL
alloc_stack16
,
LPSECURITY_ATTRIBUTES
tsa
,
LPSECURITY_ATTRIBUTES
psa
,
int
*
server_thandle
,
int
*
server_phandle
,
LPTHREAD_START_ROUTINE
start_addr
,
LPVOID
param
)
{
...
...
@@ -268,6 +272,7 @@ THDB *THREAD_Create( PDB *pdb, DWORD stack_size, BOOL alloc_stack16,
thdb
->
teb
.
tls_ptr
=
thdb
->
tls_array
;
thdb
->
teb
.
process
=
pdb
;
thdb
->
exit_code
=
0x103
;
/* STILL_ACTIVE */
thdb
->
flags
=
flags
;
thdb
->
entry_point
=
start_addr
;
thdb
->
entry_arg
=
param
;
thdb
->
socket
=
-
1
;
...
...
@@ -280,7 +285,8 @@ THDB *THREAD_Create( PDB *pdb, DWORD stack_size, BOOL alloc_stack16,
/* Do the rest of the initialization */
if
(
!
THREAD_InitTHDB
(
thdb
,
stack_size
,
alloc_stack16
,
server_thandle
,
server_phandle
))
if
(
!
THREAD_InitTHDB
(
thdb
,
stack_size
,
alloc_stack16
,
tsa
,
psa
,
server_thandle
,
server_phandle
))
goto
error
;
thdb
->
next
=
THREAD_First
;
THREAD_First
=
thdb
;
...
...
@@ -313,13 +319,12 @@ void THREAD_Start( THDB *thdb )
* CreateThread (KERNEL32.63)
*/
HANDLE
WINAPI
CreateThread
(
SECURITY_ATTRIBUTES
*
sa
,
DWORD
stack
,
LPTHREAD_START_ROUTINE
start
,
LPVOID
param
,
DWORD
flags
,
LPDWORD
id
)
LPTHREAD_START_ROUTINE
start
,
LPVOID
param
,
DWORD
flags
,
LPDWORD
id
)
{
int
handle
=
-
1
;
BOOL
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
THDB
*
thread
=
THREAD_Create
(
PROCESS_Current
(),
stack
,
TRUE
,
&
handle
,
NULL
,
start
,
param
);
THDB
*
thread
=
THREAD_Create
(
PROCESS_Current
(),
flags
,
stack
,
TRUE
,
sa
,
NULL
,
&
handle
,
NULL
,
start
,
param
);
if
(
!
thread
)
return
INVALID_HANDLE_VALUE
;
if
(
SYSDEPS_SpawnThread
(
thread
)
==
-
1
)
{
...
...
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