Fixed some characters.
[wine/wine64.git] / include / objbase.h
blobd509f5409a848dd9b38c09afbbdc700564d347fd
1 /*
2 * Copyright (C) 1998 François Gouget
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "rpc.h"
20 #include "rpcndr.h"
22 #ifndef _OBJBASE_H_
23 #define _OBJBASE_H_
25 #define __WINE_INCLUDE_OBJIDL
26 #include "objidl.h"
27 #undef __WINE_INCLUDE_OBJIDL
29 #ifndef RC_INVOKED
30 /* For compatibility only, at least for now */
31 #include <stdlib.h>
32 #endif
34 #ifndef INITGUID
35 #include "cguid.h"
36 #endif
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
42 #ifndef NONAMELESSSTRUCT
43 #define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
44 #define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
45 #else
46 #define LISet32(li, v) ((li).s.HighPart = (v) < 0 ? -1 : 0, (li).s.LowPart = (v))
47 #define ULISet32(li, v) ((li).s.HighPart = 0, (li).s.LowPart = (v))
48 #endif
50 /*****************************************************************************
51 * Standard API
53 HRESULT WINAPI CoCreateGuid(GUID* pguid);
55 HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
57 void WINAPI CoFreeAllLibraries(void);
59 void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
61 void WINAPI CoFreeUnusedLibraries(void);
63 HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
65 HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
67 HRESULT WINAPI CoInitialize(LPVOID lpReserved);
68 HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
70 void WINAPI CoUninitialize(void);
72 typedef enum tagCOINIT
74 COINIT_APARTMENTTHREADED = 0x2, /* Apartment model */
75 COINIT_MULTITHREADED = 0x0, /* OLE calls objects on any thread */
76 COINIT_DISABLE_OLE1DDE = 0x4, /* Don't use DDE for Ole1 support */
77 COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */
78 } COINIT;
81 /* FIXME: not implemented */
82 BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
84 HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
86 /* class registration flags; passed to CoRegisterClassObject */
87 typedef enum tagREGCLS
89 REGCLS_SINGLEUSE = 0,
90 REGCLS_MULTIPLEUSE = 1,
91 REGCLS_MULTI_SEPARATE = 2,
92 REGCLS_SUSPENDED = 4
93 } REGCLS;
95 HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
97 HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
99 HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
101 /*****************************************************************************
102 * GUID API
104 HRESULT WINAPI StringFromCLSID16(REFCLSID id, LPOLESTR16*);
105 HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
107 HRESULT WINAPI CLSIDFromString16(LPCOLESTR16, CLSID *);
108 HRESULT WINAPI CLSIDFromString(LPCOLESTR, CLSID *);
110 HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid);
111 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
113 HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
115 INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
117 /*****************************************************************************
118 * COM Server dll - exports
120 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
121 HRESULT WINAPI DllCanUnloadNow(void);
123 /*****************************************************************************
124 * Moniker API
126 HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid);
128 #ifdef __cplusplus
130 #endif
132 #ifndef __WINE__
133 /* These macros are msdev's way of defining COM objects.
134 * They are provided here for use by Winelib developpers.
136 #define FARSTRUCT
137 #define HUGEP
139 #define WINOLEAPI STDAPI
140 #define WINOLEAPI_(type) STDAPI_(type)
142 #if defined(__cplusplus) && !defined(CINTERFACE)
143 #define interface struct
144 #define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
145 #define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
146 #define PURE = 0
147 #define THIS_
148 #define THIS void
149 #define DECLARE_INTERFACE(iface) interface iface
150 #define DECLARE_INTERFACE_(iface, baseiface) interface iface : public baseiface
152 #define BEGIN_INTERFACE
153 #define END_INTERFACE
155 #else
157 #define interface struct
158 #define STDMETHOD(method) HRESULT STDMETHODCALLTYPE (*method)
159 #define STDMETHOD_(type,method) type STDMETHODCALLTYPE (*method)
160 #define PURE
161 #define THIS_ INTERFACE FAR* This,
162 #define THIS INTERFACE FAR* This
164 #ifdef CONST_VTABLE
165 #undef CONST_VTBL
166 #define CONST_VTBL const
167 #define DECLARE_INTERFACE(iface) \
168 typedef interface iface { const struct iface##Vtbl FAR* lpVtbl; } iface; \
169 typedef const struct iface##Vtbl iface##Vtbl; \
170 const struct iface##Vtbl
171 #else
172 #undef CONST_VTBL
173 #define CONST_VTBL
174 #define DECLARE_INTERFACE(iface) \
175 typedef interface iface { struct iface##Vtbl FAR* lpVtbl; } iface; \
176 typedef struct iface##Vtbl iface##Vtbl; \
177 struct iface##Vtbl
178 #endif
179 #define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE(iface)
181 #define BEGIN_INTERFACE
182 #define END_INTERFACE
184 #endif /* __cplusplus && !CINTERFACE */
186 #endif /* __WINE__ */
188 #endif /* _OBJBASE_H_ */