2 * Web Services on Devices
4 * Copyright 2017 Owen Rudge for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(wsdapi
);
32 typedef struct IWSDUdpAddressImpl
{
33 IWSDUdpAddress IWSDUdpAddress_iface
;
37 static inline IWSDUdpAddressImpl
*impl_from_IWSDUdpAddress(IWSDUdpAddress
*iface
)
39 return CONTAINING_RECORD(iface
, IWSDUdpAddressImpl
, IWSDUdpAddress_iface
);
42 static HRESULT WINAPI
IWSDUdpAddressImpl_QueryInterface(IWSDUdpAddress
*iface
, REFIID riid
, void **ppv
)
44 IWSDUdpAddressImpl
*This
= impl_from_IWSDUdpAddress(iface
);
46 TRACE("(%p, %s, %p)\n", This
, debugstr_guid(riid
), ppv
);
50 WARN("Invalid parameter\n");
56 if (IsEqualIID(riid
, &IID_IUnknown
) ||
57 IsEqualIID(riid
, &IID_IWSDUdpAddress
) ||
58 IsEqualIID(riid
, &IID_IWSDTransportAddress
) ||
59 IsEqualIID(riid
, &IID_IWSDAddress
))
61 *ppv
= &This
->IWSDUdpAddress_iface
;
65 WARN("Unknown IID %s\n", debugstr_guid(riid
));
69 IUnknown_AddRef((IUnknown
*)*ppv
);
73 static ULONG WINAPI
IWSDUdpAddressImpl_AddRef(IWSDUdpAddress
*iface
)
75 IWSDUdpAddressImpl
*This
= impl_from_IWSDUdpAddress(iface
);
76 ULONG ref
= InterlockedIncrement(&This
->ref
);
78 TRACE("(%p) ref=%d\n", This
, ref
);
82 static ULONG WINAPI
IWSDUdpAddressImpl_Release(IWSDUdpAddress
*iface
)
84 IWSDUdpAddressImpl
*This
= impl_from_IWSDUdpAddress(iface
);
85 ULONG ref
= InterlockedDecrement(&This
->ref
);
87 TRACE("(%p) ref=%d\n", This
, ref
);
91 HeapFree(GetProcessHeap(), 0, This
);
97 static HRESULT WINAPI
IWSDUdpAddressImpl_Serialize(IWSDUdpAddress
*This
, LPWSTR pszBuffer
, DWORD cchLength
, BOOL fSafe
)
99 FIXME("(%p, %p, %d, %d)\n", This
, pszBuffer
, cchLength
, fSafe
);
103 static HRESULT WINAPI
IWSDUdpAddressImpl_Deserialize(IWSDUdpAddress
*This
, LPCWSTR pszBuffer
)
105 FIXME("(%p, %s)\n", This
, debugstr_w(pszBuffer
));
109 static HRESULT WINAPI
IWSDUdpAddressImpl_GetPort(IWSDUdpAddress
*This
, WORD
*pwPort
)
111 FIXME("(%p, %p)\n", This
, pwPort
);
115 static HRESULT WINAPI
IWSDUdpAddressImpl_SetPort(IWSDUdpAddress
*This
, WORD wPort
)
117 FIXME("(%p, %d)\n", This
, wPort
);
121 static HRESULT WINAPI
IWSDUdpAddressImpl_GetTransportAddress(IWSDUdpAddress
*This
, LPCWSTR
*ppszAddress
)
123 FIXME("(%p, %p)\n", This
, ppszAddress
);
127 static HRESULT WINAPI
IWSDUdpAddressImpl_GetTransportAddressEx(IWSDUdpAddress
*This
, BOOL fSafe
, LPCWSTR
*ppszAddress
)
129 FIXME("(%p, %d, %p)\n", This
, fSafe
, ppszAddress
);
133 static HRESULT WINAPI
IWSDUdpAddressImpl_SetTransportAddress(IWSDUdpAddress
*This
, LPCWSTR pszAddress
)
135 FIXME("(%p, %s)\n", This
, debugstr_w(pszAddress
));
139 static HRESULT WINAPI
IWSDUdpAddressImpl_SetSockaddr(IWSDUdpAddress
*This
, const SOCKADDR_STORAGE
*pSockAddr
)
141 FIXME("(%p, %p)\n", This
, pSockAddr
);
145 static HRESULT WINAPI
IWSDUdpAddressImpl_GetSockaddr(IWSDUdpAddress
*This
, SOCKADDR_STORAGE
*pSockAddr
)
147 FIXME("(%p, %p)\n", This
, pSockAddr
);
151 static HRESULT WINAPI
IWSDUdpAddressImpl_SetExclusive(IWSDUdpAddress
*This
, BOOL fExclusive
)
153 FIXME("(%p, %d)\n", This
, fExclusive
);
157 static HRESULT WINAPI
IWSDUdpAddressImpl_GetExclusive(IWSDUdpAddress
*This
)
159 FIXME("(%p)\n", This
);
163 static HRESULT WINAPI
IWSDUdpAddressImpl_SetMessageType(IWSDUdpAddress
*This
, WSDUdpMessageType messageType
)
165 FIXME("(%p, %d)\n", This
, messageType
);
169 static HRESULT WINAPI
IWSDUdpAddressImpl_GetMessageType(IWSDUdpAddress
*This
, WSDUdpMessageType
*pMessageType
)
171 FIXME("(%p, %p)\n", This
, pMessageType
);
175 static HRESULT WINAPI
IWSDUdpAddressImpl_SetTTL(IWSDUdpAddress
*This
, DWORD dwTTL
)
177 FIXME("(%p, %d)\n", This
, dwTTL
);
181 static HRESULT WINAPI
IWSDUdpAddressImpl_GetTTL(IWSDUdpAddress
*This
, DWORD
*pdwTTL
)
183 FIXME("(%p, %p)\n", This
, pdwTTL
);
187 static HRESULT WINAPI
IWSDUdpAddressImpl_SetAlias(IWSDUdpAddress
*This
, const GUID
*pAlias
)
189 FIXME("(%p, %s)\n", This
, debugstr_guid(pAlias
));
193 static HRESULT WINAPI
IWSDUdpAddressImpl_GetAlias(IWSDUdpAddress
*This
, GUID
*pAlias
)
195 FIXME("(%p, %p)\n", This
, pAlias
);
199 static const IWSDUdpAddressVtbl udpAddressVtbl
=
201 IWSDUdpAddressImpl_QueryInterface
,
202 IWSDUdpAddressImpl_AddRef
,
203 IWSDUdpAddressImpl_Release
,
204 IWSDUdpAddressImpl_Serialize
,
205 IWSDUdpAddressImpl_Deserialize
,
206 IWSDUdpAddressImpl_GetPort
,
207 IWSDUdpAddressImpl_SetPort
,
208 IWSDUdpAddressImpl_GetTransportAddress
,
209 IWSDUdpAddressImpl_GetTransportAddressEx
,
210 IWSDUdpAddressImpl_SetTransportAddress
,
211 IWSDUdpAddressImpl_SetSockaddr
,
212 IWSDUdpAddressImpl_GetSockaddr
,
213 IWSDUdpAddressImpl_SetExclusive
,
214 IWSDUdpAddressImpl_GetExclusive
,
215 IWSDUdpAddressImpl_SetMessageType
,
216 IWSDUdpAddressImpl_GetMessageType
,
217 IWSDUdpAddressImpl_SetTTL
,
218 IWSDUdpAddressImpl_GetTTL
,
219 IWSDUdpAddressImpl_SetAlias
,
220 IWSDUdpAddressImpl_GetAlias
223 HRESULT WINAPI
WSDCreateUdpAddress(IWSDUdpAddress
**ppAddress
)
225 IWSDUdpAddressImpl
*obj
;
227 TRACE("(%p)\n", ppAddress
);
229 if (ppAddress
== NULL
)
231 WARN("Invalid parameter: ppAddress == NULL\n");
237 obj
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*obj
));
241 WARN("Out of memory\n");
242 return E_OUTOFMEMORY
;
245 obj
->IWSDUdpAddress_iface
.lpVtbl
= &udpAddressVtbl
;
248 *ppAddress
= &obj
->IWSDUdpAddress_iface
;
249 TRACE("Returning iface %p\n", *ppAddress
);