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
c10087c1
Commit
c10087c1
authored
Jul 22, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jul 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Add basic DirectPlay8ThreadPool implementation.
parent
aa0188cd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
158 additions
and
1 deletion
+158
-1
Makefile.in
dlls/dpnet/Makefile.in
+2
-1
dpnet_main.c
dlls/dpnet/dpnet_main.c
+1
-0
dpnet_private.h
dlls/dpnet/dpnet_private.h
+12
-0
threadpool.c
dlls/dpnet/threadpool.c
+143
-0
No files found.
dlls/dpnet/Makefile.in
View file @
c10087c1
...
...
@@ -13,7 +13,8 @@ C_SRCS = \
lobbiedapp.c
\
peer.c
\
regsvr.c
\
server.c
server.c
\
threadpool.c
RC_SRCS
=
version.rc
...
...
dlls/dpnet/dpnet_main.c
View file @
c10087c1
...
...
@@ -115,6 +115,7 @@ static IClassFactoryImpl DPNET_CFS[] = {
{
&
DICF_Vtbl
,
1
,
&
CLSID_DirectPlay8Peer
,
DPNET_CreateDirectPlay8Peer
},
{
&
DICF_Vtbl
,
1
,
&
CLSID_DirectPlay8Address
,
DPNET_CreateDirectPlay8Address
},
{
&
DICF_Vtbl
,
1
,
&
CLSID_DirectPlay8LobbiedApplication
,
(
void
*
)
DPNET_CreateDirectPlay8LobbiedApp
},
{
&
DICF_Vtbl
,
1
,
&
CLSID_DirectPlay8ThreadPool
,
DPNET_CreateDirectPlay8ThreadPool
},
{
NULL
,
0
,
NULL
,
NULL
}
};
...
...
dlls/dpnet/dpnet_private.h
View file @
c10087c1
...
...
@@ -35,6 +35,7 @@
typedef
struct
IDirectPlay8ClientImpl
IDirectPlay8ClientImpl
;
typedef
struct
IDirectPlay8AddressImpl
IDirectPlay8AddressImpl
;
typedef
struct
IDirectPlay8LobbiedApplicationImpl
IDirectPlay8LobbiedApplicationImpl
;
typedef
struct
IDirectPlay8ThreadPoolImpl
IDirectPlay8ThreadPoolImpl
;
/* ------------------ */
/* IDirectPlay8Client */
...
...
@@ -79,6 +80,16 @@ struct IDirectPlay8LobbiedApplicationImpl
/* IDirectPlay8LobbiedApplication fields */
};
/*****************************************************************************
* IDirectPlay8ThreadPool implementation structure
*/
struct
IDirectPlay8ThreadPoolImpl
{
/* IUnknown fields */
const
IDirectPlay8ThreadPoolVtbl
*
lpVtbl
;
LONG
ref
;
};
/**
* factories
*/
...
...
@@ -87,6 +98,7 @@ extern HRESULT DPNET_CreateDirectPlay8Server(LPCLASSFACTORY iface, LPUNKNOWN pun
extern
HRESULT
DPNET_CreateDirectPlay8Peer
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
);
extern
HRESULT
DPNET_CreateDirectPlay8Address
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
);
extern
HRESULT
DPNET_CreateDirectPlay8LobbiedApp
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
);
extern
HRESULT
DPNET_CreateDirectPlay8ThreadPool
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
);
/**
* debug
...
...
dlls/dpnet/threadpool.c
0 → 100644
View file @
c10087c1
/*
* DirectPlay8 ThreadPool
*
* Copyright 2004 Raphael Junqueira
* Copyright 2008 Alexander N. Srnes <alex@thehandofagony.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "wine/debug.h"
#include "dplay8.h"
#include "dpnet_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dpnet
);
/* IUnknown interface follows */
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_QueryInterface
(
PDIRECTPLAY8THREADPOOL
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectPlay8ThreadPoolImpl
*
This
=
(
IDirectPlay8ThreadPoolImpl
*
)
iface
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectPlay8ThreadPool
))
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
This
;
return
DPN_OK
;
}
WARN
(
"(%p)->(%s,%p): not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirectPlay8ThreadPoolImpl_AddRef
(
PDIRECTPLAY8THREADPOOL
iface
)
{
IDirectPlay8ThreadPoolImpl
*
This
=
(
IDirectPlay8ThreadPoolImpl
*
)
iface
;
ULONG
RefCount
=
InterlockedIncrement
(
&
This
->
ref
);
return
RefCount
;
}
static
ULONG
WINAPI
IDirectPlay8ThreadPoolImpl_Release
(
PDIRECTPLAY8THREADPOOL
iface
)
{
IDirectPlay8ThreadPoolImpl
*
This
=
(
IDirectPlay8ThreadPoolImpl
*
)
This
;
ULONG
RefCount
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
RefCount
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
RefCount
;
}
/* IDirectPlay8ThreadPool interface follows */
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_Initialize
(
PDIRECTPLAY8THREADPOOL
iface
,
PVOID
CONST
pvUserContext
,
CONST
PFNDPNMESSAGEHANDLER
pfn
,
CONST
DWORD
dwFlags
)
{
FIXME
(
"(%p)->(%p,%p,%x): stub
\n
"
,
iface
,
pvUserContext
,
pfn
,
dwFlags
);
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_Close
(
PDIRECTPLAY8THREADPOOL
iface
,
CONST
DWORD
dwFlags
)
{
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_GetThreadCount
(
PDIRECTPLAY8THREADPOOL
iface
,
CONST
DWORD
dwProcessorNum
,
DWORD
*
CONST
pdwNumThreads
,
CONST
DWORD
dwFlags
)
{
FIXME
(
"(%p)->(%x,%p,%x): stub
\n
"
,
iface
,
dwProcessorNum
,
pdwNumThreads
,
dwFlags
);
*
pdwNumThreads
=
0
;
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_SetThreadCount
(
PDIRECTPLAY8THREADPOOL
iface
,
CONST
DWORD
dwProcessorNum
,
CONST
DWORD
dwNumThreads
,
CONST
DWORD
dwFlags
)
{
FIXME
(
"(%p)->(%x,%x,%x): stub
\n
"
,
iface
,
dwProcessorNum
,
dwNumThreads
,
dwFlags
);
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8ThreadPoolImpl_DoWork
(
PDIRECTPLAY8THREADPOOL
iface
,
CONST
DWORD
dwAllowedTimeSlice
,
CONST
DWORD
dwFlags
)
{
static
BOOL
Run
=
FALSE
;
if
(
!
Run
)
FIXME
(
"(%p)->(%x,%x): stub
\n
"
,
iface
,
dwAllowedTimeSlice
,
dwFlags
);
Run
=
TRUE
;
return
DPN_OK
;
}
static
const
IDirectPlay8ThreadPoolVtbl
DirectPlay8ThreadPool_Vtbl
=
{
IDirectPlay8ThreadPoolImpl_QueryInterface
,
IDirectPlay8ThreadPoolImpl_AddRef
,
IDirectPlay8ThreadPoolImpl_Release
,
IDirectPlay8ThreadPoolImpl_Initialize
,
IDirectPlay8ThreadPoolImpl_Close
,
IDirectPlay8ThreadPoolImpl_GetThreadCount
,
IDirectPlay8ThreadPoolImpl_SetThreadCount
,
IDirectPlay8ThreadPoolImpl_DoWork
};
HRESULT
DPNET_CreateDirectPlay8ThreadPool
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectPlay8ThreadPoolImpl
*
Client
;
Client
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectPlay8ThreadPoolImpl
));
if
(
Client
==
NULL
)
{
*
ppobj
=
NULL
;
WARN
(
"Not enough memory
\n
"
);
return
E_OUTOFMEMORY
;
}
Client
->
lpVtbl
=
&
DirectPlay8ThreadPool_Vtbl
;
Client
->
ref
=
0
;
return
IDirectPlay8ThreadPoolImpl_QueryInterface
((
PDIRECTPLAY8THREADPOOL
)
Client
,
riid
,
ppobj
);
}
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