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

    r5602 r6648  
     1/* $Id: compobj.c,v 1.2 2001-09-05 13:17:07 bird Exp $ */
    12/*
    2  *      COMPOBJ library
    3  *
    4  *      Copyright 1995  Martin von Loewis
    5  *      Copyright 1998  Justin Bradford
     3 *  COMPOBJ library
     4 *
     5 *  Copyright 1995  Martin von Loewis
     6 *  Copyright 1998  Justin Bradford
    67 *      Copyright 1999  Francis Beaudet
    78 *  Copyright 1999  Sylvain St-Germain
     
    4445 *  COM External Lock structures and methods declaration
    4546 *
    46  *  This api provides a linked list to managed external references to 
    47  *  COM objects. 
    48  *
    49  *  The public interface consists of three calls: 
     47 *  This api provides a linked list to managed external references to
     48 *  COM objects.
     49 *
     50 *  The public interface consists of three calls:
    5051 *      COM_ExternalLockAddRef
    5152 *      COM_ExternalLockRelease
     
    5758
    5859/*
    59  * Declaration of the static structure that manage the 
     60 * Declaration of the static structure that manage the
    6061 * external lock to COM  objects.
    6162 */
     
    8283
    8384/*
    84  * Public Interface to the external lock list   
     85 * Public Interface to the external lock list
    8586 */
    8687static void COM_ExternalLockFreeList();
     
    9091
    9192/*
    92  * Private methods used to managed the linked list   
     93 * Private methods used to managed the linked list
    9394 */
    9495static BOOL COM_ExternalLockInsert(
     
    152153 */
    153154typedef struct tagOpenDll {
    154   HINSTANCE hLibrary;       
     155  HINSTANCE hLibrary;
    155156  struct tagOpenDll *next;
    156157} OpenDll;
     
    163164 */
    164165static HRESULT COM_GetRegisteredClassObject(REFCLSID    rclsid,
    165                                             DWORD       dwClsContext,
    166                                             LPUNKNOWN*  ppUnk);
     166                        DWORD       dwClsContext,
     167                        LPUNKNOWN*  ppUnk);
    167168
    168169static void COM_RevokeAllClasses();
     
    173174 *
    174175 * RETURNS
    175  *      Current build version, hiword is majornumber, loword is minornumber
     176 *  Current build version, hiword is majornumber, loword is minornumber
    176177 */
    177178DWORD WINAPI CoBuildVersion(void)
     
    183184#ifndef __WIN32OS2__
    184185/******************************************************************************
    185  *              CoInitialize16  [COMPOBJ.2]
     186 *      CoInitialize16  [COMPOBJ.2]
    186187 * Set the win16 IMalloc used for memory management
    187188 */
    188189HRESULT WINAPI CoInitialize16(
    189         LPVOID lpReserved       /* [in] pointer to win16 malloc interface */
     190    LPVOID lpReserved   /* [in] pointer to win16 malloc interface */
    190191) {
    191192    currentMalloc16 = (LPMALLOC16)lpReserved;
     
    195196
    196197/******************************************************************************
    197  *              CoInitialize    [OLE32.26]
     198 *      CoInitialize    [OLE32.26]
    198199 *
    199200 * Initializes the COM libraries.
     
    202203 */
    203204HRESULT WINAPI CoInitialize(
    204         LPVOID lpReserved       /* [in] pointer to win32 malloc interface
     205    LPVOID lpReserved   /* [in] pointer to win32 malloc interface
    205206                                   (obsolete, should be NULL) */
    206 ) 
     207)
    207208{
    208209  /*
     
    213214
    214215/******************************************************************************
    215  *              CoInitializeEx  [OLE32.163]
     216 *      CoInitializeEx  [OLE32.163]
    216217 *
    217218 * Initializes the COM libraries. The behavior used to set the win32 IMalloc
     
    225226 *
    226227 * BUGS
    227  * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE 
     228 * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE
    228229 * is never returned.
    229230 *
     
    231232 */
    232233HRESULT WINAPI CoInitializeEx(
    233         LPVOID lpReserved,      /* [in] pointer to win32 malloc interface
     234    LPVOID lpReserved,  /* [in] pointer to win32 malloc interface
    234235                                   (obsolete, should be NULL) */
    235         DWORD dwCoInit          /* [in] A value from COINIT specifies the threading model */
    236 ) 
     236    DWORD dwCoInit      /* [in] A value from COINIT specifies the threading model */
     237)
    237238{
    238239  HRESULT hr;
     
    248249   * Check for unsupported features.
    249250   */
    250   if (dwCoInit!=COINIT_APARTMENTTHREADED) 
     251  if (dwCoInit!=COINIT_APARTMENTTHREADED)
    251252  {
    252253    FIXME(":(%p,%x): unsupported flag %x\n", lpReserved, (int)dwCoInit, (int)dwCoInit);
     
    283284/***********************************************************************
    284285 *           CoUninitialize16   [COMPOBJ.3]
    285  * Don't know what it does. 
     286 * Don't know what it does.
    286287 * 3-Nov-98 -- this was originally misspelled, I changed it to what I
    287288 *   believe is the correct spelling
     
    304305{
    305306  TRACE("()\n");
    306  
     307
    307308  /*
    308309   * Decrease the reference count.
    309310   */
    310311  s_COMLockCount--;
    311  
     312
    312313  /*
    313314   * If we are back to 0 locks on the COM library, make sure we free
     
    343344 *           CoGetMalloc16    [COMPOBJ.4]
    344345 * RETURNS
    345  *      The current win16 IMalloc
     346 *  The current win16 IMalloc
    346347 */
    347348HRESULT WINAPI CoGetMalloc16(
    348         DWORD dwMemContext,     /* [in] unknown */
    349         LPMALLOC16 * lpMalloc   /* [out] current win16 malloc interface */
     349    DWORD dwMemContext, /* [in] unknown */
     350    LPMALLOC16 * lpMalloc   /* [out] current win16 malloc interface */
    350351) {
    351352    if(!currentMalloc16)
    352         currentMalloc16 = IMalloc16_Constructor();
     353    currentMalloc16 = IMalloc16_Constructor();
    353354    *lpMalloc = currentMalloc16;
    354355    return S_OK;
     
    357358
    358359/******************************************************************************
    359  *              CoGetMalloc     [OLE32.20]
     360 *      CoGetMalloc [OLE32.20]
    360361 *
    361362 * RETURNS
    362  *      The current win32 IMalloc
     363 *  The current win32 IMalloc
    363364 */
    364365HRESULT WINAPI CoGetMalloc(
    365         DWORD dwMemContext,     /* [in] unknown */
    366         LPMALLOC *lpMalloc      /* [out] current win32 malloc interface */
     366    DWORD dwMemContext, /* [in] unknown */
     367    LPMALLOC *lpMalloc  /* [out] current win32 malloc interface */
    367368) {
    368369    if(!currentMalloc32)
    369         currentMalloc32 = IMalloc_Constructor();
     370    currentMalloc32 = IMalloc_Constructor();
    370371    *lpMalloc = currentMalloc32;
    371372    return S_OK;
     
    377378 */
    378379HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext,
    379                                           LPMALLOC16 *lpMalloc)
     380                      LPMALLOC16 *lpMalloc)
    380381{
    381382    /* FIXME: docu says we shouldn't return the same allocator as in
     
    386387
    387388/******************************************************************************
    388  *              CoDisconnectObject      [COMPOBJ.15]
     389 *      CoDisconnectObject  [COMPOBJ.15]
    389390 */
    390391HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
     
    400401 *
    401402 * RETURNS
    402  *      TRUE if equal
     403 *  TRUE if equal
    403404 */
    404405BOOL16 WINAPI IsEqualGUID16(
    405         GUID* g1,       /* [in] unique id 1 */
    406         GUID* g2        /* [in] unique id 2 */
     406    GUID* g1,   /* [in] unique id 1 */
     407    GUID* g2    /* [in] unique id 2 */
    407408) {
    408409    return !memcmp( g1, g2, sizeof(GUID) );
     
    411412
    412413/******************************************************************************
    413  *              CLSIDFromString16       [COMPOBJ.20]
    414  * Converts a unique identifier from its string representation into 
     414 *      CLSIDFromString16   [COMPOBJ.20]
     415 * Converts a unique identifier from its string representation into
    415416 * the GUID struct.
    416417 *
    417  * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] 
     418 * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6]
    418419 *
    419420 * RETURNS
    420  *      the converted GUID
     421 *  the converted GUID
    421422 */
    422423HRESULT WINAPI CLSIDFromString16(
    423         LPCOLESTR16 idstr,      /* [in] string representation of guid */
    424         CLSID *id               /* [out] GUID converted from string */
     424    LPCOLESTR16 idstr,  /* [in] string representation of guid */
     425    CLSID *id       /* [out] GUID converted from string */
    425426) {
    426427  BYTE *s = (BYTE *) idstr;
    427428  BYTE *p;
    428   int   i;
     429  int   i;
    429430  BYTE table[256];
    430431
    431432  if (!s)
    432           s = "{00000000-0000-0000-0000-000000000000}";
     433      s = "{00000000-0000-0000-0000-000000000000}";
    433434  else {  /* validate the CLSID string */
    434435
     
    467468  p = (BYTE *) id;
    468469
    469   s++;  /* skip leading brace  */
     470  s++;  /* skip leading brace  */
    470471  for (i = 0; i < 4; i++) {
    471472    p[3 - i] = table[*s]<<4 | table[*(s+1)];
     
    473474  }
    474475  p += 4;
    475   s++;  /* skip - */
     476  s++;  /* skip - */
    476477
    477478  for (i = 0; i < 2; i++) {
     
    480481  }
    481482  p += 2;
    482   s++;  /* skip - */
     483  s++;  /* skip - */
    483484
    484485  for (i = 0; i < 2; i++) {
     
    487488  }
    488489  p += 2;
    489   s++;  /* skip - */
     490  s++;  /* skip - */
    490491
    491492  /* these are just sequential bytes */
     
    494495    s += 2;
    495496  }
    496   s++;  /* skip - */
     497  s++;  /* skip - */
    497498
    498499  for (i = 0; i < 6; i++) {
     
    505506
    506507/******************************************************************************
    507  *              CoCreateGuid[OLE32.6]
     508 *      CoCreateGuid[OLE32.6]
    508509 *
    509510 */
    510511HRESULT WINAPI CoCreateGuid(
    511         GUID *pguid /* [out] points to the GUID to initialize */
     512    GUID *pguid /* [out] points to the GUID to initialize */
    512513) {
    513514    return UuidCreate(pguid);
     
    515516
    516517/******************************************************************************
    517  *              CLSIDFromString [OLE32.3]
    518  * Converts a unique identifier from its string representation into 
     518 *      CLSIDFromString [OLE32.3]
     519 * Converts a unique identifier from its string representation into
    519520 * the GUID struct.
    520521 *
     
    523524 *
    524525 * RETURNS
    525  *      the converted GUID
     526 *  the converted GUID
    526527 */
    527528HRESULT WINAPI CLSIDFromString(
    528         LPCOLESTR idstr,        /* [in] string representation of GUID */
    529         CLSID *id               /* [out] GUID represented by above string */
     529    LPCOLESTR idstr,    /* [in] string representation of GUID */
     530    CLSID *id       /* [out] GUID represented by above string */
    530531) {
    531532    LPOLESTR16      xid = HEAP_strdupWtoA(GetProcessHeap(),0,idstr);
     
    540541
    541542/******************************************************************************
    542  *              WINE_StringFromCLSID    [Internal]
     543 *      WINE_StringFromCLSID    [Internal]
    543544 * Converts a GUID into the respective string representation.
    544545 *
     
    546547 *
    547548 * RETURNS
    548  *      the string representation and HRESULT
     549 *  the string representation and HRESULT
    549550 */
    550551#ifdef __WIN32OS2__
    551552HRESULT WINAPI WINE_StringFromCLSID(
    552         const CLSID *id,        /* [in] GUID to be converted */
    553         LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
     553    const CLSID *id,    /* [in] GUID to be converted */
     554    LPSTR idstr     /* [out] pointer to buffer to contain converted guid */
    554555#else
    555556static HRESULT WINE_StringFromCLSID(
    556         const CLSID *id,        /* [in] GUID to be converted */
    557         LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
     557    const CLSID *id,    /* [in] GUID to be converted */
     558    LPSTR idstr     /* [out] pointer to buffer to contain converted guid */
    558559#endif
    559560) {
    560561  static const char *hex = "0123456789ABCDEF";
    561562  char *s;
    562   int   i;
     563  int   i;
    563564
    564565  if (!id)
    565         { ERR("called with id=Null\n");
    566           *idstr = 0x00;
    567           return E_FAIL;
    568         }
    569        
     566    { ERR("called with id=Null\n");
     567      *idstr = 0x00;
     568      return E_FAIL;
     569    }
     570
    570571  sprintf(idstr, "{%08lX-%04X-%04X-%02X%02X-",
    571           id->Data1, id->Data2, id->Data3,
    572           id->Data4[0], id->Data4[1]);
     572      id->Data1, id->Data2, id->Data3,
     573      id->Data4[0], id->Data4[1]);
    573574  s = &idstr[25];
    574575
     
    588589#ifndef __WIN32OS2__
    589590/******************************************************************************
    590  *              StringFromCLSID16       [COMPOBJ.19]
     591 *      StringFromCLSID16   [COMPOBJ.19]
    591592 * Converts a GUID into the respective string representation.
    592593 * The target string is allocated using the OLE IMalloc.
    593594 * RETURNS
    594  *      the string representation and HRESULT
     595 *  the string representation and HRESULT
    595596 */
    596597HRESULT WINAPI StringFromCLSID16(
    597598        REFCLSID id,            /* [in] the GUID to be converted */
    598         LPOLESTR16 *idstr       /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */
     599    LPOLESTR16 *idstr   /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */
    599600
    600601) {
    601602    extern BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
    602603                                           DWORD cbArgs, LPVOID pArgs, LPDWORD pdwRetCode );
    603     LPMALLOC16  mllc;
    604     HRESULT     ret;
    605     DWORD       args[2];
     604    LPMALLOC16  mllc;
     605    HRESULT ret;
     606    DWORD   args[2];
    606607
    607608    ret = CoGetMalloc16(0,&mllc);
     
    615616     */
    616617    if (!K32WOWCallback16Ex(
    617         (DWORD)((ICOM_VTABLE(IMalloc16)*)MapSL(
     618        (DWORD)((ICOM_VTABLE(IMalloc16)*)MapSL(
    618619            (SEGPTR)ICOM_VTBL(((LPMALLOC16)MapSL((SEGPTR)mllc))))
    619         )->Alloc,
    620         WCB16_CDECL,
    621         2*sizeof(DWORD),
    622         (LPVOID)args,
    623         (LPDWORD)idstr
     620    )->Alloc,
     621    WCB16_CDECL,
     622    2*sizeof(DWORD),
     623    (LPVOID)args,
     624    (LPDWORD)idstr
    624625    )) {
    625         WARN("CallTo16 IMalloc16 failed\n");
    626         return E_FAIL;
     626        WARN("CallTo16 IMalloc16 failed\n");
     627        return E_FAIL;
    627628    }
    628629    return WINE_StringFromCLSID(id,MapSL((SEGPTR)*idstr));
     
    630631#endif
    631632/******************************************************************************
    632  *              StringFromCLSID [OLE32.151]
     633 *      StringFromCLSID [OLE32.151]
    633634 * Converts a GUID into the respective string representation.
    634635 * The target string is allocated using the OLE IMalloc.
    635636 * RETURNS
    636  *      the string representation and HRESULT
     637 *  the string representation and HRESULT
    637638 */
    638639HRESULT WINAPI StringFromCLSID(
    639640        REFCLSID id,            /* [in] the GUID to be converted */
    640         LPOLESTR *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */
     641    LPOLESTR *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */
    641642) {
    642         char            buf[80];
    643         HRESULT       ret;
    644         LPMALLOC        mllc;
    645 
    646         if ((ret=CoGetMalloc(0,&mllc)))
    647                 return ret;
    648 
    649         ret=WINE_StringFromCLSID(id,buf);
    650         if (!ret) {
     643    char            buf[80];
     644    HRESULT       ret;
     645    LPMALLOC    mllc;
     646
     647    if ((ret=CoGetMalloc(0,&mllc)))
     648        return ret;
     649
     650    ret=WINE_StringFromCLSID(id,buf);
     651    if (!ret) {
    651652            DWORD len = MultiByteToWideChar( CP_ACP, 0, buf, -1, NULL, 0 );
    652653            *idstr = IMalloc_Alloc( mllc, len * sizeof(WCHAR) );
    653654            MultiByteToWideChar( CP_ACP, 0, buf, -1, *idstr, len );
    654         }
    655         return ret;
    656 }
    657 
    658 /******************************************************************************
    659  *              StringFromGUID2 [COMPOBJ.76] [OLE32.152]
     655    }
     656    return ret;
     657}
     658
     659/******************************************************************************
     660 *      StringFromGUID2 [COMPOBJ.76] [OLE32.152]
    660661 *
    661662 * Converts a global unique identifier into a string of an API-
     
    663664 *
    664665 * RETURNS
    665  *      The (UNICODE) string representation of the GUID in 'str'
    666  *      The length of the resulting string, 0 if there was any problem.
     666 *  The (UNICODE) string representation of the GUID in 'str'
     667 *  The length of the resulting string, 0 if there was any problem.
    667668 */
    668669INT WINAPI
    669670StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
    670671{
    671   char          xguid[80];
     672  char      xguid[80];
    672673
    673674  if (WINE_StringFromCLSID(id,xguid))
    674         return 0;
     675    return 0;
    675676  return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
    676677}
     
    729730
    730731/******************************************************************************
    731  *              CLSIDFromProgID16       [COMPOBJ.61]
     732 *      CLSIDFromProgID16   [COMPOBJ.61]
    732733 * Converts a program id into the respective GUID. (By using a registry lookup)
    733734 * RETURNS
    734  *      riid associated with the progid
     735 *  riid associated with the progid
    735736 */
    736737HRESULT WINAPI CLSIDFromProgID16(
    737         LPCOLESTR16 progid,     /* [in] program id as found in registry */
    738         LPCLSID riid            /* [out] associated CLSID */
     738    LPCOLESTR16 progid, /* [in] program id as found in registry */
     739    LPCLSID riid        /* [out] associated CLSID */
    739740) {
    740         char    *buf,buf2[80];
    741         DWORD   buf2len;
    742         HRESULT err;
    743         HKEY    xhkey;
    744 
    745         buf = HeapAlloc(GetProcessHeap(),0,strlen(progid)+8);
    746         sprintf(buf,"%s\\CLSID",progid);
    747         if ((err=RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&xhkey))) {
    748                 HeapFree(GetProcessHeap(),0,buf);
     741    char    *buf,buf2[80];
     742    DWORD   buf2len;
     743    HRESULT err;
     744    HKEY    xhkey;
     745
     746    buf = HeapAlloc(GetProcessHeap(),0,strlen(progid)+8);
     747    sprintf(buf,"%s\\CLSID",progid);
     748    if ((err=RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&xhkey))) {
     749        HeapFree(GetProcessHeap(),0,buf);
    749750                return CO_E_CLASSSTRING;
    750         }
    751         HeapFree(GetProcessHeap(),0,buf);
    752         buf2len = sizeof(buf2);
    753         if ((err=RegQueryValueA(xhkey,NULL,buf2,&buf2len))) {
    754                 RegCloseKey(xhkey);
     751    }
     752    HeapFree(GetProcessHeap(),0,buf);
     753    buf2len = sizeof(buf2);
     754    if ((err=RegQueryValueA(xhkey,NULL,buf2,&buf2len))) {
     755        RegCloseKey(xhkey);
    755756                return CO_E_CLASSSTRING;
    756         }
    757         RegCloseKey(xhkey);
    758         return CLSIDFromString16(buf2,riid);
    759 }
    760 
    761 /******************************************************************************
    762  *              CLSIDFromProgID [OLE32.2]
     757    }
     758    RegCloseKey(xhkey);
     759    return CLSIDFromString16(buf2,riid);
     760}
     761
     762/******************************************************************************
     763 *      CLSIDFromProgID [OLE32.2]
    763764 * Converts a program id into the respective GUID. (By using a registry lookup)
    764765 * RETURNS
    765  *      riid associated with the progid
     766 *  riid associated with the progid
    766767 */
    767768HRESULT WINAPI CLSIDFromProgID(
    768         LPCOLESTR progid,       /* [in] program id as found in registry */
    769         LPCLSID riid            /* [out] associated CLSID */
     769    LPCOLESTR progid,   /* [in] program id as found in registry */
     770    LPCLSID riid        /* [out] associated CLSID */
    770771) {
    771         LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
    772         HRESULT       ret = CLSIDFromProgID16(pid,riid);
    773 
    774         HeapFree(GetProcessHeap(),0,pid);
    775         return ret;
     772    LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
     773    HRESULT       ret = CLSIDFromProgID16(pid,riid);
     774
     775    HeapFree(GetProcessHeap(),0,pid);
     776    return ret;
    776777}
    777778
     
    782783 *
    783784 * This function returns the CLSID of the DLL that implements the proxy and stub
    784  * for the specified interface. 
    785  *
    786  * It determines this by searching the 
     785 * for the specified interface.
     786 *
     787 * It determines this by searching the
    787788 * HKEY_CLASSES_ROOT\Interface\{string form of riid}\ProxyStubClsid32 in the registry
    788789 * and any interface id registered by CoRegisterPSClsid within the current process.
    789  * 
     790 *
    790791 * FIXME: We only search the registry, not ids registered with CoRegisterPSClsid.
    791792 */
     
    822823
    823824    /* ... Once we have the key, query the registry to get the
    824        value of CLSID as a string, and convert it into a 
     825       value of CLSID as a string, and convert it into a
    825826       proper CLSID structure to be passed back to the app */
    826827    buf2len = sizeof(buf2);
     
    846847
    847848/***********************************************************************
    848  *              WriteClassStm
     849 *      WriteClassStm
    849850 *
    850851 * This function write a CLSID on stream
     
    861862
    862863/***********************************************************************
    863  *              ReadClassStm
     864 *      ReadClassStm
    864865 *
    865866 * This function read a CLSID from a stream
     
    869870    ULONG nbByte;
    870871    HRESULT res;
    871    
     872
    872873    TRACE("(%p,%p)\n",pStm,rclsid);
    873874
    874875    if (rclsid==NULL)
    875876        return E_INVALIDARG;
    876    
     877
    877878    res = IStream_Read(pStm,(void*)rclsid,sizeof(CLSID),&nbByte);
    878879
    879880    if (FAILED(res))
    880881        return res;
    881    
     882
    882883    if (nbByte != sizeof(CLSID))
    883884        return S_FALSE;
     
    892893 */
    893894HRESULT WINAPI LookupETask16(HTASK16 *hTask,LPVOID p) {
    894         FIXME("(%p,%p),stub!\n",hTask,p);
    895         if ((*hTask = GetCurrentTask()) == hETask) {
    896                 memcpy(p, Table_ETask, sizeof(Table_ETask));
    897         }
    898         return 0;
     895    FIXME("(%p,%p),stub!\n",hTask,p);
     896    if ((*hTask = GetCurrentTask()) == hETask) {
     897        memcpy(p, Table_ETask, sizeof(Table_ETask));
     898    }
     899    return 0;
    899900}
    900901
     
    905906HRESULT WINAPI SetETask16(HTASK16 hTask, LPVOID p) {
    906907        FIXME("(%04x,%p),stub!\n",hTask,p);
    907         hETask = hTask;
    908         return 0;
     908    hETask = hTask;
     909    return 0;
    909910}
    910911
     
    914915 */
    915916HRESULT WINAPI CallObjectInWOW(LPVOID p1,LPVOID p2) {
    916         FIXME("(%p,%p),stub!\n",p1,p2);
    917         return 0;
    918 }
    919 
    920 /******************************************************************************
    921  *              CoRegisterClassObject16 [COMPOBJ.5]
     917    FIXME("(%p,%p),stub!\n",p1,p2);
     918    return 0;
     919}
     920
     921/******************************************************************************
     922 *      CoRegisterClassObject16 [COMPOBJ.5]
    922923 *
    923924 * Don't know where it registers it ...
    924925 */
    925926HRESULT WINAPI CoRegisterClassObject16(
    926         REFCLSID rclsid,
    927         LPUNKNOWN pUnk,
    928         DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
    929         DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
    930         LPDWORD lpdwRegister
     927    REFCLSID rclsid,
     928    LPUNKNOWN pUnk,
     929    DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
     930    DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
     931    LPDWORD lpdwRegister
    931932) {
    932         char    buf[80];
    933 
    934         WINE_StringFromCLSID(rclsid,buf);
    935 
    936         FIXME("(%s,%p,0x%08lx,0x%08lx,%p),stub\n",
    937                 buf,pUnk,dwClsContext,flags,lpdwRegister
    938         );
    939         return 0;
     933    char    buf[80];
     934
     935    WINE_StringFromCLSID(rclsid,buf);
     936
     937    FIXME("(%s,%p,0x%08lx,0x%08lx,%p),stub\n",
     938        buf,pUnk,dwClsContext,flags,lpdwRegister
     939    );
     940    return 0;
    940941}
    941942
     
    956957 * COM_GetRegisteredClassObject
    957958 *
    958  * This internal method is used to scan the registered class list to 
     959 * This internal method is used to scan the registered class list to
    959960 * find a class object.
    960961 *
    961  * Params: 
     962 * Params:
    962963 *   rclsid        Class ID of the class to find.
    963964 *   dwClsContext  Class context to match.
     
    967968 */
    968969static HRESULT COM_GetRegisteredClassObject(
    969         REFCLSID    rclsid,
    970         DWORD       dwClsContext,
    971         LPUNKNOWN*  ppUnk)
     970    REFCLSID    rclsid,
     971    DWORD       dwClsContext,
     972    LPUNKNOWN*  ppUnk)
    972973{
    973974  RegisteredClass* curClass;
     
    10181019
    10191020/******************************************************************************
    1020  *              CoRegisterClassObject   [OLE32.36]
     1021 *      CoRegisterClassObject   [OLE32.36]
    10211022 *
    10221023 * This method will register the class object for a given class ID.
     
    10251026 */
    10261027HRESULT WINAPI CoRegisterClassObject(
    1027         REFCLSID rclsid,
    1028         LPUNKNOWN pUnk,
    1029         DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
    1030         DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
    1031         LPDWORD lpdwRegister
    1032 ) 
     1028    REFCLSID rclsid,
     1029    LPUNKNOWN pUnk,
     1030    DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
     1031    DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
     1032    LPDWORD lpdwRegister
     1033)
    10331034{
    10341035  RegisteredClass* newClass;
     
    10401041
    10411042  TRACE("(%s,%p,0x%08lx,0x%08lx,%p)\n",
    1042         buf,pUnk,dwClsContext,flags,lpdwRegister);
     1043    buf,pUnk,dwClsContext,flags,lpdwRegister);
    10431044
    10441045  /*
     
    10711072    return CO_E_OBJISREG;
    10721073  }
    1073    
     1074
    10741075  /*
    10751076   * If it is not registered, we must create a new entry for this class and
     
    11021103   */
    11031104  *lpdwRegister = newClass->dwCookie;
    1104    
     1105
    11051106  /*
    11061107   * We're successful Yippee!
     
    11171118 */
    11181119HRESULT WINAPI CoRevokeClassObject(
    1119         DWORD dwRegister) 
     1120        DWORD dwRegister)
    11201121{
    11211122  RegisteredClass** prevClassLink;
     
    11751176    REFIID iid, LPVOID *ppv
    11761177) {
    1177     LPUNKNOWN   regClassObject;
    1178     HRESULT     hres = E_UNEXPECTED;
    1179     char        xclsid[80];
     1178    LPUNKNOWN   regClassObject;
     1179    HRESULT hres = E_UNEXPECTED;
     1180    char    xclsid[80];
    11801181    WCHAR dllName[MAX_PATH+1];
    11811182    DWORD dllNameLen = sizeof(dllName);
    11821183    HINSTANCE hLibrary;
    11831184#ifdef __WIN32OS2__
    1184     typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid, 
    1185                              REFIID iid, LPVOID *ppv);
     1185    typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid,
     1186                 REFIID iid, LPVOID *ppv);
    11861187#else
    1187     typedef HRESULT CALLBACK (*DllGetClassObjectFunc)(REFCLSID clsid, 
    1188                              REFIID iid, LPVOID *ppv);
     1188    typedef HRESULT CALLBACK (*DllGetClassObjectFunc)(REFCLSID clsid,
     1189                 REFIID iid, LPVOID *ppv);
    11891190#endif
    11901191    DllGetClassObjectFunc DllGetClassObject;
     
    11931194
    11941195    TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n",
    1195         debugstr_guid(rclsid),
    1196         debugstr_guid(iid)
     1196    debugstr_guid(rclsid),
     1197    debugstr_guid(iid)
    11971198    );
    11981199
    11991200    if (pServerInfo) {
    1200         FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName));
    1201         FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo);
     1201    FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName));
     1202    FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo);
    12021203    }
    12031204
    12041205    /*
    1205      * First, try and see if we can't match the class ID with one of the 
     1206     * First, try and see if we can't match the class ID with one of the
    12061207     * registered classes.
    12071208     */
     
    12281229    ){
    12291230        FIXME("%s %s not supported!\n",
    1230                 (dwClsContext&CLSCTX_LOCAL_SERVER)?"CLSCTX_LOCAL_SERVER":"",
    1231                 (dwClsContext&CLSCTX_REMOTE_SERVER)?"CLSCTX_REMOTE_SERVER":""
    1232         );
    1233         return E_ACCESSDENIED;
     1231        (dwClsContext&CLSCTX_LOCAL_SERVER)?"CLSCTX_LOCAL_SERVER":"",
     1232        (dwClsContext&CLSCTX_REMOTE_SERVER)?"CLSCTX_REMOTE_SERVER":""
     1233    );
     1234    return E_ACCESSDENIED;
    12341235    }
    12351236
    12361237    if ((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext) {
    12371238        HKEY key;
    1238         char buf[200];
    1239 
    1240         sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
     1239    char buf[200];
     1240
     1241    sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
    12411242        hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
    12421243
    1243         if (hres != ERROR_SUCCESS) {
    1244             return REGDB_E_CLASSNOTREG;
    1245         }
    1246 
    1247         memset(dllName,0,sizeof(dllName));
    1248         hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
    1249         if (hres)
    1250                 return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
    1251         RegCloseKey(key);
    1252         TRACE("found InprocServer32 dll %s\n", debugstr_w(dllName));
    1253 
    1254         /* open dll, call DllGetClassObject */
    1255         hLibrary = CoLoadLibrary(dllName, TRUE);
    1256         if (hLibrary == 0) {
    1257             FIXME("couldn't load InprocServer32 dll %s\n", debugstr_w(dllName));
    1258             return E_ACCESSDENIED; /* or should this be CO_E_DLLNOTFOUND? */
    1259         }
    1260         DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject");
    1261         if (!DllGetClassObject) {
    1262             /* not sure if this should be called here CoFreeLibrary(hLibrary);*/
    1263             FIXME("couldn't find function DllGetClassObject in %s\n", debugstr_w(dllName));
    1264             return E_ACCESSDENIED;
    1265         }
    1266 
    1267         /*
    1268         * Ask the DLL for its class object. (there was a note here about class
    1269         * factories but this is good.
    1270         */
    1271         return DllGetClassObject(rclsid, iid, ppv);
     1244    if (hres != ERROR_SUCCESS) {
     1245        return REGDB_E_CLASSNOTREG;
     1246    }
     1247
     1248    memset(dllName,0,sizeof(dllName));
     1249    hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
     1250    if (hres)
     1251        return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
     1252    RegCloseKey(key);
     1253    TRACE("found InprocServer32 dll %s\n", debugstr_w(dllName));
     1254
     1255    /* open dll, call DllGetClassObject */
     1256    hLibrary = CoLoadLibrary(dllName, TRUE);
     1257    if (hLibrary == 0) {
     1258        FIXME("couldn't load InprocServer32 dll %s\n", debugstr_w(dllName));
     1259        return E_ACCESSDENIED; /* or should this be CO_E_DLLNOTFOUND? */
     1260    }
     1261    DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject");
     1262    if (!DllGetClassObject) {
     1263        /* not sure if this should be called here CoFreeLibrary(hLibrary);*/
     1264        FIXME("couldn't find function DllGetClassObject in %s\n", debugstr_w(dllName));
     1265        return E_ACCESSDENIED;
     1266    }
     1267
     1268    /*
     1269    * Ask the DLL for its class object. (there was a note here about class
     1270    * factories but this is good.
     1271    */
     1272    return DllGetClassObject(rclsid, iid, ppv);
    12721273    }
    12731274    return hres;
     
    12811282HRESULT WINAPI CoResumeClassObjects(void)
    12821283{
    1283         FIXME("\n");
    1284         return S_OK;
     1284    FIXME("\n");
     1285    return S_OK;
    12851286}
    12861287
     
    13161317       pattern in the registry. this case is not frequently used ! so I present only the psodocode for
    13171318       this case
    1318        
     1319
    13191320     for(i=0;i<nFileTypes;i++)
    13201321
     
    13491350    length=lstrlenW(absFile);
    13501351    for(i=length-1; ( (i>=0) && (extention[i]=absFile[i]) );i--);
    1351        
     1352
    13521353    /* get the progId associated to the extension */
    13531354    progId=CoTaskMemAlloc(sizeProgId);
     
    13771378#ifndef __WIN32OS2__
    13781379/******************************************************************************
    1379  *              CoRegisterMessageFilter16       [COMPOBJ.27]
     1380 *      CoRegisterMessageFilter16   [COMPOBJ.27]
    13801381 */
    13811382HRESULT WINAPI CoRegisterMessageFilter16(
    1382         LPMESSAGEFILTER lpMessageFilter,
    1383         LPMESSAGEFILTER *lplpMessageFilter
     1383    LPMESSAGEFILTER lpMessageFilter,
     1384    LPMESSAGEFILTER *lplpMessageFilter
    13841385) {
    1385         FIXME("(%p,%p),stub!\n",lpMessageFilter,lplpMessageFilter);
    1386         return 0;
     1386    FIXME("(%p,%p),stub!\n",lpMessageFilter,lplpMessageFilter);
     1387    return 0;
    13871388}
    13881389#endif
     
    13921393 */
    13931394HRESULT WINAPI CoCreateInstance(
    1394         REFCLSID rclsid,
    1395         LPUNKNOWN pUnkOuter,
    1396         DWORD dwClsContext,
    1397         REFIID iid,
    1398         LPVOID *ppv)
    1399 {
    1400         HRESULT hres;
    1401         LPCLASSFACTORY lpclf = 0;
     1395    REFCLSID rclsid,
     1396    LPUNKNOWN pUnkOuter,
     1397    DWORD dwClsContext,
     1398    REFIID iid,
     1399    LPVOID *ppv)
     1400{
     1401    HRESULT hres;
     1402    LPCLASSFACTORY lpclf = 0;
    14021403
    14031404  /*
     
    14111412   */
    14121413  *ppv = 0;
    1413  
     1414
    14141415  /*
    14151416   * Get a class factory to construct the object we want.
    14161417   */
    14171418  hres = CoGetClassObject(rclsid,
    1418                           dwClsContext,
    1419                           NULL,
    1420                           &IID_IClassFactory,
    1421                           (LPVOID)&lpclf);
     1419              dwClsContext,
     1420              NULL,
     1421              &IID_IClassFactory,
     1422              (LPVOID)&lpclf);
    14221423
    14231424  if (FAILED(hres)) {
     
    14291430   * Create the object and don't forget to release the factory
    14301431   */
    1431         hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
    1432         IClassFactory_Release(lpclf);
    1433 
    1434         return hres;
     1432    hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
     1433    IClassFactory_Release(lpclf);
     1434
     1435    return hres;
    14351436}
    14361437
     
    14391440 */
    14401441HRESULT WINAPI CoCreateInstanceEx(
    1441   REFCLSID      rclsid, 
     1442  REFCLSID      rclsid,
    14421443  LPUNKNOWN     pUnkOuter,
    1443   DWORD         dwClsContext, 
     1444  DWORD         dwClsContext,
    14441445  COSERVERINFO* pServerInfo,
    14451446  ULONG         cmq,
     
    14721473   * Get the object and get its IUnknown pointer.
    14731474   */
    1474   hr = CoCreateInstance(rclsid, 
    1475                         pUnkOuter,
    1476                         dwClsContext,
    1477                         &IID_IUnknown,
    1478                         (VOID**)&pUnk);
     1475  hr = CoCreateInstance(rclsid,
     1476            pUnkOuter,
     1477            dwClsContext,
     1478            &IID_IUnknown,
     1479            (VOID**)&pUnk);
    14791480
    14801481  if (hr)
     
    14871488  {
    14881489    pResults[index].hr = IUnknown_QueryInterface(pUnk,
    1489                                                 pResults[index].pIID,
    1490                                                 (VOID**)&(pResults[index].pItf));
     1490                        pResults[index].pIID,
     1491                        (VOID**)&(pResults[index].pItf));
    14911492
    14921493    if (pResults[index].hr == S_OK)
     
    15191520    prev = NULL;
    15201521    for (ptr = openDllList; ptr != NULL; ptr=ptr->next) {
    1521         if (ptr->hLibrary == hLibrary) {
    1522             break;
    1523         }
    1524         prev = ptr;
     1522    if (ptr->hLibrary == hLibrary) {
     1523        break;
     1524    }
     1525    prev = ptr;
    15251526    }
    15261527
    15271528    if (ptr == NULL) {
    1528         /* shouldn't happen if user passed in a valid hLibrary */
    1529         return;
     1529    /* shouldn't happen if user passed in a valid hLibrary */
     1530    return;
    15301531    }
    15311532    /* assert: ptr points to the library entry to free */
     
    15341535    FreeLibrary(hLibrary);
    15351536    if (ptr == openDllList) {
    1536         tmp = openDllList->next;
    1537         HeapFree(GetProcessHeap(), 0, openDllList);
    1538         openDllList = tmp;
     1537    tmp = openDllList->next;
     1538    HeapFree(GetProcessHeap(), 0, openDllList);
     1539    openDllList = tmp;
    15391540    } else {
    1540         tmp = ptr->next;
    1541         HeapFree(GetProcessHeap(), 0, ptr);
    1542         prev->next = tmp;
     1541    tmp = ptr->next;
     1542    HeapFree(GetProcessHeap(), 0, ptr);
     1543    prev->next = tmp;
    15431544    }
    15441545
     
    15541555
    15551556    for (ptr = openDllList; ptr != NULL; ) {
    1556         tmp=ptr->next;
    1557         CoFreeLibrary(ptr->hLibrary);
    1558         ptr = tmp;
     1557    tmp=ptr->next;
     1558    CoFreeLibrary(ptr->hLibrary);
     1559    ptr = tmp;
    15591560    }
    15601561}
     
    15721573
    15731574    for (ptr = openDllList; ptr != NULL; ) {
    1574         DllCanUnloadNow = (DllCanUnloadNowFunc)
    1575             GetProcAddress(ptr->hLibrary, "DllCanUnloadNow");
    1576        
    1577         if ( (DllCanUnloadNow != NULL) &&
    1578              (DllCanUnloadNow() == S_OK) ) {
    1579             tmp=ptr->next;
    1580             CoFreeLibrary(ptr->hLibrary);
    1581             ptr = tmp;
    1582         } else {
    1583             ptr=ptr->next;
    1584         }
     1575    DllCanUnloadNow = (DllCanUnloadNowFunc)
     1576        GetProcAddress(ptr->hLibrary, "DllCanUnloadNow");
     1577
     1578    if ( (DllCanUnloadNow != NULL) &&
     1579         (DllCanUnloadNow() == S_OK) ) {
     1580        tmp=ptr->next;
     1581        CoFreeLibrary(ptr->hLibrary);
     1582        ptr = tmp;
     1583    } else {
     1584        ptr=ptr->next;
     1585    }
    15851586    }
    15861587}
     
    15891590 *           CoFileTimeNow [COMPOBJ.82, OLE32.10]
    15901591 * RETURNS
    1591  *      the current system time in lpFileTime
     1592 *  the current system time in lpFileTime
    15921593 */
    15931594HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime ) /* [out] the current time */
     
    16001601 *           CoTaskMemAlloc (OLE32.43)
    16011602 * RETURNS
    1602  *      pointer to newly allocated block
     1603 *  pointer to newly allocated block
    16031604 */
    16041605LPVOID WINAPI CoTaskMemAlloc(
    1605         ULONG size      /* [in] size of memoryblock to be allocated */
     1606    ULONG size  /* [in] size of memoryblock to be allocated */
    16061607) {
    1607     LPMALLOC    lpmalloc;
    1608     HRESULT     ret = CoGetMalloc(0,&lpmalloc);
    1609 
    1610     if (FAILED(ret)) 
    1611         return NULL;
     1608    LPMALLOC    lpmalloc;
     1609    HRESULT ret = CoGetMalloc(0,&lpmalloc);
     1610
     1611    if (FAILED(ret))
     1612    return NULL;
    16121613
    16131614    return IMalloc_Alloc(lpmalloc,size);
     
    16171618 */
    16181619VOID WINAPI CoTaskMemFree(
    1619         LPVOID ptr      /* [in] pointer to be freed */
     1620    LPVOID ptr  /* [in] pointer to be freed */
    16201621) {
    1621     LPMALLOC    lpmalloc;
    1622     HRESULT     ret = CoGetMalloc(0,&lpmalloc);
    1623 
    1624     if (FAILED(ret)) 
     1622    LPMALLOC    lpmalloc;
     1623    HRESULT ret = CoGetMalloc(0,&lpmalloc);
     1624
     1625    if (FAILED(ret))
    16251626      return;
    16261627
     
    16311632 *           CoTaskMemRealloc (OLE32.45)
    16321633 * RETURNS
    1633  *      pointer to newly allocated block
     1634 *  pointer to newly allocated block
    16341635 */
    16351636LPVOID WINAPI CoTaskMemRealloc(
    16361637  LPVOID pvOld,
    1637   ULONG  size)  /* [in] size of memoryblock to be allocated */
     1638  ULONG  size)  /* [in] size of memoryblock to be allocated */
    16381639{
    16391640  LPMALLOC lpmalloc;
    16401641  HRESULT  ret = CoGetMalloc(0,&lpmalloc);
    1641  
    1642   if (FAILED(ret)) 
     1642
     1643  if (FAILED(ret))
    16431644    return NULL;
    16441645
     
    16541655    OpenDll *ptr;
    16551656    OpenDll *tmp;
    1656  
     1657
    16571658    TRACE("(%s, %d)\n", debugstr_w(lpszLibName), bAutoFree);
    16581659
     
    16601661
    16611662    if (!bAutoFree)
    1662         return hLibrary;
     1663    return hLibrary;
    16631664
    16641665    if (openDllList == NULL) {
    16651666        /* empty list -- add first node */
    16661667        openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
    1667         openDllList->hLibrary=hLibrary;
    1668         openDllList->next = NULL;
     1668    openDllList->hLibrary=hLibrary;
     1669    openDllList->next = NULL;
    16691670    } else {
    16701671        /* search for this dll */
    16711672        int found = FALSE;
    16721673        for (ptr = openDllList; ptr->next != NULL; ptr=ptr->next) {
    1673             if (ptr->hLibrary == hLibrary) {
    1674                 found = TRUE;
    1675                 break;
    1676             }
     1674        if (ptr->hLibrary == hLibrary) {
     1675            found = TRUE;
     1676        break;
    16771677        }
    1678         if (!found) {
    1679             /* dll not found, add it */
    1680             tmp = openDllList;
    1681             openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
    1682             openDllList->hLibrary = hLibrary;
    1683             openDllList->next = tmp;
    1684         }
    1685     }
    1686      
     1678        }
     1679    if (!found) {
     1680        /* dll not found, add it */
     1681        tmp = openDllList;
     1682        openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
     1683        openDllList->hLibrary = hLibrary;
     1684        openDllList->next = tmp;
     1685    }
     1686    }
     1687
    16871688    return hLibrary;
    16881689}
     
    16981699#ifndef __WIN32OS2__
    16991700/******************************************************************************
    1700  *              CoLockObjectExternal16  [COMPOBJ.63]
     1701 *      CoLockObjectExternal16  [COMPOBJ.63]
    17011702 */
    17021703HRESULT WINAPI CoLockObjectExternal16(
    1703     LPUNKNOWN pUnk,             /* [in] object to be locked */
    1704     BOOL16 fLock,               /* [in] do lock */
    1705     BOOL16 fLastUnlockReleases  /* [in] ? */
     1704    LPUNKNOWN pUnk,     /* [in] object to be locked */
     1705    BOOL16 fLock,       /* [in] do lock */
     1706    BOOL16 fLastUnlockReleases  /* [in] ? */
    17061707) {
    17071708    FIXME("(%p,%d,%d),stub!\n",pUnk,fLock,fLastUnlockReleases);
     
    17111712
    17121713/******************************************************************************
    1713  *              CoLockObjectExternal    [OLE32.31]
     1714 *      CoLockObjectExternal    [OLE32.31]
    17141715 */
    17151716HRESULT WINAPI CoLockObjectExternal(
    1716     LPUNKNOWN pUnk,             /* [in] object to be locked */
    1717     BOOL fLock,         /* [in] do lock */
     1717    LPUNKNOWN pUnk,     /* [in] object to be locked */
     1718    BOOL fLock,     /* [in] do lock */
    17181719    BOOL fLastUnlockReleases) /* [in] unlock all */
    17191720{
    17201721
    1721   if (fLock) 
     1722  if (fLock)
    17221723  {
    1723     /* 
     1724    /*
    17241725     * Increment the external lock coutner, COM_ExternalLockAddRef also
    17251726     * increment the object's internal lock counter.
    17261727     */
    1727     COM_ExternalLockAddRef( pUnk); 
     1728    COM_ExternalLockAddRef( pUnk);
    17281729  }
    17291730  else
    17301731  {
    1731     /* 
     1732    /*
    17321733     * Decrement the external lock coutner, COM_ExternalLockRelease also
    17331734     * decrement the object's internal lock counter.
     
    17651766{
    17661767   FIXME ("(%p %p): stub\n", punkOuter, ppunkMarshal);
    1767    
     1768
    17681769   return S_OK;
    17691770}
     
    17741775 */
    17751776HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
    1776 {       
    1777         FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
    1778         *ppv = NULL;
    1779         return CLASS_E_CLASSNOTAVAILABLE;
     1777{
     1778    FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
     1779    *ppv = NULL;
     1780    return CLASS_E_CLASSNOTAVAILABLE;
    17801781}
    17811782
     
    17841785 * COM_RevokeAllClasses
    17851786 *
    1786  * This method is called when the COM libraries are uninitialized to 
     1787 * This method is called when the COM libraries are uninitialized to
    17871788 * release all the references to the class objects registered with
    17881789 * the library
     
    18011802
    18021803/****************************************************************************
    1803  * Public - Method that increments the count for a IUnknown* in the linked 
     1804 * Public - Method that increments the count for a IUnknown* in the linked
    18041805 * list.  The item is inserted if not already in the list.
    18051806 */
     
    18221823   * Add an internal lock to the object
    18231824   */
    1824   IUnknown_AddRef(pUnk); 
     1825  IUnknown_AddRef(pUnk);
    18251826}
    18261827
    18271828/****************************************************************************
    1828  * Public - Method that decrements the count for a IUnknown* in the linked 
     1829 * Public - Method that decrements the count for a IUnknown* in the linked
    18291830 * list.  The item is removed from the list if its count end up at zero or if
    18301831 * bRelAll is TRUE.
     
    18431844      IUnknown_Release(pUnk);     /* release local locks as well */
    18441845
    1845       if ( bRelAll == FALSE ) 
     1846      if ( bRelAll == FALSE )
    18461847        break;  /* perform single release */
    18471848
    1848     } while ( externalLock->uRefCount > 0 ); 
     1849    } while ( externalLock->uRefCount > 0 );
    18491850
    18501851    if ( externalLock->uRefCount == 0 )  /* get rid of the list entry */
     
    18641865    COM_ExternalLockDelete(head);     /* get rid of the head stuff       */
    18651866
    1866     head = elList.head;               /* get the new head...             */ 
     1867    head = elList.head;               /* get the new head...             */
    18671868  }
    18681869}
     
    18801881  {
    18811882      DPRINTF( "\t%p with %lu references count.\n", current->pUnk, current->uRefCount);
    1882  
    1883     /* Skip to the next item */ 
     1883
     1884    /* Skip to the next item */
    18841885    current = current->next;
    1885   } 
     1886  }
    18861887
    18871888}
     
    19031904  IUnknown         *pUnk)
    19041905{
    1905   if ( element == EL_END_OF_LIST ) 
     1906  if ( element == EL_END_OF_LIST )
    19061907    return EL_NOT_FOUND;
    19071908
     
    19091910    return element;
    19101911
    1911   else                                 /* Not the right guy, keep on looking */ 
     1912  else                                 /* Not the right guy, keep on looking */
    19121913    return COM_ExternalLockLocate( element->next, pUnk);
    19131914}
     
    19291930  if (newLock!=NULL)
    19301931  {
    1931     if ( elList.head == EL_END_OF_LIST ) 
     1932    if ( elList.head == EL_END_OF_LIST )
    19321933    {
    19331934      elList.head = newLock;    /* The list is empty */
    19341935    }
    1935     else 
     1936    else
    19361937    {
    1937       /* 
     1938      /*
    19381939       * insert does it at the head
    19391940       */
     
    19431944
    19441945    /*
    1945      * Set new list item data member 
     1946     * Set new list item data member
    19461947     */
    19471948    newLock->pUnk      = pUnk;
    19481949    newLock->uRefCount = 1;
    19491950    newLock->next      = previousHead;
    1950    
     1951
    19511952    return TRUE;
    19521953  }
     
    19651966  if ( current == itemList )
    19661967  {
    1967     /* 
    1968      * this section handles the deletion of the first node 
     1968    /*
     1969     * this section handles the deletion of the first node
    19691970     */
    19701971    elList.head = itemList->next;
    1971     HeapFree( GetProcessHeap(), 0, itemList); 
     1972    HeapFree( GetProcessHeap(), 0, itemList);
    19721973  }
    19731974  else
    19741975  {
    1975     do 
     1976    do
    19761977    {
    19771978      if ( current->next == itemList )   /* We found the item to free  */
    19781979      {
    19791980        current->next = itemList->next;  /* readjust the list pointers */
    1980  
    1981         HeapFree( GetProcessHeap(), 0, itemList); 
    1982         break; 
     1981
     1982        HeapFree( GetProcessHeap(), 0, itemList);
     1983        break;
    19831984      }
    1984  
    1985       /* Skip to the next item */ 
     1985
     1986      /* Skip to the next item */
    19861987      current = current->next;
    1987  
     1988
    19881989    } while ( current != EL_END_OF_LIST );
    19891990  }
     
    20312032    {
    20322033        res = REGDB_E_CLASSNOTREG;
    2033         goto done;
     2034    goto done;
    20342035    }
    20352036    len = 200;
     
    20392040    {
    20402041        res = REGDB_E_KEYMISSING;
    2041         goto done;
     2042    goto done;
    20422043    }
    20432044    MultiByteToWideChar( CP_ACP, 0, buf, -1, wbuf, sizeof(wbuf)/sizeof(WCHAR) );
     
    20642065    {
    20652066        res = REGDB_E_CLASSNOTREG;
    2066         goto done;
     2067    goto done;
    20672068    }
    20682069    if (RegCreateKeyA(hkey, "AutoConvertTo", &hkeyConvert))
    20692070    {
    20702071        res = REGDB_E_WRITEREGDB;
    2071         goto done;
     2072    goto done;
    20722073    }
    20732074    if (RegSetValueExA(hkeyConvert, NULL, 0,
     
    20752076    {
    20762077        res = REGDB_E_WRITEREGDB;
    2077         goto done;
     2078    goto done;
    20782079    }
    20792080
     
    20912092 *
    20922093 * RETURNS
    2093  *      TRUE if equal
     2094 *  TRUE if equal
    20942095 */
    20952096#undef IsEqualGUID
     
    21102111
    21112112HRESULT WIN32API CLSIDFromStringA(
    2112     LPCSTR              lpsz,           // [in] - ASCII string CLSID
    2113     LPCLSID             pclsid)         // [out] - Binary CLSID
     2113    LPCSTR      lpsz,       // [in] - ASCII string CLSID
     2114    LPCLSID     pclsid)     // [out] - Binary CLSID
    21142115{
    21152116    return CLSIDFromString16(lpsz, pclsid);
Note: See TracChangeset for help on using the changeset viewer.