[PATCH 1/3] dpnet: Correctly initialize the DPN_SP_CAPS structure

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Nov 2 04:13:24 CDT 2016


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/dpnet/peer.c         | 1 +
 dlls/dpnet/tests/client.c | 1 +
 dlls/dpnet/tests/peer.c   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c
index 886921b..17d6c6f 100644
--- a/dlls/dpnet/peer.c
+++ b/dlls/dpnet/peer.c
@@ -595,6 +595,7 @@ static const IDirectPlay8PeerVtbl DirectPlay8Peer_Vtbl =
 
 void init_dpn_sp_caps(DPN_SP_CAPS *dpnspcaps)
 {
+    dpnspcaps->dwSize = sizeof(DPN_SP_CAPS);
     dpnspcaps->dwFlags = DPNSPCAPS_SUPPORTSDPNSRV | DPNSPCAPS_SUPPORTSBROADCAST |
                          DPNSPCAPS_SUPPORTSALLADAPTERS | DPNSPCAPS_SUPPORTSTHREADPOOL;
     dpnspcaps->dwNumThreads = 3;
diff --git a/dlls/dpnet/tests/client.c b/dlls/dpnet/tests/client.c
index 6732034..cfa7e10 100644
--- a/dlls/dpnet/tests/client.c
+++ b/dlls/dpnet/tests/client.c
@@ -197,6 +197,7 @@ static void test_get_sp_caps(void)
     hr = IDirectPlay8Client_GetSPCaps(client, &CLSID_DP8SP_TCPIP, &caps, 0);
     ok(hr == DPN_OK, "GetSPCaps failed with %x\n", hr);
 
+    ok(caps.dwSize == sizeof(DPN_SP_CAPS), "got %d\n", caps.dwSize);
     ok((caps.dwFlags &
         (DPNSPCAPS_SUPPORTSDPNSRV | DPNSPCAPS_SUPPORTSBROADCAST | DPNSPCAPS_SUPPORTSALLADAPTERS)) ==
        (DPNSPCAPS_SUPPORTSDPNSRV | DPNSPCAPS_SUPPORTSBROADCAST | DPNSPCAPS_SUPPORTSALLADAPTERS),
diff --git a/dlls/dpnet/tests/peer.c b/dlls/dpnet/tests/peer.c
index f6c413f..9d06c80 100644
--- a/dlls/dpnet/tests/peer.c
+++ b/dlls/dpnet/tests/peer.c
@@ -198,6 +198,7 @@ static void test_get_sp_caps(void)
     hr = IDirectPlay8Peer_GetSPCaps(peer, &CLSID_DP8SP_TCPIP, &caps, 0);
     ok(hr == DPN_OK, "GetSPCaps failed with %x\n", hr);
 
+    ok(caps.dwSize == sizeof(DPN_SP_CAPS), "got %d\n", caps.dwSize);
     ok((caps.dwFlags &
         (DPNSPCAPS_SUPPORTSDPNSRV | DPNSPCAPS_SUPPORTSBROADCAST | DPNSPCAPS_SUPPORTSALLADAPTERS)) ==
        (DPNSPCAPS_SUPPORTSDPNSRV | DPNSPCAPS_SUPPORTSBROADCAST | DPNSPCAPS_SUPPORTSALLADAPTERS),
-- 
1.9.1




More information about the wine-patches mailing list