msvcrt: _difftime64() takes 64-bit args.
[wine.git] / dlls / wsdapi / address.c
blob7efcac2d690113534cea7040d3efbc85d467c7b0
1 /*
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
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wine/debug.h"
28 #include "wsdapi.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(wsdapi);
32 typedef struct IWSDUdpAddressImpl {
33 IWSDUdpAddress IWSDUdpAddress_iface;
34 LONG ref;
35 } IWSDUdpAddressImpl;
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);
48 if (!ppv)
50 WARN("Invalid parameter\n");
51 return E_INVALIDARG;
54 *ppv = NULL;
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;
63 else
65 WARN("Unknown IID %s\n", debugstr_guid(riid));
66 return E_NOINTERFACE;
69 IUnknown_AddRef((IUnknown*)*ppv);
70 return S_OK;
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);
79 return 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);
89 if (ref == 0)
91 HeapFree(GetProcessHeap(), 0, This);
94 return ref;
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);
100 return E_NOTIMPL;
103 static HRESULT WINAPI IWSDUdpAddressImpl_Deserialize(IWSDUdpAddress *This, LPCWSTR pszBuffer)
105 FIXME("(%p, %s)\n", This, debugstr_w(pszBuffer));
106 return E_NOTIMPL;
109 static HRESULT WINAPI IWSDUdpAddressImpl_GetPort(IWSDUdpAddress *This, WORD *pwPort)
111 FIXME("(%p, %p)\n", This, pwPort);
112 return E_NOTIMPL;
115 static HRESULT WINAPI IWSDUdpAddressImpl_SetPort(IWSDUdpAddress *This, WORD wPort)
117 FIXME("(%p, %d)\n", This, wPort);
118 return E_NOTIMPL;
121 static HRESULT WINAPI IWSDUdpAddressImpl_GetTransportAddress(IWSDUdpAddress *This, LPCWSTR *ppszAddress)
123 FIXME("(%p, %p)\n", This, ppszAddress);
124 return E_NOTIMPL;
127 static HRESULT WINAPI IWSDUdpAddressImpl_GetTransportAddressEx(IWSDUdpAddress *This, BOOL fSafe, LPCWSTR *ppszAddress)
129 FIXME("(%p, %d, %p)\n", This, fSafe, ppszAddress);
130 return E_NOTIMPL;
133 static HRESULT WINAPI IWSDUdpAddressImpl_SetTransportAddress(IWSDUdpAddress *This, LPCWSTR pszAddress)
135 FIXME("(%p, %s)\n", This, debugstr_w(pszAddress));
136 return E_NOTIMPL;
139 static HRESULT WINAPI IWSDUdpAddressImpl_SetSockaddr(IWSDUdpAddress *This, const SOCKADDR_STORAGE *pSockAddr)
141 FIXME("(%p, %p)\n", This, pSockAddr);
142 return E_NOTIMPL;
145 static HRESULT WINAPI IWSDUdpAddressImpl_GetSockaddr(IWSDUdpAddress *This, SOCKADDR_STORAGE *pSockAddr)
147 FIXME("(%p, %p)\n", This, pSockAddr);
148 return E_NOTIMPL;
151 static HRESULT WINAPI IWSDUdpAddressImpl_SetExclusive(IWSDUdpAddress *This, BOOL fExclusive)
153 FIXME("(%p, %d)\n", This, fExclusive);
154 return E_NOTIMPL;
157 static HRESULT WINAPI IWSDUdpAddressImpl_GetExclusive(IWSDUdpAddress *This)
159 FIXME("(%p)\n", This);
160 return E_NOTIMPL;
163 static HRESULT WINAPI IWSDUdpAddressImpl_SetMessageType(IWSDUdpAddress *This, WSDUdpMessageType messageType)
165 FIXME("(%p, %d)\n", This, messageType);
166 return E_NOTIMPL;
169 static HRESULT WINAPI IWSDUdpAddressImpl_GetMessageType(IWSDUdpAddress *This, WSDUdpMessageType *pMessageType)
171 FIXME("(%p, %p)\n", This, pMessageType);
172 return E_NOTIMPL;
175 static HRESULT WINAPI IWSDUdpAddressImpl_SetTTL(IWSDUdpAddress *This, DWORD dwTTL)
177 FIXME("(%p, %d)\n", This, dwTTL);
178 return E_NOTIMPL;
181 static HRESULT WINAPI IWSDUdpAddressImpl_GetTTL(IWSDUdpAddress *This, DWORD *pdwTTL)
183 FIXME("(%p, %p)\n", This, pdwTTL);
184 return E_NOTIMPL;
187 static HRESULT WINAPI IWSDUdpAddressImpl_SetAlias(IWSDUdpAddress *This, const GUID *pAlias)
189 FIXME("(%p, %s)\n", This, debugstr_guid(pAlias));
190 return E_NOTIMPL;
193 static HRESULT WINAPI IWSDUdpAddressImpl_GetAlias(IWSDUdpAddress *This, GUID *pAlias)
195 FIXME("(%p, %p)\n", This, pAlias);
196 return E_NOTIMPL;
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");
232 return E_POINTER;
235 *ppAddress = NULL;
237 obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj));
239 if (!obj)
241 WARN("Out of memory\n");
242 return E_OUTOFMEMORY;
245 obj->IWSDUdpAddress_iface.lpVtbl = &udpAddressVtbl;
246 obj->ref = 1;
248 *ppAddress = &obj->IWSDUdpAddress_iface;
249 TRACE("Returning iface %p\n", *ppAddress);
251 return S_OK;