Ignore:
Timestamp:
Sep 15, 2001, 11:32:00 AM (24 years ago)
Author:
sandervl
Message:

restored old version + wine update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/compobj.c

    r6648 r6711  
    1 /* $Id: compobj.c,v 1.2 2001-09-05 13:17:07 bird Exp $ */
    21/*
    3  *  COMPOBJ library
    4  *
    5  *  Copyright 1995  Martin von Loewis
    6  *  Copyright 1998  Justin Bradford
     2 *      COMPOBJ library
     3 *
     4 *      Copyright 1995  Martin von Loewis
     5 *      Copyright 1998  Justin Bradford
    76 *      Copyright 1999  Francis Beaudet
    87 *  Copyright 1999  Sylvain St-Germain
     
    3837#ifdef __WIN32OS2__
    3938#include <heapstring.h>
     39
     40#undef FIXME
     41#undef TRACE
     42#ifdef DEBUG
     43#define TRACE WriteLog("OLE32: %s", __FUNCTION__); WriteLog
     44#define FIXME WriteLog("FIXME OLE32: %s", __FUNCTION__); WriteLog
     45#else
     46#define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
     47#define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
     48#endif
    4049#endif
    4150
     
    4554 *  COM External Lock structures and methods declaration
    4655 *
    47  *  This api provides a linked list to managed external references to
    48  *  COM objects.
    49  *
    50  *  The public interface consists of three calls:
     56 *  This api provides a linked list to managed external references to 
     57 *  COM objects. 
     58 *
     59 *  The public interface consists of three calls: 
    5160 *      COM_ExternalLockAddRef
    5261 *      COM_ExternalLockRelease
     
    5867
    5968/*
    60  * Declaration of the static structure that manage the
     69 * Declaration of the static structure that manage the 
    6170 * external lock to COM  objects.
    6271 */
     
    8392
    8493/*
    85  * Public Interface to the external lock list
     94 * Public Interface to the external lock list   
    8695 */
    8796static void COM_ExternalLockFreeList();
     
    91100
    92101/*
    93  * Private methods used to managed the linked list
     102 * Private methods used to managed the linked list   
    94103 */
    95104static BOOL COM_ExternalLockInsert(
     
    153162 */
    154163typedef struct tagOpenDll {
    155   HINSTANCE hLibrary;
     164  HINSTANCE hLibrary;       
    156165  struct tagOpenDll *next;
    157166} OpenDll;
     
    164173 */
    165174static HRESULT COM_GetRegisteredClassObject(REFCLSID    rclsid,
    166                         DWORD       dwClsContext,
    167                         LPUNKNOWN*  ppUnk);
     175                                            DWORD       dwClsContext,
     176                                            LPUNKNOWN*  ppUnk);
    168177
    169178static void COM_RevokeAllClasses();
     
    174183 *
    175184 * RETURNS
    176  *  Current build version, hiword is majornumber, loword is minornumber
     185 *      Current build version, hiword is majornumber, loword is minornumber
    177186 */
    178187DWORD WINAPI CoBuildVersion(void)
     
    184193#ifndef __WIN32OS2__
    185194/******************************************************************************
    186  *      CoInitialize16  [COMPOBJ.2]
     195 *              CoInitialize16  [COMPOBJ.2]
    187196 * Set the win16 IMalloc used for memory management
    188197 */
    189198HRESULT WINAPI CoInitialize16(
    190     LPVOID lpReserved   /* [in] pointer to win16 malloc interface */
     199        LPVOID lpReserved       /* [in] pointer to win16 malloc interface */
    191200) {
    192201    currentMalloc16 = (LPMALLOC16)lpReserved;
     
    196205
    197206/******************************************************************************
    198  *      CoInitialize    [OLE32.26]
     207 *              CoInitialize    [OLE32.26]
    199208 *
    200209 * Initializes the COM libraries.
     
    203212 */
    204213HRESULT WINAPI CoInitialize(
    205     LPVOID lpReserved   /* [in] pointer to win32 malloc interface
     214        LPVOID lpReserved       /* [in] pointer to win32 malloc interface
    206215                                   (obsolete, should be NULL) */
    207 )
     216) 
    208217{
    209218  /*
     
    214223
    215224/******************************************************************************
    216  *      CoInitializeEx  [OLE32.163]
     225 *              CoInitializeEx  [OLE32.163]
    217226 *
    218227 * Initializes the COM libraries. The behavior used to set the win32 IMalloc
     
    226235 *
    227236 * BUGS
    228  * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE
     237 * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE 
    229238 * is never returned.
    230239 *
     
    232241 */
    233242HRESULT WINAPI CoInitializeEx(
    234     LPVOID lpReserved,  /* [in] pointer to win32 malloc interface
     243        LPVOID lpReserved,      /* [in] pointer to win32 malloc interface
    235244                                   (obsolete, should be NULL) */
    236     DWORD dwCoInit      /* [in] A value from COINIT specifies the threading model */
    237 )
     245        DWORD dwCoInit          /* [in] A value from COINIT specifies the threading model */
     246) 
    238247{
    239248  HRESULT hr;
     
    249258   * Check for unsupported features.
    250259   */
    251   if (dwCoInit!=COINIT_APARTMENTTHREADED)
     260  if (dwCoInit!=COINIT_APARTMENTTHREADED) 
    252261  {
    253262    FIXME(":(%p,%x): unsupported flag %x\n", lpReserved, (int)dwCoInit, (int)dwCoInit);
     
    284293/***********************************************************************
    285294 *           CoUninitialize16   [COMPOBJ.3]
    286  * Don't know what it does.
     295 * Don't know what it does. 
    287296 * 3-Nov-98 -- this was originally misspelled, I changed it to what I
    288297 *   believe is the correct spelling
     
    305314{
    306315  TRACE("()\n");
    307 
     316 
    308317  /*
    309318   * Decrease the reference count.
    310319   */
    311320  s_COMLockCount--;
    312 
     321 
    313322  /*
    314323   * If we are back to 0 locks on the COM library, make sure we free
     
    344353 *           CoGetMalloc16    [COMPOBJ.4]
    345354 * RETURNS
    346  *  The current win16 IMalloc
     355 *      The current win16 IMalloc
    347356 */
    348357HRESULT WINAPI CoGetMalloc16(
    349     DWORD dwMemContext, /* [in] unknown */
    350     LPMALLOC16 * lpMalloc   /* [out] current win16 malloc interface */
     358        DWORD dwMemContext,     /* [in] unknown */
     359        LPMALLOC16 * lpMalloc   /* [out] current win16 malloc interface */
    351360) {
    352361    if(!currentMalloc16)
    353     currentMalloc16 = IMalloc16_Constructor();
     362        currentMalloc16 = IMalloc16_Constructor();
    354363    *lpMalloc = currentMalloc16;
    355364    return S_OK;
     
    358367
    359368/******************************************************************************
    360  *      CoGetMalloc [OLE32.20]
     369 *              CoGetMalloc     [OLE32.20]
    361370 *
    362371 * RETURNS
    363  *  The current win32 IMalloc
     372 *      The current win32 IMalloc
    364373 */
    365374HRESULT WINAPI CoGetMalloc(
    366     DWORD dwMemContext, /* [in] unknown */
    367     LPMALLOC *lpMalloc  /* [out] current win32 malloc interface */
     375        DWORD dwMemContext,     /* [in] unknown */
     376        LPMALLOC *lpMalloc      /* [out] current win32 malloc interface */
    368377) {
    369378    if(!currentMalloc32)
    370     currentMalloc32 = IMalloc_Constructor();
     379        currentMalloc32 = IMalloc_Constructor();
    371380    *lpMalloc = currentMalloc32;
    372381    return S_OK;
     
    378387 */
    379388HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext,
    380                       LPMALLOC16 *lpMalloc)
     389                                          LPMALLOC16 *lpMalloc)
    381390{
    382391    /* FIXME: docu says we shouldn't return the same allocator as in
     
    387396
    388397/******************************************************************************
    389  *      CoDisconnectObject  [COMPOBJ.15]
     398 *              CoDisconnectObject      [COMPOBJ.15]
    390399 */
    391400HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
     
    401410 *
    402411 * RETURNS
    403  *  TRUE if equal
     412 *      TRUE if equal
    404413 */
    405414BOOL16 WINAPI IsEqualGUID16(
    406     GUID* g1,   /* [in] unique id 1 */
    407     GUID* g2    /* [in] unique id 2 */
     415        GUID* g1,       /* [in] unique id 1 */
     416        GUID* g2        /* [in] unique id 2 */
    408417) {
    409418    return !memcmp( g1, g2, sizeof(GUID) );
     
    412421
    413422/******************************************************************************
    414  *      CLSIDFromString16   [COMPOBJ.20]
    415  * Converts a unique identifier from its string representation into
     423 *              CLSIDFromString16       [COMPOBJ.20]
     424 * Converts a unique identifier from its string representation into 
    416425 * the GUID struct.
    417426 *
    418  * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6]
     427 * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] 
    419428 *
    420429 * RETURNS
    421  *  the converted GUID
     430 *      the converted GUID
    422431 */
    423432HRESULT WINAPI CLSIDFromString16(
    424     LPCOLESTR16 idstr,  /* [in] string representation of guid */
    425     CLSID *id       /* [out] GUID converted from string */
     433        LPCOLESTR16 idstr,      /* [in] string representation of guid */
     434        CLSID *id               /* [out] GUID converted from string */
    426435) {
    427436  BYTE *s = (BYTE *) idstr;
    428437  BYTE *p;
    429   int   i;
     438  int   i;
    430439  BYTE table[256];
    431440
    432441  if (!s)
    433       s = "{00000000-0000-0000-0000-000000000000}";
     442          s = "{00000000-0000-0000-0000-000000000000}";
    434443  else {  /* validate the CLSID string */
    435444
     
    468477  p = (BYTE *) id;
    469478
    470   s++;  /* skip leading brace  */
     479  s++;  /* skip leading brace  */
    471480  for (i = 0; i < 4; i++) {
    472481    p[3 - i] = table[*s]<<4 | table[*(s+1)];
     
    474483  }
    475484  p += 4;
    476   s++;  /* skip - */
     485  s++;  /* skip - */
    477486
    478487  for (i = 0; i < 2; i++) {
     
    481490  }
    482491  p += 2;
    483   s++;  /* skip - */
     492  s++;  /* skip - */
    484493
    485494  for (i = 0; i < 2; i++) {
     
    488497  }
    489498  p += 2;
    490   s++;  /* skip - */
     499  s++;  /* skip - */
    491500
    492501  /* these are just sequential bytes */
     
    495504    s += 2;
    496505  }
    497   s++;  /* skip - */
     506  s++;  /* skip - */
    498507
    499508  for (i = 0; i < 6; i++) {
     
    506515
    507516/******************************************************************************
    508  *      CoCreateGuid[OLE32.6]
     517 *              CoCreateGuid[OLE32.6]
    509518 *
    510519 */
    511520HRESULT WINAPI CoCreateGuid(
    512     GUID *pguid /* [out] points to the GUID to initialize */
     521        GUID *pguid /* [out] points to the GUID to initialize */
    513522) {
    514523    return UuidCreate(pguid);
     
    516525
    517526/******************************************************************************
    518  *      CLSIDFromString [OLE32.3]
    519  * Converts a unique identifier from its string representation into
     527 *              CLSIDFromString [OLE32.3]
     528 * Converts a unique identifier from its string representation into 
    520529 * the GUID struct.
    521530 *
     
    524533 *
    525534 * RETURNS
    526  *  the converted GUID
     535 *      the converted GUID
    527536 */
    528537HRESULT WINAPI CLSIDFromString(
    529     LPCOLESTR idstr,    /* [in] string representation of GUID */
    530     CLSID *id       /* [out] GUID represented by above string */
     538        LPCOLESTR idstr,        /* [in] string representation of GUID */
     539        CLSID *id               /* [out] GUID represented by above string */
    531540) {
    532541    LPOLESTR16      xid = HEAP_strdupWtoA(GetProcessHeap(),0,idstr);
     
    541550
    542551/******************************************************************************
    543  *      WINE_StringFromCLSID    [Internal]
     552 *              WINE_StringFromCLSID    [Internal]
    544553 * Converts a GUID into the respective string representation.
    545554 *
     
    547556 *
    548557 * RETURNS
    549  *  the string representation and HRESULT
     558 *      the string representation and HRESULT
    550559 */
    551560#ifdef __WIN32OS2__
    552561HRESULT WINAPI WINE_StringFromCLSID(
    553     const CLSID *id,    /* [in] GUID to be converted */
    554     LPSTR idstr     /* [out] pointer to buffer to contain converted guid */
     562        const CLSID *id,        /* [in] GUID to be converted */
     563        LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
    555564#else
    556565static HRESULT WINE_StringFromCLSID(
    557     const CLSID *id,    /* [in] GUID to be converted */
    558     LPSTR idstr     /* [out] pointer to buffer to contain converted guid */
     566        const CLSID *id,        /* [in] GUID to be converted */
     567        LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
    559568#endif
    560569) {
    561570  static const char *hex = "0123456789ABCDEF";
    562571  char *s;
    563   int   i;
     572  int   i;
    564573
    565574  if (!id)
    566     { ERR("called with id=Null\n");
    567       *idstr = 0x00;
    568       return E_FAIL;
    569     }
    570 
     575        { ERR("called with id=Null\n");
     576          *idstr = 0x00;
     577          return E_FAIL;
     578        }
     579       
    571580  sprintf(idstr, "{%08lX-%04X-%04X-%02X%02X-",
    572       id->Data1, id->Data2, id->Data3,
    573       id->Data4[0], id->Data4[1]);
     581          id->Data1, id->Data2, id->Data3,
     582          id->Data4[0], id->Data4[1]);
    574583  s = &idstr[25];
    575584
     
    589598#ifndef __WIN32OS2__
    590599/******************************************************************************
    591  *      StringFromCLSID16   [COMPOBJ.19]
     600 *              StringFromCLSID16       [COMPOBJ.19]
    592601 * Converts a GUID into the respective string representation.
    593602 * The target string is allocated using the OLE IMalloc.
    594603 * RETURNS
    595  *  the string representation and HRESULT
     604 *      the string representation and HRESULT
    596605 */
    597606HRESULT WINAPI StringFromCLSID16(
    598607        REFCLSID id,            /* [in] the GUID to be converted */
    599     LPOLESTR16 *idstr   /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */
     608        LPOLESTR16 *idstr       /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */
    600609
    601610) {
    602611    extern BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
    603612                                           DWORD cbArgs, LPVOID pArgs, LPDWORD pdwRetCode );
    604     LPMALLOC16  mllc;
    605     HRESULT ret;
    606     DWORD   args[2];
     613    LPMALLOC16  mllc;
     614    HRESULT     ret;
     615    DWORD       args[2];
    607616
    608617    ret = CoGetMalloc16(0,&mllc);
     
    616625     */
    617626    if (!K32WOWCallback16Ex(
    618         (DWORD)((ICOM_VTABLE(IMalloc16)*)MapSL(
     627        (DWORD)((ICOM_VTABLE(IMalloc16)*)MapSL(
    619628            (SEGPTR)ICOM_VTBL(((LPMALLOC16)MapSL((SEGPTR)mllc))))
    620     )->Alloc,
    621     WCB16_CDECL,
    622     2*sizeof(DWORD),
    623     (LPVOID)args,
    624     (LPDWORD)idstr
     629        )->Alloc,
     630        WCB16_CDECL,
     631        2*sizeof(DWORD),
     632        (LPVOID)args,
     633        (LPDWORD)idstr
    625634    )) {
    626         WARN("CallTo16 IMalloc16 failed\n");
    627         return E_FAIL;
     635        WARN("CallTo16 IMalloc16 failed\n");
     636        return E_FAIL;
    628637    }
    629638    return WINE_StringFromCLSID(id,MapSL((SEGPTR)*idstr));
     
    631640#endif
    632641/******************************************************************************
    633  *      StringFromCLSID [OLE32.151]
     642 *              StringFromCLSID [OLE32.151]
    634643 * Converts a GUID into the respective string representation.
    635644 * The target string is allocated using the OLE IMalloc.
    636645 * RETURNS
    637  *  the string representation and HRESULT
     646 *      the string representation and HRESULT
    638647 */
    639648HRESULT WINAPI StringFromCLSID(
    640649        REFCLSID id,            /* [in] the GUID to be converted */
    641     LPOLESTR *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */
     650        LPOLESTR *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */
    642651) {
    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) {
     652        char            buf[80];
     653        HRESULT       ret;
     654        LPMALLOC        mllc;
     655
     656        if ((ret=CoGetMalloc(0,&mllc)))
     657                return ret;
     658
     659        ret=WINE_StringFromCLSID(id,buf);
     660        if (!ret) {
    652661            DWORD len = MultiByteToWideChar( CP_ACP, 0, buf, -1, NULL, 0 );
    653662            *idstr = IMalloc_Alloc( mllc, len * sizeof(WCHAR) );
    654663            MultiByteToWideChar( CP_ACP, 0, buf, -1, *idstr, len );
    655     }
    656     return ret;
    657 }
    658 
    659 /******************************************************************************
    660  *      StringFromGUID2 [COMPOBJ.76] [OLE32.152]
     664        }
     665        return ret;
     666}
     667
     668/******************************************************************************
     669 *              StringFromGUID2 [COMPOBJ.76] [OLE32.152]
    661670 *
    662671 * Converts a global unique identifier into a string of an API-
     
    664673 *
    665674 * RETURNS
    666  *  The (UNICODE) string representation of the GUID in 'str'
    667  *  The length of the resulting string, 0 if there was any problem.
     675 *      The (UNICODE) string representation of the GUID in 'str'
     676 *      The length of the resulting string, 0 if there was any problem.
    668677 */
    669678INT WINAPI
    670679StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
    671680{
    672   char      xguid[80];
     681  char          xguid[80];
    673682
    674683  if (WINE_StringFromCLSID(id,xguid))
    675     return 0;
     684        return 0;
    676685  return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
    677686}
     
    730739
    731740/******************************************************************************
    732  *      CLSIDFromProgID16   [COMPOBJ.61]
     741 *              CLSIDFromProgID16       [COMPOBJ.61]
    733742 * Converts a program id into the respective GUID. (By using a registry lookup)
    734743 * RETURNS
    735  *  riid associated with the progid
     744 *      riid associated with the progid
    736745 */
    737746HRESULT WINAPI CLSIDFromProgID16(
    738     LPCOLESTR16 progid, /* [in] program id as found in registry */
    739     LPCLSID riid        /* [out] associated CLSID */
     747        LPCOLESTR16 progid,     /* [in] program id as found in registry */
     748        LPCLSID riid            /* [out] associated CLSID */
    740749) {
    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);
     750        char    *buf,buf2[80];
     751        DWORD   buf2len;
     752        HRESULT err;
     753        HKEY    xhkey;
     754
     755        buf = HeapAlloc(GetProcessHeap(),0,strlen(progid)+8);
     756        sprintf(buf,"%s\\CLSID",progid);
     757        if ((err=RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&xhkey))) {
     758                HeapFree(GetProcessHeap(),0,buf);
    750759                return CO_E_CLASSSTRING;
    751     }
    752     HeapFree(GetProcessHeap(),0,buf);
    753     buf2len = sizeof(buf2);
    754     if ((err=RegQueryValueA(xhkey,NULL,buf2,&buf2len))) {
    755         RegCloseKey(xhkey);
     760        }
     761        HeapFree(GetProcessHeap(),0,buf);
     762        buf2len = sizeof(buf2);
     763        if ((err=RegQueryValueA(xhkey,NULL,buf2,&buf2len))) {
     764                RegCloseKey(xhkey);
    756765                return CO_E_CLASSSTRING;
    757     }
    758     RegCloseKey(xhkey);
    759     return CLSIDFromString16(buf2,riid);
    760 }
    761 
    762 /******************************************************************************
    763  *      CLSIDFromProgID [OLE32.2]
     766        }
     767        RegCloseKey(xhkey);
     768        return CLSIDFromString16(buf2,riid);
     769}
     770
     771/******************************************************************************
     772 *              CLSIDFromProgID [OLE32.2]
    764773 * Converts a program id into the respective GUID. (By using a registry lookup)
    765774 * RETURNS
    766  *  riid associated with the progid
     775 *      riid associated with the progid
    767776 */
    768777HRESULT WINAPI CLSIDFromProgID(
    769     LPCOLESTR progid,   /* [in] program id as found in registry */
    770     LPCLSID riid        /* [out] associated CLSID */
     778        LPCOLESTR progid,       /* [in] program id as found in registry */
     779        LPCLSID riid            /* [out] associated CLSID */
    771780) {
    772     LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
    773     HRESULT       ret = CLSIDFromProgID16(pid,riid);
    774 
    775     HeapFree(GetProcessHeap(),0,pid);
    776     return ret;
     781        LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
     782        HRESULT       ret = CLSIDFromProgID16(pid,riid);
     783
     784        HeapFree(GetProcessHeap(),0,pid);
     785        return ret;
    777786}
    778787
     
    783792 *
    784793 * This function returns the CLSID of the DLL that implements the proxy and stub
    785  * for the specified interface.
    786  *
    787  * It determines this by searching the
     794 * for the specified interface. 
     795 *
     796 * It determines this by searching the 
    788797 * HKEY_CLASSES_ROOT\Interface\{string form of riid}\ProxyStubClsid32 in the registry
    789798 * and any interface id registered by CoRegisterPSClsid within the current process.
    790  *
     799 * 
    791800 * FIXME: We only search the registry, not ids registered with CoRegisterPSClsid.
    792801 */
     
    823832
    824833    /* ... Once we have the key, query the registry to get the
    825        value of CLSID as a string, and convert it into a
     834       value of CLSID as a string, and convert it into a 
    826835       proper CLSID structure to be passed back to the app */
    827836    buf2len = sizeof(buf2);
     
    847856
    848857/***********************************************************************
    849  *      WriteClassStm
     858 *              WriteClassStm
    850859 *
    851860 * This function write a CLSID on stream
     
    862871
    863872/***********************************************************************
    864  *      ReadClassStm
     873 *              ReadClassStm
    865874 *
    866875 * This function read a CLSID from a stream
     
    870879    ULONG nbByte;
    871880    HRESULT res;
    872 
     881   
    873882    TRACE("(%p,%p)\n",pStm,rclsid);
    874883
    875884    if (rclsid==NULL)
    876885        return E_INVALIDARG;
    877 
     886   
    878887    res = IStream_Read(pStm,(void*)rclsid,sizeof(CLSID),&nbByte);
    879888
    880889    if (FAILED(res))
    881890        return res;
    882 
     891   
    883892    if (nbByte != sizeof(CLSID))
    884893        return S_FALSE;
     
    893902 */
    894903HRESULT WINAPI LookupETask16(HTASK16 *hTask,LPVOID p) {
    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;
     904        FIXME("(%p,%p),stub!\n",hTask,p);
     905        if ((*hTask = GetCurrentTask()) == hETask) {
     906                memcpy(p, Table_ETask, sizeof(Table_ETask));
     907        }
     908        return 0;
    900909}
    901910
     
    906915HRESULT WINAPI SetETask16(HTASK16 hTask, LPVOID p) {
    907916        FIXME("(%04x,%p),stub!\n",hTask,p);
    908     hETask = hTask;
    909     return 0;
     917        hETask = hTask;
     918        return 0;
    910919}
    911920
     
    915924 */
    916925HRESULT WINAPI CallObjectInWOW(LPVOID p1,LPVOID p2) {
    917     FIXME("(%p,%p),stub!\n",p1,p2);
    918     return 0;
    919 }
    920 
    921 /******************************************************************************
    922  *      CoRegisterClassObject16 [COMPOBJ.5]
     926        FIXME("(%p,%p),stub!\n",p1,p2);
     927        return 0;
     928}
     929
     930/******************************************************************************
     931 *              CoRegisterClassObject16 [COMPOBJ.5]
    923932 *
    924933 * Don't know where it registers it ...
    925934 */
    926935HRESULT WINAPI CoRegisterClassObject16(
    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
     936        REFCLSID rclsid,
     937        LPUNKNOWN pUnk,
     938        DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
     939        DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
     940        LPDWORD lpdwRegister
    932941) {
    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;
     942        char    buf[80];
     943
     944        WINE_StringFromCLSID(rclsid,buf);
     945
     946        FIXME("(%s,%p,0x%08lx,0x%08lx,%p),stub\n",
     947                buf,pUnk,dwClsContext,flags,lpdwRegister
     948        );
     949        return 0;
    941950}
    942951
     
    957966 * COM_GetRegisteredClassObject
    958967 *
    959  * This internal method is used to scan the registered class list to
     968 * This internal method is used to scan the registered class list to 
    960969 * find a class object.
    961970 *
    962  * Params:
     971 * Params: 
    963972 *   rclsid        Class ID of the class to find.
    964973 *   dwClsContext  Class context to match.
     
    968977 */
    969978static HRESULT COM_GetRegisteredClassObject(
    970     REFCLSID    rclsid,
    971     DWORD       dwClsContext,
    972     LPUNKNOWN*  ppUnk)
     979        REFCLSID    rclsid,
     980        DWORD       dwClsContext,
     981        LPUNKNOWN*  ppUnk)
    973982{
    974983  RegisteredClass* curClass;
     
    10191028
    10201029/******************************************************************************
    1021  *      CoRegisterClassObject   [OLE32.36]
     1030 *              CoRegisterClassObject   [OLE32.36]
    10221031 *
    10231032 * This method will register the class object for a given class ID.
     
    10261035 */
    10271036HRESULT WINAPI CoRegisterClassObject(
    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 )
     1037        REFCLSID rclsid,
     1038        LPUNKNOWN pUnk,
     1039        DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */
     1040        DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
     1041        LPDWORD lpdwRegister
     1042) 
    10341043{
    10351044  RegisteredClass* newClass;
     
    10411050
    10421051  TRACE("(%s,%p,0x%08lx,0x%08lx,%p)\n",
    1043     buf,pUnk,dwClsContext,flags,lpdwRegister);
     1052        buf,pUnk,dwClsContext,flags,lpdwRegister);
    10441053
    10451054  /*
     
    10721081    return CO_E_OBJISREG;
    10731082  }
    1074 
     1083   
    10751084  /*
    10761085   * If it is not registered, we must create a new entry for this class and
     
    11031112   */
    11041113  *lpdwRegister = newClass->dwCookie;
    1105 
     1114   
    11061115  /*
    11071116   * We're successful Yippee!
     
    11181127 */
    11191128HRESULT WINAPI CoRevokeClassObject(
    1120         DWORD dwRegister)
     1129        DWORD dwRegister) 
    11211130{
    11221131  RegisteredClass** prevClassLink;
     
    11761185    REFIID iid, LPVOID *ppv
    11771186) {
    1178     LPUNKNOWN   regClassObject;
    1179     HRESULT hres = E_UNEXPECTED;
    1180     char    xclsid[80];
     1187    LPUNKNOWN   regClassObject;
     1188    HRESULT     hres = E_UNEXPECTED;
     1189    char        xclsid[80];
    11811190    WCHAR dllName[MAX_PATH+1];
    11821191    DWORD dllNameLen = sizeof(dllName);
    11831192    HINSTANCE hLibrary;
    11841193#ifdef __WIN32OS2__
    1185     typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid,
    1186                  REFIID iid, LPVOID *ppv);
     1194    typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid, 
     1195                             REFIID iid, LPVOID *ppv);
    11871196#else
    1188     typedef HRESULT CALLBACK (*DllGetClassObjectFunc)(REFCLSID clsid,
    1189                  REFIID iid, LPVOID *ppv);
     1197    typedef HRESULT CALLBACK (*DllGetClassObjectFunc)(REFCLSID clsid, 
     1198                             REFIID iid, LPVOID *ppv);
    11901199#endif
    11911200    DllGetClassObjectFunc DllGetClassObject;
     
    11941203
    11951204    TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n",
    1196     debugstr_guid(rclsid),
    1197     debugstr_guid(iid)
     1205        debugstr_guid(rclsid),
     1206        debugstr_guid(iid)
    11981207    );
    11991208
    12001209    if (pServerInfo) {
    1201     FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName));
    1202     FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo);
     1210        FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName));
     1211        FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo);
    12031212    }
    12041213
    12051214    /*
    1206      * First, try and see if we can't match the class ID with one of the
     1215     * First, try and see if we can't match the class ID with one of the 
    12071216     * registered classes.
    12081217     */
     
    12291238    ){
    12301239        FIXME("%s %s not supported!\n",
    1231         (dwClsContext&CLSCTX_LOCAL_SERVER)?"CLSCTX_LOCAL_SERVER":"",
    1232         (dwClsContext&CLSCTX_REMOTE_SERVER)?"CLSCTX_REMOTE_SERVER":""
    1233     );
    1234     return E_ACCESSDENIED;
     1240                (dwClsContext&CLSCTX_LOCAL_SERVER)?"CLSCTX_LOCAL_SERVER":"",
     1241                (dwClsContext&CLSCTX_REMOTE_SERVER)?"CLSCTX_REMOTE_SERVER":""
     1242        );
     1243        return E_ACCESSDENIED;
    12351244    }
    12361245
    12371246    if ((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext) {
    12381247        HKEY key;
    1239     char buf[200];
    1240 
    1241     sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
     1248        char buf[200];
     1249
     1250        sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
    12421251        hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
    12431252
    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);
     1253        if (hres != ERROR_SUCCESS) {
     1254            return REGDB_E_CLASSNOTREG;
     1255        }
     1256
     1257        memset(dllName,0,sizeof(dllName));
     1258        hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
     1259        if (hres)
     1260                return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
     1261        RegCloseKey(key);
     1262        TRACE("found InprocServer32 dll %s\n", debugstr_w(dllName));
     1263
     1264        /* open dll, call DllGetClassObject */
     1265        hLibrary = CoLoadLibrary(dllName, TRUE);
     1266        if (hLibrary == 0) {
     1267            FIXME("couldn't load InprocServer32 dll %s\n", debugstr_w(dllName));
     1268            return E_ACCESSDENIED; /* or should this be CO_E_DLLNOTFOUND? */
     1269        }
     1270        DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject");
     1271        if (!DllGetClassObject) {
     1272            /* not sure if this should be called here CoFreeLibrary(hLibrary);*/
     1273            FIXME("couldn't find function DllGetClassObject in %s\n", debugstr_w(dllName));
     1274            return E_ACCESSDENIED;
     1275        }
     1276
     1277        /*
     1278        * Ask the DLL for its class object. (there was a note here about class
     1279        * factories but this is good.
     1280        */
     1281        return DllGetClassObject(rclsid, iid, ppv);
    12731282    }
    12741283    return hres;
     
    12821291HRESULT WINAPI CoResumeClassObjects(void)
    12831292{
    1284     FIXME("\n");
    1285     return S_OK;
     1293        FIXME("\n");
     1294        return S_OK;
    12861295}
    12871296
     
    13171326       pattern in the registry. this case is not frequently used ! so I present only the psodocode for
    13181327       this case
    1319 
     1328       
    13201329     for(i=0;i<nFileTypes;i++)
    13211330
     
    13501359    length=lstrlenW(absFile);
    13511360    for(i=length-1; ( (i>=0) && (extention[i]=absFile[i]) );i--);
    1352 
     1361       
    13531362    /* get the progId associated to the extension */
    13541363    progId=CoTaskMemAlloc(sizeProgId);
     
    13781387#ifndef __WIN32OS2__
    13791388/******************************************************************************
    1380  *      CoRegisterMessageFilter16   [COMPOBJ.27]
     1389 *              CoRegisterMessageFilter16       [COMPOBJ.27]
    13811390 */
    13821391HRESULT WINAPI CoRegisterMessageFilter16(
    1383     LPMESSAGEFILTER lpMessageFilter,
    1384     LPMESSAGEFILTER *lplpMessageFilter
     1392        LPMESSAGEFILTER lpMessageFilter,
     1393        LPMESSAGEFILTER *lplpMessageFilter
    13851394) {
    1386     FIXME("(%p,%p),stub!\n",lpMessageFilter,lplpMessageFilter);
    1387     return 0;
     1395        FIXME("(%p,%p),stub!\n",lpMessageFilter,lplpMessageFilter);
     1396        return 0;
    13881397}
    13891398#endif
     
    13931402 */
    13941403HRESULT WINAPI CoCreateInstance(
    1395     REFCLSID rclsid,
    1396     LPUNKNOWN pUnkOuter,
    1397     DWORD dwClsContext,
    1398     REFIID iid,
    1399     LPVOID *ppv)
    1400 {
    1401     HRESULT hres;
    1402     LPCLASSFACTORY lpclf = 0;
     1404        REFCLSID rclsid,
     1405        LPUNKNOWN pUnkOuter,
     1406        DWORD dwClsContext,
     1407        REFIID iid,
     1408        LPVOID *ppv)
     1409{
     1410        HRESULT hres;
     1411        LPCLASSFACTORY lpclf = 0;
    14031412
    14041413  /*
     
    14121421   */
    14131422  *ppv = 0;
    1414 
     1423 
    14151424  /*
    14161425   * Get a class factory to construct the object we want.
    14171426   */
    14181427  hres = CoGetClassObject(rclsid,
    1419               dwClsContext,
    1420               NULL,
    1421               &IID_IClassFactory,
    1422               (LPVOID)&lpclf);
     1428                          dwClsContext,
     1429                          NULL,
     1430                          &IID_IClassFactory,
     1431                          (LPVOID)&lpclf);
    14231432
    14241433  if (FAILED(hres)) {
     
    14301439   * Create the object and don't forget to release the factory
    14311440   */
    1432     hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
    1433     IClassFactory_Release(lpclf);
    1434 
    1435     return hres;
     1441        hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
     1442        IClassFactory_Release(lpclf);
     1443
     1444        return hres;
    14361445}
    14371446
     
    14401449 */
    14411450HRESULT WINAPI CoCreateInstanceEx(
    1442   REFCLSID      rclsid,
     1451  REFCLSID      rclsid, 
    14431452  LPUNKNOWN     pUnkOuter,
    1444   DWORD         dwClsContext,
     1453  DWORD         dwClsContext, 
    14451454  COSERVERINFO* pServerInfo,
    14461455  ULONG         cmq,
     
    14731482   * Get the object and get its IUnknown pointer.
    14741483   */
    1475   hr = CoCreateInstance(rclsid,
    1476             pUnkOuter,
    1477             dwClsContext,
    1478             &IID_IUnknown,
    1479             (VOID**)&pUnk);
     1484  hr = CoCreateInstance(rclsid, 
     1485                        pUnkOuter,
     1486                        dwClsContext,
     1487                        &IID_IUnknown,
     1488                        (VOID**)&pUnk);
    14801489
    14811490  if (hr)
     
    14881497  {
    14891498    pResults[index].hr = IUnknown_QueryInterface(pUnk,
    1490                         pResults[index].pIID,
    1491                         (VOID**)&(pResults[index].pItf));
     1499                                                pResults[index].pIID,
     1500                                                (VOID**)&(pResults[index].pItf));
    14921501
    14931502    if (pResults[index].hr == S_OK)
     
    15201529    prev = NULL;
    15211530    for (ptr = openDllList; ptr != NULL; ptr=ptr->next) {
    1522     if (ptr->hLibrary == hLibrary) {
    1523         break;
    1524     }
    1525     prev = ptr;
     1531        if (ptr->hLibrary == hLibrary) {
     1532            break;
     1533        }
     1534        prev = ptr;
    15261535    }
    15271536
    15281537    if (ptr == NULL) {
    1529     /* shouldn't happen if user passed in a valid hLibrary */
    1530     return;
     1538        /* shouldn't happen if user passed in a valid hLibrary */
     1539        return;
    15311540    }
    15321541    /* assert: ptr points to the library entry to free */
     
    15351544    FreeLibrary(hLibrary);
    15361545    if (ptr == openDllList) {
    1537     tmp = openDllList->next;
    1538     HeapFree(GetProcessHeap(), 0, openDllList);
    1539     openDllList = tmp;
     1546        tmp = openDllList->next;
     1547        HeapFree(GetProcessHeap(), 0, openDllList);
     1548        openDllList = tmp;
    15401549    } else {
    1541     tmp = ptr->next;
    1542     HeapFree(GetProcessHeap(), 0, ptr);
    1543     prev->next = tmp;
     1550        tmp = ptr->next;
     1551        HeapFree(GetProcessHeap(), 0, ptr);
     1552        prev->next = tmp;
    15441553    }
    15451554
     
    15551564
    15561565    for (ptr = openDllList; ptr != NULL; ) {
    1557     tmp=ptr->next;
    1558     CoFreeLibrary(ptr->hLibrary);
    1559     ptr = tmp;
     1566        tmp=ptr->next;
     1567        CoFreeLibrary(ptr->hLibrary);
     1568        ptr = tmp;
    15601569    }
    15611570}
     
    15731582
    15741583    for (ptr = openDllList; ptr != NULL; ) {
    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     }
     1584        DllCanUnloadNow = (DllCanUnloadNowFunc)
     1585            GetProcAddress(ptr->hLibrary, "DllCanUnloadNow");
     1586       
     1587        if ( (DllCanUnloadNow != NULL) &&
     1588             (DllCanUnloadNow() == S_OK) ) {
     1589            tmp=ptr->next;
     1590            CoFreeLibrary(ptr->hLibrary);
     1591            ptr = tmp;
     1592        } else {
     1593            ptr=ptr->next;
     1594        }
    15861595    }
    15871596}
     
    15901599 *           CoFileTimeNow [COMPOBJ.82, OLE32.10]
    15911600 * RETURNS
    1592  *  the current system time in lpFileTime
     1601 *      the current system time in lpFileTime
    15931602 */
    15941603HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime ) /* [out] the current time */
     
    16011610 *           CoTaskMemAlloc (OLE32.43)
    16021611 * RETURNS
    1603  *  pointer to newly allocated block
     1612 *      pointer to newly allocated block
    16041613 */
    16051614LPVOID WINAPI CoTaskMemAlloc(
    1606     ULONG size  /* [in] size of memoryblock to be allocated */
     1615        ULONG size      /* [in] size of memoryblock to be allocated */
    16071616) {
    1608     LPMALLOC    lpmalloc;
    1609     HRESULT ret = CoGetMalloc(0,&lpmalloc);
    1610 
    1611     if (FAILED(ret))
    1612     return NULL;
     1617    LPMALLOC    lpmalloc;
     1618    HRESULT     ret = CoGetMalloc(0,&lpmalloc);
     1619
     1620    if (FAILED(ret)) 
     1621        return NULL;
    16131622
    16141623    return IMalloc_Alloc(lpmalloc,size);
     
    16181627 */
    16191628VOID WINAPI CoTaskMemFree(
    1620     LPVOID ptr  /* [in] pointer to be freed */
     1629        LPVOID ptr      /* [in] pointer to be freed */
    16211630) {
    1622     LPMALLOC    lpmalloc;
    1623     HRESULT ret = CoGetMalloc(0,&lpmalloc);
    1624 
    1625     if (FAILED(ret))
     1631    LPMALLOC    lpmalloc;
     1632    HRESULT     ret = CoGetMalloc(0,&lpmalloc);
     1633
     1634    if (FAILED(ret)) 
    16261635      return;
    16271636
     
    16321641 *           CoTaskMemRealloc (OLE32.45)
    16331642 * RETURNS
    1634  *  pointer to newly allocated block
     1643 *      pointer to newly allocated block
    16351644 */
    16361645LPVOID WINAPI CoTaskMemRealloc(
    16371646  LPVOID pvOld,
    1638   ULONG  size)  /* [in] size of memoryblock to be allocated */
     1647  ULONG  size)  /* [in] size of memoryblock to be allocated */
    16391648{
    16401649  LPMALLOC lpmalloc;
    16411650  HRESULT  ret = CoGetMalloc(0,&lpmalloc);
    1642 
    1643   if (FAILED(ret))
     1651 
     1652  if (FAILED(ret)) 
    16441653    return NULL;
    16451654
     
    16551664    OpenDll *ptr;
    16561665    OpenDll *tmp;
    1657 
     1666 
    16581667    TRACE("(%s, %d)\n", debugstr_w(lpszLibName), bAutoFree);
    16591668
     
    16611670
    16621671    if (!bAutoFree)
    1663     return hLibrary;
     1672        return hLibrary;
    16641673
    16651674    if (openDllList == NULL) {
    16661675        /* empty list -- add first node */
    16671676        openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
    1668     openDllList->hLibrary=hLibrary;
    1669     openDllList->next = NULL;
     1677        openDllList->hLibrary=hLibrary;
     1678        openDllList->next = NULL;
    16701679    } else {
    16711680        /* search for this dll */
    16721681        int found = FALSE;
    16731682        for (ptr = openDllList; ptr->next != NULL; ptr=ptr->next) {
    1674         if (ptr->hLibrary == hLibrary) {
    1675             found = TRUE;
    1676         break;
     1683            if (ptr->hLibrary == hLibrary) {
     1684                found = TRUE;
     1685                break;
     1686            }
    16771687        }
    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 
     1688        if (!found) {
     1689            /* dll not found, add it */
     1690            tmp = openDllList;
     1691            openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
     1692            openDllList->hLibrary = hLibrary;
     1693            openDllList->next = tmp;
     1694        }
     1695    }
     1696     
    16881697    return hLibrary;
    16891698}
     
    16991708#ifndef __WIN32OS2__
    17001709/******************************************************************************
    1701  *      CoLockObjectExternal16  [COMPOBJ.63]
     1710 *              CoLockObjectExternal16  [COMPOBJ.63]
    17021711 */
    17031712HRESULT WINAPI CoLockObjectExternal16(
    1704     LPUNKNOWN pUnk,     /* [in] object to be locked */
    1705     BOOL16 fLock,       /* [in] do lock */
    1706     BOOL16 fLastUnlockReleases  /* [in] ? */
     1713    LPUNKNOWN pUnk,             /* [in] object to be locked */
     1714    BOOL16 fLock,               /* [in] do lock */
     1715    BOOL16 fLastUnlockReleases  /* [in] ? */
    17071716) {
    17081717    FIXME("(%p,%d,%d),stub!\n",pUnk,fLock,fLastUnlockReleases);
     
    17121721
    17131722/******************************************************************************
    1714  *      CoLockObjectExternal    [OLE32.31]
     1723 *              CoLockObjectExternal    [OLE32.31]
    17151724 */
    17161725HRESULT WINAPI CoLockObjectExternal(
    1717     LPUNKNOWN pUnk,     /* [in] object to be locked */
    1718     BOOL fLock,     /* [in] do lock */
     1726    LPUNKNOWN pUnk,             /* [in] object to be locked */
     1727    BOOL fLock,         /* [in] do lock */
    17191728    BOOL fLastUnlockReleases) /* [in] unlock all */
    17201729{
    17211730
    1722   if (fLock)
     1731  if (fLock) 
    17231732  {
    1724     /*
     1733    /* 
    17251734     * Increment the external lock coutner, COM_ExternalLockAddRef also
    17261735     * increment the object's internal lock counter.
    17271736     */
    1728     COM_ExternalLockAddRef( pUnk);
     1737    COM_ExternalLockAddRef( pUnk); 
    17291738  }
    17301739  else
    17311740  {
    1732     /*
     1741    /* 
    17331742     * Decrement the external lock coutner, COM_ExternalLockRelease also
    17341743     * decrement the object's internal lock counter.
     
    17661775{
    17671776   FIXME ("(%p %p): stub\n", punkOuter, ppunkMarshal);
    1768 
     1777   
    17691778   return S_OK;
    17701779}
     
    17751784 */
    17761785HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
    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;
     1786{       
     1787        FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
     1788        *ppv = NULL;
     1789        return CLASS_E_CLASSNOTAVAILABLE;
    17811790}
    17821791
     
    17851794 * COM_RevokeAllClasses
    17861795 *
    1787  * This method is called when the COM libraries are uninitialized to
     1796 * This method is called when the COM libraries are uninitialized to 
    17881797 * release all the references to the class objects registered with
    17891798 * the library
     
    18021811
    18031812/****************************************************************************
    1804  * Public - Method that increments the count for a IUnknown* in the linked
     1813 * Public - Method that increments the count for a IUnknown* in the linked 
    18051814 * list.  The item is inserted if not already in the list.
    18061815 */
     
    18231832   * Add an internal lock to the object
    18241833   */
    1825   IUnknown_AddRef(pUnk);
     1834  IUnknown_AddRef(pUnk); 
    18261835}
    18271836
    18281837/****************************************************************************
    1829  * Public - Method that decrements the count for a IUnknown* in the linked
     1838 * Public - Method that decrements the count for a IUnknown* in the linked 
    18301839 * list.  The item is removed from the list if its count end up at zero or if
    18311840 * bRelAll is TRUE.
     
    18441853      IUnknown_Release(pUnk);     /* release local locks as well */
    18451854
    1846       if ( bRelAll == FALSE )
     1855      if ( bRelAll == FALSE ) 
    18471856        break;  /* perform single release */
    18481857
    1849     } while ( externalLock->uRefCount > 0 );
     1858    } while ( externalLock->uRefCount > 0 ); 
    18501859
    18511860    if ( externalLock->uRefCount == 0 )  /* get rid of the list entry */
     
    18651874    COM_ExternalLockDelete(head);     /* get rid of the head stuff       */
    18661875
    1867     head = elList.head;               /* get the new head...             */
     1876    head = elList.head;               /* get the new head...             */ 
    18681877  }
    18691878}
     
    18811890  {
    18821891      DPRINTF( "\t%p with %lu references count.\n", current->pUnk, current->uRefCount);
    1883 
    1884     /* Skip to the next item */
     1892 
     1893    /* Skip to the next item */ 
    18851894    current = current->next;
    1886   }
     1895  } 
    18871896
    18881897}
     
    19041913  IUnknown         *pUnk)
    19051914{
    1906   if ( element == EL_END_OF_LIST )
     1915  if ( element == EL_END_OF_LIST ) 
    19071916    return EL_NOT_FOUND;
    19081917
     
    19101919    return element;
    19111920
    1912   else                                 /* Not the right guy, keep on looking */
     1921  else                                 /* Not the right guy, keep on looking */ 
    19131922    return COM_ExternalLockLocate( element->next, pUnk);
    19141923}
     
    19301939  if (newLock!=NULL)
    19311940  {
    1932     if ( elList.head == EL_END_OF_LIST )
     1941    if ( elList.head == EL_END_OF_LIST ) 
    19331942    {
    19341943      elList.head = newLock;    /* The list is empty */
    19351944    }
    1936     else
     1945    else 
    19371946    {
    1938       /*
     1947      /* 
    19391948       * insert does it at the head
    19401949       */
     
    19441953
    19451954    /*
    1946      * Set new list item data member
     1955     * Set new list item data member 
    19471956     */
    19481957    newLock->pUnk      = pUnk;
    19491958    newLock->uRefCount = 1;
    19501959    newLock->next      = previousHead;
    1951 
     1960   
    19521961    return TRUE;
    19531962  }
     
    19661975  if ( current == itemList )
    19671976  {
    1968     /*
    1969      * this section handles the deletion of the first node
     1977    /* 
     1978     * this section handles the deletion of the first node 
    19701979     */
    19711980    elList.head = itemList->next;
    1972     HeapFree( GetProcessHeap(), 0, itemList);
     1981    HeapFree( GetProcessHeap(), 0, itemList); 
    19731982  }
    19741983  else
    19751984  {
    1976     do
     1985    do 
    19771986    {
    19781987      if ( current->next == itemList )   /* We found the item to free  */
    19791988      {
    19801989        current->next = itemList->next;  /* readjust the list pointers */
    1981 
    1982         HeapFree( GetProcessHeap(), 0, itemList);
    1983         break;
     1990 
     1991        HeapFree( GetProcessHeap(), 0, itemList); 
     1992        break; 
    19841993      }
    1985 
    1986       /* Skip to the next item */
     1994 
     1995      /* Skip to the next item */ 
    19871996      current = current->next;
    1988 
     1997 
    19891998    } while ( current != EL_END_OF_LIST );
    19901999  }
     
    20322041    {
    20332042        res = REGDB_E_CLASSNOTREG;
    2034     goto done;
     2043        goto done;
    20352044    }
    20362045    len = 200;
     
    20402049    {
    20412050        res = REGDB_E_KEYMISSING;
    2042     goto done;
     2051        goto done;
    20432052    }
    20442053    MultiByteToWideChar( CP_ACP, 0, buf, -1, wbuf, sizeof(wbuf)/sizeof(WCHAR) );
     
    20652074    {
    20662075        res = REGDB_E_CLASSNOTREG;
    2067     goto done;
     2076        goto done;
    20682077    }
    20692078    if (RegCreateKeyA(hkey, "AutoConvertTo", &hkeyConvert))
    20702079    {
    20712080        res = REGDB_E_WRITEREGDB;
    2072     goto done;
     2081        goto done;
    20732082    }
    20742083    if (RegSetValueExA(hkeyConvert, NULL, 0,
     
    20762085    {
    20772086        res = REGDB_E_WRITEREGDB;
    2078     goto done;
     2087        goto done;
    20792088    }
    20802089
     
    20922101 *
    20932102 * RETURNS
    2094  *  TRUE if equal
     2103 *      TRUE if equal
    20952104 */
    20962105#undef IsEqualGUID
     
    21112120
    21122121HRESULT WIN32API CLSIDFromStringA(
    2113     LPCSTR      lpsz,       // [in] - ASCII string CLSID
    2114     LPCLSID     pclsid)     // [out] - Binary CLSID
     2122    LPCSTR              lpsz,           // [in] - ASCII string CLSID
     2123    LPCLSID             pclsid)         // [out] - Binary CLSID
    21152124{
    21162125    return CLSIDFromString16(lpsz, pclsid);
Note: See TracChangeset for help on using the changeset viewer.