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
406c4311
Commit
406c4311
authored
Sep 25, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Implemented IMLangConvertCharset_DoConversionToUnicode.
parent
73dfc3d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
mlang.c
dlls/mlang/mlang.c
+4
-2
mlang.c
dlls/mlang/tests/mlang.c
+63
-0
No files found.
dlls/mlang/mlang.c
View file @
406c4311
...
...
@@ -3635,6 +3635,7 @@ static HRESULT WINAPI MLangConvertCharset_GetSourceCodePage(IMLangConvertCharset
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
src_cp
);
if
(
!
src_cp
)
return
E_INVALIDARG
;
*
src_cp
=
This
->
src_cp
;
return
S_OK
;
}
...
...
@@ -3645,6 +3646,7 @@ static HRESULT WINAPI MLangConvertCharset_GetDestinationCodePage(IMLangConvertCh
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
dst_cp
);
if
(
!
dst_cp
)
return
E_INVALIDARG
;
*
dst_cp
=
This
->
dst_cp
;
return
S_OK
;
}
...
...
@@ -3668,8 +3670,8 @@ static HRESULT WINAPI MLangConvertCharset_DoConversionToUnicode(IMLangConvertCha
UINT
*
src_size
,
WCHAR
*
dest
,
UINT
*
dest_size
)
{
struct
convert_charset
*
This
=
impl_from_IMLangConvertCharset
(
iface
);
FIXME
(
"(%p)->(%p %p %p %p): stub
\n
"
,
This
,
src
,
src_size
,
dest
,
dest_size
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p %p %p %p)
\n
"
,
This
,
src
,
src_size
,
dest
,
dest_size
);
return
ConvertINetMultiByteToUnicode
(
NULL
,
This
->
src_cp
,
src
,
(
INT
*
)
src_size
,
dest
,
(
INT
*
)
dest_size
)
;
}
static
HRESULT
WINAPI
MLangConvertCharset_DoConversionFromUnicode
(
IMLangConvertCharset
*
iface
,
...
...
dlls/mlang/tests/mlang.c
View file @
406c4311
...
...
@@ -1914,6 +1914,68 @@ todo_wine {
}
}
static
void
test_IMLangConvertCharset
(
IMultiLanguage
*
ml
)
{
IMLangConvertCharset
*
convert
;
WCHAR
strW
[]
=
{
'a'
,
'b'
,
'c'
,
'd'
,
0
};
UINT
cp
,
src_size
,
dst_size
;
char
strA
[]
=
"abcd"
;
WCHAR
buffW
[
20
];
HRESULT
hr
;
hr
=
IMultiLanguage_CreateConvertCharset
(
ml
,
CP_ACP
,
CP_UTF8
,
0
,
&
convert
);
todo_wine
ok
(
hr
==
S_FALSE
,
"expected S_FALSE got 0x%08x
\n
"
,
hr
);
hr
=
IMLangConvertCharset_GetSourceCodePage
(
convert
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
cp
=
CP_UTF8
;
hr
=
IMLangConvertCharset_GetSourceCodePage
(
convert
,
&
cp
);
ok
(
hr
==
S_OK
,
"expected S_OK got 0x%08x
\n
"
,
hr
);
ok
(
cp
==
CP_ACP
,
"got %d
\n
"
,
cp
);
hr
=
IMLangConvertCharset_GetDestinationCodePage
(
convert
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
cp
=
CP_ACP
;
hr
=
IMLangConvertCharset_GetDestinationCodePage
(
convert
,
&
cp
);
ok
(
hr
==
S_OK
,
"expected S_OK got 0x%08x
\n
"
,
hr
);
ok
(
cp
==
CP_UTF8
,
"got %d
\n
"
,
cp
);
/* DoConversionToUnicode */
hr
=
IMLangConvertCharset_Initialize
(
convert
,
CP_UTF8
,
CP_UNICODE
,
0
);
ok
(
hr
==
S_OK
,
"expected S_OK got 0x%08x
\n
"
,
hr
);
hr
=
IMLangConvertCharset_DoConversionToUnicode
(
convert
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_FAIL
||
broken
(
hr
==
S_OK
)
/* win2k */
,
"got 0x%08x
\n
"
,
hr
);
src_size
=
-
1
;
dst_size
=
20
;
buffW
[
0
]
=
0
;
buffW
[
4
]
=
4
;
hr
=
IMLangConvertCharset_DoConversionToUnicode
(
convert
,
strA
,
&
src_size
,
buffW
,
&
dst_size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
memcmp
(
buffW
,
strW
,
4
*
sizeof
(
WCHAR
)),
"got converted string %s
\n
"
,
wine_dbgstr_wn
(
buffW
,
dst_size
));
ok
(
dst_size
==
4
,
"got %d
\n
"
,
dst_size
);
ok
(
buffW
[
4
]
==
4
,
"got %d
\n
"
,
buffW
[
4
]);
ok
(
src_size
==
4
,
"got %d
\n
"
,
src_size
);
src_size
=
-
1
;
dst_size
=
0
;
buffW
[
0
]
=
1
;
hr
=
IMLangConvertCharset_DoConversionToUnicode
(
convert
,
strA
,
&
src_size
,
buffW
,
&
dst_size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
buffW
[
0
]
==
1
,
"got %d
\n
"
,
buffW
[
0
]);
ok
(
dst_size
==
4
,
"got %d
\n
"
,
dst_size
);
ok
(
src_size
==
4
,
"got %d
\n
"
,
src_size
);
hr
=
IMLangConvertCharset_Initialize
(
convert
,
CP_UNICODE
,
CP_UNICODE
,
0
);
ok
(
hr
==
S_OK
,
"expected S_OK got 0x%08x
\n
"
,
hr
);
IMLangConvertCharset_Release
(
convert
);
}
START_TEST
(
mlang
)
{
IMultiLanguage
*
iML
=
NULL
;
...
...
@@ -1940,6 +2002,7 @@ START_TEST(mlang)
if
(
ret
!=
S_OK
||
!
iML
)
return
;
test_GetNumberOfCodePageInfo
((
IMultiLanguage2
*
)
iML
);
test_IMLangConvertCharset
(
iML
);
IMultiLanguage_Release
(
iML
);
...
...
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