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.

75 lines
1.6 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. LOCATOR.H
  5. Abstract:
  6. Declares the CLocator class.
  7. History:
  8. a-davj 04-Mar-97 Created.
  9. --*/
  10. #ifndef _locator_H_
  11. #define _locator_H_
  12. typedef void ** PPVOID;
  13. //***************************************************************************
  14. //
  15. // CLASS NAME:
  16. //
  17. // CLocator
  18. //
  19. // DESCRIPTION:
  20. //
  21. // Implements the IWbemLocator interface. This class is what the client gets
  22. // when it initially hooks up to the Wbemprox.dll. The ConnectServer function
  23. // is what get the communication between client and server started.
  24. //
  25. //***************************************************************************
  26. class CLocator : public IWbemLocator
  27. {
  28. protected:
  29. long m_cRef; //Object reference count
  30. public:
  31. CLocator();
  32. ~CLocator(void);
  33. BOOL Init(void);
  34. //Non-delegating object IUnknown
  35. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  36. STDMETHODIMP_(ULONG) AddRef(void)
  37. {
  38. InterlockedIncrement(&m_cRef);
  39. return m_cRef;
  40. }
  41. STDMETHODIMP_(ULONG) Release(void)
  42. {
  43. long lTemp = InterlockedDecrement(&m_cRef);
  44. if (0L!=lTemp)
  45. return lTemp;
  46. delete this;
  47. return 0;
  48. }
  49. /* iWbemLocator methods */
  50. STDMETHOD(ConnectServer)(THIS_ const BSTR NetworkResource, const BSTR User,
  51. const BSTR Password, const BSTR lLocaleId, long lFlags, const BSTR Authority,
  52. IWbemContext __RPC_FAR *pCtx,
  53. IWbemServices FAR* FAR* ppNamespace);
  54. };
  55. #endif