3
* Licensed Materials - Property of IBM
5
* trousers - An open source TCG Software Stack
7
* (C) Copyright International Business Machines Corp. 2004-2007
15
#include "trousers/tss.h"
16
#include "trousers/trousers.h"
17
#include "trousers_types.h"
18
#include "spi_utils.h"
19
#include "capabilities.h"
25
Tspi_TPM_ReadCounter(TSS_HTPM hTPM, /* in */
26
UINT32* counterValue) /* out */
28
TSS_HCONTEXT tspContext;
30
TSS_COUNTER_ID counterID;
31
TPM_COUNTER_VALUE counter_value;
33
if (counterValue == NULL)
34
return TSPERR(TSS_E_BAD_PARAMETER);
36
if ((result = obj_tpm_get_tsp_context(hTPM, &tspContext)))
39
if ((result = obj_tpm_get_current_counter(hTPM, &counterID)))
42
if ((result = TCS_API(tspContext)->ReadCounter(tspContext, counterID, &counter_value)))
45
*counterValue = counter_value.counter;