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
0c7f4493
Commit
0c7f4493
authored
Jan 23, 2004
by
Martin Fuchs
Committed by
Alexandre Julliard
Jan 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISF_MyComputer_fnGetDisplayNameOf(): return CLSID paths of virtual
folders rooted under "My Computer" folder, better error handling.
parent
27457690
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
7 deletions
+50
-7
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+50
-7
No files found.
dlls/shell32/shfldr_mycomp.c
View file @
0c7f4493
...
...
@@ -442,6 +442,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
szDrive
[
18
];
int
len
=
0
;
BOOL
bSimplePidl
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(pidl=%p,0x%08lx,%p)
\n
"
,
This
,
pidl
,
dwFlags
,
strRet
);
pdump
(
pidl
);
...
...
@@ -461,7 +462,48 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
}
else
if
(
_ILIsSpecialFolder
(
pidl
))
{
/* take names of special folders only if its only this folder */
if
(
bSimplePidl
)
{
_ILSimpleGetText
(
pidl
,
szPath
,
MAX_PATH
);
/* append my own path */
GUID
const
*
clsid
;
if
((
clsid
=
_ILGetGUIDPointer
(
pidl
)))
{
if
(
GET_SHGDN_FOR
(
dwFlags
)
==
SHGDN_FORPARSING
)
{
int
bWantsForParsing
;
/*
* we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
* CLSID\\{...}\\shellfolder exists
* exception: the MyComputer folder has this keys not but like any filesystem backed
* folder it needs these behaviour
*/
/* get the "WantsFORPARSING" flag from the registry */
char
szRegPath
[
100
];
lstrcpyA
(
szRegPath
,
"CLSID
\\
"
);
SHELL32_GUIDToStringA
(
clsid
,
&
szRegPath
[
6
]);
lstrcatA
(
szRegPath
,
"
\\
shellfolder"
);
bWantsForParsing
=
(
ERROR_SUCCESS
==
SHGetValueA
(
HKEY_CLASSES_ROOT
,
szRegPath
,
"WantsFORPARSING"
,
NULL
,
NULL
,
NULL
));
if
((
GET_SHGDN_RELATION
(
dwFlags
)
==
SHGDN_NORMAL
)
&&
bWantsForParsing
)
{
/* we need the filesystem path to the destination folder. Only the folder itself can know it */
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
,
szPath
,
MAX_PATH
);
}
else
{
LPSTR
p
;
/* parsing name like ::{...} */
p
=
lstrcpyA
(
szPath
,
"::"
)
+
2
;
p
+=
SHELL32_GUIDToStringA
(
&
CLSID_MyComputer
,
p
);
lstrcatA
(
p
,
"
\\
::"
);
p
+=
3
;
SHELL32_GUIDToStringA
(
clsid
,
p
);
}
}
else
{
/* user friendly name */
HCR_GetClassNameA
(
clsid
,
szPath
,
MAX_PATH
);
}
}
else
_ILSimpleGetText
(
pidl
,
szPath
,
MAX_PATH
);
/* append my own path */
}
else
{
FIXME
(
"special folder
\n
"
);
}
...
...
@@ -492,15 +534,16 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface,
PathAddBackslashA
(
szPath
);
len
=
strlen
(
szPath
);
if
(
!
SUCCEEDED
(
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
|
SHGDN_INFOLDER
,
szPath
+
len
,
MAX_PATH
-
len
)))
return
E_OUTOFMEMORY
;
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
|
SHGDN_INFOLDER
,
szPath
+
len
,
MAX_PATH
-
len
);
}
if
(
SUCCEEDED
(
hr
))
{
strRet
->
uType
=
STRRET_CSTR
;
lstrcpynA
(
strRet
->
u
.
cStr
,
szPath
,
MAX_PATH
);
}
strRet
->
uType
=
STRRET_CSTR
;
lstrcpynA
(
strRet
->
u
.
cStr
,
szPath
,
MAX_PATH
);
TRACE
(
"-- (%p)->(%s)
\n
"
,
This
,
szPath
);
return
S_OK
;
return
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