Changeset 7926 for trunk/src


Ignore:
Timestamp:
Feb 15, 2002, 6:18:52 PM (24 years ago)
Author:
sandervl
Message:

Wine 20020215 resync

Location:
trunk/src/ole32
Files:
3 added
25 edited

Legend:

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

    r7508 r7926  
    44 *               Copyright 1999  Noomen Hamza
    55 ***************************************************************************************/
     6
    67#include <assert.h>
    78#include <string.h>
     
    1415#include "wine/obj_moniker.h"
    1516#include "debugtools.h"
    16 
    1717
    1818DEFAULT_DEBUG_CHANNEL(ole);
     
    620620
    621621/******************************************************************************
    622  *        CreateAntiMoniker     [OLE.55]
     622 *        CreateAntiMoniker     [OLE32.51]
    623623 ******************************************************************************/
    624624HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk)
  • trunk/src/ole32/bindctx.c

    r7508 r7926  
    1515#include "wine/obj_moniker.h"
    1616#include "debugtools.h"
    17 #include "heap.h"
    18 
    1917
    2018DEFAULT_DEBUG_CHANNEL(ole);
     
    239237            FIXME("This->bindCtxTableSize: %ld is out of data limite \n",This->bindCtxTableSize);
    240238            return E_FAIL;
    241 }
     239        }
    242240
    243241        This->bindCtxTableSize+=BLOCK_TAB_SIZE; /* new table size */
     
    311309    if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    312310    {
    313         WARN("invalid size");
     311        WARN("invalid size\n");
    314312        return E_INVALIDARG; /* FIXME : not verified */
    315313    }
     
    332330    if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
    333331    {
    334         WARN("invalid size");
     332        WARN("invalid size\n");
    335333        return E_INVALIDARG; /* FIXME : not verified */
    336334    }
     
    387385            return E_OUTOFMEMORY;
    388386        strcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
    389 }
     387    }
    390388
    391389    This->bindCtxTableLastIndex++;
     
    521519
    522520/******************************************************************************
    523  *        CreateBindCtx
     521 *        CreateBindCtx (OLE32.52)
    524522 ******************************************************************************/
    525523HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC * ppbc)
  • trunk/src/ole32/compobj.c

    r7508 r7926  
    66 *      Copyright 1999  Francis Beaudet
    77 *  Copyright 1999  Sylvain St-Germain
     8 *  Copyright 2002  Marcus Meissner
    89 */
    910
     
    1415#include <string.h>
    1516#include <assert.h>
     17
    1618#include "windef.h"
     19#include "objbase.h"
     20#include "ole2.h"
     21#include "ole2ver.h"
     22#include "rpc.h"
     23#include "winerror.h"
     24#include "winreg.h"
     25#include "wownt32.h"
    1726#include "wtypes.h"
    18 #include "wingdi.h"
     27#include "wine/unicode.h"
     28#include "wine/obj_base.h"
     29#include "wine/obj_clientserver.h"
     30#include "wine/obj_misc.h"
     31#include "wine/obj_marshal.h"
     32#include "wine/obj_storage.h"
     33#include "wine/obj_channel.h"
    1934#include "wine/winbase16.h"
    20 #include "winerror.h"
    21 #include "wownt32.h"
    22 #include "ole2ver.h"
     35#include "compobj_private.h"
     36#include "ifs.h"
     37
    2338#include "debugtools.h"
    24 #include "heap.h"
    25 #include "winreg.h"
    26 #include "rpc.h"
    27 
    28 #include "wine/obj_base.h"
    29 #include "wine/obj_misc.h"
    30 #include "wine/obj_storage.h"
    31 #include "wine/obj_clientserver.h"
    32 
    33 #include "ole.h"
    34 #include "ifs.h"
    35 #include "compobj_private.h"
    36 
    37 #ifdef __WIN32OS2__
    38 #include <heapstring.h>
    39 #endif
    4039
    4140DEFAULT_DEBUG_CHANNEL(ole);
     
    4443 *  COM External Lock structures and methods declaration
    4544 *
    46  *  This api provides a linked list to managed external references to 
    47  *  COM objects. 
    48  *
    49  *  The public interface consists of three calls: 
     45 *  This api provides a linked list to managed external references to
     46 *  COM objects.
     47 *
     48 *  The public interface consists of three calls:
    5049 *      COM_ExternalLockAddRef
    5150 *      COM_ExternalLockRelease
     
    5756
    5857/*
    59  * Declaration of the static structure that manage the 
     58 * Declaration of the static structure that manage the
    6059 * external lock to COM  objects.
    6160 */
     
    8281
    8382/*
    84  * Public Interface to the external lock list   
     83 * Public Interface to the external lock list
    8584 */
    8685static void COM_ExternalLockFreeList();
     
    9089
    9190/*
    92  * Private methods used to managed the linked list   
     91 * Private methods used to managed the linked list
    9392 */
    9493static BOOL COM_ExternalLockInsert(
     
    125124 * libraries are freed
    126125 */
    127 static ULONG s_COMLockCount = 0;
     126static LONG s_COMLockCount = 0;
    128127
    129128/*
     
    142141  DWORD     connectFlags;
    143142  DWORD     dwCookie;
     143  HANDLE    hThread; /* only for localserver */
    144144  struct tagRegisteredClass* nextClass;
    145145} RegisteredClass;
    146146
     147static CRITICAL_SECTION csRegisteredClassList;
    147148static RegisteredClass* firstRegisteredClass = NULL;
    148149
     
    152153 */
    153154typedef struct tagOpenDll {
    154   HINSTANCE hLibrary;       
     155  HINSTANCE hLibrary;
    155156  struct tagOpenDll *next;
    156157} OpenDll;
    157158
     159static CRITICAL_SECTION csOpenDllList;
    158160static OpenDll *openDllList = NULL; /* linked list of open dlls */
    159161
     
    170172
    171173/******************************************************************************
     174 * Initialize/Uninitialize critical sections.
     175 */
     176void COMPOBJ_InitProcess( void )
     177{
     178    InitializeCriticalSection( &csRegisteredClassList );
     179    InitializeCriticalSection( &csOpenDllList );
     180}
     181
     182void COMPOBJ_UninitProcess( void )
     183{
     184    DeleteCriticalSection( &csRegisteredClassList );
     185    DeleteCriticalSection( &csOpenDllList );
     186}
     187
     188/******************************************************************************
    172189 *           CoBuildVersion [COMPOBJ.1]
     190 *           CoBuildVersion [OLE32.4]
    173191 *
    174192 * RETURNS
     
    181199}
    182200
    183 #ifndef __WIN32OS2__
    184 /******************************************************************************
    185  *              CoInitialize16  [COMPOBJ.2]
     201/******************************************************************************
     202 *              CoInitialize    [COMPOBJ.2]
    186203 * Set the win16 IMalloc used for memory management
    187204 */
     
    192209    return S_OK;
    193210}
    194 #endif
    195211
    196212/******************************************************************************
     
    204220        LPVOID lpReserved       /* [in] pointer to win32 malloc interface
    205221                                   (obsolete, should be NULL) */
    206 ) 
     222)
    207223{
    208224  /*
     
    225241 *
    226242 * BUGS
    227  * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE 
     243 * Only the single threaded model is supported. As a result RPC_E_CHANGED_MODE
    228244 * is never returned.
    229245 *
     
    234250                                   (obsolete, should be NULL) */
    235251        DWORD dwCoInit          /* [in] A value from COINIT specifies the threading model */
    236 ) 
     252)
    237253{
    238254  HRESULT hr;
     
    248264   * Check for unsupported features.
    249265   */
    250   if (dwCoInit!=COINIT_APARTMENTTHREADED) 
     266  if (dwCoInit!=COINIT_APARTMENTTHREADED)
    251267  {
    252268    FIXME(":(%p,%x): unsupported flag %x\n", lpReserved, (int)dwCoInit, (int)dwCoInit);
     
    257273   * Check the lock count. If this is the first time going through the initialize
    258274   * process, we have to initialize the libraries.
     275   *
     276   * And crank-up that lock count.
    259277   */
    260   if (s_COMLockCount==0)
     278  if (InterlockedExchangeAdd(&s_COMLockCount,1)==0)
    261279  {
    262280    /*
     
    265283    TRACE("() - Initializing the COM libraries\n");
    266284
     285
    267286    RunningObjectTableImpl_Initialize();
    268287
     
    272291    hr = S_FALSE;
    273292
    274   /*
    275    * Crank-up that lock count.
    276    */
    277   s_COMLockCount++;
    278 
    279293  return hr;
    280294}
    281295
    282 #ifndef __WIN32OS2__
    283 /***********************************************************************
    284  *           CoUninitialize16   [COMPOBJ.3]
    285  * Don't know what it does.
     296/***********************************************************************
     297 *           CoUninitialize   [COMPOBJ.3]
     298 * Don't know what it does.
    286299 * 3-Nov-98 -- this was originally misspelled, I changed it to what I
    287300 *   believe is the correct spelling
     
    292305  CoFreeAllLibraries();
    293306}
    294 #endif
    295307
    296308/***********************************************************************
     
    303315void WINAPI CoUninitialize(void)
    304316{
     317  LONG lCOMRefCnt;
    305318  TRACE("()\n");
    306  
     319
    307320  /*
    308321   * Decrease the reference count.
    309    */
    310   s_COMLockCount--;
    311  
    312   /*
    313322   * If we are back to 0 locks on the COM library, make sure we free
    314323   * all the associated data structures.
    315324   */
    316   if (s_COMLockCount==0)
     325  lCOMRefCnt = InterlockedExchangeAdd(&s_COMLockCount,-1);
     326  if (lCOMRefCnt==1)
    317327  {
    318328    /*
     
    336346     */
    337347    COM_ExternalLockFreeList();
    338 }
     348
     349  }
     350  else if (lCOMRefCnt<1) {
     351    ERR( "CoUninitialize() - not CoInitialized.\n" );
     352    InterlockedExchangeAdd(&s_COMLockCount,1); /* restore the lock count. */
     353  }
    339354}
    340355
    341356#ifndef __WIN32OS2__
    342357/***********************************************************************
    343  *           CoGetMalloc16    [COMPOBJ.4]
     358 *           CoGetMalloc    [COMPOBJ.4]
    344359 * RETURNS
    345360 *      The current win16 IMalloc
     
    355370}
    356371#endif
    357 
    358372/******************************************************************************
    359373 *              CoGetMalloc     [OLE32.20]
     
    374388#ifndef __WIN32OS2__
    375389/***********************************************************************
    376  *           CoCreateStandardMalloc16 [COMPOBJ.71]
     390 *           CoCreateStandardMalloc [COMPOBJ.71]
    377391 */
    378392HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext,
     
    384398    return S_OK;
    385399}
     400#endif
    386401
    387402/******************************************************************************
    388403 *              CoDisconnectObject      [COMPOBJ.15]
     404 *              CoDisconnectObject      [OLE32.8]
    389405 */
    390406HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
     
    395411
    396412/***********************************************************************
    397  *           IsEqualGUID16 [COMPOBJ.18]
     413 *           IsEqualGUID [COMPOBJ.18]
    398414 *
    399415 * Compares two Unique Identifiers.
     
    408424    return !memcmp( g1, g2, sizeof(GUID) );
    409425}
    410 #endif
    411 
    412 /******************************************************************************
    413  *              CLSIDFromString16       [COMPOBJ.20]
    414  * Converts a unique identifier from its string representation into
     426
     427/******************************************************************************
     428 *              CLSIDFromString [COMPOBJ.20]
     429 * Converts a unique identifier from its string representation into
    415430 * the GUID struct.
    416431 *
    417  * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] 
     432 * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6]
    418433 *
    419434 * RETURNS
     
    516531/******************************************************************************
    517532 *              CLSIDFromString [OLE32.3]
    518  * Converts a unique identifier from its string representation into
     533 *              IIDFromString   [OLE32.74]
     534 * Converts a unique identifier from its string representation into
    519535 * the GUID struct.
    520536 *
     
    527543HRESULT WINAPI CLSIDFromString(
    528544        LPCOLESTR idstr,        /* [in] string representation of GUID */
    529         CLSID *id               /* [out] GUID represented by above string */
    530 ) {
    531     LPOLESTR16      xid = HEAP_strdupWtoA(GetProcessHeap(),0,idstr);
    532     HRESULT       ret = CLSIDFromString16(xid,id);
    533 
    534     HeapFree(GetProcessHeap(),0,xid);
     545        CLSID *id )             /* [out] GUID represented by above string */
     546{
     547    char xid[40];
     548    HRESULT ret;
     549
     550    if (!WideCharToMultiByte( CP_ACP, 0, idstr, -1, xid, sizeof(xid), NULL, NULL ))
     551        return CO_E_CLASSSTRING;
     552    ret = CLSIDFromString16(xid,id);
    535553    if(ret != S_OK) { /* It appears a ProgID is also valid */
    536554        ret = CLSIDFromProgID(idstr, id);
     
    548566 *      the string representation and HRESULT
    549567 */
    550 #ifdef __WIN32OS2__
    551 HRESULT WINAPI WINE_StringFromCLSID(
     568HRESULT WINE_StringFromCLSID(
    552569        const CLSID *id,        /* [in] GUID to be converted */
    553570        LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
    554 #else
    555 static HRESULT WINE_StringFromCLSID(
    556         const CLSID *id,        /* [in] GUID to be converted */
    557         LPSTR idstr             /* [out] pointer to buffer to contain converted guid */
    558 #endif
    559571) {
    560572  static const char *hex = "0123456789ABCDEF";
     
    567579          return E_FAIL;
    568580        }
    569        
     581
    570582  sprintf(idstr, "{%08lX-%04X-%04X-%02X%02X-",
    571583          id->Data1, id->Data2, id->Data3,
     
    586598  return S_OK;
    587599}
     600
    588601#ifndef __WIN32OS2__
    589602/******************************************************************************
    590  *              StringFromCLSID16       [COMPOBJ.19]
     603 *              StringFromCLSID [COMPOBJ.19]
    591604 * Converts a GUID into the respective string representation.
    592605 * The target string is allocated using the OLE IMalloc.
     
    629642}
    630643#endif
     644
    631645/******************************************************************************
    632646 *              StringFromCLSID [OLE32.151]
     647 *              StringFromIID   [OLE32.153]
    633648 * Converts a GUID into the respective string representation.
    634649 * The target string is allocated using the OLE IMalloc.
     
    657672
    658673/******************************************************************************
    659  *              StringFromGUID2 [COMPOBJ.76] [OLE32.152]
     674 *              StringFromGUID2 [COMPOBJ.76]
     675 *              StringFromGUID2 [OLE32.152]
    660676 *
    661677 * Converts a global unique identifier into a string of an API-
     
    729745
    730746/******************************************************************************
    731  *              CLSIDFromProgID16       [COMPOBJ.61]
     747 *              CLSIDFromProgID [COMPOBJ.61]
    732748 * Converts a program id into the respective GUID. (By using a registry lookup)
    733749 * RETURNS
     
    767783HRESULT WINAPI CLSIDFromProgID(
    768784        LPCOLESTR progid,       /* [in] program id as found in registry */
    769         LPCLSID riid            /* [out] associated CLSID */
    770 ) {
    771         LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
    772         HRESULT       ret = CLSIDFromProgID16(pid,riid);
    773 
    774         HeapFree(GetProcessHeap(),0,pid);
    775         return ret;
     785        LPCLSID riid )          /* [out] associated CLSID */
     786{
     787    static const WCHAR clsidW[] = { '\\','C','L','S','I','D',0 };
     788    char buf2[80];
     789    DWORD buf2len = sizeof(buf2);
     790    HKEY xhkey;
     791
     792    WCHAR *buf = HeapAlloc( GetProcessHeap(),0,(strlenW(progid)+8) * sizeof(WCHAR) );
     793    strcpyW( buf, progid );
     794    strcatW( buf, clsidW );
     795    if (RegOpenKeyW(HKEY_CLASSES_ROOT,buf,&xhkey))
     796    {
     797        HeapFree(GetProcessHeap(),0,buf);
     798        return CO_E_CLASSSTRING;
     799    }
     800    HeapFree(GetProcessHeap(),0,buf);
     801
     802    if (RegQueryValueA(xhkey,NULL,buf2,&buf2len))
     803    {
     804        RegCloseKey(xhkey);
     805        return CO_E_CLASSSTRING;
     806    }
     807    RegCloseKey(xhkey);
     808    return CLSIDFromString16(buf2,riid);
    776809}
    777810
     
    782815 *
    783816 * 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 
     817 * for the specified interface.
     818 *
     819 * It determines this by searching the
    787820 * HKEY_CLASSES_ROOT\Interface\{string form of riid}\ProxyStubClsid32 in the registry
    788821 * and any interface id registered by CoRegisterPSClsid within the current process.
    789  * 
     822 *
    790823 * FIXME: We only search the registry, not ids registered with CoRegisterPSClsid.
    791824 */
     
    822855
    823856    /* ... Once we have the key, query the registry to get the
    824        value of CLSID as a string, and convert it into a 
     857       value of CLSID as a string, and convert it into a
    825858       proper CLSID structure to be passed back to the app */
    826859    buf2len = sizeof(buf2);
     
    846879
    847880/***********************************************************************
    848  *              WriteClassStm
     881 *              WriteClassStm (OLE32.159)
    849882 *
    850883 * This function write a CLSID on stream
     
    861894
    862895/***********************************************************************
    863  *              ReadClassStm
     896 *              ReadClassStm (OLE32.135)
    864897 *
    865898 * This function read a CLSID from a stream
    866899 */
    867 HRESULT WINAPI ReadClassStm(IStream *pStm,REFCLSID rclsid)
     900HRESULT WINAPI ReadClassStm(IStream *pStm,CLSID *pclsid)
    868901{
    869902    ULONG nbByte;
    870903    HRESULT res;
    871    
    872     TRACE("(%p,%p)\n",pStm,rclsid);
    873 
    874     if (rclsid==NULL)
     904
     905    TRACE("(%p,%p)\n",pStm,pclsid);
     906
     907    if (pclsid==NULL)
    875908        return E_INVALIDARG;
    876    
    877     res = IStream_Read(pStm,(void*)rclsid,sizeof(CLSID),&nbByte);
     909
     910    res = IStream_Read(pStm,(void*)pclsid,sizeof(CLSID),&nbByte);
    878911
    879912    if (FAILED(res))
    880913        return res;
    881    
     914
    882915    if (nbByte != sizeof(CLSID))
    883916        return S_FALSE;
     
    908941        return 0;
    909942}
    910 
     943#endif
    911944/* FIXME: this function is not declared in the WINELIB headers. But where should it go ? */
    912945/***********************************************************************
    913  *           CallObjectInWOW (COMPOBJ.201)
     946 *           CALLOBJECTINWOW (COMPOBJ.201)
    914947 */
    915948HRESULT WINAPI CallObjectInWOW(LPVOID p1,LPVOID p2) {
     
    919952
    920953/******************************************************************************
    921  *              CoRegisterClassObject16 [COMPOBJ.5]
     954 *              CoRegisterClassObject   [COMPOBJ.5]
    922955 *
    923956 * Don't know where it registers it ...
     
    942975
    943976/******************************************************************************
    944  *      CoRevokeClassObject16 [COMPOBJ.6]
     977 *      CoRevokeClassObject [COMPOBJ.6]
    945978 *
    946979 */
     
    950983    return 0;
    951984}
    952 #endif
    953 
     985
     986/******************************************************************************
     987 *      CoFileTimeToDosDateTime [COMPOBJ.30]
     988 */
     989BOOL16 WINAPI CoFileTimeToDosDateTime16(const FILETIME *ft, LPWORD lpDosDate, LPWORD lpDosTime)
     990{
     991    return FileTimeToDosDateTime(ft, lpDosDate, lpDosTime);
     992}
     993
     994/******************************************************************************
     995 *      CoDosDateTimeToFileTime [COMPOBJ.31]
     996 */
     997BOOL16 WINAPI CoDosDateTimeToFileTime16(WORD wDosDate, WORD wDosTime, FILETIME *ft)
     998{
     999    return DosDateTimeToFileTime(wDosDate, wDosTime, ft);
     1000}
    9541001
    9551002/***
    9561003 * COM_GetRegisteredClassObject
    9571004 *
    958  * This internal method is used to scan the registered class list to 
     1005 * This internal method is used to scan the registered class list to
    9591006 * find a class object.
    9601007 *
    961  * Params: 
     1008 * Params:
    9621009 *   rclsid        Class ID of the class to find.
    9631010 *   dwClsContext  Class context to match.
     
    9711018        LPUNKNOWN*  ppUnk)
    9721019{
     1020  HRESULT hr = S_FALSE;
    9731021  RegisteredClass* curClass;
     1022
     1023  EnterCriticalSection( &csRegisteredClassList );
    9741024
    9751025  /*
     
    10021052      IUnknown_AddRef(curClass->classObject);
    10031053
    1004       return S_OK;
     1054      hr = S_OK;
     1055      goto end;
    10051056    }
    10061057
     
    10111062  }
    10121063
     1064end:
     1065  LeaveCriticalSection( &csRegisteredClassList );
    10131066  /*
    10141067   * If we get to here, we haven't found our class.
    10151068   */
    1016   return S_FALSE;
     1069  return hr;
     1070}
     1071
     1072static DWORD WINAPI
     1073_LocalServerThread(LPVOID param) {
     1074    HANDLE              hPipe;
     1075    char                pipefn[200];
     1076    RegisteredClass *newClass = (RegisteredClass*)param;
     1077    HRESULT             hres;
     1078    IStream             *pStm;
     1079    STATSTG             ststg;
     1080    unsigned char       *buffer;
     1081    int                 buflen;
     1082    IClassFactory       *classfac;
     1083    LARGE_INTEGER       seekto;
     1084    ULARGE_INTEGER      newpos;
     1085    ULONG               res;
     1086
     1087    TRACE("Starting threader for %s.\n",debugstr_guid(&newClass->classIdentifier));
     1088    strcpy(pipefn,PIPEPREF);
     1089    WINE_StringFromCLSID(&newClass->classIdentifier,pipefn+strlen(PIPEPREF));
     1090
     1091    hres = IUnknown_QueryInterface(newClass->classObject,&IID_IClassFactory,(LPVOID*)&classfac);
     1092    if (hres) return hres;
     1093
     1094    hres = CreateStreamOnHGlobal(0,TRUE,&pStm);
     1095    if (hres) {
     1096        FIXME("Failed to create stream on hglobal.\n");
     1097        return hres;
     1098    }
     1099    hres = CoMarshalInterface(pStm,&IID_IClassFactory,(LPVOID)classfac,0,NULL,0);
     1100    if (hres) {
     1101        FIXME("CoMarshalInterface failed, %lx!\n",hres);
     1102        return hres;
     1103    }
     1104    hres = IStream_Stat(pStm,&ststg,0);
     1105    if (hres) return hres;
     1106
     1107    buflen = ststg.cbSize.s.LowPart;
     1108    buffer = HeapAlloc(GetProcessHeap(),0,buflen);
     1109    seekto.s.LowPart = 0;
     1110    seekto.s.HighPart = 0;
     1111    hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos);
     1112    if (hres) {
     1113        FIXME("IStream_Seek failed, %lx\n",hres);
     1114        return hres;
     1115    }
     1116    hres = IStream_Read(pStm,buffer,buflen,&res);
     1117    if (hres) {
     1118        FIXME("Stream Read failed, %lx\n",hres);
     1119        return hres;
     1120    }
     1121    IStream_Release(pStm);
     1122
     1123    while (1) {
     1124        hPipe = CreateNamedPipeA(
     1125            pipefn,
     1126            PIPE_ACCESS_DUPLEX,
     1127            PIPE_TYPE_BYTE|PIPE_WAIT,
     1128            PIPE_UNLIMITED_INSTANCES,
     1129            4096,
     1130            4096,
     1131            NMPWAIT_USE_DEFAULT_WAIT,
     1132            NULL
     1133        );
     1134        if (hPipe == INVALID_HANDLE_VALUE) {
     1135            FIXME("pipe creation failed for %s, le is %lx\n",pipefn,GetLastError());
     1136            return 1;
     1137        }
     1138        if (!ConnectNamedPipe(hPipe,NULL)) {
     1139            ERR("Failure during ConnectNamedPipe %lx, ABORT!\n",GetLastError());
     1140            CloseHandle(hPipe);
     1141            continue;
     1142        }
     1143        WriteFile(hPipe,buffer,buflen,&res,NULL);
     1144        CloseHandle(hPipe);
     1145    }
     1146    return 0;
    10171147}
    10181148
     
    10301160        DWORD flags,        /* [in] REGCLS flags indicating how connections are made */
    10311161        LPDWORD lpdwRegister
    1032 ) 
     1162)
    10331163{
    10341164  RegisteredClass* newClass;
    10351165  LPUNKNOWN        foundObject;
    10361166  HRESULT          hr;
    1037     char buf[80];
    1038 
    1039     WINE_StringFromCLSID(rclsid,buf);
    10401167
    10411168  TRACE("(%s,%p,0x%08lx,0x%08lx,%p)\n",
    1042         buf,pUnk,dwClsContext,flags,lpdwRegister);
    1043 
    1044   /*
    1045    * Perform a sanity check on the parameters
    1046    */
     1169        debugstr_guid(rclsid),pUnk,dwClsContext,flags,lpdwRegister);
     1170
    10471171  if ( (lpdwRegister==0) || (pUnk==0) )
    1048   {
    10491172    return E_INVALIDARG;
    1050 }
    1051 
    1052   /*
    1053    * Initialize the cookie (out parameter)
    1054    */
     1173
    10551174  *lpdwRegister = 0;
    10561175
     
    10601179   */
    10611180  hr = COM_GetRegisteredClassObject(rclsid, dwClsContext, &foundObject);
    1062 
    1063   if (hr == S_OK)
    1064   {
    1065     /*
    1066      * The COM_GetRegisteredClassObject increased the reference count on the
    1067      * object so it has to be released.
    1068      */
     1181  if (hr == S_OK) {
    10691182    IUnknown_Release(foundObject);
    1070 
    10711183    return CO_E_OBJISREG;
    10721184  }
    1073    
    1074   /*
    1075    * If it is not registered, we must create a new entry for this class and
    1076    * append it to the registered class list.
    1077    * We use the address of the chain node as the cookie since we are sure it's
    1078    * unique.
    1079    */
     1185
    10801186  newClass = HeapAlloc(GetProcessHeap(), 0, sizeof(RegisteredClass));
    1081 
    1082   /*
    1083    * Initialize the node.
    1084    */
     1187  if ( newClass == NULL )
     1188    return E_OUTOFMEMORY;
     1189
     1190  EnterCriticalSection( &csRegisteredClassList );
     1191
    10851192  newClass->classIdentifier = *rclsid;
    10861193  newClass->runContext      = dwClsContext;
    10871194  newClass->connectFlags    = flags;
     1195  /*
     1196   * Use the address of the chain node as the cookie since we are sure it's
     1197   * unique.
     1198   */
    10881199  newClass->dwCookie        = (DWORD)newClass;
    10891200  newClass->nextClass       = firstRegisteredClass;
     
    10971208
    10981209  firstRegisteredClass = newClass;
    1099 
    1100   /*
    1101    * Assign the out parameter (cookie)
    1102    */
     1210  LeaveCriticalSection( &csRegisteredClassList );
     1211
    11031212  *lpdwRegister = newClass->dwCookie;
    1104    
    1105   /*
    1106    * We're successful Yippee!
    1107    */
     1213
     1214  if (dwClsContext & CLSCTX_LOCAL_SERVER) {
     1215      DWORD tid;
     1216
     1217      STUBMGR_Start();
     1218      newClass->hThread=CreateThread(NULL,0,_LocalServerThread,newClass,0,&tid);
     1219  }
    11081220  return S_OK;
    11091221}
     
    11171229 */
    11181230HRESULT WINAPI CoRevokeClassObject(
    1119         DWORD dwRegister)
    1120 {
     1231        DWORD dwRegister)
     1232{
     1233  HRESULT hr = E_INVALIDARG;
    11211234  RegisteredClass** prevClassLink;
    11221235  RegisteredClass*  curClass;
    11231236
    11241237  TRACE("(%08lx)\n",dwRegister);
     1238
     1239  EnterCriticalSection( &csRegisteredClassList );
    11251240
    11261241  /*
     
    11491264      /*
    11501265       * Free the memory used by the chain node.
    1151  */
     1266       */
    11521267      HeapFree(GetProcessHeap(), 0, curClass);
    11531268
    1154     return S_OK;
    1155 }
     1269      hr = S_OK;
     1270      goto end;
     1271    }
    11561272
    11571273    /*
     
    11621278  }
    11631279
     1280end:
     1281  LeaveCriticalSection( &csRegisteredClassList );
    11641282  /*
    11651283   * If we get to here, we haven't found our class.
    11661284   */
    1167   return E_INVALIDARG;
     1285  return hr;
     1286}
     1287
     1288static HRESULT WINAPI Remote_CoGetClassObject(
     1289    REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
     1290    REFIID iid, LPVOID *ppv
     1291) {
     1292  HKEY          key;
     1293  char          buf[200];
     1294  HRESULT       hres = E_UNEXPECTED;
     1295  char          xclsid[80];
     1296  WCHAR         dllName[MAX_PATH+1];
     1297  DWORD         dllNameLen = sizeof(dllName);
     1298  STARTUPINFOW  sinfo;
     1299  PROCESS_INFORMATION   pinfo;
     1300
     1301  WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
     1302
     1303  sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
     1304  hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
     1305
     1306  if (hres != ERROR_SUCCESS)
     1307      return REGDB_E_CLASSNOTREG;
     1308
     1309  memset(dllName,0,sizeof(dllName));
     1310  hres= RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)dllName,&dllNameLen);
     1311  if (hres)
     1312          return REGDB_E_CLASSNOTREG; /* FIXME: check retval */
     1313  RegCloseKey(key);
     1314
     1315  TRACE("found LocalServer32 exe %s\n", debugstr_w(dllName));
     1316
     1317  memset(&sinfo,0,sizeof(sinfo));
     1318  sinfo.cb = sizeof(sinfo);
     1319  if (!CreateProcessW(NULL,dllName,NULL,NULL,FALSE,0,NULL,NULL,&sinfo,&pinfo))
     1320      return E_FAIL;
     1321  return create_marshalled_proxy(rclsid,iid,ppv);
    11681322}
    11691323
    11701324/***********************************************************************
    11711325 *           CoGetClassObject [COMPOBJ.7]
     1326 *           CoGetClassObject [OLE32.16]
     1327 *
     1328 * FIXME.  If request allows of several options and there is a failure
     1329 *         with one (other than not being registered) do we try the
     1330 *         others or return failure?  (E.g. inprocess is registered but
     1331 *         the DLL is not found but the server version works)
    11721332 */
    11731333HRESULT WINAPI CoGetClassObject(
     
    11781338    HRESULT     hres = E_UNEXPECTED;
    11791339    char        xclsid[80];
    1180     WCHAR dllName[MAX_PATH+1];
    1181     DWORD dllNameLen = sizeof(dllName);
     1340    WCHAR ProviderName[MAX_PATH+1];
     1341    DWORD ProviderNameLen = sizeof(ProviderName);
    11821342    HINSTANCE hLibrary;
    11831343#ifdef __WIN32OS2__
    1184     typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid, 
     1344    typedef HRESULT (* CALLBACK DllGetClassObjectFunc)(REFCLSID clsid,
    11851345                             REFIID iid, LPVOID *ppv);
    11861346#else
    1187     typedef HRESULT CALLBACK (*DllGetClassObjectFunc)(REFCLSID clsid,
     1347    typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid,
    11881348                             REFIID iid, LPVOID *ppv);
    11891349#endif
    11901350    DllGetClassObjectFunc DllGetClassObject;
     1351    HKEY key;
     1352    char buf[200];
    11911353
    11921354    WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
     
    12031365
    12041366    /*
    1205      * First, try and see if we can't match the class ID with one of the 
     1367     * First, try and see if we can't match the class ID with one of the
    12061368     * registered classes.
    12071369     */
     
    12231385    }
    12241386
    1225     /* out of process and remote servers not supported yet */
    1226     if (     ((CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER) & dwClsContext)
     1387    if (((CLSCTX_LOCAL_SERVER) & dwClsContext)
     1388        && !((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext))
     1389        return Remote_CoGetClassObject(rclsid,dwClsContext,pServerInfo,iid,ppv);
     1390
     1391    /* remote servers not supported yet */
     1392    if (     ((CLSCTX_REMOTE_SERVER) & dwClsContext)
    12271393        && !((CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER) & dwClsContext)
    12281394    ){
    1229         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;
     1395        FIXME("CLSCTX_REMOTE_SERVER not supported!\n");
     1396        return E_NOINTERFACE;
    12341397    }
    12351398
     
    12381401        char buf[200];
    12391402
     1403        memset(ProviderName,0,sizeof(ProviderName));
    12401404        sprintf(buf,"CLSID\\%s\\InprocServer32",xclsid);
    1241         hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key);
    1242 
    1243         if (hres != ERROR_SUCCESS) {
    1244             return REGDB_E_CLASSNOTREG;
     1405        if (((hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key)) != ERROR_SUCCESS) ||
     1406            ((hres = RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)ProviderName,&ProviderNameLen)),
     1407             RegCloseKey (key),
     1408             hres != ERROR_SUCCESS))
     1409        {
     1410            hres = REGDB_E_CLASSNOTREG;
     1411        }
     1412        /* Don't ask me.  MSDN says that CoGetClassObject does NOT call CoLoadLibrary */
     1413        else if ((hLibrary = CoLoadLibrary(ProviderName, TRUE)) == 0)
     1414        {
     1415            FIXME("couldn't load InprocServer32 dll %s\n", debugstr_w(ProviderName));
     1416            hres = E_ACCESSDENIED; /* or should this be CO_E_DLLNOTFOUND? */
    12451417        }
    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? */
     1418        else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject")))
     1419        {
     1420            /* not sure if this should be called here CoFreeLibrary(hLibrary);*/
     1421            FIXME("couldn't find function DllGetClassObject in %s\n", debugstr_w(ProviderName));
     1422            hres = E_ACCESSDENIED;
    12591423        }
    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;
     1424        else
     1425        {
     1426            /* Ask the DLL for its class object. (there was a note here about
     1427             * class factories but this is good.
     1428             */
     1429            return DllGetClassObject(rclsid, iid, ppv);
     1430        }
     1431    }
     1432   
     1433
     1434    /* Finally try out of process */
     1435    /* out of process and remote servers not supported yet */
     1436    if (CLSCTX_LOCAL_SERVER & dwClsContext)
     1437    {
     1438        memset(ProviderName,0,sizeof(ProviderName));
     1439        sprintf(buf,"CLSID\\%s\\LocalServer32",xclsid);
     1440        if (((hres = RegOpenKeyExA(HKEY_CLASSES_ROOT, buf, 0, KEY_READ, &key)) != ERROR_SUCCESS) ||
     1441            ((hres = RegQueryValueExW(key,NULL,NULL,NULL,(LPBYTE)ProviderName,&ProviderNameLen)),
     1442             RegCloseKey (key),
     1443             hres != ERROR_SUCCESS))
     1444        {
     1445            hres = REGDB_E_CLASSNOTREG;
     1446        }
     1447        else
     1448        {
     1449            /* CO_E_APPNOTFOUND if no exe */
     1450            FIXME("CLSCTX_LOCAL_SERVER %s registered but not yet supported!\n",debugstr_w(ProviderName));
     1451            hres = E_ACCESSDENIED;
    12651452        }
    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);
    1272     }
     1453    }
     1454
     1455    if (CLSCTX_REMOTE_SERVER & dwClsContext)
     1456    {
     1457        FIXME ("CLSCTX_REMOTE_SERVER not supported\n");
     1458        hres = E_ACCESSDENIED;
     1459    }
     1460
    12731461    return hres;
    12741462}
    1275 
    1276 /***********************************************************************
    1277  *        CoResumeClassObjects
     1463/***********************************************************************
     1464 *        CoResumeClassObjects (OLE32.173)
    12781465 *
    12791466 * Resumes classobjects registered with REGCLS suspended
     
    12861473
    12871474/***********************************************************************
    1288  *        GetClassFile
     1475 *        GetClassFile (OLE32.67)
    12891476 *
    12901477 * This function supplies the CLSID associated with the given filename.
    12911478 */
    1292 HRESULT WINAPI GetClassFile(LPOLESTR filePathName,CLSID *pclsid)
     1479HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid)
    12931480{
    12941481    IStorage *pstg=0;
     
    13161503       pattern in the registry. this case is not frequently used ! so I present only the psodocode for
    13171504       this case
    1318        
     1505
    13191506     for(i=0;i<nFileTypes;i++)
    13201507
     
    13491536    length=lstrlenW(absFile);
    13501537    for(i=length-1; ( (i>=0) && (extention[i]=absFile[i]) );i--);
    1351        
     1538
    13521539    /* get the progId associated to the extension */
    13531540    progId=CoTaskMemAlloc(sizeProgId);
     
    13771564#ifndef __WIN32OS2__
    13781565/******************************************************************************
    1379  *              CoRegisterMessageFilter16       [COMPOBJ.27]
     1566 *              CoRegisterMessageFilter [COMPOBJ.27]
    13801567 */
    13811568HRESULT WINAPI CoRegisterMessageFilter16(
     
    13871574}
    13881575#endif
    1389 
    1390 /***********************************************************************
    1391  *           CoCreateInstance [COMPOBJ.13, OLE32.7]
     1576/***********************************************************************
     1577 *           CoCreateInstance [COMPOBJ.13]
     1578 *           CoCreateInstance [OLE32.7]
    13921579 */
    13931580HRESULT WINAPI CoCreateInstance(
     
    13961583        DWORD dwClsContext,
    13971584        REFIID iid,
    1398         LPVOID *ppv) 
     1585        LPVOID *ppv)
    13991586{
    14001587        HRESULT hres;
     
    14111598   */
    14121599  *ppv = 0;
    1413  
     1600
    14141601  /*
    14151602   * Get a class factory to construct the object we want.
     
    14221609
    14231610  if (FAILED(hres)) {
    1424     FIXME("no instance created for %s, hres is 0x%08lx\n",debugstr_guid(iid),hres);
     1611    FIXME("no classfactory created for CLSID %s, hres is 0x%08lx\n",
     1612          debugstr_guid(rclsid),hres);
    14251613    return hres;
    14261614  }
     
    14311619        hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv);
    14321620        IClassFactory_Release(lpclf);
     1621        if(FAILED(hres))
     1622          FIXME("no instance created for interface %s of class %s, hres is 0x%08lx\n",
     1623                debugstr_guid(iid), debugstr_guid(rclsid),hres);
    14331624
    14341625        return hres;
     
    14391630 */
    14401631HRESULT WINAPI CoCreateInstanceEx(
    1441   REFCLSID      rclsid, 
     1632  REFCLSID      rclsid,
    14421633  LPUNKNOWN     pUnkOuter,
    1443   DWORD         dwClsContext, 
     1634  DWORD         dwClsContext,
    14441635  COSERVERINFO* pServerInfo,
    14451636  ULONG         cmq,
     
    14721663   * Get the object and get its IUnknown pointer.
    14731664   */
    1474   hr = CoCreateInstance(rclsid, 
     1665  hr = CoCreateInstance(rclsid,
    14751666                        pUnkOuter,
    14761667                        dwClsContext,
     
    15091700
    15101701/***********************************************************************
    1511  *           CoFreeLibrary [COMPOBJ.13]
     1702 *           CoFreeLibrary [OLE32.13]
    15121703 */
    15131704void WINAPI CoFreeLibrary(HINSTANCE hLibrary)
     
    15151706    OpenDll *ptr, *prev;
    15161707    OpenDll *tmp;
     1708
     1709    EnterCriticalSection( &csOpenDllList );
    15171710
    15181711    /* lookup library in linked list */
     
    15271720    if (ptr == NULL) {
    15281721        /* shouldn't happen if user passed in a valid hLibrary */
    1529         return;
     1722        goto end;
    15301723    }
    15311724    /* assert: ptr points to the library entry to free */
     
    15421735        prev->next = tmp;
    15431736    }
    1544 
    1545 }
    1546 
    1547 
    1548 /***********************************************************************
    1549  *           CoFreeAllLibraries [COMPOBJ.12]
     1737end:
     1738    LeaveCriticalSection( &csOpenDllList );
     1739}
     1740
     1741
     1742/***********************************************************************
     1743 *           CoFreeAllLibraries [OLE32.12]
    15501744 */
    15511745void WINAPI CoFreeAllLibraries(void)
    15521746{
    15531747    OpenDll *ptr, *tmp;
     1748
     1749    EnterCriticalSection( &csOpenDllList );
    15541750
    15551751    for (ptr = openDllList; ptr != NULL; ) {
     
    15581754        ptr = tmp;
    15591755    }
     1756
     1757    LeaveCriticalSection( &csOpenDllList );
    15601758}
    15611759
     
    15641762/***********************************************************************
    15651763 *           CoFreeUnusedLibraries [COMPOBJ.17]
     1764 *           CoFreeUnusedLibraries [OLE32.14]
    15661765 */
    15671766void WINAPI CoFreeUnusedLibraries(void)
     
    15711770    DllCanUnloadNowFunc DllCanUnloadNow;
    15721771
     1772    EnterCriticalSection( &csOpenDllList );
     1773
    15731774    for (ptr = openDllList; ptr != NULL; ) {
    15741775        DllCanUnloadNow = (DllCanUnloadNowFunc)
    15751776            GetProcAddress(ptr->hLibrary, "DllCanUnloadNow");
    1576        
     1777
    15771778        if ( (DllCanUnloadNow != NULL) &&
    15781779             (DllCanUnloadNow() == S_OK) ) {
     
    15841785        }
    15851786    }
    1586 }
    1587 
    1588 /***********************************************************************
    1589  *           CoFileTimeNow [COMPOBJ.82, OLE32.10]
     1787
     1788    LeaveCriticalSection( &csOpenDllList );
     1789}
     1790
     1791/***********************************************************************
     1792 *           CoFileTimeNow [COMPOBJ.82]
     1793 *           CoFileTimeNow [OLE32.10]
     1794 *
    15901795 * RETURNS
    15911796 *      the current system time in lpFileTime
     
    16081813    HRESULT     ret = CoGetMalloc(0,&lpmalloc);
    16091814
    1610     if (FAILED(ret)) 
     1815    if (FAILED(ret))
    16111816        return NULL;
    16121817
     
    16221827    HRESULT     ret = CoGetMalloc(0,&lpmalloc);
    16231828
    1624     if (FAILED(ret)) 
     1829    if (FAILED(ret))
    16251830      return;
    16261831
     
    16391844  LPMALLOC lpmalloc;
    16401845  HRESULT  ret = CoGetMalloc(0,&lpmalloc);
    1641  
    1642   if (FAILED(ret)) 
     1846
     1847  if (FAILED(ret))
    16431848    return NULL;
    16441849
     
    16541859    OpenDll *ptr;
    16551860    OpenDll *tmp;
    1656  
     1861
    16571862    TRACE("(%s, %d)\n", debugstr_w(lpszLibName), bAutoFree);
    16581863
     
    16611866    if (!bAutoFree)
    16621867        return hLibrary;
     1868
     1869    EnterCriticalSection( &csOpenDllList );
    16631870
    16641871    if (openDllList == NULL) {
     
    16841891        }
    16851892    }
    1686      
     1893
     1894    LeaveCriticalSection( &csOpenDllList );
     1895
    16871896    return hLibrary;
    16881897}
     
    16961905}
    16971906
    1698 #ifndef __WIN32OS2__
    1699 /******************************************************************************
    1700  *              CoLockObjectExternal16  [COMPOBJ.63]
     1907/******************************************************************************
     1908 *              CoLockObjectExternal    [COMPOBJ.63]
    17011909 */
    17021910HRESULT WINAPI CoLockObjectExternal16(
     
    17081916    return S_OK;
    17091917}
    1710 #endif
    17111918
    17121919/******************************************************************************
     
    17191926{
    17201927
    1721   if (fLock) 
     1928  if (fLock)
    17221929  {
    1723     /* 
     1930    /*
    17241931     * Increment the external lock coutner, COM_ExternalLockAddRef also
    17251932     * increment the object's internal lock counter.
    17261933     */
    1727     COM_ExternalLockAddRef( pUnk); 
     1934    COM_ExternalLockAddRef( pUnk);
    17281935  }
    17291936  else
    17301937  {
    1731     /* 
     1938    /*
    17321939     * Decrement the external lock coutner, COM_ExternalLockRelease also
    17331940     * decrement the object's internal lock counter.
     
    17391946}
    17401947
    1741 #ifndef __WIN32OS2__
    1742 /***********************************************************************
    1743  *           CoGetState16 [COMPOBJ.115]
     1948/***********************************************************************
     1949 *           CoGetState [COMPOBJ.115]
    17441950 */
    17451951HRESULT WINAPI CoGetState16(LPDWORD state)
     
    17501956}
    17511957/***********************************************************************
    1752  *           CoSetState [COM32.42]
     1958 *           CoSetState [OLE32.42]
    17531959 */
    17541960HRESULT WINAPI CoSetState(LPDWORD state)
     
    17581964    return S_OK;
    17591965}
    1760 #endif
    17611966/***********************************************************************
    17621967 *          CoCreateFreeThreadedMarshaler [OLE32.5]
     
    17651970{
    17661971   FIXME ("(%p %p): stub\n", punkOuter, ppunkMarshal);
    1767    
     1972
    17681973   return S_OK;
    17691974}
    1770 
    1771 
    1772 /***********************************************************************
    1773  *           DllGetClassObject [OLE32.63]
    1774  */
    1775 HRESULT 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;
    1780 }
    1781 
    17821975
    17831976/***
    17841977 * COM_RevokeAllClasses
    17851978 *
    1786  * This method is called when the COM libraries are uninitialized to 
     1979 * This method is called when the COM libraries are uninitialized to
    17871980 * release all the references to the class objects registered with
    17881981 * the library
     
    17901983static void COM_RevokeAllClasses()
    17911984{
     1985  EnterCriticalSection( &csRegisteredClassList );
     1986
    17921987  while (firstRegisteredClass!=0)
    17931988  {
    17941989    CoRevokeClassObject(firstRegisteredClass->dwCookie);
    17951990  }
     1991
     1992  LeaveCriticalSection( &csRegisteredClassList );
    17961993}
    17971994
     
    18011998
    18021999/****************************************************************************
    1803  * Public - Method that increments the count for a IUnknown* in the linked 
     2000 * Public - Method that increments the count for a IUnknown* in the linked
    18042001 * list.  The item is inserted if not already in the list.
    18052002 */
     
    18222019   * Add an internal lock to the object
    18232020   */
    1824   IUnknown_AddRef(pUnk); 
     2021  IUnknown_AddRef(pUnk);
    18252022}
    18262023
    18272024/****************************************************************************
    1828  * Public - Method that decrements the count for a IUnknown* in the linked 
     2025 * Public - Method that decrements the count for a IUnknown* in the linked
    18292026 * list.  The item is removed from the list if its count end up at zero or if
    18302027 * bRelAll is TRUE.
     
    18432040      IUnknown_Release(pUnk);     /* release local locks as well */
    18442041
    1845       if ( bRelAll == FALSE ) 
     2042      if ( bRelAll == FALSE )
    18462043        break;  /* perform single release */
    18472044
    1848     } while ( externalLock->uRefCount > 0 ); 
     2045    } while ( externalLock->uRefCount > 0 );
    18492046
    18502047    if ( externalLock->uRefCount == 0 )  /* get rid of the list entry */
     
    18642061    COM_ExternalLockDelete(head);     /* get rid of the head stuff       */
    18652062
    1866     head = elList.head;               /* get the new head...             */ 
     2063    head = elList.head;               /* get the new head...             */
    18672064  }
    18682065}
     
    18802077  {
    18812078      DPRINTF( "\t%p with %lu references count.\n", current->pUnk, current->uRefCount);
    1882  
    1883     /* Skip to the next item */ 
     2079
     2080    /* Skip to the next item */
    18842081    current = current->next;
    1885   } 
     2082  }
    18862083
    18872084}
     
    19032100  IUnknown         *pUnk)
    19042101{
    1905   if ( element == EL_END_OF_LIST ) 
     2102  if ( element == EL_END_OF_LIST )
    19062103    return EL_NOT_FOUND;
    19072104
     
    19092106    return element;
    19102107
    1911   else                                 /* Not the right guy, keep on looking */ 
     2108  else                                 /* Not the right guy, keep on looking */
    19122109    return COM_ExternalLockLocate( element->next, pUnk);
    19132110}
     
    19292126  if (newLock!=NULL)
    19302127  {
    1931     if ( elList.head == EL_END_OF_LIST ) 
     2128    if ( elList.head == EL_END_OF_LIST )
    19322129    {
    19332130      elList.head = newLock;    /* The list is empty */
    19342131    }
    1935     else 
     2132    else
    19362133    {
    1937       /* 
     2134      /*
    19382135       * insert does it at the head
    19392136       */
     
    19432140
    19442141    /*
    1945      * Set new list item data member 
     2142     * Set new list item data member
    19462143     */
    19472144    newLock->pUnk      = pUnk;
    19482145    newLock->uRefCount = 1;
    19492146    newLock->next      = previousHead;
    1950    
     2147
    19512148    return TRUE;
    19522149  }
     
    19652162  if ( current == itemList )
    19662163  {
    1967     /* 
    1968      * this section handles the deletion of the first node 
     2164    /*
     2165     * this section handles the deletion of the first node
    19692166     */
    19702167    elList.head = itemList->next;
    1971     HeapFree( GetProcessHeap(), 0, itemList); 
     2168    HeapFree( GetProcessHeap(), 0, itemList);
    19722169  }
    19732170  else
    19742171  {
    1975     do 
     2172    do
    19762173    {
    19772174      if ( current->next == itemList )   /* We found the item to free  */
    19782175      {
    19792176        current->next = itemList->next;  /* readjust the list pointers */
    1980  
    1981         HeapFree( GetProcessHeap(), 0, itemList); 
    1982         break; 
     2177
     2178        HeapFree( GetProcessHeap(), 0, itemList);
     2179        break;
    19832180      }
    1984  
    1985       /* Skip to the next item */ 
     2181
     2182      /* Skip to the next item */
    19862183      current = current->next;
    1987  
     2184
    19882185    } while ( current != EL_END_OF_LIST );
    19892186  }
    19902187}
    19912188
    1992 #ifndef __WIN32OS2__
    1993 /***********************************************************************
    1994  *      COMPOBJ_DllEntryPoint                   [COMPOBJ.entry]
     2189/***********************************************************************
     2190 *      DllEntryPoint                   [COMPOBJ.116]
    19952191 *
    19962192 *    Initialization code for the COMPOBJ DLL
     
    20152211        return TRUE;
    20162212}
    2017 #endif
     2213
    20182214/******************************************************************************
    20192215 *              OleGetAutoConvert        [OLE32.104]
     
    20542250HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew)
    20552251{
    2056     HKEY hkey = 0, hkeyConvert = 0;
     2252    HKEY hkey = 0;
    20572253    char buf[200], szClsidNew[200];
    20582254    HRESULT res = S_OK;
    20592255
    2060     TRACE("(%p,%p);\n", clsidOld, clsidNew);
     2256    TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
    20612257    sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
    20622258    WINE_StringFromCLSID(clsidNew, szClsidNew);
     
    20662262        goto done;
    20672263    }
    2068     if (RegCreateKeyA(hkey, "AutoConvertTo", &hkeyConvert))
     2264    if (RegSetValueA(hkey, "AutoConvertTo", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
    20692265    {
    20702266        res = REGDB_E_WRITEREGDB;
    20712267        goto done;
    20722268    }
    2073     if (RegSetValueExA(hkeyConvert, NULL, 0,
    2074                             REG_SZ, (LPBYTE)szClsidNew, strlen(szClsidNew)+1))
     2269
     2270done:
     2271    if (hkey) RegCloseKey(hkey);
     2272    return res;
     2273}
     2274
     2275/******************************************************************************
     2276 *              CoTreatAsClass        [OLE32.46]
     2277 */
     2278HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
     2279{
     2280    HKEY hkey = 0;
     2281    char buf[200], szClsidNew[200];
     2282    HRESULT res = S_OK;
     2283
     2284    FIXME("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
     2285    sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
     2286    WINE_StringFromCLSID(clsidNew, szClsidNew);
     2287    if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
     2288    {
     2289        res = REGDB_E_CLASSNOTREG;
     2290        goto done;
     2291    }
     2292    if (RegSetValueA(hkey, "AutoTreatAs", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
    20752293    {
    20762294        res = REGDB_E_WRITEREGDB;
     
    20792297
    20802298done:
    2081     if (hkeyConvert) RegCloseKey(hkeyConvert);
    20822299    if (hkey) RegCloseKey(hkey);
    2083 
    20842300    return res;
    20852301}
     2302
    20862303
    20872304/***********************************************************************
     
    21012318    return !memcmp(rguid1,rguid2,sizeof(GUID));
    21022319}
    2103 
    2104 #ifdef __WIN32OS2__
    2105 // ----------------------------------------------------------------------
    2106 // CLSIDFromStringA()
    2107 // @@@PH: this is not a WINE API, but a replacement for CLSIDFromString16
    2108 //        which used to accept ASCII strings instead of OLE strings
    2109 // ----------------------------------------------------------------------
    2110 
    2111 HRESULT WIN32API CLSIDFromStringA(
    2112     LPCSTR              lpsz,           // [in] - ASCII string CLSID
    2113     LPCLSID             pclsid)         // [out] - Binary CLSID
    2114 {
    2115     return CLSIDFromString16(lpsz, pclsid);
    2116 }
    2117 #endif
  • trunk/src/ole32/compobj_private.h

    r5602 r7926  
    11#ifndef __WINE_OLE_COMPOBJ_H
    22#define __WINE_OLE_COMPOBJ_H
     3
     4#ifdef __WIN32OS2__
     5#undef inline
     6#define inline
     7
     8#include "wine/obj_moniker.h"
     9
     10#endif
    311
    412/* All private prototype functions used by OLE will be added to this header file */
    513
    614#include "wtypes.h"
     15
     16extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr);
     17extern HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv);
     18
     19inline static HRESULT
     20get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) {
     21    HRESULT       hres;
     22    CLSID         pxclsid;
     23
     24    if ((hres = CoGetPSClsid(riid,&pxclsid)))
     25        return hres;
     26    return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf);
     27}
     28
     29#define PIPEPREF "\\\\.\\pipe\\"
     30#define OLESTUBMGR PIPEPREF"WINE_OLE_StubMgr"
     31/* Standard Marshaling definitions */
     32typedef struct _wine_marshal_id {
     33    DWORD       processid;
     34    DWORD       objectid;       /* unique value corresp. IUnknown of object */
     35    IID         iid;
     36} wine_marshal_id;
     37
     38inline static BOOL
     39MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) {
     40    return
     41        (mid1->processid == mid2->processid)    &&
     42        (mid1->objectid == mid2->objectid)      &&
     43        IsEqualIID(&(mid1->iid),&(mid2->iid))
     44    ;
     45}
     46
     47/* compare without interface compare */
     48inline static BOOL
     49MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) {
     50    return
     51        (mid1->processid == mid2->processid)    &&
     52        (mid1->objectid == mid2->objectid)
     53    ;
     54}
     55
     56HRESULT MARSHAL_Find_Stub_Buffer(wine_marshal_id *mid,IRpcStubBuffer **stub);
     57HRESULT MARSHAL_Find_Stub_Server(wine_marshal_id *mid,LPUNKNOWN *punk);
     58HRESULT MARSHAL_Register_Stub(wine_marshal_id *mid,LPUNKNOWN punk, IRpcStubBuffer *stub);
     59
     60HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
     61
     62typedef struct _wine_marshal_data {
     63    DWORD       dwDestContext;
     64    DWORD       mshlflags;
     65} wine_marshal_data;
     66
     67
     68#define REQTYPE_REQUEST         0
     69typedef struct _wine_rpc_request_header {
     70    DWORD               reqid;
     71    wine_marshal_id     mid;
     72    DWORD               iMethod;
     73    DWORD               cbBuffer;
     74} wine_rpc_request_header;
     75
     76#define REQTYPE_RESPONSE        1
     77typedef struct _wine_rpc_response_header {
     78    DWORD               reqid;
     79    DWORD               cbBuffer;
     80    DWORD               retval;
     81} wine_rpc_response_header;
     82
     83#define REQSTATE_START                  0
     84#define REQSTATE_REQ_QUEUED             1
     85#define REQSTATE_REQ_WAITING_FOR_REPLY  2
     86#define REQSTATE_REQ_GOT                3
     87#define REQSTATE_INVOKING               4
     88#define REQSTATE_RESP_QUEUED            5
     89#define REQSTATE_RESP_GOT               6
     90#define REQSTATE_DONE                   6
     91
     92void STUBMGR_Start();
     93
     94extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf);
    795
    896/* This function initialize the Running Object Table */
     
    13101
    14102/* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */
    15 int WINAPI FileMonikerImpl_DecomposePath(LPOLESTR str, LPOLESTR** stringTable);
     103int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable);
    16104
    17105#endif /* __WINE_OLE_COMPOBJ_H */
  • trunk/src/ole32/compositemoniker.c

    r7502 r7926  
    1717#include "ole2.h"
    1818
    19 #ifdef __WIN32OS2__
    20 #undef FIXME
    21 #undef TRACE
    22 #ifdef DEBUG
    23 // PH 2001-11-30
    24 // this macro definition causes the control leave the scope of a
    25 // non-curly-braced preceeding if statement. Therefore,
    26 //   if (p!=NULL)
    27 //      TRACE("p->a=%d", p->a)
    28 // crashes.
    29 //
    30 // !!! ENSURE TRACES AND FIXMES WITH PRECEEDING IF STATEMENT
    31 // !!! ARE PUT INTO CURLY BRACES
    32 #define TRACE WriteLog("OLE32: %s", __FUNCTION__); WriteLog
    33 #define FIXME WriteLog("FIXME OLE32: %s", __FUNCTION__); WriteLog
    34 #else
    35 #define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    36 #define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    37 #endif
    38 #endif
    39 
    4019DEFAULT_DEBUG_CHANNEL(ole);
    4120
     
    4726    ICOM_VTABLE(IMoniker)*  lpvtbl1;  /* VTable relative to the IMoniker interface.*/
    4827
    49     /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether
    50      * two monikers are equal. That's whay IROTData interface is implemented by monikers.
     28    /* The ROT (RunningObjectTable implementation) uses the IROTData
     29     * interface to test whether two monikers are equal. That's why IROTData
     30     * interface is implemented by monikers.
    5131     */
    5232    ICOM_VTABLE(IROTData)*  lpvtbl2;  /* VTable relative to the IROTData interface.*/
     
    362342            return E_FAIL;
    363343
    364         else{
    365             FIXME("()");
     344        else
     345        {
     346            FIXME("()\n");
     347            /* FIXME: To whoever wrote this code: It's either return or break. it cannot be both! */
    366348            break;
    367349            return E_NOTIMPL;
     
    394376    TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty);
    395377
    396     /* this function call OleSaveToStream function for each moniker within this object */
    397 
    398     /* when I tested this function in windows system ! I usually found this constant in the begining of */
    399     /* the stream  I dont known why (there's no indication in specification) ! */
     378    /* This function calls OleSaveToStream function for each moniker within
     379     * this object.
     380     * When I tested this function in windows, I usually found this constant
     381     * at the beginning of the stream. I don't known why (there's no
     382     * indication in the specification) !
     383     */
    400384    res=IStream_Write(pStm,&constant,sizeof(constant),NULL);
    401385
     
    429413    ULARGE_INTEGER ptmpSize;
    430414
    431     /* the sizeMax of this object is calculated by calling  GetSizeMax on each moniker within this object then */
    432     /* suming all returned sizemax */
     415    /* The sizeMax of this object is calculated by calling  GetSizeMax on
     416     * each moniker within this object then summing all returned values
     417     */
    433418
    434419    TRACE("(%p,%p)\n",iface,pcbSize);
     
    469454    TRACE("(%p,%p,%p)\n",This,pmkFirst,pmkRest);
    470455
    471     /* Initialize the virtual fgunction table. */
     456    /* Initialize the virtual function table. */
    472457    This->lpvtbl1      = &VT_CompositeMonikerImpl;
    473458    This->lpvtbl2      = &VT_ROTDataImpl;
     
    483468    IMoniker_IsSystemMoniker(pmkFirst,&mkSys);
    484469
    485     /* put the first moniker contents in the begining of the table */
     470    /* put the first moniker contents in the beginning of the table */
    486471    if (mkSys!=MKSYS_GENERICCOMPOSITE){
    487472
     
    557542    else{
    558543
    559         /* add a composite moniker to the moniker table (do the same thing for each moniker within the */
    560         /* composite moniker as a simple moniker (see above how to add a simple moniker case) ) */
     544        /* add a composite moniker to the moniker table (do the same thing
     545         * for each moniker within the composite moniker as a simple moniker
     546         * (see above for how to add a simple moniker case) )
     547         */
    561548        IMoniker_Enum(pmkRest,TRUE,&enumMoniker);
    562549
     
    16641651
    16651652/******************************************************************************
    1666  *        CreateGenericComposite        [OLE.55]
     1653 *        CreateGenericComposite        [OLE32.56]
    16671654 ******************************************************************************/
    16681655HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite)
     
    17131700
    17141701/******************************************************************************
    1715  *        MonikerCommonPrefixWith       [OLE.55]
     1702 *        MonikerCommonPrefixWith       [OLE32.82]
    17161703 ******************************************************************************/
    17171704HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon)
  • trunk/src/ole32/errorinfo.c

    r6711 r7926  
    1010
    1111#include <string.h>
    12 #include "debugtools.h"
     12
    1313#include "windef.h"
    14 #include "heap.h"
     14#include "winbase.h"
     15#include "oleauto.h"
    1516#include "winerror.h"
    16 #include "thread.h"
    17 #include "debugtools.h"
     17
    1818#include "wine/obj_base.h"
    1919#include "wine/obj_oleaut.h"
    2020#include "wine/obj_errorinfo.h"
    2121#include "wine/unicode.h"
     22#include "thread.h"
     23
     24#include "debugtools.h"
    2225
    2326DEFAULT_DEBUG_CHANNEL(ole);
     
    4144    /*
    4245     * Allocate a new buffer to hold the string.
    43      * dont't forget to keep an empty spot at the begining of the
     46     * dont't forget to keep an empty spot at the beginning of the
    4447     * buffer for the character count and an extra character at the
    45      * end for the NULL.
     48     * end for the '\0'.
    4649     */
    4750    newBuffer = (DWORD*)HeapAlloc(GetProcessHeap(),
     
    448451};
    449452/***********************************************************************
    450  *              CreateErrorInfo
     453 *              CreateErrorInfo (OLE32.192)
    451454 */
    452455HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo)
     
    464467
    465468/***********************************************************************
    466  *              GetErrorInfo
     469 *              GetErrorInfo (OLE32.196)
    467470 */
    468471HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
     
    479482
    480483/***********************************************************************
    481  *              SetErrorInfo
     484 *              SetErrorInfo (OLE32.255)
    482485 */
    483486HRESULT WINAPI SetErrorInfo(ULONG dwReserved, IErrorInfo *perrinfo)
  • trunk/src/ole32/filemoniker.c

    r6711 r7926  
    8585HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* iface, LPCOLESTR lpszPathName);
    8686HRESULT WINAPI FileMonikerImpl_Destroy(FileMonikerImpl* iface);
    87 int     WINAPI FileMonikerImpl_DecomposePath(LPOLESTR str, LPOLESTR** tabStr);
     87int     WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** tabStr);
    8888
    8989
     
    322322                                    BOOL fClearDirty)/* Specifies whether to clear the dirty flag */
    323323{
    324     /* this function saves data of this object. In the begining I thougth that I have just to write
    325      * the filePath string on Stream. But, when I tested this function whith windows programs samples !
    326      * I noted that it was not the case. So I analysed data written by this function on Windows system and
    327      * what did this function do exactly ! but I have no idear a bout its logic !
    328      * I guessed data who must be written on stream wich is:
    329      * 1) WORD constant:zero 2) length of the path string ("\0" included) 3) path string type A
    330      * 4) DWORD constant : 0xDEADFFFF 5) ten WORD constant: zero  6) DWORD: double-length of the the path
    331      * string type W ("\0" not included) 7) WORD constant: 0x3 8) filePath unicode string.
    332      *  if the length(filePath) > 8 or.length(filePath) == 8 stop at step 5)
     324    /* this function saves data of this object. In the beginning I thougth
     325     * that I have just to write the filePath string on Stream. But, when I
     326     * tested this function whith windows programs samples, I noticed that it
     327     * was not the case. So I analysed data written by this function on
     328     * Windows and what this did function exactly ! But I have no idea about
     329     * its logic !
     330     * I guessed data which must be written on stream is:
     331     * 1) WORD constant:zero
     332     * 2) length of the path string ("\0" included)
     333     * 3) path string type A
     334     * 4) DWORD constant : 0xDEADFFFF
     335     * 5) ten WORD constant: zero
     336     * 6) DWORD: double-length of the the path string type W ("\0" not
     337     *    included)
     338     * 7) WORD constant: 0x3
     339     * 8) filePath unicode string.
     340     *    if the length(filePath) > 8 or length(filePath) == 8 stop at step 5)
    333341     */
    334342
     
    596604        if (pca!=NULL){
    597605
    598             FIXME("()");
     606            FIXME("()\n");
    599607           
    600608            /*res=GetClassFile(This->filePathName,&clsID);
     
    611619            }*/
    612620        }
    613 }
     621    }
    614622
    615623    if (pObj!=NULL){
     
    689697        FIXME("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvObject);
    690698
    691     return E_NOTIMPL;
    692 }
     699        return E_NOTIMPL;
     700    }
    693701    return res;
    694702}
     
    893901            h = (h * 39) + val[off];
    894902        }
    895 }
     903    }
    896904
    897905    *pdwHash=h;
     
    965973       
    966974        *pFileTime=info.ftLastWriteTime;
    967 }
     975    }
    968976
    969977    return S_OK;
     
    10361044                    machimeNameCase=FALSE;
    10371045                    break;
    1038 }
     1046            }
    10391047        }
    10401048
     
    10691077 *        DecomposePath (local function)
    10701078 ******************************************************************************/
    1071 int WINAPI FileMonikerImpl_DecomposePath(LPOLESTR str, LPOLESTR** stringTable)
     1079int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
    10721080{
    10731081    WCHAR bSlash[] = {'\\',0};
     
    13021310
    13031311/******************************************************************************
    1304  *        CreateFileMoniker16
     1312 *        CreateFileMoniker (OLE2.28)
    13051313 ******************************************************************************/
    13061314HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk)
     
    13121320
    13131321/******************************************************************************
    1314  *        CreateFileMoniker
     1322 *        CreateFileMoniker (OLE32.55)
    13151323 ******************************************************************************/
    13161324HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER * ppmk)
  • trunk/src/ole32/hglobalstream.c

    r6711 r7926  
    77 * Copyright 1999 Francis Beaudet
    88 */
     9
     10#include "config.h"
     11
    912#include <assert.h>
    1013#include <stdlib.h>
     
    1215#include <string.h>
    1316
     17#include "windef.h"
     18#include "objbase.h"
     19#include "ole2.h"
    1420#include "winbase.h"
    1521#include "winerror.h"
     22
    1623#include "debugtools.h"
    17 
    18 #include "objbase.h"
    1924
    2025DEFAULT_DEBUG_CHANNEL(storage);
     
    257262   
    258263    /*
    259      * Start the stream at the begining.
     264     * Start the stream at the beginning.
    260265     */
    261266    newStream->currentPosition.s.HighPart = 0;
  • trunk/src/ole32/ifs.c

    r6711 r7926  
    55 */
    66
     7#include "config.h"
     8
    79#include <ctype.h>
    810#include <stdlib.h>
    911#include <string.h>
    1012#include <assert.h>
     13
     14#include "ole2.h"
     15#include "windef.h"
    1116#include "winerror.h"
    12 #include "heap.h"
     17
     18#include "wine/obj_base.h"
    1319#include "wine/winbase16.h"
    14 #include "wine/obj_base.h"
     20#include "ifs.h"
     21
    1522#include "debugtools.h"
    16 
    17 #include "ole.h"
    18 #include "ifs.h"
    1923
    2024DEFAULT_DEBUG_CHANNEL(relay);
     
    139143        ICOM_THIS(IMalloc16Impl,iface);
    140144        TRACE("(%p)->Alloc(%ld)\n",This,cb);
    141         return MapLS( HeapAlloc( GetProcessHeap(), HEAP_WINE_SEGPTR, cb ) );
     145        return MapLS( HeapAlloc( GetProcessHeap(), 0, cb ) );
    142146}
    143147
     
    145149 * IMalloc16_Realloc [COMPOBJ.504]
    146150 */
    147 SEGPTR WINAPI IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb) {
    148         ICOM_THIS(IMalloc16Impl,iface);
    149         TRACE("(%p)->Realloc(%08lx,%ld)\n",This,pv,cb);
    150         return MapLS( HeapReAlloc( GetProcessHeap(), HEAP_WINE_SEGPTR, MapSL(pv), cb ) );
     151SEGPTR WINAPI IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb)
     152{
     153    SEGPTR ret;
     154    ICOM_THIS(IMalloc16Impl,iface);
     155    TRACE("(%p)->Realloc(%08lx,%ld)\n",This,pv,cb);
     156    ret = MapLS( HeapReAlloc( GetProcessHeap(), 0, MapSL(pv), cb ) );
     157    UnMapLS(pv);
     158    return ret;
    151159}
    152160
     
    154162 * IMalloc16_Free [COMPOBJ.505]
    155163 */
    156 VOID WINAPI IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv) {
    157         ICOM_THIS(IMalloc16Impl,iface);
    158         TRACE("(%p)->Free(%08lx)\n",This,pv);
    159         HeapFree( GetProcessHeap(), HEAP_WINE_SEGPTR, MapSL(pv) );
     164VOID WINAPI IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv)
     165{
     166    void *ptr = MapSL(pv);
     167    ICOM_THIS(IMalloc16Impl,iface);
     168    TRACE("(%p)->Free(%08lx)\n",This,pv);
     169    UnMapLS(pv);
     170    HeapFree( GetProcessHeap(), 0, ptr );
    160171}
    161172
     
    167178        ICOM_CTHIS(IMalloc16Impl,iface);
    168179        TRACE("(%p)->GetSize(%08lx)\n",This,pv);
    169         return HeapSize( GetProcessHeap(), HEAP_WINE_SEGPTR, MapSL(pv) );
     180        return HeapSize( GetProcessHeap(), 0, MapSL(pv) );
    170181}
    171182
     
    188199}
    189200
    190 static ICOM_VTABLE(IMalloc16)* msegvt16 = NULL;
    191 
    192201/******************************************************************************
    193202 * IMalloc16_Constructor [VTABLE]
    194203 */
    195204LPMALLOC16
    196 IMalloc16_Constructor() {
    197         IMalloc16Impl*  This;
    198         HMODULE16       hcomp = GetModuleHandle16("COMPOBJ");
    199 
    200         This = (IMalloc16Impl*)SEGPTR_NEW(IMalloc16Impl);
    201         if (!msegvt16) {
    202             msegvt16 = SEGPTR_NEW(ICOM_VTABLE(IMalloc16));
    203 
    204 #define VTENT(x) msegvt16->x = (void*)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->x)
    205             VTENT(QueryInterface);
    206             VTENT(AddRef);
    207             VTENT(Release);
    208             VTENT(Alloc);
    209             VTENT(Realloc);
    210             VTENT(Free);
    211             VTENT(GetSize);
    212             VTENT(DidAlloc);
    213             VTENT(HeapMinimize);
     205IMalloc16_Constructor()
     206{
     207    static ICOM_VTABLE(IMalloc16) vt16;
     208    static SEGPTR msegvt16;
     209    IMalloc16Impl* This;
     210    HMODULE16 hcomp = GetModuleHandle16("COMPOBJ");
     211
     212    This = HeapAlloc( GetProcessHeap(), 0, sizeof(IMalloc16Impl) );
     213    if (!msegvt16)
     214    {
     215#define VTENT(x) vt16.x = (void*)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(vt16.x)
     216        VTENT(QueryInterface);
     217        VTENT(AddRef);
     218        VTENT(Release);
     219        VTENT(Alloc);
     220        VTENT(Realloc);
     221        VTENT(Free);
     222        VTENT(GetSize);
     223        VTENT(DidAlloc);
     224        VTENT(HeapMinimize);
    214225#undef VTENT
    215         }
    216         ICOM_VTBL(This) = (ICOM_VTABLE(IMalloc16)*)SEGPTR_GET(msegvt16);
    217         This->ref = 1;
    218         return (LPMALLOC16)SEGPTR_GET(This);
     226        msegvt16 = MapLS( &vt16 );
     227    }
     228    ICOM_VTBL(This) = (ICOM_VTABLE(IMalloc16)*)msegvt16;
     229    This->ref = 1;
     230    return (LPMALLOC16)MapLS( This );
    219231}
    220232#endif
  • trunk/src/ole32/imessagefilter.cpp

    r4274 r7926  
    1 /* $Id: imessagefilter.cpp,v 1.1 2000-09-17 10:31:04 davidr Exp $ */
     1/* $Id: imessagefilter.cpp,v 1.2 2002-02-15 17:18:49 sandervl Exp $ */
    22/*
    33 *
     
    170170}
    171171
    172 //*******************************************************************************
    173 //*******************************************************************************
    174 HRESULT WIN32API CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter,
    175                                             LPMESSAGEFILTER *lplpMessageFilter)
    176 {
    177     dprintf(("OLE32: CoRegisterMessageFilter - stub"));
    178     if (lplpMessageFilter)
    179         *lplpMessageFilter = NULL;
    180     return S_FALSE;
    181 }
    182 
  • trunk/src/ole32/itemmoniker.c

    r6711 r7926  
    557557                    tempMkComposite=*ppmkComposite;
    558558                    IMoniker_AddRef(tempMkComposite);
    559 }
     559                }
    560560                return res;
    561561            }
     
    646646        for (i = len ; i > 0; i--) {
    647647            h = (h * 37) + val[off++];
    648 }
     648        }
    649649    } else {
    650650        /* only sample some characters */
     
    748748
    749749        IMoniker_Release(compositeMk);
    750 }
     750    }
    751751
    752752    return res;
     
    858858    else{
    859859        /* Otherwise, the method calls IMoniker::BindToObject on the pmkToLeft parameter, requesting an */
    860         /* IParseDisplayName interface pointer to the object identified by the moniker, and passes the display */        /* name to IParseDisplayName::ParseDisplayName */
     860        /* IParseDisplayName interface pointer to the object identified by the moniker, and passes the display */
     861        /* name to IParseDisplayName::ParseDisplayName */
    861862        res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic);
    862863
     
    872873            IParseDisplayName_Release(ppdn);
    873874        }
    874 }
     875    }
    875876    return res;
    876877}
     
    952953
    953954/******************************************************************************
    954  *        CreateItemMoniker     [OLE.55]
     955 *        CreateItemMoniker     [OLE32.58]
    955956 ******************************************************************************/
    956957HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR  lpszItem, LPMONIKER * ppmk)
  • trunk/src/ole32/memlockbytes.c

    r6711 r7926  
    77 */
    88
     9#include "config.h"
     10
    911#include <string.h>
     12
     13#include "windef.h"
     14#include "objbase.h"
     15#include "ole2.h"
    1016#include "winbase.h"
    1117#include "winerror.h"
    12 #include "objbase.h"
    1318
    1419#include "debugtools.h"
  • trunk/src/ole32/moniker.c

    r6711 r7926  
    1616#include "wine/obj_misc.h"
    1717#include "wine/obj_moniker.h"
     18#ifdef __WIN32OS2__
     19#include "wine/obj_channel.h"
     20#endif
     21
    1822#include "debugtools.h"
    19 #include "heap.h"
    2023#include "ole2.h"
    2124
    2225#include "compobj_private.h"
    23 
    24 #ifdef __WIN32OS2__
    25 #undef FIXME
    26 #undef TRACE
    27 #ifdef DEBUG
    28 #define TRACE WriteLog("OLE32: %s", __FUNCTION__); WriteLog
    29 #define FIXME WriteLog("FIXME OLE32: %s", __FUNCTION__); WriteLog
    30 #else
    31 #define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    32 #define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    33 #endif
    34 #endif
    3526
    3627DEFAULT_DEBUG_CHANNEL(ole);
     
    290281        FIXME("runObjTabRegister: %ld is out of data limite \n",This->runObjTabRegister);
    291282        return E_FAIL;
    292 }
     283    }
    293284    This->runObjTabRegister++;
    294285    This->runObjTabLastIndx++;
     
    468459
    469460/******************************************************************************
    470  *              GetRunningObjectTable16 [OLE2.30]
     461 *              GetRunningObjectTable   [OLE2.30]
    471462 */
    472463HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
     
    477468
    478469/***********************************************************************
    479  *           GetRunningObjectTable (OLE2.73)
     470 *           GetRunningObjectTable (OLE32.73)
    480471 */
    481472HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
     
    505496  ICOM_THIS(IRunnableObject,pUnknown);
    506497  LRESULT               ret;
    507 
    508 #ifdef __WIN32OS2__
    509   if(!IsValidInterface(pUnknown)) {
    510       return E_INVALIDARG;
    511   }
    512 #endif
    513498
    514499  ret = IRunnableObject_QueryInterface(This,&IID_IRunnableObject,(LPVOID*)&runable);
  • trunk/src/ole32/ole2.c

    r6711 r7926  
     1
    12/*
    23 *      OLE2 library
     
    67 *      Copyright 1999  Noel Borthwick
    78 */
     9
     10#include "config.h"
    811
    912#include <assert.h>
     
    1215#include <string.h>
    1316
     17#include "commctrl.h"
     18#include "ole2.h"
     19#include "ole2ver.h"
    1420#include "windef.h"
    1521#include "winbase.h"
    16 #include "wingdi.h"
     22#include "winerror.h"
    1723#include "winuser.h"
    18 #include "winerror.h"
    19 #include "ole2.h"
    20 #include "commctrl.h"
     24#include "winreg.h"
     25
    2126#include "wine/obj_clientserver.h"
    2227#include "wine/winbase16.h"
    2328#include "wine/wingdi16.h"
    2429#include "wine/winuser16.h"
     30#include "ole32_main.h"
     31
    2532#include "debugtools.h"
    26 #include "ole2ver.h"
    27 #include "winreg.h"
    28 #include "ole32_main.h"
    2933
    3034DEFAULT_DEBUG_CHANNEL(ole);
     
    146150/******************************************************************************
    147151 *              OleBuildVersion [OLE2.1]
     152 *              OleBuildVersion [OLE32.84]
    148153 */
    149154DWORD WINAPI OleBuildVersion(void)
     
    154159
    155160/***********************************************************************
    156  *           OleInitialize       (OLE2.2) (OLE32.108)
     161 *           OleInitialize       (OLE2.2)
     162 *           OleInitialize       (OLE32.108)
    157163 */
    158164HRESULT WINAPI OleInitialize(LPVOID reserved)
     
    183189   */
    184190  if (OLE_moduleLockCount==0)
    185 {
     191  {
    186192    /*
    187193     * Initialize the libraries.
     
    203209     */
    204210    OLEMenu_Initialize();
    205 }
     211  }
    206212
    207213  /*
     
    214220
    215221/******************************************************************************
    216  *              CoGetCurrentProcess     [COMPOBJ.34] [OLE2.2][OLE32.108]
     222 *              CoGetCurrentProcess     [COMPOBJ.34]
     223 *              CoGetCurrentProcess     [OLE32.18]
    217224 *
    218225 * NOTES
     
    225232
    226233/******************************************************************************
    227  *              OleUninitialize [OLE2.3] [OLE32.131]
     234 *              OleUninitialize [OLE2.3]
     235 *              OleUninitialize [OLE32.131]
    228236 */
    229237void WINAPI OleUninitialize(void)
     
    268276}
    269277
    270 #ifndef __WIN32OS2__
    271 //imessagefilter.cpp
    272278/******************************************************************************
    273279 *              CoRegisterMessageFilter [OLE32.38]
     
    283289    return S_OK;
    284290}
    285 #endif
    286291
    287292/******************************************************************************
     
    294299
    295300/***********************************************************************
    296  *           RegisterDragDrop16 (OLE2.35)
     301 *           RegisterDragDrop (OLE2.35)
    297302 */
    298303HRESULT WINAPI RegisterDragDrop16(
     
    348353
    349354/***********************************************************************
    350  *           RevokeDragDrop16 (OLE2.36)
     355 *           RevokeDragDrop (OLE2.36)
    351356 */
    352357HRESULT WINAPI RevokeDragDrop16(
     
    10671072   * The Edit, Object & Help groups belong to the server object
    10681073   * and the other three belong to the container.
    1069    * Loop thru the group widths and locate the group we are a member of.
     1074   * Loop through the group widths and locate the group we are a member of.
    10701075   */
    10711076  for ( i = 0, nWidth = 0; i < 6; i++ )
     
    14131418
    14141419    if(!lpMsg) return FALSE;
     1420
    14151421#ifdef __WIN32OS2__
    14161422    if (!hAccel || !(lpAccelTbl = (LPACCEL16)LockResource(hAccel)))
     
    15461552           (pmedium->u.hMetaFilePict!=0) )
    15471553      {
    1548         LPMETAFILEPICT pMP = GlobalLock(pmedium->u.hMetaFilePict);
     1554        LPMETAFILEPICT pMP = GlobalLock(pmedium->u.hGlobal);
    15491555        DeleteMetaFile(pMP->hMF);
    1550         GlobalUnlock(pmedium->u.hMetaFilePict);
    1551         GlobalFree(pmedium->u.hMetaFilePict);
     1556        GlobalUnlock(pmedium->u.hGlobal);
     1557        GlobalFree(pmedium->u.hGlobal);
    15521558      }
    15531559
     
    22002206#ifndef __WIN32OS2__
    22012207/******************************************************************************
    2202  * OleMetaFilePictFromIconAndLabel
     2208 * OleMetaFilePictFromIconAndLabel (OLE2.56)
    22032209 *
    22042210 * Returns a global memory handle to a metafile which contains the icon and
     
    22432249}
    22442250#endif
     2251
    22452252/******************************************************************************
    2246  * DllDebugObjectRPCHook
     2253 * DllDebugObjectRPCHook (OLE32.62)
    22472254 * turns on and off internal debugging,  pointer is only used on macintosh
    22482255 */
  • trunk/src/ole32/ole2impl.c

    r6711 r7926  
    1919
    2020/******************************************************************************
    21  * Function : OleQueryCreateFromData [OLE32.117]
     21 *              OleQueryCreateFromData [OLE32.117]
     22 *
    2223 * Author   : Abey George
    2324 * Checks whether an object can become an embedded object.
     
    6667
    6768/******************************************************************************
    68  * Function : OleCreateFromData        [OLE32.92]
     69 *              OleCreateFromData        [OLE32.92]
     70 *
    6971 * Author   : Abey George
    7072 * Creates an embedded object from data transfer object retrieved from
  • trunk/src/ole32/ole2stubs.c

    r6711 r7926  
    88#include "windef.h"
    99#include "winbase.h"
    10 #include "wingdi.h"
    1110#include "winuser.h"
    1211#include "ole2.h"
     
    5958
    6059/******************************************************************************
    61  *              CoTreatAsClass        [OLE32.46]
    62  */
    63 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
    64 {
    65   FIXME("(%p,%p), stub!\n", clsidOld, clsidNew);
    66   return S_OK;
    67 }
    68 
    69 /******************************************************************************
    7060 *              SetConvertStg        [OLE32.142]
    7161 */
     
    7767
    7868/******************************************************************************
    79  *              OleCreate        [OLE32.80]
     69 *              OleCreate        [OLE32.89]
    8070 *
    8171 */
     
    252242
    253243/***********************************************************************
    254  *           CoIsOle1Class                              [OLE32]
     244 *           CoIsOle1Class                              [OLE32.29]
    255245 */
    256246BOOL WINAPI CoIsOle1Class(REFCLSID clsid)
  • trunk/src/ole32/ole32.cpp

    r5602 r7926  
    1 /* $Id: ole32.cpp,v 1.15 2001-04-26 19:32:49 sandervl Exp $ */
     1/* $Id: ole32.cpp,v 1.16 2002-02-15 17:18:50 sandervl Exp $ */
    22/*
    33 *
     
    4242    return FileTimeToDosDateTime(lpFileTime, lpDosDate, lpDosTime);
    4343}
     44
     45// ----------------------------------------------------------------------
     46// CLSIDFromStringA()
     47// @@@PH: this is not a WINE API, but a replacement for CLSIDFromString16
     48//        which used to accept ASCII strings instead of OLE strings
     49// ----------------------------------------------------------------------
     50
     51HRESULT WIN32API CLSIDFromStringA(
     52    LPCSTR              lpsz,           // [in] - ASCII string CLSID
     53    LPCLSID             pclsid)         // [out] - Binary CLSID
     54{
     55    return CLSIDFromString16(lpsz, pclsid);
     56}
  • trunk/src/ole32/ole32.mak

    r7909 r7926  
    1 # $Id: ole32.mak,v 1.16 2002-02-15 13:57:40 sandervl Exp $
     1# $Id: ole32.mak,v 1.17 2002-02-15 17:18:50 sandervl Exp $
    22
    33#
     
    4949$(OBJDIR)\imessagefilter.obj \
    5050$(OBJDIR)\memlockbytes.obj \
    51 $(OBJDIR)\moniker.obj \
    5251$(OBJDIR)\oString.obj \
    5352$(OBJDIR)\ole2impl.obj \
     
    6362$(OBJDIR)\stg_stream.obj \
    6463$(OBJDIR)\storage32.obj \
     64$(OBJDIR)\marshal.obj \
     65$(OBJDIR)\oleproxy.obj \
     66$(OBJDIR)\rpc.obj \
     67$(OBJDIR)\moniker.obj \
    6568$(OBJDIR)\stubs.obj \
    6669$(OBJDIR)\ifs.obj \
  • trunk/src/ole32/ole32_main.c

    r6711 r7926  
    44 */
    55#include "windef.h"
    6 #ifdef __WIN32OS2__
    7 #include "winbase.h"
    8 #endif
    96#include "winerror.h"
    107#include "ole32_main.h"
     
    2623    case DLL_PROCESS_ATTACH:
    2724        OLE32_hInstance = hinstDLL;
     25        COMPOBJ_InitProcess();
    2826        break;
    2927
    3028    case DLL_PROCESS_DETACH:
     29        COMPOBJ_UninitProcess();
    3130        OLE32_hInstance = 0;
    3231        break;
     
    3635
    3736/***********************************************************************
    38  *              DllRegisterServer (OLE32.@)
     37 *              DllRegisterServer (OLE32.194)
    3938 */
    4039HRESULT WINAPI OLE32_DllRegisterServer() {
  • trunk/src/ole32/ole32_main.h

    r5602 r7926  
    66extern HINSTANCE OLE32_hInstance;
    77
     8void COMPOBJ_InitProcess( void );
     9void COMPOBJ_UninitProcess( void );
     10
    811#endif /* __WINE_OLE32_MAIN_H */
  • trunk/src/ole32/olestd.h

    r5918 r7926  
    88#define __WINE_OLESTD_H_
    99
    10 #if !defined(__cplusplus) && !defined( __TURBOC__) && !defined(NONAMELESSUNION)
     10#if !defined(__cplusplus) && !defined( __TURBOC__)
    1111#define NONAMELESSUNION     /* use strict ANSI standard (for DVOBJ.H) */
    1212#endif
  • trunk/src/ole32/stg_stream.c

    r6711 r7926  
    1010 */
    1111#ifdef __WIN32OS2__
    12 
    13 #include <odin.h>
    1412#include "ole32.h"
    1513#include "heapstring.h"
    16 
    1714#endif
     15
    1816#include <assert.h>
    1917#include <stdlib.h>
     
    2725
    2826#include "storage32.h"
    29 
    30 #ifdef __WIN32OS2__
    31 #undef FIXME
    32 #undef TRACE
    33 #ifdef DEBUG
    34 #define TRACE WriteLog("OLE32: %s", __FUNCTION__); WriteLog
    35 #define FIXME WriteLog("FIXME OLE32: %s", __FUNCTION__); WriteLog
    36 #else
    37 #define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    38 #define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
    39 #endif
    40 #endif
    4127
    4228DEFAULT_DEBUG_CHANNEL(storage);
     
    10490   
    10591    /*
    106      * Start the stream at the begining.
     92     * Start the stream at the beginning.
    10793     */
    10894    newStream->currentPosition.s.HighPart = 0;
     
    266252
    267253  /*
    268    * Make sure no old object is staying behind.
     254   * Make sure no old object is left over.
    269255   */
    270256  if (This->smallBlockChain != 0)
     
    323309 * This method is part of the ISequentialStream interface.
    324310 *
    325  * If reads a block of information from the stream at the current
     311 * It reads a block of information from the stream at the current
    326312 * position. It then moves the current position at the end of the
    327313 * read block
     
    339325  ULONG bytesReadBuffer;
    340326  ULONG bytesToReadFromBuffer;
     327  HRESULT res = S_FALSE;
    341328
    342329  TRACE("(%p, %p, %ld, %p)\n",
     
    344331
    345332  /*
    346    * If the caller is not interested in the nubmer of bytes read,
     333   * If the caller is not interested in the number of bytes read,
    347334   * we use another buffer to avoid "if" statements in the code.
    348335   */
     
    358345  /*
    359346   * Depending on the type of chain that was opened when the stream was constructed,
    360    * we delegate the work to the method that read the block chains.
     347   * we delegate the work to the method that reads the block chains.
    361348   */
    362349  if (This->smallBlockChain!=0)
     
    385372
    386373    *pcbRead = 0;
    387     return S_OK;
     374    res = S_OK;
     375    goto end;
    388376  }
    389377
     
    399387  This->currentPosition.s.LowPart += *pcbRead;
    400388 
    401   /*
    402    * The function returns S_OK if the buffer was filled completely
    403    * it returns S_FALSE if the end of the stream is reached before the
    404    * buffer is filled
    405    */
    406   if(*pcbRead == cb)
    407     return S_OK;
    408  
    409   return S_FALSE;
     389  if(*pcbRead != cb)
     390  {
     391    WARN("read %ld instead of the required %ld bytes !\n", *pcbRead, cb);
     392    /*
     393     * this used to return S_FALSE, however MSDN docu says that an app should
     394     * be prepared to handle error in case of stream end reached, as *some*
     395     * implementations *might* return an error (IOW: most do *not*).
     396     * As some program fails on returning S_FALSE, I better use S_OK here.
     397     */
     398    res = S_OK;
     399  }
     400  else
     401    res = S_OK;
     402 
     403end:
     404  TRACE("<-- %08lx\n", res);
     405  return res;
    410406}
    411407       
     
    554550      return STG_E_INVALIDFUNCTION;
    555551  }
     552
    556553#ifdef __WIN32OS2__
    557554  /*
     
    697694
    698695  /*
    699    * Write to the property the new information about this stream
     696   * Write the new information about this stream to the property
    700697   */
    701698  Success = StorageImpl_ReadProperty(This->parentStorage->ancestorStorage,
     
    751748
    752749  /*
    753    * use stack to store data temporarly
    754    * there is surely more performant way of doing it, for now this basic
     750   * use stack to store data temporarily
     751   * there is surely a more performant way of doing it, for now this basic
    755752   * implementation will do the job
    756753   */
     
    771768
    772769    /*
    773      * Check that read & write operations were succesfull
     770     * Check that read & write operations were successful
    774771     */
    775772    if (bytesRead != bytesWritten)
  • trunk/src/ole32/storage32.c

    r7508 r7926  
    1010 * Copyright 1999 Thuy Nguyen
    1111 */
    12 
    1312#ifdef __WIN32OS2__
    1413#include <odin.h>
     
    3635
    3736#define FILE_BEGIN 0
    38 
    3937
    4038
     
    167165    StorageBaseImpl_SetClass,
    168166    StorageImpl_SetStateBits,
    169     StorageBaseImpl_Stat
     167    StorageImpl_Stat
    170168};
    171169
     
    343341  StgProperty       currentProperty;
    344342  ULONG             foundPropertyIndex;
     343  HRESULT           res = STG_E_UNKNOWN;
    345344
    346345  TRACE("(%p, %s, %p, %lx, %ld, %p)\n",
     
    351350   */
    352351  if ( (pwcsName==NULL) || (ppstm==0) )
    353     return E_INVALIDARG;
     352  {
     353    res = E_INVALIDARG;
     354    goto end;
     355  }
    354356 
    355357  /*
    356358   * Initialize the out parameter
    357359   */
    358   *ppstm = 0;
     360  *ppstm = NULL;
    359361 
    360362  /*
     
    362364   */
    363365  if ( FAILED( validateSTGM(grfMode) ))
    364     return STG_E_INVALIDFLAG;
     366  {
     367    res = STG_E_INVALIDFLAG;
     368    goto end;
     369  }
    365370
    366371  /*
     
    370375        (grfMode & STGM_DELETEONRELEASE) ||
    371376        (grfMode & STGM_TRANSACTED) )
    372     return STG_E_INVALIDFUNCTION;
     377  {
     378    res = STG_E_INVALIDFUNCTION;
     379    goto end;
     380  }
    373381
    374382  /*
     
    411419      StgStreamImpl_AddRef(*ppstm);
    412420     
    413       return S_OK;
     421      res = S_OK;
     422      goto end;
    414423    }
    415424   
    416     return E_OUTOFMEMORY;
    417   }
    418  
    419   return STG_E_FILENOTFOUND;
     425    res = E_OUTOFMEMORY;
     426    goto end;
     427  }
     428 
     429  res = STG_E_FILENOTFOUND;
     430
     431end:
     432  if (res == S_OK)
     433    TRACE("<-- IStream %p\n", *ppstm);
     434  TRACE("<-- %08lx\n", res);
     435  return res;
    420436}
    421437
     
    441457  StgProperty            currentProperty;
    442458  ULONG                  foundPropertyIndex;
     459  HRESULT                res = STG_E_UNKNOWN;
    443460
    444461  TRACE("(%p, %s, %p, %lx, %p, %ld, %p)\n",
     
    450467   */
    451468  if ( (This==0) || (pwcsName==NULL) || (ppstg==0) )
    452     return E_INVALIDARG;
     469  {
     470    res = E_INVALIDARG;
     471    goto end;
     472  }
     473 
     474  /* as documented */
     475  if (snbExclude != NULL)
     476  {
     477    res = STG_E_INVALIDPARAMETER;
     478    goto end;
     479  }
    453480 
    454481  /*
     
    456483   */
    457484  if ( FAILED( validateSTGM(grfMode) ))
    458     return STG_E_INVALIDFLAG;
     485  {
     486    res = STG_E_INVALIDFLAG;
     487    goto end;
     488  }
    459489
    460490  /*
     
    464494        (grfMode & STGM_DELETEONRELEASE) ||
    465495        (grfMode & STGM_PRIORITY) )
    466     return STG_E_INVALIDFUNCTION;
     496  {
     497    res = STG_E_INVALIDFUNCTION;
     498    goto end;
     499  }
    467500
    468501  /*
    469502   * Initialize the out parameter
    470503   */
    471   *ppstg = 0;
     504  *ppstg = NULL;
    472505 
    473506  /*
     
    514547      StorageBaseImpl_AddRef(*ppstg);
    515548     
    516       return S_OK;
     549      res = S_OK;
     550      goto end;
    517551    }
    518552   
    519     return STG_E_INSUFFICIENTMEMORY;
    520   }
    521  
    522   return STG_E_FILENOTFOUND;
     553    res = STG_E_INSUFFICIENTMEMORY;
     554    goto end;
     555  }
     556 
     557  res = STG_E_FILENOTFOUND;
     558
     559end:
     560  TRACE("<-- %08lx\n", res);
     561  return res;
    523562}
    524563
     
    587626  ICOM_THIS(StorageBaseImpl,iface);
    588627  StgProperty    curProperty;
    589   BOOL         readSuccessful;
     628  BOOL           readSuccessful;
     629  HRESULT        res = STG_E_UNKNOWN;
    590630
    591631  TRACE("(%p, %p, %lx)\n",
     
    596636   */
    597637  if ( (This==0) || (pstatstg==0))
    598     return E_INVALIDARG;
     638  {
     639    res = E_INVALIDARG;
     640    goto end;
     641  }
    599642
    600643  /*
     
    613656      grfStatFlag);
    614657   
    615     return S_OK;
    616   }
    617  
    618   return E_FAIL;
     658    res = S_OK;
     659    goto end;
     660  }
     661 
     662  res = E_FAIL;
     663
     664end:
     665  if (res == S_OK)
     666  {
     667    TRACE("<-- STATSTG: pwcsName: %s, type: %ld, cbSize.Low/High: %ld/%ld, grfMode: %08lx, grfLocksSupported: %ld, grfStateBits: %08lx\n", debugstr_w(pstatstg->pwcsName), pstatstg->type, pstatstg->cbSize.s.LowPart, pstatstg->cbSize.s.HighPart, pstatstg->grfMode, pstatstg->grfLocksSupported, pstatstg->grfStateBits);
     668  }
     669  TRACE("<-- %08lx\n", res);
     670  return res;
    619671}
    620672
     
    16871739
    16881740
     1741/************************************************************************
     1742 * StorageImpl_Stat (IStorage)
     1743 *
     1744 * This method will retrieve information about this storage object.
     1745 * 
     1746 * See Windows documentation for more details on IStorage methods.
     1747 */
     1748HRESULT WINAPI StorageImpl_Stat( IStorage* iface,
     1749                                 STATSTG*  pstatstg,     /* [out] */
     1750                                 DWORD     grfStatFlag)  /* [in] */
     1751{
     1752  StorageImpl* const This = (StorageImpl*)iface;
     1753  HRESULT result = StorageBaseImpl_Stat( iface, pstatstg, grfStatFlag );
     1754
     1755  if ( !FAILED(result) && ((grfStatFlag & STATFLAG_NONAME) == 0) && This->pwcsName )
     1756  {
     1757      CoTaskMemFree(pstatstg->pwcsName);
     1758      pstatstg->pwcsName = CoTaskMemAlloc((lstrlenW(This->pwcsName)+1)*sizeof(WCHAR));
     1759      strcpyW(pstatstg->pwcsName, This->pwcsName);
     1760  }
     1761
     1762  return result;
     1763}
     1764
     1765
     1766
    16891767/*********************************************************************
    16901768 *
     
    20832161  const FILETIME  *pmtime)  /* [in] */
    20842162{
    2085   FIXME("not implemented!\n");
    2086   return E_NOTIMPL;
     2163  FIXME("(%s,...), stub!\n",debugstr_w(pwcsName));
     2164  return S_OK;
    20872165}
    20882166
     
    21022180  StorageImpl* This,
    21032181  HANDLE       hFile,
     2182  LPCOLESTR    pwcsName,
    21042183  ILockBytes*  pLkbyt,
    21052184  DWORD        openFlags,
     
    21112190  BOOL      readSuccessful;
    21122191  ULONG       currentPropertyIndex;
    2113  
     2192
    21142193  if ( FAILED( validateSTGM(openFlags) ))
    21152194    return STG_E_INVALIDFLAG;
     
    21182197 
    21192198  /*
    2120    * Initialize the virtual fgunction table.
     2199   * Initialize the virtual function table.
    21212200   */
    21222201  ICOM_VTBL(This)    = &Storage32Impl_Vtbl;
     
    21242203 
    21252204  /*
    2126    * This is the top-level storage so initialize the ancester pointer
     2205   * This is the top-level storage so initialize the ancestor pointer
    21272206   * to this.
    21282207   */
     
    21342213  This->hFile = hFile;
    21352214 
     2215  /*
     2216   * Store copy of file path.
     2217   */
     2218  if(pwcsName) {
     2219      This->pwcsName = HeapAlloc(GetProcessHeap(), 0,
     2220                                (lstrlenW(pwcsName)+1)*sizeof(WCHAR));
     2221      if (!This->pwcsName)
     2222         return STG_E_INSUFFICIENTMEMORY;
     2223      strcpyW(This->pwcsName, pwcsName);
     2224  }
     2225
    21362226  /*
    21372227   * Initialize the big block cache.
     
    22512341
    22522342  /*
    2253    * Find the ID of the root int he property sets.
     2343   * Find the ID of the root in the property sets.
    22542344   */
    22552345  currentPropertyIndex = 0;
     
    22962386{
    22972387  TRACE("(%p)\n", This);
     2388
     2389  if(This->pwcsName)
     2390    HeapFree(GetProcessHeap(), 0, This->pwcsName);
    22982391
    22992392  BlockChainStream_Destroy(This->smallBlockRootChain);
     
    28812974     * blocks, just make sure they are what we're expecting.
    28822975     */
    2883     assert( (This->bigBlockSize==DEF_BIG_BLOCK_SIZE) &&
    2884             (This->smallBlockSize==DEF_SMALL_BLOCK_SIZE));
     2976    if (This->bigBlockSize != DEF_BIG_BLOCK_SIZE ||
     2977        This->smallBlockSize != DEF_SMALL_BLOCK_SIZE)
     2978    {
     2979        WARN("Broken OLE storage file\n");
     2980        hr = STG_E_INVALIDHEADER;
     2981    }
     2982    else
     2983        hr = S_OK;
    28852984   
    28862985    /*
     
    28882987     */
    28892988    StorageImpl_ReleaseBigBlock(This, headerBigBlock);
    2890 
    2891     hr = S_OK;
    28922989  }
    28932990 
     
    30163113                    currentProperty,
    30173114                    &bytesRead);
    3018  
     3115
    30193116  if (readSuccessful)
    30203117  {
     3118    /* replace the name of root entry (often "Root Entry") by the file name */
     3119    WCHAR *propName = (index == This->rootPropertySetIndex) ?
     3120                        This->filename : (WCHAR *)currentProperty+OFFSET_PS_NAME;
     3121
    30213122    memset(buffer->name, 0, sizeof(buffer->name));
    30223123    memcpy(
    30233124      buffer->name,
    3024       currentProperty+OFFSET_PS_NAME,
     3125      propName,
    30253126      PROPERTY_NAME_BUFFER_LEN );
     3127    TRACE("storage name: %s\n", debugstr_w(buffer->name));
    30263128
    30273129    memcpy(&buffer->propertyType, currentProperty + OFFSET_PS_PROPERTYTYPE, 1);
     
    53685470         newStorage,
    53695471         hFile,
     5472        pwcsName,
    53705473         NULL,
    53715474         grfMode,
     
    54065509  DWORD          shareMode;
    54075510  DWORD          accessMode;
     5511  WCHAR          fullname[MAX_PATH];
     5512  WIN32_FILE_ATTRIBUTE_DATA Fad;
    54085513
    54095514  TRACE("(%s, %p, %lx, %p, %ld, %p)\n",
     
    54155520   */
    54165521  if (( pwcsName == 0) || (ppstgOpen == 0) )
    5417     return STG_E_INVALIDPOINTER;
     5522  {
     5523    hr = STG_E_INVALIDPOINTER;
     5524    goto end;
     5525  }
    54185526
    54195527  /*
     
    54215529   */
    54225530  if ( FAILED( validateSTGM(grfMode) ))
    5423     return STG_E_INVALIDFLAG;
     5531  {
     5532    hr = STG_E_INVALIDFLAG;
     5533    goto end;
     5534  }
    54245535
    54255536  /*
     
    54455556  if (hFile==INVALID_HANDLE_VALUE)
    54465557  {
    5447     HRESULT hr = E_FAIL;
    54485558    DWORD last_error = GetLastError();
     5559
     5560    hr = E_FAIL;
    54495561
    54505562    switch (last_error)
     
    54715583    }
    54725584
    5473     return hr;
     5585    goto end;
    54745586  }
    54755587
     
    54805592 
    54815593  if (newStorage == 0)
    5482     return STG_E_INSUFFICIENTMEMORY;
    5483 
     5594  {
     5595    hr = STG_E_INSUFFICIENTMEMORY;
     5596    goto end;
     5597  }
     5598
     5599  /* if the file's length was zero, initialize the storage */
    54845600  hr = StorageImpl_Construct(
    54855601         newStorage,
    54865602         hFile,
     5603        pwcsName,
    54875604         NULL,
    54885605         grfMode,
    54895606         TRUE,
    5490          FALSE);
     5607         !(Fad.nFileSizeHigh || Fad.nFileSizeLow) /* FALSE */ );
    54915608 
    54925609  if (FAILED(hr))
     
    54975614     */
    54985615    if(hr == STG_E_INVALIDHEADER)
    5499         return STG_E_FILEALREADYEXISTS;
    5500     return hr;
    5501   }
    5502  
     5616        hr = STG_E_FILEALREADYEXISTS;
     5617    goto end;
     5618  }
     5619 
     5620  /* prepare the file name string given in lieu of the root property name */
     5621  GetFullPathNameW(pwcsName, MAX_PATH, fullname, NULL);
     5622  memcpy(newStorage->filename, fullname, PROPERTY_NAME_BUFFER_LEN);
     5623  newStorage->filename[PROPERTY_NAME_BUFFER_LEN-1] = '\0';
     5624
    55035625  /*
    55045626   * Get an "out" pointer for the caller.
     
    55095631         (void**)ppstgOpen);
    55105632 
     5633end:
     5634  TRACE("<-- %08lx, IStorage %p\n", hr, ppstgOpen ? *ppstgOpen : NULL);
    55115635  return hr;
    55125636}
     
    55415665         newStorage,
    55425666         0,
     5667        0,
    55435668         plkbyt,
    55445669         grfMode,
     
    56055730         newStorage,
    56065731         0,
     5732        0,
    56075733         plkbyt,
    56085734         grfMode,
     
    56295755/******************************************************************************
    56305756 *              StgSetTimes [ole32.150]
    5631  *
    5632  *
    5633  */
    5634 HRESULT WINAPI StgSetTimes(WCHAR * str, FILETIME * a, FILETIME * b, FILETIME *c )
    5635 {
    5636  
    5637   FIXME("(%p, %p, %p, %p),stub!\n", str, a, b, c);
    5638   return FALSE;
     5757 *              StgSetTimes [OLE32.150]
     5758 *
     5759 *
     5760 */
     5761HRESULT WINAPI StgSetTimes(OLECHAR *str, FILETIME *a, FILETIME *b, FILETIME *c )
     5762{
     5763  FIXME("(%s, %p, %p, %p),stub!\n", debugstr_w(str), a, b, c);
     5764  return S_OK;
    56395765}
    56405766
     
    56775803
    56785804/***********************************************************************
    5679  *    ReadClassStg
     5805 *    ReadClassStg (OLE32.134)
    56805806 *
    56815807 * This method reads the CLSID previously written to a storage object with the WriteClassStg.
     
    57025828
    57035829/***********************************************************************
    5704  *    OleLoadFromStream
     5830 *    OleLoadFromStream (OLE32.113)
    57055831 *
    57065832 * This function loads an object from stream
     
    57365862
    57375863/***********************************************************************
    5738  *    OleSaveToStream
     5864 *    OleSaveToStream (OLE32.125)
    57395865 *
    57405866 * This function saves an object with the IPersistStream interface on it
     
    69487074    if(hRes == S_OK)
    69497075    {
    6950         /*Was it originaly Ole10 */
     7076        /* Was it originally Ole10 */
    69517077        hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream);   
    69527078        if(hRes == S_OK)
    69537079        {
    69547080            IStream_Release(pStream);
    6955             /*Get Presentation Data for Ole10Native */
     7081            /* Get Presentation Data for Ole10Native */
    69567082            OLECONVERT_GetOle10PresData(pstg, pOleStreamData);
    69577083        }
    69587084        else
    69597085        {
    6960             /*Get Presentation Data (OLE20)*/
     7086            /* Get Presentation Data (OLE20) */
    69617087            OLECONVERT_GetOle20PresData(pstg, pOleStreamData);
    69627088        }
     
    69927118
    69937119#ifdef __WIN32OS2__
     7120
    69947121static const BYTE STORAGE_notmagic[8]={0x0e,0x11,0xfc,0x0d,0xd0,0xcf,0x11,0xe0};
    69957122
    69967123/******************************************************************************
    6997  * StgIsStorageFile16 [STORAGE.5]
     7124 * StgIsStorageFile [STORAGE.5]
    69987125 */
    69997126HRESULT WINAPI StgIsStorageFile16(LPCOLESTR16 fn) {
     
    70377164StgIsStorageFile(LPCOLESTR fn)
    70387165{
    7039         LPOLESTR16      xfn = HEAP_strdupWtoA(GetProcessHeap(),0,fn);
    7040         HRESULT ret = StgIsStorageFile16(xfn);
    7041 
    7042         HeapFree(GetProcessHeap(),0,xfn);
    7043         return ret;
     7166    HRESULT ret;
     7167    DWORD len = WideCharToMultiByte( CP_ACP, 0, fn, -1, NULL, 0, NULL, NULL );
     7168    LPSTR strA = HeapAlloc( GetProcessHeap(), 0, len );
     7169
     7170    WideCharToMultiByte( CP_ACP, 0, fn, -1, strA, len, NULL, NULL );
     7171    ret = StgIsStorageFile16(strA);
     7172    HeapFree( GetProcessHeap(), 0, strA );
     7173    return ret;
    70447174}
    70457175#endif
  • trunk/src/ole32/storage32.h

    r5602 r7926  
    180180 * Storage32BaseImpl definitions.
    181181 *
    182  * This stucture defines the base information contained in all implementations
    183  * of IStorage32 contained in this filee storage implementation.
     182 * This structure defines the base information contained in all implementations
     183 * of IStorage32 contained in this file storage implementation.
    184184 *
    185185 * In OOP terms, this is the base class for all the IStorage32 implementations
     
    188188struct StorageBaseImpl
    189189{
    190   ICOM_VFIELD(IStorage);   /* Needs to be the first item in the stuct
     190  ICOM_VFIELD(IStorage);   /* Needs to be the first item in the struct
    191191                            * since we want to cast this in a Storage32 pointer */
    192192
     
    282282struct StorageImpl
    283283{
    284   ICOM_VFIELD(IStorage);   /* Needs to be the first item in the stuct
    285                                       * since we want to cast this in a Storage32 pointer */
     284  ICOM_VFIELD(IStorage); /* Needs to be the first item in the struct
     285                          * since we want to cast this in a Storage32 pointer */
    286286
    287287  /*
     
    299299   */
    300300  HANDLE           hFile;      /* Physical support for the Docfile */
    301  
     301  LPOLESTR         pwcsName;   /* Full path of the document file */
     302
     303  /* FIXME: should this be in Storage32BaseImpl ? */
     304  WCHAR            filename[PROPERTY_NAME_BUFFER_LEN];
     305
    302306  /*
    303307   * File header
     
    379383            DWORD          grfStateBits, /* [in] */
    380384            DWORD          grfMask);     /* [in] */
    381        
     385
     386HRESULT WINAPI StorageImpl_Stat(IStorage* iface,
     387                                STATSTG*  pstatstg,     /* [out] */
     388                                DWORD     grfStatFlag); /* [in] */
     389
    382390void StorageImpl_Destroy(
    383391            StorageImpl* This);
     
    386394            StorageImpl* This,
    387395            HANDLE       hFile,
     396            LPCOLESTR    pwcsName,
    388397            ILockBytes*  pLkbyt,
    389398            DWORD        openFlags,
     
    472481struct StorageInternalImpl
    473482{
    474   ICOM_VFIELD(IStorage);        /* Needs to be the first item in the stuct
     483  ICOM_VFIELD(IStorage);        /* Needs to be the first item in the struct
    475484                                 * since we want to cast this in a Storage32 pointer */
    476485
     
    516525struct IEnumSTATSTGImpl
    517526{
    518   ICOM_VFIELD(IEnumSTATSTG);    /* Needs to be the first item in the stuct
     527  ICOM_VFIELD(IEnumSTATSTG);    /* Needs to be the first item in the struct
    519528                                         * since we want to cast this in a IEnumSTATSTG pointer */
    520529 
     
    601610struct StgStreamImpl
    602611{
    603   ICOM_VFIELD(IStream);  /* Needs to be the first item in the stuct
     612  ICOM_VFIELD(IStream);  /* Needs to be the first item in the struct
    604613                                    * since we want to cast this in a IStream pointer */
    605614 
  • trunk/src/ole32/stubs.cpp

    r5602 r7926  
    1 /* $Id: stubs.cpp,v 1.16 2001-04-26 19:32:52 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.17 2002-02-15 17:18:52 sandervl Exp $ */
    22/*
    33 * Win32 COM/OLE stubs for OS/2
     
    3838//*****************************************************************************
    3939//*****************************************************************************
    40 HRESULT WIN32API CoDisconnectObject(IUnknown *pUnk, DWORD dwReserved)
    41 {
    42     dprintf(("OLE32: CoDisconnectObject - stub"));
    43     return S_OK;
    44 }
    45 //*******************************************************************************
    46 //*******************************************************************************
    4740HRESULT WIN32API CoGetCallerTID()
    4841{
     
    5649    dprintf(("OLE32: CoGetCurrentLogicalThreadId, UNKNOWN API - stub"));
    5750    return 0;
    58 }
    59 //*******************************************************************************
    60 //*******************************************************************************
    61 HRESULT WIN32API CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID riid,
    62                                                    LPVOID *ppv)
    63 {
    64     dprintf(("OLE32: CoGetInterfaceAndReleaseStream - stub"));
    65     return E_INVALIDARG;
    66 }
    67 //*******************************************************************************
    68 //*******************************************************************************
    69 HRESULT WIN32API CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk,
    70                                         DWORD dwDestContext, LPVOID pvDestContext,
    71                                         DWORD mshlflags)
    72 {
    73     dprintf(("OLE32: CoGetMarshalSizeMax - stub"));
    74     return CO_E_NOTINITIALIZED;
    75 }
    76 //*******************************************************************************
    77 //*******************************************************************************
    78 HRESULT WIN32API CoGetStandardMarshal(REFIID riid, IUnknown *pUnk, DWORD dwDestContext,
    79                                          LPVOID pvDestContext, DWORD mshlflags,
    80                                          LPMARSHAL *ppMarshal)
    81 {
    82     dprintf(("OLE32: CoGetStandardMarshal - stub"));
    83     return E_OUTOFMEMORY;
    8451}
    8552//*******************************************************************************
     
    12087//*******************************************************************************
    12188//*******************************************************************************
    122 HRESULT WIN32API CoMarshalInterThreadInterfaceInStream(REFIID riid,
    123                                                           LPUNKNOWN pUnk,
    124                                                           LPSTREAM *ppStm)
    125 {
    126     dprintf(("OLE32: CoMarshalInterThreadInterfaceInStream - stub"));
    127     return E_OUTOFMEMORY;
    128 }
    129 //*******************************************************************************
    130 //*******************************************************************************
    131 HRESULT WIN32API CoMarshalInterface(IStream *pStm, REFIID riid, IUnknown *pUnk,
    132                                        DWORD dwDestContext, void *pvDestContext,
    133                                        DWORD mshlflags)
    134 {
    135     dprintf(("OLE32: CoMarshalInterface - stub"));
    136     return E_OUTOFMEMORY;
    137 }
    138 //*******************************************************************************
    139 //*******************************************************************************
    14089HRESULT WIN32API CoQueryReleaseObject()
    14190{
     
    166115//*******************************************************************************
    167116//*******************************************************************************
    168 HRESULT WIN32API CoSetState(LPDWORD state)
    169 {
    170     dprintf(("OLE32: CoSetState (%p),stub!\n", state));
    171     if (state) *state = 0;
    172     return S_OK;
    173 }
    174 
    175 //*******************************************************************************
    176 //*******************************************************************************
    177117void WIN32API CoUnloadingWOW()
    178118{
     
    185125{
    186126    dprintf(("OLE32: CoUnmarshalHresult - stub"));
    187     return S_OK;
    188 }
    189 //*******************************************************************************
    190 //*******************************************************************************
    191 HRESULT WIN32API CoUnmarshalInterface(IStream *pSTm, REFIID riid, void **ppv)
    192 {
    193     dprintf(("OLE32: CoUnmarshalInterface - stub"));
    194127    return S_OK;
    195128}
Note: See TracChangeset for help on using the changeset viewer.