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.

41 lines
1.0 KiB

  1. /*****************************************************************************
  2. *
  3. * io.c
  4. *
  5. *****************************************************************************/
  6. #include "m4.h"
  7. /*****************************************************************************
  8. *
  9. * WriteHfPvCb
  10. *
  11. * Write bytes to a stream or die.
  12. *
  13. *****************************************************************************/
  14. void STDCALL
  15. WriteHfPvCb(HF hf, PCVOID pv, CB cb)
  16. {
  17. CB cbRc = cbWriteHfPvCb(hf, pv, cb);
  18. /* Don't Die() if we couldn't write to hfErr or we will recurse to death */
  19. if (cb != cbRc && hf != hfErr) {
  20. Die("error writing");
  21. }
  22. }
  23. #ifdef POSIX
  24. /*****************************************************************************
  25. *
  26. * GetTempFileName
  27. *
  28. *****************************************************************************/
  29. UINT
  30. GetTempFileName(PCSTR pszPath, PCSTR pszPrefix, UINT uiUnique, PTCH ptchBuf)
  31. {
  32. sprintf(ptchBuf, "%s/%sXXXXXX", pszPath, pszPrefix);
  33. return (UINT)mktemp(ptchBuf);
  34. }
  35. #endif