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
95ede766
Commit
95ede766
authored
Oct 11, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gameux: Parse GDFs in a separate thread.
The res protocol handler dislikes running from a multithreaded apartment.
parent
5bd304bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
3 deletions
+40
-3
gameexplorer.c
dlls/gameux/gameexplorer.c
+40
-3
No files found.
dlls/gameux/gameexplorer.c
View file @
95ede766
...
...
@@ -387,6 +387,13 @@ static HRESULT GAMEUX_ParseGameDefinition(
return
hr
;
}
struct
parse_gdf_thread_param
{
struct
GAMEUX_GAME_DATA
*
GameData
;
HRESULT
hr
;
};
/*******************************************************************************
* GAMEUX_ParseGDFBinary
*
...
...
@@ -399,8 +406,10 @@ static HRESULT GAMEUX_ParseGameDefinition(
* GDF will be stored in other fields of this
* structure.
*/
static
HRESULT
GAMEUX_ParseGDFBinary
(
struct
GAMEUX_GAME_DATA
*
GameData
)
static
DWORD
WINAPI
GAMEUX_ParseGDFBinary
(
void
*
thread_param
)
{
struct
parse_gdf_thread_param
*
ctx
=
thread_param
;
struct
GAMEUX_GAME_DATA
*
GameData
=
ctx
->
GameData
;
static
const
WCHAR
sRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
sDATA
[]
=
{
'D'
,
'A'
,
'T'
,
'A'
,
0
};
static
const
WCHAR
sSlash
[]
=
{
'/'
,
0
};
...
...
@@ -423,6 +432,8 @@ static HRESULT GAMEUX_ParseGDFBinary(struct GAMEUX_GAME_DATA *GameData)
lstrcatW
(
sResourcePath
,
sSlash
);
lstrcatW
(
sResourcePath
,
ID_GDF_XML_STR
);
CoInitialize
(
NULL
);
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
void
**
)
&
document
);
...
...
@@ -474,8 +485,11 @@ static HRESULT GAMEUX_ParseGDFBinary(struct GAMEUX_GAME_DATA *GameData)
IXMLDOMDocument_Release
(
document
);
}
return
hr
;
CoUninitialize
();
ctx
->
hr
=
hr
;
return
0
;
}
/*******************************************************************
* GAMEUX_RemoveRegistryRecord
*
...
...
@@ -548,12 +562,35 @@ static HRESULT GAMEUX_RegisterGame(LPCWSTR sGDFBinaryPath,
/* load data from GDF binary */
if
(
SUCCEEDED
(
hr
))
hr
=
GAMEUX_ParseGDFBinary
(
&
GameData
);
{
struct
parse_gdf_thread_param
thread_param
;
HANDLE
thread
;
HRESULT
hr
;
DWORD
ret
;
thread_param
.
GameData
=
&
GameData
;
if
(
!
(
thread
=
CreateThread
(
NULL
,
0
,
GAMEUX_ParseGDFBinary
,
&
thread_param
,
0
,
&
ret
)))
{
ERR
(
"Failed to create thread.
\n
"
);
hr
=
E_FAIL
;
goto
done
;
}
ret
=
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
thread
);
if
(
ret
!=
WAIT_OBJECT_0
)
{
ERR
(
"Wait failed (%#x).
\n
"
,
ret
);
hr
=
E_FAIL
;
goto
done
;
}
hr
=
thread_param
.
hr
;
}
/* save data to registry */
if
(
SUCCEEDED
(
hr
))
hr
=
GAMEUX_WriteRegistryRecord
(
&
GameData
);
done:
GAMEUX_uninitGameData
(
&
GameData
);
TRACE
(
"returning 0x%08x
\n
"
,
hr
);
return
hr
;
...
...
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