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
bdcc0e36
Commit
bdcc0e36
authored
Oct 06, 2003
by
Jon Griffiths
Committed by
Alexandre Julliard
Oct 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented GetCPInfoExA/W.
Documentation updates.
parent
671f02c6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
40 deletions
+109
-40
kernel32.spec
dlls/kernel/kernel32.spec
+2
-2
codepage.c
memory/codepage.c
+107
-38
No files found.
dlls/kernel/kernel32.spec
View file @
bdcc0e36
...
...
@@ -343,8 +343,8 @@
@ stdcall GetBinaryTypeA(ptr ptr)
@ stdcall GetBinaryTypeW(ptr ptr)
@ stdcall GetCPInfo(long ptr)
@ st
ub GetCPInfoExA
@ st
ub GetCPInfoExW
@ st
dcall GetCPInfoExA(long long ptr)
@ st
dcall GetCPInfoExW(long long ptr)
@ stdcall GetCommConfig(long ptr long)
@ stdcall GetCommMask(long ptr)
@ stdcall GetCommModemStatus(long ptr)
...
...
memory/codepage.c
View file @
bdcc0e36
...
...
@@ -207,6 +207,16 @@ LANGID WINAPI GetSystemDefaultUILanguage(void)
/***********************************************************************
* IsDBCSLeadByteEx (KERNEL32.@)
*
* Determine if a character is a lead byte in a given code page.
*
* PARAMS
* codepage [I] Code page for the test.
* testchar [I] Character to test
*
* RETURNS
* TRUE, if testchar is a lead byte in codepage,
* FALSE otherwise.
*/
BOOL
WINAPI
IsDBCSLeadByteEx
(
UINT
codepage
,
BYTE
testchar
)
{
...
...
@@ -218,6 +228,15 @@ BOOL WINAPI IsDBCSLeadByteEx( UINT codepage, BYTE testchar )
/***********************************************************************
* IsDBCSLeadByte (KERNEL32.@)
* IsDBCSLeadByte (KERNEL.207)
*
* Determine if a character is a lead byte.
*
* PARAMS
* testchar [I] Character to test
*
* RETURNS
* TRUE, if testchar is a lead byte in the Ansii code page,
* FALSE otherwise.
*/
BOOL
WINAPI
IsDBCSLeadByte
(
BYTE
testchar
)
{
...
...
@@ -228,6 +247,16 @@ BOOL WINAPI IsDBCSLeadByte( BYTE testchar )
/***********************************************************************
* GetCPInfo (KERNEL32.@)
*
* Get information about a code page.
*
* PARAMS
* codepage [I] Code page number
* cpinfo [O] Destination for code page information
*
* RETURNS
* Success: TRUE. cpinfo is updated with the information about codepage.
* Failure: FALSE, if codepage is invalid or cpinfo is NULL.
*/
BOOL
WINAPI
GetCPInfo
(
UINT
codepage
,
LPCPINFO
cpinfo
)
{
...
...
@@ -256,6 +285,51 @@ BOOL WINAPI GetCPInfo( UINT codepage, LPCPINFO cpinfo )
return
TRUE
;
}
/***********************************************************************
* GetCPInfoExA (KERNEL32.@)
*
* Get extended information about a code page.
*
* PARAMS
* codepage [I] Code page number
* dwFlags [I] Reserved, must to 0.
* cpinfo [O] Destination for code page information
*
* RETURNS
* Success: TRUE. cpinfo is updated with the information about codepage.
* Failure: FALSE, if codepage is invalid or cpinfo is NULL.
*/
BOOL
WINAPI
GetCPInfoExA
(
UINT
codepage
,
DWORD
dwFlags
,
LPCPINFOEXA
cpinfo
)
{
const
union
cptable
*
table
=
get_codepage_table
(
codepage
);
if
(
!
GetCPInfo
(
codepage
,
(
LPCPINFO
)
cpinfo
))
return
FALSE
;
cpinfo
->
CodePage
=
codepage
;
cpinfo
->
UnicodeDefaultChar
=
table
->
info
.
def_unicode_char
;
strcpy
(
cpinfo
->
CodePageName
,
table
->
info
.
name
);
return
TRUE
;
}
/***********************************************************************
* GetCPInfoExW (KERNEL32.@)
*
* Unicode version of GetCPInfoExA.
*/
BOOL
WINAPI
GetCPInfoExW
(
UINT
codepage
,
DWORD
dwFlags
,
LPCPINFOEXW
cpinfo
)
{
const
union
cptable
*
table
=
get_codepage_table
(
codepage
);
if
(
!
GetCPInfo
(
codepage
,
(
LPCPINFO
)
cpinfo
))
return
FALSE
;
cpinfo
->
CodePage
=
codepage
;
cpinfo
->
UnicodeDefaultChar
=
table
->
info
.
def_unicode_char
;
MultiByteToWideChar
(
CP_ACP
,
0
,
table
->
info
.
name
,
-
1
,
cpinfo
->
CodePageName
,
sizeof
(
cpinfo
->
CodePageName
)
/
sizeof
(
WCHAR
));
return
TRUE
;
}
/***********************************************************************
* EnumSystemCodePagesA (KERNEL32.@)
...
...
@@ -305,28 +379,25 @@ BOOL WINAPI EnumSystemCodePagesW( CODEPAGE_ENUMPROCW lpfnCodePageEnum, DWORD fla
/***********************************************************************
* MultiByteToWideChar (KERNEL32.@)
*
* PARAMS
* page [in] Codepage character set to convert from
* flags [in] Character mapping flags
* src [in] Source string buffer
* srclen [in] Length of source string buffer
* dst [in] Destination buffer
* dstlen [in] Length of destination buffer
* Convert a multibyte character string into a Unicode string.
*
* NOTES
* The returned length includes the null terminator character.
* PARAMS
* page [I] Codepage character set to convert from
* flags [I] Character mapping flags
* src [I] Source string buffer
* srclen [I] Length of src, or -1 if src is NUL terminated
* dst [O] Destination buffer
* dstlen [I] Length of dst, or 0 to compute the required length
*
* RETURNS
* Success: If dstlen > 0, number of characters written to destination
* buffer. If dstlen == 0, number of characters needed to do
* conversion.
* Failure: 0. Occurs if not enough space is available.
*
* ERRORS
* ERROR_INSUFFICIENT_BUFFER
* ERROR_INVALID_PARAMETER
* ERROR_NO_UNICODE_TRANSLATION
*
* Success: If dstlen > 0, the number of characters written to dst.
* If dstlen == 0, the number of characters needed to perform the
* conversion. In both cases the count includes the terminating NUL.
* Failure: 0. Use GetLastError() to determine the cause. Possible errors are
* ERROR_INSUFFICIENT_BUFFER, if not enough space is available in dst
* and dstlen != 0; ERROR_INVALID_PARAMETER, if an invalid parameter
* is passed, and ERROR_NO_UNICODE_TRANSLATION if no translation is
* possible for src.
*/
INT
WINAPI
MultiByteToWideChar
(
UINT
page
,
DWORD
flags
,
LPCSTR
src
,
INT
srclen
,
LPWSTR
dst
,
INT
dstlen
)
...
...
@@ -386,29 +457,27 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
/***********************************************************************
* WideCharToMultiByte (KERNEL32.@)
*
* Convert a Unicode character string into a multibyte string.
*
* PARAMS
* page
[in] Code
page character set to convert to
* flags
[in] Character mapping flags
* src
[in]
Source string buffer
* srclen
[in] Length of source string buffer
* dst
[in]
Destination buffer
* dstlen
[in] Length of destination buffer
* defchar [
in
] Default character to use for conversion if no exact
* page
[I] Code
page character set to convert to
* flags
[I] Mapping Flags (MB_ constants from "winnls.h").
* src
[I]
Source string buffer
* srclen
[I] Length of src, or -1 if src is NUL terminated
* dst
[O]
Destination buffer
* dstlen
[I] Length of dst, or 0 to compute the required length
* defchar [
I
] Default character to use for conversion if no exact
* conversion can be made
* used [out] Set if default character was used in the conversion
*
* NOTES
* The returned length includes the null terminator character.
* used [O] Set if default character was used in the conversion
*
* RETURNS
* Success: If dstlen > 0, number of characters written to destination
* buffer. If dstlen == 0, number of characters needed to do
* conversion.
* Failure: 0. Occurs if not enough space is available.
*
* ERRORS
* ERROR_INSUFFICIENT_BUFFER
* ERROR_INVALID_PARAMETER
* Success: If dstlen > 0, the number of characters written to dst.
* If dstlen == 0, number of characters needed to perform the
* conversion. In both cases the count includes the terminating NUL.
* Failure: 0. Use GetLastError() to determine the cause. Possible errors are
* ERROR_INSUFFICIENT_BUFFER, if not enough space is available in dst
* and dstlen != 0, and ERROR_INVALID_PARAMETER, if an invalid
* parameter was given.
*/
INT
WINAPI
WideCharToMultiByte
(
UINT
page
,
DWORD
flags
,
LPCWSTR
src
,
INT
srclen
,
LPSTR
dst
,
INT
dstlen
,
LPCSTR
defchar
,
BOOL
*
used
)
...
...
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