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.

124 lines
3.3 KiB

  1. /* ----------------------------------------------------------------------
  2. Module: ULS.DLL (Service Provider)
  3. File: splapp.h
  4. Content: This file contains the local application object definition.
  5. History:
  6. 10/15/96 Chu, Lon-Chan [lonchanc]
  7. Created.
  8. Copyright (c) Microsoft Corporation 1996-1997
  9. ---------------------------------------------------------------------- */
  10. #ifndef _ULS_SP_APPOBJ_H_
  11. #define _ULS_SP_APPOBJ_H_
  12. #include <pshpack8.h>
  13. enum
  14. {
  15. ENUM_APPATTR_NAME,
  16. ENUM_APPATTR_MIME_TYPE,
  17. ENUM_APPATTR_GUID,
  18. ENUM_APPATTR_PROT_NAME,
  19. ENUM_APPATTR_PROT_MIME,
  20. ENUM_APPATTR_PROT_PORT,
  21. COUNT_ENUM_APPATTR
  22. };
  23. #define COUNT_ENUM_STDAPPATTR ENUM_APPATTR_PROT_NAME
  24. #define APPOBJ_F_NAME 0x0001
  25. #define APPOBJ_F_MIME_TYPE 0x0002
  26. #define APPOBJ_F_GUID 0x0004
  27. extern const TCHAR *c_apszAppStdAttrNames[COUNT_ENUM_APPATTR];
  28. #define STR_APP_NAME ((TCHAR *) c_apszAppStdAttrNames[ENUM_APPATTR_NAME])
  29. typedef struct
  30. {
  31. DWORD dwFlags;
  32. TCHAR *apszStdAttrValues[COUNT_ENUM_APPATTR];
  33. TCHAR szGuid[sizeof (GUID) * 2 + 2];
  34. }
  35. APP_INFO;
  36. #define APPOBJ_SIGNATURE ((ULONG) 0x56781234UL)
  37. class UlsLdap_CLocalApp : public UlsLdap_CStdAttrs, public UlsLdap_CAnyAttrs
  38. {
  39. friend class UlsLdap_CLocalProt;
  40. public:
  41. UlsLdap_CLocalApp ( UlsLdap_CLocalUser *pUser );
  42. ~UlsLdap_CLocalApp ( VOID );
  43. ULONG AddRef ( VOID );
  44. ULONG Release ( VOID );
  45. HRESULT Register ( ULONG *puRespID, LDAP_APPINFO *pInfo );
  46. HRESULT UnRegister ( ULONG *puRespID );
  47. HRESULT SetStdAttrs ( ULONG *puRespID, LDAP_APPINFO *pInfo );
  48. HRESULT SetAnyAttrs ( ULONG *puRespID, ULONG cAttrs, TCHAR *pszAttrs );
  49. HRESULT RemoveAnyAttrs ( ULONG *puRespID, ULONG cAttrs, TCHAR *pszAttrs );
  50. VOID SetRegNone ( VOID ) { m_RegStatus = ULS_REG_STATUS_NONE; }
  51. VOID SetRegLocally ( VOID ) { m_RegStatus = ULS_REG_STATUS_LOCALLY; }
  52. VOID SetRegRemotely ( VOID ) { m_RegStatus = ULS_REG_STATUS_REMOTELY; }
  53. BOOL IsRegistered ( VOID ) { return (m_RegStatus > ULS_REG_STATUS_NONE &&
  54. m_pUser->IsRegistered ()); }
  55. BOOL IsRegLocally ( VOID ) { return (m_RegStatus == ULS_REG_STATUS_LOCALLY &&
  56. m_pUser->IsRegistered ()); }
  57. BOOL IsRegRemotely ( VOID ) { return (m_RegStatus == ULS_REG_STATUS_REMOTELY &&
  58. m_pUser->IsRegRemotely ()); }
  59. BOOL IsValidObject ( VOID ) { return m_uSignature == APPOBJ_SIGNATURE; }
  60. protected:
  61. TCHAR *GetDN ( VOID ) { return m_pUser->GetDN (); }
  62. SERVER_INFO *GetServerInfo ( VOID ) { return m_pUser->GetServerInfo (); }
  63. ULONG GetUserPrefixCount ( VOID ) { return m_pUser->GetPrefixCount (); }
  64. TCHAR *GetUserPrefixString ( VOID ) { return m_pUser->GetPrefixString (); }
  65. ULONG GetPrefixCount ( VOID ) { return m_cPrefix; }
  66. TCHAR *GetPrefixString ( VOID ) { return m_pszPrefix; }
  67. private:
  68. HRESULT CacheInfo ( VOID *pInfo );
  69. HRESULT CacheAppInfo ( LDAP_APPINFO *pInfo );
  70. HRESULT CreateRegisterModArr ( LDAPMod ***pppMod );
  71. HRESULT CreateUnRegisterModArr ( LDAPMod ***pppMod );
  72. HRESULT CreateSetStdAttrsModArr ( LDAPMod ***pppMod );
  73. VOID FillModArrAttr ( LDAPMod *pMod, LONG AttrIdx );
  74. ULONG m_uSignature;
  75. LONG m_cRefs;
  76. UlsLdap_CLocalUser *m_pUser;
  77. APP_INFO m_AppInfo;
  78. REG_STATUS m_RegStatus;
  79. ULONG m_cPrefix;
  80. TCHAR *m_pszPrefix;
  81. };
  82. #include <poppack.h>
  83. #endif // _ULS_SP_APPOBJ_H_