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.

130 lines
2.7 KiB

  1. /*****************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /*****************************************************************/
  5. /*
  6. * History:
  7. * Thomaspa 21-Feb-1992 Created
  8. *
  9. */
  10. #ifndef _LMOEALI_HXX_
  11. #define _LMOEALI_HXX_
  12. #include "lmoenum.hxx"
  13. #include "lmoersm.hxx"
  14. /**********************************************************\
  15. NAME: ALIAS_ENUM
  16. SYNOPSIS: Alias enumeration class
  17. INTERFACE: See derived USERx_ENUM classes
  18. PARENT: LM_ENUM
  19. USES:
  20. HISTORY:
  21. Thomaspa 21-Feb-1992 Created
  22. \**********************************************************/
  23. DLL_CLASS ALIAS_ENUM : public LM_RESUME_ENUM
  24. {
  25. private:
  26. SAM_ENUMERATE_HANDLE _samenumh;
  27. SAM_DOMAIN & _samdomain;
  28. SAM_RID_ENUMERATION_MEM * _psamrem;
  29. UINT _cbMaxPreferred;
  30. virtual APIERR CallAPI( BOOL fRestartEnum,
  31. BYTE ** ppbBuffer,
  32. UINT * pcEntriesRead );
  33. protected:
  34. //
  35. // This method is invoked to free an enumeration buffer.
  36. //
  37. virtual VOID FreeBuffer( BYTE ** ppbBuffer );
  38. public:
  39. ALIAS_ENUM ( SAM_DOMAIN & samdomain, UINT cbMaxPreferred = 0xffff );
  40. ~ALIAS_ENUM();
  41. }; // class ALIAS_ENUM
  42. /*************************************************************************
  43. NAME: ALIAS_ENUM_OBJ
  44. SYNOPSIS: This is basically the return type from the ALIAS_ENUM_ITER
  45. iterator.
  46. INTERFACE: ALIAS_ENUM_OBJ - Class constructor.
  47. ~ALIAS_ENUM_OBJ - Class destructor.
  48. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  49. GetName - Returns the Alias name.
  50. QueryRid - Returs the Rid for the Alias
  51. GetComment - fetches and returns the Alias comment
  52. PARENT: ENUM_OBJ_BASE
  53. HISTORY:
  54. Thomaspa 21-Feb-1992 Created
  55. **************************************************************************/
  56. DLL_CLASS ALIAS_ENUM_OBJ : public ENUM_OBJ_BASE
  57. {
  58. public:
  59. //
  60. // Provide properly-casted buffer Query/Set methods.
  61. //
  62. const SAM_RID_ENUMERATION * QueryBufferPtr( VOID ) const
  63. {
  64. return (const SAM_RID_ENUMERATION *)ENUM_OBJ_BASE::QueryBufferPtr();
  65. }
  66. VOID SetBufferPtr( const SAM_RID_ENUMERATION * pBuffer );
  67. //
  68. // Accessors.
  69. //
  70. DECLARE_ENUM_ACCESSOR( QueryUnicodeName, UNICODE_STRING, Name );
  71. DECLARE_ENUM_ACCESSOR( QueryRid, const ULONG, RelativeId );
  72. APIERR GetName( NLS_STR * pnlsName )
  73. {
  74. ASSERT( pnlsName != NULL );
  75. return pnlsName->MapCopyFrom( QueryUnicodeName().Buffer,
  76. QueryUnicodeName().Length );
  77. }
  78. APIERR GetComment( const SAM_DOMAIN & samdomain, NLS_STR * pnlsComment );
  79. }; // class ALIAS_ENUM_OBJ
  80. DECLARE_LM_RESUME_ENUM_ITER_OF( ALIAS, SAM_RID_ENUMERATION )
  81. #endif // _LMOEALI_HXX_