wsdapi: Implement IWSDUdpAddress_Get/SetMessageType.

Signed-off-by: Owen Rudge <orudge@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Owen Rudge 2017-06-28 22:13:21 +01:00 committed by Alexandre Julliard
parent 52ad4d0e66
commit b724f0b2e3
2 changed files with 25 additions and 11 deletions

View File

@ -38,6 +38,7 @@ typedef struct IWSDUdpAddressImpl {
WCHAR ipv4Address[25];
WCHAR ipv6Address[64];
WORD port;
WSDUdpMessageType messageType;
} IWSDUdpAddressImpl;
static inline IWSDUdpAddressImpl *impl_from_IWSDUdpAddress(IWSDUdpAddress *iface)
@ -247,14 +248,27 @@ static HRESULT WINAPI IWSDUdpAddressImpl_GetExclusive(IWSDUdpAddress *This)
static HRESULT WINAPI IWSDUdpAddressImpl_SetMessageType(IWSDUdpAddress *This, WSDUdpMessageType messageType)
{
FIXME("(%p, %d)\n", This, messageType);
return E_NOTIMPL;
IWSDUdpAddressImpl *impl = impl_from_IWSDUdpAddress(This);
TRACE("(%p, %d)\n", This, messageType);
impl->messageType = messageType;
return S_OK;
}
static HRESULT WINAPI IWSDUdpAddressImpl_GetMessageType(IWSDUdpAddress *This, WSDUdpMessageType *pMessageType)
{
FIXME("(%p, %p)\n", This, pMessageType);
return E_NOTIMPL;
IWSDUdpAddressImpl *impl = impl_from_IWSDUdpAddress(This);
TRACE("(%p, %p)\n", This, pMessageType);
if (pMessageType == NULL)
{
return E_POINTER;
}
*pMessageType = impl->messageType;
return S_OK;
}
static HRESULT WINAPI IWSDUdpAddressImpl_SetTTL(IWSDUdpAddress *This, DWORD dwTTL)

View File

@ -210,26 +210,26 @@ static void GetSetMessageType_udp_tests(void)
ok(udpAddress != NULL, "WSDCreateUdpAddress(NULL, &udpAddress) failed: udpAddress == NULL\n");
rc = IWSDUdpAddress_GetMessageType(udpAddress, NULL);
todo_wine ok(rc == E_POINTER, "GetMessageType returned unexpected result: %08x\n", rc);
ok(rc == E_POINTER, "GetMessageType returned unexpected result: %08x\n", rc);
rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
ok(actualMessageType == 0, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
/* Try setting a message type */
rc = IWSDUdpAddress_SetMessageType(udpAddress, expectedMessageType1);
todo_wine ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
todo_wine ok(actualMessageType == expectedMessageType1, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
ok(actualMessageType == expectedMessageType1, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
/* Set another one */
rc = IWSDUdpAddress_SetMessageType(udpAddress, expectedMessageType2);
todo_wine ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
ok(rc == S_OK, "SetMessageType returned unexpected result: %08x\n", rc);
rc = IWSDUdpAddress_GetMessageType(udpAddress, &actualMessageType);
todo_wine ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
ok(rc == S_OK, "GetMessageType returned unexpected result: %08x\n", rc);
ok(actualMessageType == expectedMessageType2, "GetMessageType returned unexpected message type: %d\n", actualMessageType);
/* Release the object */