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.

90 lines
3.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: E V E N T . H
  7. //
  8. // Contents: Private eventing functions
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 14 Oct 1999
  13. //
  14. //----------------------------------------------------------------------------
  15. #include <wininet.h>
  16. //
  17. // Controlled Device structures
  18. //
  19. struct _UPNP_EVENT_SOURCE;
  20. typedef struct _EVENT_SOURCE_PROPERTY
  21. {
  22. BOOL fModified;
  23. UPNP_PROPERTY prop;
  24. } ES_PROPERTY;
  25. typedef struct _UPNP_EVENT_SOURCE
  26. {
  27. LIST_ENTRY linkage;
  28. LPTSTR szRequestUri; // URI that identifies subscriptions
  29. // SUBSCRIBE and UNSUBSCRIBE to
  30. DWORD cProps; // Number of properties supported
  31. // by the event source
  32. ES_PROPERTY * rgesProps; // List of properties
  33. LIST_ENTRY listSubs; // List of subscribers
  34. CRITICAL_SECTION cs;
  35. BOOL fCleanup;
  36. } UPNP_EVENT_SOURCE;
  37. // Type of subscription request to send
  38. typedef enum _ESSR_TYPE
  39. {
  40. SSR_SUBSCRIBE,
  41. SSR_RESUBSCRIBE,
  42. SSR_UNSUBSCRIBE,
  43. } ESSR_TYPE;
  44. HRESULT HrSendSubscriptionRequest(HINTERNET hin,
  45. LPCTSTR szUrl,
  46. LPCTSTR szSid,
  47. DWORD *pcsecTimeout,
  48. LPTSTR *pszSidOut,
  49. ESSR_TYPE essrt);
  50. BOOL FValidateUpnpProperty(UPNP_PROPERTY * pProp);
  51. VOID CopyUpnpProperty(UPNP_PROPERTY * pPropDst, UPNP_PROPERTY * pPropSrc);
  52. VOID FreeUpnpProperty(UPNP_PROPERTY * pPropSrc);
  53. VOID FreeEventSource(UPNP_EVENT_SOURCE *pes);
  54. VOID RemoveFromListEventSource(UPNP_EVENT_SOURCE *pes);
  55. UPNP_EVENT_SOURCE * PesFindEventSource(LPCTSTR szRequestUri);
  56. UPNP_EVENT_SOURCE * PesVerifyEventSource(UPNP_EVENT_SOURCE *pes);
  57. VOID PrintListEventSource(LIST_ENTRY *pListHead);
  58. VOID CleanupEventSourceEntry (UPNP_EVENT_SOURCE *pes);
  59. VOID PrintEventSource(const UPNP_EVENT_SOURCE *pes);
  60. BOOL FRemoveSubscriberFromRequest(SOCKET socket, SSDP_REQUEST * pRequest);
  61. DWORD DwParseTime(LPCTSTR szTime);
  62. BOOL FParseCallbackUrl(LPCTSTR szCallbackUrl, LPTSTR *pszOut);
  63. VOID ComputeAbsoluteTime(DWORD csec, FILETIME * pft);
  64. LPTSTR SzGetNewSid(VOID);
  65. VOID MarkAllProperties(UPNP_EVENT_SOURCE *pes, BOOL fModified);
  66. HRESULT HrSendInitialNotifyMessage(UPNP_EVENT_SOURCE *pes, DWORD dwFlags,
  67. LPCTSTR szSid, DWORD iSeq, LPCTSTR szDestUrl);
  68. HRESULT HrSubmitUpnpPropertyEventToSubscriber(UPNP_EVENT_SOURCE *pes,
  69. DWORD dwFlags,
  70. LPCTSTR szSid, DWORD iSeq,
  71. LPCTSTR szDestUrl);
  72. HRESULT HrSubmitEventToSubscriber(DWORD dwFlags,
  73. LPCTSTR szHeaders, LPCTSTR szEventBody,
  74. LPCTSTR szDestUrl);
  75. BOOL FUpdateEventSourceWithProps(UPNP_EVENT_SOURCE *pes, DWORD cProps,
  76. UPNP_PROPERTY *rgProps);
  77. extern LIST_ENTRY g_listEventSource;
  78. extern CRITICAL_SECTION g_csListEventSource;