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
);
25 const IUriVtbl
*lpIUriVtbl
;
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
);
40 }else if(IsEqualGUID(&IID_IUri
, riid
)) {
41 TRACE("(%p)->(IID_IUri %p)\n", This
, ppv
);
44 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
49 IUnknown_AddRef((IUnknown
*)*ppv
);
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
);
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
);
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
);
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
);
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
);
97 static HRESULT WINAPI
Uri_HasProperty(IUri
*iface
, Uri_PROPERTY uriProp
, BOOL
*pfHasProperty
)
99 Uri
*This
= URI_THIS(iface
);
100 FIXME("(%p)->()\n", This
);
104 static HRESULT WINAPI
Uri_GetAbsoluteUri(IUri
*iface
, BSTR
*pstrAbsoluteUri
)
106 Uri
*This
= URI_THIS(iface
);
107 FIXME("(%p)->(%p)\n", This
, pstrAbsoluteUri
);
111 static HRESULT WINAPI
Uri_GetAuthority(IUri
*iface
, BSTR
*pstrAuthority
)
113 Uri
*This
= URI_THIS(iface
);
114 FIXME("(%p)->(%p)\n", This
, pstrAuthority
);
118 static HRESULT WINAPI
Uri_GetDisplayUri(IUri
*iface
, BSTR
*pstrDisplayUri
)
120 Uri
*This
= URI_THIS(iface
);
121 FIXME("(%p)->(%p)\n", This
, pstrDisplayUri
);
125 static HRESULT WINAPI
Uri_GetDomain(IUri
*iface
, BSTR
*pstrDomain
)
127 Uri
*This
= URI_THIS(iface
);
128 FIXME("(%p)->(%p)\n", This
, pstrDomain
);
132 static HRESULT WINAPI
Uri_GetExtension(IUri
*iface
, BSTR
*pstrExtension
)
134 Uri
*This
= URI_THIS(iface
);
135 FIXME("(%p)->(%p)\n", This
, pstrExtension
);
139 static HRESULT WINAPI
Uri_GetFragment(IUri
*iface
, BSTR
*pstrFragment
)
141 Uri
*This
= URI_THIS(iface
);
142 FIXME("(%p)->(%p)\n", This
, pstrFragment
);
146 static HRESULT WINAPI
Uri_GetHost(IUri
*iface
, BSTR
*pstrHost
)
148 Uri
*This
= URI_THIS(iface
);
149 FIXME("(%p)->(%p)\n", This
, pstrHost
);
153 static HRESULT WINAPI
Uri_GetPassword(IUri
*iface
, BSTR
*pstrPassword
)
155 Uri
*This
= URI_THIS(iface
);
156 FIXME("(%p)->(%p)\n", This
, pstrPassword
);
160 static HRESULT WINAPI
Uri_GetPath(IUri
*iface
, BSTR
*pstrPath
)
162 Uri
*This
= URI_THIS(iface
);
163 FIXME("(%p)->(%p)\n", This
, pstrPath
);
167 static HRESULT WINAPI
Uri_GetPathAndQuery(IUri
*iface
, BSTR
*pstrPathAndQuery
)
169 Uri
*This
= URI_THIS(iface
);
170 FIXME("(%p)->(%p)\n", This
, pstrPathAndQuery
);
174 static HRESULT WINAPI
Uri_GetQuery(IUri
*iface
, BSTR
*pstrQuery
)
176 Uri
*This
= URI_THIS(iface
);
177 FIXME("(%p)->(%p)\n", This
, pstrQuery
);
181 static HRESULT WINAPI
Uri_GetRawUri(IUri
*iface
, BSTR
*pstrRawUri
)
183 Uri
*This
= URI_THIS(iface
);
184 FIXME("(%p)->(%p)\n", This
, pstrRawUri
);
188 static HRESULT WINAPI
Uri_GetSchemeName(IUri
*iface
, BSTR
*pstrSchemeName
)
190 Uri
*This
= URI_THIS(iface
);
191 FIXME("(%p)->(%p)\n", This
, pstrSchemeName
);
195 static HRESULT WINAPI
Uri_GetUserInfo(IUri
*iface
, BSTR
*pstrUserInfo
)
197 Uri
*This
= URI_THIS(iface
);
198 FIXME("(%p)->(%p)\n", This
, pstrUserInfo
);
202 static HRESULT WINAPI
Uri_GetUserName(IUri
*iface
, BSTR
*pstrUserName
)
204 Uri
*This
= URI_THIS(iface
);
205 FIXME("(%p)->(%p)\n", This
, pstrUserName
);
209 static HRESULT WINAPI
Uri_GetHostType(IUri
*iface
, DWORD
*pdwHostType
)
211 Uri
*This
= URI_THIS(iface
);
212 FIXME("(%p)->(%p)\n", This
, pdwHostType
);
216 static HRESULT WINAPI
Uri_GetPort(IUri
*iface
, DWORD
*pdwPort
)
218 Uri
*This
= URI_THIS(iface
);
219 FIXME("(%p)->(%p)\n", This
, pdwPort
);
223 static HRESULT WINAPI
Uri_GetScheme(IUri
*iface
, DWORD
*pdwScheme
)
225 Uri
*This
= URI_THIS(iface
);
226 FIXME("(%p)->(%p)\n", This
, pdwScheme
);
230 static HRESULT WINAPI
Uri_GetZone(IUri
*iface
, DWORD
*pdwZone
)
232 Uri
*This
= URI_THIS(iface
);
233 FIXME("(%p)->(%p)\n", This
, pdwZone
);
237 static HRESULT WINAPI
Uri_GetProperties(IUri
*iface
, DWORD
*pdwProperties
)
239 Uri
*This
= URI_THIS(iface
);
240 FIXME("(%p)->(%p)\n", This
, pdwProperties
);
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
);
253 static const IUriVtbl UriVtbl
= {
258 Uri_GetPropertyLength
,
259 Uri_GetPropertyDWORD
,
284 /***********************************************************************
285 * CreateUri (urlmon.@)
287 HRESULT WINAPI
CreateUri(LPCWSTR pwzURI
, DWORD dwFlags
, DWORD_PTR dwReserved
, IUri
**ppURI
)
291 TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI
), dwFlags
, (DWORD
)dwReserved
, ppURI
);
293 ret
= heap_alloc(sizeof(Uri
));
295 return E_OUTOFMEMORY
;
297 ret
->lpIUriVtbl
= &UriVtbl
;