Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5fd6180a
Commit
5fd6180a
authored
May 24, 2011
by
David Hedberg
Committed by
Alexandre Julliard
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add IOleWindow implementation to the Item Dialog.
parent
1597dec0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
0 deletions
+107
-0
itemdlg.c
dlls/comdlg32/itemdlg.c
+55
-0
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+52
-0
No files found.
dlls/comdlg32/itemdlg.c
View file @
5fd6180a
...
...
@@ -65,6 +65,7 @@ typedef struct FileDialogImpl {
IExplorerBrowserEvents
IExplorerBrowserEvents_iface
;
IServiceProvider
IServiceProvider_iface
;
ICommDlgBrowser3
ICommDlgBrowser3_iface
;
IOleWindow
IOleWindow_iface
;
LONG
ref
;
FILEOPENDIALOGOPTIONS
options
;
...
...
@@ -910,6 +911,10 @@ static HRESULT WINAPI IFileDialog2_fnQueryInterface(IFileDialog2 *iface,
{
*
ppvObject
=
&
This
->
ICommDlgBrowser3_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IOleWindow
,
riid
))
{
*
ppvObject
=
&
This
->
IOleWindow_iface
;
}
else
FIXME
(
"Unknown interface requested: %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -2206,6 +2211,55 @@ static const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3 = {
ICommDlgBrowser3_fnOnPreviewCreated
};
/**************************************************************************
* IOleWindow implementation
*/
static
inline
FileDialogImpl
*
impl_from_IOleWindow
(
IOleWindow
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
FileDialogImpl
,
IOleWindow_iface
);
}
static
HRESULT
WINAPI
IOleWindow_fnQueryInterface
(
IOleWindow
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
FileDialogImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IFileDialog2_QueryInterface
(
&
This
->
IFileDialog2_iface
,
riid
,
ppvObject
);
}
static
ULONG
WINAPI
IOleWindow_fnAddRef
(
IOleWindow
*
iface
)
{
FileDialogImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IFileDialog2_AddRef
(
&
This
->
IFileDialog2_iface
);
}
static
ULONG
WINAPI
IOleWindow_fnRelease
(
IOleWindow
*
iface
)
{
FileDialogImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IFileDialog2_Release
(
&
This
->
IFileDialog2_iface
);
}
static
HRESULT
WINAPI
IOleWindow_fnContextSensitiveHelp
(
IOleWindow
*
iface
,
BOOL
fEnterMOde
)
{
FileDialogImpl
*
This
=
impl_from_IOleWindow
(
iface
);
FIXME
(
"Stub: %p (%d)
\n
"
,
This
,
fEnterMOde
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IOleWindow_fnGetWindow
(
IOleWindow
*
iface
,
HWND
*
phwnd
)
{
FileDialogImpl
*
This
=
impl_from_IOleWindow
(
iface
);
TRACE
(
"%p (%p)
\n
"
,
This
,
phwnd
);
*
phwnd
=
This
->
dlg_hwnd
;
return
S_OK
;
}
static
const
IOleWindowVtbl
vt_IOleWindow
=
{
IOleWindow_fnQueryInterface
,
IOleWindow_fnAddRef
,
IOleWindow_fnRelease
,
IOleWindow_fnGetWindow
,
IOleWindow_fnContextSensitiveHelp
};
static
HRESULT
FileDialog_constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
,
enum
ITEMDLG_TYPE
type
)
{
FileDialogImpl
*
fdimpl
;
...
...
@@ -2227,6 +2281,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
fdimpl
->
IExplorerBrowserEvents_iface
.
lpVtbl
=
&
vt_IExplorerBrowserEvents
;
fdimpl
->
IServiceProvider_iface
.
lpVtbl
=
&
vt_IServiceProvider
;
fdimpl
->
ICommDlgBrowser3_iface
.
lpVtbl
=
&
vt_ICommDlgBrowser3
;
fdimpl
->
IOleWindow_iface
.
lpVtbl
=
&
vt_IOleWindow
;
if
(
type
==
ITEMDLG_TYPE_OPEN
)
{
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
5fd6180a
...
...
@@ -166,6 +166,7 @@ static BOOL test_instantiation(void)
IFileOpenDialog
*
pfod
;
IFileSaveDialog
*
pfsd
;
IServiceProvider
*
psp
;
IOleWindow
*
pow
;
IUnknown
*
punk
;
HRESULT
hr
;
LONG
ref
;
...
...
@@ -235,6 +236,31 @@ static BOOL test_instantiation(void)
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
HWND
hwnd
;
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
0
)
{
/* Crashes on win7 */
IOleWindow_GetWindow
(
pow
,
NULL
);
}
hr
=
IOleWindow_GetWindow
(
pow
,
&
hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hwnd
==
NULL
,
"Got %p
\n
"
,
hwnd
);
IOleWindow_Release
(
pow
);
}
ref
=
IFileOpenDialog_Release
(
pfod
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
...
...
@@ -280,6 +306,32 @@ static BOOL test_instantiation(void)
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
HWND
hwnd
;
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
0
)
{
/* Crashes on win7 */
IOleWindow_GetWindow
(
pow
,
NULL
);
}
hr
=
IOleWindow_GetWindow
(
pow
,
&
hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hwnd
==
NULL
,
"Got %p
\n
"
,
hwnd
);
IOleWindow_Release
(
pow
);
}
ref
=
IFileSaveDialog_Release
(
pfsd
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
return
TRUE
;
...
...
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