Ignore:
Timestamp:
Sep 5, 2001, 3:19:02 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

File:
1 edited

Legend:

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

    r5602 r6648  
     1/* $Id: itemmoniker.c,v 1.2 2001-09-05 13:17:10 bird Exp $ */
    12/***************************************************************************************
    2  *                            ItemMonikers implementation
     3 *                        ItemMonikers implementation
    34 *
    45 *           Copyright 1999  Noomen Hamza
     
    2526    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    2627
    27     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 
     28    /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
    2829     * two monikers are equal. That's whay IROTData interface is implemented by monikers.
    2930     */
     
    3536
    3637    LPOLESTR itemDelimiter; /* Delimiter string */
    37    
     38
    3839} ItemMonikerImpl;
    3940
     
    140141  /* Perform a sanity check on the parameters.*/
    141142    if ( (This==0) || (ppvObject==0) )
    142         return E_INVALIDARG;
    143  
     143    return E_INVALIDARG;
     144
    144145  /* Initialize the return parameter */
    145146  *ppvObject = 0;
     
    152153     )
    153154      *ppvObject = iface;
    154  
     155
    155156    else if (IsEqualIID(&IID_IROTData, riid))
    156157        *ppvObject = (IROTData*)&(This->lpvtbl2);
     
    159160    if ((*ppvObject)==0)
    160161        return E_NOINTERFACE;
    161  
     162
    162163   /* Query Interface always increases the reference count by one when it is successful */
    163164  ItemMonikerImpl_AddRef(iface);
     
    208209    if (pClassID==NULL)
    209210        return E_POINTER;
    210            
     211
    211212    *pClassID = CLSID_ItemMoniker;
    212        
     213
    213214    return S_OK;
    214215}
     
    342343
    343344    /* for more details see ItemMonikerImpl_Save coments */
    344    
     345
    345346    pcbSize->s.LowPart =  sizeof(DWORD) + /* DWORD which contains delimiter length */
    346347                        delimiterLength + /* item delimiter string */
     
    362363    int sizeStr1=lstrlenW(lpszItem), sizeStr2;
    363364    static const OLECHAR emptystr[1];
    364     LPCOLESTR   delim;
     365    LPCOLESTR   delim;
    365366
    366367    TRACE("(%p,%p)\n",This,lpszItem);
     
    373374    This->itemName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr1+1));
    374375    if (!This->itemName)
    375         return E_OUTOFMEMORY;
     376    return E_OUTOFMEMORY;
    376377    strcpyW(This->itemName,lpszItem);
    377378
    378379    if (!lpszDelim)
    379         FIXME("lpszDelim is NULL. Using empty string which is possibly wrong.\n");
     380    FIXME("lpszDelim is NULL. Using empty string which is possibly wrong.\n");
    380381
    381382    delim = lpszDelim ? lpszDelim : emptystr;
     
    384385    This->itemDelimiter=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr2+1));
    385386    if (!This->itemDelimiter) {
    386         HeapFree(GetProcessHeap(),0,This->itemName);
    387         return E_OUTOFMEMORY;
     387    HeapFree(GetProcessHeap(),0,This->itemName);
     388    return E_OUTOFMEMORY;
    388389    }
    389390    strcpyW(This->itemDelimiter,delim);
     
    419420{
    420421    ICOM_THIS(ItemMonikerImpl,iface);
    421    
     422
    422423    HRESULT   res;
    423424    IID    refid=IID_IOleItemContainer;
     
    466467    if(pmkToLeft==NULL)
    467468        return E_INVALIDARG;
    468        
     469
    469470    res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    470471
     
    496497
    497498    *ppmkReduced=iface;
    498    
     499
    499500    return MK_S_REDUCED_TO_SELF;
    500501}
     
    516517
    517518    if ((ppmkComposite==NULL)||(pmkRight==NULL))
    518         return E_POINTER;
     519    return E_POINTER;
    519520
    520521    *ppmkComposite=0;
    521    
     522
    522523    IMoniker_IsSystemMoniker(pmkRight,&mkSys);
    523524
     
    529530        /* if pmkRight is a composite whose leftmost component is an anti-moniker,           */
    530531        /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
    531        
     532
    532533         if(mkSys==MKSYS_GENERICCOMPOSITE){
    533534
     
    547548                tempMkComposite=iface;
    548549                IMoniker_AddRef(iface);
    549                
     550
    550551                while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){
    551552
     
    604605    if (pmkOtherMoniker==NULL)
    605606        return S_FALSE;
    606    
     607
    607608    /* This method returns S_OK if both monikers are item monikers and their display names are */
    608609    /* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */
     
    619620    IMoniker_GetDisplayName(iface,bind,NULL,&dispName1);
    620621    IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2);
    621    
     622
    622623    if (lstrcmpW(dispName1,dispName2)!=0)
    623624        return S_FALSE;
    624    
     625
    625626    return S_OK;
    626627}
     
    639640    if (pdwHash==NULL)
    640641        return E_POINTER;
    641    
     642
    642643    val =  This->itemName;
    643644    len = lstrlenW(val);
     
    649650    } else {
    650651        /* only sample some characters */
    651         skip = len / 8;
    652         for (i = len ; i > 0; i -= skip, off += skip) {
     652    skip = len / 8;
     653    for (i = len ; i > 0; i -= skip, off += skip) {
    653654            h = (h * 39) + val[off];
    654         }
     655    }
    655656    }
    656657
     
    698699        /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/
    699700        /* passing the string contained within this moniker. */
    700        
     701
    701702        res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    702703
     
    779780
    780781        *ppmkPrefix=iface;
    781        
     782
    782783        IMoniker_AddRef(iface);
    783        
     784
    784785        return MK_S_US;
    785786    }
     
    801802
    802803    *ppmkRelPath=0;
    803    
     804
    804805    return MK_E_NOTBINDABLE;
    805806}
     
    831832    strcpyW(*ppszDisplayName,This->itemDelimiter);
    832833    strcatW(*ppszDisplayName,This->itemName);
    833    
     834
    834835    return S_OK;
    835836}
     
    885886    if (!pwdMksys)
    886887        return E_POINTER;
    887    
     888
    888889    (*pwdMksys)=MKSYS_ITEMMONIKER;
    889890
     
    922923{
    923924    ICOM_THIS_From_IROTData(IMoniker, iface);
    924    
     925
    925926    TRACE("(%p)\n",iface);
    926927
     
    941942
    942943/******************************************************************************
    943  *        CreateItemMoniker16   [OLE2.28]
     944 *        CreateItemMoniker16   [OLE2.28]
    944945 ******************************************************************************/
    945946HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR  lpszItem,LPMONIKER* ppmk)
     
    952953
    953954/******************************************************************************
    954  *        CreateItemMoniker     [OLE.55]
     955 *        CreateItemMoniker [OLE.55]
    955956 ******************************************************************************/
    956957HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR  lpszItem, LPMONIKER * ppmk)
Note: See TracChangeset for help on using the changeset viewer.