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
e11f91ed
Commit
e11f91ed
authored
Dec 18, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Add a stub implementation of IMultiLanguage3::DetectOutboundCodePageInIStream.
parent
88778ec0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
246 additions
and
7 deletions
+246
-7
mlang.c
dlls/mlang/mlang.c
+21
-7
mlang.c
dlls/mlang/tests/mlang.c
+213
-0
mlang.idl
include/mlang.idl
+12
-0
No files found.
dlls/mlang/mlang.c
View file @
e11f91ed
...
...
@@ -3064,10 +3064,17 @@ static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePage(
{
MLang_impl
*
This
=
impl_from_IMultiLanguage3
(
iface
);
FIXME
(
"(%p)->(%08x %s %u %p %u %p %p %p)
\n
"
,
This
,
dwFlags
,
debugstr_w
(
lpWideCharStr
),
cchWideChar
,
puiPreferredCodePages
,
nPreferredCodePages
,
puiDetectedCodePages
,
pnDetectedCodePages
,
lpSpecialChar
);
return
E_NOTIMPL
;
FIXME
(
"(%p)->(%08x %s %p %u %p %p(%u) %s)
\n
"
,
This
,
dwFlags
,
debugstr_w
(
lpWideCharStr
),
puiPreferredCodePages
,
nPreferredCodePages
,
puiDetectedCodePages
,
pnDetectedCodePages
,
pnDetectedCodePages
?
*
pnDetectedCodePages
:
0
,
debugstr_w
(
lpSpecialChar
));
if
(
!
puiDetectedCodePages
||
!
pnDetectedCodePages
||
!*
pnDetectedCodePages
)
return
E_INVALIDARG
;
puiDetectedCodePages
[
0
]
=
CP_UTF8
;
*
pnDetectedCodePages
=
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
fnIMultiLanguage3_DetectOutboundCodePageInIStream
(
...
...
@@ -3082,10 +3089,17 @@ static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePageInIStream(
{
MLang_impl
*
This
=
impl_from_IMultiLanguage3
(
iface
);
FIXME
(
"(%p)->(%08x %p %p %u %p %p
%p
)
\n
"
,
This
,
dwFlags
,
pStrIn
,
FIXME
(
"(%p)->(%08x %p %p %u %p %p
(%u) %s
)
\n
"
,
This
,
dwFlags
,
pStrIn
,
puiPreferredCodePages
,
nPreferredCodePages
,
puiDetectedCodePages
,
pnDetectedCodePages
,
lpSpecialChar
);
return
E_NOTIMPL
;
pnDetectedCodePages
,
pnDetectedCodePages
?
*
pnDetectedCodePages
:
0
,
debugstr_w
(
lpSpecialChar
));
if
(
!
puiDetectedCodePages
||
!
pnDetectedCodePages
||
!*
pnDetectedCodePages
)
return
E_INVALIDARG
;
puiDetectedCodePages
[
0
]
=
CP_UTF8
;
*
pnDetectedCodePages
=
1
;
return
S_OK
;
}
static
const
IMultiLanguage3Vtbl
IMultiLanguage3_vtbl
=
...
...
dlls/mlang/tests/mlang.c
View file @
e11f91ed
...
...
@@ -1984,10 +1984,214 @@ todo_wine
IMLangConvertCharset_Release
(
convert
);
}
static
const
char
stream_data
[]
=
"VCARD2.1test;test"
;
static
ULONG
stream_pos
;
static
HRESULT
WINAPI
stream_QueryInterface
(
IStream
*
iface
,
REFIID
riid
,
void
**
obj
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
stream_AddRef
(
IStream
*
iface
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
2
;
}
static
ULONG
WINAPI
stream_Release
(
IStream
*
iface
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
1
;
}
static
HRESULT
WINAPI
stream_Read
(
IStream
*
iface
,
void
*
buf
,
ULONG
len
,
ULONG
*
read
)
{
ULONG
size
;
if
(
stream_pos
==
sizeof
(
stream_data
)
-
1
)
{
*
read
=
0
;
return
S_FALSE
;
}
size
=
min
(
sizeof
(
stream_data
)
-
1
-
stream_pos
,
len
);
memcpy
(
buf
,
stream_data
+
stream_pos
,
size
);
stream_pos
+=
size
;
*
read
=
size
;
return
S_OK
;
}
static
HRESULT
WINAPI
stream_Write
(
IStream
*
iface
,
const
void
*
buf
,
ULONG
len
,
ULONG
*
written
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_Seek
(
IStream
*
iface
,
LARGE_INTEGER
move
,
DWORD
origin
,
ULARGE_INTEGER
*
newpos
)
{
if
(
origin
==
STREAM_SEEK_SET
)
stream_pos
=
move
.
QuadPart
;
else
if
(
origin
==
STREAM_SEEK_CUR
)
stream_pos
+=
move
.
QuadPart
;
else
if
(
origin
==
STREAM_SEEK_END
)
stream_pos
=
sizeof
(
stream_data
)
-
1
-
move
.
QuadPart
;
if
(
newpos
)
newpos
->
QuadPart
=
stream_pos
;
return
S_OK
;
}
static
HRESULT
WINAPI
stream_SetSize
(
IStream
*
iface
,
ULARGE_INTEGER
newsize
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_CopyTo
(
IStream
*
iface
,
IStream
*
stream
,
ULARGE_INTEGER
len
,
ULARGE_INTEGER
*
read
,
ULARGE_INTEGER
*
written
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_Commit
(
IStream
*
iface
,
DWORD
flags
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_Revert
(
IStream
*
iface
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_LockRegion
(
IStream
*
iface
,
ULARGE_INTEGER
offset
,
ULARGE_INTEGER
len
,
DWORD
locktype
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_UnlockRegion
(
IStream
*
iface
,
ULARGE_INTEGER
offset
,
ULARGE_INTEGER
len
,
DWORD
locktype
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_Stat
(
IStream
*
iface
,
STATSTG
*
stg
,
DWORD
flag
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
stream_Clone
(
IStream
*
iface
,
IStream
**
stream
)
{
ok
(
FALSE
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
const
IStreamVtbl
stream_vtbl
=
{
stream_QueryInterface
,
stream_AddRef
,
stream_Release
,
stream_Read
,
stream_Write
,
stream_Seek
,
stream_SetSize
,
stream_CopyTo
,
stream_Commit
,
stream_Revert
,
stream_LockRegion
,
stream_UnlockRegion
,
stream_Stat
,
stream_Clone
};
static
IStream
test_stream
=
{
&
stream_vtbl
};
static
void
test_DetectOutboundCodePageInIStream
(
IMultiLanguage3
*
ml
)
{
HRESULT
hr
;
UINT
nb_detected
,
detected
[
4
];
UINT
preferred
[]
=
{
1250
,
1251
,
1252
,
65001
};
UINT
preferred2
[]
=
{
1250
,
1251
,
1252
};
nb_detected
=
0
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
nb_detected
=
1
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
NULL
,
&
nb_detected
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
nb_detected
=
1
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
nb_detected
==
1
,
"got %u
\n
"
,
nb_detected
);
ok
(
detected
[
0
]
==
65001
,
"got %u
\n
"
,
detected
[
0
]);
nb_detected
=
2
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
nb_detected
==
2
,
"got %u
\n
"
,
nb_detected
);
ok
(
detected
[
0
]
==
65001
,
"got %u
\n
"
,
detected
[
0
]);
todo_wine
ok
(
detected
[
1
]
==
65000
,
"got %u
\n
"
,
detected
[
1
]);
nb_detected
=
3
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
nb_detected
==
3
,
"got %u
\n
"
,
nb_detected
);
ok
(
detected
[
0
]
==
65001
,
"got %u
\n
"
,
detected
[
0
]);
todo_wine
ok
(
detected
[
1
]
==
65000
,
"got %u
\n
"
,
detected
[
1
]);
todo_wine
ok
(
detected
[
2
]
==
1200
,
"got %u
\n
"
,
detected
[
2
]);
nb_detected
=
4
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred
,
sizeof
(
preferred
)
/
sizeof
(
preferred
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
nb_detected
==
3
,
"got %u
\n
"
,
nb_detected
);
ok
(
detected
[
0
]
==
65001
,
"got %u
\n
"
,
detected
[
0
]);
todo_wine
ok
(
detected
[
1
]
==
65000
,
"got %u
\n
"
,
detected
[
1
]);
todo_wine
ok
(
detected
[
2
]
==
1200
,
"got %u
\n
"
,
detected
[
2
]);
ok
(
detected
[
3
]
==
0
,
"got %u
\n
"
,
detected
[
3
]);
nb_detected
=
3
;
memset
(
detected
,
0
,
sizeof
(
detected
));
hr
=
IMultiLanguage3_DetectOutboundCodePageInIStream
(
ml
,
MLDETECTF_PRESERVE_ORDER
,
&
test_stream
,
preferred2
,
sizeof
(
preferred2
)
/
sizeof
(
preferred2
[
0
]),
detected
,
&
nb_detected
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
nb_detected
==
3
,
"got %u
\n
"
,
nb_detected
);
ok
(
detected
[
0
]
==
65001
,
"got %u
\n
"
,
detected
[
0
]);
todo_wine
ok
(
detected
[
1
]
==
65000
,
"got %u
\n
"
,
detected
[
1
]);
todo_wine
ok
(
detected
[
2
]
==
1200
,
"got %u
\n
"
,
detected
[
2
]);
}
START_TEST
(
mlang
)
{
IMultiLanguage
*
iML
=
NULL
;
IMultiLanguage2
*
iML2
=
NULL
;
IMultiLanguage3
*
iML3
=
NULL
;
IMLangFontLink
*
iMLFL
=
NULL
;
IMLangFontLink2
*
iMLFL2
=
NULL
;
HRESULT
ret
;
...
...
@@ -2070,5 +2274,14 @@ START_TEST(mlang)
test_CodePageToScriptID
(
iMLFL2
);
IMLangFontLink2_Release
(
iMLFL2
);
trace
(
"IMultiLanguage3
\n
"
);
ret
=
CoCreateInstance
(
&
CLSID_CMultiLanguage
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMultiLanguage3
,
(
void
**
)
&
iML3
);
if
(
ret
==
S_OK
)
{
test_DetectOutboundCodePageInIStream
(
iML3
);
IMultiLanguage3_Release
(
iML3
);
}
CoUninitialize
();
}
include/mlang.idl
View file @
e11f91ed
...
...
@@ -386,6 +386,18 @@ interface IMLangConvertCharset : IUnknown
MLCONVCHARF_DETECTJPN
=
32
}
MLCONVCHAR
;
typedef
enum
tagMLCPF
{
MLDETECTF_MAILNEWS
=
0
x0001
,
MLDETECTF_BROWSER
=
0
x0002
,
MLDETECTF_VALID
=
0
x0004
,
MLDETECTF_VALID_NLS
=
0
x0008
,
MLDETECTF_PRESERVE_ORDER
=
0
x0010
,
MLDETECTF_PREFERRED_ONLY
=
0
x0020
,
MLDETECTF_FILTER_SPECIALCHAR
=
0
x0040
,
MLDETECTF_EURO_UTF8
=
0
x0080
}
MLCP
;
HRESULT
Initialize
(
[
in
]
UINT
uiSrcCodePage
,
[
in
]
UINT
uiDstCodePage
,
...
...
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