fail as documented when the pointer to the buffer equals the pointer to the string to be converted in MultiByteToWideChar and WideCharToMultiByte
Modified: trunk/reactos/lib/kernel32/misc/nls.c

Modified: trunk/reactos/lib/kernel32/misc/nls.c
--- trunk/reactos/lib/kernel32/misc/nls.c	2005-08-03 22:49:47 UTC (rev 17038)
+++ trunk/reactos/lib/kernel32/misc/nls.c	2005-08-03 23:07:10 UTC (rev 17039)
@@ -745,7 +745,8 @@
 {
    /* Check the parameters. */
    if (MultiByteString == NULL ||
-       (WideCharString == NULL && WideCharCount > 0))
+       (WideCharString == NULL && WideCharCount > 0) ||
+       (PVOID)MultiByteString == (PVOID)WideCharString)
    {
       SetLastError(ERROR_INVALID_PARAMETER);
       return 0;
@@ -823,7 +824,8 @@
 {
    /* Check the parameters. */
    if (WideCharString == NULL ||
-       (MultiByteString == NULL && MultiByteCount > 0))
+       (MultiByteString == NULL && MultiByteCount > 0) ||
+       (PVOID)WideCharString == (PVOID)MultiByteString)
    {
       SetLastError(ERROR_INVALID_PARAMETER);
       return 0;