Changeset 795 for trunk/src


Ignore:
Timestamp:
Sep 2, 1999, 7:25:19 PM (26 years ago)
Author:
phaller
Message:

.

Location:
trunk/src/shell32/new
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/new/pidl.cpp

    r793 r795  
    142142}
    143143
     144
    144145/*************************************************************************
    145146 * ILGetDisplayName                     [SHELL32.15]
     
    293294        TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0);
    294295
    295         LocalToWideChar(lpszDisplayName, path, MAX_PATH);
     296        LocalToWideChar(lpszDisplayName, (LPSTR)path, MAX_PATH);
    296297
    297298        if (SUCCEEDED (SHGetDesktopFolder(&sf)))
  • trunk/src/shell32/new/regstream.cpp

    r791 r795  
    1717#include "shell32_main.h"
    1818
     19#include <heapstring.h>
    1920#include <misc.h>
    2021
     
    3233} ISHRegStream;
    3334
    34 static struct ICOM_VTABLE(IStream) rstvt;
    35 
    36 /**************************************************************************
    37 *   IStream_Constructor()
    38 */
    39 IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
    40 {       ISHRegStream*   rstr;
    41         DWORD           dwType;
    42        
    43         rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
    44         rstr->lpvtbl=&rstvt;
    45         rstr->ref = 1;
    46 
    47         if ( ERROR_SUCCESS == RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey)))
    48         { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,0,0,&(rstr->dwLength)))
    49           {
    50             /* read the binary data into the buffer */
    51             rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength);
    52             if (rstr->pbBuffer)
    53             { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength)))
    54               { if (dwType == REG_BINARY )
    55                 { rstr->pszSubKey = HEAP_strdupA (GetProcessHeap(),0, pszSubKey);
    56                   rstr->pszValue = HEAP_strdupA (GetProcessHeap(),0, pszValue);         
    57                   TRACE("(%p)->0x%08x,%s,%s,0x%08lx\n", rstr, hKey, pszSubKey, pszValue, grfMode);
    58                   shell32_ObjCount++;
    59                   return (IStream*)rstr;
    60                 }
    61               }
    62               HeapFree (GetProcessHeap(),0,rstr->pbBuffer);
    63             }
    64           }
    65           RegCloseKey(rstr->hKey);
    66 
    67         }
    68         HeapFree (GetProcessHeap(),0,rstr);
    69         return NULL;
    70 }
     35//static struct ICOM_VTABLE(IStream) rstvt;
     36
    7137
    7238/**************************************************************************
     
    274240};
    275241
     242/**************************************************************************
     243*   IStream_Constructor()
     244*/
     245IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
     246{       ISHRegStream*   rstr;
     247        DWORD           dwType;
     248       
     249        rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
     250        rstr->lpvtbl=&rstvt;
     251        rstr->ref = 1;
     252
     253        if ( ERROR_SUCCESS == RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey)))
     254        { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,0,0,&(rstr->dwLength)))
     255          {
     256            /* read the binary data into the buffer */
     257            rstr->pbBuffer = (BYTE*)HeapAlloc(GetProcessHeap(),0,rstr->dwLength);
     258            if (rstr->pbBuffer)
     259            { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength)))
     260              { if (dwType == REG_BINARY )
     261                { rstr->pszSubKey = HEAP_strdupA (GetProcessHeap(),0, pszSubKey);
     262                  rstr->pszValue = HEAP_strdupA (GetProcessHeap(),0, pszValue);         
     263                  TRACE("(%p)->0x%08x,%s,%s,0x%08lx\n", rstr, hKey, pszSubKey, pszValue, grfMode);
     264                  shell32_ObjCount++;
     265                  return (IStream*)rstr;
     266                }
     267              }
     268              HeapFree (GetProcessHeap(),0,rstr->pbBuffer);
     269            }
     270          }
     271          RegCloseKey(rstr->hKey);
     272
     273        }
     274        HeapFree (GetProcessHeap(),0,rstr);
     275        return NULL;
     276}
     277
     278
    276279/*************************************************************************
    277280 * OpenRegStream                                [SHELL32.85]
  • trunk/src/shell32/new/shelllink.cpp

    r791 r795  
    2626#include "shlguid.h"
    2727
     28#include <heapstring.h>
    2829#include <misc.h>
    2930
     
    6768#include "poppack.h"
    6869
    69 static ICOM_VTABLE(IShellLink)          slvt;
    70 static ICOM_VTABLE(IShellLinkW)         slvtw;
    71 static ICOM_VTABLE(IPersistFile)        pfvt;
    72 static ICOM_VTABLE(IPersistStream)      psvt;
     70//static ICOM_VTABLE(IShellLink)                slvt;
     71//static ICOM_VTABLE(IShellLinkW)               slvtw;
     72//static ICOM_VTABLE(IPersistFile)      pfvt;
     73//static ICOM_VTABLE(IPersistStream)    psvt;
    7374
    7475/* IShellLink Implementation */
     
    295296        IStream*         pLoadStream)
    296297{
    297         PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
     298        PLINK_HEADER lpLinkHeader = (PLINK_HEADER)HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
    298299        ULONG   dwBytesRead;
    299300        DWORD   ret = E_FAIL;
     
    316317            if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
    317318            {
    318               lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
     319              lpLinkHeader = (PLINK_HEADER)HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
    319320              if (lpLinkHeader)
    320321              {
     
    404405
    405406/**************************************************************************
    406  *        IShellLink_Constructor
    407  */
    408 IShellLink * IShellLink_Constructor(BOOL bUnicode)
    409 {       IShellLinkImpl * sl;
    410 
    411         sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
    412         sl->ref = 1;
    413         sl->lpvtbl = &slvt;
    414         sl->lpvtblw = &slvtw;
    415         sl->lpvtblPersistFile = &pfvt;
    416         sl->lpvtblPersistStream = &psvt;
    417        
    418         TRACE("(%p)->()\n",sl);
    419         shell32_ObjCount++;
    420         return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
    421 }
    422 
    423 /**************************************************************************
    424407 *  IShellLink_QueryInterface
    425408 */
     
    902885};
    903886
     887/**************************************************************************
     888 *        IShellLink_Constructor
     889 */
     890IShellLink * IShellLink_Constructor(BOOL bUnicode)
     891{       IShellLinkImpl * sl;
     892
     893        sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
     894        sl->ref = 1;
     895        sl->lpvtbl = &slvt;
     896        sl->lpvtblw = &slvtw;
     897        sl->lpvtblPersistFile = &pfvt;
     898        sl->lpvtblPersistStream = &psvt;
     899       
     900        TRACE("(%p)->()\n",sl);
     901        shell32_ObjCount++;
     902        return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
     903}
     904
     905
  • trunk/src/shell32/new/shellole.cpp

    r791 r795  
    6666        WINE_StringFromCLSID(refiid,xiid);
    6767        if (unknownouter)
    68                 WINE_StringFromCLSID(unknownouter,xuout);
     68                WINE_StringFromCLSID((const CLSID*)unknownouter,xuout);
    6969       
    7070        TRACE("(%p,\n\tCLSID:\t%s\n\tUOUT:\t%s\n\tIID:\t%s,%p)\n",
     
    140140{
    141141        if (VERSION_OsIsUnicode())
    142           return SHCLSIDFromStringW (clsid, id);
    143         return SHCLSIDFromStringA (clsid, id);
     142          return SHCLSIDFromStringW ((LPWSTR)clsid, id);
     143        return SHCLSIDFromStringA ((LPSTR)clsid, id);
    144144}
    145145
     
    178178          if(lpclf)
    179179          {
    180             hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (void*)&pdesktopfolder);
     180            hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (LPVOID*)&pdesktopfolder);
    181181            IClassFactory_Release(lpclf);
    182182          }
     
    206206} IClassFactoryImpl;
    207207
    208 static ICOM_VTABLE(IClassFactory) clfvt;
    209 
    210 /**************************************************************************
    211  *  IClassFactory_Constructor
    212  */
    213 
    214 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID rclsid)
    215 {
    216         IClassFactoryImpl* lpclf;
    217 
    218         lpclf= (IClassFactoryImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IClassFactoryImpl));
    219         lpclf->ref = 1;
    220         lpclf->lpvtbl = &clfvt;
    221         lpclf->rclsid = (CLSID*)rclsid;
    222 
    223         TRACE("(%p)->()\n",lpclf);
    224         shell32_ObjCount++;
    225         return (LPCLASSFACTORY)lpclf;
    226 }
     208//static ICOM_VTABLE(IClassFactory) clfvt;
     209
    227210/**************************************************************************
    228211 *  IClassFactory_QueryInterface
     
    348331
    349332/**************************************************************************
     333 *  IClassFactory_Constructor
     334 */
     335
     336LPCLASSFACTORY IClassFactory_Constructor(REFCLSID rclsid)
     337{
     338        IClassFactoryImpl* lpclf;
     339
     340        lpclf= (IClassFactoryImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IClassFactoryImpl));
     341        lpclf->ref = 1;
     342        lpclf->lpvtbl = &clfvt;
     343        lpclf->rclsid = (CLSID*)rclsid;
     344
     345        TRACE("(%p)->()\n",lpclf);
     346        shell32_ObjCount++;
     347        return (LPCLASSFACTORY)lpclf;
     348}
     349
     350
     351/**************************************************************************
    350352 * Default ClassFactory Implementation
    351353 *
     
    369371} IDefClFImpl;
    370372
    371 static ICOM_VTABLE(IClassFactory) dclfvt;
    372 
    373 /**************************************************************************
    374  *  IDefClF_fnConstructor
    375  */
    376 
    377 IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, UINT * pcRefDll, REFIID riidInst)
    378 {
    379         IDefClFImpl* lpclf;
    380         char    xriidInst[50];
    381 
    382         WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst);
    383 
    384         lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
    385         lpclf->ref = 1;
    386         lpclf->lpvtbl = &dclfvt;
    387         lpclf->lpfnCI = lpfnCI;
    388         lpclf->pcRefDll = pcRefDll;
    389 
    390         if (pcRefDll)
    391           (*pcRefDll)++;
    392 
    393         lpclf->riidInst = riidInst;
    394 
    395         TRACE("(%p)\n\tIID:\t%s\n",lpclf, xriidInst);
    396         shell32_ObjCount++;
    397         return (LPCLASSFACTORY)lpclf;
    398 }
     373//static ICOM_VTABLE(IClassFactory) dclfvt;
     374
    399375/**************************************************************************
    400376 *  IDefClF_fnQueryInterface
     
    505481};
    506482
     483/**************************************************************************
     484 *  IDefClF_fnConstructor
     485 */
     486
     487IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, UINT * pcRefDll, REFIID riidInst)
     488{
     489        IDefClFImpl* lpclf;
     490        char    xriidInst[50];
     491
     492        WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst);
     493
     494        lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
     495        lpclf->ref = 1;
     496        lpclf->lpvtbl = &dclfvt;
     497        lpclf->lpfnCI = lpfnCI;
     498        lpclf->pcRefDll = pcRefDll;
     499
     500        if (pcRefDll)
     501          (*pcRefDll)++;
     502
     503        lpclf->riidInst = riidInst;
     504
     505        TRACE("(%p)\n\tIID:\t%s\n",lpclf, xriidInst);
     506        shell32_ObjCount++;
     507        return (LPCLASSFACTORY)lpclf;
     508}
     509
     510
    507511/******************************************************************************
    508512 * SHCreateDefClassObject                       [SHELL32.70]
  • trunk/src/shell32/new/shlfolder.cpp

    r791 r795  
    2929#include "shell32_main.h"
    3030
     31#include <heapstring.h>
    3132#include <misc.h>
    3233
     
    209210} IGenericSFImpl;
    210211
    211 static struct ICOM_VTABLE(IShellFolder) sfvt;
    212 static struct ICOM_VTABLE(IPersistFolder) psfvt;
    213 static struct ICOM_VTABLE(IDropTarget) dtvt;
     212//static struct ICOM_VTABLE(IShellFolder) sfvt;
     213//static struct ICOM_VTABLE(IPersistFolder) psfvt;
     214//static struct ICOM_VTABLE(IDropTarget) dtvt;
    214215
    215216static IShellFolder * ISF_MyComputer_Constructor(void);
     
    218219#define _ICOM_THIS_From_IPersistFolder(class, name) class* This = (class*)(((char*)name)-_IPersistFolder_Offset);
    219220       
    220 static struct ICOM_VTABLE(IDropTarget) dtvt;
    221221#define _IDropTarget_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblDropTarget)))
    222222#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
     
    278278
    279279            dwSize += _ILSimpleGetText(pidl,NULL,0);            /* add the size of our name*/
    280             sf->sMyPath = SHAlloc(dwSize + 2);                  /* '\0' and backslash */
     280            sf->sMyPath = (char*)SHAlloc(dwSize + 2);                   /* '\0' and backslash */
    281281
    282282            if(!sf->sMyPath) return NULL;
     
    562562        else
    563563        {
    564           IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID)&pSubFolder);
     564          IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID*)&pSubFolder);
    565565          IShellFolder_Release(pShellFolder);
    566566          *ppvOut = pSubFolder;
     
    664664            _ILSimpleGetText(pidl1, szTemp1, MAX_PATH);
    665665            _ILSimpleGetText(pidl2, szTemp2, MAX_PATH);
    666             nReturn = strcasecmp(szTemp1, szTemp2);
     666            nReturn = strcmp(szTemp1, szTemp2);
    667667       
    668668            if (nReturn == 0)                           /* first pidl different ? */
     
    11781178        else                            /* go deeper */
    11791179        {
    1180           IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID)&pSubFolder);
     1180          IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID*)&pSubFolder);
    11811181          IShellFolder_Release(pShellFolder);
    11821182          *ppvOut = pSubFolder;
     
    14901490        else                            /* go deeper */
    14911491        {
    1492           IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID)&pSubFolder);
     1492          IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID*)&pSubFolder);
    14931493          IShellFolder_Release(pShellFolder);
    14941494          *ppvOut = pSubFolder;
  • trunk/src/shell32/new/shlmenu.cpp

    r791 r795  
    2121#include "pidl.h"
    2222
     23#include <heapstring.h>
    2324#include <misc.h>
    2425
     
    160161                {
    161162                  ILGetDisplayName( pidlTemp, sTemp);
    162                   if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, &iIcon)))
     163                  if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, (UINT*)&iIcon)))
    163164                    iIcon = FM_BLANK_ICON;
    164165                  if ( SFGAO_FOLDER & ulItemAttr)
     
    340341
    341342        if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR))
    342           lpszText = HEAP_strdupWtoA ( GetProcessHeap(),0, lpText);
    343 
    344         ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : lpText, uID, icon, hMenuPopup, nItemHeight);
     343          lpszText = (LPSTR)HEAP_strdupWtoA ( GetProcessHeap(),0, (LPCWSTR)lpText);
     344
     345        ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : (LPCSTR)lpText, uID, icon, hMenuPopup, nItemHeight);
    345346
    346347        if (lpszText)
  • trunk/src/shell32/new/shv_bg_cmenu.cpp

    r791 r795  
    3535
    3636
    37 static struct ICOM_VTABLE(IContextMenu) cmvt;
    38 
    39 /**************************************************************************
    40 *   ISVBgCm_Constructor()
    41 */
    42 IContextMenu *ISvBgCm_Constructor(void)
    43 {
    44         BgCmImpl* cm;
    45 
    46         cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
    47         cm->lpvtbl=&cmvt;
    48         cm->ref = 1;
    49 
    50         TRACE("(%p)->()\n",cm);
    51         shell32_ObjCount++;
    52         return (IContextMenu*)cm;
    53 }
     37//static struct ICOM_VTABLE(IContextMenu) cmvt;
    5438
    5539/**************************************************************************
     
    285269};
    286270
     271/**************************************************************************
     272*   ISVBgCm_Constructor()
     273*/
     274IContextMenu *ISvBgCm_Constructor(void)
     275{
     276        BgCmImpl* cm;
     277
     278        cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
     279        cm->lpvtbl=&cmvt;
     280        cm->ref = 1;
     281
     282        TRACE("(%p)->()\n",cm);
     283        shell32_ObjCount++;
     284        return (IContextMenu*)cm;
     285}
     286
     287
Note: See TracChangeset for help on using the changeset viewer.