Changeset 8620 for trunk/src/ole32/compositemoniker.c
- Timestamp:
- Jun 9, 2002, 6:37:22 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/compositemoniker.c
r8441 r8620 40 40 ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ 41 41 42 /* The ROT (RunningObjectTable implementation) uses the IROTData 43 * interface to test whether two monikers are equal. That's why IROTData 42 /* The ROT (RunningObjectTable implementation) uses the IROTData 43 * interface to test whether two monikers are equal. That's why IROTData 44 44 * interface is implemented by monikers. 45 45 */ … … 201 201 { 202 202 ICOM_THIS(CompositeMonikerImpl,iface); 203 203 204 204 TRACE("(%p,%p,%p)\n",This,riid,ppvObject); 205 205 … … 207 207 if ( (This==0) || (ppvObject==0) ) 208 208 return E_INVALIDARG; 209 209 210 210 /* Initialize the return parameter */ 211 211 *ppvObject = 0; … … 250 250 ICOM_THIS(CompositeMonikerImpl,iface); 251 251 ULONG i; 252 252 253 253 TRACE("(%p)\n",This); 254 254 … … 261 261 for (i=0;i<This->tabLastIndex;i++) 262 262 IMoniker_Release(This->tabMoniker[i]); 263 263 264 264 CompositeMonikerImpl_Destroy(This); 265 265 266 266 return 0; 267 267 } 268 return This->ref; ;268 return This->ref; 269 269 } 270 270 … … 278 278 if (pClassID==NULL) 279 279 return E_POINTER; 280 280 281 281 *pClassID = CLSID_CompositeMoniker; 282 282 283 283 return S_OK; 284 284 } … … 307 307 CLSID clsid; 308 308 WCHAR string[1]={0}; 309 310 ICOM_THIS(CompositeMonikerImpl,iface); 309 310 ICOM_THIS(CompositeMonikerImpl,iface); 311 311 312 312 TRACE("(%p,%p)\n",iface,pStm); … … 366 366 /* resize the table if needed */ 367 367 if (++This->tabLastIndex==This->tabSize){ 368 368 369 369 This->tabSize+=BLOCK_TAB_SIZE; 370 370 This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); … … 387 387 IMoniker *pmk; 388 388 DWORD constant=3; 389 389 390 390 TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty); 391 391 392 /* This function calls OleSaveToStream function for each moniker within 392 /* This function calls OleSaveToStream function for each moniker within 393 393 * this object. 394 * When I tested this function in windows, I usually found this constant 395 * at the beginning of the stream. I don't known why (there's no 394 * When I tested this function in windows, I usually found this constant 395 * at the beginning of the stream. I don't known why (there's no 396 396 * indication in the specification) ! 397 397 */ … … 427 427 ULARGE_INTEGER ptmpSize; 428 428 429 /* The sizeMax of this object is calculated by calling GetSizeMax on 429 /* The sizeMax of this object is calculated by calling GetSizeMax on 430 430 * each moniker within this object then summing all returned values 431 431 */ … … 465 465 IMoniker *tempMk; 466 466 HRESULT res; 467 467 468 468 TRACE("(%p,%p,%p)\n",This,pmkFirst,pmkRest); 469 469 … … 491 491 492 492 IMoniker_Enum(pmkFirst,TRUE,&enumMoniker); 493 493 494 494 while(IEnumMoniker_Next(enumMoniker,1,&This->tabMoniker[This->tabLastIndex],NULL)==S_OK){ 495 495 496 496 497 497 if (++This->tabLastIndex==This->tabSize){ 498 498 499 499 This->tabSize+=BLOCK_TAB_SIZE; 500 500 This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); … … 511 511 512 512 IMoniker_IsSystemMoniker(pmkRest,&mkSys); 513 513 514 514 if (mkSys!=MKSYS_GENERICCOMPOSITE){ 515 515 … … 518 518 res=IMoniker_ComposeWith(This->tabMoniker[This->tabLastIndex-1],pmkRest,TRUE,&tempMk); 519 519 520 if (res==MK_E_NEEDGENERIC){ 520 if (res==MK_E_NEEDGENERIC){ 521 521 522 522 /* there's no simplification in this case */ … … 527 527 IMoniker_AddRef(pmkRest); 528 528 } 529 else if (tempMk==NULL){ 529 else if (tempMk==NULL){ 530 530 531 531 /* we have an antimoniker after a simple moniker so we can make a simplification in this case */ … … 545 545 /* resize tabMoniker if needed */ 546 546 if (This->tabLastIndex==This->tabSize){ 547 547 548 548 This->tabSize+=BLOCK_TAB_SIZE; 549 549 … … 556 556 else{ 557 557 558 /* add a composite moniker to the moniker table (do the same thing 559 * for each moniker within the composite moniker as a simple moniker 558 /* add a composite moniker to the moniker table (do the same thing 559 * for each moniker within the composite moniker as a simple moniker 560 560 * (see above for how to add a simple moniker case) ) 561 561 */ … … 584 584 585 585 if (This->tabLastIndex==This->tabSize){ 586 586 587 587 This->tabSize+=BLOCK_TAB_SIZE; 588 588 … … 627 627 IMoniker *tempMk,*antiMk,*mostRigthMk; 628 628 IEnumMoniker *enumMoniker; 629 629 630 630 TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); 631 631 632 632 if (ppvResult==NULL) 633 633 return E_POINTER; 634 634 635 635 *ppvResult=0; 636 636 /* If pmkToLeft is NULL, this method looks for the moniker in the ROT, and if found, queries the retrieved */ … … 656 656 IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); 657 657 IEnumMoniker_Release(enumMoniker); 658 658 659 659 res=CreateAntiMoniker(&antiMk); 660 660 res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); 661 661 IMoniker_Release(antiMk); 662 662 663 663 res=CompositeMonikerImpl_BindToObject(mostRigthMk,pbc,tempMk,riid,ppvResult); 664 664 … … 691 691 692 692 if (pmkToLeft!=NULL){ 693 693 694 694 IMoniker_Enum(iface,FALSE,&enumMoniker); 695 695 IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); 696 696 IEnumMoniker_Release(enumMoniker); 697 697 698 698 res=CreateAntiMoniker(&antiMk); 699 699 res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); 700 700 IMoniker_Release(antiMk); 701 701 702 702 res=CompositeMonikerImpl_BindToStorage(mostRigthMk,pbc,tempMk,riid,ppvResult); 703 703 … … 737 737 IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); 738 738 IEnumMoniker_Release(enumMoniker); 739 739 740 740 res=CreateAntiMoniker(&antiMk); 741 741 res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); … … 754 754 IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); 755 755 IEnumMoniker_Release(enumMoniker); 756 756 757 757 res=CreateAntiMoniker(&antiMk); 758 758 res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); … … 797 797 /* otherwise, the method returns the result of combining the two monikers by calling the */ 798 798 /* CreateGenericComposite function */ 799 799 800 800 if (fOnlyIfNotGeneric) 801 801 return MK_E_NEEDGENERIC; 802 802 803 803 return CreateGenericComposite(iface,pmkRight,ppmkComposite); 804 804 } … … 815 815 if (ppenumMoniker == NULL) 816 816 return E_POINTER; 817 817 818 818 return EnumMonikerImpl_CreateEnumMoniker(This->tabMoniker,This->tabLastIndex,0,fForward,ppenumMoniker); 819 819 } … … 827 827 IMoniker *tempMk1,*tempMk2; 828 828 HRESULT res1,res2,res; 829 829 830 830 TRACE("(%p,%p)\n",iface,pmkOtherMoniker); 831 831 … … 839 839 if (enumMoniker1==NULL) 840 840 return S_FALSE; 841 841 842 842 IMoniker_Enum(iface,TRUE,&enumMoniker2); 843 843 … … 846 846 res1=IEnumMoniker_Next(enumMoniker1,1,&tempMk1,NULL); 847 847 res2=IEnumMoniker_Next(enumMoniker2,1,&tempMk2,NULL); 848 848 849 849 if((res1==S_OK)&&(res2==S_OK)){ 850 850 … … 916 916 /* If pmkToLeft is NULL, this method returns S_OK if pmkNewlyRunning is non-NULL and is equal */ 917 917 /* to this moniker */ 918 918 919 919 if (pmkNewlyRunning!=NULL) 920 920 … … 934 934 /* IMoniker::IsRunning on the rightmost component of the composite, passing the remainder of */ 935 935 /* the composite as the pmkToLeft parameter for that call. */ 936 936 937 937 res=IBindCtx_GetRunningObjectTable(pbc,&rot); 938 938 … … 978 978 IMoniker *tempMk,*antiMk,*mostRigthMk; 979 979 IEnumMoniker *enumMoniker; 980 980 981 981 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pCompositeTime); 982 982 … … 1075 1075 IEnumMoniker *enumMoniker1,*enumMoniker2; 1076 1076 ULONG i,nbCommonMk=0; 1077 1077 1078 1078 /* If the other moniker is a composite, this method compares the components of each composite from left */ 1079 1079 /* to right. The returned common prefix moniker might also be a composite moniker, depending on how many */ … … 1082 1082 if (ppmkPrefix==NULL) 1083 1083 return E_POINTER; 1084 1084 1085 1085 *ppmkPrefix=0; 1086 1086 1087 1087 if (pmkOther==NULL) 1088 1088 return MK_E_NOPREFIX; 1089 1089 1090 1090 IMoniker_IsSystemMoniker(pmkOther,&mkSys); 1091 1091 … … 1151 1151 IMoniker_Release(tempMk1); 1152 1152 IMoniker_Release(tempMk2); 1153 1153 1154 1154 /* compose all common monikers in a composite moniker */ 1155 1155 for(i=0;i<nbCommonMk;i++){ … … 1162 1162 1163 1163 IMoniker_Release(tempMk1); 1164 1164 1165 1165 *ppmkPrefix=tempMk2; 1166 1166 } … … 1203 1203 DWORD mkSys; 1204 1204 HRESULT res1,res2; 1205 1205 1206 1206 *restMk=0; 1207 1207 … … 1246 1246 for(;IEnumMoniker_Next(enumMoniker3,1,&tempMk,NULL)==S_OK;nbRestMk++) 1247 1247 1248 IMoniker_Release(tempMk); ;1248 IMoniker_Release(tempMk); 1249 1249 1250 1250 if (nbRestMk==0) … … 1301 1301 1302 1302 /* finds the common prefix of the two monikers */ 1303 res=IMoniker_CommonPrefixWith(iface,pmkOther,&commonMk); 1303 res=IMoniker_CommonPrefixWith(iface,pmkOther,&commonMk); 1304 1304 1305 1305 /* if there's no common prefix or the two moniker are equal the relative is the other moniker */ … … 1358 1358 if (ppszDisplayName==NULL) 1359 1359 return E_POINTER; 1360 1360 1361 1361 *ppszDisplayName=CoTaskMemAlloc(sizeof(WCHAR)); 1362 1362 … … 1370 1370 1371 1371 IMoniker_Enum(iface,TRUE,&enumMoniker); 1372 1372 1373 1373 while(IEnumMoniker_Next(enumMoniker,1,&tempMk,NULL)==S_OK){ 1374 1374 … … 1430 1430 if (!pwdMksys) 1431 1431 return E_POINTER; 1432 1432 1433 1433 (*pwdMksys)=MKSYS_GENERICCOMPOSITE; 1434 1434 … … 1467 1467 { 1468 1468 ICOM_THIS_From_IROTData(IMoniker, iface); 1469 1469 1470 1470 TRACE("(%p)\n",iface); 1471 1471 … … 1491 1491 { 1492 1492 ICOM_THIS(EnumMonikerImpl,iface); 1493 1493 1494 1494 TRACE("(%p,%p,%p)\n",This,riid,ppvObject); 1495 1495 … … 1497 1497 if ( (This==0) || (ppvObject==0) ) 1498 1498 return E_INVALIDARG; 1499 1499 1500 1500 /* Initialize the return parameter */ 1501 1501 *ppvObject = 0; … … 1542 1542 /* destroy the object if there's no more reference on it */ 1543 1543 if (This->ref==0){ 1544 1544 1545 1545 for(i=0;i<This->tabSize;i++) 1546 1546 IMoniker_Release(This->tabMoniker[i]); … … 1551 1551 return 0; 1552 1552 } 1553 return This->ref; ;1553 return This->ref; 1554 1554 } 1555 1555 … … 1569 1569 if (pceltFethed!=NULL) 1570 1570 *pceltFethed= i; 1571 1571 1572 1572 if (i==celt) 1573 1573 return S_OK; … … 1587 1587 1588 1588 This->currentPos+=celt; 1589 1589 1590 1590 return S_OK; 1591 1591 } … … 1633 1633 if (currentPos > tabSize) 1634 1634 return E_INVALIDARG; 1635 1635 1636 1636 /* Initialize the virtual function table. */ 1637 1637 ICOM_VTBL(newEnumMoniker) = &VT_EnumMonikerImpl; … … 1676 1676 if (ppmkComposite==NULL) 1677 1677 return E_POINTER; 1678 1678 1679 1679 *ppmkComposite=0; 1680 1680
Note:
See TracChangeset
for help on using the changeset viewer.