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
526851f5
Commit
526851f5
authored
Mar 29, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Move the lock into the DirectPlay object.
parent
878ea7d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
41 deletions
+10
-41
dplay.c
dlls/dplayx/dplay.c
+5
-31
dplay_global.h
dlls/dplayx/dplay_global.h
+1
-6
dplayx_messages.c
dlls/dplayx/dplayx_messages.c
+4
-4
No files found.
dlls/dplayx/dplay.c
View file @
526851f5
...
...
@@ -227,33 +227,6 @@ static inline IDirectPlayImpl *impl_from_IDirectPlay4( IDirectPlay4 *iface )
return
CONTAINING_RECORD
(
iface
,
IDirectPlayImpl
,
IDirectPlay4_iface
);
}
static
BOOL
DP_CreateIUnknown
(
LPVOID
lpDP
)
{
IDirectPlay2AImpl
*
This
=
lpDP
;
This
->
unk
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
(
This
->
unk
)
)
);
if
(
This
->
unk
==
NULL
)
{
return
FALSE
;
}
InitializeCriticalSection
(
&
This
->
unk
->
DP_lock
);
This
->
unk
->
DP_lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IDirectPlay2AImpl*->DirectPlayIUnknownData*->DP_lock"
);
return
TRUE
;
}
static
BOOL
DP_DestroyIUnknown
(
LPVOID
lpDP
)
{
IDirectPlay2AImpl
*
This
=
lpDP
;
This
->
unk
->
DP_lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
unk
->
DP_lock
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
unk
);
return
TRUE
;
}
static
BOOL
DP_CreateDirectPlay2
(
LPVOID
lpDP
)
{
IDirectPlay2AImpl
*
This
=
lpDP
;
...
...
@@ -418,8 +391,10 @@ HRESULT DP_CreateInterface
}
/* Initialize it */
if
(
DP_Create
IUnknown
(
This
)
&&
DP_Create
DirectPlay2
(
This
)
)
if
(
DP_CreateDirectPlay2
(
This
)
)
{
InitializeCriticalSection
(
&
This
->
lock
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IDirectPlayImpl.lock"
);
IDirectPlayX_AddRef
(
(
LPDIRECTPLAY2A
)
*
ppvObj
);
return
S_OK
;
...
...
@@ -427,8 +402,6 @@ HRESULT DP_CreateInterface
/* Initialize failed, destroy it */
DP_DestroyDirectPlay2
(
This
);
DP_DestroyIUnknown
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppvObj
=
NULL
;
...
...
@@ -483,7 +456,8 @@ static ULONG WINAPI DP_Release( IDirectPlayImpl *This )
/* If we're destroying the object, this must be the last ref
of the last interface */
DP_DestroyDirectPlay2
(
This
);
DP_DestroyIUnknown
(
This
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/dplayx/dplay_global.h
View file @
526851f5
...
...
@@ -31,11 +31,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
LPCVOID
lpAddress
,
DWORD
dwAddressSize
,
LPVOID
lpContext
)
DECLSPEC_HIDDEN
;
typedef
struct
tagDirectPlayIUnknownData
{
CRITICAL_SECTION
DP_lock
;
}
DirectPlayIUnknownData
;
typedef
struct
tagEnumSessionAsyncCallbackData
{
LPSPINITDATA
lpSpData
;
...
...
@@ -190,7 +185,7 @@ typedef struct IDirectPlayImpl
IDirectPlay4A
IDirectPlay4A_iface
;
IDirectPlay4
IDirectPlay4_iface
;
LONG
ulInterfaceRef
;
DirectPlayIUnknownData
*
un
k
;
CRITICAL_SECTION
loc
k
;
DirectPlay2Data
*
dp2
;
}
IDirectPlayImpl
;
...
...
dlls/dplayx/dplayx_messages.c
View file @
526851f5
...
...
@@ -171,9 +171,9 @@ HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
lpReplyStructList
->
replyExpected
.
dwMsgBodySize
=
0
;
/* Insert into the message queue while locked */
EnterCriticalSection
(
&
This
->
unk
->
DP_
lock
);
EnterCriticalSection
(
&
This
->
lock
);
DPQ_INSERT
(
This
->
dp2
->
repliesExpected
,
lpReplyStructList
,
repliesExpected
);
LeaveCriticalSection
(
&
This
->
unk
->
DP_
lock
);
LeaveCriticalSection
(
&
This
->
lock
);
return
lpReplyStructList
->
replyExpected
.
hReceipt
;
}
...
...
@@ -432,10 +432,10 @@ void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
/* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to
* avoid problems.
*/
EnterCriticalSection
(
&
This
->
unk
->
DP_
lock
);
EnterCriticalSection
(
&
This
->
lock
);
DPQ_REMOVE_ENTRY
(
This
->
dp2
->
repliesExpected
,
repliesExpected
,
replyExpected
.
wExpectedReply
,
==
,
wCommandId
,
lpReplyList
);
LeaveCriticalSection
(
&
This
->
unk
->
DP_
lock
);
LeaveCriticalSection
(
&
This
->
lock
);
if
(
lpReplyList
!=
NULL
)
{
...
...
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