2008-04-11 12:45:31 +00:00
|
|
|
/*
|
2009-10-20 19:28:02 +00:00
|
|
|
* Copyright 2005-2009 Jacek Caban for CodeWeavers
|
2008-04-11 12:45:31 +00:00
|
|
|
*
|
|
|
|
* 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 "wingdi.h"
|
|
|
|
#include "docobj.h"
|
2010-01-18 16:27:14 +00:00
|
|
|
#include "comcat.h"
|
2008-04-11 12:45:31 +00:00
|
|
|
#include "mshtml.h"
|
|
|
|
#include "mshtmhst.h"
|
|
|
|
#include "hlink.h"
|
2009-04-29 17:16:20 +00:00
|
|
|
#include "perhist.h"
|
2008-07-08 16:39:29 +00:00
|
|
|
#include "dispex.h"
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#include "wine/list.h"
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
|
|
|
#ifdef INIT_GUID
|
|
|
|
#include "initguid.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "nsiface.h"
|
|
|
|
|
|
|
|
#define NS_OK ((nsresult)0x00000000L)
|
|
|
|
#define NS_ERROR_FAILURE ((nsresult)0x80004005L)
|
|
|
|
#define NS_NOINTERFACE ((nsresult)0x80004002L)
|
|
|
|
#define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
|
2010-04-20 17:16:57 +00:00
|
|
|
#define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
|
2008-04-11 12:45:31 +00:00
|
|
|
#define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
|
|
|
|
#define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
|
|
|
|
#define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
|
|
|
|
|
|
|
|
#define NS_FAILED(res) ((res) & 0x80000000)
|
|
|
|
#define NS_SUCCEEDED(res) (!NS_FAILED(res))
|
|
|
|
|
|
|
|
#define NSAPI WINAPI
|
|
|
|
|
|
|
|
#define MSHTML_E_NODOC 0x800a025c
|
|
|
|
|
|
|
|
typedef struct HTMLDOMNode HTMLDOMNode;
|
|
|
|
typedef struct ConnectionPoint ConnectionPoint;
|
|
|
|
typedef struct BSCallback BSCallback;
|
2008-07-08 16:39:29 +00:00
|
|
|
typedef struct event_target_t event_target_t;
|
|
|
|
|
|
|
|
/* NOTE: make sure to keep in sync with dispex.c */
|
|
|
|
typedef enum {
|
|
|
|
NULL_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
DispCEventObj_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispDOMChildrenCollection_tid,
|
2009-10-20 19:28:02 +00:00
|
|
|
DispHTMLAnchorElement_tid,
|
2008-09-10 07:44:02 +00:00
|
|
|
DispHTMLBody_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLCommentElement_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
DispHTMLCurrentStyle_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLDocument_tid,
|
|
|
|
DispHTMLDOMTextNode_tid,
|
|
|
|
DispHTMLElementCollection_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
DispHTMLFormElement_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLGenericElement_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
DispHTMLFrameElement_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
DispHTMLIFrame_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLImg_tid,
|
|
|
|
DispHTMLInputElement_tid,
|
2009-08-09 12:00:11 +00:00
|
|
|
DispHTMLLocation_tid,
|
|
|
|
DispHTMLNavigator_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLOptionElement_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
DispHTMLScreen_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
DispHTMLScriptElement_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLSelectElement_tid,
|
|
|
|
DispHTMLStyle_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
DispHTMLTable_tid,
|
|
|
|
DispHTMLTableRow_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
DispHTMLTextAreaElement_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
DispHTMLUnknownElement_tid,
|
|
|
|
DispHTMLWindow2_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
HTMLDocumentEvents_tid,
|
2009-10-20 19:28:02 +00:00
|
|
|
IHTMLAnchorElement_tid,
|
2008-09-10 07:44:02 +00:00
|
|
|
IHTMLBodyElement_tid,
|
|
|
|
IHTMLBodyElement2_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLCommentElement_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLCurrentStyle_tid,
|
2009-04-29 17:16:20 +00:00
|
|
|
IHTMLCurrentStyle2_tid,
|
|
|
|
IHTMLCurrentStyle3_tid,
|
|
|
|
IHTMLCurrentStyle4_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLDocument2_tid,
|
|
|
|
IHTMLDocument3_tid,
|
|
|
|
IHTMLDocument4_tid,
|
|
|
|
IHTMLDocument5_tid,
|
|
|
|
IHTMLDOMChildrenCollection_tid,
|
|
|
|
IHTMLDOMNode_tid,
|
|
|
|
IHTMLDOMNode2_tid,
|
|
|
|
IHTMLDOMTextNode_tid,
|
|
|
|
IHTMLElement_tid,
|
|
|
|
IHTMLElement2_tid,
|
2008-09-10 07:44:02 +00:00
|
|
|
IHTMLElement3_tid,
|
|
|
|
IHTMLElement4_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLElementCollection_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLEventObj_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
IHTMLFiltersCollection_tid,
|
|
|
|
IHTMLFormElement_tid,
|
2009-11-15 23:44:20 +00:00
|
|
|
IHTMLFrameBase_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLFrameBase2_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
IHTMLFrameElement3_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLGenericElement_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
IHTMLIFrameElement_tid,
|
2009-11-15 23:44:20 +00:00
|
|
|
IHTMLImageElementFactory_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLImgElement_tid,
|
|
|
|
IHTMLInputElement_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLLocation_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLOptionElement_tid,
|
Finish the Wine sync. These components are not just rc file changes
atl, comctl32, comdlg32, dwmapi, fusion, gdiplus, jscript, mpr, mshtml, msi, msimtf, msxml3, ole32, oleaut32, riched20, shdocvw, shlwapi, urlmon, usp10, version and windowscodecs
Seems to build and boot. /me hides
svn path=/trunk/; revision=48273
2010-07-26 02:26:04 +00:00
|
|
|
IHTMLRect_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
IHTMLScreen_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
IHTMLScriptElement_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLSelectElement_tid,
|
|
|
|
IHTMLStyle_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLStyle2_tid,
|
2009-04-29 17:16:20 +00:00
|
|
|
IHTMLStyle3_tid,
|
|
|
|
IHTMLStyle4_tid,
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLTable_tid,
|
|
|
|
IHTMLTableRow_tid,
|
2010-03-02 14:08:15 +00:00
|
|
|
IHTMLTextAreaElement_tid,
|
2008-09-10 07:44:02 +00:00
|
|
|
IHTMLTextContainer_tid,
|
|
|
|
IHTMLUniqueName_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLWindow2_tid,
|
|
|
|
IHTMLWindow3_tid,
|
2010-01-18 16:27:14 +00:00
|
|
|
IHTMLWindow4_tid,
|
2008-07-08 16:39:29 +00:00
|
|
|
IOmNavigator_tid,
|
|
|
|
LAST_tid
|
|
|
|
} tid_t;
|
|
|
|
|
|
|
|
typedef struct dispex_data_t dispex_data_t;
|
|
|
|
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
|
|
|
|
|
|
|
|
#define MSHTML_DISPID_CUSTOM_MIN 0x60000000
|
|
|
|
#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
|
2010-05-29 14:54:55 +00:00
|
|
|
#define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
|
2008-07-08 16:39:29 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2009-09-05 15:02:49 +00:00
|
|
|
HRESULT (*value)(IUnknown*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
|
2008-07-08 16:39:29 +00:00
|
|
|
HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*);
|
|
|
|
HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
|
|
|
|
} dispex_static_data_vtbl_t;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2008-07-08 16:39:29 +00:00
|
|
|
const dispex_static_data_vtbl_t *vtbl;
|
|
|
|
const tid_t disp_tid;
|
|
|
|
dispex_data_t *data;
|
|
|
|
const tid_t* const iface_tids;
|
|
|
|
} dispex_static_data_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
|
|
|
|
|
|
|
IUnknown *outer;
|
|
|
|
|
|
|
|
dispex_static_data_t *data;
|
|
|
|
dispex_dynamic_data_t *dynamic_data;
|
|
|
|
} DispatchEx;
|
|
|
|
|
|
|
|
void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*);
|
2009-09-05 15:02:49 +00:00
|
|
|
void release_dispex(DispatchEx*);
|
2008-07-08 16:39:29 +00:00
|
|
|
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
|
2009-02-04 14:35:06 +00:00
|
|
|
HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**);
|
2010-01-18 16:27:14 +00:00
|
|
|
HRESULT get_dispids(tid_t,DWORD*,DISPID**);
|
2010-04-20 17:16:57 +00:00
|
|
|
HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*);
|
2008-07-08 16:39:29 +00:00
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
typedef struct HTMLWindow HTMLWindow;
|
2009-10-20 19:28:02 +00:00
|
|
|
typedef struct HTMLDocumentNode HTMLDocumentNode;
|
|
|
|
typedef struct HTMLDocumentObj HTMLDocumentObj;
|
2009-11-15 23:44:20 +00:00
|
|
|
typedef struct HTMLFrameBase HTMLFrameBase;
|
2010-03-06 11:42:03 +00:00
|
|
|
typedef struct NSContainer NSContainer;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SCRIPTMODE_GECKO,
|
|
|
|
SCRIPTMODE_ACTIVESCRIPT
|
|
|
|
} SCRIPTMODE;
|
|
|
|
|
|
|
|
typedef struct ScriptHost ScriptHost;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
typedef enum {
|
|
|
|
GLOBAL_SCRIPTVAR,
|
|
|
|
GLOBAL_ELEMENTVAR
|
|
|
|
} global_prop_type_t;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
typedef struct {
|
2009-11-15 23:44:20 +00:00
|
|
|
global_prop_type_t type;
|
2009-10-20 19:28:02 +00:00
|
|
|
WCHAR *name;
|
|
|
|
ScriptHost *script_host;
|
|
|
|
DISPID id;
|
|
|
|
} global_prop_t;
|
|
|
|
|
2008-07-08 16:39:29 +00:00
|
|
|
typedef struct {
|
2009-10-20 19:28:02 +00:00
|
|
|
const IHTMLOptionElementFactoryVtbl *lpHTMLOptionElementFactoryVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLWindow *window;
|
|
|
|
} HTMLOptionElementFactory;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
const IHTMLImageElementFactoryVtbl *lpHTMLImageElementFactoryVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLWindow *window;
|
|
|
|
} HTMLImageElementFactory;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
struct HTMLLocation {
|
|
|
|
DispatchEx dispex;
|
|
|
|
const IHTMLLocationVtbl *lpHTMLLocationVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLWindow *window;
|
|
|
|
};
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
typedef struct {
|
|
|
|
HTMLWindow *window;
|
|
|
|
LONG ref;
|
|
|
|
} windowref_t;
|
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
typedef struct nsChannelBSC nsChannelBSC;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
struct HTMLWindow {
|
2008-07-08 16:39:29 +00:00
|
|
|
DispatchEx dispex;
|
2008-04-11 12:45:31 +00:00
|
|
|
const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl;
|
2008-07-08 16:39:29 +00:00
|
|
|
const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl;
|
2010-01-18 16:27:14 +00:00
|
|
|
const IHTMLWindow4Vtbl *lpHTMLWindow4Vtbl;
|
2010-03-06 11:42:03 +00:00
|
|
|
const IHTMLPrivateWindowVtbl *lpIHTMLPrivateWindowVtbl;
|
2008-07-08 16:39:29 +00:00
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
windowref_t *window_ref;
|
|
|
|
LONG task_magic;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDocumentNode *doc;
|
|
|
|
HTMLDocumentObj *doc_obj;
|
2008-04-11 12:45:31 +00:00
|
|
|
nsIDOMWindow *nswindow;
|
2009-11-15 23:44:20 +00:00
|
|
|
HTMLWindow *parent;
|
|
|
|
HTMLFrameBase *frame_element;
|
|
|
|
READYSTATE readystate;
|
|
|
|
|
|
|
|
nsChannelBSC *bscallback;
|
|
|
|
IMoniker *mon;
|
|
|
|
LPOLESTR url;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2008-07-08 16:39:29 +00:00
|
|
|
IHTMLEventObj *event;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
|
|
|
SCRIPTMODE scriptmode;
|
|
|
|
struct list script_hosts;
|
|
|
|
|
|
|
|
HTMLOptionElementFactory *option_factory;
|
2009-11-15 23:44:20 +00:00
|
|
|
HTMLImageElementFactory *image_factory;
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLLocation *location;
|
2010-01-18 16:27:14 +00:00
|
|
|
IHTMLScreen *screen;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
|
|
|
global_prop_t *global_props;
|
|
|
|
DWORD global_prop_cnt;
|
|
|
|
DWORD global_prop_size;
|
2008-07-08 16:39:29 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
struct list children;
|
|
|
|
struct list sibling_entry;
|
2008-04-11 12:45:31 +00:00
|
|
|
struct list entry;
|
2009-10-20 19:28:02 +00:00
|
|
|
};
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
UNKNOWN_USERMODE,
|
|
|
|
BROWSEMODE,
|
|
|
|
EDITMODE
|
|
|
|
} USERMODE;
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
typedef struct _cp_static_data_t {
|
|
|
|
tid_t tid;
|
|
|
|
void (*on_advise)(IUnknown*,struct _cp_static_data_t*);
|
|
|
|
DWORD id_cnt;
|
|
|
|
DISPID *ids;
|
|
|
|
} cp_static_data_t;
|
|
|
|
|
|
|
|
typedef struct ConnectionPointContainer {
|
2008-04-11 12:45:31 +00:00
|
|
|
const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
|
|
|
|
|
|
|
|
ConnectionPoint *cp_list;
|
|
|
|
IUnknown *outer;
|
2010-01-18 16:27:14 +00:00
|
|
|
struct ConnectionPointContainer *forward_container;
|
2008-04-11 12:45:31 +00:00
|
|
|
} ConnectionPointContainer;
|
|
|
|
|
|
|
|
struct ConnectionPoint {
|
|
|
|
const IConnectionPointVtbl *lpConnectionPointVtbl;
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
ConnectionPointContainer *container;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
IUnknown *unk;
|
|
|
|
IDispatch *disp;
|
|
|
|
IPropertyNotifySink *propnotif;
|
|
|
|
} *sinks;
|
|
|
|
DWORD sinks_size;
|
|
|
|
|
|
|
|
const IID *iid;
|
2010-01-18 16:27:14 +00:00
|
|
|
cp_static_data_t *data;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
ConnectionPoint *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HTMLDocument {
|
|
|
|
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
|
|
|
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
|
|
|
|
const IHTMLDocument4Vtbl *lpHTMLDocument4Vtbl;
|
|
|
|
const IHTMLDocument5Vtbl *lpHTMLDocument5Vtbl;
|
2009-11-15 23:44:20 +00:00
|
|
|
const IHTMLDocument6Vtbl *lpHTMLDocument6Vtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
const IPersistMonikerVtbl *lpPersistMonikerVtbl;
|
|
|
|
const IPersistFileVtbl *lpPersistFileVtbl;
|
2009-04-29 17:16:20 +00:00
|
|
|
const IPersistHistoryVtbl *lpPersistHistoryVtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
const IMonikerPropVtbl *lpMonikerPropVtbl;
|
|
|
|
const IOleObjectVtbl *lpOleObjectVtbl;
|
|
|
|
const IOleDocumentVtbl *lpOleDocumentVtbl;
|
|
|
|
const IOleDocumentViewVtbl *lpOleDocumentViewVtbl;
|
|
|
|
const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
|
2010-01-18 16:27:14 +00:00
|
|
|
const IViewObjectExVtbl *lpViewObjectExVtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl;
|
|
|
|
const IServiceProviderVtbl *lpServiceProviderVtbl;
|
|
|
|
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
|
|
|
|
const IOleControlVtbl *lpOleControlVtbl;
|
|
|
|
const IHlinkTargetVtbl *lpHlinkTargetVtbl;
|
|
|
|
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
|
2008-07-08 16:39:29 +00:00
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
2009-02-04 14:35:06 +00:00
|
|
|
const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl;
|
2010-01-18 16:27:14 +00:00
|
|
|
const IObjectWithSiteVtbl *lpObjectWithSiteVtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
IUnknown *unk_impl;
|
|
|
|
IDispatchEx *dispex;
|
|
|
|
|
|
|
|
HTMLDocumentObj *doc_obj;
|
|
|
|
HTMLDocumentNode *doc_node;
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
HTMLWindow *window;
|
2009-11-15 23:44:20 +00:00
|
|
|
|
|
|
|
LONG task_magic;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
ConnectionPointContainer cp_container;
|
|
|
|
ConnectionPoint cp_htmldocevents;
|
|
|
|
ConnectionPoint cp_htmldocevents2;
|
|
|
|
ConnectionPoint cp_propnotif;
|
2010-01-18 16:27:14 +00:00
|
|
|
ConnectionPoint cp_dispatch;
|
|
|
|
|
|
|
|
IOleAdviseHolder *advise_holder;
|
2009-10-20 19:28:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
return IUnknown_QueryInterface(This->unk_impl, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ULONG htmldoc_addref(HTMLDocument *This)
|
|
|
|
{
|
|
|
|
return IUnknown_AddRef(This->unk_impl);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ULONG htmldoc_release(HTMLDocument *This)
|
|
|
|
{
|
|
|
|
return IUnknown_Release(This->unk_impl);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct HTMLDocumentObj {
|
|
|
|
HTMLDocument basedoc;
|
|
|
|
DispatchEx dispex;
|
|
|
|
const ICustomDocVtbl *lpCustomDocVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
NSContainer *nscontainer;
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
IOleClientSite *client;
|
|
|
|
IDocHostUIHandler *hostui;
|
|
|
|
IOleInPlaceSite *ipsite;
|
|
|
|
IOleInPlaceFrame *frame;
|
|
|
|
IOleInPlaceUIWindow *ip_window;
|
2010-03-02 14:08:15 +00:00
|
|
|
IAdviseSink *view_sink;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
DOCHOSTUIINFO hostinfo;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
IOleUndoManager *undomgr;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
HWND hwnd;
|
|
|
|
HWND tooltips_hwnd;
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
BOOL request_uiactivate;
|
2008-04-11 12:45:31 +00:00
|
|
|
BOOL in_place_active;
|
|
|
|
BOOL ui_active;
|
|
|
|
BOOL window_active;
|
2010-03-06 11:42:03 +00:00
|
|
|
BOOL hostui_setup;
|
2008-04-11 12:45:31 +00:00
|
|
|
BOOL container_locked;
|
|
|
|
BOOL focus;
|
2010-01-18 16:27:14 +00:00
|
|
|
INT download_state;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
|
|
|
USERMODE usermode;
|
2008-04-11 12:45:31 +00:00
|
|
|
LPWSTR mime;
|
|
|
|
|
|
|
|
DWORD update;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NSContainer {
|
|
|
|
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
|
|
|
|
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
|
|
|
|
const nsIURIContentListenerVtbl *lpURIContentListenerVtbl;
|
|
|
|
const nsIEmbeddingSiteWindowVtbl *lpEmbeddingSiteWindowVtbl;
|
|
|
|
const nsITooltipListenerVtbl *lpTooltipListenerVtbl;
|
|
|
|
const nsIInterfaceRequestorVtbl *lpInterfaceRequestorVtbl;
|
|
|
|
const nsIWeakReferenceVtbl *lpWeakReferenceVtbl;
|
|
|
|
const nsISupportsWeakReferenceVtbl *lpSupportsWeakReferenceVtbl;
|
|
|
|
|
|
|
|
nsIWebBrowser *webbrowser;
|
|
|
|
nsIWebNavigation *navigation;
|
|
|
|
nsIBaseWindow *window;
|
|
|
|
nsIWebBrowserFocus *focus;
|
|
|
|
|
|
|
|
nsIEditor *editor;
|
|
|
|
nsIController *editor_controller;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
NSContainer *parent;
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDocumentObj *doc;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
nsIURIContentListener *content_listener;
|
|
|
|
|
|
|
|
HWND hwnd;
|
|
|
|
};
|
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
typedef struct nsWineURI nsWineURI;
|
|
|
|
|
|
|
|
HRESULT set_wine_url(nsWineURI*,LPCWSTR);
|
|
|
|
nsresult on_start_uri_open(NSContainer*,nsIURI*,PRBool*);
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
typedef struct {
|
|
|
|
const nsIHttpChannelVtbl *lpHttpChannelVtbl;
|
|
|
|
const nsIUploadChannelVtbl *lpUploadChannelVtbl;
|
2009-09-05 15:02:49 +00:00
|
|
|
const nsIHttpChannelInternalVtbl *lpIHttpChannelInternalVtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
nsWineURI *uri;
|
2008-04-11 12:45:31 +00:00
|
|
|
nsIInputStream *post_data_stream;
|
|
|
|
nsILoadGroup *load_group;
|
|
|
|
nsIInterfaceRequestor *notif_callback;
|
2009-02-04 14:35:06 +00:00
|
|
|
nsISupports *owner;
|
2008-04-11 12:45:31 +00:00
|
|
|
nsLoadFlags load_flags;
|
|
|
|
nsIURI *original_uri;
|
|
|
|
char *content_type;
|
|
|
|
char *charset;
|
2009-09-05 15:02:49 +00:00
|
|
|
PRUint32 response_status;
|
2010-04-20 17:16:57 +00:00
|
|
|
struct list response_headers;
|
2010-01-18 16:27:14 +00:00
|
|
|
UINT url_scheme;
|
2008-04-11 12:45:31 +00:00
|
|
|
} nsChannel;
|
|
|
|
|
2010-04-20 17:16:57 +00:00
|
|
|
struct ResponseHeader {
|
|
|
|
struct list entry;
|
|
|
|
WCHAR *header;
|
|
|
|
WCHAR *data;
|
|
|
|
};
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
typedef struct {
|
|
|
|
HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
|
|
|
|
void (*destructor)(HTMLDOMNode*);
|
2009-10-20 19:28:02 +00:00
|
|
|
event_target_t **(*get_event_target)(HTMLDOMNode*);
|
2009-11-15 23:44:20 +00:00
|
|
|
HRESULT (*call_event)(HTMLDOMNode*,DWORD,BOOL*);
|
2009-02-04 14:35:06 +00:00
|
|
|
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
|
|
|
|
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
|
2010-01-18 16:27:14 +00:00
|
|
|
HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
|
|
|
|
HRESULT (*get_readystate)(HTMLDOMNode*,BSTR*);
|
|
|
|
HRESULT (*get_dispid)(HTMLDOMNode*,BSTR,DWORD,DISPID*);
|
|
|
|
HRESULT (*invoke)(HTMLDOMNode*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
|
|
|
|
HRESULT (*bind_to_tree)(HTMLDOMNode*);
|
2008-04-11 12:45:31 +00:00
|
|
|
} NodeImplVtbl;
|
|
|
|
|
|
|
|
struct HTMLDOMNode {
|
2008-07-08 16:39:29 +00:00
|
|
|
DispatchEx dispex;
|
|
|
|
const IHTMLDOMNodeVtbl *lpHTMLDOMNodeVtbl;
|
|
|
|
const IHTMLDOMNode2Vtbl *lpHTMLDOMNode2Vtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
const NodeImplVtbl *vtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
nsIDOMNode *nsnode;
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDocumentNode *doc;
|
2008-07-08 16:39:29 +00:00
|
|
|
event_target_t *event_target;
|
2010-01-18 16:27:14 +00:00
|
|
|
ConnectionPointContainer *cp_container;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
HTMLDOMNode *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HTMLDOMNode node;
|
|
|
|
ConnectionPointContainer cp_container;
|
|
|
|
|
|
|
|
const IHTMLElementVtbl *lpHTMLElementVtbl;
|
|
|
|
const IHTMLElement2Vtbl *lpHTMLElement2Vtbl;
|
2009-02-04 14:35:06 +00:00
|
|
|
const IHTMLElement3Vtbl *lpHTMLElement3Vtbl;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
nsIDOMHTMLElement *nselem;
|
|
|
|
} HTMLElement;
|
|
|
|
|
2010-03-02 14:08:15 +00:00
|
|
|
#define HTMLELEMENT_TIDS \
|
|
|
|
IHTMLDOMNode_tid, \
|
|
|
|
IHTMLDOMNode2_tid, \
|
|
|
|
IHTMLElement_tid, \
|
|
|
|
IHTMLElement2_tid, \
|
|
|
|
IHTMLElement3_tid, \
|
|
|
|
IHTMLElement4_tid
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
typedef struct {
|
|
|
|
HTMLElement element;
|
|
|
|
|
|
|
|
const IHTMLTextContainerVtbl *lpHTMLTextContainerVtbl;
|
|
|
|
|
|
|
|
ConnectionPoint cp;
|
|
|
|
} HTMLTextContainer;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
struct HTMLFrameBase {
|
|
|
|
HTMLElement element;
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
const IHTMLFrameBaseVtbl *lpIHTMLFrameBaseVtbl;
|
|
|
|
const IHTMLFrameBase2Vtbl *lpIHTMLFrameBase2Vtbl;
|
2009-11-15 23:44:20 +00:00
|
|
|
|
|
|
|
HTMLWindow *content_window;
|
2010-01-18 16:27:14 +00:00
|
|
|
|
|
|
|
nsIDOMHTMLFrameElement *nsframe;
|
|
|
|
nsIDOMHTMLIFrameElement *nsiframe;
|
2009-11-15 23:44:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _mutation_queue_t {
|
|
|
|
DWORD type;
|
|
|
|
nsISupports *nsiface;
|
|
|
|
|
|
|
|
struct _mutation_queue_t *next;
|
|
|
|
} mutation_queue_t;
|
|
|
|
|
|
|
|
typedef struct nsDocumentEventListener nsDocumentEventListener;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
struct HTMLDocumentNode {
|
|
|
|
HTMLDOMNode node;
|
|
|
|
HTMLDocument basedoc;
|
|
|
|
|
|
|
|
const IInternetHostSecurityManagerVtbl *lpIInternetHostSecurityManagerVtbl;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
const nsIDocumentObserverVtbl *lpIDocumentObserverVtbl;
|
|
|
|
const nsIRunnableVtbl *lpIRunnableVtbl;
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
LONG ref;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
nsIDOMHTMLDocument *nsdoc;
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDOMNode *nodes;
|
2009-11-15 23:44:20 +00:00
|
|
|
BOOL content_ready;
|
2010-01-18 16:27:14 +00:00
|
|
|
event_target_t *body_event_target;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
|
|
|
IInternetSecurityManager *secmgr;
|
2010-01-18 16:27:14 +00:00
|
|
|
ICatInformation *catmgr;
|
2009-11-15 23:44:20 +00:00
|
|
|
nsDocumentEventListener *nsevent_listener;
|
|
|
|
BOOL *event_vector;
|
|
|
|
|
|
|
|
mutation_queue_t *mutation_queue;
|
|
|
|
mutation_queue_t *mutation_queue_tail;
|
2009-10-20 19:28:02 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
struct list bindings;
|
2009-10-20 19:28:02 +00:00
|
|
|
struct list selection_list;
|
|
|
|
struct list range_list;
|
|
|
|
};
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
|
2008-07-08 16:39:29 +00:00
|
|
|
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
|
2010-01-18 16:27:14 +00:00
|
|
|
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
|
|
|
|
#define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
|
|
|
|
#define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
|
|
|
|
#define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
|
2009-11-15 23:44:20 +00:00
|
|
|
#define HTMLDOC6(x) ((IHTMLDocument6*) &(x)->lpHTMLDocument6Vtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
|
|
|
|
#define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
|
|
|
|
#define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
|
|
|
|
#define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
|
|
|
|
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
|
|
|
|
#define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
|
|
|
|
#define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
|
|
|
|
#define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
|
|
|
|
#define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
|
2010-01-18 16:27:14 +00:00
|
|
|
#define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectExVtbl)
|
|
|
|
#define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectExVtbl)
|
|
|
|
#define VIEWOBJEX(x) ((IViewObjectEx*) &(x)->lpViewObjectExVtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
|
|
|
|
#define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
|
|
|
|
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
|
|
|
|
#define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
|
|
|
|
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
|
|
|
|
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
|
|
|
|
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
|
|
|
|
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
|
2009-04-29 17:16:20 +00:00
|
|
|
#define PERSISTHIST(x) ((IPersistHistory*) &(x)->lpPersistHistoryVtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
#define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
|
2010-01-18 16:27:14 +00:00
|
|
|
#define OBJSITE(x) ((IObjectWithSite*) &(x)->lpObjectWithSiteVtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
|
|
|
|
#define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
|
|
|
|
#define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
|
|
|
|
#define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
|
|
|
|
#define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
|
|
|
|
#define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
|
|
|
|
#define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
|
|
|
|
#define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
|
|
|
|
#define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
#define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpIDocumentObserverVtbl)
|
2009-02-04 14:35:06 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
#define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpIRunnableVtbl)
|
2009-02-04 14:35:06 +00:00
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
|
|
|
|
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
|
|
|
|
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
|
2009-09-05 15:02:49 +00:00
|
|
|
#define NSHTTPINTERNAL(x) ((nsIHttpChannelInternal*) &(x)->lpIHttpChannelInternalVtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
|
|
|
|
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
|
|
|
|
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
|
|
|
|
|
|
|
|
#define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
|
|
|
|
#define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
|
2009-02-04 14:35:06 +00:00
|
|
|
#define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
|
2008-07-08 16:39:29 +00:00
|
|
|
#define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
|
2009-11-15 23:44:20 +00:00
|
|
|
#define HTMLFRAMEBASE(x) ((IHTMLFrameBase*) &(x)->lpIHTMLFrameBaseVtbl)
|
2010-01-18 16:27:14 +00:00
|
|
|
#define HTMLFRAMEBASE2(x) ((IHTMLFrameBase2*) &(x)->lpIHTMLFrameBase2Vtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
#define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
|
2010-01-18 16:27:14 +00:00
|
|
|
#define HTMLIMGFACTORY(x) ((IHTMLImageElementFactory*) &(x)->lpHTMLImageElementFactoryVtbl)
|
|
|
|
#define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2008-07-08 16:39:29 +00:00
|
|
|
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
|
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
#define SUPPERRINFO(x) ((ISupportErrorInfo*) &(x)->lpSupportErrorInfoVtbl)
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
#define HOSTSECMGR(x) ((IInternetHostSecurityManager*) &(x)->lpIInternetHostSecurityManagerVtbl)
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
|
|
|
|
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
|
|
|
|
|
|
|
|
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
|
|
|
|
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
|
2009-10-20 19:28:02 +00:00
|
|
|
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow*,HTMLWindow**);
|
|
|
|
void update_window_doc(HTMLWindow*);
|
2008-04-11 12:45:31 +00:00
|
|
|
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
|
2009-11-15 23:44:20 +00:00
|
|
|
nsIDOMWindow *get_nsdoc_window(nsIDOMDocument*);
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*);
|
2009-11-15 23:44:20 +00:00
|
|
|
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*);
|
2009-10-20 19:28:02 +00:00
|
|
|
HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**);
|
2008-04-11 12:45:31 +00:00
|
|
|
IOmNavigator *OmNavigator_Create(void);
|
2010-01-18 16:27:14 +00:00
|
|
|
HRESULT HTMLScreen_Create(IHTMLScreen**);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
void HTMLDocument_HTMLDocument3_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_HTMLDocument5_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_Persist_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_OleCmd_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_OleObj_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_View_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_Window_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_Service_Init(HTMLDocument*);
|
|
|
|
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*);
|
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**);
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
void ConnectionPoint_Init(ConnectionPoint*,ConnectionPointContainer*,REFIID,cp_static_data_t*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
|
|
|
|
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
NSContainer *NSContainer_Create(HTMLDocumentObj*,NSContainer*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void NSContainer_Release(NSContainer*);
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
void init_mutation(HTMLDocumentNode*);
|
|
|
|
void release_mutation(HTMLDocumentNode*);
|
2009-02-04 14:35:06 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL);
|
|
|
|
void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*);
|
|
|
|
void notif_focus(HTMLDocumentObj*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void show_tooltip(HTMLDocumentObj*,DWORD,DWORD,LPCWSTR);
|
|
|
|
void hide_tooltip(HTMLDocumentObj*);
|
2008-04-11 12:45:31 +00:00
|
|
|
HRESULT get_client_disp_property(IOleClientSite*,DISPID,VARIANT*);
|
|
|
|
|
|
|
|
HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**);
|
|
|
|
|
|
|
|
BOOL load_gecko(BOOL);
|
|
|
|
void close_gecko(void);
|
|
|
|
void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*);
|
|
|
|
void init_nsio(nsIComponentManager*,nsIComponentRegistrar*);
|
2009-02-04 14:35:06 +00:00
|
|
|
void release_nsio(void);
|
2008-04-11 12:45:31 +00:00
|
|
|
BOOL install_wine_gecko(BOOL);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*);
|
2010-03-06 11:42:03 +00:00
|
|
|
HRESULT create_doc_uri(HTMLWindow*,WCHAR*,nsWineURI**);
|
|
|
|
HRESULT load_nsuri(HTMLWindow*,nsWineURI*,nsChannelBSC*,DWORD);
|
2009-02-04 14:35:06 +00:00
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsIInputStream*,DWORD,BOOL*);
|
2010-01-18 16:27:14 +00:00
|
|
|
HRESULT navigate_url(HTMLWindow*,const WCHAR*,const WCHAR*);
|
|
|
|
HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*);
|
2010-03-06 11:42:03 +00:00
|
|
|
HRESULT set_moniker(HTMLDocument*,IMoniker*,IBindCtx*,nsChannelBSC*,BOOL);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
void call_property_onchanged(ConnectionPoint*,DISPID);
|
|
|
|
HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*);
|
|
|
|
|
2008-09-10 07:44:02 +00:00
|
|
|
void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
|
2008-04-11 12:45:31 +00:00
|
|
|
void nsfree(void*);
|
|
|
|
|
2010-05-29 14:54:55 +00:00
|
|
|
void nsACString_InitDepend(nsACString*,const char*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void nsACString_SetData(nsACString*,const char*);
|
|
|
|
PRUint32 nsACString_GetData(const nsACString*,const char**);
|
2010-05-29 14:54:55 +00:00
|
|
|
void nsACString_Finish(nsACString*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2010-03-02 14:08:15 +00:00
|
|
|
BOOL nsAString_Init(nsAString*,const PRUnichar*);
|
|
|
|
void nsAString_InitDepend(nsAString*,const PRUnichar*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void nsAString_SetData(nsAString*,const PRUnichar*);
|
|
|
|
PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**);
|
|
|
|
void nsAString_Finish(nsAString*);
|
|
|
|
|
|
|
|
nsICommandParams *create_nscommand_params(void);
|
2009-09-05 15:02:49 +00:00
|
|
|
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void get_editor_controller(NSContainer*);
|
|
|
|
nsresult get_nsinterface(nsISupports*,REFIID,void**);
|
2008-07-08 16:39:29 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
void init_nsevents(HTMLDocumentNode*);
|
|
|
|
void release_nsevents(HTMLDocumentNode*);
|
2010-03-21 15:12:30 +00:00
|
|
|
void add_nsevent_listener(HTMLDocumentNode*,nsIDOMNode*,LPCWSTR);
|
2009-11-15 23:44:20 +00:00
|
|
|
|
|
|
|
void set_window_bscallback(HTMLWindow*,nsChannelBSC*);
|
|
|
|
void set_current_mon(HTMLWindow*,IMoniker*);
|
|
|
|
HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*);
|
2010-03-06 11:42:03 +00:00
|
|
|
HRESULT async_start_doc_binding(HTMLWindow*,nsChannelBSC*);
|
2009-11-15 23:44:20 +00:00
|
|
|
void abort_document_bindings(HTMLDocumentNode*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
HRESULT bind_mon_to_buffer(HTMLDocumentNode*,IMoniker*,void**,DWORD*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2010-03-06 11:42:03 +00:00
|
|
|
HRESULT create_channelbsc(IMoniker*,WCHAR*,BYTE*,DWORD,nsChannelBSC**);
|
2008-04-11 12:45:31 +00:00
|
|
|
HRESULT channelbsc_load_stream(nsChannelBSC*,IStream*);
|
|
|
|
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*);
|
|
|
|
IMoniker *get_channelbsc_mon(nsChannelBSC*);
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
void set_ready_state(HTMLWindow*,READYSTATE);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**);
|
|
|
|
HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**);
|
2008-04-11 12:45:31 +00:00
|
|
|
IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*);
|
|
|
|
IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*);
|
|
|
|
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void detach_selection(HTMLDocumentNode*);
|
|
|
|
void detach_ranges(HTMLDocumentNode*);
|
2009-02-04 14:35:06 +00:00
|
|
|
HRESULT get_node_text(HTMLDOMNode*,BSTR*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*);
|
2008-07-08 16:39:29 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLElement *HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL);
|
|
|
|
HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*);
|
2009-11-15 23:44:20 +00:00
|
|
|
HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
2010-01-18 16:27:14 +00:00
|
|
|
HTMLElement *HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
2009-11-15 23:44:20 +00:00
|
|
|
HTMLElement *HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
|
|
|
HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*);
|
2009-11-15 23:44:20 +00:00
|
|
|
void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
|
2008-04-11 12:45:31 +00:00
|
|
|
void HTMLElement2_Init(HTMLElement*);
|
2009-02-04 14:35:06 +00:00
|
|
|
void HTMLElement3_Init(HTMLElement*);
|
2009-11-15 23:44:20 +00:00
|
|
|
void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
|
2010-01-18 16:27:14 +00:00
|
|
|
void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
|
|
|
|
void HTMLDOMNode_destructor(HTMLDOMNode*);
|
|
|
|
|
|
|
|
HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**);
|
|
|
|
void HTMLElement_destructor(HTMLDOMNode*);
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**);
|
|
|
|
void HTMLFrameBase_destructor(HTMLFrameBase*);
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
HTMLDOMNode *get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL);
|
|
|
|
void release_nodes(HTMLDocumentNode*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void release_script_hosts(HTMLWindow*);
|
|
|
|
void connect_scripts(HTMLWindow*);
|
|
|
|
void doc_insert_script(HTMLWindow*,nsIDOMHTMLScriptElement*);
|
|
|
|
IDispatch *script_parse_event(HTMLWindow*,LPCWSTR);
|
|
|
|
void set_script_mode(HTMLWindow*,SCRIPTMODE);
|
|
|
|
BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*);
|
|
|
|
IDispatch *get_script_disp(ScriptHost*);
|
2010-01-18 16:27:14 +00:00
|
|
|
HRESULT search_window_props(HTMLWindow*,BSTR,DWORD,DISPID*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL);
|
2009-10-20 19:28:02 +00:00
|
|
|
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,IUnknown*,nsIDOMNodeList*);
|
|
|
|
IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,IUnknown*,nsIDOMHTMLCollection*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
/* commands */
|
|
|
|
typedef struct {
|
|
|
|
DWORD id;
|
|
|
|
HRESULT (*query)(HTMLDocument*,OLECMD*);
|
|
|
|
HRESULT (*exec)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
|
|
|
} cmdtable_t;
|
|
|
|
|
|
|
|
extern const cmdtable_t editmode_cmds[];
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void do_ns_command(HTMLDocument*,const char*,nsICommandParams*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
/* timer */
|
|
|
|
#define UPDATE_UI 0x0001
|
|
|
|
#define UPDATE_TITLE 0x0002
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
void update_doc(HTMLDocument*,DWORD);
|
|
|
|
void update_title(HTMLDocumentObj*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
/* editor */
|
|
|
|
void init_editor(HTMLDocument*);
|
|
|
|
void handle_edit_event(HTMLDocument*,nsIDOMEvent*);
|
|
|
|
HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
|
|
|
HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
|
|
|
HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
|
|
|
void handle_edit_load(HTMLDocument*);
|
|
|
|
HRESULT editor_is_dirty(HTMLDocument*);
|
|
|
|
void set_dirty(HTMLDocument*,VARIANT_BOOL);
|
|
|
|
|
|
|
|
extern DWORD mshtml_tls;
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
typedef struct task_t task_t;
|
|
|
|
typedef void (*task_proc_t)(task_t*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
struct task_t {
|
|
|
|
LONG target_magic;
|
|
|
|
task_proc_t proc;
|
2008-04-11 12:45:31 +00:00
|
|
|
struct task_t *next;
|
2009-11-15 23:44:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
task_t header;
|
|
|
|
HTMLDocumentObj *doc;
|
|
|
|
} docobj_task_t;
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HWND thread_hwnd;
|
|
|
|
task_t *task_queue_head;
|
|
|
|
task_t *task_queue_tail;
|
2008-07-08 16:39:29 +00:00
|
|
|
struct list timer_list;
|
2008-04-11 12:45:31 +00:00
|
|
|
} thread_data_t;
|
|
|
|
|
|
|
|
thread_data_t *get_thread_data(BOOL);
|
|
|
|
HWND get_thread_hwnd(void);
|
2009-11-15 23:44:20 +00:00
|
|
|
|
|
|
|
LONG get_task_target_magic(void);
|
|
|
|
void push_task(task_t*,task_proc_t,LONG);
|
|
|
|
void remove_target_tasks(LONG);
|
|
|
|
|
2008-07-08 16:39:29 +00:00
|
|
|
DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*);
|
|
|
|
HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
2008-07-08 16:39:29 +00:00
|
|
|
void release_typelib(void);
|
2009-10-20 19:28:02 +00:00
|
|
|
HRESULT call_disp_func(IDispatch*,DISPPARAMS*);
|
2009-02-04 14:35:06 +00:00
|
|
|
|
|
|
|
const char *debugstr_variant(const VARIANT*);
|
2008-04-11 12:45:31 +00:00
|
|
|
|
|
|
|
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
|
|
|
|
|
|
|
|
DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
|
|
|
|
|
|
|
|
/* memory allocation functions */
|
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
|
2008-04-11 12:45:31 +00:00
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
|
2008-04-11 12:45:31 +00:00
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
2009-02-04 14:35:06 +00:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
|
2008-04-11 12:45:31 +00:00
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
2009-10-20 19:28:02 +00:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
|
|
|
|
}
|
|
|
|
|
2008-04-11 12:45:31 +00:00
|
|
|
static inline BOOL heap_free(void *mem)
|
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline LPWSTR heap_strdupW(LPCWSTR str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = (strlenW(str)+1)*sizeof(WCHAR);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline char *heap_strdupA(const char *str)
|
|
|
|
{
|
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = strlen(str)+1;
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline WCHAR *heap_strdupAtoW(const char *str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
|
|
|
ret = heap_alloc(len*sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline char *heap_strdupWtoA(LPCWSTR str)
|
|
|
|
{
|
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-11-15 23:44:20 +00:00
|
|
|
static inline void windowref_addref(windowref_t *ref)
|
|
|
|
{
|
|
|
|
InterlockedIncrement(&ref->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void windowref_release(windowref_t *ref)
|
|
|
|
{
|
|
|
|
if(!InterlockedDecrement(&ref->ref))
|
|
|
|
heap_free(ref);
|
|
|
|
}
|
|
|
|
|
2010-01-18 16:27:14 +00:00
|
|
|
HDC get_display_dc(void);
|
2008-04-11 12:45:31 +00:00
|
|
|
HINSTANCE get_shdoclc(void);
|
|
|
|
|
|
|
|
extern HINSTANCE hInst;
|