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
f3bfa3a4
Commit
f3bfa3a4
authored
Jan 30, 2000
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jan 30, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark initial process as 32-bit for WineLib apps.
Use teb->tibflags instead of teb->flags (for Win95 USER32 compatibility). Removed unused thread event.
parent
17b1f461
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
26 deletions
+15
-26
main.h
include/main.h
+1
-1
process.h
include/process.h
+1
-1
task.h
include/task.h
+0
-1
main.c
loader/main.c
+3
-3
process.c
scheduler/process.c
+6
-9
thread.c
scheduler/thread.c
+4
-11
No files found.
include/main.h
View file @
f3bfa3a4
...
...
@@ -8,7 +8,7 @@
#include "windef.h"
extern
void
MAIN_Usage
(
char
*
);
extern
BOOL
MAIN_MainInit
(
int
*
argc
,
char
*
argv
[]
);
extern
BOOL
MAIN_MainInit
(
int
*
argc
,
char
*
argv
[]
,
BOOL
win32
);
extern
BOOL
MAIN_WineInit
(
int
*
argc
,
char
*
argv
[]
);
extern
HINSTANCE
MAIN_WinelibInit
(
int
*
argc
,
char
*
argv
[]
);
extern
int
MAIN_GetLanguageID
(
char
*
lang
,
char
*
country
,
char
*
charset
,
char
*
dialect
);
...
...
include/process.h
View file @
f3bfa3a4
...
...
@@ -155,7 +155,7 @@ extern BOOL ENV_InheritEnvironment( LPCSTR env );
extern
void
ENV_FreeEnvironment
(
PDB
*
pdb
);
/* scheduler/process.c */
extern
BOOL
PROCESS_Init
(
void
);
extern
BOOL
PROCESS_Init
(
BOOL
win32
);
extern
BOOL
PROCESS_IsCurrent
(
HANDLE
handle
);
extern
PDB
*
PROCESS_Initial
(
void
);
extern
PDB
*
PROCESS_IdToPDB
(
DWORD
id
);
...
...
include/task.h
View file @
f3bfa3a4
...
...
@@ -143,7 +143,6 @@ typedef struct _THHOOK
#include "poppack.h"
extern
THHOOK
*
pThhook
;
extern
void
(
*
TASK_AddTaskEntryBreakpoint
)(
HTASK16
hTask
);
extern
BOOL
TASK_Create
(
struct
_NE_MODULE
*
pModule
,
UINT16
cmdShow
);
extern
void
TASK_KillTask
(
HTASK16
hTask
);
...
...
loader/main.c
View file @
f3bfa3a4
...
...
@@ -56,13 +56,13 @@ DEFAULT_DEBUG_CHANNEL(server)
/***********************************************************************
* Main initialisation routine
*/
BOOL
MAIN_MainInit
(
int
*
argc
,
char
*
argv
[]
)
BOOL
MAIN_MainInit
(
int
*
argc
,
char
*
argv
[]
,
BOOL
win32
)
{
/* store the program name */
argv0
=
argv
[
0
];
/* Create the initial process */
if
(
!
PROCESS_Init
())
return
0
;
if
(
!
PROCESS_Init
(
win32
))
return
0
;
/* Initialize syslevel handling */
SYSLEVEL_Init
();
...
...
@@ -297,7 +297,7 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] )
HMODULE16
hModule
;
/* Main initialization */
if
(
!
MAIN_MainInit
(
argc
,
argv
))
return
0
;
if
(
!
MAIN_MainInit
(
argc
,
argv
,
TRUE
))
return
0
;
/* Create and switch to initial task */
if
(
!
(
wm
=
ELF_CreateDummyModule
(
argv
[
0
],
argv
[
0
]
)))
...
...
scheduler/process.c
View file @
f3bfa3a4
...
...
@@ -26,6 +26,7 @@
#include "server.h"
#include "options.h"
#include "callback.h"
#include "debugger.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
process
)
...
...
@@ -38,9 +39,6 @@ static PDB initial_pdb;
static
PDB
*
PROCESS_First
=
&
initial_pdb
;
/* Pointer to debugger callback routine */
void
(
*
TASK_AddTaskEntryBreakpoint
)(
HTASK16
hTask
)
=
NULL
;
/***********************************************************************
* PROCESS_WalkProcess
...
...
@@ -322,7 +320,7 @@ static PDB *PROCESS_CreatePDB( PDB *parent, BOOL inherit )
/***********************************************************************
* PROCESS_Init
*/
BOOL
PROCESS_Init
(
void
)
BOOL
PROCESS_Init
(
BOOL
win32
)
{
TEB
*
teb
;
int
server_fd
;
...
...
@@ -337,7 +335,7 @@ BOOL PROCESS_Init(void)
initial_pdb
.
ring0_threads
=
1
;
initial_pdb
.
group
=
&
initial_pdb
;
initial_pdb
.
priority
=
8
;
/* Normal */
initial_pdb
.
flags
=
PDB32_WIN16_PROC
;
initial_pdb
.
flags
=
win32
?
0
:
PDB32_WIN16_PROC
;
initial_pdb
.
winver
=
0xffff
;
/* to be determined */
initial_pdb
.
main_queue
=
INVALID_HANDLE_VALUE16
;
...
...
@@ -494,9 +492,8 @@ void PROCESS_Start(void)
}
/* If requested, add entry point breakpoint */
if
(
(
Options
.
debug
&&
TASK_AddTaskEntryBreakpoint
)
||
(
pdb
->
flags
&
PDB32_DEBUGGED
))
TASK_AddTaskEntryBreakpoint
(
pdb
->
task
);
if
(
Options
.
debug
||
(
pdb
->
flags
&
PDB32_DEBUGGED
)
)
DEBUG_AddTaskEntryBreakpoint
(
pdb
->
task
);
/* Call UserSignalProc ( USIG_PROCESS_RUNNING ... ) only for non-GUI win32 apps */
if
(
type
!=
PROC_WIN16
&&
(
pdb
->
flags
&
PDB32_CONSOLE_PROC
))
...
...
@@ -760,7 +757,7 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
return
process
->
env_db
->
startup_info
->
dwFlags
;
case
GPD_PARENT
:
return
(
DWORD
)
process
->
parent
->
server_pid
;
return
process
->
parent
?
(
DWORD
)
process
->
parent
->
server_pid
:
0
;
case
GPD_FLAGS
:
return
process
->
flags
;
...
...
scheduler/thread.c
View file @
f3bfa3a4
...
...
@@ -44,7 +44,7 @@ TEB *THREAD_First = &initial_teb;
*/
BOOL
THREAD_IsWin16
(
TEB
*
teb
)
{
return
!
teb
||
!
(
teb
->
flags
&
TEBF_WIN32
);
return
!
teb
||
!
(
teb
->
tib
flags
&
TEBF_WIN32
);
}
/***********************************************************************
...
...
@@ -119,11 +119,6 @@ static BOOL THREAD_InitTEB( TEB *teb, DWORD stack_size, BOOL alloc_stack16,
teb
->
signal_stack
=
(
char
*
)
teb
->
signal_stack
+
0x10000
;
}
/* Create the thread event */
if
(
!
(
teb
->
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
)))
goto
error
;
teb
->
event
=
ConvertToGlobalHandle
(
teb
->
event
);
/* StaticUnicodeString */
teb
->
StaticUnicodeString
.
MaximumLength
=
sizeof
(
teb
->
StaticUnicodeBuffer
);
...
...
@@ -132,7 +127,6 @@ static BOOL THREAD_InitTEB( TEB *teb, DWORD stack_size, BOOL alloc_stack16,
return
TRUE
;
error:
if
(
teb
->
event
)
CloseHandle
(
teb
->
event
);
if
(
teb
->
stack_sel
)
SELECTOR_FreeBlock
(
teb
->
stack_sel
,
1
);
if
(
teb
->
stack_base
)
VirtualFree
(
teb
->
stack_base
,
0
,
MEM_RELEASE
);
return
FALSE
;
...
...
@@ -155,7 +149,6 @@ void CALLBACK THREAD_FreeTEB( ULONG_PTR arg )
PROCESS_CallUserSignalProc
(
USIG_THREAD_EXIT
,
(
DWORD
)
teb
->
tid
,
0
);
CloseHandle
(
teb
->
event
);
while
(
*
pptr
&&
(
*
pptr
!=
teb
))
pptr
=
&
(
*
pptr
)
->
next
;
if
(
*
pptr
)
*
pptr
=
teb
->
next
;
...
...
@@ -180,7 +173,7 @@ TEB *THREAD_CreateInitialThread( PDB *pdb, int server_fd )
{
initial_teb
.
except
=
(
void
*
)
-
1
;
initial_teb
.
self
=
&
initial_teb
;
initial_teb
.
flags
=
/* TEBF_WIN32 */
0
;
initial_teb
.
tibflags
=
(
pdb
->
flags
&
PDB32_WIN16_PROC
)
?
0
:
TEBF_WIN32
;
initial_teb
.
tls_ptr
=
initial_teb
.
tls_array
;
initial_teb
.
process
=
pdb
;
initial_teb
.
exit_code
=
0x103
;
/* STILL_ACTIVE */
...
...
@@ -224,7 +217,7 @@ TEB *THREAD_Create( PDB *pdb, int fd, DWORD flags, DWORD stack_size, BOOL alloc_
teb
->
except
=
(
void
*
)
-
1
;
teb
->
htask16
=
pdb
->
task
;
teb
->
self
=
teb
;
teb
->
flags
=
(
pdb
->
flags
&
PDB32_WIN16_PROC
)
?
0
:
TEBF_WIN32
;
teb
->
tibflags
=
(
pdb
->
flags
&
PDB32_WIN16_PROC
)
?
0
:
TEBF_WIN32
;
teb
->
tls_ptr
=
teb
->
tls_array
;
teb
->
process
=
pdb
;
teb
->
exit_code
=
0x103
;
/* STILL_ACTIVE */
...
...
@@ -300,7 +293,7 @@ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
int
handle
=
-
1
;
TEB
*
teb
=
THREAD_Create
(
PROCESS_Current
(),
-
1
,
flags
,
stack
,
TRUE
,
sa
,
&
handle
);
if
(
!
teb
)
return
0
;
teb
->
flags
|=
TEBF_WIN32
;
teb
->
tibflags
|=
TEBF_WIN32
;
teb
->
entry_point
=
start
;
teb
->
entry_arg
=
param
;
teb
->
startup
=
THREAD_Start
;
...
...
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