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.

479 lines
11 KiB

  1. //--------------------------------------------------------------------------
  2. //
  3. // Module Name: ULSAPI.H
  4. //
  5. // Brief Description:
  6. // This module contains declarations for all COM style APIs
  7. // of ULS Client.
  8. //
  9. // Author: Chu, Lon-Chan (lonchanc)
  10. //
  11. // Copyright (c) 1996 Microsoft Corporation
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef _ULSAPI_H_
  15. #define _ULSAPI_H_
  16. #include <winnt.h>
  17. #include <basetyps.h> // IUnknown & IClassFactory
  18. #include <mapidefs.h>
  19. #include "ulserror.h"
  20. #include "ulstags.h"
  21. #include "ulp.h"
  22. #ifdef IN
  23. #undef IN
  24. #endif
  25. #define IN
  26. #ifdef OUT
  27. #undef OUT
  28. #endif
  29. #define OUT
  30. // client specific definitions. (in between stub and service)
  31. #define CLIENT_MESSAGE_ID_LOGON 1
  32. #define CLIENT_MESSAGE_ID_LOGOFF 2
  33. #define CLIENT_MESSAGE_ID_RESOLVE 3
  34. #define CLIENT_MESSAGE_ID_DIRECTORY 4
  35. #define CLIENT_MESSAGE_ID_KEEPALIVE 5
  36. // define ULS Client version
  37. #ifndef ULS_VERSION
  38. #define ULS_VERSION MAKELONG (1, 1) // version 1.1
  39. #endif
  40. #define ULS_MAX_GUID_LENGTH 16
  41. #define ULS_MAX_IP_ADDR_LENGTH 20
  42. // window messages
  43. #define ULS_MSG_DIRECTORY_UI 0x5001
  44. #define ULS_MSG_LAUNCH 0x5002
  45. #define ULS_DEFAULT_CRP 2 // refresh period 2 minutes, Internal, BUGS BUGS
  46. /* ----- ULS_F_* (common flags) ------ */
  47. #define ULS_F_ASYNC 0x10000000UL
  48. #define ULS_F_CONN_EXISTS 0x20000000UL // use existing connection
  49. /* ----- ULSLOGON_F_* (logon flags) ------ */
  50. #define ULSREG_F_PUBLISH 0x00000001UL // indicates server publishes client's name (also used in PR_ULS_MODE)
  51. #define ULSREG_F_REGISTER 0x00000010UL // register objects
  52. #define ULSREG_F_UNREGISTER 0x00000020UL // unregister objects
  53. /* ----- ULSRESOLVE_F_* (resolve flags) ------ */
  54. /* ----- ULSDIR_F_* (directory flags) ------ */
  55. #define ULSDIR_F_DEF_PROPS 0x00000400UL // indicates default properties to retrieve
  56. #define ULSDIR_F_LAST_SERVER 0x00000800UL // indicates using the server in registry
  57. /* ----- ULSCONF_F_* ------ */
  58. #define ULSCONF_F_PUBLISH 0X00000001UL
  59. #define ULSCONF_F_SERVER_NAME 0X00000002UL
  60. #define ULSCONF_F_FIRST_NAME 0X00000004UL
  61. #define ULSCONF_F_EMAIL_NAME 0X00000008UL
  62. #define ULSCONF_F_LAST_NAME 0X00000010UL
  63. #define ULSCONF_F_CITY 0X00000020UL
  64. #define ULSCONF_F_COUNTRY 0X00000040UL
  65. #define ULSCONF_F_COMMENTS 0X00000080UL
  66. #define ULSCONF_F_USER_NAME 0x00000100UL
  67. #define ULSCONF_F_DEF_SERVER_NAME 0X00001000UL // use default uls.microsoft.com
  68. /* ----- ULSWIZ_F_* ------ */
  69. #define ULSWIZ_F_SHOW_BACK 0X00010000UL
  70. #define ULSWIZ_F_NO_FINISH 0X00020000UL
  71. /* ----- ULSQUERYPROVIDER_F_* ------ */
  72. #define ULSQUERYPROVIDER_F_ALL 0x00000001UL
  73. #define ULSQUERYPROVIDER_F_ENABLED 0x00000002UL
  74. #define ULSQUERYPROVIDER_F_DISABLED 0x00000004UL
  75. /* ------ common handle types ------ */
  76. typedef PVOID ULS_HCONN; // handle of connection
  77. typedef PVOID ULS_HOBJECT; // handle of object
  78. typedef PVOID ULS_HASYNC; // handle of async operation
  79. typedef WCHAR ULS_GUID_W[ULS_MAX_GUID_LENGTH];
  80. typedef CHAR ULS_GUID_A[ULS_MAX_GUID_LENGTH];
  81. /* ----- ULS_OBJECT_TYPE ------ */
  82. typedef enum
  83. {
  84. ULSOBJECT_PERSON,
  85. ULSOBJECT_APPLICATION,
  86. ULSOBJECT_PROTOCOL,
  87. ULSOBJECT_CONFERENCE,
  88. ULSOBJECT_ALIAS_TO_PERSON,
  89. ULSOBJECT_ALIAS_TO_CONFERENCE,
  90. }
  91. ULS_OBJECT_TYPE;
  92. /* ------ async callback procedures ------ */
  93. typedef HRESULT (WINAPI *ULS_SIMPLE_CB) (
  94. IN ULS_HASYNC hAsyncReq,
  95. IN LPARAM lParamCB,
  96. IN HRESULT hr,
  97. IN DWORD dwResult );
  98. /* ------ ULS_CONN ------ */
  99. typedef struct tag_ULS_CONN_INFO_W
  100. {
  101. DWORD dwFlags;
  102. ULONG nTimeout;
  103. PWSTR pszServerName;
  104. PWSTR pszUlsBase; // eg. "c=US, o=Microsoft, ou=ULS"
  105. PWSTR pszUserName; // if NULL, the client puts default
  106. PWSTR pszPassword; // if NULL, the client puts default
  107. }
  108. ULS_CONN_INFO_W;
  109. typedef struct tag_ULS_CONN_INFO_A
  110. {
  111. DWORD dwFlags;
  112. ULONG nTimeout;
  113. PSTR pszServerName;
  114. PSTR pszUlsBase; // eg. "c=US, o=Microsoft, ou=ULS"
  115. PSTR pszUserName; // if NULL, the client puts default
  116. PSTR pszPassword; // if NULL, the client puts default
  117. }
  118. ULS_CONN_INFO_A;
  119. #ifdef UNICODE
  120. typedef ULS_CONN_INFO_W ULS_CONN_INFO;
  121. #else
  122. typedef ULS_CONN_INFO_A ULS_CONN_INFO;
  123. #endif
  124. /* ------ ULS_CONN_REQ ------ */
  125. typedef struct tag_ULS_CONN_REQ_W
  126. {
  127. DWORD dwFlags;
  128. ULS_CONN_INFO_W ConnInfo;
  129. ULS_SIMPLE_CB pfnCB; // callback function
  130. LPARAM lParamCB; // 32-bit callback parameter
  131. }
  132. ULS_CONN_REQ_W;
  133. typedef struct tag_ULS_CONN_REQ_A
  134. {
  135. DWORD dwFlags;
  136. ULS_CONN_INFO_A ConnInfo;
  137. ULS_SIMPLE_CB pfnCB; // callback function
  138. LPARAM lParamCB; // 32-bit callback parameter
  139. }
  140. ULS_CONN_REQ_A;
  141. #ifdef UNICODE
  142. typedef ULS_CONN_REQ_W ULS_CONN_REQ;
  143. #else
  144. typedef ULS_CONN_REQ_A ULS_CONN_REQ;
  145. #endif
  146. /* ------ ULS_DISCONN_REQ ------ */
  147. typedef struct tag_ULS_DISCONN_REQ_W
  148. {
  149. DWORD dwFlags;
  150. ULS_HCONN hConn;
  151. ULS_SIMPLE_CB pfnCB; // callback function
  152. LPARAM lParamCB; // 32-bit callback parameter
  153. }
  154. ULS_DISCONN_REQ_W;
  155. typedef struct tag_ULS_DISCONN_REQ_A
  156. {
  157. DWORD dwFlags;
  158. ULS_HCONN hConn;
  159. ULS_SIMPLE_CB pfnCB; // callback function
  160. LPARAM lParamCB; // 32-bit callback parameter
  161. }
  162. ULS_DISCONN_REQ_A;
  163. #ifdef UNICODE
  164. typedef ULS_DISCONN_REQ_W ULS_DISCONN_REQ;
  165. #else
  166. typedef ULS_DISCONN_REQ_A ULS_DISCONN_REQ;
  167. #endif
  168. /* ------ ULS_REG_REQ ------ */
  169. typedef struct tag_ULS_REG_REQ_W
  170. {
  171. DWORD dwFlags; // 32-bit flags.
  172. ULS_HCONN hConn; // handle to connection to server
  173. ULS_CONN_INFO_W ConnInfo;
  174. ULS_HOBJECT hObject1; // first level object
  175. ULS_HOBJECT hObject2; // second level object
  176. ULS_SIMPLE_CB pfnCB; // callback function
  177. LPARAM lParamCB; // 32-bit callback parameter
  178. }
  179. ULS_REG_REQ_W;
  180. typedef struct tag_ULS_REG_REQ_A
  181. {
  182. DWORD dwFlags; // 32-bit flags.
  183. ULS_HCONN hConnect; // handle to connection to server
  184. ULS_CONN_INFO_A ConnInfo;
  185. ULS_HOBJECT hObject1; // first level object
  186. ULS_HOBJECT hObject2; // second level object
  187. ULS_SIMPLE_CB pfnCB; // callback function
  188. LPARAM lParamCB; // 32-bit callback parameter
  189. }
  190. ULS_REG_REQ_A;
  191. #ifdef UNICODE
  192. typedef ULS_REG_REQ_W ULS_REG_REQ;
  193. #else
  194. typedef ULS_REG_REQ_A ULS_REG_REQ;
  195. #endif
  196. /* ------ ULS_RESOLVE_REQ ------ */
  197. typedef struct tag_ULS_RESOLVE_REQ_W
  198. {
  199. DWORD dwFlags;
  200. ULS_OBJECT_TYPE ObjectType;
  201. PWSTR pszObject1Uid;
  202. PWSTR pszObject2Uid;
  203. ULONG cPropTags;
  204. PDWORD pdwPropTags;
  205. ULS_HCONN hConn;
  206. ULS_CONN_INFO_W ConnInfo;
  207. ULS_SIMPLE_CB pfnCB; // callback function
  208. LPARAM lParamCB; // 32-bit callback parameter
  209. }
  210. ULS_RESOLVE_REQ_W;
  211. typedef struct tag_ULS_RESOLVE_REQ_A
  212. {
  213. DWORD dwFlags;
  214. ULS_OBJECT_TYPE ObjectType;
  215. PSTR pszObject1Uid;
  216. PSTR pszObject2Uid;
  217. ULONG cPropTags;
  218. PDWORD pdwPropTags;
  219. ULS_HCONN hConn;
  220. ULS_CONN_INFO_A ConnInfo;
  221. ULS_SIMPLE_CB pfnCB; // callback function
  222. LPARAM lParamCB; // 32-bit callback parameter
  223. }
  224. ULS_RESOLVE_REQ_A;
  225. #ifdef UNICODE
  226. typedef ULS_RESOLVE_REQ_W ULS_RESOLVE_REQ;
  227. #else
  228. typedef ULS_RESOLVE_REQ_A ULS_RESOLVE_REQ;
  229. #endif
  230. /* ------ ULS_DIR_REQ ------ */
  231. typedef struct tag_ULS_DIR_REQ_W
  232. {
  233. DWORD dwFlags;
  234. ULS_OBJECT_TYPE ObjectType;
  235. PWSTR pszFilter;
  236. PWSTR pszToMatch;
  237. ULONG cPropTags;
  238. PDWORD pdwPropTags;
  239. ULS_HCONN hConn;
  240. ULS_CONN_INFO_W ConnInfo;
  241. ULS_SIMPLE_CB pfnCB; // callback function
  242. LPARAM lParamCB; // 32-bit callback parameter
  243. }
  244. ULS_DIR_REQ_W;
  245. typedef struct tag_ULS_DIR_REQ_A
  246. {
  247. DWORD dwFlags;
  248. ULS_OBJECT_TYPE ObjectType;
  249. PSTR pszFilter;
  250. PSTR pszToMatch;
  251. ULONG cPropTags;
  252. PDWORD pdwPropTags;
  253. ULS_HCONN hConn;
  254. ULS_CONN_INFO_A ConnInfo;
  255. ULS_SIMPLE_CB pfnCB; // callback function
  256. LPARAM lParamCB; // 32-bit callback parameter
  257. }
  258. ULS_DIR_REQ_A;
  259. #ifdef UNICODE
  260. typedef ULS_DIR_REQ_W ULS_DIR_REQ;
  261. #else
  262. typedef ULS_DIR_REQ_A ULS_DIR_REQ;
  263. #endif
  264. /* ------ ULS_DIR_UNIT ------ */
  265. typedef struct tag_ULS_DIR_UNIT_W
  266. {
  267. ULONG cProps;
  268. SPropValue *pProps;
  269. }
  270. ULS_DIR_UNIT_W;
  271. typedef ULS_DIR_UNIT_W ULS_DIR_UNIT_A;
  272. #ifdef UNICODE
  273. typedef ULS_DIR_UNIT_W ULS_DIR_UNIT;
  274. #else
  275. typedef ULS_DIR_UNIT_A ULS_DIR_UNIT;
  276. #endif
  277. /* ------ ULS_DIR_RESULT ------ */
  278. typedef struct tag_ULS_DIR_RESULT_W
  279. {
  280. ULONG cbSize;
  281. ULONG cEntries;
  282. ULS_DIR_UNIT_W audeiEntries[1];
  283. }
  284. ULS_DIR_RESULT_W;
  285. typedef ULS_DIR_RESULT_W ULS_DIR_RESULT_A;
  286. #ifdef UNICODE
  287. typedef ULS_DIR_RESULT_W ULS_DIR_RESULT;
  288. #else
  289. typedef ULS_DIR_RESULT_A ULS_DIR_RESULT;
  290. #endif
  291. /* ------ ULS_ASYNC_DIR_RESULT ------ */
  292. typedef struct tag_ULS_ASYNC_DIR_RESULT_W
  293. {
  294. ULONG cbSize;
  295. ULONG cTotalEntries;
  296. ULONG cbTotalDataSize;
  297. ULONG nFirstEntry;
  298. ULONG cEntriess;
  299. ULS_DIR_UNIT_W audeiEntries[1];
  300. }
  301. ULS_ASYNC_DIR_RESULT_W;
  302. typedef struct tag_ULS_ASYNC_DIR_RESULT_A
  303. {
  304. ULONG cbSize;
  305. ULONG nFirstEntry;
  306. ULONG cEntriess;
  307. ULS_DIR_UNIT_A audeiEntries[1];
  308. }
  309. ULS_ASYNC_DIR_RESULT_A;
  310. #ifdef UNICODE
  311. typedef ULS_ASYNC_DIR_RESULT_W ULS_ASYNC_DIR_RESULT;
  312. #else
  313. typedef ULS_ASYNC_DIR_RESULT_A ULS_ASYNC_DIR_RESULT;
  314. #endif
  315. /* ------ ULS_CONF ------ */
  316. // same as INTERNET_MAX_USER_NAME_LENGTH in wininet.h.
  317. #define ULS_MAX_UID_LENGTH 256
  318. #define ULS_MAX_SERVER_NAME_LENGTH 128
  319. #define ULS_MAX_FIRST_NAME_LENGTH 128
  320. #define ULS_MAX_LAST_NAME_LENGTH 128
  321. #define ULS_MAX_EMAIL_NAME_LENGTH 128
  322. #define ULS_MAX_CITY_NAME_LENGTH 128
  323. #define ULS_MAX_COUNTRY_NAME_LENGTH 128
  324. #define ULS_MAX_COMMENTS_LENGTH 256
  325. #define ULS_MAX_CLNTSTRING_LENGTH 256 //max of above
  326. //SS: username is concatenated first name with last name with space in between
  327. #define ULS_MAX_USER_NAME_LENGTH (ULS_MAX_FIRST_NAME_LENGTH + ULS_MAX_LAST_NAME_LENGTH)
  328. #define UI_COMMENTS_LENGTH 60 // ;Internal BUGS BUGS to remove
  329. #define MAX_IP_ADDRESS_STRING_LENGTH 20
  330. typedef struct tagULS_HTTP_RESP
  331. {
  332. ULONG cbSize;
  333. ULONG nCmdId;
  334. HRESULT hr;
  335. ULONG nPort;
  336. DWORD dwAppSession;
  337. DWORD dwClientSession;
  338. DWORD dwClientId;
  339. CHAR *pszUID;
  340. CHAR *pszURL;
  341. CHAR szIPAddress[MAX_IP_ADDRESS_STRING_LENGTH];
  342. CHAR szMimeType[MAX_MIME_TYPE_LENGTH];
  343. CHAR szAppMime[MAX_MIME_TYPE_LENGTH];
  344. CHAR szProtMime[MAX_MIME_TYPE_LENGTH];
  345. CHAR szAppId[MAX_NM_APP_ID];
  346. CHAR szProtId[MAX_PROTOCOL_ID];
  347. ULONG nApps;
  348. }
  349. ULS_HTTP_RESP;
  350. /* ------ ULS_PROVIDER_INFO ------ */
  351. #define ULS_MAX_PROVIDER_COMPANY_NAME_LENGTH 64
  352. #define ULS_MAX_PROVIDER_PRODUCT_NAME_LENGTH 64
  353. #define ULS_MAX_PROVIDER_PROTOCOL_NAME_LENGTH 16
  354. typedef struct tag_ULS_PROVIDER_INFO_W
  355. {
  356. ULONG cbSize;
  357. DWORD dwVersion; // hiword major; loword minor
  358. ULONG nProviderId; // created by the uls client, valid only in this process
  359. WCHAR szCompanyName[ULS_MAX_PROVIDER_COMPANY_NAME_LENGTH];
  360. WCHAR szProductName[ULS_MAX_PROVIDER_PRODUCT_NAME_LENGTH];
  361. WCHAR szProtocolName[ULS_MAX_PROVIDER_PROTOCOL_NAME_LENGTH];
  362. }
  363. ULS_PROVIDER_INFO_W;
  364. typedef struct tag_ULS_PROVIDER_INFO_A
  365. {
  366. ULONG cbSize;
  367. DWORD dwVersion; // hiword major; loword minor
  368. ULONG nProviderId; // created by the uls client, valid only in this process
  369. CHAR szCompanyName[ULS_MAX_PROVIDER_COMPANY_NAME_LENGTH];
  370. CHAR szProductName[ULS_MAX_PROVIDER_PRODUCT_NAME_LENGTH];
  371. CHAR szProtocolName[ULS_MAX_PROVIDER_PROTOCOL_NAME_LENGTH];
  372. }
  373. ULS_PROVIDER_INFO_A;
  374. #ifdef UNICODE
  375. typedef ULS_PROVIDER_INFO_W ULS_PROVIDER_INFO;
  376. #else
  377. typedef ULS_PROVIDER_INFO_A ULS_PROVIDER_INFO;
  378. #endif
  379. #endif // _ULSAPI_H_