Changeset 5618 for trunk/src/shell32


Ignore:
Timestamp:
Apr 28, 2001, 3:33:49 PM (24 years ago)
Author:
sandervl
Message:

resync with latest wine

Location:
trunk/src/shell32
Files:
1 added
30 edited

Legend:

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

    r4121 r5618  
    1 /* $Id: brsfolder.c,v 1.1 2000-08-30 13:52:50 sandervl Exp $ */
    2 #ifdef __WIN32OS2__
    3 #define ICOM_CINTERFACE 1
    4 #include <odin.h>
    5 #endif
    61#include <stdlib.h>
    72#include <string.h>
     
    1510#include "shresdef.h"
    1611
    17 DEFAULT_DEBUG_CHANNEL(shell)
     12DEFAULT_DEBUG_CHANNEL(shell);
    1813
    1914static HWND             hwndTreeView;
  • trunk/src/shell32/dialogs.c

    r4121 r5618  
    1 /* $Id: dialogs.c,v 1.1 2000-08-30 13:52:51 sandervl Exp $ */
     1/* $Id: dialogs.c,v 1.2 2001-04-28 13:33:43 sandervl Exp $ */
    22/*
    33 *      common shell dialogs
     
    6262{
    6363        TRACE("(0x%08x)\n", hWndOwner);
     64#ifdef __WIN32OS2__
     65        if (MessageBoxA( hWndOwner, "Do you want to exit Odin?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK)
     66#else
    6467        if (MessageBoxA( hWndOwner, "Do you want to exit WINE?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK)
     68#endif
    6569        {
    6670          SendMessageA ( hWndOwner, WM_QUIT, 0, 0);
  • trunk/src/shell32/folders.c

    r4706 r5618  
    1 /* $Id: folders.c,v 1.7 2000-11-28 11:00:47 sandervl Exp $ */
     1/* $Id: folders.c,v 1.8 2001-04-28 13:33:44 sandervl Exp $ */
    22/*
    33 *  Copyright 1997  Marcus Meissner
     
    410410
    411411    if (phiconLarge)
    412       *phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
     412      *phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
    413413
    414414    if (phiconSmall)
    415       *phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
     415      *phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
    416416
    417417    return S_OK;
  • trunk/src/shell32/iconcache.c

    r4691 r5618  
    1 /* $Id: iconcache.c,v 1.3 2000-11-24 13:19:12 sandervl Exp $ */
     1/* $Id: iconcache.c,v 1.4 2001-04-28 13:33:44 sandervl Exp $ */
    22/*
    33 *      shell icon cache (SIC)
     
    790790        else
    791791        {
    792           index = pImageList_AddIcon (ShellSmallIconList, hSmallIcon);
    793           index1= pImageList_AddIcon (ShellBigIconList, hBigIcon);
     792          index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
     793          index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
    794794
    795795          if (index!=index1)
     
    884884
    885885        if (bSmallIcon)
    886           return pImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);
    887         return pImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);
     886          return ImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);
     887        return ImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);
    888888       
    889889}
     
    912912        }
    913913
    914         ShellSmallIconList = pImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20);
    915         ShellBigIconList = pImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20);
    916 
    917         pImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW));
    918         pImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW));
     914        ShellSmallIconList = ImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20);
     915        ShellBigIconList = ImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20);
     916
     917        ImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW));
     918        ImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW));
    919919
    920920        for (index=1; index<46; index++)
  • trunk/src/shell32/makefile

    r4719 r5618  
    1 # $Id: makefile,v 1.32 2000-12-02 23:57:22 bird Exp $
     1# $Id: makefile,v 1.33 2001-04-28 13:33:44 sandervl Exp $
    22
    33#
     
    5454$(OBJDIR)\shv_item_cmenu.obj \
    5555$(OBJDIR)\unknown.obj \
     56$(OBJDIR)\control.obj \
    5657$(OBJDIR)\misc.obj \
    5758$(OBJDIR)\she.obj \
  • trunk/src/shell32/memorystream.c

    r4121 r5618  
    1 /* $Id: memorystream.c,v 1.1 2000-08-30 13:52:52 sandervl Exp $ */
    21/*
    32 *      this class implements a pure IStream object
     
    109 *      access in a IStream to.
    1110 */
    12 #ifdef __WIN32OS2__
    13 #define ICOM_CINTERFACE 1
    14 #include <odin.h>
    15 #endif
    1611
    1712#include <string.h>
    1813
    19 #include "wine/obj_storage.h"
     14#include "winbase.h"
     15#include "winerror.h"
     16#include "shlobj.h"
     17#include "debugtools.h"
    2018#include "heap.h"
    21 #include "winerror.h"
    22 #include "debugtools.h"
    2319#include "shell32_main.h"
    2420
    25 DEFAULT_DEBUG_CHANNEL(shell)
     21DEFAULT_DEBUG_CHANNEL(shell);
    2622
    2723static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj);
  • trunk/src/shell32/pidl.c

    r4125 r5618  
    1 /* $Id: pidl.c,v 1.2 2000-08-30 14:18:47 sandervl Exp $ */
    21/*
    32 *      pidl Handling
     
    98 *
    109 */
    11 #ifdef __WIN32OS2__
    12 #define ICOM_CINTERFACE 1
    13 #include <odin.h>
    14 #endif
    1510
    1611#include <ctype.h>
     
    1914#include "winbase.h"
    2015#include "debugtools.h"
    21 #include "shell.h"
    2216#include "shlguid.h"
    2317#include "winerror.h"
    2418#include "winnls.h"
     19#include "wine/undocshell.h"
    2520#include "shell32_main.h"
    2621#include "shellapi.h"
     22#include "shlwapi.h"
    2723
    2824#include "pidl.h"
    29 #include "wine/undocshell.h"
    3025
    3126DEFAULT_DEBUG_CHANNEL(pidl);
    3227DECLARE_DEBUG_CHANNEL(shell);
    3328
    34 #ifdef __WIN32OS2__
    35 #ifdef DEBUG
     29#if defined( __WIN32OS2__) && defined(DEBUG)
    3630void pdump (LPCITEMIDLIST pidl)
    3731{
     
    4438        /* silence the sub-functions */
    4539        bIsShellDebug = TRACE_ON(shell);
    46         __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, FALSE);
    47         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE);
     40        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_shell, FALSE);
     41        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, FALSE);
    4842
    4943        if (! pidltemp)
     
    8579        }
    8680
    87         __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, bIsShellDebug);
    88         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, TRUE);
    89 
    90 }
    91 #endif //DEBUG
    92 #else
    93 void pdump (LPCITEMIDLIST pidl)
    94 {
    95         BOOL bIsShellDebug;
    96        
    97         LPITEMIDLIST pidltemp = pidl;
    98         if (!TRACE_ON(pidl))
    99           return;
    100 
    101         /* silence the sub-functions */
    102         bIsShellDebug = TRACE_ON(shell);
    103         __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, FALSE);
    104         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE);
    105 
    106         if (! pidltemp)
    107         {
    108           MESSAGE ("-------- pidl=NULL (Desktop)\n");
    109         }
    110         else
    111         {
    112           MESSAGE ("-------- pidl=%p\n", pidl);
    113           if (pidltemp->mkid.cb)
    114           {
    115             do
    116             {
    117               DWORD dwAttrib = 0;
    118               LPPIDLDATA pData   = _ILGetDataPointer(pidltemp);
    119               DWORD type         = pData->type;
    120               LPSTR szLongName   = _ILGetTextPointer(pidltemp);
    121               LPSTR szShortName  = _ILGetSTextPointer(pidltemp);
    122               char szName[MAX_PATH];
    123 
    124               _ILSimpleGetText(pidltemp, szName, MAX_PATH);
    125               if( PT_FOLDER == type)
    126                 dwAttrib = pData->u.folder.uFileAttribs;
    127               else if( PT_VALUE == type)
    128                 dwAttrib = pData->u.file.uFileAttribs;
    129 
    130               MESSAGE ("-- pidl=%p size=%u type=%lx attr=0x%08lx name=%s (%s,%s)\n",
    131                        pidltemp, pidltemp->mkid.cb,type,dwAttrib,szName,debugstr_a(szLongName), debugstr_a(szShortName));
    132 
    133               pidltemp = ILGetNext(pidltemp);
    134 
    135             } while (pidltemp->mkid.cb);
    136           }
    137           else
    138           {
    139             MESSAGE ("empty pidl (Desktop)\n");
    140           }
    141           pcheck(pidl);
    142         }
    143 
    144         __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, bIsShellDebug);
    145         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, TRUE);
    146 
    147 }
    148 #endif //__WIN32OS2__
    149 
     81        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_shell, bIsShellDebug);
     82        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, TRUE);
     83
     84}
     85#endif
    15086#define BYTES_PRINTED 32
    15187BOOL pcheck (LPCITEMIDLIST pidl)
     
    15692
    15793        bIsPidlDebug = TRACE_ON(shell);
    158         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE);
     94        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, FALSE);
    15995
    16096        if (pidltemp && pidltemp->mkid.cb)
     
    175111              case PT_COMP:
    176112              case PT_NETWORK:
     113              case PT_IESPECIAL1:
     114              case PT_IESPECIAL2:
    177115              case PT_SHARE:
    178               case PT_IESPECIAL:
    179116                break;
    180117              default:
     
    202139          } while (pidltemp->mkid.cb);
    203140        }
    204         __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, bIsPidlDebug);
     141        __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, bIsPidlDebug);
    205142        return ret;
    206143}
     
    300237        return pidlNew;
    301238}
     239
    302240/*************************************************************************
    303241 * ILLoadFromStream
     
    332270        }
    333271       
    334         /* we are not jet fully compatible */
     272        /* we are not yet fully compatible */
    335273        if (!pcheck(*ppPidl))
    336274        { SHFree(*ppPidl);
     
    343281        return ret;
    344282}
     283
     284/*************************************************************************
     285 * ILSaveToStream
     286 *
     287 * NOTES
     288 *   the first two bytes are the len, the pidl is following then
     289 */
     290HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl)
     291{
     292        LPITEMIDLIST    pidl;
     293        WORD            wLen = 0;
     294        HRESULT         ret = E_FAIL;
     295       
     296        TRACE_(shell)("%p %p\n", pStream, pPidl);
     297
     298        IStream_AddRef (pStream);
     299
     300        pidl = pPidl;
     301        while (pidl->mkid.cb)
     302        {
     303          wLen += sizeof(WORD) + pidl->mkid.cb;
     304          pidl = ILGetNext(pidl);
     305        }
     306
     307        if (SUCCEEDED(IStream_Write(pStream, (LPVOID)&wLen, 2, NULL)))
     308        {
     309          if (SUCCEEDED(IStream_Write(pStream, pPidl, wLen, NULL)))
     310          { ret = S_OK;
     311          }
     312        }
     313       
     314
     315        IStream_Release (pStream);
     316
     317        return ret;
     318}
     319
    345320/*************************************************************************
    346321 * SHILCreateFromPath   [SHELL32.28]
     
    357332        TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0);
    358333
    359         lstrcpynAtoW(lpszDisplayName, path, MAX_PATH);
     334        if (!MultiByteToWideChar( CP_ACP, 0, path, -1, lpszDisplayName, MAX_PATH ))
     335            lpszDisplayName[MAX_PATH-1] = 0;
    360336
    361337        if (SUCCEEDED (SHGetDesktopFolder(&sf)))
     
    831807        TRACE("path=%s\n",debugstr_w(lpszPath));
    832808
    833         lstrcpynWtoA(lpszTemp, lpszPath, MAX_PATH);     
     809        if (!WideCharToMultiByte( CP_ACP, 0, lpszPath, -1, lpszTemp, sizeof(lpszTemp), NULL, NULL ))
     810            lpszTemp[sizeof(lpszTemp)-1] = 0;
    834811
    835812        return SHSimpleIDListFromPathA (lpszTemp);
     
    994971               pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
    995972               pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
    996                lstrcpynAtoW(pfd->cFileName,_ILGetTextPointer(pidl), MAX_PATH);
    997                lstrcpynAtoW(pfd->cAlternateFileName,_ILGetSTextPointer(pidl), 14);
     973               if (!MultiByteToWideChar( CP_ACP, 0, _ILGetTextPointer(pidl), -1,
     974                                         pfd->cFileName, MAX_PATH ))
     975                   pfd->cFileName[MAX_PATH-1] = 0;
     976               if (!MultiByteToWideChar( CP_ACP, 0, _ILGetSTextPointer(pidl), -1,
     977                                         pfd->cAlternateFileName, 14 ))
     978                   pfd->cFileName[13] = 0;
    998979            }
    999980            return NOERROR;
     
    10691050
    10701051        SHGetPathFromIDListA (pidl, sTemp);
    1071         lstrcpyAtoW(pszPath, sTemp);
     1052        MultiByteToWideChar( CP_ACP, 0, sTemp, -1, pszPath, MAX_PATH );
    10721053
    10731054        TRACE_(shell)("-- (%s)\n",debugstr_w(pszPath));
     
    12921273 */
    12931274
    1294 LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT16 uInSize)
     1275LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize)
    12951276{
    12961277        LPITEMIDLIST   pidlOut = NULL, pidlTemp = NULL;
    12971278        LPPIDLDATA     pData;
    1298         UINT16         uSize = 0;
     1279        UINT           uSize = 0;
    12991280        LPSTR   pszDest;
    13001281       
     
    13741355 *  strlen (lpszText)
    13751356 */
    1376 DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT16 uSize)
     1357DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT uSize)
    13771358{       TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
    13781359
     
    14741455 * gets the text for the first item in the pidl (eg. simple pidl)
    14751456 *
    1476  * returns the lenght of the string
     1457 * returns the length of the string
    14771458 */
    14781459DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
     
    15691550            case PT_FOLDER1:
    15701551            case PT_VALUE:
    1571             case PT_IESPECIAL:
     1552            case PT_IESPECIAL1:
     1553            case PT_IESPECIAL2:
    15721554              return (LPSTR)&(pdata->u.file.szNames);
    15731555
     
    15971579            case PT_FOLDER:
    15981580            case PT_VALUE:
    1599             case PT_IESPECIAL:
     1581            case PT_IESPECIAL1:
     1582            case PT_IESPECIAL2:
    16001583              return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1);
    16011584
  • trunk/src/shell32/pidl.h

    r4121 r5618  
    1 /* $Id: pidl.h,v 1.6 2000-08-30 13:50:55 sandervl Exp $ */
    21/*
    32 * internal pidl functions
     
    7675#define PT_COMP         0x42
    7776#define PT_NETWORK      0x47
    78 #define PT_IESPECIAL    0xb1
     77#define PT_IESPECIAL1   0x61
     78#define PT_IESPECIAL2   0xb1
    7979#define PT_SHARE        0xc3
    8080
     
    129129
    130130BOOL    _ILGetFileDateTime      (LPCITEMIDLIST pidl, FILETIME *ft);
    131 DWORD   _ILGetDrive             (LPCITEMIDLIST, LPSTR, UINT16);
     131DWORD   _ILGetDrive             (LPCITEMIDLIST, LPSTR, UINT);
    132132
    133133/*
     
    145145 * simple pidls from strings
    146146 */
    147 LPITEMIDLIST    _ILCreate       (PIDLTYPE,LPCVOID,UINT16);
     147LPITEMIDLIST    _ILCreate       (PIDLTYPE,LPCVOID,UINT);
    148148
    149149LPITEMIDLIST    _ILCreateDesktop        (void);
     
    170170 * debug helper
    171171 */
    172 #ifdef __WIN32OS2__
    173 #ifdef DEBUG
    174 void pdump (LPCITEMIDLIST pidl);
    175 #else
    176 #define pdump(pidl)
    177 #endif
    178 //CB: needed in release build
    179 BOOL pcheck (LPCITEMIDLIST pidl);
    180 #else
    181172void    pdump   (LPCITEMIDLIST pidl);
    182173BOOL    pcheck  (LPCITEMIDLIST pidl);
    183 #endif
    184174
    185175/*
  • trunk/src/shell32/sh.cpp

    r4032 r5618  
    1 /* $Id: sh.cpp,v 1.11 2000-08-18 02:01:18 phaller Exp $ */
     1/* $Id: sh.cpp,v 1.12 2001-04-28 13:33:45 sandervl Exp $ */
    22
    33/*
     
    320320}
    321321
    322 
    323 /*****************************************************************************
    324  * Name      : HRESULT SHRegDeleteKeyA
    325  * Purpose   :
    326  * Parameters:
    327  * Variables :
    328  * Result    :
    329  * Remark    : SHELL32.513
    330  * Status    : UNTESTED STUB
    331  *
    332  * Author    : Patrick Haller [Tue, 1999/06/09 20:02]
    333  *****************************************************************************/
    334 
    335 ODINFUNCTION2(HRESULT, SHRegDeleteKeyA,
    336               HKEY,    hkey,
    337               LPSTR,   lpszKey)
    338 {
    339   return RegDeleteKeyA(hkey,
    340                        lpszKey);
    341 }
    342 
  • trunk/src/shell32/shell32.def

    r4809 r5618  
    1 ; $Id: shell32.def,v 1.34 2000-12-16 22:53:43 bird Exp $
     1; $Id: shell32.def,v 1.35 2001-04-28 13:33:45 sandervl Exp $
    22
    33; Based on Windows 95
     
    8080    Shell_GetImageList                = _Shell_GetImageList@8                 @71
    8181    Shell_GetCachedImageIndex         = _Shell_GetCachedImageIndexAW@12       @72
    82     Shell_GetCachedImageIndexW        = _Shell_GetCachedImageIndexW@12
    83     Shell_GetCachedImageIndexA        = _Shell_GetCachedImageIndexA@12
     82    Shell_GetCachedImageIndexW        = _Shell_GetCachedImageIndexW@12        @1572
     83    Shell_GetCachedImageIndexA        = _Shell_GetCachedImageIndexA@12        @1573
    8484    SHShellFolderView_Message         = _SHShellFolderView_Message@12         @73
    8585    SHCreateStdEnumFmtEtc             = _SHCreateStdEnumFmtEtc@12             @74
     
    176176    SHCreateDirectory                 = _SHCreateDirectory@8                  @165
    177177;   CallCPLEntry16                    = _CallCPLEntry16@?                     @166
    178 ;   SHAddFromPropSheetExtArray        = _SHAddFromPropSheetExtArray@?         @167
    179 ;   SHCreatePropSheetExtArray         = _SHCreatePropSheetExtArray@?          @168
    180 ;   SHDestroyPropSheetExtArray        = _SHDestroyPropSheetExtArray@?         @169
    181 ;   SHReplaceFromPropSheetExtArray    = _SHReplaceFromPropSheetExtArray@?     @170
     178    SHAddFromPropSheetExtArray        = _SHAddFromPropSheetExtArray@12        @167
     179    SHCreatePropSheetExtArray         = _SHCreatePropSheetExtArray@12         @168
     180    SHDestroyPropSheetExtArray        = _SHDestroyPropSheetExtArray@4         @169
     181    SHReplaceFromPropSheetExtArray    = _SHReplaceFromPropSheetExtArray@16    @170
    182182    PathCleanupSpec                   = _PathCleanupSpecAW@8                  @171
    183183;   SHCreateLinks                     = _SHCreateLinks@?                      @172
     
    320320    StrCpyNA                          = _lstrcpynA@12                         @309
    321321    StrCpyNW                          = _lstrcpynW@12                         @310
    322 ;   StrNCmpA                          = _StrNCmpA@?                           @311
    323 ;   StrNCmpIA                         = _StrNCmpIA@?                          @312
    324 ;   StrNCmpIW                         = _StrNCmpIW@?                          @313
    325 ;   StrNCmpW                          = _StrNCmpW@?                           @314
     322    StrNCmpA                          = _StrCmpNA@12                          @311
     323    StrNCmpIA                         = _StrCmpNIA@12                         @312
     324    StrNCmpIW                         = _StrCmpNIW@12                         @313
     325    StrNCmpW                          = _StrCmpNW@12                          @314
    326326    StrNCpyA                          = _lstrcpynA@12                         @315
    327327    StrNCpyW                          = _lstrcpynW@12                         @316
    328328    StrRChrA                          = _StrRChrA@12                          @317
    329 ;   StrRChrIA                         = _StrRChrIA@?                          @318
    330 ;   StrRChrIW                         = _StrRChrIW@?                          @319
     329;    StrRChrIA                         = _StrRChrIA@8                          @318
     330;    StrRChrIW                         = _StrRChrIW@8                          @319
    331331    StrRChrW                          = _StrRChrW@12                          @320
    332332;   StrRStrA                          = _StrRStrA@?                           @321
    333 ;   StrRStrIA                         = _StrRStrIA@?                          @322
    334 ;   StrRStrIW                         = _StrRStrIW@?                          @323
     333;    StrRStrIA                         = _StrRStrIA@8                          @322
     334;    StrRStrIW                         = _StrRStrIW@8                          @323
    335335;   StrRStrW                          = _StrRStrW@?                           @324
    336336    StrStrA                           = _StrStrA@8                            @325
     
    349349    SHRegDeleteKeyA                   = _SHRegDeleteKeyA@8                    @513 ;?
    350350    SHAllocShared                     = _SHAllocShared@12                     @520
    351     SHInitRestricted                  = _SHInitRestricted@8
     351    SHInitRestricted                  = _SHInitRestricted@8                   @1521
    352352    SHLockShared                      = _SHLockShared@8                       @521
    353353    SHUnlockShared                    = _SHUnlockShared@4                     @522
     
    377377    SHGetSpecialFolderPathA           = _SHGetSpecialFolderPathA@16           @690
    378378
    379     SHGetSettings                     = _SHGetSettings@12                     @691
     379    SHGetSettings                     = _SHGetSettings@8                      @691
    380380
    381381;
     
    390390
    391391    DllGetVersion                     = _SHELL32_DllGetVersion@4              @1220
     392    DllCanUnloadNow                   = _SHELL32_DllCanUnloadNow@0            @1221
    392393
    393394    _StrFormatByteSizeA@12                @1041
  • trunk/src/shell32/shell32_main.c

    r4121 r5618  
    1 /* $Id: shell32_main.c,v 1.1 2000-08-30 13:52:54 sandervl Exp $ */
     1/* $Id: shell32_main.c,v 1.2 2001-04-28 13:33:45 sandervl Exp $ */
    22/*
    33 *                              Shell basics
     
    8989}
    9090
    91 /*************************************************************************
    92  * Control_RunDLL                       [SHELL32.12]
    93  *
    94  * Wild speculation in the following!
    95  *
    96  * http://premium.microsoft.com/msdn/library/techart/msdn193.htm
    97  */
    98 
    99 void WINAPI Control_RunDLL( HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
    100 {
    101     FIXME("(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,
    102           debugstr_a(cmd), arg4);
    103 }
    10491
    10592/*************************************************************************
     
    130117        psfi->szTypeName[0] = '\0';
    131118        psfi->iIcon = 0;
     119
     120        if (flags & SHGFI_EXETYPE) {
     121          BOOL status = FALSE;
     122          HANDLE hfile;
     123          DWORD BinaryType;
     124          IMAGE_DOS_HEADER mz_header;
     125          IMAGE_NT_HEADERS nt;
     126          DWORD len;
     127          char magic[4];
     128
     129          if (flags != SHGFI_EXETYPE) return 0;
     130
     131          status = GetBinaryTypeA (path, &BinaryType);
     132          if (!status) return 0;
     133          if ((BinaryType == SCS_DOS_BINARY)
     134                || (BinaryType == SCS_PIF_BINARY)) return 0x4d5a;
     135
     136          hfile = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ,
     137                NULL, OPEN_EXISTING, 0, 0 );
     138          if ( hfile == INVALID_HANDLE_VALUE ) return 0;
     139
     140        /* The next section is adapted from MODULE_GetBinaryType, as we need
     141         * to examine the image header to get OS and version information. We
     142         * know from calling GetBinaryTypeA that the image is valid and either
     143         * an NE or PE, so much error handling can be omitted.
     144         * Seek to the start of the file and read the header information.
     145         */
     146
     147          SetFilePointer( hfile, 0, NULL, SEEK_SET ); 
     148          ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL );
     149
     150         SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
     151         ReadFile( hfile, magic, sizeof(magic), &len, NULL );
     152         if ( *(DWORD*)magic      == IMAGE_NT_SIGNATURE )
     153         {
     154             SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
     155             ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
     156              CloseHandle( hfile );
     157              if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) {
     158                 return IMAGE_NT_SIGNATURE
     159                        | (nt.OptionalHeader.MajorSubsystemVersion << 24)
     160                        | (nt.OptionalHeader.MinorSubsystemVersion << 16);
     161              }
     162              return IMAGE_NT_SIGNATURE;
     163          }
     164         else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE )
     165         {
     166             IMAGE_OS2_HEADER ne;
     167             SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
     168             ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
     169              CloseHandle( hfile );
     170             if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE
     171                        | (ne.ne_expver << 16);
     172              return 0;
     173          }
     174          CloseHandle( hfile );
     175          return 0;
     176      }
     177
    132178       
    133179        /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified
     
    259305        /* icon handle */
    260306        if (SUCCEEDED(hr) && (flags & SHGFI_ICON))
    261           psfi->hIcon = pImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
    262 
    263 
    264         if (flags & SHGFI_EXETYPE)
    265           FIXME("type of executable, stub\n");
     307          psfi->hIcon = ImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
    266308
    267309        if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
     
    280322#endif
    281323        return ret;
    282 }
    283 
     324}
    284325/*************************************************************************
    285326 * SHGetFileInfoW                       [SHELL32.@]
     
    289330                              SHFILEINFOW *psfi, UINT sizeofpsfi,
    290331                              UINT flags )
    291 {       FIXME("(%s,0x%lx,%p,0x%x,0x%x)\n",
    292               debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags);
    293         return 0;
     332{
     333        INT len;
     334        LPSTR temppath;
     335        DWORD ret;
     336        SHFILEINFOA temppsfi;
     337
     338        len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
     339        temppath = HeapAlloc(GetProcessHeap(), 0, len);
     340        WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
     341
     342        WideCharToMultiByte(CP_ACP, 0, psfi->szDisplayName, -1, temppsfi.szDisplayName,
     343                            sizeof(temppsfi.szDisplayName), NULL, NULL);
     344        WideCharToMultiByte(CP_ACP, 0, psfi->szTypeName, -1, temppsfi.szTypeName,
     345                            sizeof(temppsfi.szTypeName), NULL, NULL);
     346
     347        ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
     348
     349        HeapFree(GetProcessHeap(), 0, temppath);
     350       
     351        return ret;
    294352}
    295353
     
    808866 *
    809867 */
    810 void    (* WINAPI  pDLLInitComctl)(LPVOID);
    811 INT     (* WINAPI  pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
    812 INT     (* WINAPI  pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
    813 HIMAGELIST (* WINAPI  pImageList_Create) (INT,INT,UINT,INT,INT);
    814 BOOL    (* WINAPI  pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
    815 HICON   (* WINAPI  pImageList_GetIcon) (HIMAGELIST, INT, UINT);
    816 INT     (* WINAPI  pImageList_GetImageCount)(HIMAGELIST);
    817 COLORREF (* WINAPI pImageList_SetBkColor)(HIMAGELIST, COLORREF);
     868void    (* WINAPI pDLLInitComctl)(LPVOID);
    818869
    819870LPVOID  (* WINAPI  pCOMCTL32_Alloc) (INT); 
    820871BOOL    (* WINAPI  pCOMCTL32_Free) (LPVOID); 
    821872
    822 HDPA    (* WINAPI  pDPA_Create) (INT); 
    823 INT     (* WINAPI  pDPA_InsertPtr) (const HDPA, INT, LPVOID);
    824 BOOL    (* WINAPI  pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
    825 LPVOID  (* WINAPI  pDPA_GetPtr) (const HDPA, INT);   
    826 BOOL    (* WINAPI  pDPA_Destroy) (const HDPA);
    827 INT     (* WINAPI pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
    828 LPVOID  (* WINAPI pDPA_DeletePtr) (const HDPA hdpa, INT i);
    829 
    830 /* user32 */
    831 HICON (* WINAPI pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
    832 HICON (* WINAPI pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
    833 
    834873static HINSTANCE        hComctl32;
    835874static INT              shell32_RefCount = 0;
     
    837876LONG            shell32_ObjCount = 0;
    838877HINSTANCE       shell32_hInstance = 0;
    839 HMODULE         huser32 = 0;
    840878HIMAGELIST      ShellSmallIconList = 0;
    841879HIMAGELIST      ShellBigIconList = 0;
     
    861899            shell32_hInstance = hinstDLL;
    862900            hComctl32 = GetModuleHandleA("COMCTL32.DLL");       
    863             if(!huser32) huser32 = GetModuleHandleA("USER32.DLL");
    864901            DisableThreadLibraryCalls(shell32_hInstance);
    865902
    866             if (!hComctl32 || !huser32)
     903            if (!hComctl32)
    867904            {
    868905              ERR("P A N I C SHELL32 loading failed\n");
     
    871908
    872909            /* comctl32 */
    873             pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");
    874             pImageList_Create=(void*)GetProcAddress(hComctl32,"ImageList_Create");
    875             pImageList_AddIcon=(void*)GetProcAddress(hComctl32,"ImageList_AddIcon");
    876             pImageList_ReplaceIcon=(void*)GetProcAddress(hComctl32,"ImageList_ReplaceIcon");
    877             pImageList_GetIcon=(void*)GetProcAddress(hComctl32,"ImageList_GetIcon");
    878             pImageList_GetImageCount=(void*)GetProcAddress(hComctl32,"ImageList_GetImageCount");
    879             pImageList_Draw=(void*)GetProcAddress(hComctl32,"ImageList_Draw");
    880             pImageList_SetBkColor=(void*)GetProcAddress(hComctl32,"ImageList_SetBkColor");
    881910            pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L);
    882911            pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L);
    883             pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);
    884             pDPA_Destroy=(void*)GetProcAddress(hComctl32, (LPCSTR)329L);
    885             pDPA_GetPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)332L);
    886             pDPA_InsertPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)334L);
    887             pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
    888             pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
    889             pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
    890             /* user32 */
    891             pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(huser32,"LookupIconIdFromDirectoryEx");
    892             pCreateIconFromResourceEx=(void*)GetProcAddress(huser32,"CreateIconFromResourceEx");
    893912
    894913            /* initialize the common controls */
    895             if (pDLLInitComctl)
    896             {
    897               pDLLInitComctl(NULL);
    898             }
     914            InitCommonControlsEx(NULL);
    899915
    900916            SIC_Initialize();
  • trunk/src/shell32/shell32_main.h

    r5576 r5618  
    1 /* $Id: shell32_main.h,v 1.8 2001-04-23 10:47:23 sandervl Exp $ */
     1/* $Id: shell32_main.h,v 1.9 2001-04-28 13:33:45 sandervl Exp $ */
    22/*
    33 *      internal Shell32 Library definitions
     
    1717#include "wine/obj_shelllink.h"
    1818#include "wine/obj_extracticon.h"
     19#include "wine/obj_oleview.h"
    1920#ifdef __WIN32OS2__
    2021#include <heapstring.h>
     
    3536* pointer to functions dynamically loaded
    3637*/
    37 extern void     (* WINAPI pDLLInitComctl)(LPVOID);
    38 extern INT      (* WINAPI pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
    39 extern INT      (* WINAPI pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
    40 extern HIMAGELIST (* WINAPI pImageList_Create) (INT,INT,UINT,INT,INT);
    41 extern BOOL     (* WINAPI pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
    42 extern HICON    (* WINAPI pImageList_GetIcon) (HIMAGELIST, INT, UINT);
    43 extern INT      (* WINAPI pImageList_GetImageCount)(HIMAGELIST);
    44 extern COLORREF (* WINAPI pImageList_SetBkColor)(HIMAGELIST, COLORREF);
    45 
    4638extern LPVOID   (* WINAPI pCOMCTL32_Alloc) (INT); 
    4739extern BOOL     (* WINAPI pCOMCTL32_Free) (LPVOID); 
    4840
    49 extern HDPA     (* WINAPI pDPA_Create) (INT); 
    50 extern INT      (* WINAPI pDPA_InsertPtr) (const HDPA, INT, LPVOID);
    51 extern BOOL     (* WINAPI pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
    52 extern LPVOID   (* WINAPI pDPA_GetPtr) (const HDPA, INT);   
    53 extern BOOL     (* WINAPI pDPA_Destroy) (const HDPA);
    54 extern INT      (* WINAPI pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
    55 extern LPVOID   (* WINAPI pDPA_DeletePtr) (const HDPA hdpa, INT i);
     41#define pDPA_Create     DPA_Create
     42#define pDPA_InsertPtr  DPA_InsertPtr
     43#define pDPA_Sort       DPA_Sort
     44#define pDPA_GetPtr     DPA_GetPtr
     45#define pDPA_Destroy    DPA_Destroy
     46#define pDPA_Search     DPA_Search
     47#define pDPA_DeletePtr  DPA_DeletePtr
     48
    5649#define pDPA_GetPtrCount(hdpa)  (*(INT*)(hdpa))   
    5750
    58 extern HICON (* WINAPI pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
    59 extern HICON (* WINAPI pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
     51#define pLookupIconIdFromDirectoryEx LookupIconIdFromDirectoryEx
     52#define pCreateIconFromResourceEx    CreateIconFromResourceEx
    6053
    6154/* ole2 */
     
    6861*/
    6962BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
    70 
    71 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
    72 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
    73 HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
    7463
    7564/* Iconcache */
  • trunk/src/shell32/shellfolder.h

    r4121 r5618  
    1 /* $Id: shellfolder.h,v 1.2 2000-08-30 13:50:58 sandervl Exp $ */
    21/*
    32 * defines helperfunctions to manipulate the contents of a IShellFolder
     
    98
    109#include "winbase.h"
    11 #include "shell.h"
    1210
    1311#include "wine/obj_base.h"
  • trunk/src/shell32/shellguid.c

    r4121 r5618  
    1 /* $Id: shellguid.c,v 1.1 2000-08-30 13:52:55 sandervl Exp $ */
     1/* $Id: shellguid.c,v 1.2 2001-04-28 13:33:46 sandervl Exp $ */
    22/*
    33 *  Shell UID
     
    2222#include "shlobj.h"
    2323#include "docobj.h"
     24#include "shellfolder.h"
  • trunk/src/shell32/shelllink.c

    r4561 r5618  
    1 /* $Id: shelllink.c,v 1.2 2000-11-06 10:20:56 sandervl Exp $ */
    21/*
    32 *
     
    65 *
    76 */
    8 #ifdef __WIN32OS2__
    9 #define ICOM_CINTERFACE 1
    10 #include <odin.h>
    11 #endif
     7
     8#include "config.h"
    129
    1310#include <string.h>
     
    1815#endif
    1916#include <errno.h>
    20 #ifndef __WIN32OS2__
    21 #include <sys/wait.h>
     17#ifdef HAVE_SYS_WAIT_H
     18# include <sys/wait.h>
    2219#endif
    23 
    2420#include "debugtools.h"
    2521#include "winerror.h"
    2622#include "winbase.h"
    2723#include "winnls.h"
     24#include "winreg.h"
    2825
    2926#include "shlobj.h"
    30 #include "wine/winestring.h"
    3127#include "wine/undocshell.h"
    3228#ifndef __WIN32OS2__
     
    3834#include "shell32_main.h"
    3935#include "shlguid.h"
    40 #include "file.h"
    41 #include "options.h"
    4236
    4337DEFAULT_DEBUG_CHANNEL(shell);
     
    355349
    356350    if (!(hModule = LoadLibraryExA(szFileName, 0, LOAD_LIBRARY_AS_DATAFILE)))
     351    {
     352        TRACE("LoadLibraryExA (%s) failed, error %ld\n", szFileName, GetLastError());
    357353        goto error1;
     354    }
    358355
    359356    if (nIndex)
     357    {
    360358        hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(nIndex), RT_GROUP_ICONA);
     359        TRACE("FindResourceA (%s) called, return 0x%x, error %ld\n", szFileName, hResInfo, GetLastError());
     360    }
    361361    else
    362362        if (EnumResourceNamesA(hModule, RT_GROUP_ICONA, &EnumResNameProc, (LONG) &hResInfo))
     363        {
     364            TRACE("EnumResourceNamesA failed, error %ld\n", GetLastError());
    363365            goto error2;
     366        }
    364367
    365368    if (!hResInfo)
     369    {
     370        TRACE("ExtractFromEXEDLL failed, error %ld\n", GetLastError());
    366371        goto error2;
     372    }
    367373
    368374    if (!(hResData = LoadResource(hModule, hResInfo)))
     375    {
     376        TRACE("LoadResource failed, error %ld\n", GetLastError());
    369377        goto error2;
     378    }
    370379    if (!(pIconDir = LockResource(hResData)))
     380    {
     381        TRACE("LockResource failed, error %ld\n", GetLastError());
    371382        goto error3;
     383    }
    372384
    373385    for (i = 0; i < pIconDir->idCount; i++)
     
    381393
    382394    if (!(hResInfo = FindResourceA(hModule, lpName, RT_ICONA)))
     395    {
     396        TRACE("Second FindResourceA failed, error %ld\n", GetLastError());
    383397        goto error2;
     398    }
    384399    if (!(hResData = LoadResource(hModule, hResInfo)))
     400    {
     401        TRACE("Second LoadResource failed, error %ld\n", GetLastError());
    385402        goto error2;
     403    }
    386404    if (!(pIcon = LockResource(hResData)))
     405    {
     406        TRACE("Second LockResource failed, error %ld\n", GetLastError());
    387407        goto error3;
     408    }
    388409
    389410    if(!SaveIconResAsXPM(pIcon, szXPMFileName))
     411    {
     412        TRACE("Failed saving icon as XPM, error %ld\n", GetLastError());
    390413        goto error3;
     414    }
    391415
    392416    FreeResource(hResData);
     
    461485inline static char *get_unix_file_name( const char *dos )
    462486{
    463     DOS_FULL_NAME path;
    464 
    465     if (!DOSFS_GetFullName( dos, FALSE, &path )) return NULL;
    466     return HEAP_strdupA( GetProcessHeap(), 0, path.long_name );
     487    char buffer[MAX_PATH];
     488
     489    if (!wine_get_unix_file_name( dos, buffer, sizeof(buffer) )) return NULL;
     490    return HEAP_strdupA( GetProcessHeap(), 0, buffer );
    467491}
    468492
     
    491515    return NULL;
    492516}
    493 #endif //#ifndef __WIN32OS2__
    494 
     517#endif //__WIN32OS2__
    495518
    496519static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
     
    505528    char *work_dir = NULL;
    506529    BOOL bDesktop;
     530    HKEY hkey;
    507531
    508532    _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
     
    522546    return NOERROR;
    523547#else
    524     PROFILE_GetWineIniString( "wine", "ShellLinker", "", buffer, sizeof(buffer) );
     548    buffer[0] = 0;
     549    if (!RegOpenKeyExA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Wine",
     550                        0, KEY_ALL_ACCESS, &hkey ))
     551    {
     552        DWORD type, count = sizeof(buffer);
     553        if (RegQueryValueExA( hkey, "ShellLinker", 0, &type, buffer, &count )) buffer[0] = 0;
     554        RegCloseKey( hkey );
     555    }
    525556    if (!*buffer) return NOERROR;
    526557    shell_link_app = HEAP_strdupA( GetProcessHeap(), 0, buffer );
     
    571602
    572603    /* extract the icon */
    573     if (!(icon_name = extract_icon( This->sIcoPath ? This->sIcoPath : This->sPath,
    574                                     This->iIcoNdx ))) goto done;
     604    if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ?
     605                                      This->sIcoPath : This->sPath,
     606                                      This->iIcoNdx ))) goto done;
     607
    575608
    576609    TRACE("linker app='%s' link='%s' mode=%s path='%s' args='%s' icon='%s' workdir='%s' descr='%s'\n",
     
    590623        argv[pos++] = path_name;
    591624        argv[pos++] = bDesktop ? "--desktop" : "--menu";
    592         if (This->sArgs)
     625        if (This->sArgs && strlen(This->sArgs))
    593626        {
    594627            argv[pos++] = "--args";
     
    600633            argv[pos++] = icon_name;
    601634        }
    602         if (This->sWorkDir)
     635        if (This->sWorkDir && strlen(This->sWorkDir))
    603636        {
    604637            argv[pos++] = "--workdir";
    605638            argv[pos++] = This->sWorkDir;
    606639        }
    607         if (This->sDescription)
     640        if (This->sDescription && strlen(This->sDescription))
    608641        {
    609642            argv[pos++] = "--descr";
     
    633666    HeapFree( GetProcessHeap(), 0, work_dir );
    634667    return ret;
    635 #endif //__WIN32OS2__
     668#endif
    636669}
    637670
     
    10201053        ICOM_THIS(IShellLinkImpl, iface);
    10211054       
    1022         FIXME("(%p)->()\n",This);
    1023         lstrcpynA(pszDir,"c:\\", cchMaxPath);
     1055        TRACE("(%p)->(%p len=%u)\n", This, pszDir, cchMaxPath);
     1056
     1057        lstrcpynA( pszDir, This->sWorkDir ? This->sWorkDir : "", cchMaxPath );
     1058
    10241059        return NOERROR;
    10251060}
     
    10411076        ICOM_THIS(IShellLinkImpl, iface);
    10421077       
    1043         FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
    1044         lstrcpynA(pszArgs, "", cchMaxPath);
     1078        TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath);
     1079
     1080        lstrcpynA( pszArgs, This->sArgs ? This->sArgs : "", cchMaxPath );
     1081
    10451082        return NOERROR;
    10461083}
     
    10971134        ICOM_THIS(IShellLinkImpl, iface);
    10981135       
    1099         FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
    1100         lstrcpynA(pszIconPath,"shell32.dll",cchIconPath);
    1101         *piIcon=1;
     1136        TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
     1137
     1138        lstrcpynA( pszIconPath, This->sIcoPath ? This->sIcoPath : "", cchIconPath );
     1139        *piIcon = This->iIcoNdx;
     1140
    11021141        return NOERROR;
    11031142}
     
    12151254       
    12161255        FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
    1217         lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
     1256        MultiByteToWideChar( CP_ACP, 0, "c:\\foo.bar", -1, pszFile, cchMaxPath );
    12181257        return NOERROR;
    12191258}
     
    12411280       
    12421281        FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
    1243         lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
     1282        MultiByteToWideChar( CP_ACP, 0, "Description, FIXME", -1, pszName, cchMaxName );
    12441283        return NOERROR;
    12451284}
     
    12631302        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    12641303       
    1265         FIXME("(%p)->()\n",This);
    1266         lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
     1304        TRACE("(%p)->(%p len %u)\n", This, pszDir, cchMaxPath);
     1305
     1306        MultiByteToWideChar( CP_ACP, 0, This->sWorkDir ? This->sWorkDir : "", -1, pszDir, cchMaxPath );
     1307
    12671308        return NOERROR;
    12681309}
     
    12861327        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    12871328       
    1288         FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
    1289         lstrcpynAtoW(pszArgs, "", cchMaxPath);
     1329        TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath);
     1330
     1331        MultiByteToWideChar( CP_ACP, 0, This->sArgs ? This->sArgs : "", -1, pszArgs, cchMaxPath );
     1332
    12901333        return NOERROR;
    12911334}
     
    13431386        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    13441387       
    1345         FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
    1346         lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
    1347         *piIcon=1;
     1388        TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon);
     1389
     1390        MultiByteToWideChar( CP_ACP, 0, This->sIcoPath ? This->sIcoPath : "", -1, pszIconPath, cchIconPath );
     1391        *piIcon = This->iIcoNdx;
     1392
    13481393        return NOERROR;
    13491394}
  • trunk/src/shell32/shellole.c

    r4121 r5618  
    1 /* $Id: shellole.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */
    21/*
    32 *      handling of SHELL32.DLL OLE-Objects
     
    76 *
    87 */
    9 #ifdef __WIN32OS2__
    10 #define ICOM_CINTERFACE 1
    11 #include <odin.h>
    12 #include <winnls.h>
    13 #endif
    148
    159#include <stdlib.h>
    1610#include <string.h>
    1711
    18 #include "wine/obj_base.h"
    19 #include "wine/obj_shelllink.h"
    20 #include "wine/obj_shellfolder.h"
    21 #include "wine/obj_shellbrowser.h"
    22 #include "wine/obj_contextmenu.h"
    23 #include "wine/obj_shellextinit.h"
    24 #include "wine/obj_extracticon.h"
    25 
     12#include "shlobj.h"
     13#include "shellapi.h"
    2614#include "shlguid.h"
    2715#include "winreg.h"
     16#include "wine/unicode.h"
    2817#include "winerror.h"
    2918#include "debugtools.h"
     
    159148{
    160149        TRACE("(%p)\n", lpmal);
    161         return CoGetMalloc(0,lpmal);
     150        return CoGetMalloc(MEMCTX_TASK, lpmal);
    162151}
    163152
     
    359348typedef HRESULT (* CALLBACK LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
    360349#else
    361 typedef HRESULT (CALLBACK * LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
     350typedef HRESULT CALLBACK (*LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
    362351#endif
    363352
     
    504493        REFIID  riid,                           
    505494        LPVOID* ppv,   
    506         LPFNCREATEINSTANCE lpfnCI,      /* create instance callback entry */
    507         PLONG   pcRefDll,               /* ref count of the dll */
    508         REFIID  riidInst)               /* optional interface to the instance */
     495        LPFNCREATEINSTANCE lpfnCI,      /* [in] create instance callback entry */
     496        PLONG   pcRefDll,               /* [in/out] ref count of the dll */
     497        REFIID  riidInst)               /* [in] optional interface to the instance */
    509498{
    510499        TRACE("\n\tIID:\t%s %p %p %p \n\tIIDIns:\t%s\n",
     
    554543BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
    555544{
    556         LPDROPFILESTRUCT lpDropFileStruct; 
     545        DROPFILES *lpDropFileStruct;
    557546        BOOL bRet;
    558547
    559548        TRACE("\n");
    560549
    561         lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock(hDrop);
    562  
    563         memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT));
    564         bRet = lpDropFileStruct->fInNonClientArea;
     550        lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
     551
     552        *p = lpDropFileStruct->pt;
     553        bRet = lpDropFileStruct->fNC;
    565554 
    566555        GlobalUnlock(hDrop);
     
    579568        LPSTR lpDrop;
    580569        UINT i = 0;
    581         LPDROPFILESTRUCT lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock(hDrop);
     570        DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
    582571   
    583572        TRACE("(%08x, %x, %p, %u)\n",   hDrop,lFile,lpszFile,lLength);
     
    585574        if(!lpDropFileStruct) goto end;
    586575
    587         lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->lSize;
     576        lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
    588577
    589578        while (i++ < lFile)
     
    618607        LPWSTR lpwDrop;
    619608        UINT i = 0;
    620         LPDROPFILESTRUCT lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock(hDrop);
     609        DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
    621610   
    622611        TRACE("(%08x, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
     
    624613        if(!lpDropFileStruct) goto end;
    625614
    626         lpwDrop = (LPWSTR) lpDropFileStruct + lpDropFileStruct->lSize;
     615        lpwDrop = (LPWSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
    627616
    628617        i = 0;
     
    637626        }
    638627   
    639         i = lstrlenW(lpwDrop);
     628        i = strlenW(lpwDrop);
    640629        i++;
    641630        if ( !lpszwFile) goto end;   /* needed buffer size */
  • trunk/src/shell32/shellord.c

    r4561 r5618  
    1 /* $Id: shellord.c,v 1.2 2000-11-06 10:20:56 sandervl Exp $ */
    21/*
    32 * The parameters of many functions changes between different OS versions
     
    76 *           1998 Jürgen Schmied
    87 */
    9 #ifdef __WIN32OS2__
    10 #define ICOM_CINTERFACE 1
    11 #include <odin.h>
    12 #endif
    138#include <string.h>
    149#include <stdio.h>
     
    122117 *  the registry path are for win98 (tested)
    123118 *  and possibly are the same in nt40
    124  */
    125 void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx)
     119 *
     120 */
     121VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
    126122{
    127123        HKEY    hKey;
     
    129125        DWORD   dwDataSize = sizeof (DWORD);
    130126
    131         TRACE("(%p 0x%08lx 0x%08lx)\n",lpsfs,dwMask, dwx);
     127        TRACE("(%p 0x%08lx)\n",lpsfs,dwMask);
    132128       
    133129        if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
     
    232228        ...)
    233229{
    234         WCHAR   szText[100],szTitle[100],szTemp[256];
    235         LPCWSTR   pszText = szText, pszTitle = szTitle;
     230        WCHAR   szText[100],szTitle[100];
     231        LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp;
    236232        va_list args;
     233        int     ret;
     234
    237235        va_start(args, uType);
    238236        /* wvsprintfA(buf,fmt, args); */
     
    242240
    243241        if (!HIWORD(lpCaption))
    244           LoadStringW(hInstance, (DWORD)lpCaption, szTitle, 100);
     242          LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
    245243        else
    246244          pszTitle = lpCaption;
    247245
    248246        if (!HIWORD(lpText))
    249           LoadStringW(hInstance, (DWORD)lpText, szText, 100);
     247          LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0]));
    250248        else
    251249          pszText = lpText;
    252250
    253         FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
    254                        szText, 0, 0, szTemp, 256, (LPDWORD) args);
     251        FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
     252                       pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
    255253
    256254        va_end(args);
    257255
    258         return MessageBoxW(hWnd,szTemp,szTitle,uType);
     256        ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
     257        LocalFree((HLOCAL)pszTemp);
     258        return ret;
    259259}
    260260
     
    270270        ...)
    271271{
    272         char    szText[100],szTitle[100],szTemp[256];
    273         LPCSTR   pszText = szText, pszTitle = szTitle;
     272        char    szText[100],szTitle[100];
     273        LPCSTR  pszText = szText, pszTitle = szTitle, pszTemp;
    274274        va_list args;
     275        int     ret;
     276
    275277        va_start(args, uType);
    276278        /* wvsprintfA(buf,fmt, args); */
     
    280282
    281283        if (!HIWORD(lpCaption))
    282           LoadStringA(hInstance, (DWORD)lpCaption, szTitle, 100);
     284          LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle));
    283285        else
    284286          pszTitle = lpCaption;
    285287
    286288        if (!HIWORD(lpText))
    287           LoadStringA(hInstance, (DWORD)lpText, szText, 100);
     289          LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText));
    288290        else
    289291          pszText = lpText;
    290292
    291         FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
    292                        szText, 0, 0, szTemp, 256, (LPDWORD) args);
     293        FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
     294                       pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
    293295
    294296        va_end(args);
    295297
    296         return MessageBoxA(hWnd,szTemp,szTitle,uType);
     298        ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
     299        LocalFree((HLOCAL)pszTemp);
     300        return ret;
    297301}
    298302
     
    456460 */
    457461HRESULT WINAPI SHCreateShellFolderViewEx(
    458         LPCSHELLFOLDERVIEWINFO psvcbi, /*[in ] shelltemplate struct*/
    459         LPSHELLVIEW* ppv)              /*[out] IShellView pointer*/
     462        LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
     463        LPSHELLVIEW* ppv)              /* [out] IShellView pointer */
    460464{
    461465        IShellView * psf;
     
    878882        return 0;
    879883}
    880 /*************************************************************************
    881  * Control_FillCache_RunDLL                     [SHELL32.8]
    882  *
    883  */
    884 HRESULT WINAPI Control_FillCache_RunDLL(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
    885 {       FIXME("0x%04x 0x%04x 0x%04lx 0x%04lx stub\n",hWnd, hModule,w,x);
    886         return 0;
    887 }
    888 /*************************************************************************
    889  * RunDLL_CallEntry16                           [SHELL32.122]
    890  * the name is propably wrong
    891  */
    892 HRESULT WINAPI RunDLL_CallEntry16(DWORD v, DWORD w, DWORD x, DWORD y, DWORD z)
    893 {       FIXME("0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",v,w,x,y,z);
    894         return 0;
    895 }
    896884
    897885/************************************************************************
     
    980968        return 0;
    981969}
     970
     971/*************************************************************************
     972 *      SHAddFromPropSheetExtArray      [SHELL32]
     973 */
     974DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
     975{
     976        FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c);
     977        return 0;
     978}
     979
     980/*************************************************************************
     981 *      SHCreatePropSheetExtArray       [SHELL32]
     982 */
     983DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
     984{
     985        FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c);
     986        return 0;
     987}
     988
     989/*************************************************************************
     990 *      SHReplaceFromPropSheetExtArray  [SHELL]
     991 */
     992DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
     993{
     994        FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d);
     995        return 0;
     996}
     997
     998/*************************************************************************
     999 *      SHDestroyPropSheetExtArray      [SHELL32]
     1000 */
     1001DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
     1002{
     1003        FIXME("(%08lx)stub\n", a);
     1004        return 0;
     1005}
  • trunk/src/shell32/shellpath.c

    r5461 r5618  
    1 /* $Id: shellpath.c,v 1.4 2001-04-03 18:42:42 sandervl Exp $ */
    21/*
    32 * Path Functions
     
    65 *
    76 */
    8 #ifdef __WIN32OS2__
    9 #define ICOM_CINTERFACE 1
    10 #include <odin.h>
    11 #endif
    12 
    137#include <string.h>
    148#include <ctype.h>
    159#include "debugtools.h"
     10#include "windef.h"
    1611#include "winnls.h"
    1712#include "winreg.h"
     
    1914#include "shlobj.h"
    2015#include "shell32_main.h"
    21 #include "windef.h"
    22 #include "options.h"
    23 #include "wine/winestring.h"
    2416#include "wine/undocshell.h"
    2517#include "wine/unicode.h"
     
    2820DEFAULT_DEBUG_CHANNEL(shell);
    2921
    30 #define isSlash(x) ((x)=='\\' || (x)=='/')
    3122/*
    3223        ########## Combining and Constructing paths ##########
     
    347338
    348339        for(i=0; lpszExtensions[i]; i++)
     340#ifdef __WIN32OS2__
    349341          if (!lstrcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
    350          
     342#else
     343          if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
     344#endif   
    351345        return FALSE;
    352346}
     
    485479
    486480#ifdef __WIN32OS2__
    487 /*************************************************************************
    488  * PathYetAnotherMakeUniqueNameA [SHELL32.75]
    489  *
    490  * NOTES
    491  *     exported by ordinal
    492  */
     481
    493482BOOL WINAPI PathYetAnotherMakeUniqueNameW(
    494483        LPWSTR lpszBuffer,
     
    497486        LPCWSTR lpszLongName)
    498487{
    499     FIXME("(%p,%p, %p ,%p):stub.\n",
     488    FIXME("PathYetAnotherMakeUniqueNameW (%p,%p, %p ,%p):stub.\n",
    500489     lpszBuffer, lpszPathName, lpszShortName, lpszLongName);
    501490    return TRUE;
     
    514503#endif
    515504
     505
    516506/*
    517507        ########## cleaning and resolving paths ##########
     
    531521 * PathCleanupSpecAW    [SHELL32]
    532522 */
    533 DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
     523DWORD WINAPI PathCleanupSpecAW (LPCVOID x, LPVOID y)
    534524{
    535525    FIXME("(%p, %p) stub\n",x,y);
     
    668658 */
    669659 
    670 static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
    671 static char * szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders";
     660static const char * const szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
     661static const char * const szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders";
     662static const char * const szSetup = "Software\\Microsoft\\Windows\\CurrentVersion\\Setup";
     663static const char * const szCurrentVersion = "Software\\Microsoft\\Windows\\CurrentVersion";
    672664#if 0
    673 static char * szEnvUserProfile = "%USERPROFILE%";
    674 static char * szEnvSystemRoot = "%SYSTEMROOT%";
     665static const char * const szEnvUserProfile = "%USERPROFILE%";
     666static const char * const szEnvSystemRoot = "%SYSTEMROOT%";
    675667#endif
     668
     669typedef struct
     670{
     671    DWORD dwFlags;
     672    HKEY hRootKey;
     673    LPCSTR szValueName;
     674    LPCSTR szDefaultPath; /* fallback string; sub dir of windows directory */
     675} CSIDL_DATA;
     676
     677#define CSIDL_MYFLAG_SHFOLDER   1
     678#define CSIDL_MYFLAG_SETUP      2
     679#define CSIDL_MYFLAG_CURRVER    4
     680#define CSIDL_MYFLAG_RELATIVE   8
     681
     682#define HKLM HKEY_LOCAL_MACHINE
     683#define HKCU HKEY_CURRENT_USER
     684static const CSIDL_DATA CSIDL_Data[] =
     685{
     686    { /* CSIDL_DESKTOP */
     687        9, HKCU,
     688        "Desktop",
     689        "Desktop"
     690    },
     691    { /* CSIDL_INTERNET (??) */
     692        0, 1, /* FIXME */
     693        NULL,
     694        NULL,
     695    },
     696    { /* CSIDL_PROGRAMS */
     697        9, HKCU,
     698        "Programs",
     699        "Start Menu\\Programs"
     700    },
     701    { /* CSIDL_CONTROLS (.CPL files) */
     702        10, HKLM,
     703        "SysDir",
     704        "SYSTEM"
     705    },
     706    { /* CSIDL_PRINTERS */
     707        10, HKLM,
     708        "SysDir",
     709        "SYSTEM"
     710    },
     711    { /* CSIDL_PERSONAL */
     712        1, HKCU,
     713        "Personal",
     714        "My Documents"
     715    },
     716    { /* CSIDL_FAVORITES */
     717        9, HKCU,
     718        "Favorites",
     719        "Favorites"
     720    },
     721    { /* CSIDL_STARTUP */
     722        9, HKCU,
     723        "StartUp",
     724        "Start Menu\\Programs\\StartUp"
     725    },
     726    { /* CSIDL_RECENT */
     727        9, HKCU,
     728        "Recent",
     729        "Recent"
     730    },
     731    { /* CSIDL_SENDTO */
     732        9, HKCU,
     733        "SendTo",
     734        "SendTo"
     735    },
     736    { /* CSIDL_BITBUCKET (is this c:\recycled ?) */
     737        0, 1, /* FIXME */
     738        NULL,
     739        "recycled"
     740    },
     741    { /* CSIDL_STARTMENU */
     742        9, HKCU,
     743        "Start Menu",
     744        "Start Menu"
     745    },
     746    { /* not known */
     747        0, 0,
     748        NULL,
     749        NULL,
     750    },
     751    { /* not known */
     752        0, 0,
     753        NULL,
     754        NULL,
     755    },
     756    { /* not known */
     757        0, 0,
     758        NULL,
     759        NULL,
     760    },
     761    { /* not known */
     762        0, 0,
     763        NULL,
     764        NULL,
     765    },
     766    { /* CSIDL_DESKTOPDIRECTORY */
     767        9, HKCU,
     768        "Desktop",
     769        "Desktop"
     770    },
     771    { /* CSIDL_DRIVES */
     772        0, 1, /* FIXME */
     773        NULL,
     774        "My Computer"
     775    },
     776    { /* CSIDL_NETWORK */
     777        0, 1, /* FIXME */
     778        NULL,
     779        "Network Neighborhood"
     780    },
     781    { /* CSIDL_NETHOOD */
     782        9, HKCU,
     783        "NetHood",
     784        "NetHood"
     785    },
     786    { /* CSIDL_FONTS */
     787        9, HKCU,
     788        "Fonts",
     789        "Fonts"
     790    },
     791    { /* CSIDL_TEMPLATES */
     792        9, HKCU,
     793        "Templates",
     794        "ShellNew"
     795    },
     796    { /* CSIDL_COMMON_STARTMENU */
     797        9, HKLM,
     798        "Common Start Menu",
     799        "Start Menu"
     800    },
     801    { /* CSIDL_COMMON_PROGRAMS */
     802        9, HKLM,
     803        "Common Programs",
     804        ""
     805    },
     806    { /* CSIDL_COMMON_STARTUP */
     807        9, HKLM,
     808        "Common StartUp",
     809        "All Users\\Start Menu\\Programs\\StartUp"
     810    },
     811    { /* CSIDL_COMMON_DESKTOPDIRECTORY */
     812        9, HKLM,
     813        "Common Desktop",
     814        "Desktop"
     815    },
     816    { /* CSIDL_APPDATA */
     817        9, HKCU,
     818        "AppData",
     819        "Application Data"
     820    },
     821    { /* CSIDL_PRINTHOOD */
     822        9, HKCU,
     823        "PrintHood",
     824        "PrintHood"
     825    },
     826    { /* not known */
     827        0, 0,
     828        NULL,
     829        NULL,
     830    },
     831    { /* CSIDL_ALTSTARTUP */
     832        0, 1, /* FIXME */
     833        NULL,
     834        NULL
     835    },
     836    { /* CSIDL_COMMON_ALTSTARTUP */
     837        0, 1, /* FIXME */
     838        NULL,
     839        NULL
     840    },
     841    { /* CSIDL_COMMON_FAVORITES */
     842        9, HKCU,
     843        "Favorites",
     844        "Favorites"
     845    },
     846    { /* CSIDL_INTERNET_CACHE */
     847        9, HKCU,
     848        "Cache",
     849        "Temporary Internet Files"
     850    },
     851    { /* CSIDL_COOKIES */
     852        9, HKCU,
     853        "Cookies",
     854        "Cookies"
     855    },
     856    { /* CSIDL_HISTORY */
     857        9, HKCU,
     858        "History",
     859        "History"
     860    },
     861    { /* CSIDL_COMMON_APPDATA */
     862        9, HKLM,
     863        "Common AppData",
     864        "All Users\\Application Data"
     865    },
     866    { /* CSIDL_WINDOWS */
     867        2, HKLM,
     868        "WinDir",
     869        "Windows"
     870    },
     871    { /* CSIDL_SYSTEM */
     872        10, HKLM,
     873        "SysDir",
     874        "SYSTEM"
     875    },
     876    { /* CSIDL_PROGRAM_FILES */
     877        4, HKLM,
     878        "ProgramFilesDir",
     879        "Program Files"
     880    },
     881    { /* CSIDL_MYPICTURES */
     882        1, HKCU,
     883        "My Pictures",
     884        "My Documents\\My Pictures"
     885    },
     886    { /* CSIDL_PROFILE */
     887        10, HKLM,
     888        "WinDir", /* correct ? */
     889        ""
     890    },
     891    { /* CSIDL_SYSTEMX86 */
     892        10, HKLM,
     893        "SysDir",
     894        "SYSTEM"
     895    },
     896    { /* CSIDL_PROGRAM_FILESX86 */
     897        4, HKLM,
     898        "ProgramFilesDir",
     899        "Program Files"
     900    },
     901    { /* CSIDL_PROGRAM_FILES_COMMON */
     902        4, HKLM,
     903        "CommonFilesDir",
     904        "Program Files\\Common Files" /* ? */
     905    },
     906    { /* CSIDL_PROGRAM_FILES_COMMONX86 */
     907        4, HKLM,
     908        "CommonFilesDir",
     909        "Program Files\\Common Files" /* ? */
     910    },
     911    { /* CSIDL_COMMON_TEMPLATES */
     912        0, 1, /* FIXME */
     913        NULL,
     914        NULL
     915    },
     916    { /* CSIDL_COMMON_DOCUMENTS */
     917        0, 1, /* FIXME */
     918        NULL,
     919        NULL
     920    },
     921    { /* CSIDL_COMMON_ADMINTOOLS */
     922        0, 1, /* FIXME */
     923        NULL,
     924        NULL
     925    },
     926    { /* CSIDL_ADMINTOOLS */
     927        9, HKCU,
     928        "Administrative Tools",
     929        "Start Menu\\Programs\\Administrative Tools"
     930    },
     931    { /* CSIDL_CONNECTIONS */
     932        0, 1, /* FIXME */
     933        NULL,
     934        NULL
     935    }
     936};
     937#undef HKCU
     938#undef HKLM
     939
     940/**********************************************************************/
    676941
    677942BOOL WINAPI SHGetSpecialFolderPathA (
     
    681946        BOOL bCreate)
    682947{
    683         CHAR    szValueName[MAX_PATH], szDefaultPath[MAX_PATH];
     948        CHAR    szValueName[MAX_PATH], szDefaultPath[MAX_PATH], szBuildPath[MAX_PATH];
    684949        HKEY    hRootKey, hKey;
    685         BOOL    bRelative = TRUE;
     950        DWORD   dwFlags;
    686951        DWORD   dwType, dwDisp, dwPathLen = MAX_PATH;
     952        DWORD   folder = csidl & CSIDL_FOLDER_MASK;
     953        CHAR    *p;
    687954
    688955        TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
    689956
    690         /* build default values */
    691         switch(csidl)
     957        if ((folder > CSIDL_CONNECTIONS) || (CSIDL_Data[folder].hRootKey == 0))
    692958        {
    693           case CSIDL_APPDATA:
    694             hRootKey = HKEY_CURRENT_USER;
    695             strcpy (szValueName, "AppData");
    696             strcpy (szDefaultPath, "AppData");
    697             break;
    698 
    699           case CSIDL_COOKIES:
    700             hRootKey = HKEY_CURRENT_USER;
    701             strcpy (szValueName, "Cookies");
    702             strcpy(szDefaultPath, "Cookies");
    703             break;
    704 
    705           case CSIDL_DESKTOPDIRECTORY:
    706             hRootKey = HKEY_CURRENT_USER;
    707             strcpy(szValueName, "Desktop");
    708             strcpy(szDefaultPath, "Desktop");
    709             break;
    710 
    711           case CSIDL_COMMON_DESKTOPDIRECTORY:
    712             hRootKey = HKEY_LOCAL_MACHINE;
    713             strcpy(szValueName, "Common Desktop");
    714             strcpy(szDefaultPath, "Desktop");
    715             break;
    716 
    717           case CSIDL_FAVORITES:
    718             hRootKey = HKEY_CURRENT_USER;
    719             strcpy(szValueName, "Favorites");
    720             strcpy(szDefaultPath, "Favorites");
    721             break;
    722 
    723           case CSIDL_FONTS:
    724             hRootKey = HKEY_CURRENT_USER;
    725             strcpy(szValueName, "Fonts");
    726             strcpy(szDefaultPath, "Fonts");
    727             break;
    728 
    729           case CSIDL_HISTORY:
    730             hRootKey = HKEY_CURRENT_USER;
    731             strcpy(szValueName, "History");
    732             strcpy(szDefaultPath, "History");
    733             break;
    734 
    735           case CSIDL_NETHOOD:
    736             hRootKey = HKEY_CURRENT_USER;
    737             strcpy(szValueName, "NetHood");
    738             strcpy(szDefaultPath, "NetHood");
    739             break;
    740 
    741           case CSIDL_INTERNET_CACHE:
    742             hRootKey = HKEY_CURRENT_USER;
    743             strcpy(szValueName, "Cache");
    744             strcpy(szDefaultPath, "Temporary Internet Files");
    745             break;
    746 
    747           case CSIDL_PERSONAL:
    748             hRootKey = HKEY_CURRENT_USER;
    749             strcpy(szValueName, "Personal");
    750             strcpy(szDefaultPath, "My Own Files");
    751             bRelative = FALSE;
    752             break;
    753 
    754           case CSIDL_PRINTHOOD:
    755             hRootKey = HKEY_CURRENT_USER;
    756             strcpy(szValueName, "PrintHood");
    757             strcpy(szDefaultPath, "PrintHood");
    758             break;
    759 
    760           case CSIDL_PROGRAMS:
    761             hRootKey = HKEY_CURRENT_USER;
    762             strcpy(szValueName, "Programs");
    763             strcpy(szDefaultPath, "Start Menu\\Programs");
    764             break;
    765 
    766           case CSIDL_COMMON_PROGRAMS:
    767             hRootKey = HKEY_LOCAL_MACHINE;
    768             strcpy(szValueName, "Common Programs");
    769             strcpy(szDefaultPath, "");
    770             break;
    771 
    772           case CSIDL_RECENT:
    773             hRootKey = HKEY_CURRENT_USER;
    774             strcpy(szValueName, "Recent");
    775             strcpy(szDefaultPath, "Recent");
    776             break;
    777 
    778           case CSIDL_SENDTO:
    779             hRootKey = HKEY_CURRENT_USER;
    780             strcpy(szValueName, "SendTo");
    781             strcpy(szDefaultPath, "SendTo");
    782             break;
    783 
    784           case CSIDL_STARTMENU:
    785             hRootKey = HKEY_CURRENT_USER;
    786             strcpy(szValueName, "Start Menu");
    787             strcpy(szDefaultPath, "Start Menu");
    788             break;
    789 
    790           case CSIDL_COMMON_STARTMENU:
    791             hRootKey = HKEY_LOCAL_MACHINE;
    792             strcpy(szValueName, "Common Start Menu");
    793             strcpy(szDefaultPath, "Start Menu");
    794             break;
    795 
    796           case CSIDL_STARTUP:
    797             hRootKey = HKEY_CURRENT_USER;
    798             strcpy(szValueName, "StartUp");
    799             strcpy(szDefaultPath, "Start Menu\\Programs\\StartUp");
    800             break;
    801 
    802           case CSIDL_COMMON_STARTUP:
    803             hRootKey = HKEY_LOCAL_MACHINE;
    804             strcpy(szValueName, "Common StartUp");
    805             strcpy(szDefaultPath, "Start Menu\\Programs\\StartUp");
    806             break;
    807 
    808           case CSIDL_TEMPLATES:
    809             hRootKey = HKEY_CURRENT_USER;
    810             strcpy(szValueName, "Templates");
    811             strcpy(szDefaultPath, "ShellNew");
    812             break;
    813 
    814           default:
    815959            ERR("folder unknown or not allowed\n");
    816960            return FALSE;
    817961        }
    818 
    819         /* user shell folders */
    820         if (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
    821 
    822         if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
     962        if (CSIDL_Data[folder].hRootKey == 1)
    823963        {
     964            FIXME("folder unknown, please add.\n");
     965            return FALSE;
     966        }
     967
     968        dwFlags = CSIDL_Data[folder].dwFlags;
     969        hRootKey = CSIDL_Data[folder].hRootKey;
     970        strcpy(szValueName, CSIDL_Data[folder].szValueName);
     971        strcpy(szDefaultPath, CSIDL_Data[folder].szDefaultPath);
     972
     973        if (dwFlags & CSIDL_MYFLAG_SHFOLDER)
     974        {
     975          /*   user shell folders */
     976          if   (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
     977
     978          if   (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
     979          {
     980            RegCloseKey(hKey);
     981
     982            /* shell folders */
     983            if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
     984
     985            if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
     986            {
     987
     988              /* value not existing */
     989              if (dwFlags & CSIDL_MYFLAG_RELATIVE)
     990              {
     991                GetWindowsDirectoryA(szPath, MAX_PATH);
     992                PathAddBackslashA(szPath);
     993                strcat(szPath, szDefaultPath);
     994              }
     995              else
     996              {
     997                strcpy(szPath, "C:\\"); /* FIXME ??? */
     998                strcat(szPath, szDefaultPath);
     999              }
     1000              RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
     1001            }
     1002          }
    8241003          RegCloseKey(hKey);
    825 
    826           /* shell folders */
    827           if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
    828 
    829           if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
     1004        }
     1005        else
     1006        {
     1007          LPCSTR pRegPath;
     1008
     1009          if (dwFlags & CSIDL_MYFLAG_SETUP)
     1010            pRegPath = szSetup;
     1011          else
     1012          if (dwFlags & CSIDL_MYFLAG_CURRVER)
     1013            pRegPath = szCurrentVersion;
     1014          else
    8301015          {
    831 
     1016            ERR("folder settings broken, please correct !\n");
     1017            return FALSE;
     1018          }
     1019
     1020          if   (RegCreateKeyExA(hRootKey,pRegPath,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
     1021
     1022          if   (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
     1023          {
    8321024            /* value not existing */
    833             if (bRelative)
     1025            if (dwFlags & CSIDL_MYFLAG_RELATIVE)
    8341026            {
    8351027              GetWindowsDirectoryA(szPath, MAX_PATH);
     
    8391031            else
    8401032            {
    841               strcpy(szPath, "C:\\");   /* fixme ??? */
     1033              strcpy(szPath, "C:\\");   /* FIXME ??? */
    8421034              strcat(szPath, szDefaultPath);
    8431035            }
    8441036            RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
    8451037          }
     1038          RegCloseKey(hKey);
    8461039        }
    847         RegCloseKey(hKey);
    8481040
    8491041        /* expand paths like %USERPROFILE% */
     
    8541046        }
    8551047
    856         /* if we don't care about existing directorys we are ready */
     1048        /* if we don't care about existing directories we are ready */
    8571049        if(csidl & CSIDL_FLAG_DONT_VERIFY) return TRUE;
    8581050
    8591051        if (PathFileExistsA(szPath)) return TRUE;
    8601052
    861         /* not existing but we not allowed to create it */
     1053        /* not existing but we are not allowed to create it */
    8621054        if (!bCreate) return FALSE;
    863        
    864         if (!CreateDirectoryA(szPath,NULL))
     1055
     1056        /* create directory/directories */
     1057        strcpy(szBuildPath, szPath);
     1058        p = strchr(szBuildPath, '\\');
     1059        while (p)
    8651060        {
    866           ERR("Failed to create directory '%s'.\n", szPath);
    867           return FALSE;
     1061            *p = 0;
     1062            if (!PathFileExistsA(szBuildPath))
     1063            {
     1064                if (!CreateDirectoryA(szBuildPath,NULL))
     1065                {
     1066                    ERR("Failed to create directory '%s'.\n", szPath);
     1067                    return FALSE;
     1068                }
     1069            }
     1070            *p = '\\';
     1071            p = strchr(p+1, '\\');
    8681072        }
    8691073
     
    8851089        if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate))
    8861090        {
    887           lstrcpynAtoW(szPath, szTemp, MAX_PATH);
    888         }
     1091            if (!MultiByteToWideChar( CP_ACP, 0, szTemp, -1, szPath, MAX_PATH ))
     1092                szPath[MAX_PATH-1] = 0;
     1093        }
    8891094
    8901095        TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
     
    9141119        HWND hwndOwner,
    9151120        int nFolder,
    916         HANDLE hToken,  /* FIXME: get paths for specific user */
    917         DWORD dwFlags,  /* FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */
     1121        HANDLE hToken,  /* [in] FIXME: get paths for specific user */
     1122        DWORD dwFlags,  /* [in] FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */
    9181123        LPSTR pszPath)
    9191124{
  • trunk/src/shell32/shellreg.c

    r4121 r5618  
    1 /* $Id: shellreg.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */
    21/*
    32        Shell Registry Access
    43*/
    5 #ifdef __WIN32OS2__
    6 #define ICOM_CINTERFACE 1
    7 #include <odin.h>
    8 #endif
    94#include <string.h>
    105#include <stdio.h>
     
    138#include "debugtools.h"
    149#include "winnls.h"
    15 #include "heap.h"
    1610
    1711#include "shellapi.h"
     
    10195}
    10296
    103 #ifndef __WIN32OS2__
    10497/*************************************************************************
    10598 * SHRegDeleteKeyA   [SHELL32]
     
    110103{
    111104        FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
     105#ifdef __WIN32OS2__
     106        return RegDeleteKeyA(hkey,pszSubKey);
     107#else
    112108        return 0;
    113 }
    114109#endif
     110}
    115111
    116112/*************************************************************************
     
    122118{
    123119        FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
     120#ifdef __WIN32OS2__
     121        return RegDeleteKeyW(hkey,pszSubKey);
     122#else
    124123        return 0;
     124#endif
    125125}
    126126
     
    134134        return RegCloseKey( hkey );
    135135}
     136
     137#ifndef __WIN32OS2__
     138
     139/* 16-bit functions */
     140
     141/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by
     142 * some programs. Do not remove those cases. -MM
     143 */
     144static inline void fix_win16_hkey( HKEY *hkey )
     145{
     146    if (*hkey == 0 || *hkey == 1) *hkey = HKEY_CLASSES_ROOT;
     147}
     148
     149/******************************************************************************
     150 *           RegOpenKey16   [SHELL.1]
     151 */
     152DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
     153{
     154    fix_win16_hkey( &hkey );
     155    return RegOpenKeyA( hkey, name, retkey );
     156}
     157
     158/******************************************************************************
     159 *           RegCreateKey16   [SHELL.2]
     160 */
     161DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
     162{
     163    fix_win16_hkey( &hkey );
     164    return RegCreateKeyA( hkey, name, retkey );
     165}
     166
     167/******************************************************************************
     168 *           RegCloseKey16   [SHELL.3]
     169 */
     170DWORD WINAPI RegCloseKey16( HKEY hkey )
     171{
     172    fix_win16_hkey( &hkey );
     173    return RegCloseKey( hkey );
     174}
     175
     176/******************************************************************************
     177 *           RegDeleteKey16   [SHELL.4]
     178 */
     179DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name )
     180{
     181    fix_win16_hkey( &hkey );
     182    return RegDeleteKeyA( hkey, name );
     183}
     184
     185/******************************************************************************
     186 *           RegSetValue16   [SHELL.5]
     187 */
     188DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count )
     189{
     190    fix_win16_hkey( &hkey );
     191    return RegSetValueA( hkey, name, type, data, count );
     192}
     193
     194/******************************************************************************
     195 *           RegQueryValue16   [SHELL.6]
     196 *
     197 * NOTES
     198 *    Is this HACK still applicable?
     199 *
     200 * HACK
     201 *    The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just
     202 *    mask out the high 16 bit.  This (not so much incidently) hopefully fixes
     203 *    Aldus FH4)
     204 */
     205DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count )
     206{
     207    fix_win16_hkey( &hkey );
     208    if (count) *count &= 0xffff;
     209    return RegQueryValueA( hkey, name, data, count );
     210}
     211
     212/******************************************************************************
     213 *           RegEnumKey16   [SHELL.7]
     214 */
     215DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
     216{
     217    fix_win16_hkey( &hkey );
     218    return RegEnumKeyA( hkey, index, name, name_len );
     219}
     220#endif //__WIN32OS2__
  • trunk/src/shell32/shellstring.c

    r4121 r5618  
    1 /* $Id: shellstring.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */
    2 #ifdef __WIN32OS2__
    3 #define ICOM_CINTERFACE 1
    4 #include <odin.h>
    5 #endif
    61#include <string.h>
    72#include <stdio.h>
     
    149#include "heap.h"
    1510
     11#include "shlobj.h"
     12#include "shlwapi.h"
    1613#include "shellapi.h"
    1714#include "shell32_main.h"
     
    3128 *  the pidl is for STRRET OFFSET
    3229 */
    33 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
     30HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
    3431{
    3532        return StrRetToBufA( src, pidl, dest, len );
    3633}
    3734
    38 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
     35HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
    3936{
    4037        return StrRetToBufW( src, pidl, dest, len );
    4138}
    4239
    43 HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
     40HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
    4441{
    4542        if(SHELL_OsIsUnicode())
  • trunk/src/shell32/shellstub.cpp

    r5544 r5618  
    1 /* $Id: shellstub.cpp,v 1.2 2001-04-19 08:32:18 sandervl Exp $ */
     1/* $Id: shellstub.cpp,v 1.3 2001-04-28 13:33:47 sandervl Exp $ */
    22
    33/*
     
    100100}
    101101
    102 ODINFUNCTION2(DWORD, ILSaveToStream, DWORD, x1, DWORD, x2)
    103 {
    104   dprintf(("STUB!"));
    105   return 0;
    106 }
    107 
    108102ODINFUNCTION1(DWORD, InvalidateDriveType, DWORD, x1)
    109103{
  • trunk/src/shell32/shlfolder.c

    r4121 r5618  
    1 /* $Id: shlfolder.c,v 1.1 2000-08-30 13:52:57 sandervl Exp $ */
    21/*
    32 *      Shell Folder stuff
     
    109 */
    1110#ifdef __WIN32OS2__
    12 #define ICOM_CINTERFACE 1
    13 #include <odin.h>
     11#define WINE_LARGE_INTEGER
     12#define snprintf(a,b,c,d)       sprintf(a,c,d)
    1413#endif
    15 
    1614#include <stdlib.h>
    1715#include <string.h>
     
    2018#include "debugtools.h"
    2119#include "winerror.h"
     20#include "winbase.h"
    2221
    2322#include "oleidl.h"
     
    3231#include "shresdef.h"
    3332#include "shlwapi.h"
    34 
    35 #define INITGUID
    36 #include "initguid.h"
    3733#include "shellfolder.h"
    3834
    39 
    40 DEFAULT_DEBUG_CHANNEL(shell)
     35DEFAULT_DEBUG_CHANNEL(shell);
    4136
    4237
     
    347342
    348343/**************************************************************************
    349 *       we need a seperate IUnknown to handle aggregation
     344*       we need a separate IUnknown to handle aggregation
    350345*       (inner IUnknown)
    351346*/
     
    616611*
    617612* NOTES
    618 *  every folder trys to parse only it's own (the leftmost) pidl and creates a
     613*  every folder tries to parse only its own (the leftmost) pidl and creates a
    619614*  subfolder to evaluate the remaining parts
    620615*  now we can parse into namespaces implemented by shell extensions
     
    658653
    659654          /* build the full pathname to the element */
    660           lstrcpynWtoA(szTempA, szElement, lstrlenW(szElement) + 1);
     655          WideCharToMultiByte( CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL );
    661656          strcpy(szPath, This->sMyPath);
    662657          PathAddBackslashA(szPath);
     
    691686        }
    692687
    693         *ppidl = pidlTemp;
     688        if (!hr)
     689          *ppidl = pidlTemp;
     690        else
     691          *ppidl = NULL;
    694692
    695693        TRACE("(%p)->(-- pidl=%p ret=0x%08lx)\n", This, ppidl? *ppidl:0, hr);
     
    11881186        PathAddBackslashA(szDest);
    11891187        len = strlen (szDest);
    1190         lstrcpynWtoA(szDest+len, lpName, MAX_PATH-len);
    1191        
     1188        WideCharToMultiByte( CP_ACP, 0, lpName, -1, szDest+len, MAX_PATH-len, NULL, NULL );
     1189        szDest[MAX_PATH-1] = 0;
    11921190        TRACE("src=%s dest=%s\n", szSrc, szDest);
    11931191        if ( MoveFileA(szSrc, szDest) )
     
    14981496        int i;
    14991497        char szPath[MAX_PATH];
     1498        BOOL bConfirm = TRUE;
    15001499
    15011500        TRACE("(%p)(%u %p)\n", This, cidl, apidl);
    15021501       
     1502        /* deleting multiple items so give a slightly different warning */
     1503        if(cidl != 1)
     1504        {
     1505          char tmp[8];
     1506          snprintf(tmp, sizeof(tmp), "%d", cidl);
     1507          if(!SHELL_WarnItemDelete(ASK_DELETE_MULTIPLE_ITEM, tmp))
     1508            return E_FAIL;
     1509          bConfirm = FALSE;
     1510        }
     1511
    15031512        for(i=0; i< cidl; i++)
    15041513        {
     
    15101519          {
    15111520            LPITEMIDLIST pidl;
    1512 
    1513             MESSAGE("delete %s\n", szPath);
    1514             if (! SHELL_DeleteDirectoryA(szPath, TRUE)) return E_FAIL;
     1521            TRACE("delete %s\n", szPath);
     1522            if (! SHELL_DeleteDirectoryA(szPath, bConfirm))
     1523            {
     1524              TRACE("delete %s failed, bConfirm=%d", szPath, bConfirm);
     1525              return E_FAIL;
     1526            }
    15151527            pidl = ILCombine(This->absPidl, apidl[i]);
    15161528            SHChangeNotifyA(SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL);
     
    15211533            LPITEMIDLIST pidl;
    15221534
    1523             MESSAGE("delete %s\n", szPath);
    1524             if (! DeleteFileA(szPath)) return E_FAIL;
     1535            TRACE("delete %s\n", szPath);
     1536            if (! SHELL_DeleteFileA(szPath, bConfirm))
     1537            {
     1538              TRACE("delete %s failed, bConfirm=%d", szPath, bConfirm);
     1539              return E_FAIL;
     1540            }
    15251541            pidl = ILCombine(This->absPidl, apidl[i]);
    15261542            SHChangeNotifyA(SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL);
     
    21332149        {
    21342150          szNext = GetNextElementW(lpszDisplayName, szElement, MAX_PATH);
    2135           lstrcpynWtoA(szTempA, szElement, lstrlenW(szElement) + 1);
     2151          WideCharToMultiByte( CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL );
    21362152          pidlTemp = _ILCreateDrive(szTempA);
    21372153
     
    24982514                _ILSimpleGetText(pidl, szPath, MAX_PATH);
    24992515                GetDiskFreeSpaceExA(szPath, NULL, &ulBytes, NULL);
    2500 #ifdef __WIN32OS2__
    2501                 StrFormatByteSizeA(ulBytes.LowPart, psd->str.u.cStr, MAX_PATH);
    2502 #else
    25032516                StrFormatByteSizeA(ulBytes.s.LowPart, psd->str.u.cStr, MAX_PATH);
    2504 #endif
    25052517              }
    25062518              break;
     
    25102522                _ILSimpleGetText(pidl, szPath, MAX_PATH);
    25112523                GetDiskFreeSpaceExA(szPath, &ulBytes, NULL, NULL);
    2512 #ifdef __WIN32OS2__
    2513                 StrFormatByteSizeA(ulBytes.LowPart, psd->str.u.cStr, MAX_PATH);
    2514 #else
    25152524                StrFormatByteSizeA(ulBytes.s.LowPart, psd->str.u.cStr, MAX_PATH);
    2516 #endif
    25172525              }
    25182526              break;
  • trunk/src/shell32/shlmenu.c

    r4121 r5618  
    1 /* $Id: shlmenu.c,v 1.1 2000-08-30 13:52:59 sandervl Exp $ */
    21/*
    32 * see www.geocities.com/SiliconValley/4942/filemenu.html
    43 */
    5 #ifdef __WIN32OS2__
    6 #define ICOM_CINTERFACE 1
    7 #include <odin.h>
    8 #endif
    94#include <string.h>
    105
     6#include "shlobj.h"
    117#include "wine/obj_base.h"
    128#include "wine/obj_enumidlist.h"
    139#include "wine/obj_shellfolder.h"
    1410#include "wine/undocshell.h"
    15 
     11#include "shlwapi.h"
    1612#include "heap.h"
    1713#include "debugtools.h"
     
    5248#define CCH_MAXITEMTEXT 256
    5349
    54 DEFAULT_DEBUG_CHANNEL(shell)
     50DEFAULT_DEBUG_CHANNEL(shell);
    5551
    5652LPFMINFO FM_GetMenuInfo(HMENU hmenu)
     
    359355
    360356}
     357
     358/**********************************************************************/
     359
    361360BOOL WINAPI FileMenu_AppendItemAW(
    362361        HMENU hMenu,
     
    603602       
    604603        Shell_GetImageList(0, &hImageList);
    605         pImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
     604        ImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
    606605
    607606        TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom);
     
    691690
    692691        GetMenuItemInfoA(hMenu, uID, FALSE, &mii );
    693         if ( mii.hSubMenu );
     692        if ( mii.hSubMenu )
     693        {
     694          /* FIXME: Do what? */
     695        }
    694696
    695697        DeleteMenu(hMenu, MF_BYCOMMAND, uID);
     
    711713
    712714        GetMenuItemInfoA(hMenu, uPos, TRUE, &mii );
    713         if ( mii.hSubMenu );
     715        if ( mii.hSubMenu )
     716        {
     717          /* FIXME: Do what? */
     718        }
    714719
    715720        DeleteMenu(hMenu, MF_BYPOSITION, uPos);
     
    820825        return(FALSE);
    821826}
     827
     828/**********************************************************************/
    822829
    823830HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
  • trunk/src/shell32/shlview.c

    r4121 r5618  
    1 /* $Id: shlview.c,v 1.1 2000-08-30 13:52:59 sandervl Exp $ */
    21/*
    32 *      ShellView
     
    2322 * Release() ???
    2423 */
    25 #ifdef __WIN32OS2__
    26 #define ICOM_CINTERFACE 1
    27 #include <odin.h>
    28 #endif
    2924
    3025#include <stdlib.h>
    3126#include <string.h>
    3227
     28#include "windef.h"
     29#include "winerror.h"
     30#include "winnls.h"
    3331#include "servprov.h"
    3432#include "shlguid.h"
    35 #include "wine/obj_base.h"
    36 #include "wine/obj_shellfolder.h"
    37 #include "wine/obj_shellview.h"
    38 #include "wine/obj_oleview.h"
    39 #include "wine/obj_commdlgbrowser.h"
    40 #include "wine/obj_shellbrowser.h"
    41 #include "wine/obj_dockingwindowframe.h"
    42 #include "wine/obj_extracticon.h"
    43 #include "wine/obj_dragdrop.h"
     33#include "shlobj.h"
    4434#include "wine/undocshell.h"
    4535#include "shresdef.h"
    4636#include "debugtools.h"
    47 #include "winerror.h"
    48 #include "wine/winestring.h"
    4937
    5038#include "docobj.h"
    5139#include "pidl.h"
    5240#include "shell32_main.h"
     41#include "shellfolder.h"
    5342
    5443DEFAULT_DEBUG_CHANNEL(shell);
     
    118107#define SHV_CHANGE_NOTIFY WM_USER + 0x1111
    119108
    120 #define TOOLBAR_ID   (L"SHELLDLL_DefView")
    121109/*windowsx.h */
    122110#define GET_WM_COMMAND_ID(wp, lp)               LOWORD(wp)
    123111#define GET_WM_COMMAND_HWND(wp, lp)             (HWND)(lp)
    124112#define GET_WM_COMMAND_CMD(wp, lp)              HIWORD(wp)
    125 /* winuser.h */
    126 #define WM_SETTINGCHANGE                WM_WININICHANGE
     113
    127114extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
    128115                        UINT wID, UINT fType, LPSTR dwTypeData, UINT fState);
     
    152139typedef void (* CALLBACK PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
    153140#else
    154 typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
     141typedef void CALLBACK (*PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
    155142#endif
    156143
     
    12591246               
    12601247                pidl = (LPITEMIDLIST)lpdi->item.lParam;
    1261                 lstrcpynAtoW(wszNewName, lpdi->item.pszText, MAX_PATH);
     1248                if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH ))
     1249                    wszNewName[MAX_PATH-1] = 0;
    12621250                hr = IShellFolder_SetNameOf(This->pSFParent, 0, pidl, wszNewName, SHGDN_INFOLDER, &pidl);
    12631251               
     
    12851273             
    12861274              LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh;
     1275
     1276              /* initiate a rename of the selected file or directory */
     1277              if(plvKeyDown->wVKey == VK_F2)
     1278              {
     1279                /* see how many files are selected */
     1280                int i = ListView_GetSelectedCount(This->hWndList);
     1281
     1282                /* get selected item */
     1283                if(i == 1)
     1284                {
     1285                  /* get selected item */
     1286                  i = ListView_GetNextItem(This->hWndList, -1,
     1287                        LVNI_SELECTED);
     1288 
     1289                  ListView_EnsureVisible(This->hWndList, i, 0);
     1290                  ListView_EditLabelA(This->hWndList, i);
     1291                }
     1292              }
    12871293#if 0
    12881294              TranslateAccelerator(This->hWnd, This->hAccel, &msg)
    12891295#endif
    1290               FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey);
     1296              else if(plvKeyDown->wVKey == VK_DELETE)
     1297              {
     1298                int i, item_index;
     1299                LVITEMA item;
     1300                LPITEMIDLIST* pItems;
     1301                ISFHelper *psfhlp;
     1302
     1303                IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper,
     1304                        (LPVOID*)&psfhlp);
     1305
     1306                if(!(i = ListView_GetSelectedCount(This->hWndList)))
     1307                  break;
     1308       
     1309                /* allocate memory for the pidl array */
     1310                pItems = HeapAlloc(GetProcessHeap(), 0,
     1311                        sizeof(LPITEMIDLIST) * i);
     1312 
     1313                /* retrieve all selected items */
     1314                i = 0;
     1315                item_index = -1;
     1316                while(ListView_GetSelectedCount(This->hWndList) > i)
     1317                {
     1318                  /* get selected item */
     1319                  item_index = ListView_GetNextItem(This->hWndList,
     1320                        item_index, LVNI_SELECTED);
     1321                  item.iItem = item_index;
     1322                  ListView_GetItemA(This->hWndList, &item);
     1323
     1324                  /* get item pidl */
     1325                  pItems[i] = (LPITEMIDLIST)item.lParam;
     1326                 
     1327                  i++;
     1328                }
     1329
     1330                /* perform the item deletion */
     1331                ISFHelper_DeleteItems(psfhlp, i, pItems);
     1332
     1333                /* free pidl array memory */
     1334                HeapFree(GetProcessHeap(), 0, pItems);
     1335              }
     1336              else
     1337                FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey);
    12911338            }
    12921339            break;
     1340
    12931341          default:
    12941342            TRACE("-- %p WM_COMMAND %x unhandled\n", This, lpnmh->code);
  • trunk/src/shell32/shpolicy.c

    r4121 r5618  
    1 /* $Id: shpolicy.c,v 1.1 2000-08-30 13:53:00 sandervl Exp $ */
    21/*
    32 * shpolicy.c - Data for shell/system policies.
     
    1413 * Up to date as of SHELL32 v4.72 (Win98, Win95 with MSIE 5)
    1514 */
    16 #ifdef __WIN32OS2__
    17 #define ICOM_CINTERFACE 1
    18 #include <odin.h>
    19 #endif
    2015
    2116#include <stdlib.h>
  • trunk/src/shell32/shpolicy.h

    r4121 r5618  
    1 /* $Id: shpolicy.h,v 1.3 2000-08-30 13:51:08 sandervl Exp $ */
    2 /*
     1/*
    32 *  shpolicy.h - contains defs of policy data for SHRestricted
    4  *
     3 * 
    54 *  Created 1999 by Ian Schmidt, <ischmidt@cfl.rr.com>
    65 *  Up to date as of SHELL32 v4.72 (Win98, Win95 with MSIE 5)
    7  *
    8  * Corel WINE 20000324 level
    96 */
    107
  • trunk/src/shell32/shres.orc

    r5576 r5618  
    1 /* $Id: shres.orc,v 1.12 2001-04-23 10:47:23 sandervl Exp $ */
     1/* $Id: shres.orc,v 1.13 2001-04-28 13:33:48 sandervl Exp $ */
    22/*
    33 * Top level resource file for Common Dialogs
     
    104104 DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
    105105 PUSHBUTTON "Cancel", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP
    106  LTEXT "", IDD_TITLE, 4, 4, 18, 12
    107  LTEXT "", IDD_STATUS, 4, 25, 18, 12
     106 LTEXT "", IDD_TITLE, 4, 4, 180, 12
     107 LTEXT "", IDD_STATUS, 4, 25, 180, 12
    108108 CONTROL "Tree1",IDD_TREEVIEW,"SysTreeView32",
    109109        TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
    110         WS_BORDER | WS_TABSTOP,
     110        WS_BORDER | WS_TABSTOP, 
    111111        4, 40, 180, 120
    112112}
     113
    113114
    114115/*
  • trunk/src/shell32/shv_bg_cmenu.c

    r4121 r5618  
    1 /* $Id: shv_bg_cmenu.c,v 1.1 2000-08-30 13:53:00 sandervl Exp $ */
    21/*
    32 *      IContextMenu
     
    65 *      Copyright 1999  Juergen Schmied <juergen.schmied@metronet.de>
    76 */
    8 #ifdef __WIN32OS2__
    9 #define ICOM_CINTERFACE 1
    10 #include <odin.h>
    11 #endif
    127#include <string.h>
    138
     
    2217#include "shell32_main.h"
    2318#include "shellfolder.h"
    24 #include "shell.h" /* DROPFILESTRUCT */
    2519#include "wine/undocshell.h"
    2620
    27 DEFAULT_DEBUG_CHANNEL(shell)
     21DEFAULT_DEBUG_CHANNEL(shell);
    2822
    2923/**************************************************************************
     
    201195        TRACE("\n");
    202196
    203         if(SUCCEEDED(pOleGetClipboard(&pda)));
     197        if(SUCCEEDED(pOleGetClipboard(&pda)))
    204198        {
    205199          STGMEDIUM medium;
     
    370364        TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
    371365
    372         /* test the existance of the menu items, the file dialog enables
     366        /* test the existence of the menu items, the file dialog enables
    373367           the buttons according to this */
    374368        if (uFlags == GCS_VALIDATEA)
  • trunk/src/shell32/shv_item_cmenu.c

    r4121 r5618  
    1 /* $Id: shv_item_cmenu.c,v 1.1 2000-08-30 13:53:01 sandervl Exp $ */
    21/*
    32 *      IContextMenu for items in the shellview
     
    54 *      1998, 2000      Juergen Schmied <juergen.schmied@debitel.net>
    65 */
    7 #ifdef __WIN32OS2__
    8 #define ICOM_CINTERFACE 1
    9 #include <odin.h>
    10 #endif
    116#include <string.h>
    127
     
    2419#include "shell32_main.h"
    2520#include "shellfolder.h"
    26 #include "shell.h" /* DROPFILESTRUCT */
    27 
    28 DEFAULT_DEBUG_CHANNEL(shell)
     21
     22DEFAULT_DEBUG_CHANNEL(shell);
    2923
    3024/**************************************************************************
     
    491485            switch(idCommand)
    492486            { case FCIDM_SHVIEW_RENAME:
    493                 lstrcpyAtoW((LPWSTR)lpszName, "rename");
     487                MultiByteToWideChar( CP_ACP, 0, "rename", -1, (LPWSTR)lpszName, uMaxNameLen );
    494488                hr = NOERROR;
    495489                break;
  • trunk/src/shell32/systray.c

    r4121 r5618  
    1 /* $Id: systray.c,v 1.1 2000-08-30 13:53:01 sandervl Exp $ */
    21/*
    32 *      Systray
     
    109 *
    1110 */
    12 #ifdef __WIN32OS2__
    13 #define ICOM_CINTERFACE 1
    14 #include <odin.h>
    15 #else
     11
     12#ifndef __WIN32OS2__
    1613#include <unistd.h>
    1714#endif
     
    1916#include <string.h>
    2017
    21 #ifndef __WIN32OS2__
    22 #include "heap.h"
    23 #endif
     18#include "winnls.h"
     19#include "shlobj.h"
    2420#include "shellapi.h"
    2521#include "shell32_main.h"
    26 #include "windows.h"
    2722#include "commctrl.h"
    2823#include "debugtools.h"
     24#include "heap.h"
    2925#include "config.h"
    3026
    31 DEFAULT_DEBUG_CHANNEL(shell)
     27DEFAULT_DEBUG_CHANNEL(shell);
    3228
    3329typedef struct SystrayItem {
     
    186182  return FALSE;
    187183#else
     184
    188185  /* Initialize the window size. */
    189186  rect.left   = 0;
     
    215212  }
    216213  return TRUE;
    217 #endif  //__WIN32OS2__
     214#endif
    218215}
    219216
     
    221218static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem)
    222219{
     220  if(ptrayItem->notifyIcon.hIcon)
     221     DestroyIcon(ptrayItem->notifyIcon.hIcon);   
    223222  if(ptrayItem->hWndToolTip)
    224223      DestroyWindow(ptrayItem->hWndToolTip);
     
    237236void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon)
    238237{
    239   ptrayItem->notifyIcon.hIcon = hIcon; /* do we need a copy? */
     238  ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon);
    240239  InvalidateRect(ptrayItem->hWnd, NULL, TRUE);
    241240}
     
    346345
    347346/*************************************************************************
    348  * Shell_NotifyIconA                    [SHELL32.297]
     347 * Shell_NotifyIconA                    [SHELL32.297][SHELL32.296]
    349348 */
    350349BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
     
    368367
    369368/*************************************************************************
    370  * Shell_NotifyIconW                    [SHELL32.297]
     369 * Shell_NotifyIconW                    [SHELL32.298]
    371370 */
    372371BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid )
     
    376375        PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
    377376        memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
    378         if (*(pnid->szTip))
    379           lstrcpynWtoA (p->szTip, pnid->szTip, 64 );
     377        WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL );
     378        p->szTip[sizeof(p->szTip)-1] = 0;
    380379
    381380        ret = Shell_NotifyIconA(dwMessage, p );
     
    384383        return ret;
    385384}
    386 
    387 /*************************************************************************
    388  * Shell_NotifyIcon                     [SHELL32.296]
    389  */
    390 BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATAA pnid)
    391 {
    392   return Shell_NotifyIconA(dwMessage, pnid);
    393 }
Note: See TracChangeset for help on using the changeset viewer.