unknwn.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. //
  5. //
  6. // ===========================================================================
  7. // File: unknwn.h
  8. //
  9. // ===========================================================================
  10. // simplified unknwn.h for PAL
  11. #include "rpc.h"
  12. #include "rpcndr.h"
  13. #include <initguid.h>
  14. #ifndef __IUnknown_INTERFACE_DEFINED__
  15. #define __IUnknown_INTERFACE_DEFINED__
  16. typedef interface IUnknown IUnknown;
  17. typedef /* [unique] */ IUnknown *LPUNKNOWN;
  18. // 00000000-0000-0000-C000-000000000046
  19. DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
  20. MIDL_INTERFACE("00000000-0000-0000-C000-000000000046")
  21. IUnknown
  22. {
  23. virtual HRESULT STDMETHODCALLTYPE QueryInterface(
  24. REFIID riid,
  25. void **ppvObject) = 0;
  26. virtual ULONG STDMETHODCALLTYPE AddRef( void) = 0;
  27. virtual ULONG STDMETHODCALLTYPE Release( void) = 0;
  28. template<class Q>
  29. HRESULT
  30. STDMETHODCALLTYPE
  31. QueryInterface(Q** pp)
  32. {
  33. return QueryInterface(__uuidof(Q), (void **)pp);
  34. }
  35. };
  36. #endif // __IUnknown_INTERFACE_DEFINED__
  37. #ifndef __IClassFactory_INTERFACE_DEFINED__
  38. #define __IClassFactory_INTERFACE_DEFINED__
  39. // 00000001-0000-0000-C000-000000000046
  40. EXTERN_C const IID IID_IClassFactory;
  41. MIDL_INTERFACE("00000001-0000-0000-C000-000000000046")
  42. IClassFactory : public IUnknown
  43. {
  44. virtual HRESULT STDMETHODCALLTYPE CreateInstance(
  45. IUnknown *pUnkOuter,
  46. REFIID riid,
  47. void **ppvObject) = 0;
  48. virtual HRESULT STDMETHODCALLTYPE LockServer(
  49. BOOL fLock) = 0;
  50. };
  51. #endif // __IClassFactory_INTERFACE_DEFINED__