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
bf1b56be
Commit
bf1b56be
authored
Jul 26, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Jul 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement SHCreateShellItemArrayFromShellItem.
parent
090824fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
shell32.spec
dlls/shell32/shell32.spec
+1
-0
shellitem.c
dlls/shell32/shellitem.c
+30
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+57
-0
shobjidl.idl
include/shobjidl.idl
+1
-0
No files found.
dlls/shell32/shell32.spec
View file @
bf1b56be
...
...
@@ -335,6 +335,7 @@
@ stub SHCreateProcessAsUserW
@ stdcall SHCreateShellItem(ptr ptr ptr ptr)
@ stdcall SHCreateShellItemArray(ptr ptr long ptr ptr)
@ stdcall SHCreateShellItemArrayFromShellItem(ptr ptr ptr)
@ stdcall SHEmptyRecycleBinA(long str long)
@ stdcall SHEmptyRecycleBinW(long wstr long)
@ stub SHExtractIconsW
...
...
dlls/shell32/shellitem.c
View file @
bf1b56be
...
...
@@ -827,3 +827,33 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent,
*
ppsiItemArray
=
NULL
;
return
ret
;
}
HRESULT
WINAPI
SHCreateShellItemArrayFromShellItem
(
IShellItem
*
psi
,
REFIID
riid
,
void
**
ppv
)
{
IShellItemArrayImpl
*
This
;
IShellItem
**
array
;
HRESULT
ret
;
TRACE
(
"%p, %s, %p
\n
"
,
psi
,
shdebugstr_guid
(
riid
),
ppv
);
array
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IShellItem
*
));
if
(
!
array
)
return
E_OUTOFMEMORY
;
ret
=
IShellItemArray_Constructor
(
NULL
,
riid
,
(
void
**
)
&
This
);
if
(
SUCCEEDED
(
ret
))
{
array
[
0
]
=
psi
;
IShellItem_AddRef
(
psi
);
This
->
array
=
array
;
This
->
item_count
=
1
;
*
ppv
=
This
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
array
);
*
ppv
=
NULL
;
}
return
ret
;
}
dlls/shell32/tests/shlfolder.c
View file @
bf1b56be
...
...
@@ -59,6 +59,7 @@ static HRESULT (WINAPI *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID
static
HRESULT
(
WINAPI
*
pSHCreateItemFromParsingName
)(
PCWSTR
,
IBindCtx
*
,
REFIID
,
void
**
);
static
HRESULT
(
WINAPI
*
pSHCreateShellItem
)(
LPCITEMIDLIST
,
IShellFolder
*
,
LPCITEMIDLIST
,
IShellItem
**
);
static
HRESULT
(
WINAPI
*
pSHCreateShellItemArray
)(
LPCITEMIDLIST
,
IShellFolder
*
,
UINT
,
LPCITEMIDLIST
*
,
IShellItemArray
**
);
static
HRESULT
(
WINAPI
*
pSHCreateShellItemArrayFromShellItem
)(
IShellItem
*
,
REFIID
,
void
**
);
static
LPITEMIDLIST
(
WINAPI
*
pILCombine
)(
LPCITEMIDLIST
,
LPCITEMIDLIST
);
static
HRESULT
(
WINAPI
*
pSHParseDisplayName
)(
LPCWSTR
,
IBindCtx
*
,
LPITEMIDLIST
*
,
SFGAOF
,
SFGAOF
*
);
static
LPITEMIDLIST
(
WINAPI
*
pSHSimpleIDListFromPathAW
)(
LPCVOID
);
...
...
@@ -81,6 +82,7 @@ static void init_function_pointers(void)
MAKEFUNC
(
SHCreateItemFromParsingName
);
MAKEFUNC
(
SHCreateShellItem
);
MAKEFUNC
(
SHCreateShellItemArray
);
MAKEFUNC
(
SHCreateShellItemArrayFromShellItem
);
MAKEFUNC
(
SHGetFolderPathA
);
MAKEFUNC
(
SHGetFolderPathAndSubDirA
);
MAKEFUNC
(
SHGetPathFromIDListW
);
...
...
@@ -3056,6 +3058,61 @@ static void test_SHCreateShellItemArray(void)
}
}
/* SHCreateShellItemArrayFromShellItem */
if
(
pSHCreateShellItemArrayFromShellItem
)
{
IShellItem
*
psi
;
if
(
0
)
{
/* Crashes under Windows 7 */
hr
=
pSHCreateShellItemArrayFromShellItem
(
NULL
,
&
IID_IShellItemArray
,
NULL
);
hr
=
pSHCreateShellItemArrayFromShellItem
(
NULL
,
&
IID_IShellItemArray
,
(
void
**
)
&
psia
);
hr
=
pSHCreateShellItemArrayFromShellItem
(
psi
,
&
IID_IShellItemArray
,
NULL
);
}
hr
=
pSHCreateItemFromIDList
(
pidl_testdir
,
&
IID_IShellItem
,
(
void
**
)
&
psi
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
pSHCreateShellItemArrayFromShellItem
(
psi
,
&
IID_IShellItemArray
,
(
void
**
)
&
psia
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IShellItem
*
psi2
;
UINT
count
;
hr
=
IShellItemArray_GetCount
(
psia
,
&
count
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %d
\n
"
,
count
);
hr
=
IShellItemArray_GetItemAt
(
psia
,
0
,
&
psi2
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
psi
!=
psi2
,
"ShellItems are of the same instance.
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
LPITEMIDLIST
pidl1
,
pidl2
;
hr
=
pSHGetIDListFromObject
((
IUnknown
*
)
psi
,
&
pidl1
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
pidl1
!=
NULL
,
"pidl1 was null.
\n
"
);
hr
=
pSHGetIDListFromObject
((
IUnknown
*
)
psi2
,
&
pidl2
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
pidl2
!=
NULL
,
"pidl2 was null.
\n
"
);
ok
(
ILIsEqual
(
pidl1
,
pidl2
),
"pidls not equal.
\n
"
);
pILFree
(
pidl1
);
pILFree
(
pidl2
);
IShellItem_Release
(
psi2
);
}
hr
=
IShellItemArray_GetItemAt
(
psia
,
1
,
&
psi2
);
ok
(
hr
==
E_FAIL
,
"Got 0x%08x
\n
"
,
hr
);
IShellItemArray_Release
(
psia
);
}
IShellItem_Release
(
psi
);
}
}
else
skip
(
"No SHCreateShellItemArrayFromShellItem.
\n
"
);
IShellFolder_Release
(
psf
);
pILFree
(
pidl_testdir
);
Cleanup
();
...
...
include/shobjidl.idl
View file @
bf1b56be
...
...
@@ -518,6 +518,7 @@ cpp_quote("HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_G
cpp_quote
(
"HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl);"
)
cpp_quote
(
"HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv);"
)
cpp_quote
(
"HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder* psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray);"
)
cpp_quote
(
"HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv);"
)
/*****************************************************************************
*
IShellItemFilter
interface
...
...
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