Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
4.3 KiB

  1. // NCEvent.h
  2. #ifndef _NCEVENT_H
  3. #define _NCEVENT_H
  4. #ifdef ISP2PDLL
  5. //#define WMIAPI __declspec(dllexport) WINAPI
  6. #define WMIAPI WINAPI
  7. #else
  8. #define WMIAPI __declspec(dllimport) WINAPI
  9. #endif
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. typedef enum _tagEVENT_SOURCE_MSG
  14. {
  15. ESM_START_SENDING_EVENTS,
  16. ESM_STOP_SENDING_EVENTS,
  17. ESM_NEW_QUERY,
  18. ESM_CANCEL_QUERY,
  19. ESM_ACCESS_CHECK,
  20. } EVENT_SOURCE_MSG;
  21. typedef HRESULT (WINAPI *LPEVENT_SOURCE_CALLBACK)(HANDLE, EVENT_SOURCE_MSG, LPVOID, LPVOID);
  22. typedef struct _tagES_ACCESS_CHECK
  23. {
  24. LPCWSTR szQueryLanguage;
  25. LPCWSTR szQuery;
  26. DWORD dwSidLen;
  27. LPBYTE pSid;
  28. } ES_ACCESS_CHECK;
  29. typedef struct _tagES_NEW_QUERY
  30. {
  31. DWORD dwID;
  32. LPCWSTR szQueryLanguage;
  33. LPCWSTR szQuery;
  34. } ES_NEW_QUERY;
  35. typedef struct _tagES_CANCEL_QUERY
  36. {
  37. DWORD dwID;
  38. } ES_CANCEL_QUERY;
  39. typedef long CIMTYPE;
  40. // Flags for all Create functions
  41. #define WMI_CREATEOBJ_LOCKABLE 1
  42. // Flags for WmiSetAndCommit
  43. #define WMI_SENDCOMMIT_SET_NOT_REQUIRED 1
  44. #define WMI_USE_VA_LIST 2
  45. #ifndef __WbemClient_v1_LIBRARY_DEFINED__
  46. typedef /* [v1_enum] */
  47. enum tag_CIMTYPE_ENUMERATION
  48. { CIM_ILLEGAL = 0xfff,
  49. CIM_EMPTY = 0,
  50. CIM_SINT8 = 16,
  51. CIM_UINT8 = 17,
  52. CIM_SINT16 = 2,
  53. CIM_UINT16 = 18,
  54. CIM_SINT32 = 3,
  55. CIM_UINT32 = 19,
  56. CIM_SINT64 = 20,
  57. CIM_UINT64 = 21,
  58. CIM_REAL32 = 4,
  59. CIM_REAL64 = 5,
  60. CIM_BOOLEAN = 11,
  61. CIM_STRING = 8,
  62. CIM_DATETIME = 101,
  63. CIM_REFERENCE = 102,
  64. CIM_CHAR16 = 103,
  65. CIM_OBJECT = 13,
  66. CIM_IUNKNOWN = 104,
  67. CIM_FLAG_ARRAY = 0x2000
  68. } CIMTYPE_ENUMERATION;
  69. #endif
  70. // Register to send events
  71. HANDLE WMIAPI WmiEventSourceConnect(
  72. LPCWSTR szNamespace,
  73. LPCWSTR szProviderName,
  74. BOOL bBatchSend,
  75. DWORD dwBatchBufferSize,
  76. DWORD dwMaxSendLatency,
  77. LPVOID pUserData,
  78. LPEVENT_SOURCE_CALLBACK pCallback);
  79. HANDLE WMIAPI WmiCreateRestrictedConnection(
  80. HANDLE hSource,
  81. DWORD nQueries,
  82. LPCWSTR *szQueries,
  83. LPVOID pUserData,
  84. LPEVENT_SOURCE_CALLBACK pCallback);
  85. BOOL WMIAPI WmiSetConnectionSecurity(
  86. HANDLE hSource,
  87. SECURITY_DESCRIPTOR *pSD);
  88. void WMIAPI WmiEventSourceDisconnect(
  89. HANDLE hSource);
  90. HANDLE WMIAPI WmiCreateObject(
  91. HANDLE hSource,
  92. LPCWSTR szClassName,
  93. DWORD dwFlags);
  94. HANDLE WMIAPI WmiCreateObjectFromBuffer(
  95. HANDLE hSource,
  96. DWORD dwFlags,
  97. LPVOID pLayoutBuffer,
  98. DWORD dwLayoutSize,
  99. LPVOID pDataBuffer,
  100. DWORD dwDataSize);
  101. BOOL WMIAPI WmiCommitObject(
  102. HANDLE hObject);
  103. BOOL WMIAPI WmiResetObject(
  104. HANDLE hObject);
  105. BOOL WMIAPI WmiDestroyObject(
  106. HANDLE hObject);
  107. HANDLE WMIAPI WmiCreateObjectWithProps(
  108. HANDLE hSource,
  109. LPCWSTR szEventName,
  110. DWORD dwFlags,
  111. DWORD nPropertyCount,
  112. LPCWSTR *pszPropertyNames,
  113. CIMTYPE *pPropertyTypes);
  114. HANDLE WMIAPI WmiCreateObjectWithFormat(
  115. HANDLE hSource,
  116. LPCWSTR szEventName,
  117. DWORD dwFlags,
  118. LPCWSTR szFormat);
  119. HANDLE WMIAPI WmiCreateObjectPropSubset(
  120. HANDLE hObject,
  121. DWORD dwFlags,
  122. DWORD nPropertyCount,
  123. DWORD *pdwPropIndexes);
  124. BOOL WMIAPI WmiAddObjectProp(
  125. HANDLE hObject,
  126. LPCWSTR szPropertyName,
  127. CIMTYPE type,
  128. DWORD *pdwPropIndex);
  129. BOOL WMIAPI WmiSetObjectProp(
  130. HANDLE hObject,
  131. DWORD dwPropIndex,
  132. ...);
  133. BOOL WMIAPI WmiGetObjectProp(
  134. HANDLE hObject,
  135. DWORD dwPropIndex,
  136. LPVOID pData,
  137. DWORD dwBufferSize,
  138. DWORD *pdwBytesRead);
  139. BOOL WMIAPI WmiSetObjectPropNull(
  140. HANDLE hObject,
  141. DWORD dwPropIndex);
  142. BOOL WMIAPI WmiSetObjectProps(
  143. HANDLE hObject,
  144. ...);
  145. BOOL WMIAPI WmiSetAndCommitObject(
  146. HANDLE hObject,
  147. DWORD dwFlags,
  148. ...);
  149. BOOL WMIAPI WmiReportEvent(
  150. HANDLE hConnection,
  151. LPCWSTR szClassName,
  152. LPCWSTR szFormat,
  153. ...);
  154. BOOL WMIAPI WmiGetObjectBuffer(
  155. HANDLE hObject,
  156. LPVOID *ppLayoutBuffer,
  157. DWORD *pdwLayoutSize,
  158. LPVOID *ppDataBuffer,
  159. DWORD *pdwDataSize);
  160. BOOL WMIAPI WmiReportEventBlob(
  161. HANDLE hConnection,
  162. LPCWSTR szClassName,
  163. LPVOID pData,
  164. DWORD dwSize);
  165. void WMIAPI WmiLockObject(HANDLE hObject);
  166. void WMIAPI WmiUnlockObject(HANDLE hObject);
  167. HANDLE WMIAPI WmiDuplicateObject(
  168. HANDLE hOldObject,
  169. HANDLE hNewSource,
  170. DWORD dwFlags);
  171. BOOL WMIAPI WmiIsObjectActive(HANDLE hObject);
  172. BOOL WMIAPI WmiSetObjectSecurity(
  173. HANDLE hObject,
  174. SECURITY_DESCRIPTOR *pSD);
  175. #ifdef __cplusplus
  176. }
  177. #endif
  178. #endif