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
9d78f678
Commit
9d78f678
authored
Jan 21, 2004
by
Martin Fuchs
Committed by
Alexandre Julliard
Jan 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only return valid file system names from RenderFILENAMEA/W() by using
SHELL_GetPathFromIDListA/W().
parent
aa43d016
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
13 deletions
+29
-13
clipboard.c
dlls/shell32/clipboard.c
+29
-13
No files found.
dlls/shell32/clipboard.c
View file @
9d78f678
...
...
@@ -209,17 +209,24 @@ HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT
HGLOBAL
RenderFILENAMEA
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
{
int
len
,
size
=
0
;
int
size
=
0
;
char
szTemp
[
MAX_PATH
],
*
szFileName
;
LPITEMIDLIST
pidl
;
HGLOBAL
hGlobal
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
/* build name of first file */
SHGetPathFromIDListA
(
pidlRoot
,
szTemp
);
PathAddBackslashA
(
szTemp
);
len
=
strlen
(
szTemp
);
_ILSimpleGetText
(
apidl
[
0
],
szTemp
+
len
,
MAX_PATH
-
len
);
/* get path of combined pidl */
pidl
=
ILCombine
(
pidlRoot
,
apidl
[
0
]);
if
(
!
pidl
)
return
0
;
hr
=
SHELL_GetPathFromIDListA
(
pidl
,
szTemp
,
MAX_PATH
);
SHFree
(
pidl
);
if
(
FAILED
(
hr
))
return
0
;
size
=
strlen
(
szTemp
)
+
1
;
/* fill the structure */
...
...
@@ -228,23 +235,31 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
szFileName
=
(
char
*
)
GlobalLock
(
hGlobal
);
memcpy
(
szFileName
,
szTemp
,
size
);
GlobalUnlock
(
hGlobal
);
return
hGlobal
;
}
HGLOBAL
RenderFILENAMEW
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
{
int
len
,
size
=
0
;
int
size
=
0
;
WCHAR
szTemp
[
MAX_PATH
],
*
szFileName
;
LPITEMIDLIST
pidl
;
HGLOBAL
hGlobal
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
/* build name of first file */
SHGetPathFromIDListW
(
pidlRoot
,
szTemp
);
PathAddBackslashW
(
szTemp
);
len
=
strlenW
(
szTemp
);
_ILSimpleGetTextW
(
apidl
[
0
],
szTemp
+
len
,
MAX_PATH
-
len
);
size
=
sizeof
(
WCHAR
)
*
(
strlenW
(
szTemp
)
+
1
);
/* get path of combined pidl */
pidl
=
ILCombine
(
pidlRoot
,
apidl
[
0
]);
if
(
!
pidl
)
return
0
;
hr
=
SHELL_GetPathFromIDListW
(
pidl
,
szTemp
,
MAX_PATH
);
SHFree
(
pidl
);
if
(
FAILED
(
hr
))
return
0
;
size
=
(
strlenW
(
szTemp
)
+
1
)
*
sizeof
(
WCHAR
);
/* fill the structure */
hGlobal
=
GlobalAlloc
(
GHND
|
GMEM_SHARE
,
size
);
...
...
@@ -252,6 +267,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
szFileName
=
(
WCHAR
*
)
GlobalLock
(
hGlobal
);
memcpy
(
szFileName
,
szTemp
,
size
);
GlobalUnlock
(
hGlobal
);
return
hGlobal
;
}
...
...
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