2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
17 /***********************************************************************
18 * GetACP (KERNEL32.148)
22 return 1252; /* Windows 3.1 ISO Latin */
25 /***********************************************************************
26 * GetCPInfo (KERNEL32.154)
28 BOOL
GetCPInfo(UINT codepage
, LPCPINFO cpinfo
)
30 cpinfo
->MaxCharSize
= 1;
31 cpinfo
->DefaultChar
[0] = '?';
36 /***********************************************************************
37 * GetOEMCP (KERNEL32.248)
41 return 437; /* MS-DOS United States */
44 /***********************************************************************
45 * MultiByteToWideChar (KERNEL32.392)
47 int MultiByteToWideChar(UINT page
, DWORD flags
, char *src
, int srclen
,
48 WCHAR
*dst
, int dstlen
)
50 return (srclen
==-1) ? strlen(src
) * 2: srclen
*2;
53 int WideCharToMultiByte(UINT page
, DWORD flags
, WCHAR
*src
, int srclen
,
54 char *dst
, int dstlen
, char* defchar
, BOOL
*used
)
57 int dont_copy
= (dstlen
==0);
58 if(page
!=GetACP() && page
!=CP_OEMCP
&& page
!=CP_ACP
)
59 fprintf(stdnimp
,"Conversion in CP %d not supported\n",page
);
61 fprintf(stdnimp
,"WideCharToMultiByte flags %lx not supported\n",flags
);
64 while(srclen
&& (dont_copy
|| dstlen
))
71 /* FIXME: Is this correct ?*/
72 if(flags
& WC_DEFAULTCHAR
){
73 *dst
= defchar
? *defchar
: '?';
83 if(srclen
!=-1)srclen
--;
89 /***********************************************************************
90 * EnumSystemCodePages32A (KERNEL32.92)
93 EnumSystemCodePages32A(CODEPAGE_ENUMPROC32A lpfnCodePageEnum
,DWORD flags
) {
94 dprintf_win32(stddeb
,"EnumSystemCodePages32A(%p,%08lx)\n",
95 lpfnCodePageEnum
,flags
97 lpfnCodePageEnum("437");
101 /***********************************************************************
102 * EnumSystemCodePages32W (KERNEL32.93)
105 EnumSystemCodePages32W( CODEPAGE_ENUMPROC32W lpfnCodePageEnum
, DWORD flags
)
108 dprintf_win32(stddeb
,"EnumSystemCodePages32W(%p,%08lx)\n",
109 lpfnCodePageEnum
,flags
);
111 cp
= HEAP_strdupAtoW( GetProcessHeap(), 0, "437" );
112 lpfnCodePageEnum(cp
);
113 HeapFree( GetProcessHeap(), 0, cp
);