+// Part 2, section 7.4: TPM_PERMANENT_DATA\r
+//\r
+#define TPM_MIN_COUNTERS 4 ///< the minimum number of counters is 4\r
+#define TPM_DELEGATE_KEY TPM_KEY\r
+#define TPM_NUM_PCR 16\r
+#define TPM_MAX_NV_WRITE_NOOWNER 64\r
+\r
+//\r
+// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability\r
+//\r
+#define TPM_PD_REVMAJOR ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_PD_REVMINOR ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_PD_TPMPROOF ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_PD_OWNERAUTH ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_PD_OPERATORAUTH ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_PD_MANUMAINTPUB ((TPM_CAPABILITY_AREA) 6)\r
+#define TPM_PD_ENDORSEMENTKEY ((TPM_CAPABILITY_AREA) 7)\r
+#define TPM_PD_SRK ((TPM_CAPABILITY_AREA) 8)\r
+#define TPM_PD_DELEGATEKEY ((TPM_CAPABILITY_AREA) 9)\r
+#define TPM_PD_CONTEXTKEY ((TPM_CAPABILITY_AREA) 10)\r
+#define TPM_PD_AUDITMONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 11)\r
+#define TPM_PD_MONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 12)\r
+#define TPM_PD_PCRATTRIB ((TPM_CAPABILITY_AREA) 13)\r
+#define TPM_PD_ORDINALAUDITSTATUS ((TPM_CAPABILITY_AREA) 14)\r
+#define TPM_PD_AUTHDIR ((TPM_CAPABILITY_AREA) 15)\r
+#define TPM_PD_RNGSTATE ((TPM_CAPABILITY_AREA) 16)\r
+#define TPM_PD_FAMILYTABLE ((TPM_CAPABILITY_AREA) 17)\r
+#define TPM_DELEGATETABLE ((TPM_CAPABILITY_AREA) 18)\r
+#define TPM_PD_EKRESET ((TPM_CAPABILITY_AREA) 19)\r
+#define TPM_PD_MAXNVBUFSIZE ((TPM_CAPABILITY_AREA) 20)\r
+#define TPM_PD_LASTFAMILYID ((TPM_CAPABILITY_AREA) 21)\r
+#define TPM_PD_NOOWNERNVWRITE ((TPM_CAPABILITY_AREA) 22)\r
+#define TPM_PD_RESTRICTDELEGATE ((TPM_CAPABILITY_AREA) 23)\r
+#define TPM_PD_TPMDAASEED ((TPM_CAPABILITY_AREA) 24)\r
+#define TPM_PD_DAAPROOF ((TPM_CAPABILITY_AREA) 25)\r
+\r
+///\r
+/// Part 2, section 7.5: TPM_STCLEAR_DATA\r
+/// available inside TPM only\r
+///\r
+ typedef struct tdTPM_STCLEAR_DATA{\r
+ TPM_STRUCTURE_TAG tag;\r
+ TPM_NONCE contextNonceKey;\r
+ TPM_COUNT_ID countID;\r
+ UINT32 ownerReference;\r
+ BOOLEAN disableResetLock;\r
+ TPM_PCRVALUE PCR[TPM_NUM_PCR];\r
+ UINT32 deferredPhysicalPresence;\r
+ }TPM_STCLEAR_DATA;\r
+\r
+//\r
+// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability\r
+//\r
+#define TPM_SD_CONTEXTNONCEKEY ((TPM_CAPABILITY_AREA)0x00000001)\r
+#define TPM_SD_COUNTID ((TPM_CAPABILITY_AREA)0x00000002)\r
+#define TPM_SD_OWNERREFERENCE ((TPM_CAPABILITY_AREA)0x00000003)\r
+#define TPM_SD_DISABLERESETLOCK ((TPM_CAPABILITY_AREA)0x00000004)\r
+#define TPM_SD_PCR ((TPM_CAPABILITY_AREA)0x00000005)\r
+#define TPM_SD_DEFERREDPHYSICALPRESENCE ((TPM_CAPABILITY_AREA)0x00000006)\r
+\r
+//\r
+// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability\r
+//\r
+#define TPM_AD_CONTEXTNONCESESSION ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_AD_AUDITDIGEST ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_AD_CURRENTTICKS ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_AD_CONTEXTCOUNT ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_AD_CONTEXTLIST ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_AD_SESSIONS ((TPM_CAPABILITY_AREA) 6)\r