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
ff35e1fb
Commit
ff35e1fb
authored
Dec 24, 1998
by
Ulrich Weigand
Committed by
Alexandre Julliard
Dec 24, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Callout table instead of direct GetProcAddress.
UserYield moved to USER.
parent
61439d27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
67 deletions
+16
-67
task.c
loader/task.c
+8
-46
main.c
miscemu/main.c
+8
-21
No files found.
loader/task.c
View file @
ff35e1fb
...
@@ -604,20 +604,13 @@ void TASK_KillCurrentTask( INT16 exitCode )
...
@@ -604,20 +604,13 @@ void TASK_KillCurrentTask( INT16 exitCode )
USER_ExitWindows
();
USER_ExitWindows
();
}
}
if
(
!
__winelib
)
{
/* FIXME: Hack! Send a message to the initial task so that
/* FIXME: Hack! Send a message to the initial task so that
* the GetMessage wakes up and the initial task can check whether
* the GetMessage wakes up and the initial task can check whether
* it is the only remaining one and terminate itself ...
* it is the only remaining one and terminate itself ...
* The initial task should probably install hooks or something
* The initial task should probably install hooks or something
* to get informed about task termination :-/
* to get informed about task termination :-/
*/
*/
HTASK16
hTask
=
PROCESS_Initial
()
->
task
;
Callout
.
PostAppMessage16
(
PROCESS_Initial
()
->
task
,
WM_NULL
,
0
,
0
);
HMODULE16
hModule
=
GetModuleHandle16
(
"USER"
);
FARPROC16
postFunc
=
WIN32_GetProcAddress16
(
hModule
,
"PostAppMessage"
);
if
(
postFunc
)
Callbacks
->
CallPostAppMessageProc
(
postFunc
,
hTask
,
WM_NULL
,
0
,
0
);
}
/* Remove the task from the list to be sure we never switch back to it */
/* Remove the task from the list to be sure we never switch back to it */
TASK_UnlinkTask
(
hCurrentTask
);
TASK_UnlinkTask
(
hCurrentTask
);
...
@@ -1043,33 +1036,6 @@ void WINAPI DirectedYield( HTASK16 hTask )
...
@@ -1043,33 +1036,6 @@ void WINAPI DirectedYield( HTASK16 hTask )
TRACE
(
task
,
"%04x: back from DirectedYield(%04x)
\n
"
,
pCurTask
->
hSelf
,
hTask
);
TRACE
(
task
,
"%04x: back from DirectedYield(%04x)
\n
"
,
pCurTask
->
hSelf
,
hTask
);
}
}
/***********************************************************************
* UserYield (USER.332)
*/
void
WINAPI
UserYield
(
void
)
{
TDB
*
pCurTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
MESSAGEQUEUE
*
queue
=
(
MESSAGEQUEUE
*
)
GlobalLock16
(
pCurTask
->
hQueue
);
if
(
!
THREAD_IsWin16
(
THREAD_Current
()
)
)
{
FIXME
(
task
,
"called for Win32 thread (%04x)!
\n
"
,
THREAD_Current
()
->
teb_sel
);
return
;
}
/* Handle sent messages */
while
(
queue
&&
(
queue
->
wakeBits
&
QS_SENDMESSAGE
))
QUEUE_ReceiveMessage
(
queue
);
OldYield
();
queue
=
(
MESSAGEQUEUE
*
)
GlobalLock16
(
pCurTask
->
hQueue
);
while
(
queue
&&
(
queue
->
wakeBits
&
QS_SENDMESSAGE
))
QUEUE_ReceiveMessage
(
queue
);
}
/***********************************************************************
/***********************************************************************
* Yield16 (KERNEL.29)
* Yield16 (KERNEL.29)
*/
*/
...
@@ -1084,7 +1050,7 @@ void WINAPI Yield16(void)
...
@@ -1084,7 +1050,7 @@ void WINAPI Yield16(void)
}
}
if
(
pCurTask
)
pCurTask
->
hYieldTo
=
0
;
if
(
pCurTask
)
pCurTask
->
hYieldTo
=
0
;
if
(
pCurTask
&&
pCurTask
->
hQueue
)
UserYield
();
if
(
pCurTask
&&
pCurTask
->
hQueue
)
Callout
.
UserYield
();
else
OldYield
();
else
OldYield
();
}
}
...
@@ -1260,7 +1226,7 @@ HQUEUE16 WINAPI GetTaskQueue( HTASK16 hTask )
...
@@ -1260,7 +1226,7 @@ HQUEUE16 WINAPI GetTaskQueue( HTASK16 hTask )
*/
*/
HQUEUE16
WINAPI
SetThreadQueue
(
DWORD
thread
,
HQUEUE16
hQueue
)
HQUEUE16
WINAPI
SetThreadQueue
(
DWORD
thread
,
HQUEUE16
hQueue
)
{
{
THDB
*
thdb
=
THREAD_IdToTHDB
(
thread
);
THDB
*
thdb
=
thread
?
THREAD_IdToTHDB
(
thread
)
:
THREAD_Current
(
);
HQUEUE16
oldQueue
=
thdb
?
thdb
->
teb
.
queue
:
0
;
HQUEUE16
oldQueue
=
thdb
?
thdb
->
teb
.
queue
:
0
;
if
(
thdb
)
if
(
thdb
)
...
@@ -1279,7 +1245,7 @@ HQUEUE16 WINAPI SetThreadQueue( DWORD thread, HQUEUE16 hQueue )
...
@@ -1279,7 +1245,7 @@ HQUEUE16 WINAPI SetThreadQueue( DWORD thread, HQUEUE16 hQueue )
*/
*/
HQUEUE16
WINAPI
GetThreadQueue
(
DWORD
thread
)
HQUEUE16
WINAPI
GetThreadQueue
(
DWORD
thread
)
{
{
THDB
*
thdb
=
THREAD_IdToTHDB
(
thread
);
THDB
*
thdb
=
thread
?
THREAD_IdToTHDB
(
thread
)
:
THREAD_Current
(
);
return
(
HQUEUE16
)(
thdb
?
thdb
->
teb
.
queue
:
0
);
return
(
HQUEUE16
)(
thdb
?
thdb
->
teb
.
queue
:
0
);
}
}
...
@@ -1288,7 +1254,7 @@ HQUEUE16 WINAPI GetThreadQueue( DWORD thread )
...
@@ -1288,7 +1254,7 @@ HQUEUE16 WINAPI GetThreadQueue( DWORD thread )
*/
*/
VOID
WINAPI
SetFastQueue
(
DWORD
thread
,
HANDLE32
hQueue
)
VOID
WINAPI
SetFastQueue
(
DWORD
thread
,
HANDLE32
hQueue
)
{
{
THDB
*
thdb
=
THREAD_IdToTHDB
(
thread
);
THDB
*
thdb
=
thread
?
THREAD_IdToTHDB
(
thread
)
:
THREAD_Current
(
);
if
(
thdb
)
thdb
->
teb
.
queue
=
(
HQUEUE16
)
hQueue
;
if
(
thdb
)
thdb
->
teb
.
queue
=
(
HQUEUE16
)
hQueue
;
}
}
...
@@ -1300,14 +1266,10 @@ HANDLE32 WINAPI GetFastQueue( void )
...
@@ -1300,14 +1266,10 @@ HANDLE32 WINAPI GetFastQueue( void )
THDB
*
thdb
=
THREAD_Current
();
THDB
*
thdb
=
THREAD_Current
();
if
(
!
thdb
)
return
0
;
if
(
!
thdb
)
return
0
;
if
(
!
(
thdb
->
teb
.
queue
))
if
(
!
thdb
->
teb
.
queue
)
{
Callout
.
InitThreadInput
(
0
,
THREAD_IsWin16
(
thdb
)
?
4
:
5
);
HMODULE16
hModule
=
GetModuleHandle16
(
"USER"
);
FARPROC16
proc
=
WIN32_GetProcAddress16
(
hModule
,
"InitThreadInput"
);
Callbacks
->
CallBootAppProc
(
proc
,
0
,
THREAD_IsWin16
(
thdb
)
?
4
:
5
);
/* FIXME! */
}
if
(
!
(
thdb
->
teb
.
queue
)
)
if
(
!
thdb
->
teb
.
queue
)
FIXME
(
task
,
"(): should initialize thread-local queue, expect failure!
\n
"
);
FIXME
(
task
,
"(): should initialize thread-local queue, expect failure!
\n
"
);
return
(
HANDLE32
)
thdb
->
teb
.
queue
;
return
(
HANDLE32
)
thdb
->
teb
.
queue
;
...
...
miscemu/main.c
View file @
ff35e1fb
...
@@ -41,30 +41,26 @@ BOOL32 MAIN_EmulatorInit(void)
...
@@ -41,30 +41,26 @@ BOOL32 MAIN_EmulatorInit(void)
return
TRUE
;
return
TRUE
;
}
}
typedef
BOOL32
(
*
WINAPI
tGetMessage
)(
MSG32
*
lpmsg
,
HWND32
hwnd
,
UINT32
min
,
UINT32
max
);
typedef
BOOL32
(
*
WINAPI
tTranslateMessage
)(
const
MSG32
*
msg
);
typedef
LONG
(
*
WINAPI
tDispatchMessage
)(
const
MSG32
*
msg
);
/***********************************************************************
/***********************************************************************
* Main loop of initial task
* Main loop of initial task
*/
*/
void
MAIN_EmulatorRun
(
void
)
void
MAIN_EmulatorRun
(
void
)
{
{
extern
void
THUNK_InitCallout
(
void
);
char
startProg
[
256
],
defProg
[
256
];
char
startProg
[
256
],
defProg
[
256
];
HINSTANCE32
handle
;
HINSTANCE32
handle
;
int
i
;
int
i
;
MSG32
msg
;
tGetMessage
pGetMessage
;
tTranslateMessage
pTranslateMessage
;
tDispatchMessage
pDispatchMessage
;
HMODULE32
hModule
;
MSG32
msg
;
/* Load system DLLs into the initial process (and initialize them) */
/* Load system DLLs into the initial process (and initialize them) */
if
(
!
LoadLibrary16
(
"GDI.EXE"
)
||
!
LoadLibrary32A
(
"GDI32.DLL"
)
if
(
!
LoadLibrary16
(
"GDI.EXE"
)
||
!
LoadLibrary32A
(
"GDI32.DLL"
)
||
!
LoadLibrary16
(
"USER.EXE"
)
||
!
LoadLibrary32A
(
"USER32.DLL"
))
||
!
LoadLibrary16
(
"USER.EXE"
)
||
!
LoadLibrary32A
(
"USER32.DLL"
))
ExitProcess
(
1
);
ExitProcess
(
1
);
/* Get pointers to USER routines called by KERNEL */
THUNK_InitCallout
();
/* Add the Default Program if no program on the command line */
/* Add the Default Program if no program on the command line */
if
(
!
MAIN_argv
[
1
])
if
(
!
MAIN_argv
[
1
])
{
{
...
@@ -107,19 +103,10 @@ void MAIN_EmulatorRun( void )
...
@@ -107,19 +103,10 @@ void MAIN_EmulatorRun( void )
/* Start message loop for desktop window */
/* Start message loop for desktop window */
hModule
=
GetModuleHandle32A
(
"USER32"
);
while
(
GetNumTasks
()
>
1
&&
Callout
.
GetMessage32A
(
&
msg
,
0
,
0
,
0
)
)
pGetMessage
=
(
tGetMessage
)
GetProcAddress32
(
hModule
,
"GetMessageA"
);
pTranslateMessage
=
(
tTranslateMessage
)
GetProcAddress32
(
hModule
,
"TranslateMessage"
);
pDispatchMessage
=
(
tDispatchMessage
)
GetProcAddress32
(
hModule
,
"DispatchMessageA"
);
assert
(
pGetMessage
);
assert
(
pTranslateMessage
);
assert
(
pDispatchMessage
);
while
(
GetNumTasks
()
>
1
&&
pGetMessage
(
&
msg
,
0
,
0
,
0
)
)
{
{
pTranslateMessage
(
&
msg
);
Callout
.
TranslateMessage32
(
&
msg
);
pDispatchMessage
(
&
msg
);
Callout
.
DispatchMessage32A
(
&
msg
);
}
}
ExitProcess
(
0
);
ExitProcess
(
0
);
...
...
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