Implement RtlInitAnsiStringEx.
[wine/multimedia.git] / dlls / urlmon / session.c
blobc516b7e0baf6819aebddab8b099fe203d466cd3c
1 /*
2 * Copyright 2005 Jacek Caban
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27 #include "urlmon.h"
28 #include "urlmon_main.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
34 static HRESULT WINAPI InternetSession_QueryInterface(IInternetSession *iface,
35 REFIID riid, void **ppv)
37 TRACE("(%s %p)\n", debugstr_guid(riid), ppv);
39 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetSession, riid)) {
40 *ppv = iface;
41 IInternetSession_AddRef(iface);
42 return S_OK;
45 *ppv = NULL;
46 return E_NOINTERFACE;
49 static ULONG WINAPI InternetSession_AddRef(IInternetSession *iface)
51 TRACE("()\n");
52 URLMON_LockModule();
53 return 2;
56 static ULONG WINAPI InternetSession_Release(IInternetSession *iface)
58 TRACE("()\n");
59 URLMON_UnlockModule();
60 return 1;
63 static HRESULT WINAPI InternetSession_RegisterNameSpace(IInternetSession *iface,
64 IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzProtocol, ULONG cPatterns,
65 const LPCWSTR *ppwzPatterns, DWORD dwReserved)
67 FIXME("(%p %s %s %ld %p %ld)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzProtocol),
68 cPatterns, ppwzPatterns, dwReserved);
69 return E_NOTIMPL;
72 static HRESULT WINAPI InternetSession_UnregisterNameSpace(IInternetSession *iface,
73 IClassFactory *pCF, LPCWSTR pszProtocol)
75 FIXME("(%p %s)\n", pCF, debugstr_w(pszProtocol));
76 return E_NOTIMPL;
79 static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface,
80 IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzType)
82 FIXME("(%p %s %s)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzType));
83 return E_NOTIMPL;
86 static HRESULT WINAPI InternetSession_UnregisterMimeFilter(IInternetSession *iface,
87 IClassFactory *pCF, LPCWSTR pwzType)
89 FIXME("(%p %s)\n", pCF, debugstr_w(pwzType));
90 return E_NOTIMPL;
93 static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
94 LPBC pBC, LPCWSTR szUrl, IUnknown *pUnkOuter, IUnknown **ppUnk,
95 IInternetProtocol **ppOInetProt, DWORD dwOption)
97 FIXME("(%p %s %p %p %p %08lx)\n", pBC, debugstr_w(szUrl), pUnkOuter, ppUnk,
98 ppOInetProt, dwOption);
99 return E_NOTIMPL;
102 static HRESULT WINAPI InternetSession_SetSessionOption(IInternetSession *iface,
103 DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD dwReserved)
105 FIXME("(%08lx %p %ld %ld)\n", dwOption, pBuffer, dwBufferLength, dwReserved);
106 return E_NOTIMPL;
109 static const IInternetSessionVtbl InternetSessionVtbl = {
110 InternetSession_QueryInterface,
111 InternetSession_AddRef,
112 InternetSession_Release,
113 InternetSession_RegisterNameSpace,
114 InternetSession_UnregisterNameSpace,
115 InternetSession_RegisterMimeFilter,
116 InternetSession_UnregisterMimeFilter,
117 InternetSession_CreateBinding,
118 InternetSession_SetSessionOption
121 static IInternetSession InternetSession = { &InternetSessionVtbl };
123 /***********************************************************************
124 * CoInternetGetSession (URLMON.@)
126 * Create a new internet session and return an IInternetSession interface
127 * representing it.
129 * PARAMS
130 * dwSessionMode [I] Mode for the internet session
131 * ppIInternetSession [O] Destination for creates IInternetSession object
132 * dwReserved [I] Reserved, must be 0.
134 * RETURNS
135 * Success: S_OK. ppIInternetSession contains the IInternetSession interface.
136 * Failure: E_INVALIDARG, if any argument is invalid, or
137 * E_OUTOFMEMORY if memory allocation fails.
139 HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppIInternetSession,
140 DWORD dwReserved)
142 TRACE("(%ld %p %ld)\n", dwSessionMode, ppIInternetSession, dwReserved);
144 if(dwSessionMode)
145 ERR("dwSessionMode=%ld\n", dwSessionMode);
146 if(dwReserved)
147 ERR("dwReserved=%ld\n", dwReserved);
149 *ppIInternetSession = &InternetSession;
150 return S_OK;