Sourc code for the first ole32.dll COM implementation

svn path=/trunk/; revision=1909
This commit is contained in:
Jurgen van Gael 2001-05-15 12:22:18 +00:00
parent 48da1fcf14
commit 079339b3b8
9 changed files with 1580 additions and 0 deletions

664
reactos/lib/ole32/CoXxx.c Normal file
View file

@ -0,0 +1,664 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\CoXxx.c
* PURPOSE: The Co... function implementation
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 01/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#define INITGUID
#include "ole32.h"
//
// lCOMLockCount is a reference count, when it reaches 0, all COM libraries are freed
//
static ULONG lCOMLockCount = 0;
/*WINOLEAPI_(ULONG) CoAddRefServerProcess()
{
// not implemented
return 0L;
}
WINOLEAPI CoAllowSetForegroundWindow(IUnknown *pUnk, LPVOID lpvReserved)
{
// not implemented
return 0L;
}*/
//
// The winapi states this function has becaome obsolete
//
WINOLEAPI_(DWORD) CoBuildVersion()
{
return 0;
}
/*WINOLEAPI CoCancelCall(DWORD dwThreadId, ULONG ulTimeout)
{
// not implemented
return E_FAIL;
}
WINOLEAPI CoCopyProxy(IUnknown* pProxy, IUnknown** ppCopy)
{
// not implemented
return E_FAIL;
}
WINOLEAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal)
{
// not implemented
return E_FAIL;
}
//
// CoCreateGuid creates a uuid
//
WINOLEAPI CoCreateGuid(GUID* pguid)
{
return UuidCreate(pguid);
}
//
// CoCreateInstanceEx can call multiple inteerfaces
//
WINOLEAPI CoCreateInstanceEx(REFCLSID Clsid, IUnknown* pUnkOuter, DWORD dwClsCtx, COSERVERINFO* pServerInfo,
DWORD dwCount, MULTI_QI* pResults)
{
IUnknown* pUnknown = NULL;
HRESULT hr = S_OK;
DWORD nSuccess = 0;
if((dwCount == 0) || (pResults == NULL))
return E_INVALIDARG;
// we do not implement object creation on other machines
if(pServerInfo != NULL)
return E_NOTIMPL;
// init the pResults structure
for(DWORD i = 0; i < dwCount; i++)
{
pResults[i].pItf = NULL;
pResults[i].hr = E_NOINTERFACE;
}
// create the object
hr = CoCreateInstance(Clsid, pUnkOuter, dwClsCtx, IID_IUnknown, (void**) &pUnknown);
if(FAILED(hr))
return hr;
//Then, query for all the interfaces requested
for(i = 0; i < dwCount; i++)
{
pResults[i].hr = pUnknown->QueryInterface((REFIID) pResults[i].pIID, (void**) &(pResults[i].pItf));
if(!FAILED(pResults[i].hr))
nSuccess++;
}
// clean up
pUnknown->Release();
if(nSuccess == 0)
return E_NOINTERFACE;
if(nSuccess != dwCount)
return CO_S_NOTALLINTERFACES;
return S_OK;
}
//
//
//
WINOLEAPI CoDisableCallCancellation(LPVOID pvReserved)
{
return E_FAIL;
}
WINOLEAPI CoDisconnectObject(LPUNKNOWN pUnk, DWORD dwReserved)
{
// not implemented
return E_FAIL;
}
//
//
//
WINOLEAPI_(BOOL) CoDosDateTimeToFileTime(WORD nDosDate, WORD nDosTime, FILETIME* lpFileTime)
{
return TRUE;
}
//
//
//
WINOLEAPI CoEnableCallCancellation(LPVOID pvReserver)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoFileTimeNow(FILETIME* lpFileTime)
{
return E_FAIL;
}
//
//
//
WINOLEAPI_(BOOL) CoFileTimeToDosDateTime(FILETIME* lpFileTime, LPWORD lpDosDate, LPWORD lpDosTime)
{
return E_FAIL;
}*/
//
// CoFreeAllLibraries frees all libraries loaded by CoLoadLibrary
// from memory.
//
WINOLEAPI_(VOID) CoFreeAllLibraries()
{
return;
}
/*
//
//
//
WINOLEAPI_(void) CoFreeLibrary(HINSTANCE hInst)
{
return;
}
//
//
//
WINOLEAPI_(void) CoFreeUnusedLibraries()
{
return;
}
//
//
//
WINOLEAPI CoGetCallContext(REFIID riid, void** ppInterface)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetCancelObject(DWORD dwThreadId, REFIID iid, void** ppUnk)
{
return E_FAIL;
}*/
//
// CoCreateInstance creates an instance of some COM object
//
WINOLEAPI CoCreateInstance(REFCLSID rclsid, IUnknown* pUnkOuter, DWORD dwClsContext, REFIID riid, VOID** ppv)
{
HRESULT hr = S_OK;
IClassFactory* pCF;
if(ppv == NULL)
return E_POINTER;
*ppv = NULL;
// create the class factory
hr = CoGetClassObject(rclsid, dwClsContext, NULL, &IID_IClassFactory, (VOID**) &pCF);
if(FAILED(hr))
return hr;
// create one instance of this class
pCF->lpVtbl->CreateInstance(pCF, pUnkOuter, riid, ppv);
pCF->lpVtbl->Release(pCF);
return hr;
}
//
// CoGetClassObject gets the class factory for a specified object
//
WINOLEAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, VOID* pvReserved, REFIID riid, VOID** ppv)
{
HMODULE hComDll;
HRESULT hr = S_OK;
typedef HRESULT (*PF) (REFCLSID, REFIID, VOID**);
PF fpDllGetClassObject;
// sanity checks
if(ppv == NULL)
return E_POINTER;
*ppv = NULL;
// only the CLSCTX_INPROC_SERVER is valid now
if(dwClsContext != CLSCTX_INPROC_SERVER)
return E_FAIL;
// fix: CoGetClassObject should call CoLoadLibrary as stated in the win32 api docs
hComDll = LoadLibrary("C:\\MsCom.dll");
fpDllGetClassObject = (PF) GetProcAddress(hComDll, "DllGetClassObject");
// get the class object
fpDllGetClassObject(rclsid, riid, (VOID**) ppv);
/*
//HKEY hCLSID;
HKEY hKey;
HKEY hInprocServer;
char szDllPath[MAX_PATH + 1];
DWORD dwSize;
// convert the CLISD to a string
char szCLSID[37] = CLSIDToString(rclsid);
// get the dll path from the registry
if(RegOpenKeyEx(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
return E_FAIL;
if(RegOpenKeyEx(hKey, szCLSID, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
return E_FAIL;
if(RegOpenKeyEx(hKey, "InprocServer32", 0, KEY_READ, &hInprocServer) != ERROR_SUCCESS)
return E_FAIL;
if(RegQueryValueEx(hInprocServer, NULL, NULL, NULL, (unsigned char*) szDllPath, &dwSize) != ERROR_SUCCESS)
return E_FAIL;
*/
return hr;
}
/*
//
//
//
WINOLEAPI_(DWORD) CoGetCurrentProcess()
{
return 0;
}
//
//
//
WINOLEAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter,
DWORD dwClsCtx, DWORD grfMode, OLECHAR* pwszName, DWORD dwCount, MULTI_QI* pResults)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetInstanceFromIStorage(COSERVERINFO* pServerInfo, CLSID* pClsid, IUnknown* punkOuter,
DWORD dwClsCtx, IStorage *pstg, DWORD dwCount, MULTI_QI* pResults)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetMalloc(DWORD dwMemContext, LPMALLOC* ppMalloc)
{
return S_OK;
}
//
//
//
WINOLEAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext,
LPVOID pvdestContext, DWORD mshlflags)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetObject(LPCWSTR pszName, BIND_OPTS* pBindOptions, REFIID riid, void** ppv)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetObjectContext(REFIID riid, LPVOID FAR* ppv)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetPSClsid(REFIID riid, CLSID* pClsid)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvdestContext,
DWORD mshlflags, LPMARSHAL* ppMarshal)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetStdMarshalEx(LPUNKNOWN pUnkOuter, DWORD smexflags, LPUNKNOWN* ppUnkInner)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew)
{
return E_FAIL;
}
//
//
//
WINOLEAPI CoImpersonateClient()
{
return E_FAIL;
}*/
//
// CoInitializeEx is the new function to init COM runtime on
// the current thread, setting it's concurrency model, and
// creating an appartment as needed.
//
WINOLEAPI CoInitializeEx(VOID* lpReserved, DWORD dwCoInit)
{
HRESULT hr = S_OK;
if(lpReserved != NULL)
return E_INVALIDARG;
// only apartement threaded COM is supported for now
if(dwCoInit != COINIT_APARTMENTTHREADED)
return E_UNEXPECTED;
lCOMLockCount++;
return hr;
}
//
// CoInitialize is called to initialize the COM runtime on
// the current thread.
//
WINOLEAPI CoInitialize(VOID* lpReserved)
{
// CoInitializeEx is actually the new function to init COM
return CoInitializeEx(lpReserved, COINIT_APARTMENTTHREADED);
}
//
// CoUninitialzie closes the COM runtime on the current thread
// unloads all COM dll's and resources loaded by the thread, and
// forces all RPC connections on this thread to close.
//
WINOLEAPI_(VOID) CoUninitialize()
{
lCOMLockCount--;
// free all resources for the last Unitialize call
if(lCOMLockCount == 0)
{
/*RunningObjectTableImpl_UnInitialize(); WINE
COM_RevokeAllClasses();
COM_ExternalLockFreeList();*/
CoFreeAllLibraries();
}
}
/*
/*WINOLEAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy)
{
return S_OK;
}
WINOLEAPI CoRevokeMallocSpy()
{
return S_OK;
}
WINOLEAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
{
return S_OK;
}
WINOLEAPI CoRevokeClassObject(DWORD dwRegister)
{
return S_OK;
}
WINOLEAPI CoResumeClassObjects()
{
return S_OK;
}
WINOLEAPI CoSuspendClassObjects()
{
return S_OK;
}
WINOLEAPI_(ULONG) CoReleaseServerProcess()
{
return 0;
}
WINOLEAPI CoRegisterPSClsid(IN REFIID riid, IN REFCLSID rclsid)
{
return S_OK;
}
WINOLEAPI CoRegisterSurrogate(IN LPSURROGATE pSurrogate)
{
return S_OK;
}
WINOLEAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext,
DWORD mshlflags)
{
return S_OK;
}
WINOLEAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID FAR* ppv)
{
return S_OK;
}
WINOLEAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult)
{
return S_OK;
}
WINOLEAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT FAR * phresult)
{
return S_OK;
}
WINOLEAPI CoReleaseMarshalData(LPSTREAM pStm)
{
return S_OK;
}
WINOLEAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases)
{
return S_OK;
}
WINOLEAPI_(BOOL) CoIsHandlerConnected(LPUNKNOWN pUnk)
{
return S_OK;
}
WINOLEAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM *ppStm)
{
return S_OK;
}
WINOLEAPI_(HINSTANCE) CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree)
{
return NULL;
}
WINOLEAPI CoInitializeSecurity(
PSECURITY_DESCRIPTOR pSecDesc,
LONG cAuthSvc,
SOLE_AUTHENTICATION_SERVICE *asAuthSvc,
void *pReserved1,
DWORD dwAuthnLevel,
DWORD dwImpLevel,
void *pAuthList,
DWORD dwCapabilities,
void *pReserved3 )
{
return S_OK;
}
WINOLEAPI CoQueryProxyBlanket(
IUnknown *pProxy,
DWORD *pwAuthnSvc,
DWORD *pAuthzSvc,
OLECHAR **pServerPrincName,
DWORD *pAuthnLevel,
DWORD *pImpLevel,
RPC_AUTH_IDENTITY_HANDLE *pAuthInfo,
DWORD *pCapabilites )
{
return S_OK;
}
WINOLEAPI CoSetProxyBlanket(
IUnknown *pProxy,
DWORD dwAuthnSvc,
DWORD dwAuthzSvc,
OLECHAR *pServerPrincName,
DWORD dwAuthnLevel,
DWORD dwImpLevel,
RPC_AUTH_IDENTITY_HANDLE pAuthInfo,
DWORD dwCapabilities )
{
return S_OK;
}
WINOLEAPI CoQueryClientBlanket(
DWORD *pAuthnSvc,
DWORD *pAuthzSvc,
OLECHAR **pServerPrincName,
DWORD *pAuthnLevel,
DWORD *pImpLevel,
RPC_AUTHZ_HANDLE *pPrivs,
DWORD *pCapabilities )
{
return S_OK;
}
WINOLEAPI CoRevertToSelf()
{
return S_OK;
}
WINOLEAPI CoQueryAuthenticationServices(
DWORD *pcAuthSvc,
SOLE_AUTHENTICATION_SERVICE **asAuthSvc )
{
return S_OK;
}
WINOLEAPI CoSwitchCallContext(IUnknown *pNewObject, IUnknown **ppOldObject )
{
return S_OK;
}
WINOLEAPI CoSetCancelObject(IUnknown *pUnk)
{
return S_OK;
}
WINOLEAPI CoTestCancel()
{
return S_OK;
}
WINOLEAPI CoRegisterMessageFilter( IN LPMESSAGEFILTER lpMessageFilter,
OUT LPMESSAGEFILTER FAR* lplpMessageFilter)
{
return S_OK;
}
WINOLEAPI CoRegisterChannelHook(REFGUID ExtensionUuid, IChannelHook *pChannelHook )
{
return S_OK;
}
WINOLEAPI CoWaitForMultipleHandles(IN DWORD dwFlags,
IN DWORD dwTimeout,
IN ULONG cHandles,
IN LPHANDLE pHandles,
OUT LPDWORD lpdwindex)
{
return S_OK;
}
WINOLEAPI CoTreatAsClass(IN REFCLSID clsidOld, IN REFCLSID clsidNew)
{
return S_OK;
}
WINOLEAPI_(LPVOID) CoTaskMemAlloc(IN SIZE_T cb)
{
return NULL;
}
WINOLEAPI_(LPVOID) CoTaskMemRealloc(IN LPVOID pv, IN SIZE_T cb)
{
return NULL;
}
WINOLEAPI_(void) CoTaskMemFree(IN LPVOID pv)
{
return;
}*/

