- switched the Windows backend to use the Windows Unicode API.
With localization for non-Latin languages on the support list the multibyte API doesn't cut it anymore. It neither can handle system text output outside the local code page nor can an ANSI window receive text input outside its own code page. Similar problems exist for file names. With the multibyte API it is impossible to handle any file containing characters outside the active local code page. So as of now, everything that may pass along some Unicode text will use the Unicode API with some text conversion functions. The only places where calls to the multibyte API were left are those where known string literals are passed or where the information is not used for anything but comparing it to other return values from the same API.
This commit is contained in:
parent
8efc3188b9
commit
868ac5adf8
30 changed files with 325 additions and 228 deletions
|
|
@ -173,7 +173,7 @@ bool FCDThread::Init ()
|
|||
CD_WindowClass.style = CS_NOCLOSE;
|
||||
CD_WindowClass.lpfnWndProc = CD_WndProc;
|
||||
CD_WindowClass.hInstance = g_hInst;
|
||||
CD_WindowClass.lpszClassName = GAMENAME " CD Player";
|
||||
CD_WindowClass.lpszClassName = WGAMENAME " CD Player";
|
||||
CD_WindowAtom = RegisterClass (&CD_WindowClass);
|
||||
|
||||
if (CD_WindowAtom == 0)
|
||||
|
|
@ -181,7 +181,7 @@ bool FCDThread::Init ()
|
|||
|
||||
CD_Window = CreateWindow (
|
||||
(LPCTSTR)(INT_PTR)(int)CD_WindowAtom,
|
||||
GAMENAME " CD Player",
|
||||
WGAMENAME " CD Player",
|
||||
0,
|
||||
0, 0, 10, 10,
|
||||
NULL,
|
||||
|
|
@ -263,12 +263,12 @@ DWORD FCDThread::Dispatch (DWORD method, DWORD parm1, DWORD parm2, DWORD parm3)
|
|||
DWORD firstTrack, lastTrack, numTracks;
|
||||
DWORD length;
|
||||
DWORD openFlags;
|
||||
char ident[32];
|
||||
wchar_t ident[32];
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case CDM_Init:
|
||||
mciOpen.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO;
|
||||
mciOpen.lpstrDeviceType = (LPCWSTR)MCI_DEVTYPE_CD_AUDIO;
|
||||
openFlags = MCI_OPEN_SHAREABLE|MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID|MCI_WAIT;
|
||||
if ((signed)parm1 >= 0)
|
||||
{
|
||||
|
|
@ -411,7 +411,7 @@ DWORD FCDThread::Dispatch (DWORD method, DWORD parm1, DWORD parm2, DWORD parm3)
|
|||
|
||||
case CDM_GetMediaIdentity:
|
||||
case CDM_GetMediaUPC:
|
||||
char ident[32];
|
||||
wchar_t ident[32];
|
||||
|
||||
infoParms.lpstrReturn = ident;
|
||||
infoParms.dwRetSize = sizeof(ident);
|
||||
|
|
@ -423,7 +423,7 @@ DWORD FCDThread::Dispatch (DWORD method, DWORD parm1, DWORD parm2, DWORD parm3)
|
|||
}
|
||||
else
|
||||
{
|
||||
return strtoul (ident, NULL, 0);
|
||||
return wcstoul (ident, NULL, 0);
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue