blob: 97197ade68e09c6d1d9ba88f87b6f95ea9fe5e37 [file] [log] [blame]
Huw D M Davies6b97f5e2002-08-13 18:20:24 +00001/*
Francois Gougetae500132003-09-08 19:38:45 +00002 * Copyright 2002 Huw D M Davies for CodeWeavers
Huw D M Davies6b97f5e2002-08-13 18:20:24 +00003 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef __WINE_URLMON_MAIN_H
20#define __WINE_URLMON_MAIN_H
21
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000022#include <stdarg.h>
23
Huw D M Davies6b97f5e2002-08-13 18:20:24 +000024#include "windef.h"
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000025#include "winbase.h"
Huw D M Davies6b97f5e2002-08-13 18:20:24 +000026
27extern HINSTANCE URLMON_hInstance;
Huw Davies076b5b72004-09-28 19:18:52 +000028extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
Jacek Caband9ce4cd2004-11-30 21:14:21 +000029extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
Jacek Caban0d4f07b2005-09-06 09:27:04 +000030extern HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
Jacek Cabanc54f0132005-09-14 15:38:26 +000031extern HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
32extern HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
Huw D M Davies6b97f5e2002-08-13 18:20:24 +000033
James Hawkinsbbc081e2005-02-03 19:38:37 +000034/**********************************************************************
35 * Dll lifetime tracking declaration for urlmon.dll
36 */
37extern LONG URLMON_refCount;
Stefan Huehner863a4b12005-06-21 20:53:13 +000038static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); }
39static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); }
James Hawkinsbbc081e2005-02-03 19:38:37 +000040
Alexandre Julliard936198c2004-08-13 00:44:22 +000041#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
Jacek Caban0d4f07b2005-09-06 09:27:04 +000042#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
Alexandre Julliard936198c2004-08-13 00:44:22 +000043
Troy Rollocaf6fa92005-05-04 10:36:54 +000044typedef struct
45{
46 const IStreamVtbl *lpVtbl;
Mike McCormack058e38a2005-07-03 12:05:03 +000047 LONG ref;
Troy Rollocaf6fa92005-05-04 10:36:54 +000048 HANDLE handle;
49 BOOL closed;
50 WCHAR *pszFileName;
51 WCHAR *pszURL;
52} IUMCacheStream;
53
54HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr);
55void UMCloseCacheFileStream(IUMCacheStream *pstr);
56
Jacek Caban9630d152005-11-14 12:28:18 +000057HRESULT get_protocol_iface(LPCWSTR url, IUnknown **ret);
58
Jacek Caban0dcf2a42005-11-14 15:12:43 +000059HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
60
Huw D M Davies6b97f5e2002-08-13 18:20:24 +000061#endif /* __WINE_URLMON_MAIN_H */