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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
131 deletions
+115
-131
persist.c
dlls/shdocvw/persist.c
+99
-97
shdocvw.h
dlls/shdocvw/shdocvw.h
+5
-27
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 2001 John R. Sheets (for CodeWeavers)
* Copyright 2005 Jacek Caban
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -27,168 +28,169 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
...
@@ -27,168 +28,169 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
* Implement the IPersistStorage interface
* Implement the IPersistStorage interface
*/
*/
static
HRESULT
WINAPI
WBPS_QueryInterface
(
LPPERSISTSTORAGE
iface
,
#define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
static
HRESULT
WINAPI
PersistStorage_QueryInterface
(
IPersistStorage
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
REFIID
riid
,
LPVOID
*
ppobj
)
{
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_QueryInterface
(
WEBBROWSER
(
This
),
riid
,
ppobj
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
WBPS_AddRef
(
LPPERSISTSTORAGE
iface
)
static
ULONG
WINAPI
PersistStorage_AddRef
(
IPersistStorage
*
iface
)
{
{
SHDOCVW_LockModule
();
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_AddRef
(
WEBBROWSER
(
This
));
return
2
;
/* non-heap based object */
}
}
static
ULONG
WINAPI
WBPS_Release
(
LPPERSISTSTORAGE
iface
)
static
ULONG
WINAPI
PersistStorage_Release
(
IPersistStorage
*
iface
)
{
{
SHDOCVW_UnlockModule
();
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
IWebBrowser_Release
(
WEBBROWSER
(
This
));
return
1
;
/* non-heap based object */
}
}
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
));
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
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
"
);
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
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
);
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
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
);
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStg
);
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
WBPS_Save
(
LPPERSISTSTORAGE
iface
,
LPSTORAGE
pStg
,
static
HRESULT
WINAPI
PersistStorage_Save
(
IPersistStorage
*
iface
,
LPSTORAGE
pStg
,
BOOL
fSameAsLoad
)
BOOL
fSameAsLoad
)
{
{
FIXME
(
"stub: LPSTORAGE = %p, fSameAsLoad = %d
\n
"
,
pStg
,
fSameAsLoad
);
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
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
);
WebBrowser
*
This
=
PERSTORAGE_THIS
(
iface
);
return
S_OK
;
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStgNew
);
return
E_NOTIMPL
;
}
}
/**********************************************************************
#define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
* IPersistStorage virtual function table for IE Web Browser component
*/
static
const
IPersistStorageVtbl
WBPS_
Vtbl
=
static
const
IPersistStorageVtbl
PersistStorage
Vtbl
=
{
{
WBPS
_QueryInterface
,
PersistStorage
_QueryInterface
,
WBPS
_AddRef
,
PersistStorage
_AddRef
,
WBPS
_Release
,
PersistStorage
_Release
,
WBPS
_GetClassID
,
PersistStorage
_GetClassID
,
WBPS
_IsDirty
,
PersistStorage
_IsDirty
,
WBPS
_InitNew
,
PersistStorage
_InitNew
,
WBPS
_Load
,
PersistStorage
_Load
,
WBPS
_Save
,
PersistStorage
_Save
,
WBPS
_SaveCompleted
PersistStorage
_SaveCompleted
};
};
IPersistStorageImpl
SHDOCVW_PersistStorage
=
{
&
WBPS_Vtbl
};
/**********************************************************************
/**********************************************************************
* Implement the IPersistStreamInit interface
* Implement the IPersistStreamInit interface
*/
*/
static
HRESULT
WINAPI
WBPSI_QueryInterface
(
LPPERSISTSTREAMINIT
iface
,
#define PERSTRINIT_THIS(iface) DEFINE_THIS(WebBrowser, PersistStreamInit, iface)
static
HRESULT
WINAPI
PersistStreamInit_QueryInterface
(
IPersistStreamInit
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
REFIID
riid
,
LPVOID
*
ppobj
)
{
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_QueryInterface
(
WEBBROWSER
(
This
),
riid
,
ppobj
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
WBPSI_AddRef
(
LPPERSISTSTREAMINIT
iface
)
static
ULONG
WINAPI
PersistStreamInit_AddRef
(
IPersistStreamInit
*
iface
)
{
{
SHDOCVW_LockModule
();
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_AddRef
(
WEBBROWSER
(
This
));
return
2
;
/* non-heap based object */
}
}
static
ULONG
WINAPI
WBPSI_Release
(
LPPERSISTSTREAMINIT
iface
)
static
ULONG
WINAPI
PersistStreamInit_Release
(
IPersistStreamInit
*
iface
)
{
{
SHDOCVW_UnlockModule
();
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
IWebBrowser_Release
(
WEBBROWSER
(
This
));
return
1
;
/* non-heap based object */
}
}
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
)
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
return
IPersistStorage_GetClassID
(
PERSTORAGE
(
This
),
pClassID
)
;
}
}
static
HRESULT
WINAPI
WBPSI_IsDirty
(
LPPERSISTSTREAMINIT
iface
)
static
HRESULT
WINAPI
PersistStreamInit_IsDirty
(
IPersistStreamInit
*
iface
)
{
{
FIXME
(
"stub
\n
"
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
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
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pStg
);
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
WBPSI_Save
(
LPPERSISTSTREAMINIT
iface
,
LPSTREAM
pStg
,
static
HRESULT
WINAPI
PersistStreamInit_Save
(
IPersistStreamInit
*
iface
,
LPSTREAM
pStg
,
BOOL
fSameAsLoad
)
BOOL
fSameAsLoad
)
{
{
FIXME
(
"stub: LPSTORAGE = %p, fSameAsLoad = %d
\n
"
,
pStg
,
fSameAsLoad
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
FIXME
(
"(%p)->(%p %x)
\n
"
,
This
,
pStg
,
fSameAsLoad
);
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
WBPSI_GetSizeMax
(
LPPERSISTSTREAMINIT
iface
,
static
HRESULT
WINAPI
PersistStreamInit_GetSizeMax
(
IPersistStreamInit
*
iface
,
ULARGE_INTEGER
*
pcbSize
)
ULARGE_INTEGER
*
pcbSize
)
{
{
FIXME
(
"stub: ULARGE_INTEGER = %p
\n
"
,
pcbSize
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
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
"
);
WebBrowser
*
This
=
PERSTRINIT_THIS
(
iface
);
return
S_OK
;
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
}
/**********************************************************************
#undef PERSTRINIT_THIS
* IPersistStreamInit virtual function table for IE Web Browser component
*/
static
const
IPersistStreamInitVtbl
WBPSI_
Vtbl
=
static
const
IPersistStreamInitVtbl
PersistStreamInit
Vtbl
=
{
{
WBPSI
_QueryInterface
,
PersistStreamInit
_QueryInterface
,
WBPSI
_AddRef
,
PersistStreamInit
_AddRef
,
WBPSI
_Release
,
PersistStreamInit
_Release
,
WBPSI
_GetClassID
,
PersistStreamInit
_GetClassID
,
WBPSI
_IsDirty
,
PersistStreamInit
_IsDirty
,
WBPSI
_Load
,
PersistStreamInit
_Load
,
WBPSI
_Save
,
PersistStreamInit
_Save
,
WBPSI
_GetSizeMax
,
PersistStreamInit
_GetSizeMax
,
WBPSI
_InitNew
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
...
@@ -57,6 +57,8 @@ typedef struct {
...
@@ -57,6 +57,8 @@ typedef struct {
const
IOleObjectVtbl
*
lpOleObjectVtbl
;
const
IOleObjectVtbl
*
lpOleObjectVtbl
;
const
IOleInPlaceObjectVtbl
*
lpOleInPlaceObjectVtbl
;
const
IOleInPlaceObjectVtbl
*
lpOleInPlaceObjectVtbl
;
const
IOleControlVtbl
*
lpOleControlVtbl
;
const
IOleControlVtbl
*
lpOleControlVtbl
;
const
IPersistStorageVtbl
*
lpPersistStorageVtbl
;
const
IPersistStreamInitVtbl
*
lpPersistStreamInitVtbl
;
LONG
ref
;
LONG
ref
;
}
WebBrowser
;
}
WebBrowser
;
...
@@ -65,8 +67,11 @@ typedef struct {
...
@@ -65,8 +67,11 @@ typedef struct {
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#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_OleObject_Init
(
WebBrowser
*
);
void
WebBrowser_Persist_Init
(
WebBrowser
*
);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
...
@@ -95,33 +100,6 @@ typedef struct
...
@@ -95,33 +100,6 @@ typedef struct
extern
IProvideClassInfo2Impl
SHDOCVW_ProvideClassInfo2
;
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
* 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,
...
@@ -56,15 +56,18 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid,
}
else
if
(
IsEqualGUID
(
&
IID_IOleInPlaceObject
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IOleInPlaceObject
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleInPlaceObject %p)
\n
"
,
This
,
ppv
);
TRACE
(
"(%p)->(IID_IOleInPlaceObject %p)
\n
"
,
This
,
ppv
);
*
ppv
=
INPLACEOBJ
(
This
);
*
ppv
=
INPLACEOBJ
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
{
FIXM
E
(
"(%p)->(IID_IOleControl %p)
\n
"
,
This
,
ppv
);
TRAC
E
(
"(%p)->(IID_IOleControl %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CONTROL
(
This
);
*
ppv
=
CONTROL
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStorage
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IPersist
,
riid
))
{
FIXME
(
"(%p)->(IID_IPersistStorage %p)
\n
"
,
This
,
ppv
);
TRACE
(
"(%p)->(IID_IPersist %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_PersistStorage
;
*
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
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStreamInit
,
riid
))
{
FIXM
E
(
"(%p)->(IID_IPersistStreamInit %p)
\n
"
,
This
,
ppv
);
TRAC
E
(
"(%p)->(IID_IPersistStreamInit %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_PersistStreamInit
;
*
ppv
=
PERSTRINIT
(
This
)
;
}
else
if
(
IsEqualGUID
(
&
IID_IProvideClassInfo
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IProvideClassInfo
,
riid
))
{
FIXME
(
"(%p)->(IID_IProvideClassInfo %p)
\n
"
,
This
,
ppv
);
FIXME
(
"(%p)->(IID_IProvideClassInfo %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
SHDOCVW_ProvideClassInfo
;
*
ppv
=
&
SHDOCVW_ProvideClassInfo
;
...
@@ -382,6 +385,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
...
@@ -382,6 +385,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret
->
ref
=
0
;
ret
->
ref
=
0
;
WebBrowser_OleObject_Init
(
ret
);
WebBrowser_OleObject_Init
(
ret
);
WebBrowser_Persist_Init
(
ret
);
hres
=
IWebBrowser_QueryInterface
(
WEBBROWSER
(
ret
),
riid
,
ppv
);
hres
=
IWebBrowser_QueryInterface
(
WEBBROWSER
(
ret
),
riid
,
ppv
);
if
(
SUCCEEDED
(
hres
))
{
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