home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 April / PCWorld_2008-04_cd.bin / temacd / devc++ / devcpp-4.9.9.2_setup.exe / objbase.h < prev    next >
C/C++ Source or Header  |  2005-01-29  |  9KB  |  205 lines

  1. /* Include here to prevent circular dependencies if windows.h
  2.    not already included */
  3. #include <rpc.h>
  4. #include <rpcndr.h>
  5.  
  6. #ifndef _OBJBASE_H
  7. #define _OBJBASE_H
  8. #define _OBJBASE_H_
  9. #if __GNUC__ >=3
  10. #pragma GCC system_header
  11. #endif
  12.  
  13. #include <stdlib.h>
  14. #pragma pack(push,8)
  15. #include <basetyps.h>
  16.  
  17. #define WINOLEAPI STDAPI
  18. #define WINOLEAPI_(type) STDAPI_(type)
  19. #define FARSTRUCT
  20. #define HUGEP
  21. #define LISet32(li,v) ((li).HighPart=(v)<0?-1:0,(li).LowPart=(v))
  22. #define ULISet32(li,v) ((li).HighPart=0,(li).LowPart=(v))
  23. #define CLSCTX_ALL (CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER|CLSCTX_LOCAL_SERVER)
  24. #define CLSCTX_INPROC (CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER)
  25. #define CLSCTX_SERVER (CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER)
  26. #define MARSHALINTERFACE_MIN 500
  27. #define CWCSTORAGENAME 32
  28. #define STGM_DIRECT 0
  29. #define STGM_TRANSACTED 0x10000L
  30. #define STGM_SIMPLE 0x8000000L
  31. #define STGM_READ 0
  32. #define STGM_WRITE 1
  33. #define STGM_READWRITE 2
  34. #define STGM_SHARE_DENY_NONE 0x40
  35. #define STGM_SHARE_DENY_READ 0x30
  36. #define STGM_SHARE_DENY_WRITE 0x20
  37. #define STGM_SHARE_EXCLUSIVE 0x10
  38. #define STGM_PRIORITY 0x40000L
  39. #define STGM_DELETEONRELEASE 0x4000000
  40. #define STGM_NOSCRATCH 0x100000
  41. #define STGM_CREATE 0x1000
  42. #define STGM_CONVERT 0x20000
  43. #define STGM_NOSNAPSHOT 0x200000
  44. #define STGM_FAILIFTHERE 0
  45. #define CWCSTORAGENAME 32
  46. #define ASYNC_MODE_COMPATIBILITY    1
  47. #define ASYNC_MODE_DEFAULT    0
  48. #define STGTY_REPEAT    256
  49. #define STG_TOEND    0xFFFFFFFF
  50. #define STG_LAYOUT_SEQUENTIAL    0
  51. #define STG_LAYOUT_INTERLEAVED    1
  52. #define COM_RIGHTS_EXECUTE 1
  53. #define COM_RIGHTS_SAFE_FOR_SCRIPTING 2
  54. #define STGOPTIONS_VERSION 2
  55. typedef enum tagSTGFMT {
  56.     STGFMT_STORAGE = 0, 
  57.     STGFMT_FILE = 3, 
  58.     STGFMT_ANY = 4, 
  59.     STGFMT_DOCFILE = 5
  60. } STGFMT;
  61. typedef struct tagSTGOPTIONS {
  62.     USHORT usVersion;
  63.     USHORT reserved;
  64.     ULONG ulSectorSize;
  65.     const WCHAR *pwcsTemplateFile;
  66. } STGOPTIONS;
  67. typedef enum tagREGCLS {
  68.     REGCLS_SINGLEUSE = 0,
  69.     REGCLS_MULTIPLEUSE = 1,
  70.     REGCLS_MULTI_SEPARATE = 2
  71. } REGCLS;
  72. #include <wtypes.h>
  73. #include <unknwn.h>
  74. #include <objidl.h>
  75.  
  76. #ifdef __cplusplus
  77. inline BOOL IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
  78.     { return !memcmp(&rguid1, &rguid2, sizeof(GUID)); }
  79. inline BOOL operator==(const GUID& guidOne, const GUID& guidOther)
  80.     { return !memcmp(&guidOne,&guidOther,sizeof(GUID)); }
  81. inline BOOL operator!=(const GUID& g1, const GUID& g2)
  82.     { return !(g1 == g2); }
  83. #else
  84. #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
  85. #endif
  86. #define IsEqualIID(id1,id2) IsEqualGUID(id1,id2)
  87. #define IsEqualCLSID(id1,id2) IsEqualGUID(id1,id2)
  88. #include <cguid.h>
  89.  
  90. typedef enum tagCOINIT {
  91.     COINIT_APARTMENTTHREADED    = 0x2,
  92.     COINIT_MULTITHREADED        = 0x0,
  93.     COINIT_DISABLE_OLE1DDE        = 0x4,
  94.     COINIT_SPEED_OVER_MEMORY    = 0x8
  95. } COINIT;
  96. typedef enum tagSTDMSHLFLAGS {
  97.     SMEXF_SERVER  = 0x01,
  98.     SMEXF_HANDLER = 0x02
  99. } STDMSHLFLAGS;
  100.  
  101. WINOLEAPI_(DWORD) CoBuildVersion(void);
  102. WINOLEAPI CoInitialize(PVOID);
  103. WINOLEAPI CoInitializeEx(LPVOID,DWORD);
  104. WINOLEAPI_(void) CoUninitialize(void);
  105. WINOLEAPI CoGetMalloc(DWORD,LPMALLOC*);
  106. WINOLEAPI_(DWORD) CoGetCurrentProcess(void);
  107. WINOLEAPI CoRegisterMallocSpy(LPMALLOCSPY);
  108. WINOLEAPI CoRevokeMallocSpy(void);
  109. WINOLEAPI CoCreateStandardMalloc(DWORD,IMalloc**);
  110. #ifdef DBG
  111. WINOLEAPI_(ULONG) DebugCoGetRpcFault(void);
  112. WINOLEAPI_(void) DebugCoSetRpcFault(ULONG);
  113. #endif
  114. WINOLEAPI CoGetClassObject(REFCLSID,DWORD,COSERVERINFO*,REFIID,PVOID*);
  115. WINOLEAPI CoRegisterClassObject(REFCLSID,LPUNKNOWN,DWORD,DWORD,PDWORD);
  116. WINOLEAPI CoRevokeClassObject(DWORD);
  117. WINOLEAPI CoGetMarshalSizeMax(ULONG*,REFIID,LPUNKNOWN,DWORD,PVOID,DWORD);
  118. WINOLEAPI CoMarshalInterface(LPSTREAM,REFIID,LPUNKNOWN,DWORD,PVOID,DWORD);
  119. WINOLEAPI CoUnmarshalInterface(LPSTREAM,REFIID,PVOID*);
  120. WINOLEAPI CoMarshalHresult(LPSTREAM,HRESULT);
  121. WINOLEAPI CoUnmarshalHresult(LPSTREAM,HRESULT*);
  122. WINOLEAPI CoReleaseMarshalData(LPSTREAM);
  123. WINOLEAPI CoDisconnectObject(LPUNKNOWN,DWORD);
  124. WINOLEAPI CoLockObjectExternal(LPUNKNOWN,BOOL,BOOL);
  125. WINOLEAPI CoGetStandardMarshal(REFIID,LPUNKNOWN,DWORD,PVOID,DWORD,LPMARSHAL*);
  126. WINOLEAPI CoGetStdMarshalEx(LPUNKNOWN,DWORD,LPUNKNOWN*);
  127. WINOLEAPI_(BOOL) CoIsHandlerConnected(LPUNKNOWN);
  128. WINOLEAPI_(BOOL) CoHasStrongExternalConnections(LPUNKNOWN);
  129. WINOLEAPI CoMarshalInterThreadInterfaceInStream(REFIID,LPUNKNOWN,LPSTREAM*);
  130. WINOLEAPI CoGetInterfaceAndReleaseStream(LPSTREAM,REFIID,PVOID*);
  131. WINOLEAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN,LPUNKNOWN*);
  132. WINOLEAPI_(HINSTANCE) CoLoadLibrary(LPOLESTR,BOOL);
  133. WINOLEAPI_(void) CoFreeLibrary(HINSTANCE);
  134. WINOLEAPI_(void) CoFreeAllLibraries(void);
  135. WINOLEAPI_(void) CoFreeUnusedLibraries(void);
  136. WINOLEAPI CoCreateInstance(REFCLSID,LPUNKNOWN,DWORD,REFIID,PVOID*);
  137. WINOLEAPI CoCreateInstanceEx(REFCLSID,IUnknown*,DWORD,COSERVERINFO*,DWORD,MULTI_QI*);
  138. WINOLEAPI StringFromCLSID(REFCLSID,LPOLESTR*);
  139. WINOLEAPI CLSIDFromString(LPOLESTR,LPCLSID);
  140. WINOLEAPI StringFromIID(REFIID,LPOLESTR*);
  141. WINOLEAPI IIDFromString(LPOLESTR,LPIID);
  142. WINOLEAPI_(BOOL) CoIsOle1Class(REFCLSID);
  143. WINOLEAPI ProgIDFromCLSID(REFCLSID,LPOLESTR*);
  144. WINOLEAPI CLSIDFromProgID(LPCOLESTR,LPCLSID);
  145. WINOLEAPI_(int) StringFromGUID2(REFGUID,LPOLESTR,int);
  146. WINOLEAPI CoCreateGuid(GUID*);
  147. WINOLEAPI_(BOOL) CoFileTimeToDosDateTime(FILETIME*,LPWORD,LPWORD);
  148. WINOLEAPI_(BOOL) CoDosDateTimeToFileTime(WORD,WORD,FILETIME*);
  149. WINOLEAPI CoFileTimeNow(FILETIME*);
  150. WINOLEAPI CoRegisterMessageFilter(LPMESSAGEFILTER,LPMESSAGEFILTER*);
  151. WINOLEAPI CoGetTreatAsClass(REFCLSID,LPCLSID);
  152. WINOLEAPI CoTreatAsClass(REFCLSID,REFCLSID);
  153. typedef HRESULT (STDAPICALLTYPE *LPFNGETCLASSOBJECT)(REFCLSID,REFIID,PVOID*);
  154. typedef HRESULT (STDAPICALLTYPE *LPFNCANUNLOADNOW)(void);
  155. STDAPI DllGetClassObject(REFCLSID,REFIID,PVOID*);
  156. STDAPI DllCanUnloadNow(void);
  157. WINOLEAPI_(PVOID) CoTaskMemAlloc(ULONG);
  158. WINOLEAPI_(PVOID) CoTaskMemRealloc(PVOID,ULONG);
  159. WINOLEAPI_(void) CoTaskMemFree(PVOID);
  160. WINOLEAPI CreateDataAdviseHolder(LPDATAADVISEHOLDER*);
  161. WINOLEAPI CreateDataCache(LPUNKNOWN,REFCLSID,REFIID,PVOID*);
  162. WINOLEAPI StgCreateDocfile(const OLECHAR*,DWORD,DWORD,IStorage**);
  163. WINOLEAPI StgCreateDocfileOnILockBytes(ILockBytes*,DWORD,DWORD,IStorage**);
  164. WINOLEAPI StgOpenStorage(const OLECHAR*,IStorage*,DWORD,SNB,DWORD,IStorage**);
  165. WINOLEAPI StgOpenStorageOnILockBytes(ILockBytes*,IStorage*,DWORD,SNB,DWORD,IStorage**);
  166. WINOLEAPI StgIsStorageFile(const OLECHAR*);
  167. WINOLEAPI StgIsStorageILockBytes(ILockBytes*);
  168. WINOLEAPI StgSetTimes(OLECHAR const*,FILETIME const*,FILETIME const*,FILETIME const*);
  169. WINOLEAPI StgCreateStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
  170. WINOLEAPI StgOpenStorageEx(const WCHAR*,DWORD,DWORD,DWORD,STGOPTIONS*,void*,REFIID,void**);
  171. WINOLEAPI BindMoniker(LPMONIKER,DWORD,REFIID,PVOID*);
  172. WINOLEAPI CoGetObject(LPCWSTR,BIND_OPTS*,REFIID,void**);
  173. WINOLEAPI MkParseDisplayName(LPBC,LPCOLESTR,ULONG*,LPMONIKER*);
  174. WINOLEAPI MonikerRelativePathTo(LPMONIKER,LPMONIKER,LPMONIKER*,BOOL);
  175. WINOLEAPI MonikerCommonPrefixWith(LPMONIKER,LPMONIKER,LPMONIKER*);
  176. WINOLEAPI CreateBindCtx(DWORD,LPBC*);
  177. WINOLEAPI CreateGenericComposite(LPMONIKER,LPMONIKER,LPMONIKER*);
  178. WINOLEAPI GetClassFile (LPCOLESTR,CLSID*);
  179. WINOLEAPI CreateFileMoniker(LPCOLESTR,LPMONIKER*);
  180. WINOLEAPI CreateItemMoniker(LPCOLESTR,LPCOLESTR,LPMONIKER*);
  181. WINOLEAPI CreateAntiMoniker(LPMONIKER*);
  182. WINOLEAPI CreatePointerMoniker(LPUNKNOWN,LPMONIKER*);
  183. WINOLEAPI GetRunningObjectTable(DWORD,LPRUNNINGOBJECTTABLE*);
  184. WINOLEAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR,LONG,SOLE_AUTHENTICATION_SERVICE*, void*,DWORD,DWORD,void*,DWORD,void*);
  185. WINOLEAPI CoGetCallContext(REFIID,void**);
  186. WINOLEAPI CoQueryProxyBlanket(IUnknown*, DWORD*,DWORD*,OLECHAR**,DWORD*,DWORD*,RPC_AUTH_IDENTITY_HANDLE*,DWORD*);
  187. WINOLEAPI CoSetProxyBlanket(IUnknown*,DWORD,DWORD,OLECHAR*,DWORD,DWORD,RPC_AUTH_IDENTITY_HANDLE, DWORD);
  188. WINOLEAPI CoCopyProxy(IUnknown*,IUnknown**);
  189. WINOLEAPI CoQueryClientBlanket(DWORD*,DWORD*,OLECHAR**, DWORD*,DWORD*,RPC_AUTHZ_HANDLE*,DWORD*);
  190. WINOLEAPI CoImpersonateClient(void);
  191. WINOLEAPI CoRevertToSelf(void);
  192. WINOLEAPI CoQueryAuthenticationServices(DWORD*, SOLE_AUTHENTICATION_SERVICE**);
  193. WINOLEAPI CoSwitchCallContext(IUnknown*,IUnknown**);
  194. WINOLEAPI CoGetInstanceFromFile(COSERVERINFO*, CLSID*,IUnknown*,DWORD,DWORD,OLECHAR*,DWORD,MULTI_QI*);
  195. WINOLEAPI CoGetInstanceFromIStorage(COSERVERINFO*,CLSID*, IUnknown*,DWORD,struct IStorage*, DWORD,MULTI_QI*);
  196. WINOLEAPI_(ULONG) CoAddRefServerProcess(void);
  197. WINOLEAPI_(ULONG) CoReleaseServerProcess(void);
  198. WINOLEAPI CoResumeClassObjects(void);
  199. WINOLEAPI CoSuspendClassObjects(void);
  200. WINOLEAPI CoGetPSClsid(REFIID,CLSID*);
  201. WINOLEAPI CoRegisterPSClsid(REFIID,REFCLSID);
  202.  
  203. #pragma pack(pop)
  204. #endif
  205.