View file

@ -0,0 +1,35 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\DllMain.c
* PURPOSE: The dll entry routine
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 01/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
return TRUE;
}

94
reactos/lib/ole32/Misc.c Normal file
View file

@ -0,0 +1,94 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\Misc.c
* PURPOSE: Ole32.dll helper functions
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 14/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
/*WINOLEAPI PropVariantClear(PROPVARIANT *pvar){return S_OK;}
WINOLEAPI FreePropVariantArray(
ULONG cVariants, //Count of elements in the structure
PROPVARIANT *rgvars //Pointer to the PROPVARIANT structure
){return S_OK;}
WINOLEAPI PropVariantCopy(PROPVARIANT* pvarDest, const PROPVARIANT* pvarSrc){return S_OK;}
WINOLEAPI CreateDataAdviseHolder(OUT LPDATAADVISEHOLDER FAR* ppDAHolder)
{
return S_OK;
}
WINOLEAPI CreateDataCache(IN LPUNKNOWN pUnkOuter, IN REFCLSID rclsid,
IN REFIID iid, OUT LPVOID FAR* ppv)
{
return S_OK;
}
WINOLEAPI StringFromCLSID(IN REFCLSID rclsid, OUT LPOLESTR FAR* lplpsz)
{
return S_OK;
}
WINOLEAPI CLSIDFromString(IN LPOLESTR lpsz, OUT LPCLSID pclsid)
{
return E_FAIL;
}
WINOLEAPI StringFromIID(IN REFIID rclsid, OUT LPOLESTR FAR* lplpsz)
{
return S_OK;
}
WINOLEAPI IIDFromString(IN LPOLESTR lpsz, OUT LPIID lpiid)
{
return S_OK;
}
WINOLEAPI_(BOOL) CoIsOle1Class(IN REFCLSID rclsid)
{
return S_OK;
}
WINOLEAPI ProgIDFromCLSID (IN REFCLSID clsid, OUT LPOLESTR FAR* lplpszProgID)
{
return S_OK;
}
WINOLEAPI CLSIDFromProgID (IN LPCOLESTR lpszProgID, OUT LPCLSID lpclsid)
{
return S_OK;
}
WINOLEAPI CLSIDFromProgIDEx (IN LPCOLESTR lpszProgID, OUT LPCLSID lpclsid)
{
return S_OK;
}
WINOLEAPI_(int) StringFromGUID2(IN REFGUID rguid, OUT LPOLESTR lpsz, IN int cchMax)
{
return S_OK;
}*/

