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/bindctx.c

    r5602 r6648  
     1/* $Id: bindctx.c,v 1.2 2001-09-05 13:17:07 bird Exp $ */
    12/***************************************************************************************
    2  *                            BindCtx implementation
     3 *                        BindCtx implementation
    34 *
    45 *  Copyright 1999  Noomen Hamza
     
    2021
    2122/* represent the first size table and it's increment block size */
    22 #define  BLOCK_TAB_SIZE 10 
     23#define  BLOCK_TAB_SIZE 10
    2324#define  MAX_TAB_SIZE   0xFFFFFFFF
    2425
     
    3839
    3940    ICOM_VFIELD(IBindCtx); /* VTable relative to the IBindCtx interface.*/
    40                                      
     41
    4142    ULONG ref; /* reference counter for this object */
    4243
     
    102103  if ( (This==0) || (ppvObject==0) )
    103104      return E_INVALIDARG;
    104  
     105
    105106  /* Initialize the return parameter.*/
    106107  *ppvObject = 0;
     
    116117  if ((*ppvObject)==0)
    117118      return E_NOINTERFACE;
    118  
     119
    119120   /* Query Interface always increases the reference count by one when it is successful */
    120121  BindCtxImpl_AddRef(iface);
     
    223224    if (punk==NULL)
    224225        return E_POINTER;
    225    
     226
    226227    IUnknown_AddRef(punk);
    227    
     228
    228229    /* put the object in the first free element in the table */
    229230    This->bindCtxTable[lastIndex].pObj = punk;
     
    263264    /* check if the object was registred or not */
    264265    if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE)
    265        
     266
    266267        return MK_E_NOTBOUND;
    267268
    268269    IUnknown_Release(This->bindCtxTable[index].pObj);
    269    
     270
    270271    /* left-shift all elements in the right side of the current revoked object */
    271272    for(j=index; j<This->bindCtxTableLastIndex-1; j++)
    272273        This->bindCtxTable[j]= This->bindCtxTable[j+1];
    273    
     274
    274275    This->bindCtxTableLastIndex--;
    275276
     
    307308    if (pbindopts==NULL)
    308309        return E_POINTER;
    309    
     310
    310311    if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    311312    {
     
    351352    if (pprot==NULL)
    352353        return E_POINTER;
    353    
     354
    354355    res=GetRunningObjectTable(0, pprot);
    355356
     
    368369    if (punk==NULL)
    369370        return E_INVALIDARG;
    370    
     371
    371372    IUnknown_AddRef(punk);
    372373
     
    389390
    390391    This->bindCtxTableLastIndex++;
    391    
     392
    392393    if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */
    393394
     
    419420
    420421    *punk=0;
    421    
     422
    422423    if (BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_FALSE)
    423424        return E_FAIL;
    424425
    425426    IUnknown_AddRef(This->bindCtxTable[index].pObj);
    426    
     427
    427428    *punk = This->bindCtxTable[index].pObj;
    428429
     
    446447    /* release the object if it's found */
    447448    IUnknown_Release(This->bindCtxTable[index].pObj);
    448    
     449
    449450    /* remove the object from the table with a left-shifting of all objects in the right side */
    450451    for(j=index; j<This->bindCtxTableLastIndex-1; j++)
    451452        This->bindCtxTable[j]= This->bindCtxTable[j+1];
    452    
     453
    453454    This->bindCtxTableLastIndex--;
    454455
     
    476477    DWORD i;
    477478    BYTE found=0;
    478    
     479
    479480    TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index);
    480481
Note: See TracChangeset for help on using the changeset viewer.