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
9b683294
Commit
9b683294
authored
Jan 17, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Feb 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Cleanup IDirectPlay8Client.
parent
ff7ebba2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
client.c
dlls/dpnet/client.c
+30
-20
No files found.
dlls/dpnet/client.c
View file @
9b683294
...
...
@@ -61,24 +61,24 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_QueryInterface(IDirectPlay8Client *
static
ULONG
WINAPI
IDirectPlay8ClientImpl_AddRef
(
IDirectPlay8Client
*
iface
)
{
IDirectPlay8ClientImpl
*
This
=
impl_from_IDirectPlay8Client
(
iface
);
ULONG
ref
Count
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)
->(ref before=%u)
\n
"
,
This
,
refCount
-
1
);
TRACE
(
"(%p)
ref=%u
\n
"
,
This
,
ref
);
return
ref
Count
;
return
ref
;
}
static
ULONG
WINAPI
IDirectPlay8ClientImpl_Release
(
IDirectPlay8Client
*
iface
)
{
IDirectPlay8ClientImpl
*
This
=
impl_from_IDirectPlay8Client
(
iface
);
ULONG
ref
Count
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)
->(ref before=%u)
\n
"
,
This
,
refCount
+
1
);
TRACE
(
"(%p)
ref=%u
\n
"
,
This
,
ref
);
if
(
!
ref
Count
)
{
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
Count
;
return
ref
;
}
/* IDirectPlay8Client Interface follow: */
...
...
@@ -273,17 +273,27 @@ static const IDirectPlay8ClientVtbl DirectPlay8Client_Vtbl =
IDirectPlay8ClientImpl_RegisterLobby
};
HRESULT
DPNET_CreateDirectPlay8Client
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectPlay8ClientImpl
*
client
;
TRACE
(
"(%p, %s, %p)
\n
"
,
punkOuter
,
debugstr_guid
(
riid
),
ppobj
);
client
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectPlay8ClientImpl
));
if
(
NULL
==
client
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
client
->
IDirectPlay8Client_iface
.
lpVtbl
=
&
DirectPlay8Client_Vtbl
;
client
->
ref
=
0
;
/* will be inited with QueryInterface */
return
IDirectPlay8ClientImpl_QueryInterface
(
&
client
->
IDirectPlay8Client_iface
,
riid
,
ppobj
);
HRESULT
DPNET_CreateDirectPlay8Client
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
)
{
IDirectPlay8ClientImpl
*
client
;
HRESULT
hr
;
TRACE
(
"(%p, %s, %p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
client
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectPlay8ClientImpl
));
if
(
!
client
)
return
E_OUTOFMEMORY
;
client
->
IDirectPlay8Client_iface
.
lpVtbl
=
&
DirectPlay8Client_Vtbl
;
client
->
ref
=
1
;
hr
=
IDirectPlay8ClientImpl_QueryInterface
(
&
client
->
IDirectPlay8Client_iface
,
riid
,
ppv
);
IDirectPlay8ClientImpl_Release
(
&
client
->
IDirectPlay8Client_iface
);
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