Author: hbelusca Date: Sun Oct 18 16:44:56 2015 New Revision: 69603
URL: http://svn.reactos.org/svn/reactos?rev=69603&view=rev Log: [COMSUPP]: ConvertStringToBSTR and ConvertBSTRToString really work only on ANSI strings.
Modified: trunk/reactos/lib/sdk/comsupp/comsupp.cpp
Modified: trunk/reactos/lib/sdk/comsupp/comsupp.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/comsupp/comsupp.cpp... ============================================================================== --- trunk/reactos/lib/sdk/comsupp/comsupp.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/comsupp/comsupp.cpp [iso-8859-1] Sun Oct 18 16:44:56 2015 @@ -63,7 +63,7 @@ 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 @@ }
/* 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 @@ 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 @@
/* 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();