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
4e3ce9f8
Commit
4e3ce9f8
authored
Jul 08, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Reimplement ConvertINetMultiByteToUnicode.
parent
e7fe63df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
22 deletions
+35
-22
mlang.c
dlls/mlang/mlang.c
+35
-22
No files found.
dlls/mlang/mlang.c
View file @
4e3ce9f8
...
...
@@ -546,50 +546,63 @@ HRESULT WINAPI ConvertINetUnicodeToMultiByte(
LPSTR
pDstStr
,
LPINT
pcDstSize
)
{
INT
destsz
,
size
;
INT
src_len
=
-
1
;
TRACE
(
"%p %d %s %p %p %p
\n
"
,
pdwMode
,
dwEncoding
,
debugstr_w
(
pSrcStr
),
pcSrcSize
,
pDstStr
,
pcDstSize
);
if
(
!
pcDstSize
)
return
E_FAIL
;
return
S_OK
;
if
(
!
pcSrcSize
)
pcSrcSize
=
&
src_len
;
if
(
!*
pcSrcSize
)
{
*
pcDstSize
=
0
;
destsz
=
(
pDstStr
)
?
*
pcDstSize
:
0
;
*
pcDstSize
=
0
;
if
(
!
pSrcStr
||
!*
pcSrcSize
)
return
S_OK
;
}
switch
(
dwEncoding
)
if
(
*
pcSrcSize
==
-
1
)
*
pcSrcSize
=
lstrlenW
(
pSrcStr
);
if
(
dwEncoding
==
CP_UNICODE
)
{
case
CP_UNICODE
:
if
(
*
pcSrcSize
==
-
1
)
*
pcSrcSize
=
lstrlenW
(
pSrcStr
);
*
pcDstSize
=
min
(
*
pcSrcSize
*
sizeof
(
WCHAR
),
*
pcDstSize
);
size
=
min
(
*
pcSrcSize
,
destsz
)
*
sizeof
(
WCHAR
);
if
(
pDstStr
)
memmove
(
pDstStr
,
pSrcStr
,
*
pcDstSize
);
break
;
memmove
(
pDstStr
,
pSrcStr
,
size
);
default:
if
(
*
pcSrcSize
==
-
1
)
*
pcSrcSize
=
lstrlenW
(
pSrcStr
);
if
(
size
>=
destsz
)
goto
fail
;
}
else
{
size
=
WideCharToMultiByte
(
dwEncoding
,
0
,
pSrcStr
,
*
pcSrcSize
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
size
)
goto
fail
;
if
(
pDstStr
)
*
pcDstSize
=
WideCharToMultiByte
(
dwEncoding
,
0
,
pSrcStr
,
*
pcSrcSize
,
pDstStr
,
*
pcDstSize
,
NULL
,
NULL
);
else
*
pcDstSize
=
WideCharToMultiByte
(
dwEncoding
,
0
,
pSrcStr
,
*
pcSrcSize
,
NULL
,
0
,
NULL
,
NULL
);
break
;
{
size
=
min
(
size
,
destsz
);
size
=
WideCharToMultiByte
(
dwEncoding
,
0
,
pSrcStr
,
*
pcSrcSize
,
pDstStr
,
destsz
,
NULL
,
NULL
);
if
(
!
size
)
goto
fail
;
}
}
if
(
!*
pcDstSize
)
return
E_FAIL
;
*
pcDstSize
=
size
;
return
S_OK
;
fail:
*
pcSrcSize
=
0
;
*
pcDstSize
=
0
;
return
E_FAIL
;
}
HRESULT
WINAPI
ConvertINetString
(
...
...
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