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
db8169b8
Commit
db8169b8
authored
Jun 19, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Convert ISF_MyComputer_fnGetDisplayNameOf to Unicode.
parent
0da8836f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
36 deletions
+32
-36
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+32
-36
No files found.
dlls/shell32/shfldr_mycomp.c
View file @
db8169b8
...
@@ -555,7 +555,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
...
@@ -555,7 +555,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
{
{
IGenericSFImpl
*
This
=
(
IGenericSFImpl
*
)
iface
;
IGenericSFImpl
*
This
=
(
IGenericSFImpl
*
)
iface
;
char
szPath
[
MAX_PATH
];
WCHAR
w
szPath
[
MAX_PATH
];
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(pidl=%p,0x%08lx,%p)
\n
"
,
This
,
pidl
,
dwFlags
,
strRet
);
TRACE
(
"(%p)->(pidl=%p,0x%08lx,%p)
\n
"
,
This
,
pidl
,
dwFlags
,
strRet
);
...
@@ -564,13 +564,14 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
...
@@ -564,13 +564,14 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
if
(
!
strRet
)
if
(
!
strRet
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
szPath
[
0
]
=
0x0
0
;
wszPath
[
0
]
=
0
;
if
(
!
pidl
->
mkid
.
cb
)
if
(
!
pidl
->
mkid
.
cb
)
{
{
/* parsing name like ::{...} */
/* parsing name like ::{...} */
lstrcpyA
(
szPath
,
"::"
);
wszPath
[
0
]
=
':'
;
SHELL32_GUIDToStringA
(
&
CLSID_MyComputer
,
&
szPath
[
2
]);
wszPath
[
1
]
=
':'
;
SHELL32_GUIDToStringW
(
&
CLSID_MyComputer
,
&
wszPath
[
2
]);
}
}
else
if
(
_ILIsPidlSimple
(
pidl
))
else
if
(
_ILIsPidlSimple
(
pidl
))
{
{
...
@@ -617,62 +618,63 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
...
@@ -617,62 +618,63 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
if
((
GET_SHGDN_RELATION
(
dwFlags
)
==
SHGDN_NORMAL
)
&&
if
((
GET_SHGDN_RELATION
(
dwFlags
)
==
SHGDN_NORMAL
)
&&
bWantsForParsing
)
bWantsForParsing
)
{
{
WCHAR
wszPath
[
MAX_PATH
];
/*
/*
* We need the filesystem path to the destination folder
* We need the filesystem path to the destination folder
* Only the folder itself can know it
* Only the folder itself can know it
*/
*/
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
,
wszPath
,
MAX_PATH
);
dwFlags
,
wszPath
,
MAX_PATH
);
if
(
SUCCEEDED
(
hr
))
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wszPath
,
-
1
,
szPath
,
MAX_PATH
,
NULL
,
NULL
))
wszPath
[
0
]
=
'\0'
;
}
}
}
else
else
{
{
LP
STR
p
;
LP
WSTR
p
=
wszPath
;
/* parsing name like ::{...} */
/* parsing name like ::{...} */
p
=
lstrcpyA
(
szPath
,
"::"
)
+
2
;
p
[
0
]
=
':'
;
p
+=
SHELL32_GUIDToStringA
(
&
CLSID_MyComputer
,
p
);
p
[
1
]
=
':'
;
p
+=
2
;
lstrcatA
(
p
,
"
\\
::"
);
p
+=
SHELL32_GUIDToStringW
(
&
CLSID_MyComputer
,
p
);
/* \:: */
p
[
0
]
=
'\\'
;
p
[
1
]
=
':'
;
p
[
2
]
=
':'
;
p
+=
3
;
p
+=
3
;
SHELL32_GUIDToString
A
(
clsid
,
p
);
SHELL32_GUIDToString
W
(
clsid
,
p
);
}
}
}
}
else
else
{
{
/* user friendly name */
/* user friendly name */
HCR_GetClassName
A
(
clsid
,
szPath
,
MAX_PATH
);
HCR_GetClassName
W
(
clsid
,
w
szPath
,
MAX_PATH
);
}
}
}
}
else
else
{
{
/* append my own path */
/* append my own path */
_ILSimpleGetText
(
pidl
,
szPath
,
MAX_PATH
);
_ILSimpleGetText
W
(
pidl
,
w
szPath
,
MAX_PATH
);
}
}
}
}
else
if
(
_ILIsDrive
(
pidl
))
else
if
(
_ILIsDrive
(
pidl
))
{
{
_ILSimpleGetText
(
pidl
,
szPath
,
MAX_PATH
);
/* append my own path */
_ILSimpleGetText
W
(
pidl
,
w
szPath
,
MAX_PATH
);
/* append my own path */
/* long view "lw_name (C:)" */
/* long view "lw_name (C:)" */
if
(
!
(
dwFlags
&
SHGDN_FORPARSING
))
if
(
!
(
dwFlags
&
SHGDN_FORPARSING
))
{
{
DWORD
dwVolumeSerialNumber
,
dwMaximumComponetLength
,
dwFileSystemFlags
;
DWORD
dwVolumeSerialNumber
,
dwMaximumComponetLength
,
dwFileSystemFlags
;
char
szDrive
[
18
]
=
""
;
WCHAR
wszDrive
[
18
]
=
{
0
};
static
const
WCHAR
wszOpenBracket
[]
=
{
' '
,
'('
,
0
};
static
const
WCHAR
wszCloseBracket
[]
=
{
')'
,
0
};
GetVolumeInformationA
(
szPath
,
szDrive
,
sizeof
(
szDrive
)
-
6
,
GetVolumeInformationW
(
wszPath
,
wszDrive
,
sizeof
(
wszDrive
)
/
sizeof
(
wszDrive
[
0
])
-
6
,
&
dwVolumeSerialNumber
,
&
dwVolumeSerialNumber
,
&
dwMaximumComponetLength
,
&
dwFileSystemFlags
,
NULL
,
0
);
&
dwMaximumComponetLength
,
&
dwFileSystemFlags
,
NULL
,
0
);
strcat
(
szDrive
,
" ("
);
strcat
W
(
wszDrive
,
wszOpenBracket
);
strncat
(
szDrive
,
szPath
,
2
);
lstrcpynW
(
wszDrive
+
strlenW
(
wszDrive
),
wszPath
,
3
);
strcat
(
szDrive
,
")"
);
strcat
W
(
wszDrive
,
wszCloseBracket
);
strcpy
(
szPath
,
szDrive
);
strcpy
W
(
wszPath
,
w
szDrive
);
}
}
}
}
else
else
...
@@ -684,25 +686,19 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
...
@@ -684,25 +686,19 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
}
}
else
else
{
{
WCHAR
wszPath
[
MAX_PATH
];
/* Complex pidl. Let the child folder do the work */
/* Complex pidl. Let the child folder do the work */
strRet
->
uType
=
STRRET_CSTR
;
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
,
wszPath
,
MAX_PATH
);
hr
=
SHELL32_GetDisplayNameOfChild
(
iface
,
pidl
,
dwFlags
,
wszPath
,
MAX_PATH
);
if
(
SUCCEEDED
(
hr
))
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wszPath
,
-
1
,
szPath
,
MAX_PATH
,
NULL
,
NULL
))
wszPath
[
0
]
=
'\0'
;
}
}
}
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
strRet
->
uType
=
STRRET_CSTR
;
strRet
->
uType
=
STRRET_CSTR
;
lstrcpynA
(
strRet
->
u
.
cStr
,
szPath
,
MAX_PATH
);
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wszPath
,
-
1
,
strRet
->
u
.
cStr
,
MAX_PATH
,
NULL
,
NULL
))
strRet
->
u
.
cStr
[
0
]
=
'\0'
;
}
}
TRACE
(
"-- (%p)->(%s)
\n
"
,
This
,
szPath
);
TRACE
(
"-- (%p)->(%s)
\n
"
,
This
,
debugstr_w
(
wszPath
)
);
return
hr
;
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