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.

72 lines
1.5 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. CPROVLOC.H
  5. Abstract:
  6. Declares the CProviderLoc class.
  7. History:
  8. davj 30-Oct-00 Created.
  9. --*/
  10. #ifndef _cprovloc_H_
  11. #define _cprovloc_H_
  12. typedef void ** PPVOID;
  13. //***************************************************************************
  14. //
  15. // CLASS NAME:
  16. //
  17. // CProviderLoc
  18. //
  19. // DESCRIPTION:
  20. //
  21. // Implements the IWbemLocator interface. This support the formally inproc
  22. // logins used by providers.
  23. //
  24. //***************************************************************************
  25. class CProviderLoc : public IWbemLocator
  26. {
  27. protected:
  28. long m_cRef; //Object reference count
  29. DWORD m_dwType;
  30. public:
  31. CProviderLoc(DWORD dwType);
  32. ~CProviderLoc(void);
  33. //Non-delegating object IUnknown
  34. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  35. STDMETHODIMP_(ULONG) AddRef(void)
  36. {
  37. InterlockedIncrement(&m_cRef);
  38. return m_cRef;
  39. }
  40. STDMETHODIMP_(ULONG) Release(void)
  41. {
  42. long lTemp = InterlockedDecrement(&m_cRef);
  43. if (0L!=lTemp)
  44. return lTemp;
  45. delete this;
  46. return 0;
  47. }
  48. /* iWbemLocator methods */
  49. STDMETHOD(ConnectServer)(THIS_ const BSTR NetworkResource, const BSTR User,
  50. const BSTR Password, const BSTR lLocaleId, long lFlags, const BSTR Authority,
  51. IWbemContext __RPC_FAR *pCtx,
  52. IWbemServices FAR* FAR* ppNamespace);
  53. };
  54. #endif