Added header files for ole32.dll COM implementation

svn path=/trunk/; revision=1908
This commit is contained in:
Jurgen van Gael 2001-05-15 11:53:23 +00:00
parent afdf923c65
commit 48da1fcf14
5 changed files with 340 additions and 145 deletions

View file

@ -1,131 +1,36 @@
/*
basetyps.h
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: include\ole32\basetyps.h
* PURPOSE: Base type and interface macros
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 05/01/2001
*/
/********************************************************************
definitions for basic types used to develop COM
macro definitions for interface declaration
Copyright (C) 1996 Free Software Foundation, Inc.
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.
Author: Jurgen Van Gael <jurgen.vangael@student.kuleuven.ac.be>
Date: january 2001
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.
This file is part of the Windows32 API Library.
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.
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.
If you are interested in a warranty or support for this source code,
contact Scott Christley <scottc@net-community.com> for more information.
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,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
********************************************************************/
#ifndef _BASETYPS
#define _BASETYPS
#ifndef EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif
#endif
#ifndef _ERROR_STATUS_T_DEFINED
typedef unsigned long error_status_t;
#define _ERROR_STATUS_T_DEFINED
#endif
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#define STDMETHODCALLTYPE __stdcall
#define STDMETHODVCALLTYPE __cdecl
#define STDAPICALLTYPE __stdcall
#define STDAPIVCALLTYPE __cdecl
#define STDAPI EXTERN_C HRESULT STDMETHODCALLTYPE
#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
// variable argument lists versions
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
/************************* interface declaration **********************************
*
* Here are some macros you can use to define interfaces. These macro's are
* usefull because they declare an interface for a c++ implementation or a
* a c implementation. The c interface will be made when the user compiles a
* .c file. The c++ interface will be declared when a .cpp file is compiled.
*
* use DECLARE_INTERFACE(iface) when the interface does not derive from another
* use DECLARE_INTERFACE_(iface, baseiface) when the interface derives from another
* interface
*/
#if defined(__cplusplus) && !defined(CINTERFACE)
// define the c++ macros
#define interface struct
#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
#define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
#define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
#define PURE = 0
#define THIS_
#define THIS void
#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
#else
// define the c macros
#define interface struct
#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE* method)
#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE* method)
#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE* method)
#define STDMETHODV_(type,method)type (STDMETHODVCALLTYPE* method)
#define PURE
#define THIS_ INTERFACE FAR* This,
#define THIS INTERFACE FAR* This
#ifdef CONST_VTABLE
#define DECLARE_INTERFACE(iface) typedef interface iface { \
const struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef const struct iface##Vtbl iface##Vtbl; \
const struct iface##Vtbl
#else
#define DECLARE_INTERFACE(iface) typedef interface iface { \
struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef struct iface##Vtbl iface##Vtbl; \
struct iface##Vtbl
#endif
#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE(iface)
#endif
#include <ole32\objbase.h>
#endif

View file

@ -1,33 +1,32 @@
/*
guiddef.h
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: include\ole32\guiddef.h
* PURPOSE: Guid definition macros
* PROGRAMMER: jurgen van gael [jurgen.vangael@student.kuleuven.ac.be]
* UPDATE HISTORY:
* Created 05/01/2001
*/
/********************************************************************
guid declaration
Copyright (C) 1996 Free Software Foundation, Inc.
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.
Author: Jurgen Van Gael <jurgen.vangael@student.kuleuven.ac.be>
Date: january 2001
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.
This file is part of the Windows32 API Library.
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.
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.
If you are interested in a warranty or support for this source code,
contact Scott Christley <scottc@net-community.com> for more information.
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,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
********************************************************************/
#ifndef _GUIDDEF_H
#define _GUIDDEF_H
@ -64,10 +63,10 @@
#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
const GUID name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID name
const GUID name
#endif
#define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)

View file

