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
90a5529d
Commit
90a5529d
authored
Apr 18, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add ::Initialize() and ::GetCurFolder() for printers folder IPersistFolder2 interface.
parent
e51fe8e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
shfldr_printers.c
dlls/shell32/shfldr_printers.c
+17
-4
shfldr_special.c
dlls/shell32/tests/shfldr_special.c
+27
-0
No files found.
dlls/shell32/shfldr_printers.c
View file @
90a5529d
...
...
@@ -42,6 +42,8 @@ typedef struct {
const
IShellFolder2Vtbl
*
lpVtbl
;
const
IPersistFolder2Vtbl
*
lpvtblPersistFolder2
;
LONG
ref
;
LPITEMIDLIST
pidl
;
}
IPrintersFolderImpl
;
static
inline
IPrintersFolderImpl
*
impl_from_IPersistFolder2
(
IPersistFolder2
*
iface
)
...
...
@@ -111,6 +113,7 @@ static ULONG WINAPI IShellFolder_Printers_fnRelease (IShellFolder2 * iface)
if
(
!
refCount
)
{
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
SHFree
(
This
->
pidl
);
LocalFree
(
This
);
}
return
refCount
;
...
...
@@ -380,15 +383,24 @@ static HRESULT WINAPI IPersistFolder2_Printers_fnGetClassID(IPersistFolder2 *ifa
static
HRESULT
WINAPI
IPersistFolder2_Printers_fnInitialize
(
IPersistFolder2
*
iface
,
LPCITEMIDLIST
pidl
)
{
IPrintersFolderImpl
*
This
=
impl_from_IPersistFolder2
(
iface
);
FIXME
(
"(%p) stub
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pidl
);
SHFree
(
This
->
pidl
);
This
->
pidl
=
ILClone
(
pidl
);
return
S_OK
;
}
static
HRESULT
WINAPI
IPersistFolder2_Printers_fnGetCurFolder
(
IPersistFolder2
*
iface
,
LPITEMIDLIST
*
pidl
)
{
IPrintersFolderImpl
*
This
=
impl_from_IPersistFolder2
(
iface
);
FIXME
(
"(%p) stub
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pidl
);
*
pidl
=
ILClone
(
This
->
pidl
);
return
*
pidl
?
S_OK
:
S_FALSE
;
}
static
const
IPersistFolder2Vtbl
vtbl_PersistFolder2
=
...
...
@@ -417,6 +429,7 @@ HRESULT WINAPI Printers_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *
return
E_OUTOFMEMORY
;
sf
->
ref
=
0
;
sf
->
pidl
=
NULL
;
sf
->
lpVtbl
=
&
vtbl_ShellFolder2
;
sf
->
lpvtblPersistFolder2
=
&
vtbl_PersistFolder2
;
...
...
dlls/shell32/tests/shfldr_special.c
View file @
90a5529d
...
...
@@ -125,8 +125,10 @@ static void test_parse_for_control_panel(void)
static
void
test_printers_folder
(
void
)
{
IShellFolder2
*
folder
;
IPersistFolder2
*
pf
;
SHELLDETAILS
details
;
SHCOLSTATEF
state
;
LPITEMIDLIST
pidl1
,
pidl2
;
INT
i
;
HRESULT
hr
;
...
...
@@ -145,6 +147,7 @@ if (0)
/* crashes on XP */
hr
=
IShellFolder2_GetDetailsOf
(
folder
,
NULL
,
0
,
NULL
);
hr
=
IShellFolder2_GetDefaultColumnState
(
folder
,
0
,
NULL
);
hr
=
IPersistFolder2_GetCurFolder
(
pf
,
NULL
);
}
/* 5 columns defined */
...
...
@@ -173,6 +176,30 @@ if (0)
ok
(
state
==
(
SHCOLSTATE_TYPE_STR
|
SHCOLSTATE_ONBYDEFAULT
),
"got 0x%x
\n
"
,
state
);
}
/* default pidl */
hr
=
IShellFolder2_QueryInterface
(
folder
,
&
IID_IPersistFolder2
,
(
void
**
)
&
pf
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* not initialized */
pidl1
=
(
void
*
)
0xdeadbeef
;
hr
=
IPersistFolder2_GetCurFolder
(
pf
,
&
pidl1
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
pidl1
==
NULL
,
"got %p
\n
"
,
pidl1
);
hr
=
SHGetSpecialFolderLocation
(
NULL
,
CSIDL_PRINTERS
,
&
pidl2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IPersistFolder2_Initialize
(
pf
,
pidl2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IPersistFolder2_GetCurFolder
(
pf
,
&
pidl1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
ILIsEqual
(
pidl1
,
pidl2
),
"expected same PIDL
\n
"
);
IPersistFolder2_Release
(
pf
);
ILFree
(
pidl1
);
ILFree
(
pidl2
);
IShellFolder2_Release
(
folder
);
CoUninitialize
();
...
...
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