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
5e9e487b
Commit
5e9e487b
authored
Sep 02, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translate file name from unix to ANSI encoding in
UnixFolder_IShellFolder2_GetDisplayNameOf.
parent
55124ec0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+19
-3
No files found.
dlls/shell32/shfldr_unixfs.c
View file @
5e9e487b
...
...
@@ -471,7 +471,7 @@ static BOOL UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, LPIT
}
pidl
->
mkid
.
cb
=
0
;
/* Terminate the ITEMIDLIST */
if
((
int
)
pidl
-
(
int
)
*
ppidl
+
sizeof
(
USHORT
)
!=
cPidlLen
)
/* We've corrupted the heap :( */
if
((
char
*
)
pidl
-
(
char
*
)
*
ppidl
+
sizeof
(
USHORT
)
!=
cPidlLen
)
/* We've corrupted the heap :( */
ERR
(
"Computed length of pidl incorrect. Please report.
\n
"
);
return
TRUE
;
...
...
@@ -783,6 +783,22 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetUIObjectOf(IShellFolder2* ifac
}
}
/******************************************************************************
* Translate file name from unix to ANSI encoding.
*/
static
void
strcpyn_U2A
(
char
*
win_fn
,
UINT
win_fn_len
,
const
char
*
unix_fn
)
{
UINT
len
;
WCHAR
*
unicode_fn
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unix_fn
,
-
1
,
NULL
,
0
);
unicode_fn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
unix_fn
,
-
1
,
unicode_fn
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
unicode_fn
,
len
,
win_fn
,
win_fn_len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
unicode_fn
);
}
static
HRESULT
WINAPI
UnixFolder_IShellFolder2_GetDisplayNameOf
(
IShellFolder2
*
iface
,
LPCITEMIDLIST
pidl
,
SHGDNF
uFlags
,
STRRET
*
lpName
)
{
...
...
@@ -797,7 +813,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
if
(
!
pidl
||
!
pidl
->
mkid
.
cb
)
{
lpName
->
uType
=
STRRET_CSTR
;
if
(
This
->
m_dwPathMode
==
PATHMODE_UNIX
)
{
strcpy
(
lpName
->
u
.
cStr
,
This
->
m_pszPath
);
strcpy
n_U2A
(
lpName
->
u
.
cStr
,
MAX_PATH
,
This
->
m_pszPath
);
}
else
{
WCHAR
*
pwszDosPath
=
wine_get_dos_file_name
(
This
->
m_pszPath
);
if
(
!
pwszDosPath
)
...
...
@@ -819,7 +835,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i
}
else
{
char
*
pszFileName
=
_ILGetTextPointer
(
pidl
);
lpName
->
uType
=
STRRET_CSTR
;
strcpy
(
lpName
->
u
.
cStr
,
pszFileName
?
pszFileName
:
""
);
strcpy
n_U2A
(
lpName
->
u
.
cStr
,
MAX_PATH
,
pszFileName
?
pszFileName
:
""
);
}
/* If in dos mode, do some post-processing on the path.
...
...
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