From: Hermès Bélusca-Maïto Date: Sun, 18 Oct 2015 16:44:56 +0000 (+0000) Subject: [COMSUPP]: ConvertStringToBSTR and ConvertBSTRToString really work only on ANSI strings. X-Git-Tag: ReactOS-0.4.0~452 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=da8f428784a8ea38792bf4e71294b652c6add47d [COMSUPP]: ConvertStringToBSTR and ConvertBSTRToString really work only on ANSI strings. svn path=/trunk/; revision=69603 --- diff --git a/reactos/lib/sdk/comsupp/comsupp.cpp b/reactos/lib/sdk/comsupp/comsupp.cpp index 1b97a21d405..676b53d2e5c 100644 --- a/reactos/lib/sdk/comsupp/comsupp.cpp +++ b/reactos/lib/sdk/comsupp/comsupp.cpp @@ -63,7 +63,7 @@ BSTR WINAPI ConvertStringToBSTR(const char *pSrc) if (!pSrc) return NULL; /* Compute the needed size with the NULL terminator */ - cwch = ::MultiByteToWideChar(CP_ACP /* CP_UTF8 */, 0, pSrc, -1, NULL, 0); + cwch = ::MultiByteToWideChar(CP_ACP, 0, pSrc, -1, NULL, 0); if (cwch == 0) return NULL; /* Allocate the BSTR (without the NULL terminator) */ @@ -75,7 +75,7 @@ BSTR WINAPI ConvertStringToBSTR(const char *pSrc) } /* Convert the string */ - if (::MultiByteToWideChar(CP_ACP /* CP_UTF8 */, 0, pSrc, -1, wsOut, cwch) == 0) + if (::MultiByteToWideChar(CP_ACP, 0, pSrc, -1, wsOut, cwch) == 0) { /* We failed, clean everything up */ cwch = ::GetLastError(); @@ -100,7 +100,7 @@ char* WINAPI ConvertBSTRToString(BSTR pSrc) cwch = ::SysStringLen(pSrc) + 1; /* Compute the needed size with the NULL terminator */ - cb = ::WideCharToMultiByte(CP_ACP /* CP_UTF8 */, 0, pSrc, cwch, NULL, 0, NULL, NULL); + cb = ::WideCharToMultiByte(CP_ACP, 0, pSrc, cwch, NULL, 0, NULL, NULL); if (cb == 0) { cwch = ::GetLastError(); @@ -118,7 +118,7 @@ char* WINAPI ConvertBSTRToString(BSTR pSrc) /* Convert the string and NULL-terminate */ szOut[cb - 1] = '\0'; - if (::WideCharToMultiByte(CP_ACP /* CP_UTF8 */, 0, pSrc, cwch, szOut, cb, NULL, NULL) == 0) + if (::WideCharToMultiByte(CP_ACP, 0, pSrc, cwch, szOut, cb, NULL, NULL) == 0) { /* We failed, clean everything up */ cwch = ::GetLastError();