@ -0,0 +1,196 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: include\ole32\objbase.h
* PURPOSE: Header file for the ole32.dll 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.
********************************************************************/
#ifndef _OBJBASE
#define _OBJBASE
#include <ole32\guiddef.h>
#ifndef EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif
#endif
#define STDMETHODCALLTYPE __stdcall
#define STDMETHODVCALLTYPE __cdecl
#define STDAPICALLTYPE __stdcall
#define STDAPIVCALLTYPE __cdecl
#define STDAPI EXTERN_C HRESULT STDMETHODCALLTYPE
#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
// variable argument lists versions
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
#ifndef WINOLEAPI
#define WINOLEAPI STDAPI
#define WINOLEAPI_(type) STDAPI_(type)
#endif
// context in which to create COM objects
typedef enum tagCLSCTX
{
CLSCTX_INPROC_SERVER = 0x1,
CLSCTX_INPROC_HANDLER = 0x2,
CLSCTX_LOCAL_SERVER = 0x4,
CLSCTX_INPROC_SERVER16 = 0x8,
CLSCTX_REMOTE_SERVER = 0x10,
CLSCTX_INPROC_HANDLER16 = 0x20,
CLSCTX_INPROC_SERVERX86 = 0x40,
CLSCTX_INPROC_HANDLERX86= 0x80,
CLSCTX_ESERVER_HANDLER = 0x100,
CLSCTX_RESERVED = 0x200,
CLSCTX_NO_CODE_DOWNLOAD = 0x400,
CLSCTX_NO_WX86_TRANSLATION = 0x800,
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
CLSCTX_NO_FAILURE_LOG = 0x4000
}CLSCTX;
#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER)
// COM initialization flags, passed to CoInitialize.
typedef enum tagCOINIT
{
COINIT_APARTMENTTHREADED = 0x2, // apartement threaded model
COINIT_MULTITHREADED = 0x0, // OLE calls objects on any thread
COINIT_DISABLE_OLE1DDE = 0x4, // don't use DDE for Ole1 support
COINIT_SPEED_OVER_MEMORY = 0x8, // trade memory for speed*/
}COINIT;
//
// COM interface declaration macros [from the wine implementation
//
// These macros declare interfaces for both C and C++ depending for what
// language you are compiling
//
// DECLARE_INTERFACE(iface): declare not derived interface
// DECLARE_INTERFACE(iface, baseiface): declare derived interface
//
// Use CINTERFACE if you want to force a c style interface declaration,
// else, the compiler will look at the source file extension
//
#if defined(__cplusplus) && !defined(CINTERFACE)
// define the c++ macros
#define interface struct
#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
#define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
#define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
#define PURE = 0
#define THIS_
#define THIS
#define DECLARE_INTERFACE(iface) interface iface
#define DECLARE_INTERFACE_(iface, baseiface) interface iface : public baseiface
#else
// define the c macros
#define interface struct
#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE* method)
#define STDMETHOD_(type,method) type (STDMETHODCALLTYPE* method)
#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE* method)
#define STDMETHODV_(type,method)type (STDMETHODVCALLTYPE* method)
#define PURE
#define THIS_ INTERFACE FAR* This,
#define THIS INTERFACE FAR* This
#ifdef CONST_VTABLE
#define DECLARE_INTERFACE(iface) typedef interface iface { \
const struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef const struct iface##Vtbl iface##Vtbl; \
const struct iface##Vtbl
#else
#define DECLARE_INTERFACE(iface) typedef interface iface { \
struct iface##Vtbl FAR* lpVtbl; \
} iface; \
typedef struct iface##Vtbl iface##Vtbl; \
struct iface##Vtbl
#endif
#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE(iface)
#endif
DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
DEFINE_OLEGUID(IID_IClassFactory, 0x00000001L, 0, 0);
// IUnknown
//
DECLARE_INTERFACE(IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, VOID* FAR* ppUnk) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
};
// IClassFactory
//
DECLARE_INTERFACE_(IClassFactory, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID iid, VOID* FAR* ppvObject) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IClassFactory methods ***
STDMETHOD(CreateInstance) (THIS_ IUnknown* pUnkOuter, REFIID riid, VOID* FAR* ppvObject) PURE;
STDMETHOD(LockServer) (THIS_ BOOL fLock) PURE;
};
//
// COM API definition
//
WINOLEAPI_(VOID) CoUninitialize();
WINOLEAPI_(VOID) CoFreeAllLibraries();
WINOLEAPI_(DWORD) CoBuildVersion();
WINOLEAPI CoCreateInstance(REFCLSID rclsid, IUnknown* pUnkOuter, DWORD dwClsContext, REFIID riid, VOID** ppv);
WINOLEAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, VOID* pvReserved, REFIID riid, VOID** ppv);
WINOLEAPI CoInitializeEx(VOID* lpReserved, DWORD dwCoInit);
WINOLEAPI CoInitialize(VOID* lpReserved);
#endif

View file

@ -0,0 +1,37 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: include\ole32\unknwn.h
* PURPOSE: Defines IUnknown and IClassFactory interface
* 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 _UNKNWN_H
#define _UNKNWN_H
#include <ole32\objbase.h>
#endif

View file

@ -0,0 +1,58 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: include\ole32\winerror.h
* PURPOSE: Defines windows error codes
* 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 _WINERROR_H
#define _WINERROR_H
//
// Return Code macros
//
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
#define FAILED(Status) ((HRESULT)(Status)<0)
//
// Success Codes
//
#define S_OK 0x00000000L
#define S_FALSE 0x00000001L
//
// Error Codes
//
#define E_NOINTERFACE 0x80000004L
#define E_POINTER 0x80004003L
#define E_FAIL 0x80004005L
#define E_UNEXPECTED 0x8000FFFFL
#define CLASS_E_NOAGGREGATION 0x80040110L
#define CLASS_E_CLASSNOTAVAILABLE 0x80040111L
#define E_OUTOFMEMORY 0x8007000EL
#define E_INVALIDARG 0x80070057L
#endif