Ignore:
Timestamp:
Sep 15, 2001, 11:32:00 AM (24 years ago)
Author:
sandervl
Message:

restored old version + wine update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/itemmoniker.c

    r6648 r6711  
    1 /* $Id: itemmoniker.c,v 1.2 2001-09-05 13:17:10 bird Exp $ */
    21/***************************************************************************************
    3  *                        ItemMonikers implementation
     2 *                            ItemMonikers implementation
    43 *
    54 *           Copyright 1999  Noomen Hamza
     
    2625    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    2726
    28     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
     27    /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 
    2928     * two monikers are equal. That's whay IROTData interface is implemented by monikers.
    3029     */
     
    3635
    3736    LPOLESTR itemDelimiter; /* Delimiter string */
    38 
     37   
    3938} ItemMonikerImpl;
    4039
     
    141140  /* Perform a sanity check on the parameters.*/
    142141    if ( (This==0) || (ppvObject==0) )
    143     return E_INVALIDARG;
    144 
     142        return E_INVALIDARG;
     143 
    145144  /* Initialize the return parameter */
    146145  *ppvObject = 0;
     
    153152     )
    154153      *ppvObject = iface;
    155 
     154 
    156155    else if (IsEqualIID(&IID_IROTData, riid))
    157156        *ppvObject = (IROTData*)&(This->lpvtbl2);
     
    160159    if ((*ppvObject)==0)
    161160        return E_NOINTERFACE;
    162 
     161 
    163162   /* Query Interface always increases the reference count by one when it is successful */
    164163  ItemMonikerImpl_AddRef(iface);
     
    209208    if (pClassID==NULL)
    210209        return E_POINTER;
    211 
     210           
    212211    *pClassID = CLSID_ItemMoniker;
    213 
     212       
    214213    return S_OK;
    215214}
     
    343342
    344343    /* for more details see ItemMonikerImpl_Save coments */
    345 
     344   
    346345    pcbSize->s.LowPart =  sizeof(DWORD) + /* DWORD which contains delimiter length */
    347346                        delimiterLength + /* item delimiter string */
     
    363362    int sizeStr1=lstrlenW(lpszItem), sizeStr2;
    364363    static const OLECHAR emptystr[1];
    365     LPCOLESTR   delim;
     364    LPCOLESTR   delim;
    366365
    367366    TRACE("(%p,%p)\n",This,lpszItem);
     
    374373    This->itemName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr1+1));
    375374    if (!This->itemName)
    376     return E_OUTOFMEMORY;
     375        return E_OUTOFMEMORY;
    377376    strcpyW(This->itemName,lpszItem);
    378377
    379378    if (!lpszDelim)
    380     FIXME("lpszDelim is NULL. Using empty string which is possibly wrong.\n");
     379        FIXME("lpszDelim is NULL. Using empty string which is possibly wrong.\n");
    381380
    382381    delim = lpszDelim ? lpszDelim : emptystr;
     
    385384    This->itemDelimiter=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr2+1));
    386385    if (!This->itemDelimiter) {
    387     HeapFree(GetProcessHeap(),0,This->itemName);
    388     return E_OUTOFMEMORY;
     386        HeapFree(GetProcessHeap(),0,This->itemName);
     387        return E_OUTOFMEMORY;
    389388    }
    390389    strcpyW(This->itemDelimiter,delim);
     
    420419{
    421420    ICOM_THIS(ItemMonikerImpl,iface);
    422 
     421   
    423422    HRESULT   res;
    424423    IID    refid=IID_IOleItemContainer;
     
    467466    if(pmkToLeft==NULL)
    468467        return E_INVALIDARG;
    469 
     468       
    470469    res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    471470
     
    497496
    498497    *ppmkReduced=iface;
    499 
     498   
    500499    return MK_S_REDUCED_TO_SELF;
    501500}
     
    517516
    518517    if ((ppmkComposite==NULL)||(pmkRight==NULL))
    519     return E_POINTER;
     518        return E_POINTER;
    520519
    521520    *ppmkComposite=0;
    522 
     521   
    523522    IMoniker_IsSystemMoniker(pmkRight,&mkSys);
    524523
     
    530529        /* if pmkRight is a composite whose leftmost component is an anti-moniker,           */
    531530        /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
    532 
     531       
    533532         if(mkSys==MKSYS_GENERICCOMPOSITE){
    534533
     
    548547                tempMkComposite=iface;
    549548                IMoniker_AddRef(iface);
    550 
     549               
    551550                while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){
    552551
     
    605604    if (pmkOtherMoniker==NULL)
    606605        return S_FALSE;
    607 
     606   
    608607    /* This method returns S_OK if both monikers are item monikers and their display names are */
    609608    /* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */
     
    620619    IMoniker_GetDisplayName(iface,bind,NULL,&dispName1);
    621620    IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2);
    622 
     621   
    623622    if (lstrcmpW(dispName1,dispName2)!=0)
    624623        return S_FALSE;
    625 
     624   
    626625    return S_OK;
    627626}
     
    640639    if (pdwHash==NULL)
    641640        return E_POINTER;
    642 
     641   
    643642    val =  This->itemName;
    644643    len = lstrlenW(val);
     
    650649    } else {
    651650        /* only sample some characters */
    652     skip = len / 8;
    653     for (i = len ; i > 0; i -= skip, off += skip) {
     651        skip = len / 8;
     652        for (i = len ; i > 0; i -= skip, off += skip) {
    654653            h = (h * 39) + val[off];
    655     }
     654        }
    656655    }
    657656
     
    699698        /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/
    700699        /* passing the string contained within this moniker. */
    701 
     700       
    702701        res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    703702
     
    780779
    781780        *ppmkPrefix=iface;
    782 
     781       
    783782        IMoniker_AddRef(iface);
    784 
     783       
    785784        return MK_S_US;
    786785    }
     
    802801
    803802    *ppmkRelPath=0;
    804 
     803   
    805804    return MK_E_NOTBINDABLE;
    806805}
     
    832831    strcpyW(*ppszDisplayName,This->itemDelimiter);
    833832    strcatW(*ppszDisplayName,This->itemName);
    834 
     833   
    835834    return S_OK;
    836835}
     
    886885    if (!pwdMksys)
    887886        return E_POINTER;
    888 
     887   
    889888    (*pwdMksys)=MKSYS_ITEMMONIKER;
    890889
     
    923922{
    924923    ICOM_THIS_From_IROTData(IMoniker, iface);
    925 
     924   
    926925    TRACE("(%p)\n",iface);
    927926
     
    942941
    943942/******************************************************************************
    944  *        CreateItemMoniker16   [OLE2.28]
     943 *        CreateItemMoniker16   [OLE2.28]
    945944 ******************************************************************************/
    946945HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR  lpszItem,LPMONIKER* ppmk)
     
    953952
    954953/******************************************************************************
    955  *        CreateItemMoniker [OLE.55]
     954 *        CreateItemMoniker     [OLE.55]
    956955 ******************************************************************************/
    957956HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR  lpszItem, LPMONIKER * ppmk)
Note: See TracChangeset for help on using the changeset viewer.