Jacek Caban : urlmon: Added CreateUri stub implementation.

Alexandre Julliard julliard at winehq.org
Fri Feb 12 10:17:41 CST 2010


Module: wine
Branch: master
Commit: 141e61468ea274804e64b885293e39a9da8299d9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=141e61468ea274804e64b885293e39a9da8299d9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb 11 18:33:48 2010 +0100

urlmon: Added CreateUri stub implementation.

---

 dlls/urlmon/Makefile.in |    1 +
 dlls/urlmon/uri.c       |  302 +++++++++++++++++++++++++++++++++++++++++++++++
 dlls/urlmon/urlmon.spec |    1 +
 3 files changed, 304 insertions(+), 0 deletions(-)

diff --git a/dlls/urlmon/Makefile.in b/dlls/urlmon/Makefile.in
index f0dd490..6a9182c 100644
--- a/dlls/urlmon/Makefile.in
+++ b/dlls/urlmon/Makefile.in
@@ -28,6 +28,7 @@ C_SRCS = \
 	session.c \
 	umon.c \
 	umstream.c \
+	uri.c \
 	urlmon_main.c \
 	usrmarshal.c
 
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
new file mode 100644
index 0000000..d4d6b47
--- /dev/null
+++ b/dlls/urlmon/uri.c
@@ -0,0 +1,302 @@
+/*
+ * Copyright 2010 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "urlmon_main.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
+
+typedef struct {
+    const IUriVtbl  *lpIUriVtbl;
+    LONG ref;
+} Uri;
+
+#define URI(x)  ((IUri*)  &(x)->lpIUriVtbl)
+
+#define URI_THIS(iface) DEFINE_THIS(Uri, IUri, iface)
+
+static HRESULT WINAPI Uri_QueryInterface(IUri *iface, REFIID riid, void **ppv)
+{
+    Uri *This = URI_THIS(iface);
+
+    if(IsEqualGUID(&IID_IUnknown, riid)) {
+        TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
+        *ppv = URI(This);
+    }else if(IsEqualGUID(&IID_IUri, riid)) {
+        TRACE("(%p)->(IID_IUri %p)\n", This, ppv);
+        *ppv = URI(This);
+    }else {
+        TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
+        *ppv = NULL;
+        return E_NOINTERFACE;
+    }
+
+    IUnknown_AddRef((IUnknown*)*ppv);
+    return S_OK;
+}
+
+static ULONG WINAPI Uri_AddRef(IUri *iface)
+{
+    Uri *This = URI_THIS(iface);
+    LONG ref = InterlockedIncrement(&This->ref);
+
+    TRACE("(%p) ref=%d\n", This, ref);
+
+    return ref;
+}
+
+static ULONG WINAPI Uri_Release(IUri *iface)
+{
+    Uri *This = URI_THIS(iface);
+    LONG ref = InterlockedDecrement(&This->ref);
+
+    TRACE("(%p) ref=%d\n", This, ref);
+
+    if(!ref)
+        heap_free(This);
+
+    return ref;
+}
+
+static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BSTR *pbstrProperty, DWORD dwFlags)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *pfHasProperty)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrAbsoluteUri);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrAuthority);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrDisplayUri);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrDomain);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrExtension);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrFragment);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrHost);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrPassword);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPath(IUri *iface, BSTR *pstrPath)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrPath);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrPathAndQuery);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrQuery);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrRawUri);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetSchemeName(IUri *iface, BSTR *pstrSchemeName)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrSchemeName);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrUserInfo);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetUserName(IUri *iface, BSTR *pstrUserName)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pstrUserName);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwHostType);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwPort);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwScheme);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwZone);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwProperties);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual)
+{
+    Uri *This = URI_THIS(iface);
+    FIXME("(%p)->(%p %p)\n", This, pUri, pfEqual);
+    return E_NOTIMPL;
+}
+
+#undef URI_THIS
+
+static const IUriVtbl UriVtbl = {
+    Uri_QueryInterface,
+    Uri_AddRef,
+    Uri_Release,
+    Uri_GetPropertyBSTR,
+    Uri_GetPropertyLength,
+    Uri_GetPropertyDWORD,
+    Uri_HasProperty,
+    Uri_GetAbsoluteUri,
+    Uri_GetAuthority,
+    Uri_GetDisplayUri,
+    Uri_GetDomain,
+    Uri_GetExtension,
+    Uri_GetFragment,
+    Uri_GetHost,
+    Uri_GetPassword,
+    Uri_GetPath,
+    Uri_GetPathAndQuery,
+    Uri_GetQuery,
+    Uri_GetRawUri,
+    Uri_GetSchemeName,
+    Uri_GetUserInfo,
+    Uri_GetUserName,
+    Uri_GetHostType,
+    Uri_GetPort,
+    Uri_GetScheme,
+    Uri_GetZone,
+    Uri_GetProperties,
+    Uri_IsEqual
+};
+
+/***********************************************************************
+ *           CreateUri (urlmon.@)
+ */
+HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
+{
+    Uri *ret;
+
+    TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI), dwFlags, (DWORD)dwReserved, ppURI);
+
+    ret = heap_alloc(sizeof(Uri));
+    if(!ret)
+        return E_OUTOFMEMORY;
+
+    ret->lpIUriVtbl = &UriVtbl;
+    ret->ref = 1;
+
+    *ppURI = URI(ret);
+    return S_OK;
+}
diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec
index cc40c36..dbb8fa9 100644
--- a/dlls/urlmon/urlmon.spec
+++ b/dlls/urlmon/urlmon.spec
@@ -26,6 +26,7 @@
 @ stdcall CreateAsyncBindCtx(long ptr ptr ptr)
 @ stdcall CreateAsyncBindCtxEx(ptr long ptr ptr ptr long)
 @ stdcall CreateFormatEnumerator(long ptr ptr)
+@ stdcall CreateUri(wstr long long ptr)
 @ stdcall CreateURLMoniker(ptr wstr ptr)
 @ stdcall CreateURLMonikerEx(ptr wstr ptr long)
 @ stdcall -private DllCanUnloadNow()




More information about the wine-cvs mailing list