VirtualBox

Changeset 81321 in vbox


Ignore:
Timestamp:
Oct 17, 2019 2:46:33 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Convert ANSI to UTF-8 in SharedClipboardWinDropFilesToStringList(). Untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp

    r81319 r81321  
    11281128        {
    11291129            /* Allocate enough space (including terminator). */
    1130             pszFileUtf8 = (char *)RTMemAlloc((cchFile + 1) * sizeof(char));
    1131             if (pszFileUtf8)
     1130            char *pszFileANSI = (char *)RTMemAlloc((cchFile + 1) * sizeof(char));
     1131            UINT  cchFileANSI = 0;
     1132            if (pszFileANSI)
    11321133            {
    1133                 cchFileUtf8 = DragQueryFileA(hDrop, i /* File index */,
    1134                                              pszFileUtf8, cchFile + 1 /* Include terminator */);
    1135 
    1136                 AssertMsg(cchFileUtf8 == cchFile, ("cchFileUtf8 (%RU16) does not match cchFile (%RU16)\n",
    1137                                                    cchFileUtf8, cchFile));
     1134                cchFileANSI = DragQueryFileA(hDrop, i /* File index */,
     1135                                             pszFileANSI, cchFile + 1 /* Include terminator */);
     1136
     1137                AssertMsg(cchFileANSI == cchFile, ("cchFileANSI (%RU16) does not match cchFile (%RU16)\n",
     1138                                                   cchFileANSI, cchFile));
     1139
     1140                /* Convert the ANSI codepage to UTF-8. */
     1141                rc = RTStrCurrentCPToUtf8(&pszFileUtf8, pszFileANSI);
     1142                if (RT_SUCCESS(rc))
     1143                {
     1144                    cchFileUtf8 = (UINT)strlen(pszFileUtf8);
     1145                }
    11381146            }
    11391147            else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette