Changeset 6648 for trunk/src/ole32/itemmoniker.c
- Timestamp:
- Sep 5, 2001, 3:19:02 PM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/ole32/itemmoniker.c (modified) (29 diffs)
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 $ */ 1 2 /*************************************************************************************** 2 * ItemMonikers implementation3 * ItemMonikers implementation 3 4 * 4 5 * Copyright 1999 Noomen Hamza … … 25 26 ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ 26 27 27 /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 28 /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether 28 29 * two monikers are equal. That's whay IROTData interface is implemented by monikers. 29 30 */ … … 35 36 36 37 LPOLESTR itemDelimiter; /* Delimiter string */ 37 38 38 39 } ItemMonikerImpl; 39 40 … … 140 141 /* Perform a sanity check on the parameters.*/ 141 142 if ( (This==0) || (ppvObject==0) ) 142 return E_INVALIDARG;143 143 return E_INVALIDARG; 144 144 145 /* Initialize the return parameter */ 145 146 *ppvObject = 0; … … 152 153 ) 153 154 *ppvObject = iface; 154 155 155 156 else if (IsEqualIID(&IID_IROTData, riid)) 156 157 *ppvObject = (IROTData*)&(This->lpvtbl2); … … 159 160 if ((*ppvObject)==0) 160 161 return E_NOINTERFACE; 161 162 162 163 /* Query Interface always increases the reference count by one when it is successful */ 163 164 ItemMonikerImpl_AddRef(iface); … … 208 209 if (pClassID==NULL) 209 210 return E_POINTER; 210 211 211 212 *pClassID = CLSID_ItemMoniker; 212 213 213 214 return S_OK; 214 215 } … … 342 343 343 344 /* for more details see ItemMonikerImpl_Save coments */ 344 345 345 346 pcbSize->s.LowPart = sizeof(DWORD) + /* DWORD which contains delimiter length */ 346 347 delimiterLength + /* item delimiter string */ … … 362 363 int sizeStr1=lstrlenW(lpszItem), sizeStr2; 363 364 static const OLECHAR emptystr[1]; 364 LPCOLESTR delim;365 LPCOLESTR delim; 365 366 366 367 TRACE("(%p,%p)\n",This,lpszItem); … … 373 374 This->itemName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr1+1)); 374 375 if (!This->itemName) 375 return E_OUTOFMEMORY;376 return E_OUTOFMEMORY; 376 377 strcpyW(This->itemName,lpszItem); 377 378 378 379 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"); 380 381 381 382 delim = lpszDelim ? lpszDelim : emptystr; … … 384 385 This->itemDelimiter=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr2+1)); 385 386 if (!This->itemDelimiter) { 386 HeapFree(GetProcessHeap(),0,This->itemName);387 return E_OUTOFMEMORY;387 HeapFree(GetProcessHeap(),0,This->itemName); 388 return E_OUTOFMEMORY; 388 389 } 389 390 strcpyW(This->itemDelimiter,delim); … … 419 420 { 420 421 ICOM_THIS(ItemMonikerImpl,iface); 421 422 422 423 HRESULT res; 423 424 IID refid=IID_IOleItemContainer; … … 466 467 if(pmkToLeft==NULL) 467 468 return E_INVALIDARG; 468 469 469 470 res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); 470 471 … … 496 497 497 498 *ppmkReduced=iface; 498 499 499 500 return MK_S_REDUCED_TO_SELF; 500 501 } … … 516 517 517 518 if ((ppmkComposite==NULL)||(pmkRight==NULL)) 518 return E_POINTER;519 return E_POINTER; 519 520 520 521 *ppmkComposite=0; 521 522 522 523 IMoniker_IsSystemMoniker(pmkRight,&mkSys); 523 524 … … 529 530 /* if pmkRight is a composite whose leftmost component is an anti-moniker, */ 530 531 /* the returned moniker is the composite after the leftmost anti-moniker is removed. */ 531 532 532 533 if(mkSys==MKSYS_GENERICCOMPOSITE){ 533 534 … … 547 548 tempMkComposite=iface; 548 549 IMoniker_AddRef(iface); 549 550 550 551 while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){ 551 552 … … 604 605 if (pmkOtherMoniker==NULL) 605 606 return S_FALSE; 606 607 607 608 /* This method returns S_OK if both monikers are item monikers and their display names are */ 608 609 /* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */ … … 619 620 IMoniker_GetDisplayName(iface,bind,NULL,&dispName1); 620 621 IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2); 621 622 622 623 if (lstrcmpW(dispName1,dispName2)!=0) 623 624 return S_FALSE; 624 625 625 626 return S_OK; 626 627 } … … 639 640 if (pdwHash==NULL) 640 641 return E_POINTER; 641 642 642 643 val = This->itemName; 643 644 len = lstrlenW(val); … … 649 650 } else { 650 651 /* 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) { 653 654 h = (h * 39) + val[off]; 654 }655 } 655 656 } 656 657 … … 698 699 /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/ 699 700 /* passing the string contained within this moniker. */ 700 701 701 702 res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); 702 703 … … 779 780 780 781 *ppmkPrefix=iface; 781 782 782 783 IMoniker_AddRef(iface); 783 784 784 785 return MK_S_US; 785 786 } … … 801 802 802 803 *ppmkRelPath=0; 803 804 804 805 return MK_E_NOTBINDABLE; 805 806 } … … 831 832 strcpyW(*ppszDisplayName,This->itemDelimiter); 832 833 strcatW(*ppszDisplayName,This->itemName); 833 834 834 835 return S_OK; 835 836 } … … 885 886 if (!pwdMksys) 886 887 return E_POINTER; 887 888 888 889 (*pwdMksys)=MKSYS_ITEMMONIKER; 889 890 … … 922 923 { 923 924 ICOM_THIS_From_IROTData(IMoniker, iface); 924 925 925 926 TRACE("(%p)\n",iface); 926 927 … … 941 942 942 943 /****************************************************************************** 943 * CreateItemMoniker16 [OLE2.28]944 * CreateItemMoniker16 [OLE2.28] 944 945 ******************************************************************************/ 945 946 HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR lpszItem,LPMONIKER* ppmk) … … 952 953 953 954 /****************************************************************************** 954 * CreateItemMoniker [OLE.55]955 * CreateItemMoniker [OLE.55] 955 956 ******************************************************************************/ 956 957 HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR lpszItem, LPMONIKER * ppmk)
Note:
See TracChangeset
for help on using the changeset viewer.
