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.

78 lines
1.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class CClients
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef CLIENTS_H
  11. #define CLIENTS_H
  12. #pragma once
  13. #include "clientstrie.h"
  14. class CClients
  15. {
  16. public:
  17. CClients() throw ();
  18. ~CClients() throw ();
  19. HRESULT Init() throw ();
  20. void Shutdown() throw ();
  21. HRESULT SetClients(VARIANT* pVarClients) throw ();
  22. BOOL FindObject(
  23. DWORD dwKey,
  24. IIasClient** ppIIasClient = 0
  25. ) throw ();
  26. void DeleteObjects() throw ();
  27. private:
  28. // Frees the client objects in m_pCClientArray.
  29. void FreeClientArray(DWORD dwCount) throw ();
  30. // Resolve the clients in the m_pCClientArray member.
  31. void Resolve(DWORD dwCount) throw ();
  32. // Wait for the resolver thread to exit.
  33. HRESULT StopResolvingClients() throw ();
  34. // State passed to the resolver thread.
  35. struct ConfigureCallback : IAS_CALLBACK
  36. {
  37. CClients* self;
  38. DWORD numClients;
  39. };
  40. // Thread start routine for the resolver thread.
  41. static void WINAPI CallbackRoutine(IAS_CALLBACK* context) throw ();
  42. // Critical section used to serialize access to the ClientTrie.
  43. bool m_CritSectInitialized;
  44. CRITICAL_SECTION m_CritSect;
  45. // Class factory for creating new client objects.
  46. CComPtr<IClassFactory> m_pIClassFactory;
  47. // Scratch pad for storing clients that need to be resolved.
  48. CClient** m_pCClientArray;
  49. // The map of clients
  50. ClientTrie m_mapClients;
  51. // Used to signal that the resolver thread has finished.
  52. HANDLE m_hResolverEvent;
  53. // Max number of clients allowed.
  54. LONG m_dwMaxClients;
  55. // True if subnet syntax and multiple addresses per hostname are allowed.
  56. bool m_fAllowSubnetSyntax;
  57. };
  58. #endif // CLIENTS_H