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
c7690c70
Commit
c7690c70
authored
Apr 15, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netprofm: Add a stub implementation of INetworkCostManager.
parent
06fd202a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
0 deletions
+147
-0
list.c
dlls/netprofm/list.c
+72
-0
list.c
dlls/netprofm/tests/list.c
+18
-0
netlistmgr.idl
include/netlistmgr.idl
+57
-0
No files found.
dlls/netprofm/list.c
View file @
c7690c70
...
...
@@ -33,9 +33,76 @@ WINE_DEFAULT_DEBUG_CHANNEL(netprofm);
struct
list_manager
{
INetworkListManager
INetworkListManager_iface
;
INetworkCostManager
INetworkCostManager_iface
;
LONG
refs
;
};
static
inline
struct
list_manager
*
impl_from_INetworkCostManager
(
INetworkCostManager
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
list_manager
,
INetworkCostManager_iface
);
}
static
HRESULT
WINAPI
cost_manager_QueryInterface
(
INetworkCostManager
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
list_manager
*
mgr
=
impl_from_INetworkCostManager
(
iface
);
return
INetworkListManager_QueryInterface
(
&
mgr
->
INetworkListManager_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
cost_manager_AddRef
(
INetworkCostManager
*
iface
)
{
struct
list_manager
*
mgr
=
impl_from_INetworkCostManager
(
iface
);
return
INetworkListManager_AddRef
(
&
mgr
->
INetworkListManager_iface
);
}
static
ULONG
WINAPI
cost_manager_Release
(
INetworkCostManager
*
iface
)
{
struct
list_manager
*
mgr
=
impl_from_INetworkCostManager
(
iface
);
return
INetworkListManager_Release
(
&
mgr
->
INetworkListManager_iface
);
}
static
HRESULT
WINAPI
cost_manager_GetCost
(
INetworkCostManager
*
iface
,
DWORD
*
pCost
,
NLM_SOCKADDR
*
pDestIPAddr
)
{
FIXME
(
"%p, %p, %p
\n
"
,
iface
,
pCost
,
pDestIPAddr
);
if
(
!
pCost
)
return
E_POINTER
;
*
pCost
=
NLM_CONNECTION_COST_UNRESTRICTED
;
return
S_OK
;
}
static
HRESULT
WINAPI
cost_manager_GetDataPlanStatus
(
INetworkCostManager
*
iface
,
NLM_DATAPLAN_STATUS
*
pDataPlanStatus
,
NLM_SOCKADDR
*
pDestIPAddr
)
{
FIXME
(
"%p, %p, %p
\n
"
,
iface
,
pDataPlanStatus
,
pDestIPAddr
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
cost_manager_SetDestinationAddresses
(
INetworkCostManager
*
iface
,
UINT32
length
,
NLM_SOCKADDR
*
pDestIPAddrList
,
VARIANT_BOOL
bAppend
)
{
FIXME
(
"%p, %u, %p, %x
\n
"
,
iface
,
length
,
pDestIPAddrList
,
bAppend
);
return
E_NOTIMPL
;
}
static
const
INetworkCostManagerVtbl
cost_manager_vtbl
=
{
cost_manager_QueryInterface
,
cost_manager_AddRef
,
cost_manager_Release
,
cost_manager_GetCost
,
cost_manager_GetDataPlanStatus
,
cost_manager_SetDestinationAddresses
};
static
inline
struct
list_manager
*
impl_from_INetworkListManager
(
INetworkListManager
*
iface
)
{
...
...
@@ -76,6 +143,10 @@ static HRESULT WINAPI list_manager_QueryInterface(
{
*
obj
=
iface
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_INetworkCostManager
))
{
*
obj
=
&
mgr
->
INetworkCostManager_iface
;
}
else
{
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
)
);
...
...
@@ -222,6 +293,7 @@ HRESULT list_manager_create( void **obj )
if
(
!
(
mgr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
mgr
)
)))
return
E_OUTOFMEMORY
;
mgr
->
INetworkListManager_iface
.
lpVtbl
=
&
list_manager_vtbl
;
mgr
->
INetworkCostManager_iface
.
lpVtbl
=
&
cost_manager_vtbl
;
mgr
->
refs
=
1
;
*
obj
=
&
mgr
->
INetworkListManager_iface
;
...
...
dlls/netprofm/tests/list.c
View file @
c7690c70
...
...
@@ -27,6 +27,7 @@
static
void
test_INetworkListManager
(
void
)
{
INetworkListManager
*
mgr
;
INetworkCostManager
*
cost_mgr
;
NLM_CONNECTIVITY
connectivity
;
VARIANT_BOOL
connected
;
HRESULT
hr
;
...
...
@@ -55,6 +56,23 @@ static void test_INetworkListManager( void )
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
connected
==
VARIANT_TRUE
||
connected
==
VARIANT_FALSE
,
"expected boolean value
\n
"
);
INetworkListManager_QueryInterface
(
mgr
,
&
IID_INetworkCostManager
,
(
void
**
)
&
cost_mgr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
DWORD
cost
;
hr
=
INetworkCostManager_GetCost
(
cost_mgr
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
cost
=
0xdeadbeef
;
hr
=
INetworkCostManager_GetCost
(
cost_mgr
,
&
cost
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cost
!=
0xdeadbeef
,
"cost not set
\n
"
);
INetworkCostManager_Release
(
cost_mgr
);
}
INetworkListManager_Release
(
mgr
);
}
...
...
include/netlistmgr.idl
View file @
c7690c70
...
...
@@ -27,6 +27,7 @@ interface IEnumNetworks;
interface
IEnumNetworkConnections
;
interface
INetwork
;
interface
INetworkConnection
;
interface
INetworkCostManager
;
interface
INetworkListManager
;
typedef
[
v1_enum
]
enum
NLM_CONNECTIVITY
...
...
@@ -49,6 +50,62 @@ typedef [v1_enum] enum NLM_ENUM_NETWORK
NLM_ENUM_NETWORK_ALL
=
0
x03
}
NLM_ENUM_NETWORK
;
typedef
[
v1_enum
]
enum
NLM_CONNECTION_COST
{
NLM_CONNECTION_COST_UNKNOWN
=
0
x0
,
NLM_CONNECTION_COST_UNRESTRICTED
=
0
x1
,
NLM_CONNECTION_COST_FIXED
=
0
x2
,
NLM_CONNECTION_COST_VARIABLE
=
0
x4
,
NLM_CONNECTION_COST_OVERDATALIMIT
=
0
x10000
,
NLM_CONNECTION_COST_CONGESTED
=
0
x20000
,
NLM_CONNECTION_COST_ROAMING
=
0
x40000
,
NLM_CONNECTION_COST_APPROACHINGDATALIMIT
=
0
x80000
}
NLM_CONNECTION_COST
;
typedef
struct
NLM_SOCKADDR
{
BYTE
data
[
128
]
;
}
NLM_SOCKADDR
;
typedef
struct
NLM_USAGE_DATA
{
DWORD
UsageInMegabytes
;
FILETIME
LastSyncTime
;
}
NLM_USAGE_DATA
;
typedef
struct
NLM_DATAPLAN_STATUS
{
GUID
InterfaceGuid
;
NLM_USAGE_DATA
UsageData
;
DWORD
DataLimitInMegabytes
;
DWORD
InboundBandwidthInKbps
;
DWORD
OutboundBandwidthInKbps
;
FILETIME
NextBillingCycle
;
DWORD
MaxTransferSizeInMegabytes
;
DWORD
Reserved
;
}
NLM_DATAPLAN_STATUS
;
[
object
,
pointer_default
(
unique
),
uuid
(
dcb00008
-
570
f
-
4
a9b
-
8
d69
-
199
fdba5723b
)
]
interface
INetworkCostManager
:
IUnknown
{
HRESULT
GetCost
(
[
out
]
DWORD
*
pCost
,
[
in
,
unique
]
NLM_SOCKADDR
*
pDestIPAddr
)
;
HRESULT
GetDataPlanStatus
(
[
out
]
NLM_DATAPLAN_STATUS
*
pDataPlanStatus
,
[
in
,
unique
]
NLM_SOCKADDR
*
pDestIPAddr
)
;
HRESULT
SetDestinationAddresses
(
[
in
]
UINT32
length
,
[
in
,
unique
,
size_is
(
length
)
]
NLM_SOCKADDR
*
pDestIPAddrList
,
[
in
]
VARIANT_BOOL
bAppend
)
;
}
[
dual
,
object
,
...
...
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