fail as documented when the pointer to the buffer equals the pointer to the string to be converted in MultiByteToWideChar and WideCharToMultiByte

svn path=/trunk/; revision=17039
This commit is contained in:
Thomas Bluemel 2005-08-03 23:07:10 +00:00
parent 9912b90aff
commit f89d9a13ad

View file

@ -745,7 +745,8 @@ MultiByteToWideChar(UINT CodePage, DWORD Flags,
{ {
/* Check the parameters. */ /* Check the parameters. */
if (MultiByteString == NULL || if (MultiByteString == NULL ||
(WideCharString == NULL && WideCharCount > 0)) (WideCharString == NULL && WideCharCount > 0) ||
(PVOID)MultiByteString == (PVOID)WideCharString)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return 0; return 0;
@ -823,7 +824,8 @@ WideCharToMultiByte(UINT CodePage, DWORD Flags,
{ {
/* Check the parameters. */ /* Check the parameters. */
if (WideCharString == NULL || if (WideCharString == NULL ||
(MultiByteString == NULL && MultiByteCount > 0)) (MultiByteString == NULL && MultiByteCount > 0) ||
(PVOID)WideCharString == (PVOID)MultiByteString)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return 0; return 0;