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
2ef383c0
Commit
2ef383c0
authored
Sep 28, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement FolderItem::Name() property getter.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
682c1b95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
7 deletions
+55
-7
shelldispatch.c
dlls/shell32/shelldispatch.c
+32
-4
shelldispatch.c
dlls/shell32/tests/shelldispatch.c
+23
-3
No files found.
dlls/shell32/shelldispatch.c
View file @
2ef383c0
...
...
@@ -748,12 +748,40 @@ static HRESULT WINAPI FolderItemImpl_get_Parent(FolderItem2 *iface, IDispatch **
return
S_OK
;
}
static
HRESULT
WINAPI
FolderItemImpl_get_Name
(
FolderItem2
*
iface
,
BSTR
*
pbs
)
static
HRESULT
WINAPI
FolderItemImpl_get_Name
(
FolderItem2
*
iface
,
BSTR
*
name
)
{
FIXME
(
"(%p,%p)
\n
"
,
iface
,
pbs
);
FolderItemImpl
*
This
=
impl_from_FolderItem
(
iface
);
LPCITEMIDLIST
last_part
;
IShellFolder2
*
parent
;
HRESULT
hr
=
S_OK
;
LPITEMIDLIST
pidl
;
STRRET
strret
;
*
pbs
=
NULL
;
return
E_NOTIMPL
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
name
);
*
name
=
NULL
;
if
(
This
->
path
)
hr
=
SHParseDisplayName
(
This
->
path
,
NULL
,
&
pidl
,
0
,
NULL
);
else
pidl
=
This
->
folder
->
pidl
;
if
(
FAILED
(
hr
))
return
S_FALSE
;
hr
=
SHBindToParent
(
pidl
,
&
IID_IShellFolder2
,
(
void
**
)
&
parent
,
&
last_part
);
if
(
hr
==
S_OK
)
hr
=
IShellFolder2_GetDisplayNameOf
(
parent
,
last_part
,
SHGDN_INFOLDER
,
&
strret
);
IShellFolder2_Release
(
parent
);
if
(
hr
==
S_OK
)
hr
=
StrRetToBSTR
(
&
strret
,
last_part
,
name
);
if
(
This
->
path
)
ILFree
(
pidl
);
return
hr
;
}
static
HRESULT
WINAPI
FolderItemImpl_put_Name
(
FolderItem2
*
iface
,
BSTR
bs
)
...
...
dlls/shell32/tests/shelldispatch.c
View file @
2ef383c0
...
...
@@ -49,12 +49,22 @@ static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*);
/* Updated Windows 7 has a new IShellDispatch6 in its typelib */
DEFINE_GUID
(
IID_IWin7ShellDispatch6
,
0x34936ba1
,
0x67ad
,
0x4c41
,
0x99
,
0xb8
,
0x8c
,
0x12
,
0xdf
,
0xf1
,
0xe9
,
0x74
);
static
BSTR
a2bstr
(
const
char
*
str
)
{
BSTR
ret
;
int
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
SysAllocStringLen
(
NULL
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
}
static
void
variant_set_string
(
VARIANT
*
v
,
const
char
*
s
)
{
WCHAR
wstr
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
s
,
-
1
,
wstr
,
MAX_PATH
);
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
SysAllocString
(
wstr
);
V_BSTR
(
v
)
=
a2bstr
(
s
);
}
static
void
init_function_pointers
(
void
)
...
...
@@ -595,6 +605,7 @@ static void test_items(void)
for
(
i
=
0
;
i
<
sizeof
(
file_defs
)
/
sizeof
(
file_defs
[
0
]);
i
++
)
{
VARIANT_BOOL
b
;
BSTR
name
;
V_I4
(
&
int_index
)
=
i
;
variant_set_string
(
&
str_index
,
file_defs
[
i
].
name
);
...
...
@@ -618,6 +629,15 @@ static void test_items(void)
"file_defs[%d]: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
bstr
=
a2bstr
(
file_defs
[
i
].
name
);
r
=
FolderItem_get_Name
(
item
,
&
name
);
ok
(
r
==
S_OK
,
"Failed to get item name, hr %#x.
\n
"
,
r
);
/* Returned display name does not have to strictly match file name, e.g. extension could be omitted. */
ok
(
lstrlenW
(
name
)
<=
lstrlenW
(
bstr
),
"file_defs[%d]: unexpected name length.
\n
"
,
i
);
ok
(
!
memcmp
(
bstr
,
name
,
lstrlenW
(
name
)
*
sizeof
(
WCHAR
)),
"file_defs[%d]: unexpected name %s.
\n
"
,
i
,
wine_dbgstr_w
(
name
));
SysFreeString
(
name
);
SysFreeString
(
bstr
);
item
=
NULL
;
r
=
FolderItems_Item
(
items
,
str_index
,
&
item
);
ok
(
r
==
S_OK
,
"file_defs[%d]: FolderItems::Item failed: %08x
\n
"
,
i
,
r
);
...
...
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