Skip to content

Commit 84fc5b4

Browse files
committed
TPM (Windows): corrently report TPM device is not found
Fix #1314
1 parent 729085e commit 84fc5b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/detection/tpm/tpm_windows.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
// #include <tbs.h>
55

6-
#define TBS_SUCCESS 0u
7-
#define TBS_E_INTERNAL_ERROR 0x80284001u
8-
#define TBS_E_INVALID_CONTEXT 0x80284004u
96
typedef UINT32 TBS_RESULT;
7+
#define TBS_SUCCESS 0u
8+
#define TBS_E_TPM_NOT_FOUND ((TBS_RESULT) 0x8028400Fu)
109

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

4746
switch (deviceInfo.tpmVersion)
4847
{

0 commit comments

Comments
 (0)