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
70ae1ba4
Commit
70ae1ba4
authored
Oct 14, 2009
by
Markus Stockhausen
Committed by
Alexandre Julliard
Oct 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8: Ensure balance of CoInitialize/CoUninitialize.
parent
8643bae3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dinput8_main.c
dlls/dinput8/dinput8_main.c
+4
-2
No files found.
dlls/dinput8/dinput8_main.c
View file @
70ae1ba4
...
...
@@ -51,7 +51,7 @@ static void UnlockModule(void)
* DirectInput8Create (DINPUT8.@)
*/
HRESULT
WINAPI
DECLSPEC_HOTPATCH
DirectInput8Create
(
HINSTANCE
hinst
,
DWORD
dwVersion
,
REFIID
riid
,
LPVOID
*
ppDI
,
LPUNKNOWN
punkOuter
)
{
HRESULT
hr
;
HRESULT
hr
,
hrCo
;
TRACE
(
"hInst (%p), dwVersion: %d, riid (%s), punkOuter (%p))
\n
"
,
hinst
,
dwVersion
,
debugstr_guid
(
riid
),
punkOuter
);
...
...
@@ -62,7 +62,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst, DWORD dwVer
if
(
!
(
IsEqualGUID
(
&
IID_IDirectInput8A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput8W
,
riid
)
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
)
return
DIERR_INVALIDPARAM
;
CoInitialize
(
NULL
);
hrCo
=
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DirectInput8
,
punkOuter
,
CLSCTX_INPROC_SERVER
,
riid
,
ppDI
);
if
(
FAILED
(
hr
))
{
...
...
@@ -70,6 +70,8 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst, DWORD dwVer
return
DIERR_INVALIDPARAM
;
}
/* ensure balance of calls */
if
(
hrCo
==
S_OK
||
hrCo
==
S_FALSE
)
CoUninitialize
();
/* When aggregation is used (punkOuter!=NULL) the application needs to manually call Initialize. */
...
...
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