msi: Convert IWineMsiRemoteDatabase BSTR parameters to LPCWSTR to avoid typecast.
[wine/testsucceed.git] / dlls / urlmon / uri.c
blobd4d6b47e5abc63b8034544c001b4dba93b315426
1 /*
2 * Copyright 2010 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "urlmon_main.h"
20 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
24 typedef struct {
25 const IUriVtbl *lpIUriVtbl;
26 LONG ref;
27 } Uri;
29 #define URI(x) ((IUri*) &(x)->lpIUriVtbl)
31 #define URI_THIS(iface) DEFINE_THIS(Uri, IUri, iface)
33 static HRESULT WINAPI Uri_QueryInterface(IUri *iface, REFIID riid, void **ppv)
35 Uri *This = URI_THIS(iface);
37 if(IsEqualGUID(&IID_IUnknown, riid)) {
38 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
39 *ppv = URI(This);
40 }else if(IsEqualGUID(&IID_IUri, riid)) {
41 TRACE("(%p)->(IID_IUri %p)\n", This, ppv);
42 *ppv = URI(This);
43 }else {
44 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
45 *ppv = NULL;
46 return E_NOINTERFACE;
49 IUnknown_AddRef((IUnknown*)*ppv);
50 return S_OK;
53 static ULONG WINAPI Uri_AddRef(IUri *iface)
55 Uri *This = URI_THIS(iface);
56 LONG ref = InterlockedIncrement(&This->ref);
58 TRACE("(%p) ref=%d\n", This, ref);
60 return ref;
63 static ULONG WINAPI Uri_Release(IUri *iface)
65 Uri *This = URI_THIS(iface);
66 LONG ref = InterlockedDecrement(&This->ref);
68 TRACE("(%p) ref=%d\n", This, ref);
70 if(!ref)
71 heap_free(This);
73 return ref;
76 static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BSTR *pbstrProperty, DWORD dwFlags)
78 Uri *This = URI_THIS(iface);
79 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags);
80 return E_NOTIMPL;
83 static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
85 Uri *This = URI_THIS(iface);
86 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
87 return E_NOTIMPL;
90 static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
92 Uri *This = URI_THIS(iface);
93 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
94 return E_NOTIMPL;
97 static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *pfHasProperty)
99 Uri *This = URI_THIS(iface);
100 FIXME("(%p)->()\n", This);
101 return E_NOTIMPL;
104 static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
106 Uri *This = URI_THIS(iface);
107 FIXME("(%p)->(%p)\n", This, pstrAbsoluteUri);
108 return E_NOTIMPL;
111 static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
113 Uri *This = URI_THIS(iface);
114 FIXME("(%p)->(%p)\n", This, pstrAuthority);
115 return E_NOTIMPL;
118 static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
120 Uri *This = URI_THIS(iface);
121 FIXME("(%p)->(%p)\n", This, pstrDisplayUri);
122 return E_NOTIMPL;
125 static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
127 Uri *This = URI_THIS(iface);
128 FIXME("(%p)->(%p)\n", This, pstrDomain);
129 return E_NOTIMPL;
132 static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
134 Uri *This = URI_THIS(iface);
135 FIXME("(%p)->(%p)\n", This, pstrExtension);
136 return E_NOTIMPL;
139 static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
141 Uri *This = URI_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, pstrFragment);
143 return E_NOTIMPL;
146 static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost)
148 Uri *This = URI_THIS(iface);
149 FIXME("(%p)->(%p)\n", This, pstrHost);
150 return E_NOTIMPL;
153 static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
155 Uri *This = URI_THIS(iface);
156 FIXME("(%p)->(%p)\n", This, pstrPassword);
157 return E_NOTIMPL;
160 static HRESULT WINAPI Uri_GetPath(IUri *iface, BSTR *pstrPath)
162 Uri *This = URI_THIS(iface);
163 FIXME("(%p)->(%p)\n", This, pstrPath);
164 return E_NOTIMPL;
167 static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery)
169 Uri *This = URI_THIS(iface);
170 FIXME("(%p)->(%p)\n", This, pstrPathAndQuery);
171 return E_NOTIMPL;
174 static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery)
176 Uri *This = URI_THIS(iface);
177 FIXME("(%p)->(%p)\n", This, pstrQuery);
178 return E_NOTIMPL;
181 static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri)
183 Uri *This = URI_THIS(iface);
184 FIXME("(%p)->(%p)\n", This, pstrRawUri);
185 return E_NOTIMPL;
188 static HRESULT WINAPI Uri_GetSchemeName(IUri *iface, BSTR *pstrSchemeName)
190 Uri *This = URI_THIS(iface);
191 FIXME("(%p)->(%p)\n", This, pstrSchemeName);
192 return E_NOTIMPL;
195 static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo)
197 Uri *This = URI_THIS(iface);
198 FIXME("(%p)->(%p)\n", This, pstrUserInfo);
199 return E_NOTIMPL;
202 static HRESULT WINAPI Uri_GetUserName(IUri *iface, BSTR *pstrUserName)
204 Uri *This = URI_THIS(iface);
205 FIXME("(%p)->(%p)\n", This, pstrUserName);
206 return E_NOTIMPL;
209 static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
211 Uri *This = URI_THIS(iface);
212 FIXME("(%p)->(%p)\n", This, pdwHostType);
213 return E_NOTIMPL;
216 static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
218 Uri *This = URI_THIS(iface);
219 FIXME("(%p)->(%p)\n", This, pdwPort);
220 return E_NOTIMPL;
223 static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
225 Uri *This = URI_THIS(iface);
226 FIXME("(%p)->(%p)\n", This, pdwScheme);
227 return E_NOTIMPL;
230 static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
232 Uri *This = URI_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, pdwZone);
234 return E_NOTIMPL;
237 static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties)
239 Uri *This = URI_THIS(iface);
240 FIXME("(%p)->(%p)\n", This, pdwProperties);
241 return E_NOTIMPL;
244 static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual)
246 Uri *This = URI_THIS(iface);
247 FIXME("(%p)->(%p %p)\n", This, pUri, pfEqual);
248 return E_NOTIMPL;
251 #undef URI_THIS
253 static const IUriVtbl UriVtbl = {
254 Uri_QueryInterface,
255 Uri_AddRef,
256 Uri_Release,
257 Uri_GetPropertyBSTR,
258 Uri_GetPropertyLength,
259 Uri_GetPropertyDWORD,
260 Uri_HasProperty,
261 Uri_GetAbsoluteUri,
262 Uri_GetAuthority,
263 Uri_GetDisplayUri,
264 Uri_GetDomain,
265 Uri_GetExtension,
266 Uri_GetFragment,
267 Uri_GetHost,
268 Uri_GetPassword,
269 Uri_GetPath,
270 Uri_GetPathAndQuery,
271 Uri_GetQuery,
272 Uri_GetRawUri,
273 Uri_GetSchemeName,
274 Uri_GetUserInfo,
275 Uri_GetUserName,
276 Uri_GetHostType,
277 Uri_GetPort,
278 Uri_GetScheme,
279 Uri_GetZone,
280 Uri_GetProperties,
281 Uri_IsEqual
284 /***********************************************************************
285 * CreateUri (urlmon.@)
287 HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
289 Uri *ret;
291 TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI), dwFlags, (DWORD)dwReserved, ppURI);
293 ret = heap_alloc(sizeof(Uri));
294 if(!ret)
295 return E_OUTOFMEMORY;
297 ret->lpIUriVtbl = &UriVtbl;
298 ret->ref = 1;
300 *ppURI = URI(ret);
301 return S_OK;