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
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
Show 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
...
@@ -209,17 +209,24 @@ HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT
HGLOBAL
RenderFILENAMEA
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
HGLOBAL
RenderFILENAMEA
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
{
{
int
len
,
size
=
0
;
int
size
=
0
;
char
szTemp
[
MAX_PATH
],
*
szFileName
;
char
szTemp
[
MAX_PATH
],
*
szFileName
;
LPITEMIDLIST
pidl
;
HGLOBAL
hGlobal
;
HGLOBAL
hGlobal
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
/* build name of first file */
/* get path of combined pidl */
SHGetPathFromIDListA
(
pidlRoot
,
szTemp
);
pidl
=
ILCombine
(
pidlRoot
,
apidl
[
0
]);
PathAddBackslashA
(
szTemp
);
if
(
!
pidl
)
len
=
strlen
(
szTemp
);
return
0
;
_ILSimpleGetText
(
apidl
[
0
],
szTemp
+
len
,
MAX_PATH
-
len
);
hr
=
SHELL_GetPathFromIDListA
(
pidl
,
szTemp
,
MAX_PATH
);
SHFree
(
pidl
);
if
(
FAILED
(
hr
))
return
0
;
size
=
strlen
(
szTemp
)
+
1
;
size
=
strlen
(
szTemp
)
+
1
;
/* fill the structure */
/* fill the structure */
...
@@ -228,23 +235,31 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
...
@@ -228,23 +235,31 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
szFileName
=
(
char
*
)
GlobalLock
(
hGlobal
);
szFileName
=
(
char
*
)
GlobalLock
(
hGlobal
);
memcpy
(
szFileName
,
szTemp
,
size
);
memcpy
(
szFileName
,
szTemp
,
size
);
GlobalUnlock
(
hGlobal
);
GlobalUnlock
(
hGlobal
);
return
hGlobal
;
return
hGlobal
;
}
}
HGLOBAL
RenderFILENAMEW
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
HGLOBAL
RenderFILENAMEW
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
)
{
{
int
len
,
size
=
0
;
int
size
=
0
;
WCHAR
szTemp
[
MAX_PATH
],
*
szFileName
;
WCHAR
szTemp
[
MAX_PATH
],
*
szFileName
;
LPITEMIDLIST
pidl
;
HGLOBAL
hGlobal
;
HGLOBAL
hGlobal
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
TRACE
(
"(%p,%p,%u)
\n
"
,
pidlRoot
,
apidl
,
cidl
);
/* build name of first file */
/* get path of combined pidl */
SHGetPathFromIDListW
(
pidlRoot
,
szTemp
);
pidl
=
ILCombine
(
pidlRoot
,
apidl
[
0
]);
PathAddBackslashW
(
szTemp
);
if
(
!
pidl
)
len
=
strlenW
(
szTemp
);
return
0
;
_ILSimpleGetTextW
(
apidl
[
0
],
szTemp
+
len
,
MAX_PATH
-
len
);
size
=
sizeof
(
WCHAR
)
*
(
strlenW
(
szTemp
)
+
1
);
hr
=
SHELL_GetPathFromIDListW
(
pidl
,
szTemp
,
MAX_PATH
);
SHFree
(
pidl
);
if
(
FAILED
(
hr
))
return
0
;
size
=
(
strlenW
(
szTemp
)
+
1
)
*
sizeof
(
WCHAR
);
/* fill the structure */
/* fill the structure */
hGlobal
=
GlobalAlloc
(
GHND
|
GMEM_SHARE
,
size
);
hGlobal
=
GlobalAlloc
(
GHND
|
GMEM_SHARE
,
size
);
...
@@ -252,6 +267,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
...
@@ -252,6 +267,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
szFileName
=
(
WCHAR
*
)
GlobalLock
(
hGlobal
);
szFileName
=
(
WCHAR
*
)
GlobalLock
(
hGlobal
);
memcpy
(
szFileName
,
szTemp
,
size
);
memcpy
(
szFileName
,
szTemp
,
size
);
GlobalUnlock
(
hGlobal
);
GlobalUnlock
(
hGlobal
);
return
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