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
0d735ac9
Commit
0d735ac9
authored
Feb 22, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- handle IFileSystemBindData in IShellFolder::ParseDisplayName
- convert IShellFolder::ParseDisplayName to use Unicode
parent
78a04e39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
7 deletions
+56
-7
pidl.h
dlls/shell32/pidl.h
+2
-0
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+54
-7
No files found.
dlls/shell32/pidl.h
View file @
0d735ac9
...
...
@@ -212,7 +212,9 @@ LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
/* Commonly used PIDLs representing file system objects. */
LPITEMIDLIST
_ILCreateDesktop
(
void
);
LPITEMIDLIST
_ILCreateFromFindDataA
(
WIN32_FIND_DATAA
*
stffile
);
LPITEMIDLIST
_ILCreateFromFindDataW
(
WIN32_FIND_DATAW
*
stffile
);
HRESULT
_ILCreateFromPathA
(
LPCSTR
szPath
,
LPITEMIDLIST
*
ppidl
);
HRESULT
_ILCreateFromPathW
(
LPCWSTR
szPath
,
LPITEMIDLIST
*
ppidl
);
/* Other helpers */
LPITEMIDLIST
_ILCreateMyComputer
(
void
);
...
...
dlls/shell32/shfldr_fs.c
View file @
0d735ac9
...
...
@@ -296,6 +296,50 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
}
/**************************************************************************
* SHELL32_CreatePidlFromBindCtx [internal]
*
* If the caller bound File System Bind Data, assume it is the
* find data for the path.
* This allows binding of pathes that don't exist.
*/
LPITEMIDLIST
SHELL32_CreatePidlFromBindCtx
(
IBindCtx
*
pbc
,
LPCWSTR
path
)
{
static
const
WCHAR
szfsbc
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
,
' '
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
' '
,
'B'
,
'i'
,
'n'
,
'd'
,
' '
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
IFileSystemBindData
*
fsbd
=
NULL
;
LPITEMIDLIST
pidl
=
NULL
;
IUnknown
*
param
=
NULL
;
WIN32_FIND_DATAW
wfd
;
HRESULT
r
;
TRACE
(
"%p %s
\n
"
,
pbc
,
debugstr_w
(
path
));
if
(
!
pbc
)
return
NULL
;
/* see if the caller bound File System Bind Data */
r
=
IBindCtx_GetObjectParam
(
pbc
,
(
LPOLESTR
)
szfsbc
,
&
param
);
if
(
FAILED
(
r
))
return
NULL
;
r
=
IUnknown_QueryInterface
(
param
,
&
IID_IFileSystemBindData
,
(
LPVOID
*
)
&
fsbd
);
if
(
SUCCEEDED
(
r
))
{
r
=
IFileSystemBindData_GetFindData
(
fsbd
,
&
wfd
);
if
(
SUCCEEDED
(
r
))
{
lstrcpynW
(
&
wfd
.
cFileName
[
0
],
path
,
MAX_PATH
);
pidl
=
_ILCreateFromFindDataW
(
&
wfd
);
}
IFileSystemBindData_Release
(
fsbd
);
}
return
pidl
;
}
/**************************************************************************
* IShellFolder_ParseDisplayName {SHELL32}
*
* Parse a display name.
...
...
@@ -332,7 +376,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
HRESULT
hr
=
E_INVALIDARG
;
LPCWSTR
szNext
=
NULL
;
WCHAR
szElement
[
MAX_PATH
];
CHAR
szPath
[
MAX_PATH
];
W
CHAR
szPath
[
MAX_PATH
];
LPITEMIDLIST
pidlTemp
=
NULL
;
DWORD
len
;
...
...
@@ -345,18 +389,21 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
if
(
pchEaten
)
*
pchEaten
=
0
;
/* strange but like the original */
if
(
*
lpszDisplayName
)
{
pidlTemp
=
SHELL32_CreatePidlFromBindCtx
(
pbc
,
lpszDisplayName
);
if
(
!
pidlTemp
&&
*
lpszDisplayName
)
{
/* get the next element */
szNext
=
GetNextElementW
(
lpszDisplayName
,
szElement
,
MAX_PATH
);
/* build the full pathname to the element */
lstrcpyA
(
szPath
,
This
->
sPathTarget
);
PathAddBackslashA
(
szPath
);
len
=
lstrlenA
(
szPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
szElement
,
-
1
,
szPath
+
len
,
MAX_PATH
-
len
,
NULL
,
NULL
);
/* lstrcpyW(szPath, This->sPathTarget); */
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
sPathTarget
,
-
1
,
szPath
,
MAX_PATH
);
PathAddBackslashW
(
szPath
);
len
=
lstrlenW
(
szPath
);
lstrcpynW
(
szPath
+
len
,
szElement
,
MAX_PATH
-
len
);
/* get the pidl */
hr
=
_ILCreateFromPath
A
(
szPath
,
&
pidlTemp
);
hr
=
_ILCreateFromPath
W
(
szPath
,
&
pidlTemp
);
if
(
SUCCEEDED
(
hr
))
{
if
(
szNext
&&
*
szNext
)
{
...
...
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