Changeset 6648 for trunk/src/ole32/bindctx.c
- Timestamp:
- Sep 5, 2001, 3:19:02 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/bindctx.c
r5602 r6648 1 /* $Id: bindctx.c,v 1.2 2001-09-05 13:17:07 bird Exp $ */ 1 2 /*************************************************************************************** 2 * 3 * BindCtx implementation 3 4 * 4 5 * Copyright 1999 Noomen Hamza … … 20 21 21 22 /* represent the first size table and it's increment block size */ 22 #define BLOCK_TAB_SIZE 10 23 #define BLOCK_TAB_SIZE 10 23 24 #define MAX_TAB_SIZE 0xFFFFFFFF 24 25 … … 38 39 39 40 ICOM_VFIELD(IBindCtx); /* VTable relative to the IBindCtx interface.*/ 40 41 41 42 ULONG ref; /* reference counter for this object */ 42 43 … … 102 103 if ( (This==0) || (ppvObject==0) ) 103 104 return E_INVALIDARG; 104 105 105 106 /* Initialize the return parameter.*/ 106 107 *ppvObject = 0; … … 116 117 if ((*ppvObject)==0) 117 118 return E_NOINTERFACE; 118 119 119 120 /* Query Interface always increases the reference count by one when it is successful */ 120 121 BindCtxImpl_AddRef(iface); … … 223 224 if (punk==NULL) 224 225 return E_POINTER; 225 226 226 227 IUnknown_AddRef(punk); 227 228 228 229 /* put the object in the first free element in the table */ 229 230 This->bindCtxTable[lastIndex].pObj = punk; … … 263 264 /* check if the object was registred or not */ 264 265 if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE) 265 266 266 267 return MK_E_NOTBOUND; 267 268 268 269 IUnknown_Release(This->bindCtxTable[index].pObj); 269 270 270 271 /* left-shift all elements in the right side of the current revoked object */ 271 272 for(j=index; j<This->bindCtxTableLastIndex-1; j++) 272 273 This->bindCtxTable[j]= This->bindCtxTable[j+1]; 273 274 274 275 This->bindCtxTableLastIndex--; 275 276 … … 307 308 if (pbindopts==NULL) 308 309 return E_POINTER; 309 310 310 311 if (pbindopts->cbStruct > sizeof(BIND_OPTS2)) 311 312 { … … 351 352 if (pprot==NULL) 352 353 return E_POINTER; 353 354 354 355 res=GetRunningObjectTable(0, pprot); 355 356 … … 368 369 if (punk==NULL) 369 370 return E_INVALIDARG; 370 371 371 372 IUnknown_AddRef(punk); 372 373 … … 389 390 390 391 This->bindCtxTableLastIndex++; 391 392 392 393 if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */ 393 394 … … 419 420 420 421 *punk=0; 421 422 422 423 if (BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_FALSE) 423 424 return E_FAIL; 424 425 425 426 IUnknown_AddRef(This->bindCtxTable[index].pObj); 426 427 427 428 *punk = This->bindCtxTable[index].pObj; 428 429 … … 446 447 /* release the object if it's found */ 447 448 IUnknown_Release(This->bindCtxTable[index].pObj); 448 449 449 450 /* remove the object from the table with a left-shifting of all objects in the right side */ 450 451 for(j=index; j<This->bindCtxTableLastIndex-1; j++) 451 452 This->bindCtxTable[j]= This->bindCtxTable[j+1]; 452 453 453 454 This->bindCtxTableLastIndex--; 454 455 … … 476 477 DWORD i; 477 478 BYTE found=0; 478 479 479 480 TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index); 480 481
Note:
See TracChangeset
for help on using the changeset viewer.