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
9eed85f0
Commit
9eed85f0
authored
May 21, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
May 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement IShellItem_GetParent.
parent
5b95a43d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
4 deletions
+55
-4
shellitem.c
dlls/shell32/shellitem.c
+33
-3
shlfolder.c
dlls/shell32/tests/shlfolder.c
+22
-1
No files found.
dlls/shell32/shellitem.c
View file @
9eed85f0
...
...
@@ -105,6 +105,27 @@ static ULONG WINAPI ShellItem_Release(IShellItem *iface)
return
ref
;
}
static
HRESULT
ShellItem_get_parent_pidl
(
ShellItem
*
This
,
LPITEMIDLIST
*
parent_pidl
)
{
*
parent_pidl
=
ILClone
(
This
->
pidl
);
if
(
*
parent_pidl
)
{
if
(
ILRemoveLastID
(
*
parent_pidl
))
return
S_OK
;
else
{
ILFree
(
*
parent_pidl
);
*
parent_pidl
=
NULL
;
return
E_INVALIDARG
;
}
}
else
{
*
parent_pidl
=
NULL
;
return
E_OUTOFMEMORY
;
}
}
static
HRESULT
WINAPI
ShellItem_BindToHandler
(
IShellItem
*
iface
,
IBindCtx
*
pbc
,
REFGUID
rbhid
,
REFIID
riid
,
void
**
ppvOut
)
{
...
...
@@ -117,11 +138,20 @@ static HRESULT WINAPI ShellItem_BindToHandler(IShellItem *iface, IBindCtx *pbc,
static
HRESULT
WINAPI
ShellItem_GetParent
(
IShellItem
*
iface
,
IShellItem
**
ppsi
)
{
FIXME
(
"(%p,%p)
\n
"
,
iface
,
ppsi
);
ShellItem
*
This
=
(
ShellItem
*
)
iface
;
LPITEMIDLIST
parent_pidl
;
HRESULT
ret
;
*
ppsi
=
NULL
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
ppsi
)
;
return
E_NOTIMPL
;
ret
=
ShellItem_get_parent_pidl
(
This
,
&
parent_pidl
);
if
(
SUCCEEDED
(
ret
))
{
ret
=
SHCreateShellItem
(
NULL
,
NULL
,
parent_pidl
,
ppsi
);
ILFree
(
parent_pidl
);
}
return
ret
;
}
static
HRESULT
WINAPI
ShellItem_GetDisplayName
(
IShellItem
*
iface
,
SIGDN
sigdnName
,
...
...
dlls/shell32/tests/shlfolder.c
View file @
9eed85f0
...
...
@@ -1747,7 +1747,7 @@ cleanup:
static
void
test_SHCreateShellItem
(
void
)
{
IShellItem
*
shellitem
;
IShellItem
*
shellitem
,
*
shellitem2
;
IPersistIDList
*
persistidl
;
LPITEMIDLIST
pidl_cwd
=
NULL
,
pidl_testfile
,
pidl_abstestfile
,
pidl_test
;
HRESULT
ret
;
...
...
@@ -1830,6 +1830,27 @@ static void test_SHCreateShellItem(void)
}
IPersistIDList_Release
(
persistidl
);
}
ret
=
IShellItem_GetParent
(
shellitem
,
&
shellitem2
);
ok
(
SUCCEEDED
(
ret
),
"GetParent returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
{
ret
=
IShellItem_QueryInterface
(
shellitem2
,
&
IID_IPersistIDList
,
(
void
**
)
&
persistidl
);
ok
(
SUCCEEDED
(
ret
),
"QueryInterface returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
{
ret
=
IPersistIDList_GetIDList
(
persistidl
,
&
pidl_test
);
ok
(
SUCCEEDED
(
ret
),
"GetIDList returned %x
\n
"
,
ret
);
if
(
SUCCEEDED
(
ret
))
{
ok
(
ILIsEqual
(
pidl_cwd
,
pidl_test
),
"id lists are not equal
\n
"
);
pILFree
(
pidl_test
);
}
IPersistIDList_Release
(
persistidl
);
}
IShellItem_Release
(
shellitem2
);
}
IShellItem_Release
(
shellitem
);
}
...
...
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