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
d286b8a6
Commit
d286b8a6
authored
Jun 01, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use standard TLS functions instead of a TEB internal field to access
per-thread data.
parent
a55450da
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
9 deletions
+14
-9
desktop.c
dlls/x11drv/desktop.c
+4
-4
event.c
dlls/x11drv/event.c
+1
-1
init.c
dlls/x11drv/init.c
+1
-0
x11drv.h
dlls/x11drv/x11drv.h
+2
-2
x11drv_main.c
dlls/x11drv/x11drv_main.c
+6
-2
No files found.
dlls/x11drv/desktop.c
View file @
d286b8a6
...
...
@@ -68,7 +68,7 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
HWND
hwnd
;
Atom
atom
=
x11drv_atom
(
WM_DELETE_WINDOW
);
NtCurrentTeb
()
->
driver_data
=
driver_data
;
TlsSetValue
(
thread_data_tls_index
,
driver_data
)
;
display
=
thread_display
();
hwnd
=
GetDesktopWindow
();
...
...
@@ -94,15 +94,15 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
*/
void
X11DRV_create_desktop_thread
(
void
)
{
HANDLE
handle
=
CreateThread
(
NULL
,
0
,
desktop_thread
,
NtCurrentTeb
()
->
driver_data
,
0
,
&
desktop_tid
);
HANDLE
handle
=
CreateThread
(
NULL
,
0
,
desktop_thread
,
TlsGetValue
(
thread_data_tls_index
),
0
,
&
desktop_tid
);
if
(
!
handle
)
{
MESSAGE
(
"Could not create desktop thread
\n
"
);
ExitProcess
(
1
);
}
/* we transferred our driver data to the new thread */
NtCurrentTeb
()
->
driver_data
=
NULL
;
TlsSetValue
(
thread_data_tls_index
,
NULL
)
;
CloseHandle
(
handle
);
}
...
...
dlls/x11drv/event.c
View file @
d286b8a6
...
...
@@ -276,7 +276,7 @@ DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
{
HANDLE
new_handles
[
MAXIMUM_WAIT_OBJECTS
+
1
];
/* FIXME! */
DWORD
i
,
ret
;
struct
x11drv_thread_data
*
data
=
NtCurrentTeb
()
->
driver_data
;
struct
x11drv_thread_data
*
data
=
TlsGetValue
(
thread_data_tls_index
)
;
if
(
!
data
||
data
->
process_event_count
)
return
WaitForMultipleObjectsEx
(
count
,
handles
,
flags
&
MWMO_WAITALL
,
...
...
dlls/x11drv/init.c
View file @
d286b8a6
...
...
@@ -25,6 +25,7 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "x11drv.h"
#include "x11font.h"
#include "ddrawi.h"
...
...
dlls/x11drv/x11drv.h
View file @
d286b8a6
...
...
@@ -63,7 +63,6 @@ typedef int Status;
#include "wingdi.h"
#include "winuser.h"
#include "ddrawi.h"
#include "thread.h"
#include "wine/list.h"
#define MAX_PIXELFORMATS 8
...
...
@@ -517,10 +516,11 @@ struct x11drv_thread_data
};
extern
struct
x11drv_thread_data
*
x11drv_init_thread_data
(
void
);
extern
DWORD
thread_data_tls_index
;
inline
static
struct
x11drv_thread_data
*
x11drv_thread_data
(
void
)
{
struct
x11drv_thread_data
*
data
=
NtCurrentTeb
()
->
driver_data
;
struct
x11drv_thread_data
*
data
=
TlsGetValue
(
thread_data_tls_index
)
;
if
(
!
data
)
data
=
x11drv_init_thread_data
();
return
data
;
}
...
...
dlls/x11drv/x11drv_main.c
View file @
d286b8a6
...
...
@@ -81,6 +81,7 @@ int client_side_with_render = 1;
int
client_side_antialias_with_core
=
1
;
int
client_side_antialias_with_render
=
1
;
int
using_wine_desktop
=
0
;
DWORD
thread_data_tls_index
=
TLS_OUT_OF_INDEXES
;
static
BOOL
synchronous
;
/* run in synchronous mode? */
static
BOOL
desktop_dbl_buf
=
TRUE
;
...
...
@@ -315,6 +316,8 @@ static BOOL process_attach(void)
setup_options
();
if
((
thread_data_tls_index
=
TlsAlloc
())
==
TLS_OUT_OF_INDEXES
)
return
FALSE
;
/* Open display */
if
(
!
(
display
=
XOpenDisplay
(
NULL
)))
return
FALSE
;
...
...
@@ -393,7 +396,7 @@ static BOOL process_attach(void)
*/
static
void
thread_detach
(
void
)
{
struct
x11drv_thread_data
*
data
=
NtCurrentTeb
()
->
driver_data
;
struct
x11drv_thread_data
*
data
=
TlsGetValue
(
thread_data_tls_index
)
;
if
(
data
)
{
...
...
@@ -427,6 +430,7 @@ static void process_detach(void)
X11DRV_GDI_Finalize
();
DeleteCriticalSection
(
&
X11DRV_CritSection
);
TlsFree
(
thread_data_tls_index
);
}
...
...
@@ -479,7 +483,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
data
->
grab_window
=
None
;
data
->
last_focus
=
0
;
data
->
selection_wnd
=
0
;
NtCurrentTeb
()
->
driver_data
=
data
;
TlsSetValue
(
thread_data_tls_index
,
data
)
;
if
(
desktop_tid
)
AttachThreadInput
(
GetCurrentThreadId
(),
desktop_tid
,
TRUE
);
return
data
;
}
...
...
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