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.

115 lines
2.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // FILE
  4. //
  5. // iasntds.h
  6. //
  7. // SYNOPSIS
  8. //
  9. // Declares global objects and functions for the IAS NTDS API.
  10. //
  11. // MODIFICATION HISTORY
  12. //
  13. // 05/11/1998 Original version.
  14. // 07/13/1998 Clean up header file dependencies.
  15. // 08/25/1998 Added IASNtdsQueryUserAttributes.
  16. // 09/02/1998 Added 'scope' parameter to IASNtdsQueryUserAttributes.
  17. // 03/10/1999 Added IASNtdsIsNativeModeDomain.
  18. //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. #ifndef _IASNTDS_H_
  21. #define _IASNTDS_H_
  22. #if _MSC_VER >= 1000
  23. #pragma once
  24. #endif
  25. #include <winldap.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. //////////
  30. // API must be initialized prior to accessing any of the global objects.
  31. //////////
  32. DWORD
  33. WINAPI
  34. IASNtdsInitialize( VOID );
  35. //////////
  36. // API should be uninitialized when done.
  37. //////////
  38. VOID
  39. WINAPI
  40. IASNtdsUninitialize( VOID );
  41. //////////
  42. // Returns TRUE if the specified domain is running in native mode.
  43. //////////
  44. BOOL
  45. WINAPI
  46. IASNtdsIsNativeModeDomain(
  47. IN PCWSTR domain
  48. );
  49. typedef struct _IAS_NTDS_RESULT {
  50. HANDLE cxn;
  51. PLDAPMessage msg;
  52. } IAS_NTDS_RESULT, *PIAS_NTDS_RESULT;
  53. //////////
  54. // Reads attributes from a user object.
  55. //////////
  56. DWORD
  57. WINAPI
  58. IASNtdsQueryUserAttributes(
  59. IN PCWSTR domain,
  60. IN PCWSTR username,
  61. IN ULONG scope,
  62. IN PWCHAR attrs[],
  63. OUT PIAS_NTDS_RESULT result
  64. );
  65. //////////
  66. // Frees a result struct.
  67. //////////
  68. VOID
  69. WINAPI
  70. IASNtdsFreeResult(
  71. PIAS_NTDS_RESULT result
  72. );
  73. #ifdef __cplusplus
  74. // Simple RAII wrapper around an IAS_NTDS_RESULT struct.
  75. class IASNtdsResult : public IAS_NTDS_RESULT
  76. {
  77. public:
  78. IASNtdsResult() throw ();
  79. ~IASNtdsResult() throw ();
  80. private:
  81. // Not implemented.
  82. // IASNtdsResult(const IASNtdsResult&);
  83. // IASNtdsResult& operator=(const IASNtdsResult&);
  84. };
  85. inline IASNtdsResult::IASNtdsResult() throw ()
  86. {
  87. cxn = 0;
  88. msg = 0;
  89. }
  90. inline IASNtdsResult::~IASNtdsResult() throw ()
  91. {
  92. IASNtdsFreeResult(this);
  93. }
  94. }
  95. #endif
  96. #endif // _IASNTDS_H_