Hi @Matthew Johnson ,
Thank for posting your issue.
There is an additional Microsoft-authored, API-specific source relevant to this discrepancy: https://github.com/microsoft/TSS.MSR/blob/main/PCPTool.v11/Using%20the%20Windows%208%20Platform%20Crypto%20Provider%20and%20Associated%20TPM%20Functionality.pdf, printed pages 27–28, under "Obtaining the TPM Version."
That section explicitly documents Tbsi_GetDeviceInfo and states that:
- Successful output contains four 4-byte fields at offsets 0, 4, 8, and 12.
- The first field identifies the output structure's version and is returned as 1.
- The second field contains
TPM_VERSION_12orTPM_VERSION_20. - The remaining two fields are reserved.
- An undersized
SizeproducesTBS_E_BAD_PARAMETER.
This supports your concern about the current structure reference. The three version concepts are separate:
-
structVersionidentifies the device-information schema. -
tpmVersionidentifies the TPM version. - The context-input version identifies the parameters supplied to
Tbsi_Context_Create. Microsoft's publishedtbs.hdefines those constants separately asTBS_CONTEXT_VERSION_ONEandTBS_CONTEXT_VERSION_TWO.
The _Out_writes_bytes_(Size) annotation also supports a caller providing storage without initializing its contents; Microsoft's SAL documentation permits uninitialized initial contents for that annotation. However, this does not establish the stronger implementation-level guarantee that no initial byte is ever read.
The white paper is historical documentation, so it does not resolve your full compatibility and operational questions. I have not found an explicit published contract covering:
- Every supported architecture and DLL version, future schema layouts, or interpretation of unknown values.
- Acceptance and trailing-byte treatment for larger
Sizevalues, invalid-memory handling, or usable output after failure. - Getter-specific service/dependency startup, driver activity, hardware access, internal TPM commands, or cache freshness.
- A maximum completion time or a supported cancellation/interruption mechanism.
Accordingly, the current context-version wording appears erroneous and warrants correction. The remaining guarantees still require clarification from the Windows TBS API owner; inferring them from context creation, command submission, or general TBS behavior would not answer the contract question you've raised.
And since you want to route this questions to the appropriate team, I recommend posting on the Feedback Hub:
- Press Win + F open Feedback Hub from the Start menu.
- Select Report a problem (or Suggest a feature if you'd prefer to frame it as a documentation request).
- Choose the Developer Platform category and the closest API-related subcategory.
If you found my investigation and direction of my support helpful, I’d really appreciate it if you could follow this guide so others with similar issue can benefit as well.
Thank you.