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.

35 lines
724 B

  1. //
  2. // UTILW32C.C
  3. //
  4. // Copyright (C) Microsoft Corporation, 1995
  5. //
  6. // Operating system interfaces for Win32 environments.
  7. //
  8. #include "pch.h"
  9. //
  10. // RgCreateTempFile
  11. //
  12. // Returns the path through lpFileName and a file handle of a temporary file
  13. // located in the same directory as lpFileName. lpFileName must specify the
  14. //
  15. HFILE
  16. INTERNAL
  17. RgCreateTempFile(
  18. LPSTR lpFileName
  19. )
  20. {
  21. HFILE hFile;
  22. if (GetTempFileName(lpFileName, "reg", 0, lpFileName) > 0) {
  23. if ((hFile = RgOpenFile(lpFileName, OF_WRITE)) != HFILE_ERROR)
  24. return hFile;
  25. DeleteFile(lpFileName);
  26. }
  27. DEBUG_OUT(("RgCreateTempFile failed\n"));
  28. return HFILE_ERROR;
  29. }