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
25 #define __WINE_INCLUDE_OBJIDL
27 #undef __WINE_INCLUDE_OBJIDL
30 /* For compatibility only, at least for now */
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))
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))
50 /*****************************************************************************
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 */
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
90 REGCLS_MULTIPLEUSE
= 1,
91 REGCLS_MULTI_SEPARATE
= 2,
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 /*****************************************************************************
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 /*****************************************************************************
126 HRESULT WINAPI
GetClassFile(LPCOLESTR filePathName
,CLSID
*pclsid
);
133 /* These macros are msdev's way of defining COM objects.
134 * They are provided here for use by Winelib developpers.
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
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
157 #define interface struct
158 #define STDMETHOD(method) HRESULT STDMETHODCALLTYPE (*method)
159 #define STDMETHOD_(type,method) type STDMETHODCALLTYPE (*method)
161 #define THIS_ INTERFACE FAR* This,
162 #define THIS INTERFACE FAR* This
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
174 #define DECLARE_INTERFACE(iface) \
175 typedef interface iface { struct iface##Vtbl FAR* lpVtbl; } iface; \
176 typedef struct iface##Vtbl iface##Vtbl; \
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_ */