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.

105 lines
3.7 KiB

  1. #pragma once
  2. #ifndef _EVTAPI_H
  3. #define _EVTAPI_H
  4. struct UPNP_EVENT_SOURCE;
  5. struct UPNP_EVENT
  6. {
  7. LPWSTR szBody; // Body of event NOTIFY message
  8. UPNP_EVENT * pevtNext; // Next in list
  9. };
  10. struct UPNP_WAIT_PARAMS
  11. {
  12. LPWSTR szEsid; // Event source identifier
  13. LPWSTR szSid; // Subscription Identifier
  14. };
  15. struct UPNP_RENEWAL
  16. {
  17. LPWSTR szEsid; // Event source identifier
  18. LPWSTR szSid; // Subscription Identifier
  19. DWORD iRenewal; // renewal index
  20. };
  21. struct UPNP_SUBSCRIBER
  22. {
  23. UPNP_EVENT_SOURCE * pes; // Pointer to event source [valid
  24. // only when subscriber is in list]
  25. LPWSTR * rgszUrl; // Callback URL list
  26. DWORD cszUrl; // Number of URLs in the list
  27. DWORD csecTimeout; // Timeout period
  28. FILETIME ftTimeout; // Timeout period in FILETIME
  29. DWORD iSeq; // Event sequence number
  30. LPWSTR szSid; // Subscription Identifier
  31. DWORD cRenewals; // # of renewals received
  32. DWORD dwIpAddr; // IP address of subscriber's host
  33. HANDLE hEventQ; // Event signaled when Q full
  34. UPNP_EVENT * pevtQueue; // Event queue
  35. UPNP_EVENT * pevtQueueTail; // Event queue tail
  36. HANDLE hWait; // Handle of registered wait
  37. HANDLE hTimer; // TimerQueue timer handle
  38. UPNP_WAIT_PARAMS uwp; // Params for the registered wait
  39. UPNP_RENEWAL ur; // Subscription renewal params
  40. UPNP_SUBSCRIBER * psubNext; // Next in list
  41. };
  42. const DWORD c_cuwlAlloc = 5; // Number of items to alloc in one chunk
  43. struct UPNP_EVENT_SOURCE
  44. {
  45. LPWSTR szEsid; // Event source identifier
  46. UPNP_SUBSCRIBER * psubList; // List of subscribers
  47. UPNP_EVENT_SOURCE * pesNext; // Next in list
  48. };
  49. HRESULT HrInitEventApi(VOID);
  50. HRESULT HrInitInternetSession(VOID);
  51. VOID DeInitEventApi(VOID);
  52. HRESULT HrRegisterEventSource(LPCWSTR szEsid);
  53. HRESULT HrDeregisterEventSource(LPCWSTR szEsid);
  54. HRESULT HrSubmitEvent(LPCWSTR szEsid,
  55. LPCWSTR szEventBody);
  56. HRESULT HrSubmitEventZero(LPCWSTR szEsid,
  57. LPCWSTR szSid,
  58. LPCWSTR szEventBody);
  59. UPNP_EVENT_SOURCE *PesFindEventSource(LPCWSTR szEsid);
  60. UPNP_SUBSCRIBER *PsubFindSubscriber(UPNP_EVENT_SOURCE *pes, LPCWSTR szSid);
  61. VOID WINAPI EventQueueWorker(LPVOID pvContext, BOOL fTimeOut);
  62. VOID AppendToEventQueue(UPNP_SUBSCRIBER * psub, UPNP_EVENT * pevt);
  63. HRESULT HrComposeUpnpNotifyHeaders(DWORD iSeq, LPCTSTR szSid,
  64. LPWSTR *pszHeaders);
  65. //HRESULT HrComposeXmlBodyFromEventSource(EVENT_VARIABLE *rgevVars, DWORD cVars,
  66. // LPWSTR *pszOut);
  67. HRESULT HrSubmitNotifyToSubscriber(LPCWSTR szHeaders, LPCWSTR szBody,
  68. LPCWSTR szUrl);
  69. VOID DbgDumpListEventSource(VOID);
  70. HRESULT HrAddSubscriber(
  71. LPCWSTR szEsid,
  72. DWORD dwIpAddr,
  73. DWORD cszUrl,
  74. LPCWSTR * rgszCallbackUrl,
  75. LPCWSTR szEventBody,
  76. DWORD * pcsecTimeout,
  77. LPWSTR * pszSid);
  78. HRESULT HrRenewSubscriber(
  79. LPCWSTR szEsid,
  80. DWORD * pcsecTimeout,
  81. LPCWSTR szSid);
  82. HRESULT HrRemoveSubscriber(
  83. LPCWSTR szEsid,
  84. LPCWSTR szSid);
  85. #endif //!_EVTAPI_H