1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_TBS
#define _INC_TBS
#if (_WIN32_WINNT >= 0x0600)
#ifdef __cplusplus
extern "C" {
#endif
typedef UINT32 TBS_RESULT;
typedef enum _TBS_COMMAND_LOCALITY {
TBS_COMMAND_LOCALITY_ZERO = 0,
TBS_COMMAND_LOCALITY_ONE,
TBS_COMMAND_LOCALITY_TWO,
TBS_COMMAND_LOCALITY_THREE,
TBS_COMMAND_LOCALITY_FOUR
} TBS_COMMAND_LOCALITY;
typedef enum _TBS_COMMAND_PRIORITY {
TBS_COMMAND_PRIORITY_LOW = 100,
TBS_COMMAND_PRIORITY_NORMAL = 200,
TBS_COMMAND_PRIORITY_HIGH = 300,
TBS_COMMAND_PRIORITY_SYSTEM = 400,
TBS_COMMAND_PRIORITY_MAX = 0x80000000
} TBS_COMMAND_PRIORITY;
typedef struct _TBS_CONTEXT_PARAMS {
UINT32 version;
} TBS_CONTEXT_PARAMS;
/* Added for Windows 8 */
#define TBS_CONTEXT_VERSION_TWO 2
#define TBS_SUCCESS 0
typedef struct tdTBS_CONTEXT_PARAMS2
{
UINT32 version;
union
{
struct
{
UINT32 requestRaw : 1; // if set to 1, request raw context
UINT32 includeTpm12 : 1; // if 1.2 device present, can use this
UINT32 includeTpm20 : 1; // if 2.0 device present, can use this
};
UINT32 asUINT32;
};
} TBS_CONTEXT_PARAMS2, *PTBS_CONTEXT_PARAMS2;
typedef LPVOID TBS_HCONTEXT;
#if defined TPM_WINDOWS_TBSI_WIN7
TBS_RESULT WINAPI Tbsi_Context_Create(const TBS_CONTEXT_PARAMS *pContextParams,TBS_HCONTEXT *phContext);
#elif defined TPM_WINDOWS_TBSI_WIN8
TBS_RESULT WINAPI Tbsi_Context_Create(const TBS_CONTEXT_PARAMS2 *pContextParams,TBS_HCONTEXT *phContext);
#endif
TBS_RESULT WINAPI Tbsi_Get_TCG_Log(TBS_HCONTEXT hContext,BYTE *pOutputBuf,UINT32 *pOutputBufLen);
TBS_RESULT WINAPI Tbsi_Physical_Presence_Command(TBS_HCONTEXT hContext,const BYTE *pInputBuf,UINT32 InputBufLen,BYTE *pOutputBuf,UINT32 *pOutputBufLen);
TBS_RESULT WINAPI Tbsip_Cancel_Commands(TBS_HCONTEXT hContext);
TBS_RESULT WINAPI Tbsip_Context_Close(TBS_HCONTEXT hContext);
TBS_RESULT WINAPI Tbsip_Submit_Command(TBS_HCONTEXT hContext,TBS_COMMAND_LOCALITY locality,TBS_COMMAND_PRIORITY priority,const BYTE *pCommandBuf,UINT32 commandBufLen,BYTE *pResultBuf,UINT32 *pResultBufLen);
#ifdef __cplusplus
}
#endif
#endif /*(_WIN32_WINNT >= 0x0600)*/
#endif /*_INC_TBH*/
|