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.

88 lines
2.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: CLOCKBYT.CXX
  7. //
  8. // Contents:
  9. //
  10. // Classes: Implements the ILockBytes base class.
  11. //
  12. // Functions:
  13. //
  14. // History: 12-01-95 JoeS (Joe Souza) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #include <urlint.h>
  18. #include <urlmon.hxx>
  19. #include "clockbyt.hxx"
  20. CLockBytes::CLockBytes() : _CRefs()
  21. {
  22. }
  23. STDMETHODIMP CLockBytes::QueryInterface
  24. (REFIID riid, LPVOID FAR* ppvObj)
  25. {
  26. VDATETHIS(this);
  27. UrlMkDebugOut((DEB_ILOCKBYTES, "%p IN CLockBytes::QueryInterface\n", this));
  28. HRESULT hresult = NOERROR;
  29. if ( IsEqualIID(riid, IID_IUnknown)
  30. || IsEqualIID(riid, IID_ILockBytes)
  31. )
  32. {
  33. *ppvObj = this;
  34. }
  35. else
  36. {
  37. *ppvObj = NULL;
  38. hresult = E_NOINTERFACE;
  39. }
  40. if (*ppvObj)
  41. AddRef();
  42. UrlMkDebugOut((DEB_ILOCKBYTES, "%p OUT CLockBytes::QueryInterface\n", this));
  43. return hresult;
  44. }
  45. STDMETHODIMP_(ULONG) CLockBytes::AddRef(void)
  46. {
  47. VDATETHIS(this);
  48. UrlMkDebugOut((DEB_ILOCKBYTES, "%p IN CLockBytes::AddRef\n", this));
  49. LONG lRet = ++_CRefs;
  50. UrlMkDebugOut((DEB_ILOCKBYTES, "%p OUT CLockBytes::AddRef\n", this));
  51. return lRet;
  52. }
  53. HRESULT CLockBytes::Flush()
  54. {
  55. UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::Flush (NoOp)\n", this));
  56. return(NOERROR);
  57. }
  58. HRESULT CLockBytes::LockRegion(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,
  59. DWORD dwLockType)
  60. {
  61. UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::LockRegion (NoOp)\n", this));
  62. return(NOERROR);
  63. }
  64. HRESULT CLockBytes::UnlockRegion(THIS_ ULARGE_INTEGER libOffset,
  65. ULARGE_INTEGER cb, DWORD dwLockType)
  66. {
  67. UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::UnlockRegion (NoOp)\n", this));
  68. return(NOERROR);
  69. }
  70. HRESULT CLockBytes::Stat(THIS_ STATSTG FAR *pStatStg, DWORD grfStatFlag)
  71. {
  72. UrlMkDebugOut((DEB_ILOCKBYTES, "%p CLockBytes::Stat (NoOp)\n", this));
  73. return(STG_E_UNKNOWN);
  74. }