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
1.4 KiB

  1. #define BCFILE 0
  2. #define LINFILE 1
  3. //////////////////// RFILE Class ///////////////////////
  4. typedef struct
  5. {
  6. WORD wAtt;
  7. WORD wPage;
  8. hSecureFile hsecfile;
  9. }
  10. RFILE, FAR* LPRFILE;
  11. // Need to remember encodings of files, but don't want to increase the NVRAM
  12. // storage requirements for an array of struct RFILE
  13. typedef struct
  14. {
  15. LPRFILE lpRFile;
  16. DWORD Encoding;
  17. DWORD dwFlush;
  18. DWORD dwEndMetaData;
  19. }
  20. RXSFILE, FAR* LPRXSFILE;
  21. typedef struct
  22. {
  23. WORD wSigRF;
  24. WORD wNumEntries;
  25. LPRFILE lpRFileTail; // last valid item
  26. LPRFILE lpRFileHead; // first free item
  27. // empty if Head==Tail. Full if ((Head+1) mod N)==Tail
  28. WORD wFlags; // see below
  29. WORD dummy; // sizeof(RFILEHDR)==sizeof(RFILE) must be true
  30. }
  31. RFILEHDR, FAR* LPRFILEHDR;
  32. #define NVBUFSIZE 2048
  33. #define NUMSPECIAL 2
  34. #define NUMGENERAL 120
  35. #define SIG_RF 0x4d41
  36. // wFlags
  37. #define RFILE_NO_NVRAM 1 // if this flag set then RFILE list is in regular RAM!
  38. #define lprfLim (lprfStart + NUMGENERAL)
  39. #define lprfTail (lprfHdr->lpRFileTail)
  40. #define lprfHead (lprfHdr->lpRFileHead)
  41. #define RFileGetCount() \
  42. ( (lprfHead >= lprfTail) ? ((WORD)(lprfHead-lprfTail)) : ((WORD)(NUMGENERAL-(lprfTail-lprfHead))) )
  43. #define MyRegisterSecFile(lprfHdr, lphsec) \
  44. ((lprfHdr->wFlags & RFILE_NO_NVRAM) ? TRUE : RegisterSecFile(lphsec))
  45. #define MyUnRegisterSecFile(lprfHdr, lphsec) \
  46. ((lprfHdr->wFlags & RFILE_NO_NVRAM) ? TRUE : UnRegisterSecFile(lphsec))