Ignore:
Timestamp:
Apr 24, 2001, 10:37:25 PM (25 years ago)
Author:
sandervl
Message:

Wine resync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/filedlgbrowser.c

    r4561 r5583  
    55 */
    66
     7#include <stdio.h>
     8#include <string.h>
     9
     10#include "windef.h"
     11#include "winbase.h"
     12#include "winnls.h"
     13#include "wingdi.h"
     14#include "winuser.h"
     15#include "heap.h"
     16#include "debugtools.h"
     17
     18#include "shlwapi.h"
     19#include "filedlgbrowser.h"
     20#include "cdlg.h"
     21#include "shlguid.h"
     22#include "wine/obj_serviceprovider.h"
     23
    724#ifdef __WIN32OS2__
    8 #include <windef.h>
    9 #include <winbase.h>
    10 #include <wingdi.h>
    11 #include <winuser.h>
    1225#include <heapstring.h>
    1326#include <misc.h>
    14 
    1527#endif
    16 
    17 #include <stdio.h>
    18 #include "unknwn.h"
    19 #include "filedlgbrowser.h"
    20 #include "windef.h"
    21 #include "wingdi.h"
    22 #include "winuser.h"
    23 #include "wine/winestring.h"
    24 #include "heap.h"
    25 #include "shlguid.h"
    26 #include "wine/obj_dataobject.h"
    27 #include "debugtools.h"
    28 #include "cdlg.h"
    29 
    30 #define INITGUID
    31 #include "initguid.h"
    32 #include "wine/obj_serviceprovider.h"
    3328
    3429DEFAULT_DEBUG_CHANNEL(commdlg);
     
    8479 *   Helper functions
    8580 */
     81
     82static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
     83{
     84    char lpstrPath[MAX_PATH];
     85    SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
     86    SetCurrentDirectoryA(lpstrPath);
     87    TRACE("new current folder %s\n", lpstrPath);
     88}
    8689
    8790/* copied from shell32 to avoid linking to it */
     
    98101
    99102          case STRRET_CSTRA:
    100             lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
     103            if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
     104                ((LPWSTR)dest)[len-1] = 0;
    101105            break;
    102106
     
    104108            if (pidl)
    105109            {
    106               lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
     110                if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
     111                                                 -1, (LPWSTR)dest, len ))
     112                    ((LPWSTR)dest)[len-1] = 0;
    107113            }
    108114            break;
     
    111117            FIXME("unknown type!\n");
    112118            if (len)
    113             { *(LPSTR)dest = '\0';
     119            { *(LPWSTR)dest = '\0';
    114120            }
    115121            return(FALSE);
     
    140146    sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
    141147    sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
    142     COMDLG32_SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
     148    SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
    143149                               &fodInfos->ShellInfos.pidlAbsCurrent);
    144150
     
    157163    ICOM_THIS(IShellBrowserImpl, iface);
    158164
    159 #ifndef __WIN32OS2__
    160165    TRACE("(%p)\n\t%s\n", This, debugstr_guid(riid));
    161 #endif
    162166
    163167    *ppvObj = NULL;
     
    376380    COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
    377381    fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
     382
     383    COMDLG32_UpdateCurrentDir(fodInfos);
    378384
    379385    /* Create the window */
     
    791797      if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
    792798      {
    793           if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
     799          if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
    794800          return S_OK;
    795801      }
     
    905911    _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
    906912
    907 #ifndef __WIN32OS2__
    908913    FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
    909 #endif
    910914
    911915    *ppv = NULL;
Note: See TracChangeset for help on using the changeset viewer.