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.

49 lines
1000 B

  1. /*
  2. * _ S O F . H
  3. *
  4. * Stream on file implementation class
  5. *
  6. * Copyright 1986-1997 Microsoft Corporation, All Rights Reserved
  7. */
  8. #ifndef __SOF_H_
  9. #define __SOF_H_
  10. #include <nonimpl.h>
  11. // StmOnFile -----------------------------------------------------------------
  12. //
  13. class StmOnFile : public CStreamNonImpl
  14. {
  15. private:
  16. HANDLE m_hf;
  17. public:
  18. StmOnFile(HANDLE hf) : m_hf(hf) {}
  19. ~StmOnFile() {}
  20. virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read(
  21. /* [length_is][size_is][out] */ void __RPC_FAR *,
  22. /* [in] */ ULONG,
  23. /* [out] */ ULONG __RPC_FAR *);
  24. virtual /* [local] */ HRESULT STDMETHODCALLTYPE Write(
  25. /* [size_is][in] */ const void __RPC_FAR * pb,
  26. /* [in] */ ULONG cb,
  27. /* [out] */ ULONG __RPC_FAR * pcb);
  28. virtual HRESULT STDMETHODCALLTYPE Commit(
  29. /* [in] */ DWORD)
  30. {
  31. // Flush the file to disk
  32. //
  33. if (!FlushFileBuffers (m_hf))
  34. return HRESULT_FROM_WIN32(GetLastError());
  35. return S_OK;
  36. }
  37. };
  38. #endif // __SOF_H_