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
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
)) {
41 IInternetSession_AddRef(iface
);
49 static ULONG WINAPI
InternetSession_AddRef(IInternetSession
*iface
)
56 static ULONG WINAPI
InternetSession_Release(IInternetSession
*iface
)
59 URLMON_UnlockModule();
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
);
72 static HRESULT WINAPI
InternetSession_UnregisterNameSpace(IInternetSession
*iface
,
73 IClassFactory
*pCF
, LPCWSTR pszProtocol
)
75 FIXME("(%p %s)\n", pCF
, debugstr_w(pszProtocol
));
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
));
86 static HRESULT WINAPI
InternetSession_UnregisterMimeFilter(IInternetSession
*iface
,
87 IClassFactory
*pCF
, LPCWSTR pwzType
)
89 FIXME("(%p %s)\n", pCF
, debugstr_w(pwzType
));
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
);
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
);
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
130 * dwSessionMode [I] Mode for the internet session
131 * ppIInternetSession [O] Destination for creates IInternetSession object
132 * dwReserved [I] Reserved, must be 0.
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
,
142 TRACE("(%ld %p %ld)\n", dwSessionMode
, ppIInternetSession
, dwReserved
);
145 ERR("dwSessionMode=%ld\n", dwSessionMode
);
147 ERR("dwReserved=%ld\n", dwReserved
);
149 *ppIInternetSession
= &InternetSession
;