Source code of Windows XP (NT5)
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.

63 lines
827 B

  1. //
  2. // UTILWINC.C
  3. //
  4. // Copyright (C) Microsoft Corporation, 1995
  5. //
  6. // Operating system interfaces for Windows environments.
  7. //
  8. #include "pch.h"
  9. BOOL
  10. INTERNAL
  11. RgReadFile(
  12. HFILE hFile,
  13. LPVOID lpBuffer,
  14. UINT ByteCount
  15. )
  16. {
  17. UINT BytesRead;
  18. BytesRead = _lread(hFile, lpBuffer, ByteCount);
  19. return ByteCount == BytesRead;
  20. }
  21. BOOL
  22. INTERNAL
  23. RgWriteFile(
  24. HFILE hFile,
  25. LPVOID lpBuffer,
  26. UINT ByteCount
  27. )
  28. {
  29. UINT BytesWritten;
  30. BytesWritten = _lwrite(hFile, lpBuffer, ByteCount);
  31. return ByteCount == BytesWritten;
  32. }
  33. #ifndef FILE_BEGIN
  34. #define FILE_BEGIN SEEK_SET
  35. #endif
  36. BOOL
  37. INTERNAL
  38. RgSeekFile(
  39. HFILE hFile,
  40. LONG FileOffset
  41. )
  42. {
  43. LONG NewFileOffset;
  44. NewFileOffset = _llseek(hFile, FileOffset, FILE_BEGIN);
  45. return FileOffset == NewFileOffset;
  46. }