rtworkq.idl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright 2020 Nikolay Sivov for CodeWeavers
  3. *
  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.
  8. *
  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.
  13. *
  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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "unknwn.idl";
  19. typedef enum
  20. {
  21. RTWQ_STANDARD_WORKQUEUE = 0,
  22. RTWQ_WINDOW_WORKQUEUE = 1,
  23. RTWQ_MULTITHREADED_WORKQUEUE = 2,
  24. } RTWQ_WORKQUEUE_TYPE;
  25. typedef unsigned __int64 RTWQWORKITEM_KEY;
  26. [
  27. object,
  28. uuid(ac6b7889-0740-4d51-8619-905994a55cc6),
  29. local
  30. ]
  31. interface IRtwqAsyncResult : IUnknown
  32. {
  33. HRESULT GetState([out] IUnknown **state);
  34. HRESULT GetStatus();
  35. HRESULT SetStatus([in] HRESULT status);
  36. HRESULT GetObject([out] IUnknown **object);
  37. IUnknown *GetStateNoAddRef();
  38. }
  39. [
  40. object,
  41. uuid(a27003cf-2354-4f2a-8d6a-ab7cff15437e),
  42. local
  43. ]
  44. interface IRtwqAsyncCallback : IUnknown
  45. {
  46. HRESULT GetParameters([out] DWORD *flags, [out] DWORD *queue);
  47. HRESULT Invoke([in] IRtwqAsyncResult *result);
  48. }
  49. [
  50. object,
  51. uuid(63d9255a-7ff1-4b61-8faf-ed6460dacf2b),
  52. local
  53. ]
  54. interface IRtwqPlatformEvents : IUnknown
  55. {
  56. HRESULT InitializationComplete(void);
  57. HRESULT ShutdownStart(void);
  58. HRESULT ShutdownComplete(void);
  59. }
  60. cpp_quote("#define RTWQ_E_ERROR(x) ((HRESULT)(0xc00d0000L+x))")
  61. cpp_quote("#define RTWQ_E_BUFFERTOOSMALL RTWQ_E_ERROR(14001)")
  62. cpp_quote("#define RTWQ_E_NOT_INITIALIZED RTWQ_E_ERROR(14006)")
  63. cpp_quote("#define RTWQ_E_UNEXPECTED RTWQ_E_ERROR(14011)")
  64. cpp_quote("#define RTWQ_E_NOT_FOUND RTWQ_E_ERROR(14037)")
  65. cpp_quote("#define RTWQ_E_OPERATION_CANCELLED RTWQ_E_ERROR(14061)")
  66. cpp_quote("#define RTWQ_E_INVALID_WORKQUEUE RTWQ_E_ERROR(14079)")
  67. cpp_quote("#define RTWQ_E_SHUTDOWN RTWQ_E_ERROR(16005)")
  68. cpp_quote("#ifdef __WINESRC__")
  69. cpp_quote("typedef struct tagRTWQASYNCRESULT")
  70. cpp_quote("{")
  71. cpp_quote(" IRtwqAsyncResult AsyncResult;")
  72. cpp_quote("#else")
  73. cpp_quote("typedef struct tagRTWQASYNCRESULT : public IRtwqAsyncResult {")
  74. cpp_quote("#endif")
  75. cpp_quote(" OVERLAPPED overlapped;")
  76. cpp_quote(" IRtwqAsyncCallback *pCallback;")
  77. cpp_quote(" HRESULT hrStatusResult;")
  78. cpp_quote(" DWORD dwBytesTransferred;")
  79. cpp_quote(" HANDLE hEvent;")
  80. cpp_quote("} RTWQASYNCRESULT;")
  81. cpp_quote("typedef void (WINAPI *RTWQPERIODICCALLBACK)(IUnknown *context);")
  82. cpp_quote("HRESULT WINAPI RtwqAddPeriodicCallback(RTWQPERIODICCALLBACK callback, IUnknown *context, DWORD *key);")
  83. cpp_quote("HRESULT WINAPI RtwqAllocateSerialWorkQueue(DWORD target_queue, DWORD *queue);")
  84. cpp_quote("HRESULT WINAPI RtwqAllocateWorkQueue(RTWQ_WORKQUEUE_TYPE queue_type, DWORD *queue);")
  85. cpp_quote("HRESULT WINAPI RtwqBeginRegisterWorkQueueWithMMCSS(DWORD queue, const WCHAR *mmcss_class, DWORD taskid, LONG priority, IRtwqAsyncCallback *callback, IUnknown *state);")
  86. cpp_quote("HRESULT WINAPI RtwqBeginUnregisterWorkQueueWithMMCSS(DWORD queue, IRtwqAsyncCallback *callback, IUnknown *state);")
  87. cpp_quote("HRESULT WINAPI RtwqCancelDeadline(HANDLE request);")
  88. cpp_quote("HRESULT WINAPI RtwqCancelWorkItem(RTWQWORKITEM_KEY key);")
  89. cpp_quote("HRESULT WINAPI RtwqCreateAsyncResult(IUnknown *object, IRtwqAsyncCallback *callback, IUnknown *state, IRtwqAsyncResult **result);")
  90. cpp_quote("HRESULT WINAPI RtwqEndRegisterWorkQueueWithMMCSS(IRtwqAsyncResult *result, DWORD *taskid);")
  91. cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSClass(DWORD queue, WCHAR *mmcss_class, DWORD *length);")
  92. cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSPriority(DWORD queue, LONG *priority);")
  93. cpp_quote("HRESULT WINAPI RtwqGetWorkQueueMMCSSTaskId(DWORD queue, DWORD *taskid);")
  94. cpp_quote("HRESULT WINAPI RtwqInvokeCallback(IRtwqAsyncResult *result);")
  95. cpp_quote("HRESULT WINAPI RtwqJoinWorkQueue(DWORD queue, HANDLE hFile, HANDLE *cookie);")
  96. cpp_quote("HRESULT WINAPI RtwqLockPlatform(void);")
  97. cpp_quote("HRESULT WINAPI RtwqLockSharedWorkQueue(const WCHAR *usageclass, LONG priority, DWORD *taskid, DWORD *queue);")
  98. cpp_quote("HRESULT WINAPI RtwqLockWorkQueue(DWORD queue);")
  99. cpp_quote("HRESULT WINAPI RtwqPutWaitingWorkItem(HANDLE event, LONG priority, IRtwqAsyncResult *result, RTWQWORKITEM_KEY *key);")
  100. cpp_quote("HRESULT WINAPI RtwqPutWorkItem(DWORD queue, LONG priority, IRtwqAsyncResult *result);")
  101. cpp_quote("HRESULT WINAPI RtwqRegisterPlatformEvents(IRtwqPlatformEvents *events);")
  102. cpp_quote("HRESULT WINAPI RtwqRegisterPlatformWithMMCSS(const WCHAR *mmcss_class, DWORD *taskid, LONG priority);")
  103. cpp_quote("HRESULT WINAPI RtwqRemovePeriodicCallback(DWORD key);")
  104. cpp_quote("HRESULT WINAPI RtwqScheduleWorkItem(IRtwqAsyncResult *result, INT64 timeout, RTWQWORKITEM_KEY *key);")
  105. cpp_quote("HRESULT WINAPI RtwqSetDeadline(DWORD queue_id, LONGLONG deadline, HANDLE *request);")
  106. cpp_quote("HRESULT WINAPI RtwqSetDeadline2(DWORD queue_id, LONGLONG deadline, LONGLONG predeadline, HANDLE *request);")
  107. cpp_quote("HRESULT WINAPI RtwqSetLongRunning(DWORD queue_id, WINBOOL enable);")
  108. cpp_quote("HRESULT WINAPI RtwqShutdown(void);")
  109. cpp_quote("HRESULT WINAPI RtwqStartup(void);")
  110. cpp_quote("HRESULT WINAPI RtwqUnjoinWorkQueue(DWORD queue, HANDLE cookie);")
  111. cpp_quote("HRESULT WINAPI RtwqUnlockPlatform(void);")
  112. cpp_quote("HRESULT WINAPI RtwqUnlockWorkQueue(DWORD queue);")
  113. cpp_quote("HRESULT WINAPI RtwqUnregisterPlatformEvents(IRtwqPlatformEvents *events);")
  114. cpp_quote("HRESULT WINAPI RtwqUnregisterPlatformFromMMCSS(void);")