Changeset 8552 for trunk/src


Ignore:
Timestamp:
Jun 2, 2002, 9:32:46 PM (23 years ago)
Author:
sandervl
Message:

Added automatic asii/unicode conversion to DragQueryFileA/W

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shellole.c

    r8540 r8552  
    577577        lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
    578578
     579    if(lpDropFileStruct->fWide == TRUE) {
     580        LPWSTR lpszFileW = NULL;
     581
     582        if(lpszFile) {
     583            lpszFileW = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
     584            if(lpszFileW == NULL) {
     585                goto end;
     586            }
     587        }
     588        i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength);
     589
     590        if(lpszFileW) {
     591            WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL);
     592            HeapFree(GetProcessHeap(), 0, lpszFileW);
     593        }
     594        goto end;
     595    }
     596
    579597        while (i++ < lFile)
    580598        {
     
    614632        if(!lpDropFileStruct) goto end;
    615633
     634    if(lpDropFileStruct->fWide == FALSE) {
     635        LPSTR lpszFileA = NULL;
     636
     637        if(lpszwFile) {
     638            lpszFileA = (LPSTR) HeapAlloc(GetProcessHeap(), 0, lLength);
     639            if(lpszFileA == NULL) {
     640                goto end;
     641            }
     642        }
     643        i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength);
     644
     645        if(lpszFileA) {
     646            MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength);
     647            HeapFree(GetProcessHeap(), 0, lpszFileA);
     648        }
     649        goto end;
     650    }
     651
    616652        lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
    617653
Note: See TracChangeset for help on using the changeset viewer.