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
09371c75
Commit
09371c75
authored
Oct 05, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Only register the window class once to avoid race conditions.
parent
cd2c4585
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
dinput_main.c
dlls/dinput/dinput_main.c
+15
-10
No files found.
dlls/dinput/dinput_main.c
View file @
09371c75
...
...
@@ -754,20 +754,13 @@ static LRESULT CALLBACK dinput_hook_WndProc(HWND hWnd, UINT message, WPARAM wPar
static
HWND
hook_thread_hwnd
;
static
LONG
hook_thread_refcount
;
static
const
WCHAR
classW
[]
=
{
'H'
,
'o'
,
'o'
,
'k'
,
'_'
,
'L'
,
'L'
,
'_'
,
'C'
,
'L'
,
0
};
static
DWORD
WINAPI
hook_thread_proc
(
void
*
param
)
{
static
const
WCHAR
classW
[]
=
{
'H'
,
'o'
,
'o'
,
'k'
,
'_'
,
'L'
,
'L'
,
'_'
,
'C'
,
'L'
,
0
};
MSG
msg
;
WNDCLASSEXW
wcex
;
HWND
hwnd
;
memset
(
&
wcex
,
0
,
sizeof
(
wcex
));
wcex
.
cbSize
=
sizeof
(
wcex
);
wcex
.
lpfnWndProc
=
dinput_hook_WndProc
;
wcex
.
lpszClassName
=
classW
;
wcex
.
hInstance
=
GetModuleHandleW
(
0
);
if
(
!
RegisterClassExW
(
&
wcex
))
ERR
(
"Error registering window class
\n
"
);
hwnd
=
CreateWindowExW
(
0
,
classW
,
NULL
,
0
,
0
,
0
,
0
,
0
,
HWND_MESSAGE
,
NULL
,
NULL
,
0
);
hook_thread_hwnd
=
hwnd
;
...
...
@@ -783,7 +776,6 @@ static DWORD WINAPI hook_thread_proc(void *param)
}
else
ERR
(
"Error creating message window
\n
"
);
UnregisterClassW
(
wcex
.
lpszClassName
,
wcex
.
hInstance
);
return
0
;
}
...
...
@@ -799,8 +791,21 @@ static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0
static
BOOL
create_hook_thread
(
void
)
{
LONG
ref
;
static
ATOM
class_atom
;
EnterCriticalSection
(
&
dinput_hook_crit
);
if
(
!
class_atom
)
{
WNDCLASSEXW
wcex
;
memset
(
&
wcex
,
0
,
sizeof
(
wcex
));
wcex
.
cbSize
=
sizeof
(
wcex
);
wcex
.
lpfnWndProc
=
dinput_hook_WndProc
;
wcex
.
lpszClassName
=
classW
;
wcex
.
hInstance
=
GetModuleHandleW
(
0
);
if
(
!
(
class_atom
=
RegisterClassExW
(
&
wcex
)))
ERR
(
"Error registering window class
\n
"
);
}
ref
=
++
hook_thread_refcount
;
TRACE
(
"Refcount %ld
\n
"
,
ref
);
if
(
ref
==
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