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
...
@@ -1129,19 +1129,24 @@ static HRESULT WINAPI FolderItemsImpl_get_Parent(FolderItems3 *iface, IDispatch
return
E_NOTIMPL
;
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
);
FolderItemsImpl
*
This
=
impl_from_FolderItems
(
iface
);
BSTR
display_name
=
NULL
;
BSTR
display_name
=
NULL
;
VARIANT
index
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_variant
(
&
index
),
item
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_variant
(
&
var
),
item
);
*
item
=
NULL
;
*
item
=
NULL
;
if
(
!
shellfolder_exists
(
This
->
folder
->
path
))
if
(
!
shellfolder_exists
(
This
->
folder
->
path
))
return
S_FALSE
;
return
S_FALSE
;
VariantInit
(
&
index
);
if
(
FAILED
(
hr
=
VariantCopyInd
(
&
index
,
&
var
)))
return
hr
;
switch
(
V_VT
(
&
index
))
switch
(
V_VT
(
&
index
))
{
{
case
VT_I2
:
case
VT_I2
:
...
@@ -1163,8 +1168,9 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
...
@@ -1163,8 +1168,9 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
if
(
!
V_BSTR
(
&
index
))
if
(
!
V_BSTR
(
&
index
))
return
S_FALSE
;
return
S_FALSE
;
if
(
FAILED
(
hr
=
IShellFolder2_ParseDisplayName
(
This
->
folder
->
folder
,
NULL
,
NULL
,
V_BSTR
(
&
index
),
hr
=
IShellFolder2_ParseDisplayName
(
This
->
folder
->
folder
,
NULL
,
NULL
,
V_BSTR
(
&
index
),
NULL
,
&
pidl
,
NULL
);
NULL
,
&
pidl
,
NULL
)))
VariantClear
(
&
index
);
if
(
FAILED
(
hr
))
return
S_FALSE
;
return
S_FALSE
;
if
(
IShellFolder2_GetDisplayNameOf
(
This
->
folder
->
folder
,
pidl
,
SHGDN_FORPARSING
,
&
strret
)
==
S_OK
)
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
...
@@ -1176,7 +1182,8 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
break
;
break
;
default:
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 */
/* fall through */
case
VT_EMPTY
:
case
VT_EMPTY
:
return
E_NOTIMPL
;
return
E_NOTIMPL
;
...
...
dlls/shell32/tests/shelldispatch.c
View file @
6634b315
...
@@ -382,7 +382,7 @@ static void test_items(void)
...
@@ -382,7 +382,7 @@ static void test_items(void)
FolderItems3
*
items3
=
NULL
;
FolderItems3
*
items3
=
NULL
;
FolderItem
*
item
=
(
FolderItem
*
)
0xdeadbeef
,
*
item2
;
FolderItem
*
item
=
(
FolderItem
*
)
0xdeadbeef
,
*
item2
;
FolderItemVerbs
*
verbs
=
(
FolderItemVerbs
*
)
0xdeadbeef
;
FolderItemVerbs
*
verbs
=
(
FolderItemVerbs
*
)
0xdeadbeef
;
VARIANT
var
,
int_index
,
str_index
,
str_index2
;
VARIANT
var
,
var2
,
int_index
,
str_index
,
str_index2
;
IDispatch
*
disp
,
*
disp2
;
IDispatch
*
disp
,
*
disp2
;
LONG
count
=
-
1
;
LONG
count
=
-
1
;
IUnknown
*
unk
;
IUnknown
*
unk
;
...
@@ -543,12 +543,14 @@ static void test_items(void)
...
@@ -543,12 +543,14 @@ static void test_items(void)
ok
(
r
==
S_OK
,
"FolderItems::get_Count failed: %08x
\n
"
,
r
);
ok
(
r
==
S_OK
,
"FolderItems::get_Count failed: %08x
\n
"
,
r
);
ok
(
count
==
ARRAY_SIZE
(
file_defs
),
"got %d files
\n
"
,
count
);
ok
(
count
==
ARRAY_SIZE
(
file_defs
),
"got %d files
\n
"
,
count
);
/* VT_EMPTY */
V_VT
(
&
var
)
=
VT_EMPTY
;
V_VT
(
&
var
)
=
VT_EMPTY
;
item
=
(
FolderItem
*
)
0xdeadbeef
;
item
=
(
FolderItem
*
)
0xdeadbeef
;
r
=
FolderItems_Item
(
items
,
var
,
&
item
);
r
=
FolderItems_Item
(
items
,
var
,
&
item
);
ok
(
r
==
E_NOTIMPL
,
"expected E_NOTIMPL, got %08x
\n
"
,
r
);
ok
(
r
==
E_NOTIMPL
,
"expected E_NOTIMPL, got %08x
\n
"
,
r
);
ok
(
!
item
,
"item is not null
\n
"
);
ok
(
!
item
,
"item is not null
\n
"
);
/* VT_I2 */
V_VT
(
&
var
)
=
VT_I2
;
V_VT
(
&
var
)
=
VT_I2
;
V_I2
(
&
var
)
=
0
;
V_I2
(
&
var
)
=
0
;
...
@@ -571,6 +573,20 @@ static void test_items(void)
...
@@ -571,6 +573,20 @@ static void test_items(void)
FolderItem_Release
(
item
);
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_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0
;
V_I4
(
&
var
)
=
0
;
item
=
NULL
;
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