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
2ec34e48
Commit
2ec34e48
authored
Apr 04, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added TASK_GetPtr/TASK_GetCurrent functions to get the TDB for a task
handle.
parent
3e7497f2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
19 deletions
+18
-19
menu.c
controls/menu.c
+1
-1
thunk.c
dlls/kernel/thunk.c
+2
-2
module.c
dlls/winedos/module.c
+1
-1
drive.c
files/drive.c
+5
-5
module.c
loader/ne/module.c
+4
-5
int21.c
msdos/int21.c
+3
-3
thread.c
scheduler/thread.c
+1
-1
winproc.c
windows/winproc.c
+1
-1
No files found.
controls/menu.c
View file @
2ec34e48
...
...
@@ -1602,7 +1602,7 @@ BOOL MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
if
(
hTask
)
{
TDB
*
task
=
(
TDB
*
)
GlobalLock16
(
hTask
);
TDB
*
task
=
TASK_GetPtr
(
hTask
);
if
(
task
)
{
pTPWnd
->
hInstance
=
task
->
hInstance
;
...
...
dlls/kernel/thunk.c
View file @
2ec34e48
...
...
@@ -1518,7 +1518,7 @@ FARPROC THUNK_AllocLSThunklet( SEGPTR target, DWORD relay,
THUNKLET_TYPE_LS
);
if
(
!
thunk
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
owner
);
TDB
*
pTask
=
TASK_GetPtr
(
owner
);
if
(
!
(
thunk
=
HeapAlloc
(
ThunkletHeap
,
0
,
sizeof
(
THUNKLET
)
))
)
return
0
;
...
...
@@ -1551,7 +1551,7 @@ SEGPTR THUNK_AllocSLThunklet( FARPROC target, DWORD relay,
THUNKLET_TYPE_SL
);
if
(
!
thunk
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
owner
);
TDB
*
pTask
=
TASK_GetPtr
(
owner
);
if
(
!
(
thunk
=
HeapAlloc
(
ThunkletHeap
,
0
,
sizeof
(
THUNKLET
)
))
)
return
0
;
...
...
dlls/winedos/module.c
View file @
2ec34e48
...
...
@@ -521,7 +521,7 @@ static void MZ_Launch(void)
{
LPDOSTASK
lpDosTask
=
MZ_Current
();
CONTEXT
context
;
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
BYTE
*
psp_start
=
PTR_REAL_TO_LIN
(
lpDosTask
->
psp_seg
,
0
);
MZ_FillPSP
(
psp_start
,
GetCommandLineA
());
...
...
files/drive.c
View file @
2ec34e48
...
...
@@ -291,7 +291,7 @@ int DRIVE_IsValid( int drive )
*/
int
DRIVE_GetCurrentDrive
(
void
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
if
(
pTask
&&
(
pTask
->
curdrive
&
0x80
))
return
pTask
->
curdrive
&
~
0x80
;
return
DRIVE_CurDrive
;
}
...
...
@@ -302,7 +302,7 @@ int DRIVE_GetCurrentDrive(void)
*/
int
DRIVE_SetCurrentDrive
(
int
drive
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
if
(
!
DRIVE_IsValid
(
drive
))
{
SetLastError
(
ERROR_INVALID_DRIVE
);
...
...
@@ -391,7 +391,7 @@ const char * DRIVE_GetRoot( int drive )
*/
const
char
*
DRIVE_GetDosCwd
(
int
drive
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
if
(
!
DRIVE_IsValid
(
drive
))
return
NULL
;
/* Check if we need to change the directory to the new task. */
...
...
@@ -412,7 +412,7 @@ const char * DRIVE_GetDosCwd( int drive )
*/
const
char
*
DRIVE_GetUnixCwd
(
int
drive
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
if
(
!
DRIVE_IsValid
(
drive
))
return
NULL
;
/* Check if we need to change the directory to the new task. */
...
...
@@ -672,7 +672,7 @@ int DRIVE_Chdir( int drive, const char *path )
char
buffer
[
MAX_PATHNAME_LEN
];
LPSTR
unix_cwd
;
BY_HANDLE_FILE_INFORMATION
info
;
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
strcpy
(
buffer
,
"A:"
);
buffer
[
0
]
+=
drive
;
...
...
loader/ne/module.c
View file @
2ec34e48
...
...
@@ -1002,7 +1002,7 @@ static HINSTANCE16 NE_CreateThread( NE_MODULE *pModule, WORD cmdShow, LPCSTR cmd
CloseHandle
(
hThread
);
return
exit_code
;
}
if
(
!
(
pTask
=
(
TDB
*
)
GlobalLock16
(
hTask
)))
break
;
if
(
!
(
pTask
=
TASK_GetPtr
(
hTask
)))
break
;
instance
=
pTask
->
hInstance
;
GlobalUnlock16
(
hTask
);
}
while
(
!
instance
);
...
...
@@ -1113,7 +1113,7 @@ HINSTANCE16 NE_StartMain( LPCSTR name, HANDLE file )
*/
DWORD
NE_StartTask
(
void
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
NE_MODULE
*
pModule
=
NE_GetPtr
(
pTask
->
hModule
);
HINSTANCE16
hInstance
,
hPrevInstance
;
SEGTABLEENTRY
*
pSegTable
=
NE_SEG_TABLE
(
pModule
);
...
...
@@ -1685,7 +1685,7 @@ HMODULE16 WINAPI MapHModuleLS(HMODULE hmod) {
NE_MODULE
*
pModule
;
if
(
!
hmod
)
return
((
TDB
*
)
GlobalLock16
(
GetCurrentTask
())
)
->
hInstance
;
return
TASK_GetCurrent
(
)
->
hInstance
;
if
(
!
HIWORD
(
hmod
))
return
hmod
;
/* we already have a 16 bit module handle */
pModule
=
(
NE_MODULE
*
)
GlobalLock16
(
hFirstModule
);
...
...
@@ -1704,8 +1704,7 @@ HMODULE WINAPI MapHModuleSL(HMODULE16 hmod) {
NE_MODULE
*
pModule
;
if
(
!
hmod
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
());
TDB
*
pTask
=
TASK_GetCurrent
();
hmod
=
pTask
->
hModule
;
}
pModule
=
(
NE_MODULE
*
)
GlobalLock16
(
hmod
);
...
...
msdos/int21.c
View file @
2ec34e48
...
...
@@ -130,7 +130,7 @@ static BOOL INT21_CreateHeap(void)
static
BYTE
*
GetCurrentDTA
(
CONTEXT86
*
context
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
/* FIXME: This assumes DTA was set correctly! */
return
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
SELECTOROF
(
pTask
->
dta
),
...
...
@@ -1300,7 +1300,7 @@ void WINAPI DOS3Call( CONTEXT86 *context )
case
0x1a
:
/* SET DISK TRANSFER AREA ADDRESS */
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
pTask
->
dta
=
MAKESEGPTR
(
context
->
SegDs
,
DX_reg
(
context
));
TRACE
(
"Set DTA: %08lx
\n
"
,
pTask
->
dta
);
}
...
...
@@ -1352,7 +1352,7 @@ void WINAPI DOS3Call( CONTEXT86 *context )
case
0x2f
:
/* GET DISK TRANSFER AREA ADDRESS */
TRACE
(
"GET DISK TRANSFER AREA ADDRESS
\n
"
);
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
TDB
*
pTask
=
TASK_GetCurrent
(
);
context
->
SegEs
=
SELECTOROF
(
pTask
->
dta
);
BX_reg
(
context
)
=
OFFSETOF
(
pTask
->
dta
);
}
...
...
scheduler/thread.c
View file @
2ec34e48
...
...
@@ -68,7 +68,7 @@ TEB *THREAD_IdToTEB( DWORD id )
/* Allow task handles to be used; convert to main thread */
if
(
IsTask16
(
id
)
)
{
TDB
*
pTask
=
(
TDB
*
)
GlobalLock16
(
id
);
TDB
*
pTask
=
TASK_GetPtr
(
id
);
if
(
pTask
)
return
pTask
->
teb
;
}
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
windows/winproc.c
View file @
2ec34e48
...
...
@@ -1285,7 +1285,7 @@ INT WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT *pmsg32,
message queues.
*/
HTASK16
htask
=
(
HTASK16
)
*
plparam
;
DWORD
idThread
=
(
DWORD
)
((
TDB
*
)
GlobalLock16
(
htask
)
)
->
teb
->
tid
;
DWORD
idThread
=
(
DWORD
)
TASK_GetPtr
(
htask
)
->
teb
->
tid
;
*
plparam
=
(
LPARAM
)
idThread
;
}
return
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