Changeset 5618


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

resync with latest wine

Location:
trunk/src
Files:
5 added
2 deleted
36 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified 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;
  • TabularUnified 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);
  • TabularUnified 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;
  • TabularUnified 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++)
  • TabularUnified 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 \
  • TabularUnified 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);
  • TabularUnified 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
  • TabularUnified 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/*
  • TabularUnified 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 
  • TabularUnified 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
  • TabularUnified 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();
  • TabularUnified 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 */
  • TabularUnified 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"
  • TabularUnified 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"
  • TabularUnified 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}
  • TabularUnified 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 */
  • TabularUnified 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}
  • TabularUnified 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{
  • TabularUnified 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__
  • TabularUnified 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())
  • TabularUnified 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{
  • TabularUnified 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;
  • TabularUnified 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)
  • TabularUnified 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);
  • TabularUnified 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>
  • TabularUnified 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
  • TabularUnified 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/*
  • TabularUnified 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)
  • TabularUnified 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;
  • TabularUnified 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 }
  • TabularUnified trunk/src/shlwapi/makefile

    r4719 r5618  
    1 # $Id: makefile,v 1.20 2000-12-02 23:57:08 bird Exp $
     1# $Id: makefile,v 1.21 2001-04-28 13:32:19 sandervl Exp $
    22
    33#
     
    2121$(OBJDIR)\shlstub.obj \
    2222$(OBJDIR)\url.obj \
     23$(OBJDIR)\url_odin.obj \
    2324$(OBJDIR)\reg_odin.obj \
    2425$(OBJDIR)\reg.obj \
     
    3031$(OBJDIR)\shlwapirsrc.obj \
    3132$(OBJDIR)\ordinal.obj \
     33$(OBJDIR)\ordinal_odin.obj \
    3234$(DLLENTRY)
    3335
  • TabularUnified trunk/src/shlwapi/path.c

    r4081 r5618  
    11/*
    22 * Path Functions
    3  *
    4  * Note: Odin changes marked by #ifdef __WIN32OS2__
    5  */
    6 
     3 */
    74#ifdef __WIN32OS2__
    85#include <odin.h>
     
    1714
    1815#include <heapstring.h>
     16#include <wine\undocshell.h>
    1917#endif
    2018
     
    2422#include "winerror.h"
    2523#include "wine/unicode.h"
    26 #include "wine/undocshell.h"
     24#include "winbase.h"
     25#include "wingdi.h"
     26#include "winuser.h"
    2727#include "shlwapi.h"
    2828#include "debugtools.h"
     29
    2930
    3031DEFAULT_DEBUG_CHANNEL(shell);
     
    211212LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
    212213{
     214        lpszPath[0] = 'A' + drive;
     215        lpszPath[1] = ':';
     216        lpszPath[2] = '\\';
     217        lpszPath[3] = 0;
    213218        TRACE("%p %i\n",debugstr_w(lpszPath), drive);
    214 
    215         lstrcpyAtoW(lpszPath,"A:\\");
    216         lpszPath[0]+=drive;
    217219        return lpszPath;
    218220}
     
    10701072BOOL WINAPI PathMatchSpecW(LPCWSTR name, LPCWSTR mask)
    10711073{
    1072         WCHAR stemp[4];
     1074    static const WCHAR stemp[] = { '*','.','*',0 };
    10731075        TRACE("%s %s\n",debugstr_w(name),debugstr_w(mask));
    10741076
    1075         lstrcpyAtoW(stemp,"*.*");       
    10761077        if (!lstrcmpW( mask, stemp )) return 1;   /* we don't require a period */
    10771078
  • TabularUnified trunk/src/shlwapi/reg.c

    r4081 r5618  
    11/*
    22 * SHLWAPI registry functions
    3  * Note: Odin changes marked by __WIN32OS2__
    4  */
    5 
     3 */
     4
     5#include <string.h>
    66#include "windef.h"
     7#include "winbase.h"
     8#include "wingdi.h"
     9#include "winuser.h"
    710#include "winerror.h"
    811#include "winreg.h"
    9 #include "wine/undocshell.h"
    1012#include "debugtools.h"
     13#include "shlwapi.h"
     14#include "wine/unicode.h"
    1115
    1216DEFAULT_DEBUG_CHANNEL(shell);
     17
     18static const char *lpszContentTypeA = "Content Type";
     19static const WCHAR lpszContentTypeW[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'};
    1320
    1421/*************************************************************************
     
    5057}
    5158
     59/*************************************************************************
     60 * SHRegOpenUSKeyA      [SHLWAPI.@]
     61 *
     62 * Openss a user-specific registry key
     63 */
     64LONG WINAPI SHRegOpenUSKeyA(
     65        LPCSTR Path,
     66        REGSAM AccessType,
     67        HKEY hRelativeUSKey,
     68        HKEY hNewUSKey,
     69        BOOL fIgnoreHKCU)
     70{
     71        FIXME("stub!\n");
     72        return ERROR_SUCCESS;  /* return success */
     73}
     74
     75/*************************************************************************
     76 * SHRegOpenUSKeyW      [SHLWAPI.@]
     77 *
     78 * Openss a user-specific registry key
     79 */
     80LONG WINAPI SHRegOpenUSKeyW(
     81        LPCSTR Path,
     82        REGSAM AccessType,
     83        HKEY hRelativeUSKey,
     84        HKEY hNewUSKey,
     85        BOOL fIgnoreHKCU)
     86{
     87        FIXME("stub!\n");
     88        return ERROR_SUCCESS;  /* return success */
     89}
     90
    5291#ifndef __WIN32OS2__
    5392/*************************************************************************
     
    82121 */
    83122LONG WINAPI SHRegQueryUSValueA(
    84         HKEY/*HUSKEY*/ hUSKey,
     123        HKEY hUSKey,             /* [in] FIXME: HUSKEY */
    85124        LPCSTR pszValue,
    86125        LPDWORD pdwType,
     
    96135
    97136/*************************************************************************
     137 *      SHRegQueryUSValueA      [SHLWAPI]
     138 */
     139LONG WINAPI SHRegQueryUSValueW(
     140        HKEY hUSKey,             /* [in] FIXME: HUSKEY */
     141        LPCSTR pszValue,
     142        LPDWORD pdwType,
     143        void *pvData,
     144        LPDWORD pcbData,
     145        BOOL fIgnoreHKCU,
     146        void *pvDefaultData,
     147        DWORD dwDefaultDataSize)
     148{
     149        FIXME("%s stub\n",pszValue);
     150        return 1;
     151}
     152
     153/*************************************************************************
    98154 * SHRegGetPathA   [SHLWAPI.@]
    99155 */
     
    138194        HKEY hSubKey;
    139195        DWORD res;
    140        
     196
    141197        TRACE("(%s %s)\n", pSubKey, pValue);
    142        
     198
    143199        if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
    144200        res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
    145201        RegCloseKey( hSubKey );
    146        
     202
    147203        return res;
    148204}
     
    163219        HKEY hSubKey;
    164220        DWORD res;
    165        
     221
    166222        TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
    167        
     223
    168224        if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
    169225        res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
    170226        RegCloseKey( hSubKey );
    171        
     227
    172228        return res;
    173229}
     
    176232 *      SHSetValueA   [SHLWAPI.@]
    177233 */
    178 DWORD WINAPI SHSetValueA(
     234HRESULT WINAPI SHSetValueA(
    179235        HKEY hkey,
    180236        LPCSTR pszSubKey,
     
    184240        DWORD cbData)
    185241{
    186         FIXME("(%s %s)stub\n",pszSubKey, pszValue);
    187         return 1;
     242    HKEY        subkey;
     243    HRESULT     hres;
     244
     245    hres = RegCreateKeyA(hkey,pszSubKey,&subkey);
     246    if (!hres)
     247        return hres;
     248    hres = RegSetValueExA(subkey,pszValue,0,dwType,pvData,cbData);
     249    RegCloseKey(subkey);
     250    return hres;
     251}
     252
     253/*************************************************************************
     254 *      SHSetValueW   [SHLWAPI.@]
     255 */
     256HRESULT WINAPI SHSetValueW(
     257        HKEY hkey,
     258        LPCWSTR pszSubKey,
     259        LPCWSTR pszValue,
     260        DWORD dwType,
     261        LPCVOID pvData,
     262        DWORD cbData)
     263{
     264    HKEY        subkey;
     265    HRESULT     hres;
     266
     267    hres = RegCreateKeyW(hkey,pszSubKey,&subkey);
     268    if (!hres)
     269        return hres;
     270    hres = RegSetValueExW(subkey,pszValue,0,dwType,pvData,cbData);
     271    RegCloseKey(subkey);
     272    return hres;
    188273}
    189274
     
    210295 * FIXME
    211296 *  if the datatype REG_EXPAND_SZ then expand the string and change
    212  *  *pdwType to REG_SZ. 
     297 *  *pdwType to REG_SZ.
    213298 */
    214299HRESULT WINAPI SHQueryValueExW (
     
    227312/*************************************************************************
    228313 * SHDeleteKeyA   [SHLWAPI.@]
     314 *
     315 * It appears this function is made available to account for the differences
     316 * between the Win9x and WinNT/2k RegDeleteKeyA functions.
     317 *
     318 * According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
     319 * WinNt/2k will only delete the key if empty.
    229320 */
    230321HRESULT WINAPI SHDeleteKeyA(
    231         HKEY hkey,
    232         LPCSTR pszSubKey)
    233 {
    234         FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
    235         return 0;
     322        HKEY hKey,
     323        LPCSTR lpszSubKey)
     324{
     325    DWORD r, dwKeyCount, dwSize, i, dwMaxSubkeyLen;
     326    HKEY hSubKey;
     327    LPSTR lpszName;
     328
     329    TRACE("hkey=0x%08x, %s\n", hKey, debugstr_a(lpszSubKey));
     330
     331    hSubKey = 0;
     332    r = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
     333    if(r != ERROR_SUCCESS)
     334        return r;
     335
     336    /* find how many subkeys there are */
     337    dwKeyCount = 0;
     338    dwMaxSubkeyLen = 0;
     339    r = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
     340                    &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL);
     341    if(r != ERROR_SUCCESS)
     342    {
     343        RegCloseKey(hSubKey);
     344        return r;
     345    }
     346
     347    /* alloc memory for the longest string terminating 0 */
     348    dwMaxSubkeyLen++;
     349    lpszName = HeapAlloc(GetProcessHeap(), 0, dwMaxSubkeyLen*sizeof(CHAR));
     350    if(!lpszName)
     351    {
     352        RegCloseKey(hSubKey);
     353        return ERROR_NOT_ENOUGH_MEMORY;
     354    }
     355
     356    /* recursively delete all the subkeys */
     357    for(i=0; i<dwKeyCount; i++)
     358    {
     359        dwSize = dwMaxSubkeyLen;
     360        r = RegEnumKeyExA(hSubKey, i, lpszName, &dwSize, NULL, NULL, NULL, NULL);
     361        if(r != ERROR_SUCCESS)
     362            break;
     363        r = SHDeleteKeyA(hSubKey, lpszName);
     364        if(r != ERROR_SUCCESS)
     365            break;
     366    }
     367
     368    HeapFree(GetProcessHeap(), 0, lpszName);
     369
     370    RegCloseKey(hSubKey);
     371
     372    if(r == ERROR_SUCCESS)
     373        r = RegDeleteKeyA(hKey, lpszSubKey);
     374
     375    return r;
    236376}
    237377
    238378/*************************************************************************
    239379 * SHDeleteKeyW   [SHLWAPI.@]
     380 *
     381 * It appears this function is made available to account for the differences
     382 * between the Win9x and WinNT/2k RegDeleteKeyA functions.
     383 *
     384 * According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
     385 * WinNt/2k will only delete the key if empty.
    240386 */
    241387HRESULT WINAPI SHDeleteKeyW(
     
    246392        return 0;
    247393}
     394
     395/*************************************************************************
     396 * SHDeleteValueA   [SHLWAPI.@]
     397 *
     398 * Function opens the key, get/set/delete the value, then close the key.
     399 */
     400HRESULT WINAPI SHDeleteValueA(HKEY hkey, LPCSTR pszSubKey, LPCSTR pszValue) {
     401    HKEY        subkey;
     402    HRESULT     hres;
     403
     404    hres = RegOpenKeyA(hkey,pszSubKey,&subkey);
     405    if (hres)
     406        return hres;
     407    hres = RegDeleteValueA(subkey,pszValue);
     408    RegCloseKey(subkey);
     409    return hres;
     410}
     411
     412/*************************************************************************
     413 * SHDeleteValueW   [SHLWAPI.@]
     414 *
     415 * Function opens the key, get/set/delete the value, then close the key.
     416 */
     417HRESULT WINAPI SHDeleteValueW(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue) {
     418    HKEY        subkey;
     419    HRESULT     hres;
     420
     421    hres = RegOpenKeyW(hkey,pszSubKey,&subkey);
     422    if (hres)
     423        return hres;
     424    hres = RegDeleteValueW(subkey,pszValue);
     425    RegCloseKey(subkey);
     426    return hres;
     427}
     428
     429/*************************************************************************
     430 * SHDeleteEmptyKeyA   [SHLWAPI.@]
     431 *
     432 * It appears this function is made available to account for the differences
     433 * between the Win9x and WinNT/2k RegDeleteKeyA functions.
     434 *
     435 * According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
     436 * WinNt/2k will only delete the key if empty.
     437 */
     438DWORD WINAPI SHDeleteEmptyKeyA(HKEY hKey, LPCSTR lpszSubKey)
     439{
     440    DWORD r, dwKeyCount;
     441    HKEY hSubKey;
     442
     443    TRACE("hkey=0x%08x, %s\n", hKey, debugstr_a(lpszSubKey));
     444
     445    hSubKey = 0;
     446    r = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
     447    if(r != ERROR_SUCCESS)
     448        return r;
     449
     450    dwKeyCount = 0;
     451    r = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
     452                    NULL, NULL, NULL, NULL, NULL, NULL, NULL);
     453    if(r != ERROR_SUCCESS)
     454        return r;
     455
     456    RegCloseKey(hSubKey);
     457
     458    if(dwKeyCount)
     459        return ERROR_KEY_HAS_CHILDREN;
     460
     461    r = RegDeleteKeyA(hKey, lpszSubKey);
     462
     463    return r;
     464}
     465
     466/*************************************************************************
     467 * SHDeleteEmptyKeyW   [SHLWAPI.@]
     468 *
     469 * It appears this function is made available to account for the differences
     470 * between the Win9x and WinNT/2k RegDeleteKeyA functions.
     471 *
     472 * According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
     473 * WinNt/2k will only delete the key if empty.
     474 */
     475DWORD WINAPI SHDeleteEmptyKeyW(HKEY hKey, LPCWSTR lpszSubKey)
     476{
     477    FIXME("hkey=0x%08x, %s\n", hKey, debugstr_w(lpszSubKey));
     478    return 0;
     479}
     480
     481/*************************************************************************
     482 * SHLWAPI_205   [SHLWAPI.205]
     483 *
     484 * Wrapper for SHGetValueA in case machine is in safe mode.
     485 */
     486DWORD WINAPI SHLWAPI_205(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue,
     487                         LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
     488{
     489  if (GetSystemMetrics(SM_CLEANBOOT))
     490    return ERROR_INVALID_FUNCTION;
     491  return SHGetValueA(hkey, pSubKey, pValue, pwType, pvData, pbData);
     492}
     493
     494/*************************************************************************
     495 * SHLWAPI_206   [SHLWAPI.206]
     496 *
     497 * Unicode version of SHLWAPI_205.
     498 */
     499DWORD WINAPI SHLWAPI_206(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue,
     500                         LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
     501{
     502  if (GetSystemMetrics(SM_CLEANBOOT))
     503    return ERROR_INVALID_FUNCTION;
     504  return SHGetValueW(hkey, pSubKey, pValue, pwType, pvData, pbData);
     505}
     506
     507/*************************************************************************
     508 * SHLWAPI_320   [SHLWAPI.320]
     509 *
     510 */
     511BOOL WINAPI SHLWAPI_320(LPCSTR lpszSubKey, LPCSTR lpszValue)
     512{
     513  DWORD dwLen = strlen(lpszValue);
     514  HRESULT ret = SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
     515                            REG_SZ, lpszValue, dwLen);
     516  return ret ? FALSE : TRUE;
     517}
     518
     519/*************************************************************************
     520 * SHLWAPI_321   [SHLWAPI.321]
     521 *
     522 * Unicode version of SHLWAPI_320.
     523 */
     524BOOL WINAPI SHLWAPI_321(LPCWSTR lpszSubKey, LPCWSTR lpszValue)
     525{
     526  DWORD dwLen = strlenW(lpszValue);
     527  HRESULT ret = SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
     528                            REG_SZ, lpszValue, dwLen);
     529  return ret ? FALSE : TRUE;
     530}
     531
     532/*************************************************************************
     533 * SHLWAPI_322   [SHLWAPI.322]
     534 *
     535 */
     536BOOL WINAPI SHLWAPI_322(LPCSTR lpszSubKey)
     537{
     538  HRESULT ret = SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA);
     539  return ret ? FALSE : TRUE;
     540}
     541
     542/*************************************************************************
     543 * SHLWAPI_323   [SHLWAPI.323]
     544 *
     545 * Unicode version of SHLWAPI_322.
     546 */
     547BOOL WINAPI SHLWAPI_323(LPCWSTR lpszSubKey)
     548{
     549  HRESULT ret = SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW);
     550  return ret ? FALSE : TRUE;
     551}
     552
  • TabularUnified trunk/src/shlwapi/shlwapi.def

    r4809 r5618  
    1 ; $Id: shlwapi.def,v 1.19 2000-12-16 22:53:44 bird Exp $
     1; $Id: shlwapi.def,v 1.20 2001-04-28 13:32:20 sandervl Exp $
    22
    33; updated export ordinals to NT4 SP6 version of SHLWAPI.DLL
     
    1919
    2020
    21                              _SHLWAPI_1@8                         @1
    22                              _SHLWAPI_2@8                         @2
    23                              _SHLWAPI_3@8                         @3
    24                              _SHLWAPI_4@8                         @4
    25                              _SHLWAPI_5@12                        @5
    26                              _SHLWAPI_6@12                        @6
    27                              _SHLWAPI_7@12                        @7
    28                              _SHLWAPI_8@8                         @8
    29                              _SHLWAPI_9@4                         @9
    30                              _SHLWAPI_10@8                        @10
    31                              _SHLWAPI_11@20                       @11
    32                              _SHLWAPI_12@8                        @12
    33                              _SHLWAPI_13@8                        @13
    34                              _SHLWAPI_14@8                        @14
    35                              _SHLWAPI_15@8                        @15
     21                             _SHLWAPI_1@8                         @1  NONAME
     22                             _SHLWAPI_2@8                         @2  NONAME
     23                             _SHLWAPI_3@8                         @3  NONAME
     24                             _SHLWAPI_4@8                         @4  NONAME
     25                             _SHLWAPI_5@12                        @5  NONAME
     26                             _SHLWAPI_6@12                        @6  NONAME
     27                             _SHLWAPI_7@12                        @7  NONAME
     28                             _SHLWAPI_8@8                         @8  NONAME
     29                             _SHLWAPI_9@4                         @9  NONAME
     30                             _SHLWAPI_10@8                        @10 NONAME
     31                             _SHLWAPI_11@20                       @11 NONAME
     32                             _SHLWAPI_12@8                        @12 NONAME
     33                             _SHLWAPI_13@8                        @13 NONAME
     34                             _SHLWAPI_14@8                        @14 NONAME
     35                             _SHLWAPI_15@8                        @15 NONAME
    3636    SHCreateThread         = _SHCreateThread@16                   @16
    37                              _SHLWAPI_17@8                        @17
    38                              _SHLWAPI_18@8                        @18
    39                              _SHLWAPI_19@4                        @19
    40                              _SHLWAPI_20@8                        @20
    41                              _SHLWAPI_21@8                        @21
    42                              _SHLWAPI_22@8                        @22
    43                              _SHLWAPI_23@12                       @23
    44                              _SHLWAPI_24@12                       @24
    45                              _SHLWAPI_28@4                        @28
    46                              _SHLWAPI_30@4                        @30
    47 
    48                              _CallWindowProcW@20                  @37
    49                              _CharLowerW@4                        @38
    50                              _CharLowerBuffW@8                    @39
    51                              _CharNextW@4                         @40
    52                              _CharPrevW@8                         @41
    53                              _CharToOemW@8                        @42
    54                              _CharUpperW@4                        @43
    55                              _CharUpperBuffW@8                    @44
    56                              _CompareStringW@24                   @45
    57                              _CopyAcceleratorTableW@12            @46
    58                              _CreateAcceleratorTableW@8           @47
    59                              _CreateDCW@16                        @48
    60                              _CreateDialogParamW@20               @49 ; @@@PH imcomplete
    61                              _CreateDirectoryW@8                  @50
    62                              _CreateEventW@16                     @51
    63                              _CreateFileW@28                      @52
    64                              _CreateFontIndirectW@4               @53
    65                              _CreateICW@16                        @54
    66                              _CreateWindowExW@48                  @55
    67                              _DefWindowProcW@16                   @56
    68                              _DeleteFileW@4                       @57
    69                              _DialogBoxIndirectParamW@20          @58 ; @@@PH imcomplete
    70                              _DialogBoxParamW@20                  @59 ; @@@PH imcomplete
    71                              _DispatchMessageW@4                  @60
    72                              _DrawTextW@20                        @61
    73                              _EnumFontFamiliesW@16                @62
    74                              _EnumFontFamiliesExW@20              @63
    75                              _EnumResourceNamesW@16               @64
    76                              _FindFirstFileW@8                    @65
    77                              _FindResourceW@12                    @66
    78                              _FindWindowW@8                       @67
    79                              _FormatMessageW@28                   @68
    80                              _GetClassInfoW@12                    @69
    81                              _GetClassLongW@8                     @70
    82                              _GetClassNameW@12                    @71
    83                              _GetClipboardFormatNameW@12          @72
    84                              _GetCurrentDirectoryW@8              @73
    85                              _GetDlgItemTextW@16                  @74
    86                              _GetFileAttributesW@4                @75
    87                              _GetFullPathNameW@16                 @76
    88                              _GetLocaleInfoW@16                   @77
    89                              _GetMenuItemInfoW@16                 @78
    90                              _GetMessageW@16                      @79
    91                              _GetModuleFileNameW@12               @80
    92                              _GetSystemDirectoryW@8               @81
    93                              _SearchPathW@24                      @82
    94                              _GetModuleHandleW@4                  @83
    95                              _GetObjectW@12                       @84
    96                              _GetPrivateProfileIntW@16            @85
    97                              _GetProfileStringW@20                @86
    98                              _GetPropW@8                          @87
    99                              _GetStringTypeExW@20                 @88
    100                              _GetTempFileNameW@16                 @89
    101                              _GetTempPathW@8                      @90
    102                              _GetTextExtentPoint32W@16            @91
    103                              _GetTextFaceW@12                     @92
    104                              _GetTextMetricsW@8                   @93
    105                              _GetWindowLongW@8                    @94
    106                              _GetWindowTextW@12                   @95
    107                              _GetWindowTextLengthW@4              @96
    108                              _GetWindowsDirectoryW@8              @97
    109                              _InsertMenuW@20                      @98 ; @@@PH incomplete
    110                              _IsDialogMessageW@8                  @99
    111                              _LoadAcceleratorsW@8                 @100
    112                              _LoadBitmapW@8                       @101
    113                              _LoadCursorW@8                       @102
    114                              _LoadIconW@8                         @103
    115                              _LoadImageW@24                       @104
    116                              _LoadLibraryExW@12                   @105
    117                              _LoadMenuW@8                         @106
    118                              _LoadStringW@16                      @107
    119                              _MessageBoxIndirectW@4               @108
    120                              _ModifyMenuW@20                      @109
    121                              _GetCharWidth32W@16                  @110
    122                              _GetCharacterPlacementW@24           @111
    123                              _CopyFileW@12                        @112
    124                              _MoveFileW@8                         @113
    125                              _OemToCharW@8                        @114
    126                              _OutputDebugStringW@4                @115
    127                              _PeekMessageW@20                     @116
    128                              _PostMessageW@16                     @117
    129                              _PostThreadMessageW@16               @118
    130                              _RegCreateKeyW@12                    @119
    131                              _RegCreateKeyExW@36                  @120
    132                              _RegDeleteKeyW@8                     @121
    133                              _RegEnumKeyW@16                      @122
    134                              _RegEnumKeyExW@32                    @123
    135                              _RegOpenKeyW@12                      @124
    136                              _RegOpenKeyExW@20                    @125
    137                              _RegQueryInfoKeyW@48                 @126
    138                              _RegQueryValueW@16                   @127
    139                              _RegQueryValueExW@24                 @128
    140                              _RegSetValueW@20                     @129
    141                              _RegSetValueExW@24                   @130
    142                              _RegisterClassW@4                    @131
    143                              _RegisterClipboardFormatW@4          @132
    144                              _RegisterWindowMessageW@4            @133
    145                              _RemovePropW@8                       @134
    146                              _SendDlgItemMessageW@20              @135
    147                              _SendMessageW@16                     @136
    148                              _SetCurrentDirectoryW@4              @137
     37                             _SHLWAPI_17@8                        @17 NONAME
     38                             _SHLWAPI_18@8                        @18 NONAME
     39                             _SHLWAPI_19@4                        @19 NONAME
     40                             _SHLWAPI_20@8                        @20 NONAME
     41                             _SHLWAPI_21@8                        @21 NONAME
     42                             _SHLWAPI_22@8                        @22 NONAME
     43                             _SHLWAPI_23@12                       @23 NONAME
     44                             _SHLWAPI_24@12                       @24 NONAME
     45                             _SHLWAPI_28@4                        @28 NONAME
     46                             _SHLWAPI_30@4                        @30 NONAME
     47                             _SHLWAPI_32@4                        @32 NONAME
     48                             _CallWindowProcW@20                  @37 NONAME
     49                             _CharLowerW@4                        @38 NONAME
     50                             _CharLowerBuffW@8                    @39 NONAME
     51                             _CharNextW@4                         @40 NONAME
     52                             _CharPrevW@8                         @41 NONAME
     53                             _CharToOemW@8                        @42 NONAME
     54                             _CharUpperW@4                        @43 NONAME
     55                             _CharUpperBuffW@8                    @44 NONAME
     56                             _CompareStringW@24                   @45 NONAME
     57                             _CopyAcceleratorTableW@12            @46 NONAME
     58                             _CreateAcceleratorTableW@8           @47 NONAME
     59                             _CreateDCW@16                        @48 NONAME
     60                             _CreateDialogParamW@20               @49 NONAME ; @@@PH imcomplete
     61                             _CreateDirectoryW@8                  @50 NONAME
     62                             _CreateEventW@16                     @51 NONAME
     63                             _CreateFileW@28                      @52 NONAME
     64                             _CreateFontIndirectW@4               @53 NONAME
     65                             _CreateICW@16                        @54 NONAME
     66                             _CreateWindowExW@48                  @55 NONAME
     67                             _DefWindowProcW@16                   @56 NONAME
     68                             _DeleteFileW@4                       @57 NONAME
     69                             _DialogBoxIndirectParamW@20          @58 NONAME ; @@@PH imcomplete
     70                             _DialogBoxParamW@20                  @59 NONAME ; @@@PH imcomplete
     71                             _DispatchMessageW@4                  @60 NONAME
     72                             _DrawTextW@20                        @61 NONAME
     73                             _EnumFontFamiliesW@16                @62 NONAME
     74                             _EnumFontFamiliesExW@20              @63 NONAME
     75                             _EnumResourceNamesW@16               @64 NONAME
     76                             _FindFirstFileW@8                    @65 NONAME
     77                             _FindResourceW@12                    @66 NONAME
     78                             _FindWindowW@8                       @67 NONAME
     79                             _FormatMessageW@28                   @68 NONAME
     80                             _GetClassInfoW@12                    @69 NONAME
     81                             _GetClassLongW@8                     @70 NONAME
     82                             _GetClassNameW@12                    @71 NONAME
     83                             _GetClipboardFormatNameW@12          @72 NONAME
     84                             _GetCurrentDirectoryW@8              @73 NONAME
     85                             _SHLWAPI_74@16                       @74 NONAME
     86                             _GetFileAttributesW@4                @75  NONAME
     87                             _GetFullPathNameW@16                 @76 NONAME
     88                             _GetLocaleInfoW@16                   @77 NONAME
     89                             _GetMenuItemInfoW@16                 @78 NONAME
     90                             _GetMessageW@16                      @79 NONAME
     91                             _GetModuleFileNameW@12               @80 NONAME
     92                             _GetSystemDirectoryW@8               @81 NONAME
     93                             _SearchPathW@24                      @82 NONAME
     94                             _GetModuleHandleW@4                  @83 NONAME
     95                             _GetObjectW@12                       @84 NONAME
     96                             _GetPrivateProfileIntW@16            @85 NONAME
     97                             _GetProfileStringW@20                @86 NONAME
     98                             _GetPropW@8                          @87 NONAME
     99                             _GetStringTypeExW@20                 @88 NONAME
     100                             _GetTempFileNameW@16                 @89 NONAME
     101                             _GetTempPathW@8                      @90 NONAME
     102                             _GetTextExtentPoint32W@16            @91 NONAME
     103                             _GetTextFaceW@12                     @92 NONAME
     104                             _GetTextMetricsW@8                   @93 NONAME
     105                             _GetWindowLongW@8                    @94 NONAME
     106                             _GetWindowTextW@12                   @95 NONAME
     107                             _GetWindowTextLengthW@4              @96 NONAME
     108                             _GetWindowsDirectoryW@8              @97 NONAME
     109                             _InsertMenuW@20                      @98 NONAME
     110                             _IsDialogMessageW@8                  @99 NONAME
     111                             _LoadAcceleratorsW@8                 @100 NONAME
     112                             _LoadBitmapW@8                       @101 NONAME
     113                             _LoadCursorW@8                       @102 NONAME
     114                             _LoadIconW@8                         @103 NONAME
     115                             _LoadImageW@24                       @104 NONAME
     116                             _LoadLibraryExW@12                   @105 NONAME
     117                             _LoadMenuW@8                         @106 NONAME
     118                             _LoadStringW@16                      @107 NONAME
     119                             _MessageBoxIndirectW@4               @108 NONAME
     120                             _ModifyMenuW@20                      @109 NONAME
     121                             _GetCharWidth32W@16                  @110 NONAME
     122                             _GetCharacterPlacementW@24           @111 NONAME
     123                             _CopyFileW@12                        @112 NONAME
     124                             _MoveFileW@8                         @113 NONAME
     125                             _OemToCharW@8                        @114 NONAME
     126                             _OutputDebugStringW@4                @115 NONAME
     127                             _PeekMessageW@20                     @116 NONAME
     128                             _PostMessageW@16                     @117 NONAME
     129                             _PostThreadMessageW@16               @118 NONAME
     130                             _RegCreateKeyW@12                    @119 NONAME
     131                             _RegCreateKeyExW@36                  @120 NONAME
     132                             _RegDeleteKeyW@8                     @121 NONAME
     133                             _RegEnumKeyW@16                      @122 NONAME
     134                             _RegEnumKeyExW@32                    @123 NONAME
     135                             _RegOpenKeyW@12                      @124 NONAME
     136                             _RegOpenKeyExW@20                    @125 NONAME
     137                             _RegQueryInfoKeyW@48                 @126 NONAME
     138                             _RegQueryValueW@16                   @127 NONAME
     139                             _RegQueryValueExW@24                 @128 NONAME
     140                             _RegSetValueW@20                     @129 NONAME
     141                             _RegSetValueExW@24                   @130 NONAME
     142                             _RegisterClassW@4                    @131 NONAME
     143                             _RegisterClipboardFormatW@4          @132 NONAME
     144                             _RegisterWindowMessageW@4            @133 NONAME
     145                             _RemovePropW@8                       @134 NONAME
     146                             _SendDlgItemMessageW@20              @135 NONAME
     147                             _SendMessageW@16                     @136 NONAME
     148                             _SetCurrentDirectoryW@4              @137 NONAME
    149149                             _SetDlgItemTextW@12                  @138
    150150                             _SetMenuItemInfoW@16                 @139 ; @@@PH imcomplete
    151                              _SetPropW@12                         @140
    152                              _SetWindowLongW@12                   @141
    153                              _SetWindowsHookExW@16                @142
    154                              _SetWindowTextW@8                    @143
    155                              _StartDocW@8                         @144
    156                              _SystemParametersInfoW@16            @145
    157                              _TranslateAcceleratorW@12            @146
    158                              _UnregisterClassW@8                  @147
    159                              _VkKeyScanW@4                        @148
    160                              _WinHelpW@16                         @149
    161                              _wvsprintfW@12                       @150
    162 
    163                              _SHLWAPI_156@8                       @156
    164                              _SHLWAPI_158@8                       @158
    165                              _SHLWAPI_160@8                       @160
    166                              _SHLWAPI_169@4                       @169
    167                              _SHLWAPI_170@4                       @170
    168                              _SHLWAPI_185@24                      @185
    169                              _SHLWAPI_191@24                      @191
    170                              _SHLWAPI_193@0                       @193
    171                              _SHLWAPI_197@12                      @197
    172                              _SHLWAPI_219@16                      @219
    173                              _SHLWAPI_222@4                       @222
    174                              _SHLWAPI_223@4                       @223
    175                              _SHLWAPI_237@4                       @237
    176                              _SHLWAPI_240@16                      @240
    177                              _SHLWAPI_241@0                       @241
    178                              _SHLWAPI_243@20                      @243
    179 ;   AssocCreate            = _AssocCreate@20                      @253
    180 ;   AssocQueryKeyA         = _AssocQueryKeyA@20                   @254
    181                              _SHLWAPI_266@16                      @266
    182                              _SHLWAPI_267@16                      @267
    183                              _SHLWAPI_268@8                       @268
    184                              _SHLWAPI_276@0                       @276
    185                              _SHLWAPI_309@4                       @309
    186                              _RegisterClassExW@4                  @314
    187                              _CallMsgFilterW@8                    @332
    188                              _FindNextFileW@8                     @341
    189                              _SHLWAPI_342@16                      @342
    190                              _SHLWAPI_346@12                      @346
    191                              _SHLWAPI_364@12                      @364
    192                              _SHLWAPI_376@0                       @376
    193                              _SHLWAPI_377@12                      @377
     151                             _SetPropW@12                         @140 NONAME
     152                             _SetWindowLongW@12                   @141 NONAME
     153                             _SetWindowsHookExW@16                @142 NONAME
     154                             _SetWindowTextW@8                    @143 NONAME
     155                             _StartDocW@8                         @144 NONAME
     156                             _SystemParametersInfoW@16            @145 NONAME
     157                             _TranslateAcceleratorW@12            @146 NONAME
     158                             _UnregisterClassW@8                  @147 NONAME
     159                             _VkKeyScanW@4                        @148 NONAME
     160                             _WinHelpW@16                         @149 NONAME
     161                             _wvsprintfW@12                       @150 NONAME
     162                             _SHLWAPI_151@0                       @151 NONAME
     163                             _SHLWAPI_152@12                      @152 NONAME
     164                             _SHLWAPI_153@12                      @153 NONAME
     165
     166                             _SHLWAPI_156@8                       @156 NONAME
     167                             _SHLWAPI_158@8                       @158 NONAME
     168                             _CompareStringW@24                   @159 NONAME
     169                             _SHLWAPI_160@8                       @160 NONAME
     170                             _SHLWAPI_162@8                       @162 NONAME
     171                             _SHLWAPI_165@16                      @165 NONAME
     172                             _SHLWAPI_169@4                       @169 NONAME
     173                             _SHLWAPI_170@4                       @170 NONAME
     174                             _SHLWAPI_181@12                      @181 NONAME
     175                             _SHLWAPI_183@4                       @183 NONAME
     176                             _SHLWAPI_185@24                      @185 NONAME
     177                             _SHLWAPI_191@24                      @191 NONAME
     178                             _SHLWAPI_193@0                       @193 NONAME
     179                             _SHLWAPI_197@12                      @197 NONAME
     180                             _SHLWAPI_205@24                      @205 NONAME
     181                             _SHLWAPI_206@24                      @206 NONAME
     182                             _SHLWAPI_215@12                      @215 NONAME
     183                             _SHLWAPI_217@12                      @217 NONAME
     184                             _SHLWAPI_218@16                      @218 NONAME
     185                             _SHLWAPI_219@16                      @219 NONAME
     186                             _SHLWAPI_222@4                       @222 NONAME
     187                             _SHLWAPI_223@4                       @223 NONAME
     188                             _SHLWAPI_237@4                       @237 NONAME
     189                             _SHLWAPI_240@16                      @240 NONAME
     190                             _SHLWAPI_241@0                       @241 NONAME
     191                             _SHLWAPI_243@20                      @243 NONAME
     192;   AssocCreate            = _AssocCreate@20                      @253 ;by name
     193;   AssocQueryKeyA         = _AssocQueryKeyA@20                   @254 ;by name
     194;   AssocQueryKeyW         = _AssocQueryKeyW@20                   @255 ;by name
     195                             _SHLWAPI_266@16                      @266 NONAME
     196                             _SHLWAPI_267@16                      @267 NONAME
     197                             _SHLWAPI_268@8                       @268 NONAME
     198                             _SHLWAPI_276@0                       @276 NONAME
     199                             _SHLWAPI_278@24                      @278 NONAME
     200                             _WritePrivateProfileStringW@16       @298 NONAME
     201
     202                             _DrawTextExW@24                      @301 NONAME
     203                             _GetMenuItemInfoW@16                 @302 NONAME ; FIXME CreateFontW
     204                             _InsertMenuItemW@16                  @303 NONAME
     205                             _CreateMetaFileW@4                   @304 NONAME
     206                             _CreateMutexW@12                     @305 NONAME
     207                             _ExpandEnvironmentStringsW@12        @306 NONAME
     208                             _CreateSemaphoreW@16                 @307 NONAME
     209                             _IsBadStringPtrW@8                   @308 NONAME
     210                             _LoadLibraryW@4                      @309 NONAME
     211                             _GetTimeFormatW@24                   @310 NONAME
     212                             _GetDateFormatW@24                   @311 NONAME
     213                             _GetPrivateProfileStringW@24         @312 NONAME
     214                             _SHLWAPI_313@20                      @313 NONAME
     215                             _RegisterClassExW@4                  @314 NONAME
     216                             _GetClassInfoExW@12                  @315 NONAME
     217
     218                             _SHLWAPI_318@16                      @318 NONAME
     219                             _FindWindowExW@16                    @319 NONAME
     220
     221                             _SHLWAPI_320@8                       @320 NONAME
     222                             _SHLWAPI_321@8                       @321 NONAME
     223                             _SHLWAPI_322@4                       @322 NONAME
     224                             _SHLWAPI_323@4                       @323 NONAME
     225
     226                             _CallMsgFilterW@8                    @332 NONAME
     227                             _SHLWAPI_333@4                       @333 NONAME
     228                             _SHLWAPI_334@8                       @334 NONAME
     229                             _SHLWAPI_335@4                       @335 NONAME
     230                             _SHLWAPI_336@4                       @336 NONAME
     231                             _SHLWAPI_337@20                      @337 NONAME
     232                             _SetFileAttributesW@8                @338 NONAME
     233                             _GetNumberFormatW@24                 @339 NONAME
     234                             _MessageBoxW@16                      @340 NONAME
     235                             _FindNextFileW@8                     @341 NONAME
     236                             _SHLWAPI_342@16                      @342 NONAME
     237                             _SHLWAPI_346@12                      @346 NONAME
     238                             _RegDeleteValueW@8                   @347 NONAME
     239
     240                             _SHLWAPI_357@20                      @357 NONAME
     241                             _SHLWAPI_358@24                      @358 NONAME
     242                             _OpenEventW@12                       @359 NONAME
     243                             _RemoveDirectoryW@4                  @360 NONAME
     244                             _GetShortPathNameW@12                @361 NONAME
     245
     246                             _SHLWAPI_364@12                      @364 NONAME
     247                     
     248                             _RegEnumValueW@32                    @366 NONAME
     249                             _WritePrivateProfileStructW@20       @367 NONAME
     250                             _GetPrivateProfileStructW@20         @368 NONAME
     251                             _CreateProcessW@40                   @369 NONAME
     252                             _SHLWAPI_370@12                      @370 NONAME
     253
     254                             _SHLWAPI_364@12                      @364 NONAME
     255                             _SHLWAPI_376@0                       @376 NONAME ;kernel32.GetUserDefaultUILanguage
     256                             _SHLWAPI_377@12                      @377 NONAME
     257                             _SHLWAPI_378@12                      @378 NONAME
     258
    194259;   AssocQueryStringA      = _AssocQueryStringA@20                @381
    195260;   AssocQueryStringByKeyA = _AssocQueryStringByKeyA@20           @382
    196261    ChrCmpIA               = _ChrCmpIA@8                          @385
    197   ; ChrCmpIW               = _ChrCmpIW@?                          @386
    198 
    199 ;                            _SHLWAPI_407@16                      @407
    200 ;                            _SHLWAPI_408@16                      @408
    201 ;                            _SHLWAPI_409@12                      @409
    202 ;                            _SHLWAPI_410@12                      @410
    203 
    204                              _SHLWAPI_437@4                       @437
     262  ; ChrCmpIW               = _ChrCmpIW@8                          @386
     263
     264                             _SHLWAPI_389@4                       @389 NONAME
     265                             _SHLWAPI_390@8                       @390 NONAME
     266                             _SHLWAPI_391@20                      @391 NONAME
     267
     268                             _SHLWAPI_401@4                       @401 NONAME
     269                             _SHLWAPI_402@4                       @402 NONAME
     270                             _SHLWAPI_403@4                       @403 NONAME
     271    ColorHLSToRGB          = _ColorHLSToRGB@12                    @404 NONAME
     272
     273;                            _SHLWAPI_407@16                      @407 NONAME
     274;                            _SHLWAPI_408@16                      @408 NONAME
     275;                            _SHLWAPI_409@12                      @409 NONAME
     276;                            _SHLWAPI_410@12                      @410 NONAME
     277
     278                             _SHLWAPI_431@4                       @431 NONAME
     279
     280                             _SendMessageTimeoutW@28              @434 NONAME
     281
     282                             _SHLWAPI_437@4                       @437 NONAME
     283         
     284                             _GetEnvironmentVariableW@12          @442 NONAME
     285                             _GetSystemWindowsDirectoryA@8        @443 NONAME
     286                             _GetSystemWindowsDirectoryW@8        @444 NONAME
     287  ; ColorRGBToHLS @445
     288
    205289    DllGetVersion          = _DllGetVersion@4                     @446
    206   ; GetMenuPosFromID       = _GetMenuPosFromID@?                  @447
    207 ;   HashData               = _HashData@16                         @448
     290    GetMenuPosFromID       = _GetMenuPosFromID@8                  @447
     291    HashData               = _HashData@16                         @448
    208292  ; IntlStrEqWorkerA       = _StrIsIntlEqualA@16                  @449
    209293  ; IntlStrEqWorkerW       = _StrIsIntlEqualw@16                  @450
     
    331415  ; SHDeleteOrphanKeyA     = _SHDeleteOrphanKeyA@?                @571
    332416  ; SHDeleteOrphanKeyW     = _SHDeleteOrphanKeyW@?                @572
    333   ; SHDeleteValueA         = _SHDeleteValueA@?                    @573
    334   ; SHDeleteValueW         = _SHDeleteValueW@?                    @574
     417    SHDeleteValueA         = _SHDeleteValueA@12                   @573
     418    SHDeleteValueW         = _SHDeleteValueW@12                   @574
    335419  ; SHEnumKeyExA           = _SHEnumKeyExA@?                      @575
    336420  ; SHEnumKeyExW           = _SHEnumKeyExW@?                      @576
    337421  ; SHEnumValueA           = _SHEnumValueA@?                      @577
    338422  ; SHEnumValueW           = _SHEnumValueW@?                      @578
    339 ;   _SHGetInstanceExplorer@4 = ????                               @579
    340   ; SHGetInverseCMAP       = _SHGetInverseCMAP@?                  @580
     423    _SHGetInstanceExplorer = __SHGetInstanceExplorer@4            @579
     424    SHGetInverseCMAP       = _SHGetInverseCMAP@8                  @580
    341425;   SHGetThreadRef         = _SHGetThreadRef@?                    @581
    342426    SHGetValueA            = _SHGetValueA@24                      @582
     
    367451    SHRegGetUSValueA       = _SHRegGetUSValueA@32                 @607
    368452    SHRegGetUSValueW       = _SHRegGetUSValueW@32                 @608
    369   ; SHRegOpenUSKeyA        = _SHRegOpenUSKeyA@?                   @609
    370   ; SHRegOpenUSKeyW        = _SHRegOpenUSKeyW@?                   @610
     453    SHRegOpenUSKeyA        = _SHRegOpenUSKeyA@20                  @609
     454    SHRegOpenUSKeyW        = _SHRegOpenUSKeyW@20                  @610
    371455  ; SHRegQueryInfoKeyA     = _SHRegQueryInfoKeyA@?                @611
    372456  ; SHRegQueryInfoKeyW     = _SHRegQueryInfoKeyW@?                @612
    373   ; SHRegQueryUSValueA     = _SHRegQueryUSValueA@?                @613
    374   ; SHRegQueryUSValueW     = _SHRegQueryUSValueW@?                @614
     457    SHRegQueryUSValueA     = _SHRegQueryUSValueA@32               @613
     458    SHRegQueryUSValueW     = _SHRegQueryUSValueW@32               @614
    375459    SHRegSetUSValueA       = _SHRegSetUSValueA@24                 @615
    376460    SHRegSetUSValueW       = _SHRegSetUSValueW@24                 @616
     
    389473    StrCatBuffA            = _StrCatBuffA@12                      @629
    390474    StrCatBuffW            = _StrCatBuffW@12                      @630
    391   ; StrCatA                = _StrCatA@?                                 ; not exported ?
    392   ; StrCatW                = _StrCatW@?                           @631
     475;    StrCatA                = _StrCatA@8                                 ; not exported ?
     476    StrCatW                = _StrCatW@8                           @631
    393477    StrChrA                = _StrChrA@8                           @632
    394478    StrChrIA               = _StrChrIA@8                          @633
     
    415499  ; IntlStrEqWorkerA       = _StrIsIntlEqualA@16                  @653
    416500  ; StrIsIntlEqualW        = _StrIsIntlEqualW@?                   @654
    417   ; StrNCatA               = _StrNCatA@?                          @655
    418   ; StrNCatW               = _StrNCatW@12                         @656
     501    StrNCatA               = _StrNCatA@12                         @655
     502    StrNCatW               = _StrNCatW@12                         @656
    419503  ; StrPBrkA               = _StrPBrkA@?                          @657
    420504  ; StrPBrkW               = _StrPBrkW@?                          @658
     
    425509  ; StrRStrIA              = _StrRStrIA@?                         @663
    426510  ; StrRStrIW              = _StrRStrIW@?                         @664
    427 ;   StrRetToBufA           = _StrRetToBufA@16                     @665
    428 ;   StrRetToBufW           = _StrRetToBufW@16                     @666
     511    StrRetToBufA           = _StrRetToBufA@16                     @665
     512    StrRetToBufW           = _StrRetToBufW@16                     @666
    429513;   StrRetToStrA           = _StrRetToStrA@12                     @667
    430514;   StrRetToStrW           = _StrRetToStrW@12                     @668
     
    436520    StrStrW                = _StrStrW@8                           @674
    437521    StrToIntA              = _StrToIntA@4                         @675
    438   ; StrToIntExA            = _StrToIntExA@?                       @676
    439   ; StrToIntExW            = _StrToIntExW@?                       @677
     522    StrToIntExA            = _StrToIntExA@12                      @676
     523    StrToIntExW            = _StrToIntExW@12                      @677
    440524    StrToIntW              = _StrToIntW@4                         @678
    441525  ; StrTrimA               = _StrTrimA@?                          @679
     
    469553    wnsprintfA             = _wnsprintfA                          @707
    470554    wnsprintfW             = _wnsprintfW                          @708
    471 ;   wvnsprintfA            = _wvnsprintfA@16                      @709
    472 ;   wvnsprintfW            = _wvnsprintfW@16                      @710
    473 
    474 ;which ordinals??
    475     StrRetToBufA           = _StrRetToBufA@16                     @800
    476     StrRetToBufW           = _StrRetToBufW@16                     @801
     555;    wvnsprintfA            = _wvnsprintfA@16                      @709
     556;    wvnsprintfW            = _wvnsprintfW@16                      @710
    477557
    478558    SHRegGetPathA          = _SHRegGetPathA@20                    @802
  • TabularUnified trunk/src/shlwapi/string.c

    r4081 r5618  
    1414#include <winnls.h>
    1515#endif
    16 
    1716#include <ctype.h>
    1817#include <stdlib.h>
     
    2120
    2221#include "winerror.h"
    23 #include "wine/undocshell.h"
     22#include "windef.h"
     23#include "winbase.h"
     24#include "wingdi.h"
     25#include "winuser.h"
     26#include "shlwapi.h"
     27#include "shlobj.h"
    2428#include "wine/unicode.h"
    25 #include "heap.h"
    2629#include "debugtools.h"
    2730
     
    4649        return strchrW(str, x);
    4750}
     51#ifndef __WIN32OS2__
     52/*************************************************************************
     53 * StrCmpIW                                     [SHLWAPI]
     54 */
     55int WINAPI StrCmpIW ( LPCWSTR wstr1, LPCWSTR wstr2 )
     56{
     57    TRACE("%s %s\n", debugstr_w(wstr1),debugstr_w(wstr2));
     58    return strcmpiW( wstr1, wstr2 );
     59}
     60#endif
    4861
    4962/*************************************************************************
     
    8497
    8598/*************************************************************************
     99 * StrCmpW                                      [SHLWAPI]
     100 */
     101int WINAPI StrCmpW ( LPCWSTR wstr1, LPCWSTR wstr2 )
     102{
     103    TRACE("%s %s\n", debugstr_w(wstr1),debugstr_w(wstr2));
     104    return strcmpW( wstr1, wstr2 );
     105}
     106
     107/*************************************************************************
    86108 * StrCatW                                      [SHLWAPI]
    87109 */
     
    98120{
    99121    return strcpyW( wstr1, wstr2 );
     122}
     123
     124
     125/*************************************************************************
     126 * StrCpyNW                                     [SHLWAPI]
     127 */
     128LPWSTR WINAPI StrCpyNW( LPWSTR wstr1, LPCWSTR wstr2, int n )
     129{
     130    return lstrcpynW( wstr1, wstr2, n );
    100131}
    101132
     
    131162}
    132163
    133 #ifndef __WIN32OS2__
    134164/*************************************************************************
    135165 * StrStrIA                                     [SHLWAPI]
     
    161191    return NULL;
    162192}
    163 #endif
    164193
    165194/*************************************************************************
     
    177206int WINAPI StrToIntW(LPCWSTR lpSrc)
    178207{
    179         int ret;
    180         LPSTR lpStr =  HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc);
    181 
    182         TRACE("%s\n", debugstr_w(lpSrc));
    183 
    184         ret = atol(lpStr);
    185         HeapFree(GetProcessHeap(),0,lpStr);
    186         return ret;
     208    char buffer[32];
     209
     210    TRACE("%s\n", debugstr_w(lpSrc));
     211    WideCharToMultiByte( CP_ACP, 0, lpSrc, -1, buffer, sizeof(buffer), NULL, NULL );
     212    buffer[sizeof(buffer)-1] = 0;
     213    return atol(buffer);
     214}
     215
     216/*************************************************************************
     217 *      StrToIntExA                     [SHLWAPI]
     218 */
     219BOOL WINAPI StrToIntExA( LPCSTR pszString, DWORD dwFlags, LPINT piRet)
     220{
     221        TRACE("%s %ld stub !\n", debugstr_a(pszString), dwFlags);
     222        piRet = (LPINT) StrToIntA(pszString);
     223        return TRUE;
     224}
     225
     226/*************************************************************************
     227 *      StrToIntExW                     [SHLWAPI]
     228 */
     229BOOL WINAPI StrToIntExW( LPCWSTR pszString, DWORD dwFlags, LPINT piRet)
     230{
     231        TRACE("%s %ld stub !\n", debugstr_w(pszString), dwFlags);
     232        piRet = (LPINT) StrToIntW(pszString);
     233        return TRUE;
    187234}
    188235
     
    348395 *  the pidl is for STRRET OFFSET
    349396 */
    350 HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
     397HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, DWORD len)
    351398{
    352399        TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
     
    386433 *  the pidl is for STRRET OFFSET
    387434 */
    388 HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
     435HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, DWORD len)
    389436{
    390437        TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
     
    398445
    399446          case STRRET_CSTRA:
    400             lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
     447              if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ) && len)
     448                  dest[len-1] = 0;
    401449            break;
    402450
     
    404452            if (pidl)
    405453            {
    406               lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
     454              if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1,
     455                                        dest, len ) && len)
     456                  dest[len-1] = 0;
    407457            }
    408458            break;
     
    425475        TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
    426476        if ( dw<1024L )
    427         { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
     477        { sprintf (buf,"%ld bytes", dw);
    428478        }
    429479        else if ( dw<1048576L)
     
    444494 */
    445495LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
    446 {       char buf[64];
    447         TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
    448         if ( dw<1024L )
    449         { sprintf (buf,"%3.1f bytes", (FLOAT)dw);
    450         }
    451         else if ( dw<1048576L)
    452         { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
    453         }
    454         else if ( dw < 1073741824L)
    455         { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
    456         }
    457         else
    458         { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
    459         }
    460         lstrcpynAtoW (pszBuf, buf, cchBuf);
    461         return pszBuf; 
     496{
     497        char buf[64];
     498        StrFormatByteSizeA( dw, buf, sizeof(buf) );
     499        if (!MultiByteToWideChar( CP_ACP, 0, buf, -1, pszBuf, cchBuf ) && cchBuf)
     500            pszBuf[cchBuf-1] = 0;
     501        return pszBuf;
     502}
     503
     504/*************************************************************************
     505 *      StrNCatA        [SHLWAPI]
     506 */
     507LPSTR WINAPI StrNCatA(LPSTR front, LPCSTR back, INT cchMax)
     508{
     509        TRACE("%s %s %i stub\n", debugstr_a(front),debugstr_a(back),cchMax);
     510        return (front);
     511}
     512
     513/*************************************************************************
     514 *      StrNCatW        [SHLWAPI]
     515 */
     516LPWSTR WINAPI StrNCatW(LPWSTR front, LPCWSTR back, INT cchMax)
     517{
     518        TRACE("%s %s %i stub\n", debugstr_w(front),debugstr_w(back),cchMax);
     519        return (front);
    462520}
    463521
  • TabularUnified trunk/src/shlwapi/string_odin.cpp

    r4081 r5618  
    1  /* $Id: string_odin.cpp,v 1.1 2000-08-24 09:32:44 sandervl Exp $ */
     1 /* $Id: string_odin.cpp,v 1.2 2001-04-28 13:32:21 sandervl Exp $ */
    22
    33/*
     
    200200ODINFUNCTION2(LPSTR,  StrChrIA,
    201201              LPCSTR, lpStart,
    202               CHAR,   wMatch)
     202              WORD,   wMatch)
    203203{
    204204  LPSTR lpRes;
     
    250250
    251251/*****************************************************************************
    252  * Name      : StrStrIA
    253  * Purpose   : Finds the first occurrence of a substring within a string. The
    254  *             comparison is not case sensitive.
    255  * Parameters: LPCSTR lpFirst
    256  *             LPCSTR lpSrch
    257  * Variables :
    258  * Result    : Returns the address of the first occurrence of the matching
    259  *             substring if successful, or NULL otherwise.
    260  * Remark    : SHELL32.
    261  * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
    262  *
    263  * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
    264  *****************************************************************************/
    265 
    266 ODINFUNCTION2(LPSTR,  StrStrIA,
    267               LPCSTR, lpFirst,
    268               LPCSTR, lpSrch)
    269 {
    270   char  ch = lpSrch[0];          // look for 1st character
    271   LONG  lLen = lstrlenA(lpSrch); // length of search string
    272   int   iRes;                    // comparsion result
    273 
    274   do
    275   {
    276     lpFirst = StrChrIA(lpFirst, // find first matching character
    277                        ch);
    278     if (NULL == lpFirst)        // not found
    279       return NULL;
    280 
    281     iRes   = StrCmpNIA((LPSTR)lpFirst, // compare search string
    282                        (LPSTR)lpSrch,
    283                        lLen);
    284 
    285     if (0 == iRes)              // Found!
    286       return (LPSTR)lpFirst;
    287 
    288     lpFirst = CharNextA(lpFirst); // skip to next character
    289   }
    290   while (*lpFirst != 0);        // safe termination
    291 
    292   return NULL;                  // default result
    293 }
    294 
    295 
    296 
    297 /*****************************************************************************
    298  * Name      : StrStrIW
    299  * Purpose   : Finds the first occurrence of a substring within a string. The
    300  *             comparison is not case sensitive.
    301  * Parameters: LPCWSTR lpFirst
    302  *             LPCWSTR lpSrch
    303  * Variables :
    304  * Result    : Returns the address of the first occurrence of the matching
    305  *             substring if successful, or NULL otherwise.
    306  * Remark    : SHELL32.
    307  * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
    308  *
    309  * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
    310  *****************************************************************************/
    311 
    312 ODINFUNCTION2(LPWSTR,  StrStrIW,
    313               LPCWSTR, lpFirst,
    314               LPCWSTR, lpSrch)
    315 {
    316   WCHAR  ch = lpSrch[0];          // look for 1st character
    317   LONG   lLen = lstrlenW(lpSrch); // length of search string
    318   int   iRes;                    // comparsion result
    319 
    320   do
    321   {
    322     lpFirst = StrChrIW(lpFirst, // find first matching character
    323                        ch);
    324     if (NULL == lpFirst)        // not found
    325       return NULL;
    326 
    327     iRes   = StrCmpNIW((LPWSTR)lpFirst, // compare search string
    328                        (LPWSTR)lpSrch,
    329                        lLen);
    330 
    331     if (0 == iRes)              // Found!
    332       return (LPWSTR)lpFirst;
    333 
    334     lpFirst = CharNextW(lpFirst); // skip to next character
    335   }
    336   while (*lpFirst != 0);        // safe termination
    337 
    338   return NULL;                  // default result
    339 }
    340 
    341 
    342 
    343 
    344 
    345 
    346 /*****************************************************************************
    347252 * Name      : StrCpyA
    348253 * Purpose   : copy a string
Note: See TracChangeset for help on using the changeset viewer.