Leaked source code of windows server 2003
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.

134 lines
4.9 KiB

  1. //****************************************************************************
  2. //
  3. // Module: ULS.DLL
  4. // File: localapp.h
  5. // Content: This file contains the LocalApplication object definition.
  6. // History:
  7. // Wed 17-Apr-1996 11:18:47 -by- Viroon Touranachun [viroont]
  8. //
  9. // Copyright (c) Microsoft Corporation 1996-1997
  10. //
  11. //****************************************************************************
  12. #ifndef _CLOCALAPP_H_
  13. #define _CLOCALAPP_H_
  14. #include "connpt.h"
  15. //****************************************************************************
  16. // Enumeration type
  17. //****************************************************************************
  18. //
  19. typedef enum {
  20. ULS_APP_SET_ATTRIBUTES,
  21. ULS_APP_REMOVE_ATTRIBUTES,
  22. } APP_CHANGE_ATTRS;
  23. typedef enum {
  24. ULS_APP_ADD_PROT,
  25. ULS_APP_REMOVE_PROT,
  26. } APP_CHANGE_PROT;
  27. //****************************************************************************
  28. // CUls definition
  29. //****************************************************************************
  30. //
  31. class CLocalApp : public IULSLocalApplication,
  32. public IConnectionPointContainer
  33. {
  34. private:
  35. ULONG cRef;
  36. LPTSTR szName;
  37. GUID guid;
  38. LPTSTR szMimeType;
  39. CAttributes *pAttrs;
  40. CList ProtList;
  41. CConnectionPoint *pConnPt;
  42. // Private methods
  43. STDMETHODIMP NotifySink (void *pv, CONN_NOTIFYPROC pfn);
  44. STDMETHODIMP ChangeAttributes (IULSAttributes *pAttributes,
  45. ULONG *puReqID,
  46. APP_CHANGE_ATTRS uCmd);
  47. STDMETHODIMP ChangeProtocol (IULSLocalAppProtocol *pAttributes,
  48. ULONG *puReqID,
  49. APP_CHANGE_PROT uCmd);
  50. public:
  51. // Constructor and destructor
  52. CLocalApp (void);
  53. ~CLocalApp (void);
  54. STDMETHODIMP Init (BSTR bstrName, REFGUID rguid, BSTR bstrMimeType);
  55. // Internal methods
  56. STDMETHODIMP GetAppInfo (PLDAP_APPINFO *ppAppInfo);
  57. // Asynchronous response handler
  58. //
  59. STDMETHODIMP AttributesChangeResult (CAttributes *pAttributes,
  60. ULONG uReqID, HRESULT hResult,
  61. APP_CHANGE_ATTRS uCmd);
  62. STDMETHODIMP ProtocolChangeResult (CLocalProt *pProtocol,
  63. ULONG uReqID, HRESULT hResult,
  64. APP_CHANGE_PROT uCmd);
  65. // IUnknown
  66. STDMETHODIMP QueryInterface (REFIID iid, void **ppv);
  67. STDMETHODIMP_(ULONG) AddRef (void);
  68. STDMETHODIMP_(ULONG) Release (void);
  69. // IULSLocalApplication
  70. STDMETHODIMP CreateProtocol (BSTR bstrProtocolID, ULONG uPortNumber,
  71. BSTR bstrMimeType,
  72. IULSLocalAppProtocol **ppProtocol);
  73. STDMETHODIMP AddProtocol (IULSLocalAppProtocol *pProtocol,
  74. ULONG *puReqID);
  75. STDMETHODIMP RemoveProtocol (IULSLocalAppProtocol *pProtocol,
  76. ULONG *puReqID);
  77. STDMETHODIMP EnumProtocols (IEnumULSLocalAppProtocols **ppEnumProtocol);
  78. STDMETHODIMP SetAttributes (IULSAttributes *pAttributes,
  79. ULONG *puReqID);
  80. STDMETHODIMP RemoveAttributes (IULSAttributes *pAttributes,
  81. ULONG *puReqID);
  82. // IConnectionPointContainer
  83. STDMETHODIMP EnumConnectionPoints(IEnumConnectionPoints **ppEnum);
  84. STDMETHODIMP FindConnectionPoint(REFIID riid,
  85. IConnectionPoint **ppcp);
  86. #ifdef DEBUG
  87. void DebugProtocolDump(void);
  88. #endif // DEBUG
  89. };
  90. //****************************************************************************
  91. // CEnumLocalAppProtocols definition
  92. //****************************************************************************
  93. //
  94. class CEnumLocalAppProtocols : public IEnumULSLocalAppProtocols
  95. {
  96. private:
  97. ULONG cRef;
  98. CList ProtList;
  99. HANDLE hEnum;
  100. public:
  101. // Constructor and Initialization
  102. CEnumLocalAppProtocols (void);
  103. ~CEnumLocalAppProtocols (void);
  104. STDMETHODIMP Init (CList *pProtList);
  105. // IUnknown
  106. STDMETHODIMP QueryInterface (REFIID iid, void **ppv);
  107. STDMETHODIMP_(ULONG) AddRef (void);
  108. STDMETHODIMP_(ULONG) Release (void);
  109. // IEnumULSLocalAppProtocols
  110. STDMETHODIMP Next(ULONG cProtocols, IULSLocalAppProtocol **rgpProt,
  111. ULONG *pcFetched);
  112. STDMETHODIMP Skip(ULONG cProtocols);
  113. STDMETHODIMP Reset();
  114. STDMETHODIMP Clone(IEnumULSLocalAppProtocols **ppEnum);
  115. };
  116. #endif //_CLOCALAPP_H_