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.

123 lines
2.5 KiB

  1. #include "inspch.h"
  2. #include "insengmn.h"
  3. #include "inseng.h"
  4. #include "download.h"
  5. #include "sitemgr.h"
  6. #include "sitefact.h"
  7. #include "util2.h"
  8. //=--------------------------------------------------------------------------=
  9. // Function name here
  10. //=--------------------------------------------------------------------------=
  11. // Function description
  12. //
  13. // Parameters:
  14. //
  15. // Returns:
  16. //
  17. // Notes:
  18. //
  19. STDMETHODIMP CSiteManagerFactory::QueryInterface(REFIID riid, void **ppv)
  20. {
  21. if((riid == IID_IClassFactory) || (riid == IID_IUnknown))
  22. {
  23. cRef++;
  24. *ppv = (void *)this;
  25. return NOERROR;
  26. }
  27. *ppv = NULL;
  28. return E_NOINTERFACE;
  29. }
  30. //=--------------------------------------------------------------------------=
  31. // Function name here
  32. //=--------------------------------------------------------------------------=
  33. // Function description
  34. //
  35. // Parameters:
  36. //
  37. // Returns:
  38. //
  39. // Notes:
  40. //
  41. STDMETHODIMP_(ULONG) CSiteManagerFactory::AddRef()
  42. {
  43. return(++cRef);
  44. }
  45. //=--------------------------------------------------------------------------=
  46. // Function name here
  47. //=--------------------------------------------------------------------------=
  48. // Function description
  49. //
  50. // Parameters:
  51. //
  52. // Returns:
  53. //
  54. // Notes:
  55. //
  56. STDMETHODIMP_(ULONG) CSiteManagerFactory::Release()
  57. {
  58. return(--cRef);
  59. }
  60. //=--------------------------------------------------------------------------=
  61. // Function name here
  62. //=--------------------------------------------------------------------------=
  63. // Function description
  64. //
  65. // Parameters:
  66. //
  67. // Returns:
  68. //
  69. // Notes:
  70. //
  71. STDMETHODIMP CSiteManagerFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv)
  72. {
  73. CDownloadSiteMgr *pdsm = NULL;
  74. IUnknown *punk;
  75. HRESULT hr;
  76. if(pUnkOuter != NULL)
  77. return CLASS_E_NOAGGREGATION;
  78. pdsm = new CDownloadSiteMgr(&punk);
  79. if(!pdsm)
  80. return (E_OUTOFMEMORY);
  81. hr = punk->QueryInterface(riid, ppv);
  82. if(FAILED(hr))
  83. delete pdsm;
  84. else
  85. DllAddRef();
  86. punk->Release();
  87. return hr;
  88. }
  89. //=--------------------------------------------------------------------------=
  90. // Function name here
  91. //=--------------------------------------------------------------------------=
  92. // Function description
  93. //
  94. // Parameters:
  95. //
  96. // Returns:
  97. //
  98. // Notes:
  99. //
  100. STDMETHODIMP CSiteManagerFactory::LockServer(BOOL fLock)
  101. {
  102. if(fLock)
  103. DllAddRef();
  104. else
  105. DllRelease();
  106. return NOERROR;
  107. }