Changeset 6711 for trunk/src/ole32/bindctx.c
- Timestamp:
- Sep 15, 2001, 11:32:00 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/bindctx.c
r6648 r6711 1 /* $Id: bindctx.c,v 1.2 2001-09-05 13:17:07 bird Exp $ */2 1 /*************************************************************************************** 3 * 2 * BindCtx implementation 4 3 * 5 4 * Copyright 1999 Noomen Hamza … … 18 17 #include "heap.h" 19 18 19 #ifdef __WIN32OS2__ 20 #undef FIXME 21 #undef TRACE 22 #ifdef DEBUG 23 #define TRACE WriteLog("OLE32: %s", __FUNCTION__); WriteLog 24 #define FIXME WriteLog("FIXME OLE32: %s", __FUNCTION__); WriteLog 25 #else 26 #define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) 27 #define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) 28 #endif 29 #endif 30 20 31 DEFAULT_DEBUG_CHANNEL(ole); 21 32 22 33 /* represent the first size table and it's increment block size */ 23 #define BLOCK_TAB_SIZE 10 34 #define BLOCK_TAB_SIZE 10 24 35 #define MAX_TAB_SIZE 0xFFFFFFFF 25 36 … … 39 50 40 51 ICOM_VFIELD(IBindCtx); /* VTable relative to the IBindCtx interface.*/ 41 52 42 53 ULONG ref; /* reference counter for this object */ 43 54 … … 103 114 if ( (This==0) || (ppvObject==0) ) 104 115 return E_INVALIDARG; 105 116 106 117 /* Initialize the return parameter.*/ 107 118 *ppvObject = 0; … … 117 128 if ((*ppvObject)==0) 118 129 return E_NOINTERFACE; 119 130 120 131 /* Query Interface always increases the reference count by one when it is successful */ 121 132 BindCtxImpl_AddRef(iface); … … 224 235 if (punk==NULL) 225 236 return E_POINTER; 226 237 227 238 IUnknown_AddRef(punk); 228 239 229 240 /* put the object in the first free element in the table */ 230 241 This->bindCtxTable[lastIndex].pObj = punk; … … 264 275 /* check if the object was registred or not */ 265 276 if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE) 266 277 267 278 return MK_E_NOTBOUND; 268 279 269 280 IUnknown_Release(This->bindCtxTable[index].pObj); 270 281 271 282 /* left-shift all elements in the right side of the current revoked object */ 272 283 for(j=index; j<This->bindCtxTableLastIndex-1; j++) 273 284 This->bindCtxTable[j]= This->bindCtxTable[j+1]; 274 285 275 286 This->bindCtxTableLastIndex--; 276 287 … … 308 319 if (pbindopts==NULL) 309 320 return E_POINTER; 310 321 311 322 if (pbindopts->cbStruct > sizeof(BIND_OPTS2)) 312 323 { … … 352 363 if (pprot==NULL) 353 364 return E_POINTER; 354 365 355 366 res=GetRunningObjectTable(0, pprot); 356 367 … … 369 380 if (punk==NULL) 370 381 return E_INVALIDARG; 371 382 372 383 IUnknown_AddRef(punk); 373 384 … … 390 401 391 402 This->bindCtxTableLastIndex++; 392 403 393 404 if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */ 394 405 … … 420 431 421 432 *punk=0; 422 433 423 434 if (BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_FALSE) 424 435 return E_FAIL; 425 436 426 437 IUnknown_AddRef(This->bindCtxTable[index].pObj); 427 438 428 439 *punk = This->bindCtxTable[index].pObj; 429 440 … … 447 458 /* release the object if it's found */ 448 459 IUnknown_Release(This->bindCtxTable[index].pObj); 449 460 450 461 /* remove the object from the table with a left-shifting of all objects in the right side */ 451 462 for(j=index; j<This->bindCtxTableLastIndex-1; j++) 452 463 This->bindCtxTable[j]= This->bindCtxTable[j+1]; 453 464 454 465 This->bindCtxTableLastIndex--; 455 466 … … 477 488 DWORD i; 478 489 BYTE found=0; 479 490 480 491 TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index); 481 492
Note:
See TracChangeset
for help on using the changeset viewer.