Skip to content

Commit

Permalink
TPM (Windows): corrently report TPM device is not found
Browse files Browse the repository at this point in the history
Fix #1314
  • Loading branch information
CarterLi committed Oct 4, 2024
1 parent 729085e commit 84fc5b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/detection/tpm/tpm_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

// #include <tbs.h>

#define TBS_SUCCESS 0u
#define TBS_E_INTERNAL_ERROR 0x80284001u
#define TBS_E_INVALID_CONTEXT 0x80284004u
typedef UINT32 TBS_RESULT;
#define TBS_SUCCESS 0u
#define TBS_E_TPM_NOT_FOUND ((TBS_RESULT) 0x8028400Fu)

#define TPM_VERSION_UNKNOWN 0
#define TPM_VERSION_12 1
Expand Down Expand Up @@ -42,7 +41,7 @@ const char* ffDetectTPM(FFTPMResult* result)
TPM_DEVICE_INFO deviceInfo = {};
TBS_RESULT code = ffTbsi_GetDeviceInfo(sizeof(deviceInfo), &deviceInfo);
if (code != TBS_SUCCESS)
return code == (TBS_RESULT) TBS_E_INVALID_CONTEXT ? "TPM device is not found" : "Tbsi_GetDeviceInfo() failed";
return code == TBS_E_TPM_NOT_FOUND ? "TPM device is not found" : "Tbsi_GetDeviceInfo() failed";

switch (deviceInfo.tpmVersion)
{
Expand Down

0 comments on commit 84fc5b4

Please sign in to comment.