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
fbea5308
Commit
fbea5308
authored
Jul 03, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jul 03, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On NE process creation, move major part of NE EXE module loading and
NE instance creation into the child process.
parent
3922ca74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
33 deletions
+25
-33
module.h
include/module.h
+2
-1
process.h
include/process.h
+0
-3
task.h
include/task.h
+1
-3
module.c
loader/dos/module.c
+1
-1
main.c
loader/main.c
+1
-1
module.c
loader/ne/module.c
+0
-0
pe_image.c
loader/pe_image.c
+1
-1
task.c
loader/task.c
+6
-16
main.c
miscemu/main.c
+1
-1
process.c
scheduler/process.c
+12
-6
No files found.
include/module.h
View file @
fbea5308
...
...
@@ -202,11 +202,12 @@ extern FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern
FARPROC16
NE_GetEntryPointEx
(
HMODULE16
hModule
,
WORD
ordinal
,
BOOL16
snoop
);
extern
BOOL16
NE_SetEntryPoint
(
HMODULE16
hModule
,
WORD
ordinal
,
WORD
offset
);
extern
HANDLE
NE_OpenFile
(
NE_MODULE
*
pModule
);
extern
HINSTANCE16
MODULE_LoadModule16
(
LPCSTR
name
,
BOOL
implicit
);
extern
BOOL
NE_CreateProcess
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
cmd_line
,
LPCSTR
env
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
DWORD
flags
,
LPSTARTUPINFOA
startup
,
LPPROCESS_INFORMATION
info
);
extern
BOOL
NE_InitProcess
(
NE_MODULE
*
pModule
);
/* loader/ne/resource.c */
extern
HGLOBAL16
WINAPI
NE_DefResourceHandler
(
HGLOBAL16
,
HMODULE16
,
HRSRC16
);
...
...
include/process.h
View file @
fbea5308
...
...
@@ -95,8 +95,6 @@ typedef struct _PDB
HANDLE
*
dos_handles
;
/* Handles mapping DOS -> Win32 */
struct
_PDB
*
next
;
/* List reference - list of PDB's */
WORD
winver
;
/* Windows version figured out by VERSION_GetVersion */
WORD
hInstance
;
/* hInstance on startup */
WORD
hPrevInstance
;
/* hPrevInstance on startup */
struct
_SERVICETABLE
*
service_table
;
/* Service table for service thread */
}
PDB
;
...
...
@@ -161,7 +159,6 @@ extern PDB *PROCESS_IdToPDB( DWORD id );
extern
void
PROCESS_CallUserSignalProc
(
UINT
uCode
,
HMODULE
hModule
);
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
,
DWORD
flags
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
);
...
...
include/task.h
View file @
fbea5308
...
...
@@ -146,9 +146,7 @@ typedef struct _THHOOK
extern
THHOOK
*
pThhook
;
extern
void
(
*
TASK_AddTaskEntryBreakpoint
)(
HTASK16
hTask
);
extern
BOOL
TASK_Create
(
struct
_NE_MODULE
*
pModule
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
UINT16
cmdShow
);
extern
BOOL
TASK_Create
(
struct
_NE_MODULE
*
pModule
,
UINT16
cmdShow
);
extern
void
TASK_KillTask
(
HTASK16
hTask
);
extern
HTASK16
TASK_GetNextTask
(
HTASK16
hTask
);
extern
void
TASK_Reschedule
(
void
);
...
...
loader/dos/module.c
View file @
fbea5308
...
...
@@ -498,7 +498,7 @@ BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR env,
return
FALSE
;
}
inherit
=
TRUE
;
/* bad hack for inheriting the CreatePipe... */
if
(
!
PROCESS_Create
(
pModule
,
cmdline
,
env
,
0
,
0
,
if
(
!
PROCESS_Create
(
pModule
,
cmdline
,
env
,
psa
,
tsa
,
inherit
,
flags
,
startup
,
info
))
return
FALSE
;
}
...
...
loader/main.c
View file @
fbea5308
...
...
@@ -309,7 +309,7 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] )
pModule
->
flags
=
NE_FFLAGS_WIN32
;
pModule
->
module32
=
wm
->
module
;
if
(
!
TASK_Create
(
pModule
,
0
,
0
,
FALSE
))
return
0
;
if
(
!
TASK_Create
(
pModule
,
FALSE
))
return
0
;
/* Initialize GDI and USER */
if
(
!
LoadLibraryA
(
"GDI32.DLL"
))
return
0
;
...
...
loader/ne/module.c
View file @
fbea5308
This diff is collapsed.
Click to expand it.
loader/pe_image.c
View file @
fbea5308
...
...
@@ -984,7 +984,7 @@ BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env,
/* Create new process */
if
(
!
PROCESS_Create
(
pModule
,
cmd_line
,
env
,
0
,
0
,
psa
,
tsa
,
inherit
,
flags
,
startup
,
info
)
)
psa
,
tsa
,
inherit
,
flags
,
startup
,
info
)
)
return
FALSE
;
/* Note: PE_CreateModule and the remaining process initialization will
...
...
loader/task.c
View file @
fbea5308
...
...
@@ -275,16 +275,13 @@ void TASK_CallToStart(void)
* by entering the Win16Lock while linking the task into the
* global task list.
*/
BOOL
TASK_Create
(
NE_MODULE
*
pModule
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
UINT16
cmdShow
)
BOOL
TASK_Create
(
NE_MODULE
*
pModule
,
UINT16
cmdShow
)
{
HTASK16
hTask
;
TDB
*
pTask
;
LPSTR
cmd_line
;
WORD
sp
;
char
name
[
10
];
PDB
*
pdb32
=
PROCESS_Current
();
SEGTABLEENTRY
*
pSegTable
=
NE_SEG_TABLE
(
pModule
);
/* Allocate the task structure */
...
...
@@ -304,9 +301,12 @@ BOOL TASK_Create( NE_MODULE *pModule, HINSTANCE16 hInstance,
if
(
pModule
->
lpDosTask
)
pTask
->
flags
|=
TDBF_WINOLDAP
;
pTask
->
hInstance
=
pModule
->
self
;
pTask
->
hPrevInstance
=
0
;
/* NOTE: for 16-bit tasks, the instance handles are updated later on
in NE_InitProcess */
pTask
->
version
=
pModule
->
expected_version
;
pTask
->
hInstance
=
hInstance
?
hInstance
:
pModule
->
self
;
pTask
->
hPrevInstance
=
hPrevInstance
;
pTask
->
hModule
=
pModule
->
self
;
pTask
->
hParent
=
GetCurrentTask
();
pTask
->
magic
=
TDB_MAGIC
;
...
...
@@ -388,16 +388,6 @@ BOOL TASK_Create( NE_MODULE *pModule, HINSTANCE16 hInstance,
pTask
->
teb
->
htask16
=
pTask
->
teb
->
process
->
task
=
hTask
;
TRACE_
(
task
)(
"module='%s' cmdline='%s' task=%04x
\n
"
,
name
,
cmd_line
,
hTask
);
/* If we have a DGROUP/hInstance, use it for 16-bit stack */
if
(
hInstance
)
{
if
(
!
(
sp
=
pModule
->
sp
))
sp
=
pSegTable
[
pModule
->
ss
-
1
].
minsize
+
pModule
->
stack_size
;
sp
&=
~
1
;
sp
-=
sizeof
(
STACK16FRAME
);
pTask
->
teb
->
cur_stack
=
PTR_SEG_OFF_TO_SEGPTR
(
hInstance
,
sp
);
}
/* If requested, add entry point breakpoint */
if
(
TASK_AddTaskEntryBreakpoint
)
...
...
miscemu/main.c
View file @
fbea5308
...
...
@@ -168,7 +168,7 @@ int main( int argc, char *argv[] )
/* Create initial task */
if
(
!
(
pModule
=
NE_GetPtr
(
GetModuleHandle16
(
"KERNEL"
)
))
)
return
1
;
if
(
!
TASK_Create
(
pModule
,
0
,
0
,
FALSE
)
)
return
1
;
if
(
!
TASK_Create
(
pModule
,
FALSE
)
)
return
1
;
/* Switch to initial task */
PostEvent16
(
PROCESS_Current
()
->
task
);
...
...
scheduler/process.c
View file @
fbea5308
...
...
@@ -411,9 +411,14 @@ void PROCESS_Start(void)
/* Create a task for this process */
if
(
pdb
->
env_db
->
startup_info
->
dwFlags
&
STARTF_USESHOWWINDOW
)
cmdShow
=
pdb
->
env_db
->
startup_info
->
wShowWindow
;
if
(
!
TASK_Create
(
pModule
,
pdb
->
hInstance
,
pdb
->
hPrevInstance
,
cmdShow
))
if
(
!
TASK_Create
(
pModule
,
cmdShow
))
goto
error
;
/* Perform Win16 specific process initialization */
if
(
type
==
PROC_WIN16
)
if
(
!
NE_InitProcess
(
pModule
)
)
goto
error
;
/* Note: The USIG_PROCESS_CREATE signal is supposed to be sent in the
* context of the parent process. Actually, the USER signal proc
* doesn't really care about that, but it *does* require that the
...
...
@@ -502,13 +507,13 @@ void PROCESS_Start(void)
* Create a new process database and associated info.
*/
PDB
*
PROCESS_Create
(
NE_MODULE
*
pModule
,
LPCSTR
cmd_line
,
LPCSTR
env
,
HINSTANCE16
hInstance
,
HINSTANCE16
hPrevInstance
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
BOOL
inherit
,
DWORD
flags
,
STARTUPINFOA
*
startup
,
PROCESS_INFORMATION
*
info
)
{
HANDLE
handles
[
2
],
load_done_evt
=
INVALID_HANDLE_VALUE
;
DWORD
exitcode
,
size
;
BOOL
alloc_stack16
;
int
server_thandle
;
struct
new_process_request
*
req
=
get_req_buffer
();
TEB
*
teb
=
NULL
;
...
...
@@ -554,21 +559,24 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
size
=
header
->
SizeOfStackReserve
;
if
(
header
->
Subsystem
==
IMAGE_SUBSYSTEM_WINDOWS_CUI
)
pdb
->
flags
|=
PDB32_CONSOLE_PROC
;
alloc_stack16
=
TRUE
;
}
else
if
(
!
pModule
->
dos_image
)
/* Win16 process */
{
alloc_stack16
=
FALSE
;
size
=
0
;
pdb
->
flags
|=
PDB32_WIN16_PROC
;
}
else
/* DOS process */
{
alloc_stack16
=
FALSE
;
size
=
0
;
pdb
->
flags
|=
PDB32_DOS_PROC
;
}
/* Create the main thread */
if
(
!
(
teb
=
THREAD_Create
(
pdb
,
0L
,
size
,
hInstance
==
0
,
tsa
,
&
server_thandle
)))
if
(
!
(
teb
=
THREAD_Create
(
pdb
,
0L
,
size
,
alloc_stack16
,
tsa
,
&
server_thandle
)))
goto
error
;
info
->
hThread
=
server_thandle
;
info
->
dwThreadId
=
(
DWORD
)
teb
->
tid
;
...
...
@@ -579,10 +587,8 @@ PDB *PROCESS_Create( NE_MODULE *pModule, LPCSTR cmd_line, LPCSTR env,
DuplicateHandle
(
GetCurrentProcess
(),
load_done_evt
,
info
->
hProcess
,
&
pdb
->
load_done_evt
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
/* Pass module
/instance
to new process (FIXME: hack) */
/* Pass module to new process (FIXME: hack) */
pdb
->
module
=
pModule
->
self
;
pdb
->
hInstance
=
hInstance
;
pdb
->
hPrevInstance
=
hPrevInstance
;
SYSDEPS_SpawnThread
(
teb
);
/* Wait until process is initialized (or initialization failed) */
...
...
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