2001-01-11 23:32:44 +01:00
|
|
|
/*
|
2002-05-05 21:40:57 +02:00
|
|
|
* Header includes for shdocvw.dll
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
2006-01-25 13:14:57 +01:00
|
|
|
* Copyright 2005-2006 Jacek Caban for CodeWeavers
|
2002-03-10 00:29:33 +01: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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-01-11 23:32:44 +01:00
|
|
|
*/
|
|
|
|
|
2002-05-05 21:40:57 +02:00
|
|
|
#ifndef __WINE_SHDOCVW_H
|
|
|
|
#define __WINE_SHDOCVW_H
|
|
|
|
|
2005-09-06 13:41:14 +02:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
#include "winbase.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "wingdi.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
#include "winuser.h"
|
|
|
|
|
2002-12-05 21:33:07 +01:00
|
|
|
#include "ole2.h"
|
|
|
|
#include "olectl.h"
|
|
|
|
#include "shlobj.h"
|
2003-09-04 04:00:46 +02:00
|
|
|
#include "exdisp.h"
|
2005-11-17 12:03:53 +01:00
|
|
|
#include "mshtmhst.h"
|
2006-02-08 12:42:23 +01:00
|
|
|
#include "hlink.h"
|
2010-05-20 13:47:02 +02:00
|
|
|
#include "htiframe.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2008-01-18 21:53:06 +01:00
|
|
|
#include "wine/unicode.h"
|
2011-01-07 19:07:05 +01:00
|
|
|
#include "wine/list.h"
|
2010-06-20 20:25:34 +02:00
|
|
|
#include "resource.h"
|
|
|
|
|
2008-01-18 21:53:06 +01:00
|
|
|
|
2010-07-27 14:23:14 +02:00
|
|
|
#define WM_UPDATEADDRBAR (WM_APP+1)
|
|
|
|
|
2005-11-08 17:12:06 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* Shell Instance Objects
|
|
|
|
*/
|
|
|
|
extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
|
2011-05-13 18:17:44 +02:00
|
|
|
REFIID riid, LPVOID *ppvClassObj) DECLSPEC_HIDDEN;
|
2002-05-05 21:40:57 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
2005-09-06 13:41:14 +02:00
|
|
|
* WebBrowser declaration for SHDOCVW.DLL
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
2005-12-02 11:26:32 +01:00
|
|
|
|
|
|
|
typedef struct ConnectionPoint ConnectionPoint;
|
2008-01-18 21:53:25 +01:00
|
|
|
typedef struct DocHost DocHost;
|
2005-12-02 11:26:32 +01:00
|
|
|
|
2006-05-17 18:25:33 +02:00
|
|
|
typedef struct {
|
2010-11-13 17:48:34 +01:00
|
|
|
IConnectionPointContainer IConnectionPointContainer_iface;
|
2006-05-17 18:26:30 +02:00
|
|
|
|
2006-05-17 18:25:33 +02:00
|
|
|
ConnectionPoint *wbe2;
|
|
|
|
ConnectionPoint *wbe;
|
|
|
|
ConnectionPoint *pns;
|
2006-05-17 18:26:30 +02:00
|
|
|
|
|
|
|
IUnknown *impl;
|
2006-05-17 18:25:33 +02:00
|
|
|
} ConnectionPointContainer;
|
|
|
|
|
2010-07-27 18:14:54 +02:00
|
|
|
typedef struct {
|
2010-11-13 17:48:21 +01:00
|
|
|
IHlinkFrame IHlinkFrame_iface;
|
|
|
|
ITargetFrame2 ITargetFrame2_iface;
|
2010-07-27 18:14:54 +02:00
|
|
|
|
|
|
|
IUnknown *outer;
|
|
|
|
DocHost *doc_host;
|
|
|
|
} HlinkFrame;
|
|
|
|
|
2008-01-18 21:53:25 +01:00
|
|
|
struct _task_header_t;
|
|
|
|
|
|
|
|
typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
|
2011-05-26 17:01:31 +02:00
|
|
|
typedef void (*task_destr_t)(struct _task_header_t*);
|
2008-01-18 21:53:25 +01:00
|
|
|
|
|
|
|
typedef struct _task_header_t {
|
2011-05-26 17:01:42 +02:00
|
|
|
struct list entry;
|
2008-01-18 21:53:25 +01:00
|
|
|
task_proc_t proc;
|
2011-05-26 17:01:31 +02:00
|
|
|
task_destr_t destr;
|
2008-01-18 21:53:25 +01:00
|
|
|
} task_header_t;
|
|
|
|
|
2010-07-29 10:28:02 +02:00
|
|
|
typedef struct _IDocHostContainerVtbl
|
|
|
|
{
|
2011-01-07 19:03:23 +01:00
|
|
|
ULONG (*addref)(DocHost*);
|
|
|
|
ULONG (*release)(DocHost*);
|
2010-07-29 10:28:02 +02:00
|
|
|
void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
|
|
|
|
HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
|
|
|
|
void (WINAPI* SetURL)(DocHost*,LPCWSTR);
|
2010-11-12 14:30:03 +01:00
|
|
|
HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
|
2010-07-29 10:28:02 +02:00
|
|
|
} IDocHostContainerVtbl;
|
|
|
|
|
2008-01-18 21:53:25 +01:00
|
|
|
struct DocHost {
|
2010-11-13 17:47:58 +01:00
|
|
|
IOleClientSite IOleClientSite_iface;
|
2011-06-06 00:02:02 +02:00
|
|
|
IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
|
2010-11-13 17:48:09 +01:00
|
|
|
IDocHostUIHandler2 IDocHostUIHandler2_iface;
|
|
|
|
IOleDocumentSite IOleDocumentSite_iface;
|
2010-11-17 13:12:20 +01:00
|
|
|
IOleControlSite IOleControlSite_iface;
|
2010-11-13 17:48:09 +01:00
|
|
|
IOleCommandTarget IOleCommandTarget_iface;
|
|
|
|
IDispatch IDispatch_iface;
|
|
|
|
IPropertyNotifySink IPropertyNotifySink_iface;
|
|
|
|
IServiceProvider IServiceProvider_iface;
|
2006-04-18 00:24:59 +02:00
|
|
|
|
2006-04-18 00:36:09 +02:00
|
|
|
/* Interfaces of InPlaceFrame object */
|
2010-11-13 17:48:34 +01:00
|
|
|
IOleInPlaceFrame IOleInPlaceFrame_iface;
|
2006-04-18 00:36:09 +02:00
|
|
|
|
2006-04-18 00:24:59 +02:00
|
|
|
IDispatch *disp;
|
|
|
|
|
2007-03-09 16:50:01 +01:00
|
|
|
IDispatch *client_disp;
|
|
|
|
IDocHostUIHandler *hostui;
|
2007-03-09 16:56:02 +01:00
|
|
|
IOleInPlaceFrame *frame;
|
2007-03-09 16:50:01 +01:00
|
|
|
|
2006-04-18 00:31:22 +02:00
|
|
|
IUnknown *document;
|
|
|
|
IOleDocumentView *view;
|
2010-03-13 16:43:24 +01:00
|
|
|
IUnknown *doc_navigate;
|
2006-04-18 00:28:37 +02:00
|
|
|
|
2010-07-29 10:28:02 +02:00
|
|
|
const IDocHostContainerVtbl *container_vtbl;
|
|
|
|
|
2006-04-18 00:26:47 +02:00
|
|
|
HWND hwnd;
|
|
|
|
HWND frame_hwnd;
|
2006-04-18 00:41:43 +02:00
|
|
|
|
2011-05-26 17:01:42 +02:00
|
|
|
struct list task_queue;
|
|
|
|
|
2006-04-18 00:42:45 +02:00
|
|
|
LPOLESTR url;
|
|
|
|
|
2007-03-09 16:52:16 +01:00
|
|
|
VARIANT_BOOL silent;
|
|
|
|
VARIANT_BOOL offline;
|
2008-03-13 13:16:41 +01:00
|
|
|
VARIANT_BOOL busy;
|
2007-03-09 16:52:16 +01:00
|
|
|
|
2009-08-30 01:02:03 +02:00
|
|
|
READYSTATE ready_state;
|
2010-03-13 16:43:48 +01:00
|
|
|
READYSTATE doc_state;
|
2009-08-30 01:02:03 +02:00
|
|
|
DWORD prop_notif_cookie;
|
|
|
|
BOOL is_prop_notif;
|
|
|
|
|
2006-05-17 18:25:33 +02:00
|
|
|
ConnectionPointContainer cps;
|
2008-01-18 21:53:25 +01:00
|
|
|
};
|
2006-04-18 00:24:59 +02:00
|
|
|
|
2006-08-03 02:36:15 +02:00
|
|
|
struct WebBrowser {
|
2010-11-13 17:47:31 +01:00
|
|
|
IWebBrowser2 IWebBrowser2_iface;
|
|
|
|
IOleObject IOleObject_iface;
|
|
|
|
IOleInPlaceObject IOleInPlaceObject_iface;
|
|
|
|
IOleControl IOleControl_iface;
|
2010-11-13 17:47:44 +01:00
|
|
|
IPersistStorage IPersistStorage_iface;
|
|
|
|
IPersistMemory IPersistMemory_iface;
|
|
|
|
IPersistStreamInit IPersistStreamInit_iface;
|
|
|
|
IProvideClassInfo2 IProvideClassInfo2_iface;
|
|
|
|
IViewObject2 IViewObject2_iface;
|
2010-11-13 17:47:31 +01:00
|
|
|
IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
|
|
|
|
IOleCommandTarget IOleCommandTarget_iface;
|
|
|
|
IServiceProvider IServiceProvider_iface;
|
2010-11-13 17:47:44 +01:00
|
|
|
IDataObject IDataObject_iface;
|
2010-07-27 18:14:54 +02:00
|
|
|
HlinkFrame hlink_frame;
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-07-13 13:59:15 +02:00
|
|
|
LONG ref;
|
2005-09-16 20:44:37 +02:00
|
|
|
|
2006-05-23 20:03:30 +02:00
|
|
|
INT version;
|
|
|
|
|
2005-09-16 20:44:37 +02:00
|
|
|
IOleClientSite *client;
|
2005-11-16 12:46:56 +01:00
|
|
|
IOleContainer *container;
|
2011-06-06 00:02:02 +02:00
|
|
|
IOleInPlaceSiteEx *inplace;
|
2005-11-16 12:46:56 +01:00
|
|
|
|
|
|
|
/* window context */
|
|
|
|
|
|
|
|
HWND frame_hwnd;
|
|
|
|
IOleInPlaceUIWindow *uiwindow;
|
|
|
|
RECT pos_rect;
|
|
|
|
RECT clip_rect;
|
|
|
|
OLEINPLACEFRAMEINFO frameinfo;
|
2006-07-31 13:22:32 +02:00
|
|
|
SIZEL extent;
|
2005-11-17 12:40:55 +01:00
|
|
|
|
2005-11-22 12:59:57 +01:00
|
|
|
HWND shell_embedding_hwnd;
|
|
|
|
|
2008-05-12 16:22:10 +02:00
|
|
|
VARIANT_BOOL register_browser;
|
2006-04-28 20:29:07 +02:00
|
|
|
VARIANT_BOOL visible;
|
2006-04-28 23:45:36 +02:00
|
|
|
VARIANT_BOOL menu_bar;
|
2006-04-29 13:33:05 +02:00
|
|
|
VARIANT_BOOL address_bar;
|
2006-04-29 13:34:38 +02:00
|
|
|
VARIANT_BOOL status_bar;
|
2006-04-29 13:35:29 +02:00
|
|
|
VARIANT_BOOL tool_bar;
|
2007-09-23 22:37:01 +02:00
|
|
|
VARIANT_BOOL full_screen;
|
2008-02-22 11:34:06 +01:00
|
|
|
VARIANT_BOOL theater_mode;
|
2006-04-28 20:29:07 +02:00
|
|
|
|
2006-04-18 00:24:59 +02:00
|
|
|
DocHost doc_host;
|
2006-08-03 02:36:15 +02:00
|
|
|
};
|
2005-09-06 13:41:14 +02:00
|
|
|
|
2011-01-07 19:03:23 +01:00
|
|
|
typedef struct {
|
|
|
|
DocHost doc_host;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
InternetExplorer *ie;
|
|
|
|
} IEDocHost;
|
|
|
|
|
2006-08-03 02:36:15 +02:00
|
|
|
struct InternetExplorer {
|
2010-11-13 17:47:19 +01:00
|
|
|
IWebBrowser2 IWebBrowser2_iface;
|
2010-07-27 18:15:38 +02:00
|
|
|
HlinkFrame hlink_frame;
|
2006-04-19 20:33:32 +02:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HWND frame_hwnd;
|
2010-07-29 11:35:42 +02:00
|
|
|
HWND status_hwnd;
|
2010-07-29 12:04:46 +02:00
|
|
|
HMENU menu;
|
2011-01-07 19:07:05 +01:00
|
|
|
BOOL nohome;
|
2006-04-19 20:33:32 +02:00
|
|
|
|
2011-01-07 19:07:05 +01:00
|
|
|
struct list entry;
|
2011-01-07 19:03:23 +01:00
|
|
|
IEDocHost *doc_host;
|
2006-08-03 02:36:15 +02:00
|
|
|
};
|
2006-04-19 20:33:32 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
|
|
|
|
void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
|
|
|
|
void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
|
|
|
|
void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
|
2006-04-18 00:41:43 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
|
|
|
|
void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
|
2005-11-28 11:01:17 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
|
2006-05-17 18:26:30 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
|
|
|
|
void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
|
2005-11-16 12:46:56 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
|
2010-07-27 18:14:54 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT ShellBrowser_Create(IShellBrowser**) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
|
|
|
|
void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
|
|
|
|
void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
|
2005-11-28 11:17:28 +01:00
|
|
|
|
2008-01-18 21:53:25 +01:00
|
|
|
#define WM_DOCHOSTTASK (WM_USER+0x300)
|
2011-05-26 17:01:31 +02:00
|
|
|
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
|
2011-05-26 17:01:42 +02:00
|
|
|
LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
|
2011-05-26 17:02:03 +02:00
|
|
|
void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
|
2008-01-18 21:53:25 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
|
|
|
void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
|
2006-04-19 20:33:32 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
void released_obj(void) DECLSPEC_HIDDEN;
|
2011-01-07 19:03:23 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
2006-10-25 23:06:35 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
2008-08-03 11:18:26 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT TaskbarList_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2005-01-27 11:43:53 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* Dll lifetime tracking declaration for shdocvw.dll
|
|
|
|
*/
|
2011-05-13 18:17:44 +02:00
|
|
|
extern LONG SHDOCVW_refCount DECLSPEC_HIDDEN;
|
2005-06-20 16:18:03 +02:00
|
|
|
static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
|
|
|
|
static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
|
2005-01-27 11:43:53 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
extern HINSTANCE shdocvw_hinstance DECLSPEC_HIDDEN;
|
|
|
|
extern void register_iewindow_class(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
|
2005-11-22 12:59:57 +01:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
HRESULT register_class_object(BOOL) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT get_typeinfo(ITypeInfo**) DECLSPEC_HIDDEN;
|
|
|
|
DWORD register_iexplore(BOOL) DECLSPEC_HIDDEN;
|
2006-04-19 20:37:57 +02:00
|
|
|
|
2011-05-13 18:17:44 +02:00
|
|
|
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
|
2009-10-11 21:24:51 +02:00
|
|
|
|
2006-05-11 06:45:43 +02:00
|
|
|
/* memory allocation functions */
|
|
|
|
|
2007-11-28 00:09:35 +01:00
|
|
|
static inline void *heap_alloc(size_t len)
|
2006-05-11 06:45:43 +02:00
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
2010-03-13 16:43:06 +01:00
|
|
|
static inline void *heap_alloc_zero(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
2007-11-28 00:09:35 +01:00
|
|
|
static inline void *heap_realloc(void *mem, size_t len)
|
2006-05-11 06:45:43 +02:00
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
2007-11-28 00:09:35 +01:00
|
|
|
static inline BOOL heap_free(void *mem)
|
2006-05-11 06:45:43 +02:00
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
2008-01-18 21:53:06 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2008-08-03 11:18:26 +02:00
|
|
|
static inline LPWSTR co_strdupW(LPCWSTR str)
|
|
|
|
{
|
|
|
|
WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
|
|
|
|
if (ret)
|
|
|
|
lstrcpyW(ret, str);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline LPWSTR co_strdupAtoW(LPCSTR str)
|
|
|
|
{
|
|
|
|
INT len;
|
|
|
|
WCHAR *ret;
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
|
|
|
ret = CoTaskMemAlloc(len*sizeof(WCHAR));
|
|
|
|
if (ret)
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline LPSTR co_strdupWtoA(LPCWSTR str)
|
|
|
|
{
|
|
|
|
INT len;
|
|
|
|
CHAR *ret;
|
|
|
|
len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
|
|
|
|
ret = CoTaskMemAlloc(len);
|
|
|
|
if (ret)
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2002-05-05 21:40:57 +02:00
|
|
|
#endif /* __WINE_SHDOCVW_H */
|