mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:35:41 +00:00
- Implement GetCPInfo. Now this function passes all Wine tests
svn path=/trunk/; revision=37387
This commit is contained in:
parent
4e37ce697b
commit
415da61549
1 changed files with 42 additions and 17 deletions
|
@ -1238,29 +1238,54 @@ GetCalendarInfoW(
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
GetCPInfo (
|
GetCPInfo(UINT CodePage,
|
||||||
UINT CodePage,
|
LPCPINFO CodePageInfo)
|
||||||
LPCPINFO CodePageInfo
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
unsigned i;
|
PCODEPAGE_ENTRY CodePageEntry;
|
||||||
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
if (!CodePageInfo)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
CodePageInfo->MaxCharSize = 1;
|
CodePageEntry = IntGetCodePageEntry(CodePage);
|
||||||
CodePageInfo->DefaultChar[0] = '?';
|
if (CodePageEntry == NULL)
|
||||||
for (i = 1; i < MAX_DEFAULTCHAR; i++)
|
{
|
||||||
{
|
switch(CodePage)
|
||||||
CodePageInfo->DefaultChar[i] = 0;
|
{
|
||||||
}
|
case CP_UTF7:
|
||||||
for (i = 0; i < MAX_LEADBYTES; i++)
|
case CP_UTF8:
|
||||||
{
|
CodePageInfo->DefaultChar[0] = 0x3f;
|
||||||
CodePageInfo->LeadByte[i] = 0;
|
CodePageInfo->DefaultChar[1] = 0;
|
||||||
}
|
CodePageInfo->LeadByte[0] = CodePageInfo->LeadByte[1] = 0;
|
||||||
|
CodePageInfo->MaxCharSize = (CodePage == CP_UTF7) ? 5 : 4;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CodePageEntry->CodePageTable.DefaultChar & 0xff00)
|
||||||
|
{
|
||||||
|
CodePageInfo->DefaultChar[0] = (CodePageEntry->CodePageTable.DefaultChar & 0xff00) >> 8;
|
||||||
|
CodePageInfo->DefaultChar[1] = CodePageEntry->CodePageTable.DefaultChar & 0x00ff;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CodePageInfo->DefaultChar[0] = CodePageEntry->CodePageTable.DefaultChar & 0xff;
|
||||||
|
CodePageInfo->DefaultChar[1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((CodePageInfo->MaxCharSize = CodePageEntry->CodePageTable.MaximumCharacterSize) == 2)
|
||||||
|
memcpy(CodePageInfo->LeadByte, CodePageEntry->CodePageTable.LeadByte, sizeof(CodePageInfo->LeadByte));
|
||||||
|
else
|
||||||
|
CodePageInfo->LeadByte[0] = CodePageInfo->LeadByte[1] = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue