Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e5b5eb69
Commit
e5b5eb69
authored
Sep 08, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make IPersist* interfaces heap based.
parent
2312fdeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
140 deletions
+124
-140
persist.c
dlls/shdocvw/persist.c
+104
-102
shdocvw.h
dlls/shdocvw/shdocvw.h
+9
-31
webbrowser.c
dlls/shdocvw/webbrowser.c
+11
-7
No files found.
dlls/shdocvw/persist.c
View file @
e5b5eb69
/*
* Implementation of IPersist interfaces for
IE Web
Browser control
* Implementation of IPersist interfaces for
Web
Browser control
*
* Copyright 2001 John R. Sheets (for CodeWeavers)
* Copyright 2005 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -27,168 +28,169 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
* Implement the IPersistStorage interface
*/
static
HRESULT
WINAPI
WBPS_QueryInterface
(
LPPERSISTSTORAGE
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
#define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
static
HRESULT
WINAPI
PersistStorage_QueryInterface
(
IPersistStorage
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_QueryInterface
(
WEBBROWSER
(
This
),
riid
,
ppobj
);
}
static
ULONG
WINAPI
WBPS_AddRef
(
LPPERSISTSTORAGE
iface
)
static
ULONG
WINAPI
PersistStorage_AddRef
(
IPersistStorage
*
iface
)
{
SHDOCVW_LockModule
();
return
2
;
/* non-heap based object */
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_AddRef
(
WEBBROWSER
(
This
));
}
static
ULONG
WINAPI
WBPS_Release
(
LPPERSISTSTORAGE
iface
)
static
ULONG
WINAPI
PersistStorage_Release
(
IPersistStorage
*
iface
)
{
SHDOCVW_UnlockModule
();
return
1
;
/* non-heap based object */
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_Release
(
WEBBROWSER
(
This
));
}
static
HRESULT
WINAPI
WBPS_GetClassID
(
LPPERSISTSTORAGE
iface
,
CLSID
*
pClassID
)
static
HRESULT
WINAPI
PersistStorage_GetClassID
(
IPersistStorage
*
iface
,
CLSID
*
pClassID
)
{
FIXME
(
"stub: CLSID = %s
\n
"
,
debugstr_guid
(
pClassID
));
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pClassID
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPS_IsDirty
(
LPPERSISTSTORAGE
iface
)
static
HRESULT
WINAPI
PersistStorage_IsDirty
(
IPersistStorage
*
iface
)
{
FIXME
(
"stub
\n
"
);
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPS_InitNew
(
LPPERSISTSTORAGE
iface
,
LPSTORAGE
pStg
)
static
HRESULT
WINAPI
PersistStorage_InitNew
(
IPersistStorage
*
iface
,
LPSTORAGE
pStg
)
{
FIXME
(
"stub: LPSTORAGE = %p
\n
"
,
pStg
);
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStg
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPS_Load
(
LPPERSISTSTORAGE
iface
,
LPSTORAGE
pStg
)
static
HRESULT
WINAPI
PersistStorage_Load
(
IPersistStorage
*
iface
,
LPSTORAGE
pStg
)
{
FIXME
(
"stub: LPSTORAGE = %p
\n
"
,
pStg
);
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStg
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPS_Save
(
LPPERSISTSTORAGE
iface
,
LPSTORAGE
pStg
,
BOOL
fSameAsLoad
)
static
HRESULT
WINAPI
PersistStorage_Save
(
IPersistStorage
*
iface
,
LPSTORAGE
pStg
,
BOOL
fSameAsLoad
)
{
FIXME
(
"stub: LPSTORAGE = %p, fSameAsLoad = %d
\n
"
,
pStg
,
fSameAsLoad
);
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)->(%p %x)
\n
"
,
This
,
pStg
,
fSameAsLoad
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPS_SaveCompleted
(
LPPERSISTSTORAGE
iface
,
LPSTORAGE
pStgNew
)
static
HRESULT
WINAPI
PersistStorage_SaveCompleted
(
IPersistStorage
*
iface
,
LPSTORAGE
pStgNew
)
{
FIXME
(
"stub: LPSTORAGE = %p
\n
"
,
pStgNew
);
return
S_OK
;
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStgNew
);
return
E_NOTIMPL
;
}
/**********************************************************************
* IPersistStorage virtual function table for IE Web Browser component
*/
#define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
static
const
IPersistStorageVtbl
WBPS_
Vtbl
=
{
WBPS
_QueryInterface
,
WBPS
_AddRef
,
WBPS
_Release
,
WBPS
_GetClassID
,
WBPS
_IsDirty
,
WBPS
_InitNew
,
WBPS
_Load
,
WBPS
_Save
,
WBPS
_SaveCompleted
static
const
IPersistStorageVtbl
PersistStorage
Vtbl
=
{
PersistStorage
_QueryInterface
,
PersistStorage
_AddRef
,
PersistStorage
_Release
,
PersistStorage
_GetClassID
,
PersistStorage
_IsDirty
,
PersistStorage
_InitNew
,
PersistStorage
_Load
,
PersistStorage
_Save
,
PersistStorage
_SaveCompleted
};
IPersistStorageImpl
SHDOCVW_PersistStorage
=
{
&
WBPS_Vtbl
};
/**********************************************************************
* Implement the IPersistStreamInit interface
*/
static
HRESULT
WINAPI
WBPSI_QueryInterface
(
LPPERSISTSTREAMINIT
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
#define PERSTRINIT_THIS(iface) DEFINE_THIS(WebBrowser, PersistStreamInit, iface)
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
static
HRESULT
WINAPI
PersistStreamInit_QueryInterface
(
IPersistStreamInit
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_QueryInterface
(
WEBBROWSER
(
This
),
riid
,
ppobj
);
}
static
ULONG
WINAPI
WBPSI_AddRef
(
LPPERSISTSTREAMINIT
iface
)
static
ULONG
WINAPI
PersistStreamInit_AddRef
(
IPersistStreamInit
*
iface
)
{
SHDOCVW_LockModule
();
return
2
;
/* non-heap based object */
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_AddRef
(
WEBBROWSER
(
This
));
}
static
ULONG
WINAPI
WBPSI_Release
(
LPPERSISTSTREAMINIT
iface
)
static
ULONG
WINAPI
PersistStreamInit_Release
(
IPersistStreamInit
*
iface
)
{
SHDOCVW_UnlockModule
();
return
1
;
/* non-heap based object */
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_Release
(
WEBBROWSER
(
This
));
}
static
HRESULT
WINAPI
WBPSI_GetClassID
(
LPPERSISTSTREAMINIT
iface
,
CLSID
*
pClassID
)
static
HRESULT
WINAPI
PersistStreamInit_GetClassID
(
IPersistStreamInit
*
iface
,
CLSID
*
pClassID
)
{
FIXME
(
"stub: CLSID = %s
\n
"
,
debugstr_guid
(
pClassID
)
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IPersistStorage_GetClassID
(
PERSTORAGE
(
This
),
pClassID
)
;
}
static
HRESULT
WINAPI
WBPSI_IsDirty
(
LPPERSISTSTREAMINIT
iface
)
static
HRESULT
WINAPI
PersistStreamInit_IsDirty
(
IPersistStreamInit
*
iface
)
{
FIXME
(
"stub
\n
"
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IPersistStorage_IsDirty
(
PERSTORAGE
(
This
))
;
}
static
HRESULT
WINAPI
WBPSI_Load
(
LPPERSISTSTREAMINIT
iface
,
LPSTREAM
pStg
)
static
HRESULT
WINAPI
PersistStreamInit_Load
(
IPersistStreamInit
*
iface
,
LPSTREAM
pStg
)
{
FIXME
(
"stub: LPSTORAGE = %p
\n
"
,
pStg
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStg
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPSI_Save
(
LPPERSISTSTREAMINIT
iface
,
LPSTREAM
pStg
,
BOOL
fSameAsLoad
)
static
HRESULT
WINAPI
PersistStreamInit_Save
(
IPersistStreamInit
*
iface
,
LPSTREAM
pStg
,
BOOL
fSameAsLoad
)
{
FIXME
(
"stub: LPSTORAGE = %p, fSameAsLoad = %d
\n
"
,
pStg
,
fSameAsLoad
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
FIXME
(
"(%p)->(%p %x)
\n
"
,
This
,
pStg
,
fSameAsLoad
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPSI_GetSizeMax
(
LPPERSISTSTREAMINIT
iface
,
ULARGE_INTEGER
*
pcbSize
)
static
HRESULT
WINAPI
PersistStreamInit_GetSizeMax
(
IPersistStreamInit
*
iface
,
ULARGE_INTEGER
*
pcbSize
)
{
FIXME
(
"stub: ULARGE_INTEGER = %p
\n
"
,
pcbSize
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pcbSize
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WBPSI_InitNew
(
LPPERSISTSTREAMINIT
iface
)
static
HRESULT
WINAPI
PersistStreamInit_InitNew
(
IPersistStreamInit
*
iface
)
{
FIXME
(
"stub
\n
"
);
return
S_OK
;
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
/**********************************************************************
* IPersistStreamInit virtual function table for IE Web Browser component
*/
#undef PERSTRINIT_THIS
static
const
IPersistStreamInitVtbl
WBPSI_
Vtbl
=
{
WBPSI
_QueryInterface
,
WBPSI
_AddRef
,
WBPSI
_Release
,
WBPSI
_GetClassID
,
WBPSI
_IsDirty
,
WBPSI
_Load
,
WBPSI
_Save
,
WBPSI
_GetSizeMax
,
WBPSI
_InitNew
static
const
IPersistStreamInitVtbl
PersistStreamInit
Vtbl
=
{
PersistStreamInit
_QueryInterface
,
PersistStreamInit
_AddRef
,
PersistStreamInit
_Release
,
PersistStreamInit
_GetClassID
,
PersistStreamInit
_IsDirty
,
PersistStreamInit
_Load
,
PersistStreamInit
_Save
,
PersistStreamInit
_GetSizeMax
,
PersistStreamInit
_InitNew
};
IPersistStreamInitImpl
SHDOCVW_PersistStreamInit
=
{
&
WBPSI_Vtbl
};
void
WebBrowser_Persist_Init
(
WebBrowser
*
This
)
{
This
->
lpPersistStorageVtbl
=
&
PersistStorageVtbl
;
This
->
lpPersistStreamInitVtbl
=
&
PersistStreamInitVtbl
;
}
dlls/shdocvw/shdocvw.h
View file @
e5b5eb69
...
...
@@ -53,10 +53,12 @@ extern IClassFactoryImpl SHDOCVW_ClassFactory;
* WebBrowser declaration for SHDOCVW.DLL
*/
typedef
struct
{
const
IWebBrowserVtbl
*
lpWebBrowserVtbl
;
const
IOleObjectVtbl
*
lpOleObjectVtbl
;
const
IOleInPlaceObjectVtbl
*
lpOleInPlaceObjectVtbl
;
const
IOleControlVtbl
*
lpOleControlVtbl
;
const
IWebBrowserVtbl
*
lpWebBrowserVtbl
;
const
IOleObjectVtbl
*
lpOleObjectVtbl
;
const
IOleInPlaceObjectVtbl
*
lpOleInPlaceObjectVtbl
;
const
IOleControlVtbl
*
lpOleControlVtbl
;
const
IPersistStorageVtbl
*
lpPersistStorageVtbl
;
const
IPersistStreamInitVtbl
*
lpPersistStreamInitVtbl
;
LONG
ref
;
}
WebBrowser
;
...
...
@@ -65,8 +67,11 @@ typedef struct {
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
void
WebBrowser_OleObject_Init
(
WebBrowser
*
);
void
WebBrowser_Persist_Init
(
WebBrowser
*
);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
...
...
@@ -95,33 +100,6 @@ typedef struct
extern
IProvideClassInfo2Impl
SHDOCVW_ProvideClassInfo2
;
/**********************************************************************
* IPersistStorage declaration for SHDOCVW.DLL
*/
typedef
struct
{
/* IUnknown fields */
const
IPersistStorageVtbl
*
lpVtbl
;
LONG
ref
;
}
IPersistStorageImpl
;
extern
IPersistStorageImpl
SHDOCVW_PersistStorage
;
/**********************************************************************
* IPersistStreamInit declaration for SHDOCVW.DLL
*/
typedef
struct
{
/* IUnknown fields */
const
IPersistStreamInitVtbl
*
lpVtbl
;
LONG
ref
;
}
IPersistStreamInitImpl
;
extern
IPersistStreamInitImpl
SHDOCVW_PersistStreamInit
;
/**********************************************************************
* IQuickActivate declaration for SHDOCVW.DLL
*/
...
...
dlls/shdocvw/webbrowser.c
View file @
e5b5eb69
...
...
@@ -56,15 +56,18 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid,
}
else
if
(
IsEqualGUID
(
&
IID_IOleInPlaceObject
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleInPlaceObject %p)
\n
"
,
This
,
ppv
);
*
ppv
=
INPLACEOBJ
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
{
FIXM
E
(
"(%p)->(IID_IOleControl %p)
\n
"
,
This
,
ppv
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
{
TRAC
E
(
"(%p)->(IID_IOleControl %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CONTROL
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStorage
,
riid
))
{
FIXME
(
"(%p)->(IID_IPersistStorage %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_PersistStorage
;
}
else
if
(
IsEqualGUID
(
&
IID_IPersist
,
riid
))
{
TRACE
(
"(%p)->(IID_IPersist %p)
\n
"
,
This
,
ppv
);
*
ppv
=
PERSTORAGE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStorage
,
riid
))
{
TRACE
(
"(%p)->(IID_IPersistStorage %p)
\n
"
,
This
,
ppv
);
*
ppv
=
PERSTORAGE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStreamInit
,
riid
))
{
FIXM
E
(
"(%p)->(IID_IPersistStreamInit %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_PersistStreamInit
;
TRAC
E
(
"(%p)->(IID_IPersistStreamInit %p)
\n
"
,
This
,
ppv
);
*
ppv
=
PERSTRINIT
(
This
)
;
}
else
if
(
IsEqualGUID
(
&
IID_IProvideClassInfo
,
riid
))
{
FIXME
(
"(%p)->(IID_IProvideClassInfo %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_ProvideClassInfo
;
...
...
@@ -382,6 +385,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret
->
ref
=
0
;
WebBrowser_OleObject_Init
(
ret
);
WebBrowser_Persist_Init
(
ret
);
hres
=
IWebBrowser_QueryInterface
(
WEBBROWSER
(
ret
),
riid
,
ppv
);
if
(
SUCCEEDED
(
hres
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment