Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk3 min

How to Send Raw TPM Commands and Handle Responses with Windows TBS

Windows TBS submits raw TPM command buffers, but a successful API call does not guarantee TPM success. Learn the context, buffer, error-checking, and decoding steps.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows TBS sends a caller’s TPM command buffer to the TPM and returns a result buffer, but success has two layers: Tbsip_Submit_Command can succeed while the TPM command itself returns an error. Create a context with Tbsi_Context_Create, submit the command, check the TBS return code, and then interpret the TPM response using the specification for that TPM generation and command.

Choose TBS when you need raw TPM access

TPM Base Services (TBS) is the Windows service/API that centralizes TPM access across applications and cooperatively schedules requests using caller priorities. Microsoft recommends higher-level Key Storage APIs for targeted key-storage operations; use TBS when your task requires submitting TPM command buffers directly. See Microsoft’s TPM Base Services overview.

As an Amazon Associate I earn from qualifying purchases.

Create a context for the TPM generation you support

Call Tbsi_Context_Create to obtain a TBS context handle, which you pass to later TBS calls. The context parameters indicate which TPM generation your application supports. For TPM 2.0, configure TBS_CONTEXT_PARAMS2 with version set to TPM_VERSION_20 and includeTpm20 set to 1. If the application should also support TPM 1.2, set includeTpm12 as well. Consult the TBS_CONTEXT_PARAMS2 reference and Tbsi_Context_Create reference for the documented structure and call details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Context creation can fail, including because parameters are invalid, the TBS service is disabled or stopped, too many contexts are open, or no compatible TPM is available. Handle the returned TBS code rather than assuming a usable context was created.

#1 Best Overall
NewHail TPM2.0 Module LPC 14Pin Module with Infineon SLB9665 for ASUS Motherboard Compatible with TPM-M R2.0
  • Compatible with TPM-M R2.0
  • Chipset: Infineon SLB9665
  • PIN DEFINE:14Pin
  • Interface:LPC
  • Please check the Pinout of mainboard at the official website and make sure it compatible with the pinout of TPM module before purchasing, thank you.

Submit the command buffer

Tbsip_Submit_Command accepts the context, a command buffer and its byte count, a locality, a priority, and a result buffer with an in/out size. In pcbResult, provide the output buffer capacity before the call; on return it indicates the result length, or the required size if that buffer was too small. Microsoft also documents that the input and output buffers may be the same buffer. The function reference is at Tbsip_Submit_Command.

  • pabCommand and cbCommand identify the submitted bytes and their length.
  • pabResult points to the result buffer.
  • pcbResult supplies its capacity and receives the returned or required size.
  • Locality and priority are explicit call parameters. Microsoft documents locality zero as the only currently supported locality. Priorities include low, normal, high, system, and max.

The documented development files are tbs.h, Tbs.lib, and Tbs.dll. The function reference lists desktop support beginning with Windows Vista and Windows Server 2008; check the current requirements for your specific Windows target.

Rank #2
Sale
Yeiwenl TPM 2.0 Module with 14 Pin, TPM 2.0 Encryption Security Module for ASUS Motherboard Compatible with Win11
  • TPM 2.0 module for Asus motherboard.
  • TPM 2.0 module chip 2.0mm pitch, 2x7P, 14 pin security module
  • LPC 14 Pin for AsusTPM chip is better compatible with DDR4 memory module of motherboard, built in support memory type higher than DDR3! Supported states may vary by motherboard specification.
  • Note: Don't support laptops and motherboards prior to X99; Don't support DDR3 memory.
  • Packing list:1x TPM 2.0 Module for ASUS

Check the TBS result and TPM response separately

First inspect the function’s TBS_RESULT. A failed TBS call returns a TBS error code: the Windows API operation did not complete successfully. If the call returns TBS_SUCCESS, inspect the result buffer as well. It contains the TPM command result and can hold a standard TPM error, so API success does not establish that the TPM command succeeded.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • TBS failure: handle the returned TBS code as an API or submission/processing failure.
  • TBS success with a TPM error: the request reached the response stage, but the TPM reported an error in its response. Decode that response under the applicable TPM command definition.
  • TBS success with a successful TPM response: interpret the remaining response fields under that same command definition.

Use the TPM specification to decode response bytes

The TBS call documentation explains the result buffer’s role and error distinction; it does not define a general response header layout, byte order, response-tag rules, or command-specific payload schema. Do not infer byte offsets from the TBS function signature. Identify the TPM generation and command you submitted, then use the corresponding normative TPM specification and command definition to parse the response. Without that definition, a byte-level decoder would be guesswork.

Rank #3
Sale
Yeiwenl TPM 2.0 Module 18 Pin, TPM 2.0 Encryption Security Module for ASROCK Motherboard Compatible with Win11
  • TPM 2.0 module for ASROCK motherboard.
  • TPM 2.0 module chip 2.0mm pitch, 2x9P, 18 pin security module for ASROCK
  • LPC 18 Pin for TPM chip is better compatible with DDR4 memory module of motherboard, built in support memory type higher than DDR3! Supported states may vary by motherboard specification.
  • Note: Don't support laptops and motherboards prior to X99; Don't support DDR3 memory.
  • Packing list:1x TPM 2.0 Module for ASROCK
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Close the context when finished

Use Tbsip_Context_Close to close the context and release its associated resources and binding handle. Microsoft lists this function in the TBS header reference.

Quick Recap

Bestseller No. 1
NewHail TPM2.0 Module LPC 14Pin Module with Infineon SLB9665 for ASUS Motherboard Compatible with TPM-M R2.0
NewHail TPM2.0 Module LPC 14Pin Module with Infineon SLB9665 for ASUS Motherboard Compatible with TPM-M R2.0
Compatible with TPM-M R2.0; Chipset: Infineon SLB9665; PIN DEFINE:14Pin; Interface:LPC
$24.99
SaleBestseller No. 2
Yeiwenl TPM 2.0 Module with 14 Pin, TPM 2.0 Encryption Security Module for ASUS Motherboard Compatible with Win11
Yeiwenl TPM 2.0 Module with 14 Pin, TPM 2.0 Encryption Security Module for ASUS Motherboard Compatible with Win11
TPM 2.0 module for Asus motherboard.; TPM 2.0 module chip 2.0mm pitch, 2x7P, 14 pin security module
$23.74
SaleBestseller No. 3
Yeiwenl TPM 2.0 Module 18 Pin, TPM 2.0 Encryption Security Module for ASROCK Motherboard Compatible with Win11
Yeiwenl TPM 2.0 Module 18 Pin, TPM 2.0 Encryption Security Module for ASROCK Motherboard Compatible with Win11
TPM 2.0 module for ASROCK motherboard.; TPM 2.0 module chip 2.0mm pitch, 2x9P, 18 pin security module for ASROCK
$23.74
SaleBestseller No. 4
SaleBestseller No. 5
Yeiwenl TPM 2.0 Encryption Security Module with 12 pin Compatible with Windows 11 for GIGABYTE Motherboard
Yeiwenl TPM 2.0 Encryption Security Module with 12 pin Compatible with Windows 11 for GIGABYTE Motherboard
TPM modules are suitable for GIGABYTE for Windows 11 motherboards.; Interface: LPC; Packing list:1x TPM 2.0 Module for GIGABYTE
$23.74
Best Value
Sale
Yeiwenl TPM 2.0 Encryption Security Module with 12 pin Compatible with Windows 11 for GIGABYTE Motherboard
  • TPM modules are suitable for GIGABYTE for Windows 11 motherboards.
  • Some motherboards require a TPM module inserted or an update to the latest BIOS to enable the TPM option.
  • 12Pin Remote Card Encryption Security Module Is Easy To Use, No Complicated Procedures Are Required, And It Can Be Used Immediately After Installation.
  • Interface: LPC
  • Packing list:1x TPM 2.0 Module for GIGABYTE
Rank #4
Sale
Yeiwenl TPM 2.0 Module with 20-1 Pin, TPM 2.0 Encryption Security Module for ASUS Motherboard Compatible with Win11
  • Compatible with ASUS motherboards with 20-1 pin TPM header; Please check your motherboard manual to confirm the presence of a 20-1pin TPM header before purchasing. Not compatible with ASUS X570-P or other models with other TPM header
  • TPM 2.0 module 2.54mm pitch, 2x10P, 20-1 pin security module
  • LPC 20-1Pin for AsusTPM chip is better compatible with DDR4 memory module of motherboard, built in support memory type higher than DDR3! Supported states may vary by motherboard specification.
  • Note: Don't support laptops and motherboards prior to X99; Don't support DDR3 memory.If you are unsure whether your motherboard is compatible with our TPM module, please verify with us before making a purchase. Thank you.
  • Packing list:1x TPM 2.0 Module for ASUS (Doesn't fit the connector on a ASUS Prime X570-P motherboard)

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.