Windows NT 4.0 source code leak
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.

45 lines
1.4 KiB

4 years ago
  1. #ifdef DESCRIPTION
  2. *************************** DESCRIPTION ***********************************
  3. The class is specific to hc, and is designed to prevent the creation of
  4. temporary files by using global memory instead. Writing to the file will
  5. copy the data to memory until the total amount of data exceeds a reasonable
  6. size, at which point a temporary file will be created and all data from
  7. that point on will be written to the temporary file. Since the compiler
  8. tends to generate oodles of small temporary files, this should reduce or
  9. eliminate the actual number of temporary files.
  10. *************************************************************************
  11. #endif // DESCRIPTION
  12. #ifndef _CTMPFILE_INCLUDED
  13. #define _CTMPFILE_INCLUDED
  14. class CTmpFile
  15. {
  16. public:
  17. CTmpFile(void);
  18. ~CTmpFile(void);
  19. int STDCALL seek(int lPos, int wOrg);
  20. int STDCALL tell(void) { return FilePtr; };
  21. int STDCALL write(void* qv, int lcb);
  22. int STDCALL read(void* qv, int lcb);
  23. RC_TYPE STDCALL copyfromfile(HFILE hfSrc, DWORD lcb);
  24. RC_TYPE STDCALL copytofile(HFILE hfDst, DWORD lcb);
  25. HFILE hf; // != HFILE_ERROR when a real file has been created
  26. PSTR pszFileName; // temporary filename if one is created
  27. protected:
  28. PBYTE pmem;
  29. int cbAlloc; // current memory allocated for temporary file
  30. int cbFile; // current size of the file
  31. int FilePtr; // current file pointer
  32. };
  33. #endif // _CTMPFILE_INCLUDED