Ignore:
Timestamp:
Apr 4, 2001, 12:48:05 PM (24 years ago)
Author:
sandervl
Message:

lstrcpynWtoA & lstrcpynAtoW fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/heapstring.cpp

    r5457 r5476  
    1 /* $Id: heapstring.cpp,v 1.37 2001-04-03 17:47:11 sandervl Exp $ */
     1/* $Id: heapstring.cpp,v 1.38 2001-04-04 10:48:05 sandervl Exp $ */
    22
    33/*
     
    466466
    467467    ret = WideCharToMultiByte(CP_ACP, 0, ustring, -1, astring, length, 0, NULL);
     468    if(ret == 0) {
     469         SetLastError(ERROR_SUCCESS); //WideCharToMultiByte sets it to ERROR_INSUFFICIENT_BUFFER
     470         ret = length;
     471    }
    468472    //Must not always set the last character to 0; some apps send the wrong
    469473    //string size to apis that use this function (i.e. GetMenuStringW (Notes))
     
    486490
    487491    ret = MultiByteToWideChar(CP_ACP, 0, ascii, -1, unicode, asciilen);
     492    if(ret == 0) {
     493         SetLastError(ERROR_SUCCESS); //MultiByteToWideChar sets it to ERROR_INSUFFICIENT_BUFFER
     494         ret = asciilen;
     495    }
    488496
    489497    //Must not always set the last character to 0; some apps send the wrong
Note: See TracChangeset for help on using the changeset viewer.