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
2b3fea02
Commit
2b3fea02
authored
Jun 28, 2010
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Pass the file extension to ParseDisplayName in unixfs's SetNameOf.
parent
4d9a3117
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+10
-4
No files found.
dlls/shell32/shfldr_unixfs.c
View file @
2b3fea02
...
...
@@ -1183,9 +1183,9 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_SetNameOf(IShellFolder2* iface, H
static
const
WCHAR
awcInvalidChars
[]
=
{
'\\'
,
'/'
,
':'
,
'*'
,
'?'
,
'"'
,
'<'
,
'>'
,
'|'
};
char
szSrc
[
FILENAME_MAX
],
szDest
[
FILENAME_MAX
];
WCHAR
wszSrcRelative
[
MAX_PATH
];
WCHAR
wszSrcRelative
[
MAX_PATH
]
,
*
pwszExt
=
NULL
;
unsigned
int
i
;
int
cBasePathLen
=
lstrlenA
(
This
->
m_pszPath
);
int
cBasePathLen
=
lstrlenA
(
This
->
m_pszPath
)
,
cNameLen
;
struct
stat
statDest
;
LPITEMIDLIST
pidlSrc
,
pidlDest
,
pidlRelativeDest
;
LPOLESTR
lpwszName
;
...
...
@@ -1221,8 +1221,8 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_SetNameOf(IShellFolder2* iface, H
_ILSimpleGetTextW
(
pidl
,
wszSrcRelative
,
MAX_PATH
)
&&
SHELL_FS_HideExtension
(
wszSrcRelative
))
{
WCHAR
*
pwszExt
=
PathFindExtensionW
(
wszSrcRelative
);
int
cLenDest
=
strlen
(
szDest
);
pwszExt
=
PathFindExtensionW
(
wszSrcRelative
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
pwszExt
,
-
1
,
szDest
+
cLenDest
,
FILENAME_MAX
-
cLenDest
,
NULL
,
NULL
);
}
...
...
@@ -1238,8 +1238,14 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_SetNameOf(IShellFolder2* iface, H
return
E_FAIL
;
/* Build a pidl for the path of the renamed file */
lpwszName
=
SHAlloc
((
lstrlenW
(
lpcwszName
)
+
1
)
*
sizeof
(
WCHAR
));
/* due to const correctness. */
cNameLen
=
lstrlenW
(
lpcwszName
)
+
1
;
if
(
pwszExt
)
cNameLen
+=
lstrlenW
(
pwszExt
);
lpwszName
=
SHAlloc
(
cNameLen
*
sizeof
(
WCHAR
));
/* due to const correctness. */
lstrcpyW
(
lpwszName
,
lpcwszName
);
if
(
pwszExt
)
lstrcatW
(
lpwszName
,
pwszExt
);
hr
=
IShellFolder2_ParseDisplayName
(
iface
,
NULL
,
NULL
,
lpwszName
,
NULL
,
&
pidlRelativeDest
,
NULL
);
SHFree
(
lpwszName
);
if
(
FAILED
(
hr
))
{
...
...
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