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
768d498e
Commit
768d498e
authored
Mar 31, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Mar 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add IServiceProvider implementation to the Item Dialog.
parent
140113b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
itemdlg.c
dlls/comdlg32/itemdlg.c
+69
-0
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+1
-1
No files found.
dlls/comdlg32/itemdlg.c
View file @
768d498e
...
...
@@ -59,6 +59,7 @@ typedef struct FileDialogImpl {
}
u
;
enum
ITEMDLG_TYPE
dlg_type
;
IExplorerBrowserEvents
IExplorerBrowserEvents_iface
;
IServiceProvider
IServiceProvider_iface
;
LONG
ref
;
FILEOPENDIALOGOPTIONS
options
;
...
...
@@ -478,6 +479,10 @@ static HRESULT WINAPI IFileDialog2_fnQueryInterface(IFileDialog2 *iface,
{
*
ppvObject
=
&
This
->
IExplorerBrowserEvents_iface
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IServiceProvider
))
{
*
ppvObject
=
&
This
->
IServiceProvider_iface
;
}
else
FIXME
(
"Unknown interface requested: %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -1465,6 +1470,69 @@ static const IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents = {
IExplorerBrowserEvents_fnOnNavigationFailed
};
/**************************************************************************
* IServiceProvider implementation
*/
static
inline
FileDialogImpl
*
impl_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
FileDialogImpl
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
IServiceProvider_fnQueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
FileDialogImpl
*
This
=
impl_from_IServiceProvider
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
return
IFileDialog2_QueryInterface
(
&
This
->
IFileDialog2_iface
,
riid
,
ppvObject
);
}
static
ULONG
WINAPI
IServiceProvider_fnAddRef
(
IServiceProvider
*
iface
)
{
FileDialogImpl
*
This
=
impl_from_IServiceProvider
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
return
IFileDialog2_AddRef
(
&
This
->
IFileDialog2_iface
);
}
static
ULONG
WINAPI
IServiceProvider_fnRelease
(
IServiceProvider
*
iface
)
{
FileDialogImpl
*
This
=
impl_from_IServiceProvider
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
return
IFileDialog2_Release
(
&
This
->
IFileDialog2_iface
);
}
static
HRESULT
WINAPI
IServiceProvider_fnQueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
FileDialogImpl
*
This
=
impl_from_IServiceProvider
(
iface
);
HRESULT
hr
=
E_FAIL
;
TRACE
(
"%p (%s, %s, %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
guidService
,
&
SID_STopLevelBrowser
)
&&
This
->
peb
)
hr
=
IExplorerBrowser_QueryInterface
(
This
->
peb
,
riid
,
ppv
);
else
if
(
IsEqualGUID
(
guidService
,
&
SID_SExplorerBrowserFrame
))
hr
=
IFileDialog2_QueryInterface
(
&
This
->
IFileDialog2_iface
,
riid
,
ppv
);
else
FIXME
(
"Interface %s requested from unknown service %s
\n
"
,
debugstr_guid
(
riid
),
debugstr_guid
(
guidService
));
if
(
SUCCEEDED
(
hr
)
&&
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
return
E_FAIL
;
}
static
const
IServiceProviderVtbl
vt_IServiceProvider
=
{
IServiceProvider_fnQueryInterface
,
IServiceProvider_fnAddRef
,
IServiceProvider_fnRelease
,
IServiceProvider_fnQueryService
};
static
HRESULT
FileDialog_constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
,
enum
ITEMDLG_TYPE
type
)
{
FileDialogImpl
*
fdimpl
;
...
...
@@ -1484,6 +1552,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
fdimpl
->
ref
=
1
;
fdimpl
->
IFileDialog2_iface
.
lpVtbl
=
&
vt_IFileDialog2
;
fdimpl
->
IExplorerBrowserEvents_iface
.
lpVtbl
=
&
vt_IExplorerBrowserEvents
;
fdimpl
->
IServiceProvider_iface
.
lpVtbl
=
&
vt_IServiceProvider
;
if
(
type
==
ITEMDLG_TYPE_OPEN
)
{
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
768d498e
...
...
@@ -181,7 +181,7 @@ static BOOL test_instantiation(void)
if
(
SUCCEEDED
(
hr
))
IFileOpenDialog_Release
(
pfsd
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IServiceProvider
,
(
void
**
)
&
psp
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IExplorerBrowser
*
peb
;
...
...
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