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.

82 lines
3.2 KiB

  1. /*******************************************************************
  2. *
  3. * DESCRIPTION: protection header file
  4. *
  5. * AUTHOR: arie tamam
  6. *
  7. * HISTORY: created november 14, 2000
  8. *
  9. *******************************************************************/
  10. #ifndef PROTECT_MDOCP_H
  11. #define PROTECT_MDOCP_H
  12. /** include files **/
  13. /** local definitions **/
  14. /* protection types */
  15. /* default settings */
  16. /** external functions **/
  17. extern FLStatus protectionBoundries(FLFlash vol, byte area ,
  18. CardAddress* addressLow ,
  19. CardAddress* addressHigh ,
  20. byte floorNo);
  21. extern FLStatus protectionKeyInsert(FLFlash vol, byte area, byte FAR1* key);
  22. extern FLStatus protectionKeyRemove(FLFlash vol, byte area);
  23. extern FLStatus protectionType(FLFlash vol, byte area, word* flag);
  24. extern FLStatus setStickyBit(FLFlash * flash);
  25. #ifndef FL_READ_ONLY
  26. extern FLStatus protectionSet ( FLFlash vol, byte area, word flag,
  27. CardAddress addressLow,
  28. CardAddress addressHigh,
  29. byte FAR1* key , byte modes, byte floorNo);
  30. #endif /* FL_READ_ONLY */
  31. /** external data **/
  32. /** internal functions **/
  33. /** public data **/
  34. /** private data **/
  35. /** public functions **/
  36. /** private functions **/
  37. typedef byte HWKey[8];
  38. typedef struct {
  39. LEulong addressLow;
  40. LEulong addressHigh;
  41. HWKey key;
  42. byte protectionType;
  43. byte checksum;
  44. }DPSStruct;
  45. #define NdataProtect0Status 0x105C /* Data Protect Structure Status register[0].read only */
  46. #define NdataProtect1Status 0x105D /* Data Protect Structure Status register[1].read only */
  47. #define PROTECT_STAT_KEY_OK_MASK 0x10 /* 1=key correctly written */
  48. #define PROTECT_STAT_LOCK_MASK 0x8 /* value of this bit in data protect structure */
  49. #define PROTECT_STAT_WP_MASK 0x4 /* write protect. value of this bit in data protect structure */
  50. #define PROTECT_STAT_RP_MASK 0x2 /* read protect. value of this bit in data protect structure */
  51. #define NdataProtect0Pointer 0x105E /*Data Protect Structure Pointer register[0]. read only */
  52. #define NdataProtect1Pointer 0x105F /*Data Protect Structure Pointer register[1]. read only */
  53. #define PROTECT_POINTER_HN_MASK 0xf0 /* high nibble. */
  54. #define PROTECT_POINTER_LN_MASK 0xf0 /* low nibble. */
  55. #define NdataProtect0LowAddr 0x1060 /*Data Protect Lower Address register 0 [3:0].read only*/
  56. #define NdataProtect0UpAddr 0x1064 /*Data Protect Upper Address register 0 [3:0].read only*/
  57. #define NdataProtect1LowAddr 0x1068 /*Data Protect Lower Address register 1 [3:0].read only*/
  58. #define NdataProtect1UpAddr 0x106C /*Data Protect Upper Address register 1 [3:0].read only*/
  59. #define NdataProtect0Key 0x1070 /*Data Protect Key register[0]. write only*/
  60. #define NdataProtect1Key 0x1072 /*Data Protect Key register[1]. write only*/
  61. /* DPS values */
  62. #define DPS_READ_PROTECTED 0x2
  63. #define DPS_WRITE_PROTECTED 0x4
  64. #define DPS_LOCK_ENABLED 0x8
  65. #endif /* PROTECT_MDOCP_H */