Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Helander
wine
Commits
9d78f678
Commit
9d78f678
authored
21 years ago
by
Martin Fuchs
Committed by
Alexandre Julliard
21 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Only return valid file system names from RenderFILENAMEA/W() by using
SHELL_GetPathFromIDListA/W().
parent
aa43d016
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shell32/clipboard.c
+29
-13
29 additions, 13 deletions
dlls/shell32/clipboard.c
with
29 additions
and
13 deletions
dlls/shell32/clipboard.c
+
29
−
13
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment