|
- CALL GetTPMInfos "%&SystemROOT%\System32\tbs.dll" &&HaveTPM &&TPM_VERSION &&TPM_Type
- MESS. <%&&HaveTPM%><%&&TPM_VERSION%><%&&TPM_Type%>
- _SUB GetTPMInfos
- ENVI-ret %~2=UnKnown
- ENVI-ret %~3=
- ENVI-ret %~4=
- CALL $--ret:&&htbs --cd ,-LoadLibrary,^%~1
- //MESS. %&&htbs%
- IFEX #%&&htbs%=0,EXIT
- ENVI &&htbs=*%&&htbs%
- ENVI &&TBS_SUCCESS=0 //0x0 功能成功。
- ENVI &&TBS_E_BAD_PARAMETER=2150121474 //0x80284002 一个或多个参数值无效。
- ENVI &&TBS_E_TPM_NOT_FOUND=2150121487 //0x8028400F 在此计算机上找不到兼容的可信平台模块 (TPM) 安全设备。
- ENVI &&TPM_DEVICE_INFO.Size=16
- ENVI$# &&TPM_DEVICE_INFO=*%&&TPM_DEVICE_INFO.Size% 0
- CALL $--qd --ret:&&Tbsi_GetDeviceInfoRet %&&htbs%,Tbsi_GetDeviceInfo,#%&&TPM_DEVICE_INFO.Size%,*&&TPM_DEVICE_INFO
- FIND *=&&Tbsi_GetDeviceInfoRet,
- {*
- ENVI-ret %~2=UnKnown
- }!
- {*
- IFEX #%&&Tbsi_GetDeviceInfoRet%=%&&TBS_SUCCESS%,
- {*
- ENVI-ret %~2=Exist
- //MESS. %&&Tbsi_GetDeviceInfoRet%
-
- ENVI &&TPM_VERSION_UNKNOWN=0
- ENVI &&TPM_VERSION_12=1
- ENVI &&TPM_VERSION_20=2
-
- ENVI &&TPM_IFTYPE_UNKNOWN=0
- ENVI &&TPM_IFTYPE_1=1 // for 1.2 - use I/O-port or MMIO
- ENVI &&TPM_IFTYPE_TRUSTZONE=2 // 2.0: Trustzone
- ENVI &&TPM_IFTYPE_HW=3 // 2.0: HW TPM
- ENVI &&TPM_IFTYPE_EMULATOR=4 // 2.0: SW-emulator
- ENVI &&TPM_IFTYPE_SPB=5 // 2.0: SPB attached
-
- ENVI?int &&TPM_DEVICE_INFO=&&structVersion
- ENVI?int &&TPM_DEVICE_INFO=&&tpmVersion:~1
- IFEX #%&&tpmVersion%=%&&TPM_VERSION_UNKNOWN%,
- {*
- ENVI-ret %~3=UnKnownVersion
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_VERSION_12%,
- {*
- ENVI-ret %~3=1.2
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_VERSION_20%,
- {*
- ENVI-ret %~3=2.0
- }!
- {*
- ENVI-ret %~3=%&&tpmVersion%
- }
- }
- }
- ENVI?int &&TPM_DEVICE_INFO=&&tpmInterfaceType:~2
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_UNKNOWN%,
- {*
- ENVI-ret %~4=UnKnownType
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_1%,
- {*
- ENVI-ret %~4=1.2 - use I/O-port or MMIO
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_TRUSTZONE%,
- {*
- ENVI-ret %~4=2.0: Trustzone
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_HW%,
- {*
- ENVI-ret %~4=2.0: HW TPM
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_EMULATOR%,
- {*
- ENVI-ret %~4=2.0: SW-emulator
- }!
- {*
- IFEX #%&&tpmVersion%=%&&TPM_IFTYPE_SPB%,
- {*
- ENVI-ret %~4=2.0: SPB attached
- }
- }
- }
- }
- }
- }
- ENVI?int &&TPM_DEVICE_INFO=&&tpmImpRevision:~3
- //MESS. <%&structVersion%><%&tpmVersion%><%&tpmInterfaceType%><%&tpmImpRevision%>
- }!
- {*
- IFEX #%&&Tbsi_GetDeviceInfoRet%=%&&TBS_E_TPM_NOT_FOUND%,
- {*
- ENVI-ret %~2=Not exist
- }
- }
- }
- _END
复制代码
|
评分
-
查看全部评分
|