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.

100 lines
2.2 KiB

  1. /* ----------------------------------------------------------------------
  2. Module: ULS.DLL (Service Provider)
  3. File: splprot.h
  4. Content: This file contains the local protocol object definition.
  5. History:
  6. 10/15/96 Chu, Lon-Chan [lonchanc]
  7. Created.
  8. Copyright (c) Microsoft Corporation 1996-1997
  9. ---------------------------------------------------------------------- */
  10. #ifndef _ILS_SP_PROTOBJ_H_
  11. #define _ILS_SP_PROTOBJ_H_
  12. #include <pshpack8.h>
  13. enum
  14. {
  15. ENUM_PROTATTR_NAME,
  16. ENUM_PROTATTR_MIME_TYPE,
  17. ENUM_PROTATTR_PORT_NUMBER,
  18. COUNT_ENUM_PROTATTR
  19. };
  20. #define PROTOBJ_F_NAME 0x0001
  21. #define PROTOBJ_F_MIME_TYPE 0x0002
  22. #define PROTOBJ_F_PORT_NUMBER 0x0004
  23. extern const TCHAR *c_apszProtStdAttrNames[];
  24. #define STR_PROT_NAME ((TCHAR *) c_apszProtStdAttrNames[ENUM_PROTATTR_NAME])
  25. typedef struct
  26. {
  27. DWORD dwFlags;
  28. TCHAR *apszStdAttrValues[COUNT_ENUM_PROTATTR];
  29. TCHAR szPortNumber[INTEGER_STRING_LENGTH];
  30. }
  31. PROT_INFO;
  32. #define PROTOBJ_SIGNATURE ((ULONG) 0xABCD1278UL)
  33. class SP_CProtocol
  34. {
  35. friend class SP_CClient;
  36. public:
  37. SP_CProtocol ( SP_CClient *pClient );
  38. ~SP_CProtocol ( VOID );
  39. ULONG AddRef ( VOID );
  40. ULONG Release ( VOID );
  41. HRESULT Register ( ULONG uRespID, LDAP_PROTINFO *pInfo );
  42. HRESULT UnRegister ( ULONG uRespID );
  43. HRESULT SetAttributes ( ULONG uRespID, LDAP_PROTINFO *pInfo );
  44. VOID SetRegNone ( VOID ) { m_RegStatus = ILS_REG_STATUS_NONE; }
  45. VOID SetRegLocally ( VOID ) { m_RegStatus = ILS_REG_STATUS_LOCALLY; }
  46. VOID SetRegRemotely ( VOID ) { m_RegStatus = ILS_REG_STATUS_REMOTELY; }
  47. BOOL IsRegistered ( VOID ) { return (m_RegStatus > ILS_REG_STATUS_NONE &&
  48. m_pClient->IsRegistered ()); }
  49. BOOL IsRegLocally ( VOID ) { return (m_RegStatus == ILS_REG_STATUS_LOCALLY &&
  50. m_pClient->IsRegistered ()); }
  51. BOOL IsRegRemotely ( VOID ) { return (m_RegStatus == ILS_REG_STATUS_REMOTELY &&
  52. m_pClient->IsRegRemotely ()); }
  53. BOOL IsValidObject ( VOID ) { return m_uSignature == PROTOBJ_SIGNATURE; }
  54. protected:
  55. PROT_INFO *GetProtInfo ( VOID ) { return &m_ProtInfo; }
  56. private:
  57. VOID CacheProtInfo ( LDAP_PROTINFO *pInfo );
  58. ULONG m_uSignature;
  59. LONG m_cRefs;
  60. SP_CClient *m_pClient;
  61. PROT_INFO m_ProtInfo;
  62. REG_STATUS m_RegStatus;
  63. };
  64. #include <poppack.h>
  65. #endif // _ILS_SP_PROTOBJ_H_