43
reactos/lib/ole32/Ole32.h Normal file
View file

@ -0,0 +1,43 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\Ole32.h
* PURPOSE: The internal include file for the ole32.dll
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 01/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#ifndef _OLE32
#define _OLE32
// include windows stuff
#include <windows.h>
//#include <ole32\basetyps.h>
//#include <ole32\guiddef.h>
#include <ole32\winerror.h>
//#include <ole32\unknwn.h>
#include <ole32\objbase.h>
#endif

View file

@ -0,0 +1,36 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\oleauto.c
* PURPOSE: Ole automation helper functions
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 01/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
/*WINOLEAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo){return S_OK;}
WINOLEAPI GetErrorInfo(
DWORD dwReserved,
IErrorInfo **pperrinfo
){return S_OK;}*/

View file

@ -0,0 +1,87 @@
# ReactOS 0.17
# Jurgen Van Gael [jurgen.vangael@student.kuleuven.ac.be]
#
# Makefile for ReactOS ole32.dll
#
PATH_TO_TOP = ../..
CFLAGS = -fno-rtti -I../../include/
TARGETNAME=ole32
DLLTARGET=$(TARGETNAME).dll
OBJECTS=\
DllMain.o \
CoXxx.o \
Moniker.o \
Ole2.o \
OleAuto.o \
Misc.o \
Storage.o
ifeq ($(DOSCLI),yes)
CLEAN_FILES = *.o \
$(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \
$(TARGETNAME).dll $(TARGETNAME).sym
else
CLEAN_FILES = *.o \
$(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \
$(TARGETNAME).dll $(TARGETNAME).sym
endif
all: $(DLLTARGET)
$(TARGETNAME).a: $(OBJECTS)
$(LD) -r $(OBJECTS) -o $(TARGETNAME).a
$(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
$(LD) -r $(OBJECTS) -o $(TARGETNAME).o
$(DLLTOOL) \
--dllname $(TARGETNAME).dll \
--def $(TARGETNAME).def \
--kill-at \
--output-lib $(TARGETNAME).a
$(CC) \
$(TARGETNAME).o \
../kernel32/kernel32.a \
-nostartfiles \
-nostdlib \
-mdll \
-o junk.tmp \
-Wl,--entry=_DllMain@12\
-Wl,--base-file,base.tmp
- $(RM) junk.tmp
$(DLLTOOL) \
--dllname $(TARGETNAME).dll \
--base-file base.tmp \
--output-exp temp.exp \
--def $(TARGETNAME).edf
- $(RM) base.tmp
$(CC) \
$(TARGETNAME).o \
../kernel32/kernel32.a \
-nostartfiles \
-nostdlib \
-mdll \
-o $(TARGETNAME).dll \
-Wl,--entry=_DllMain@12\
-Wl,--image-base,0x77A50000 \
-Wl,--file-alignment,0x1000 \
-Wl,--section-alignment,0x1000 \
-Wl,temp.exp
- $(RM) temp.exp
$(NM) --numeric-sort $(TARGETNAME).dll > $(TARGETNAME).sym
clean: $(CLEAN_FILES:%=%_clean)
$(CLEAN_FILES:%=%_clean): %_clean:
- $(RM) $*
.PHONY: clean $(CLEAN_FILES:%=%_clean)
include ../../rules.mak

209
reactos/lib/ole32/moniker.c Normal file
View file

@ -0,0 +1,209 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\Moniker.c
* PURPOSE: Moniker implementation
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 10/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
/*
//
//
//
WINOLEAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult)
{
return S_OK;
}
WINOLEAPI CoInstall(
IN IBindCtx * pbc,
IN DWORD dwFlags,
IN uCLSSPEC * pClassSpec,
IN QUERYCONTEXT * pQuery,
IN LPWSTR pszCodeBase)
{
return S_OK;
}
WINOLEAPI MkParseDisplayName(IN LPBC pbc, IN LPCOLESTR szUserName,
OUT ULONG FAR * pchEaten, OUT LPMONIKER FAR * ppmk)
{
return S_OK;
}
WINOLEAPI MonikerRelativePathTo(IN LPMONIKER pmkSrc, IN LPMONIKER pmkDest, OUT LPMONIKER
FAR* ppmkRelPath, IN BOOL dwReserved)
{
return S_OK;
}
WINOLEAPI MonikerCommonPrefixWith(IN LPMONIKER pmkThis, IN LPMONIKER pmkOther,
OUT LPMONIKER FAR* ppmkCommon)
{
return S_OK;
}
WINOLEAPI CreateBindCtx(IN DWORD reserved, OUT LPBC FAR* ppbc)
{
return S_OK;
}
WINOLEAPI CreateGenericComposite(IN LPMONIKER pmkFirst, IN LPMONIKER pmkRest,
OUT LPMONIKER FAR* ppmkComposite)
{
return S_OK;
}
WINOLEAPI GetClassFile (IN LPCOLESTR szFilename, OUT CLSID FAR* pclsid)
{
// wine stuff
/*IStorage *pstg=0;
HRESULT res;
int nbElm=0,length=0,i=0;
LONG sizeProgId=20;
LPOLESTR *pathDec=0,absFile=0,progId=0;
WCHAR extention[100]={0};
TRACE("()\n");
/* if the file contain a storage object the return the CLSID writen by IStorage_SetClass method
if((StgIsStorageFile(filePathName))==S_OK){
res=StgOpenStorage(filePathName,NULL,STGM_READ | STGM_SHARE_DENY_WRITE,NULL,0,&pstg);
if (SUCCEEDED(res))
res=ReadClassStg(pstg,pclsid);
IStorage_Release(pstg);
return res;
}
/* if the file is not a storage object then attemps to match various bits in the file against a
pattern in the registry. this case is not frequently used ! so I present only the psodocode for
this case
for(i=0;i<nFileTypes;i++)
for(i=0;j<nPatternsForType;j++){
PATTERN pat;
HANDLE hFile;
pat=ReadPatternFromRegistry(i,j);
hFile=CreateFileW(filePathName,,,,,,hFile);
SetFilePosition(hFile,pat.offset);
ReadFile(hFile,buf,pat.size,NULL,NULL);
if (memcmp(buf&pat.mask,pat.pattern.pat.size)==0){
*pclsid=ReadCLSIDFromRegistry(i);
return S_OK;
}
}
*/
/* if the obove strategies fail then search for the extension key in the registry
/* get the last element (absolute file) in the path name
nbElm=FileMonikerImpl_DecomposePath(filePathName,&pathDec);
absFile=pathDec[nbElm-1];
/* failed if the path represente a directory and not an absolute file name
if (lstrcmpW(absFile,(LPOLESTR)"\\"))
return MK_E_INVALIDEXTENSION;
/* get the extension of the file
length=lstrlenW(absFile);
for(i=length-1; ( (i>=0) && (extention[i]=absFile[i]) );i--);
/* get the progId associated to the extension
progId=CoTaskMemAlloc(sizeProgId);
res=RegQueryValueW(HKEY_CLASSES_ROOT,extention,progId,&sizeProgId);
if (res==ERROR_MORE_DATA){
progId = CoTaskMemRealloc(progId,sizeProgId);
res=RegQueryValueW(HKEY_CLASSES_ROOT,extention,progId,&sizeProgId);
}
if (res==ERROR_SUCCESS)
/* return the clsid associated to the progId
res= CLSIDFromProgID(progId,pclsid);
for(i=0; pathDec[i]!=NULL;i++)
CoTaskMemFree(pathDec[i]);
CoTaskMemFree(pathDec);
CoTaskMemFree(progId);
if (res==ERROR_SUCCESS)
return res;
return MK_E_INVALIDEXTENSION;
return E_FAIL;
}
WINOLEAPI CreateClassMoniker(IN REFCLSID rclsid, OUT LPMONIKER FAR* ppmk)
{
return S_OK;
}
WINOLEAPI CreateFileMoniker(IN LPCOLESTR lpszPathName, OUT LPMONIKER FAR* ppmk)
{
return S_OK;
}
WINOLEAPI CreateItemMoniker(IN LPCOLESTR lpszDelim, IN LPCOLESTR lpszItem,
OUT LPMONIKER FAR* ppmk)
{
return S_OK;
}
WINOLEAPI CreateAntiMoniker(OUT LPMONIKER FAR* ppmk)
{
return S_OK;
}
WINOLEAPI CreatePointerMoniker(IN LPUNKNOWN punk, OUT LPMONIKER FAR* ppmk)
{
return S_OK;
}
WINOLEAPI CreateObjrefMoniker(IN LPUNKNOWN punk, OUT LPMONIKER FAR * ppmk)
{
return S_OK;
}
WINOLEAPI GetRunningObjectTable( IN DWORD reserved, OUT LPRUNNINGOBJECTTABLE FAR* pprot)
{
return S_OK;
}*/

246
reactos/lib/ole32/ole2.c Normal file
View file

@ -0,0 +1,246 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\Ole2.c
* PURPOSE: Object Linking And Embedding implementation
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 12/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
/*
WINOLEAPI_(DWORD) OleBuildVersion( VOID ){return S_OK;}
WINOLEAPI OleInitialize(IN LPVOID pvReserved){return S_OK;}
WINOLEAPI_(void) OleUninitialize(void)
{
return;
}
WINOLEAPI OleQueryLinkFromData(IN LPDATAOBJECT pSrcDataObject){return S_OK;}
WINOLEAPI OleQueryCreateFromData(IN LPDATAOBJECT pSrcDataObject){return S_OK;}
WINOLEAPI OleCreate(IN REFCLSID rclsid, IN REFIID riid, IN DWORD renderopt,
IN LPFORMATETC pFormatEtc, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateEx(IN REFCLSID rclsid, IN REFIID riid, IN DWORD dwFlags,
IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLinkFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLinkFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT IN DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateStaticFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID iid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLink(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLinkEx(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLinkToFile(IN LPCOLESTR lpszFileName, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateLinkToFileEx(IN LPCOLESTR lpszFileName, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateFromFile(IN REFCLSID rclsid, IN LPCOLESTR lpszFileName, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleCreateFromFileEx(IN REFCLSID rclsid, IN LPCOLESTR lpszFileName, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleLoad(IN LPSTORAGE pStg, IN REFIID riid, IN LPOLECLIENTSITE pClientSite,
OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleSave(IN LPPERSISTSTORAGE pPS, IN LPSTORAGE pStg, IN BOOL fSameAsLoad){return S_OK;}
WINOLEAPI OleLoadFromStream( IN LPSTREAM pStm, IN REFIID iidInterface, OUT LPVOID FAR* ppvObj){return S_OK;}
WINOLEAPI OleSaveToStream( IN LPPERSISTSTREAM pPStm, IN LPSTREAM pStm ){return S_OK;}
WINOLEAPI OleSetContainedObject(IN LPUNKNOWN pUnknown, IN BOOL fContained){return S_OK;}
WINOLEAPI OleNoteObjectVisible(IN LPUNKNOWN pUnknown, IN BOOL fVisible){return S_OK;}
WINOLEAPI RegisterDragDrop(IN HWND hwnd, IN LPDROPTARGET pDropTarget){return S_OK;}
WINOLEAPI RevokeDragDrop(IN HWND hwnd){return S_OK;}
WINOLEAPI DoDragDrop(IN LPDATAOBJECT pDataObj, IN LPDROPSOURCE pDropSource,
IN DWORD dwOKEffects, OUT LPDWORD pdwEffect){return S_OK;}
WINOLEAPI OleSetClipboard(IN LPDATAOBJECT pDataObj){return S_OK;}
WINOLEAPI OleGetClipboard(OUT LPDATAOBJECT FAR* ppDataObj){return S_OK;}
WINOLEAPI OleFlushClipboard(void){return S_OK;}
WINOLEAPI OleIsCurrentClipboard(IN LPDATAOBJECT pDataObj){return S_OK;}
WINOLEAPI_(HOLEMENU) OleCreateMenuDescriptor (IN HMENU hmenuCombined,
IN LPOLEMENUGROUPWIDTHS lpMenuWidths){return NULL;}
WINOLEAPI OleSetMenuDescriptor (IN HOLEMENU holemenu, IN HWND hwndFrame,
IN HWND hwndActiveObject,
IN LPOLEINPLACEFRAME lpFrame,
IN LPOLEINPLACEACTIVEOBJECT lpActiveObj){return S_OK;}
WINOLEAPI OleDestroyMenuDescriptor (IN HOLEMENU holemenu){return S_OK;}
WINOLEAPI OleTranslateAccelerator (IN LPOLEINPLACEFRAME lpFrame,
IN LPOLEINPLACEFRAMEINFO lpFrameInfo, IN LPMSG lpmsg){return S_OK;}
WINOLEAPI_(HANDLE) OleDuplicateData (IN HANDLE hSrc, IN CLIPFORMAT cfFormat,
IN UINT uiFlags){return NULL;}
WINOLEAPI OleDraw (IN LPUNKNOWN pUnknown, IN DWORD dwAspect, IN HDC hdcDraw,
IN LPCRECT lprcBounds){return S_OK;}
WINOLEAPI OleRun(IN LPUNKNOWN pUnknown){return S_OK;}
WINOLEAPI_(BOOL) OleIsRunning(IN LPOLEOBJECT pObject){return S_OK;}
WINOLEAPI OleLockRunning(IN LPUNKNOWN pUnknown, IN BOOL fLock, IN BOOL fLastUnlockCloses){return S_OK;}
WINOLEAPI_(void) ReleaseStgMedium(IN LPSTGMEDIUM){return;}
WINOLEAPI CreateOleAdviseHolder(OUT LPOLEADVISEHOLDER FAR* ppOAHolder){return S_OK;}
WINOLEAPI OleCreateDefaultHandler(IN REFCLSID clsid, IN LPUNKNOWN pUnkOuter,
IN REFIID riid, OUT LPVOID FAR* lplpObj){return S_OK;}
WINOLEAPI OleCreateEmbeddingHelper(IN REFCLSID clsid, IN LPUNKNOWN pUnkOuter,
IN DWORD flags, IN LPCLASSFACTORY pCF,
IN REFIID riid, OUT LPVOID FAR* lplpObj){return S_OK;}
WINOLEAPI_(BOOL) IsAccelerator(IN HACCEL hAccel, IN int cAccelEntries, IN LPMSG lpMsg,
OUT WORD FAR* lpwCmd){return S_OK;}
WINOLEAPI_(HGLOBAL) OleGetIconOfFile(IN LPOLESTR lpszPath, IN BOOL fUseFileAsLabel){return NULL;}
WINOLEAPI_(HGLOBAL) OleGetIconOfClass(IN REFCLSID rclsid, IN LPOLESTR lpszLabel,
IN BOOL fUseTypeAsLabel){return NULL;}
WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(IN HICON hIcon, IN LPOLESTR lpszLabel,
IN LPOLESTR lpszSourceFile, IN UINT iIconIndex){return NULL;}
WINOLEAPI OleRegGetUserType (IN REFCLSID clsid, IN DWORD dwFormOfType,
OUT LPOLESTR FAR* pszUserType){return S_OK;}
WINOLEAPI OleRegGetMiscStatus (IN REFCLSID clsid, IN DWORD dwAspect,
OUT DWORD FAR* pdwStatus){return S_OK;}
WINOLEAPI OleRegEnumFormatEtc (IN REFCLSID clsid, IN DWORD dwDirection,
OUT LPENUMFORMATETC FAR* ppenum){return S_OK;}
WINOLEAPI OleRegEnumVerbs (IN REFCLSID clsid, OUT LPENUMOLEVERB FAR* ppenum){return S_OK;}
// OLE 1.0
WINOLEAPI OleConvertOLESTREAMToIStorage
(IN LPOLESTREAM lpolestream,
OUT LPSTORAGE pstg,
IN const DVTARGETDEVICE FAR* ptd){return S_OK;}
WINOLEAPI OleConvertIStorageToOLESTREAM
(IN LPSTORAGE pstg,
OUT LPOLESTREAM lpolestream){return S_OK;}
WINOLEAPI GetHGlobalFromILockBytes (IN LPLOCKBYTES plkbyt, OUT HGLOBAL FAR* phglobal){return S_OK;}
WINOLEAPI CreateILockBytesOnHGlobal (IN HGLOBAL hGlobal, IN BOOL fDeleteOnRelease,
OUT LPLOCKBYTES FAR* pplkbyt){return S_OK;}
WINOLEAPI GetHGlobalFromStream (IN LPSTREAM pstm, OUT HGLOBAL FAR* phglobal){return S_OK;}
WINOLEAPI CreateStreamOnHGlobal (IN HGLOBAL hGlobal, IN BOOL fDeleteOnRelease,
OUT LPSTREAM FAR* ppstm){return S_OK;}
WINOLEAPI OleDoAutoConvert(IN LPSTORAGE pStg, OUT LPCLSID pClsidNew){return S_OK;}
WINOLEAPI OleGetAutoConvert(IN REFCLSID clsidOld, OUT LPCLSID pClsidNew){return S_OK;}
WINOLEAPI OleSetAutoConvert(IN REFCLSID clsidOld, IN REFCLSID clsidNew){return S_OK;}
WINOLEAPI GetConvertStg(IN LPSTORAGE pStg){return S_OK;}
WINOLEAPI SetConvertStg(IN LPSTORAGE pStg, IN BOOL fConvert){return S_OK;}
WINOLEAPI OleConvertIStorageToOLESTREAMEx
(IN LPSTORAGE pstg,
// Presentation data to OLESTREAM
IN CLIPFORMAT cfFormat, // format
IN LONG lWidth, // width
IN LONG lHeight, // height
IN DWORD dwSize, // size in bytes
IN LPSTGMEDIUM pmedium, // bits
OUT LPOLESTREAM polestm){return S_OK;}
WINOLEAPI OleConvertOLESTREAMToIStorageEx
(IN LPOLESTREAM polestm,
OUT LPSTORAGE pstg,
// Presentation data from OLESTREAM
OUT CLIPFORMAT FAR* pcfFormat, // format
OUT LONG FAR* plwWidth, // width
OUT LONG FAR* plHeight, // height
OUT DWORD FAR* pdwSize, // size in bytes
OUT LPSTGMEDIUM pmedium){return S_OK;} // bits*/

166
reactos/lib/ole32/storage.c Normal file
View file

@ -0,0 +1,166 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib\ole32\Storage.c
* PURPOSE: Storage helper functions
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 12/05/2001
*/
/********************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
********************************************************************/
#include "ole32.h"
/*WINOLEAPI StgCreatePropStg( IUnknown* pUnk, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg ){return S_OK;}
WINOLEAPI StgOpenPropStg( IUnknown* pUnk, REFFMTID fmtid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg ){return S_OK;}
WINOLEAPI StgCreatePropSetStg( IStorage *pStorage, DWORD dwReserved, IPropertySetStorage **ppPropSetStg){return S_OK;}
WINOLEAPI FmtIdToPropStgName( const FMTID *pfmtid, LPOLESTR oszName ){return S_OK;}
WINOLEAPI PropStgNameToFmtId( const LPOLESTR oszName, FMTID *pfmtid ){return S_OK;}
WINOLEAPI StgSetTimes(
WCHAR const *lpszName,
FILETIME const *pctime,
FILETIME const *patime,
FILETIME const *pmtime
){return S_OK;}
// helper functions
WINOLEAPI ReadClassStg(IN LPSTORAGE pStg, OUT CLSID FAR* pclsid){return S_OK;}
WINOLEAPI WriteClassStg(IN LPSTORAGE pStg, IN REFCLSID rclsid){return S_OK;}
WINOLEAPI ReadClassStm(IN LPSTREAM pStm, OUT CLSID FAR* pclsid){return S_OK;}
WINOLEAPI WriteClassStm(IN LPSTREAM pStm, IN REFCLSID rclsid){return S_OK;}
WINOLEAPI WriteFmtUserTypeStg (IN LPSTORAGE pstg, IN CLIPFORMAT cf, IN LPOLESTR lpszUserType){return S_OK;}
WINOLEAPI ReadFmtUserTypeStg (IN LPSTORAGE pstg, OUT CLIPFORMAT FAR* pcf, OUT LPOLESTR FAR* lplpszUserType){return S_OK;}
WINOLEAPI StgCreateDocfile(IN const OLECHAR FAR* pwcsName,
IN DWORD grfMode,
IN DWORD reserved,
OUT IStorage FAR * FAR *ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgCreateDocfileOnILockBytes(IN ILockBytes FAR *plkbyt,
IN DWORD grfMode,
IN DWORD reserved,
OUT IStorage FAR * FAR *ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgOpenStorage(IN const OLECHAR FAR* pwcsName,
IN IStorage FAR *pstgPriority,
IN DWORD grfMode,
IN SNB snbExclude,
IN DWORD reserved,
OUT IStorage FAR * FAR *ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgOpenStorageOnILockBytes(IN ILockBytes FAR *plkbyt,
IN IStorage FAR *pstgPriority,
IN DWORD grfMode,
IN SNB snbExclude,
IN DWORD reserved,
OUT IStorage FAR * FAR *ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgIsStorageFile(IN const OLECHAR FAR* pwcsName)
{
return S_OK;
}
WINOLEAPI StgIsStorageILockBytes(IN ILockBytes FAR* plkbyt)
{
return S_OK;
}
WINOLEAPI StgSetTimes(IN OLECHAR const FAR* lpszName,
IN FILETIME const FAR* pctime,
IN FILETIME const FAR* patime,
IN FILETIME const FAR* pmtime);
WINOLEAPI StgOpenAsyncDocfileOnIFillLockBytes( IN IFillLockBytes *pflb,
IN DWORD grfMode,
IN DWORD asyncFlags,
OUT IStorage **ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgGetIFillLockBytesOnILockBytes( IN ILockBytes *pilb,
OUT IFillLockBytes **ppflb)
{
return S_OK;
}
WINOLEAPI StgGetIFillLockBytesOnFile(IN OLECHAR const *pwcsName,
OUT IFillLockBytes **ppflb)
{
return S_OK;
}
WINOLEAPI StgOpenLayoutDocfile(IN OLECHAR const *pwcsDfName,
IN DWORD grfMode,
IN DWORD reserved,
OUT IStorage **ppstgOpen)
{
return S_OK;
}
WINOLEAPI StgCreateStorageEx (IN const WCHAR* pwcsName,
IN DWORD grfMode,
IN DWORD stgfmt, // enum
IN DWORD grfAttrs, // reserved
IN STGOPTIONS * pStgOptions,
IN void * reserved,
IN REFIID riid,
OUT void ** ppObjectOpen)
{
return S_OK;
}
WINOLEAPI StgOpenStorageEx (IN const WCHAR* pwcsName,
IN DWORD grfMode,
IN DWORD stgfmt, // enum
IN DWORD grfAttrs, // reserved
IN STGOPTIONS * pStgOptions,
IN void * reserved,
IN REFIID riid,
OUT void ** ppObjectOpen)
{
return S_OK;
}*/