Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2e658768
Commit
2e658768
authored
Apr 11, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Apr 11, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send USIG_PROCESS_CREATE signal.
Bugfix: GetProcessDword offset -8 should return parent process ID.
parent
af504742
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
26 deletions
+31
-26
process.h
include/process.h
+2
-2
module.c
loader/ne/module.c
+1
-1
task.c
loader/task.c
+7
-7
process.c
scheduler/process.c
+19
-14
thread.c
scheduler/thread.c
+2
-2
No files found.
include/process.h
View file @
2e658768
...
...
@@ -136,7 +136,7 @@ typedef struct _PDB
#define GPD_STARTF_SIZE (-20)
#define GPD_STARTF_POSITION (-16)
#define GPD_STARTF_FLAGS (-12)
#define GPD_PARENT
_PDB
(- 8)
#define GPD_PARENT
(- 8)
#define GPD_FLAGS (- 4)
#define GPD_USERDATA ( 0)
...
...
@@ -154,7 +154,7 @@ extern PDB *PROCESS_Current(void);
extern
BOOL
PROCESS_IsCurrent
(
HANDLE
handle
);
extern
PDB
*
PROCESS_Initial
(
void
);
extern
PDB
*
PROCESS_IdToPDB
(
DWORD
id
);
extern
void
PROCESS_CallUserSignalProc
(
UINT
uCode
,
HMODULE
hModule
);
extern
void
PROCESS_CallUserSignalProc
(
UINT
uCode
,
DWORD
dwThreadOrProcessId
,
HMODULE
hModule
);
extern
PDB
*
PROCESS_Create
(
struct
_NE_MODULE
*
pModule
,
LPCSTR
cmd_line
,
LPCSTR
env
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
...
...
loader/ne/module.c
View file @
2e658768
...
...
@@ -1091,7 +1091,7 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep )
pTask
->
userhandler
(
hModule
,
USIG16_DLL_UNLOAD
,
0
,
pTask
->
hInstance
,
pTask
->
hQueue
);
PROCESS_CallUserSignalProc
(
USIG_DLL_UNLOAD_WIN16
,
hModule
);
PROCESS_CallUserSignalProc
(
USIG_DLL_UNLOAD_WIN16
,
0
,
hModule
);
}
else
call_wep
=
FALSE
;
/* We are freeing a task -> no more WEPs */
...
...
loader/task.c
View file @
2e658768
...
...
@@ -239,10 +239,10 @@ static void TASK_CallToStart(void)
memset
(
THREAD_STACK16
(
pTask
->
thdb
),
'\0'
,
sizeof
(
STACK16FRAME
));
/* Call USER signal proc */
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
);
/* for initial thread */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_INIT
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_LOADED
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_RUNNING
,
0
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
,
0
);
/* for initial thread */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_INIT
,
0
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_LOADED
,
0
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_RUNNING
,
0
,
0
);
if
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
{
...
...
@@ -574,9 +574,9 @@ void TASK_KillTask( HTASK16 hTask )
pTask
->
userhandler
(
hTask
,
USIG16_TERMINATION
,
0
,
pTask
->
hInstance
,
pTask
->
hQueue
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_EXIT
,
0
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_EXIT
,
0
);
/* FIXME */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_DESTROY
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_EXIT
,
0
,
0
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_EXIT
,
0
,
0
);
/* FIXME */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_DESTROY
,
0
,
0
);
if
(
nTaskCount
<=
1
)
{
...
...
scheduler/process.c
View file @
2e658768
...
...
@@ -172,11 +172,11 @@ PDB *PROCESS_IdToPDB( DWORD id )
* USIG_FLAGS_FAULT
* The signal is being sent due to a fault.
*/
void
PROCESS_CallUserSignalProc
(
UINT
uCode
,
HMODULE
hModule
)
void
PROCESS_CallUserSignalProc
(
UINT
uCode
,
DWORD
dwThreadOrProcessId
,
HMODULE
hModule
)
{
PDB
*
pdb
=
PROCESS_Current
();
STARTUPINFOA
*
startup
=
pdb
->
env_db
?
pdb
->
env_db
->
startup_info
:
NULL
;
DWORD
dwFlags
=
0
,
dwThreadOrProcessID
;
DWORD
dwFlags
=
0
;
/* Determine dwFlags */
...
...
@@ -201,10 +201,11 @@ void PROCESS_CallUserSignalProc( UINT uCode, HMODULE hModule )
/* Get thread or process ID */
if
(
uCode
==
USIG_THREAD_INIT
||
uCode
==
USIG_THREAD_EXIT
)
dwThreadOrProcessID
=
GetCurrentThreadId
();
else
dwThreadOrProcessID
=
GetCurrentProcessId
();
if
(
dwThreadOrProcessId
==
0
)
if
(
uCode
==
USIG_THREAD_INIT
||
uCode
==
USIG_THREAD_EXIT
)
dwThreadOrProcessId
=
GetCurrentThreadId
();
else
dwThreadOrProcessId
=
GetCurrentProcessId
();
/* Convert module handle to 16-bit */
...
...
@@ -214,7 +215,7 @@ void PROCESS_CallUserSignalProc( UINT uCode, HMODULE hModule )
/* Call USER signal proc */
if
(
Callout
.
UserSignalProc
)
Callout
.
UserSignalProc
(
uCode
,
dwThreadOrProcessI
D
,
dwFlags
,
hModule
);
Callout
.
UserSignalProc
(
uCode
,
dwThreadOrProcessI
d
,
dwFlags
,
hModule
);
}
...
...
@@ -450,7 +451,7 @@ void PROCESS_Start(void)
NE_MODULE
*
pModule
=
NE_GetPtr
(
pTask
->
hModule
);
OFSTRUCT
*
ofs
=
(
OFSTRUCT
*
)((
char
*
)(
pModule
)
+
(
pModule
)
->
fileinfo
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
);
/* for initial thread */
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
,
0
);
/* for initial thread */
#if 0
/* Initialize the critical section */
...
...
@@ -474,7 +475,7 @@ void PROCESS_Start(void)
#endif
PROCESS_CallUserSignalProc
(
USIG_PROCESS_INIT
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_INIT
,
0
,
0
);
/* Map system DLLs into this process (from initial process) */
/* FIXME: this is a hack */
...
...
@@ -483,7 +484,7 @@ void PROCESS_Start(void)
/* Create 32-bit MODREF */
if
(
!
PE_CreateModule
(
pModule
->
module32
,
ofs
,
0
,
FALSE
))
goto
error
;
PROCESS_CallUserSignalProc
(
USIG_PROCESS_LOADED
,
0
);
/* FIXME: correct location? */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_LOADED
,
0
,
0
);
/* FIXME: correct location? */
/* Initialize thread-local storage */
...
...
@@ -496,7 +497,7 @@ void PROCESS_Start(void)
MODULE_InitializeDLLs
(
0
,
DLL_PROCESS_ATTACH
,
(
LPVOID
)
1
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_RUNNING
,
0
);
PROCESS_CallUserSignalProc
(
USIG_PROCESS_RUNNING
,
0
,
0
);
entry
=
(
LPTHREAD_START_ROUTINE
)
RVA_PTR
(
pModule
->
module32
,
OptionalHeader
.
AddressOfEntryPoint
);
...
...
@@ -587,6 +588,10 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
if
(
!
PROCESS_InheritEnvDB
(
pdb
,
cmd_line
,
env
,
inherit
,
startup
))
goto
error
;
/* Call USER signal proc */
PROCESS_CallUserSignalProc
(
USIG_PROCESS_CREATE
,
info
->
dwProcessId
,
0
);
/* Create the main thread */
if
(
pModule
->
module32
)
...
...
@@ -730,8 +735,8 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
case
GPD_STARTF_FLAGS
:
return
process
->
env_db
->
startup_info
->
dwFlags
;
case
GPD_PARENT
_PDB
:
return
(
DWORD
)
process
->
parent
;
case
GPD_PARENT
:
return
(
DWORD
)
process
->
parent
->
server_pid
;
case
GPD_FLAGS
:
return
process
->
flags
;
...
...
@@ -770,7 +775,7 @@ void WINAPI SetProcessDword( DWORD dwProcessID, INT offset, DWORD value )
case
GPD_STARTF_SIZE
:
case
GPD_STARTF_POSITION
:
case
GPD_STARTF_FLAGS
:
case
GPD_PARENT
_PDB
:
case
GPD_PARENT
:
case
GPD_FLAGS
:
ERR
(
win32
,
"Not allowed to modify offset %d
\n
"
,
offset
);
break
;
...
...
scheduler/thread.c
View file @
2e658768
...
...
@@ -154,7 +154,7 @@ void THREAD_FreeTHDB( THDB *thdb )
{
THDB
**
pptr
=
&
THREAD_First
;
PROCESS_CallUserSignalProc
(
USIG_THREAD_EXIT
,
0
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_EXIT
,
0
,
0
);
CloseHandle
(
thdb
->
event
);
while
(
*
pptr
&&
(
*
pptr
!=
thdb
))
pptr
=
&
(
*
pptr
)
->
next
;
...
...
@@ -279,7 +279,7 @@ static void THREAD_Start(void)
{
THDB
*
thdb
=
THREAD_Current
();
LPTHREAD_START_ROUTINE
func
=
(
LPTHREAD_START_ROUTINE
)
thdb
->
entry_point
;
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
);
PROCESS_CallUserSignalProc
(
USIG_THREAD_INIT
,
0
,
0
);
PE_InitTls
();
MODULE_InitializeDLLs
(
0
,
DLL_THREAD_ATTACH
,
NULL
);
ExitThread
(
func
(
thdb
->
entry_arg
)
);
...
...
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