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
6634b315
Commit
6634b315
authored
Aug 12, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Support BYREF index in FolderItems::Item().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
824837ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
shelldispatch.c
dlls/shell32/shelldispatch.c
+12
-5
shelldispatch.c
dlls/shell32/tests/shelldispatch.c
+17
-1
No files found.
dlls/shell32/shelldispatch.c
View file @
6634b315
...
...
@@ -1129,19 +1129,24 @@ static HRESULT WINAPI FolderItemsImpl_get_Parent(FolderItems3 *iface, IDispatch
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
FolderItemsImpl_Item
(
FolderItems3
*
iface
,
VARIANT
index
,
FolderItem
**
item
)
static
HRESULT
WINAPI
FolderItemsImpl_Item
(
FolderItems3
*
iface
,
VARIANT
var
,
FolderItem
**
item
)
{
FolderItemsImpl
*
This
=
impl_from_FolderItems
(
iface
);
BSTR
display_name
=
NULL
;
VARIANT
index
;
HRESULT
hr
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_variant
(
&
index
),
item
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_variant
(
&
var
),
item
);
*
item
=
NULL
;
if
(
!
shellfolder_exists
(
This
->
folder
->
path
))
return
S_FALSE
;
VariantInit
(
&
index
);
if
(
FAILED
(
hr
=
VariantCopyInd
(
&
index
,
&
var
)))
return
hr
;
switch
(
V_VT
(
&
index
))
{
case
VT_I2
:
...
...
@@ -1163,8 +1168,9 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
if
(
!
V_BSTR
(
&
index
))
return
S_FALSE
;
if
(
FAILED
(
hr
=
IShellFolder2_ParseDisplayName
(
This
->
folder
->
folder
,
NULL
,
NULL
,
V_BSTR
(
&
index
),
NULL
,
&
pidl
,
NULL
)))
hr
=
IShellFolder2_ParseDisplayName
(
This
->
folder
->
folder
,
NULL
,
NULL
,
V_BSTR
(
&
index
),
NULL
,
&
pidl
,
NULL
);
VariantClear
(
&
index
);
if
(
FAILED
(
hr
))
return
S_FALSE
;
if
(
IShellFolder2_GetDisplayNameOf
(
This
->
folder
->
folder
,
pidl
,
SHGDN_FORPARSING
,
&
strret
)
==
S_OK
)
...
...
@@ -1176,7 +1182,8 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
break
;
default:
FIXME
(
"Index type %d not handled.
\n
"
,
V_VT
(
&
index
));
FIXME
(
"Index type %#x not handled.
\n
"
,
V_VT
(
&
index
));
VariantClear
(
&
index
);
/* fall through */
case
VT_EMPTY
:
return
E_NOTIMPL
;
...
...
dlls/shell32/tests/shelldispatch.c
View file @
6634b315
...
...
@@ -382,7 +382,7 @@ static void test_items(void)
FolderItems3
*
items3
=
NULL
;
FolderItem
*
item
=
(
FolderItem
*
)
0xdeadbeef
,
*
item2
;
FolderItemVerbs
*
verbs
=
(
FolderItemVerbs
*
)
0xdeadbeef
;
VARIANT
var
,
int_index
,
str_index
,
str_index2
;
VARIANT
var
,
var2
,
int_index
,
str_index
,
str_index2
;
IDispatch
*
disp
,
*
disp2
;
LONG
count
=
-
1
;
IUnknown
*
unk
;
...
...
@@ -543,12 +543,14 @@ static void test_items(void)
ok
(
r
==
S_OK
,
"FolderItems::get_Count failed: %08x
\n
"
,
r
);
ok
(
count
==
ARRAY_SIZE
(
file_defs
),
"got %d files
\n
"
,
count
);
/* VT_EMPTY */
V_VT
(
&
var
)
=
VT_EMPTY
;
item
=
(
FolderItem
*
)
0xdeadbeef
;
r
=
FolderItems_Item
(
items
,
var
,
&
item
);
ok
(
r
==
E_NOTIMPL
,
"expected E_NOTIMPL, got %08x
\n
"
,
r
);
ok
(
!
item
,
"item is not null
\n
"
);
/* VT_I2 */
V_VT
(
&
var
)
=
VT_I2
;
V_I2
(
&
var
)
=
0
;
...
...
@@ -571,6 +573,20 @@ static void test_items(void)
FolderItem_Release
(
item
);
/* VT_VARIANT | VT_BYREF */
V_VT
(
&
var2
)
=
VT_I2
;
V_I2
(
&
var2
)
=
0
;
V_VT
(
&
var
)
=
VT_BYREF
|
VT_VARIANT
;
V_VARIANTREF
(
&
var
)
=
&
var2
;
item
=
NULL
;
r
=
FolderItems_Item
(
items
,
var
,
&
item
);
ok
(
r
==
S_OK
,
"FolderItems::Item failed: %08x
\n
"
,
r
);
ok
(
!!
item
,
"item is null
\n
"
);
FolderItem_Release
(
item
);
/* VT_I4 */
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0
;
item
=
NULL
;
...
...
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