Changeset 1033 for trunk/src


Ignore:
Timestamp:
Sep 24, 1999, 11:49:45 PM (26 years ago)
Author:
davidr
Message:

Ported remaining files pertaining to OLE32 from WINE

Location:
trunk/src/ole32
Files:
14 added
6 edited

Legend:

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

    r993 r1033  
     1/* $Id: antimoniker.cpp,v 1.2 1999-09-24 21:49:42 davidr Exp $ */
    12/*
    23 * AntiMonikers functions.
  • trunk/src/ole32/clsid.cpp

    r880 r1033  
    1 /* $Id: clsid.cpp,v 1.7 1999-09-08 15:39:55 davidr Exp $ */
     1/* $Id: clsid.cpp,v 1.8 1999-09-24 21:49:42 davidr Exp $ */
    22/*
    33 *
     
    293293}
    294294
     295// ----------------------------------------------------------------------
     296// CONCRETE_IsEqualGUID
     297// ----------------------------------------------------------------------
     298int WIN32API CONCRETE_IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
     299{
     300    return IsEqualGUID(rguid1, rguid2);
     301}
     302
  • trunk/src/ole32/makefile

    r993 r1033  
    2121
    2222OBJS =  ole32.obj \
     23        antimoniker.obj \
     24        bindctx.obj \
     25        clsid.obj \
     26        compositemoniker.obj \
     27        datacache.obj \
     28        defaulthandler.obj \
     29        filemoniker.obj \
     30        guid.obj \
     31        hglobalstream.obj \
     32        initialise.obj \
     33        initterm.obj \
     34        itemmoniker.obj \
     35        iunknown.obj \
     36        library.obj \
     37        memlockbytes.obj \
    2338        moniker.obj \
    24         antimoniker.obj \
    25         initterm.obj \
    2639        oString.obj \
    27         clsid.obj \
    28         guid.obj \
    29         initialise.obj \
    30         taskmem.obj \
    31         library.obj \
    32         iunknown.obj \
    3340        ole2.obj \
     41        oleobj.obj \
     42        oleClip.obj \
     43        oleDrag.obj \
    3444        oleMenu.obj \
    35         oleDrag.obj \
    36         oleClip.obj \
    37         stubs.obj
     45        stg_bigblockfile.obj \
     46        stg_stream.obj \
     47        storage.obj \
     48        stubs.obj \
     49        taskmem.obj
    3850
    3951all: $(TARGET).dll $(TARGET).lib regsvr32.exe
     
    6072
    6173
    62 oString.obj:    oString.cpp
    63 ole32.obj:      ole32.cpp
    64 ole2.obj:       ole2.cpp
    65 oleClip.obj:    oleClip.cpp
    66 oleDrag.obj:    oleDrag.cpp
    67 oleMenu.obj:    oleMenu.cpp
    68 initialise.obj: initialise.cpp
    69 clsid.obj:      clsid.cpp
    70 guid.obj:       guid.cpp
    71 stubs.obj:      stubs.cpp
    72 initterm.obj:   initterm.cpp
    73 moniker.obj:    moniker.cpp
    74 taskmem.obj:    taskmem.cpp
    75 library.obj:    library.cpp
    76 iunknown.obj:   iunknown.cpp
     74antimoniker.obj:        antimoniker.cpp
     75bindctx.obj:            bindctx.cpp
     76clsid.obj:              clsid.cpp
     77compositemoniker.obj:   compositemoniker.cpp
     78datacache.obj:          datacache.cpp
     79defaulthandler.obj:     defaulthandler.cpp
     80filemoniker.obj:        filemoniker.cpp
     81guid.obj:               guid.cpp
     82hglobalstream.obj:      hglobalstream.cpp
     83initialise.obj:         initialise.cpp
     84initterm.obj:           initterm.cpp
     85iunknown.obj:           iunknown.cpp
     86itemmoniker.obj:        itemmoniker.cpp
     87library.obj:            library.cpp
     88memlockbytes.obj:       memlockbytes.cpp
     89moniker.obj:            moniker.cpp
     90oString.obj:            oString.cpp
     91ole2.obj:               ole2.cpp
     92oleobj.obj:             oleobj.cpp
     93ole32.obj:              ole32.cpp
     94oleClip.obj:            oleClip.cpp
     95oleDrag.obj:            oleDrag.cpp
     96oleMenu.obj:            oleMenu.cpp
     97stg_bigblockfile.obj:   stg_bigblockfile.cpp
     98stg_stream.obj:         stg_stream.cpp
     99storage.obj:            storage.cpp
     100stubs.obj:              stubs.cpp
     101taskmem.obj:            taskmem.cpp
    77102
    78103regsvr32.obj:   regsvr32.cpp
  • trunk/src/ole32/ole32.cpp

    r872 r1033  
    1 /* $Id: ole32.cpp,v 1.10 1999-09-08 11:29:28 davidr Exp $ */
     1/* $Id: ole32.cpp,v 1.11 1999-09-24 21:49:43 davidr Exp $ */
    22/*
    33 *
     
    2222
    2323#include "oString.h"
    24 #include "moniker.h"    // RunningObjectTableImpl_***
     24#include "moniker.h"            // RunningObjectTableImpl_***
     25#include "filemoniker.h"        // FileMonikerImpl_***
    2526
    2627// ======================================================================
     
    583584}
    584585
     586// ----------------------------------------------------------------------
     587// GetClassFile
     588// ----------------------------------------------------------------------
     589// This function supplies the CLSID associated with the given filename.
     590HRESULT WIN32API GetClassFile(LPOLESTR filePathName, CLSID *pclsid)
     591{
     592    IStorage *  pstg = 0;
     593    HRESULT     res;
     594    int         nbElm = 0;
     595    int         length = 0;
     596    int         i = 0;
     597    LONG        sizeProgId = 20;
     598    LPOLESTR *  pathDec = 0;
     599    LPOLESTR    absFile = 0;
     600    LPOLESTR    progId = 0;
     601    WCHAR       extention[100] = {0};
     602
     603    dprintf(("OLE32: GetClassFile"));
     604
     605    // if the file contain a storage object the return the CLSID
     606    // writen by IStorage_SetClass method
     607
     608    if((StgIsStorageFile(filePathName)) == S_OK)
     609    {
     610        res = StgOpenStorage(filePathName, NULL, STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &pstg);
     611
     612        if (SUCCEEDED(res))
     613            res = ReadClassStg(pstg, pclsid);
     614
     615        IStorage_Release(pstg);
     616
     617        return res;
     618    }
     619
     620    /* if the obove strategies fail then search for the extension key in the registry */
     621
     622    /* get the last element (absolute file) in the path name */
     623    nbElm = FileMonikerImpl_DecomposePath(filePathName, &pathDec);
     624    absFile = pathDec[nbElm-1];
     625
     626    /* failed if the path represente a directory and not an absolute file name*/
     627    if (lstrcmpW(absFile, (LPOLESTR)"\\"))
     628        return MK_E_INVALIDEXTENSION;
     629
     630    /* get the extension of the file */
     631    length = lstrlenW(absFile);
     632    for(i = length-1; ( (i >= 0) && (extention[i] = absFile[i]) ); i--);
     633       
     634    /* get the progId associated to the extension */
     635    progId = (WCHAR *)CoTaskMemAlloc(sizeProgId);
     636
     637    res = RegQueryValueW(HKEY_CLASSES_ROOT, extention, progId, &sizeProgId);
     638
     639    if (res == ERROR_MORE_DATA)
     640    {
     641        CoTaskMemRealloc(progId,sizeProgId);
     642
     643        res = RegQueryValueW(HKEY_CLASSES_ROOT, extention, progId, &sizeProgId);
     644    }
     645    if (res == ERROR_SUCCESS)
     646        /* return the clsid associated to the progId */
     647        res =  CLSIDFromProgID(progId, pclsid);
     648
     649    for(i = 0; pathDec[i] != NULL; i++)
     650        CoTaskMemFree(pathDec[i]);
     651
     652    CoTaskMemFree(pathDec);
     653
     654    CoTaskMemFree(progId);
     655
     656    if (res == ERROR_SUCCESS)
     657        return res;
     658
     659    return MK_E_INVALIDEXTENSION;
     660}
    585661// ======================================================================
    586662// Private functions.
  • trunk/src/ole32/ole32.h

    r872 r1033  
    1 /* $Id: ole32.h,v 1.8 1999-09-08 11:29:28 davidr Exp $ */
     1/* $Id: ole32.h,v 1.9 1999-09-24 21:49:44 davidr Exp $ */
    22/*
    33 *
     
    3838#include <winreg.h>
    3939
    40 #include "wine/obj_base.h"
    41 #include "wine/obj_misc.h"
     40#include "objbase.h"
     41
    4242#include "wine/obj_inplace.h"
    43 #include "wine/obj_dataobject.h"
    4443#include "wine/obj_oleobj.h"
    45 #include "wine/obj_marshal.h"
    46 #include "wine/obj_moniker.h"
    47 #include "wine/obj_clientserver.h"
    48 #include "wine/obj_dragdrop.h"
    4944#include "wine/obj_surrogate.h"
     45#include "wine/obj_oleview.h"
     46#include "wine/obj_cache.h"
    5047
    5148#endif
  • trunk/src/ole32/stubs.cpp

    r993 r1033  
    1 /* $Id: stubs.cpp,v 1.8 1999-09-20 20:38:20 davidr Exp $ */
     1/* $Id: stubs.cpp,v 1.9 1999-09-24 21:49:45 davidr Exp $ */
    22/*
    33 * Win32 COM/OLE stubs for OS/2
     
    222222//*******************************************************************************
    223223//*******************************************************************************
    224 HRESULT WIN32API CreateBindCtx(DWORD reserved, LPBC *ppbc)
    225 {
    226     dprintf(("OLE32: CreateBindCtx - stub"));
    227     return E_OUTOFMEMORY;
    228 }
    229 //*******************************************************************************
    230 //*******************************************************************************
    231 HRESULT WIN32API CreateDataAdviseHolder(IDataAdviseHolder **ppDAHolder)
    232 {
    233     dprintf(("OLE32: CreateDataAdviseHolder - stub"));
    234     return E_OUTOFMEMORY;
    235 }
    236 //*******************************************************************************
    237 //*******************************************************************************
    238 HRESULT WIN32API CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid,
    239                                     REFIID riid, LPVOID *ppvObj)
    240 {
    241     dprintf(("OLE32: CreateDataCache - stub"));
    242     return E_OUTOFMEMORY;
    243 }
    244 //*******************************************************************************
    245 //*******************************************************************************
    246 HRESULT WIN32API CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER *ppmk)
    247 {
    248     dprintf(("OLE32: CreateFileMoniker - stub"));
    249     return E_OUTOFMEMORY;
    250 }
    251 //*******************************************************************************
    252 //*******************************************************************************
    253 HRESULT WIN32API CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest,
    254                                            LPMONIKER *ppmkComposite)
    255 {
    256     dprintf(("OLE32: CreateGenericComposite - stub"));
    257     return E_OUTOFMEMORY;
    258 }
    259 //*******************************************************************************
    260 //*******************************************************************************
    261 HRESULT WIN32API CreateILockBytesOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease,
    262                                               ILockBytes **ppkLkbyt)
    263 {
    264     dprintf(("OLE32: CreateILockBytesOnHGlobal - stub"));
    265     return E_OUTOFMEMORY;
    266 }
    267 //*******************************************************************************
    268 //*******************************************************************************
    269 HRESULT WIN32API CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER *ppmk)
    270 {
    271     dprintf(("OLE32: CreateItemMoniker - stub"));
    272     return E_OUTOFMEMORY;
    273 }
    274 //*******************************************************************************
    275 //*******************************************************************************
    276 HRESULT WIN32API CreateOleAdviseHolder (LPOLEADVISEHOLDER *ppOAHolder)
    277 {
    278     dprintf(("OLE32: CreateOleAdviseHolder - stub"));
    279     return E_OUTOFMEMORY;
    280 }
    281 //*******************************************************************************
    282 //*******************************************************************************
    283224HRESULT WIN32API CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER *ppmk)
    284225{
     
    288229//*******************************************************************************
    289230//*******************************************************************************
    290 HRESULT WIN32API CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease,
    291                                           LPSTREAM *ppstm)
    292 {
    293     dprintf(("OLE32: CreateStreamOnHGlobal - stub"));
    294     return E_OUTOFMEMORY;
    295 }
    296 //*******************************************************************************
    297 //*******************************************************************************
    298231HRESULT WIN32API DllDebugObjectRPCHook()
    299232{
     
    321254    dprintf(("OLE32: EnableHookObject, UNKNOWN API - stub"));
    322255    return 0;
    323 }
    324 //*******************************************************************************
    325 //*******************************************************************************
    326 HRESULT WIN32API GetClassFile(LPCWSTR szFileName, CLSID *pclsid)
    327 {
    328     dprintf(("OLE32: GetClassFile - stub"));
    329     return MK_E_CANTOPENFILE;
    330256}
    331257//*******************************************************************************
     
    345271//*******************************************************************************
    346272//*******************************************************************************
    347 HRESULT WIN32API GetHGlobalFromILockBytes(ILockBytes *pLkbyt, HGLOBAL *phglobal)
    348 {
    349     dprintf(("OLE32: GetHGlobalFromILockBytes - stub"));
    350     return E_INVALIDARG;
    351 }
    352 //*******************************************************************************
    353 //*******************************************************************************
    354 HRESULT WIN32API GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
    355 {
    356     dprintf(("OLE32: GetHGlobalFromStream - stub"));
    357     return E_INVALIDARG;
    358 }
    359 //*******************************************************************************
    360 //*******************************************************************************
    361273HRESULT WIN32API GetHookInterface()
    362274{
     
    373285//*******************************************************************************
    374286//*******************************************************************************
    375 BOOL WIN32API CONCRETE_IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
    376 {
    377     dprintf(("OLE32: IsEqualGUID - stub"));
    378     return FALSE;
    379 }
    380 //*******************************************************************************
    381 //*******************************************************************************
    382287HRESULT WIN32API IsValidIid(DWORD Iid)
    383288{
     
    405310{
    406311    dprintf(("OLE32: MkParseDisplayName - stub"));
    407     return E_OUTOFMEMORY;
    408 }
    409 //*******************************************************************************
    410 //*******************************************************************************
    411 HRESULT WIN32API MonikerCommonPrefixWith(LPMONIKER pmkThis, LPMONIKER pmkOther,
    412                                             LPMONIKER *ppmkCommon)
    413 {
    414     dprintf(("OLE32: MonikerCommonPrefixWith - stub"));
    415312    return E_OUTOFMEMORY;
    416313}
     
    476373//*******************************************************************************
    477374//*******************************************************************************
    478 HRESULT WIN32API OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter,
    479                                             REFIID riid, LPVOID *ppvObj)
    480 {
    481     dprintf(("OLE32: OleCreateDefaultHandler - stub"));
    482     return(E_OUTOFMEMORY);
    483 }
    484 //*******************************************************************************
    485 //*******************************************************************************
    486375HRESULT WIN32API OleCreateEmbeddingHelper(REFCLSID clsid, LPUNKNOWN pUnkOuter,
    487376                                             DWORD flags, LPCLASSFACTORY pCF,
     
    610499//*******************************************************************************
    611500//*******************************************************************************
    612 HRESULT WIN32API OleLoadFromStream(IStream *pStm, REFIID iidInterface, void** ppvObj)
    613 {
    614     dprintf(("OLE32: OleLoadFromStream - stub"));
    615     return(E_OUTOFMEMORY);
    616 }
    617 //*******************************************************************************
    618 //*******************************************************************************
    619501HRESULT WIN32API OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses)
    620502{
     
    673555    dprintf(("OLE32: OleRun - stub"));
    674556    return(E_UNEXPECTED);
    675 }
    676 //*******************************************************************************
    677 //*******************************************************************************
    678 HRESULT WIN32API OleSaveToStream(IPersistStream *pPStm, IStream *pStm)
    679 {
    680     dprintf(("OLE32: OleSaveToStream - stub"));
    681     return(STG_E_MEDIUMFULL);
    682557}
    683558//*******************************************************************************
     
    714589//*******************************************************************************
    715590//*******************************************************************************
    716 HRESULT WIN32API ReadClassStg(IStorage *pStg, CLSID *pclsid)
    717 {
    718     dprintf(("OLE32: ReadClassStg - stub"));
    719     return(E_OUTOFMEMORY);
    720 }
    721 //*******************************************************************************
    722 //*******************************************************************************
    723591HRESULT WIN32API ReadClassStm(IStream *pStm, CLSID *pclsid)
    724592{
     
    757625//*******************************************************************************
    758626//*******************************************************************************
    759 HRESULT WIN32API StgCreateDocfile(const WCHAR *pwcsName, DWORD grfMode,
    760                                      DWORD reserved, IStorage **ppstgOpen)
    761 {
    762     dprintf(("OLE32: StgCreateDocfile - stub"));
    763     return(STG_E_INSUFFICIENTMEMORY);
    764 }
    765 //*******************************************************************************
    766 //*******************************************************************************
    767627HRESULT WIN32API SetDocumentBitStg()
    768628{
    769629    dprintf(("OLE32: SetDocumentBitStg, UNKNOWN API - stub"));
    770630    return(E_OUTOFMEMORY);
    771 }
    772 //*******************************************************************************
    773 //*******************************************************************************
    774 HRESULT WIN32API StgCreateDocfileOnILockBytes(ILockBytes *plkbyt, DWORD grfMode,
    775                                                  DWORD reserved, IStorage **ppstgOpen)
    776 {
    777     dprintf(("OLE32: StgCreateDocfileOnILockBytes - stub"));
    778     return(STG_E_INSUFFICIENTMEMORY);
    779 }
    780 //*******************************************************************************
    781 //*******************************************************************************
    782 HRESULT WIN32API StgIsStorageFile(const WCHAR *pwcsName)
    783 {
    784     dprintf(("OLE32: StgIsStorageFile - stub"));
    785     return(S_FALSE);
    786 }
    787 //*******************************************************************************
    788 //*******************************************************************************
    789 HRESULT WIN32API StgIsStorageILockBytes(ILockBytes *plkbyt)
    790 {
    791     dprintf(("OLE32: StgIsStorageILockBytes - stub"));
    792     return(S_FALSE);
    793 }
    794 //*******************************************************************************
    795 //*******************************************************************************
    796 HRESULT WIN32API StgOpenStorage(const WCHAR *pwcsName, IStorage *pstgPriority,
    797                                    DWORD grfMode, SNB snbExclude, DWORD reserved,
    798                                    IStorage **ppstgOpen)
    799 {
    800     dprintf(("OLE32: StgOpenStorage - stub"));
    801     return(STG_E_INSUFFICIENTMEMORY);
    802 }
    803 //*******************************************************************************
    804 //*******************************************************************************
    805 HRESULT WIN32API StgOpenStorageOnILockBytes(ILockBytes *plkbyt,
    806                                                IStorage *pstgPriority,
    807                                                DWORD grfMode, SNB snbExclude,
    808                                                DWORD reserved,
    809                                                IStorage **ppstgOpen)
    810 {
    811     dprintf(("OLE32: StgOpenStorageOnILockBytes - stub"));
    812     return(STG_E_INSUFFICIENTMEMORY);
    813631}
    814632//*******************************************************************************
     
    847665    dprintf(("OLE32: UtGetDvtd32Info, UNKNOWN API - stub"));
    848666    return(E_OUTOFMEMORY);
    849 }
    850 //*******************************************************************************
    851 //*******************************************************************************
    852 HRESULT WIN32API WriteClassStg(IStorage *pStg, REFCLSID rclsid)
    853 {
    854     dprintf(("OLE32: WriteClassStg - stub"));
    855     return(STG_E_MEDIUMFULL);
    856667}
    857668//*******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.