Share via

How is this command(pabCommand) constructed?

keith 85 Reputation points
2023-08-15T08:48:26.6566667+00:00

Using Tbsip_ Submit_ Command sends a command to the TPM (Trusted Platform Module) to create a key. How is this command(pabCommand) constructed?

Always return parameter errors in Tbsip_Submit_Command.

TBS_CONTEXT_PARAMS2 pContextParams2 = {0};
pContextParams2.version = TPM_VERSION_20;
pContextParams2.includeTpm20 = 1;
TBS_HCONTEXT phContext = NULL;
TBS_RESULT   result;
result = Tbsi_Context_Create((PCTBS_CONTEXT_PARAMS)&pContextParams2, &phContext);
if(result != TBS_SUCCESS){
    printf("context create failed, contextCreate = %0x", result);
    return -1;
}
BYTE   pabCommand[64] = "TPM_CreateWrapKey";
    BYTE publicKey[128];
    TBS_HANDLE hKey[1024];
    BYTE   abResult[TBS_IN_OUT_BUF_SIZE_MAX];
    PBYTE  *pabResult = abResult;
    UINT32 pcbResult = TBS_IN_OUT_BUF_SIZE_MAX;
    TBS_COMMAND_LOCALITY locality = TBS_COMMAND_LOCALITY_ZERO;
    TBS_COMMAND_PRIORITY priority = TBS_COMMAND_PRIORITY_NORMAL;
    result = Tbsip_Submit_Command(phContext, locality, priority,
                                    pabCommand, sizeof(pabCommand), pabResult, &pcbResult);
    if(result != TBS_SUCCESS){
        Tbsip_Context_Close(phContext);
        return -1;
    }

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Limitless Technology 45,241 Reputation points
    2023-08-16T09:33:30.63+00:00

    Hello there,

    The error message "Always return parameter errors in Tbsip_Submit_Command" suggests that there might be an issue with the parameters being passed to this function.

    Make sure you're passing the correct types of parameters. For example, if the function expects a string parameter, ensure that you're passing a string and not some other data type.

    ps command is used to list the currently running processes and their PIDs along with some other information depends on different options. It reads the process information from the virtual files in /proc file-system. /proc contains virtual files, this is the reason it's referred as a virtual file system.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.