xref: /aosp_15_r20/external/ms-tpm-20-ref/TPMCmd/tpm/include/HandleProcess.h (revision 5c591343844d1f9da7da26467c4bf7efc8a7a413)
1 /* Microsoft Reference Implementation for TPM 2.0
2  *
3  *  The copyright in this software is being made available under the BSD License,
4  *  included below. This software may be subject to other third party and
5  *  contributor rights, including patent rights, and no such rights are granted
6  *  under this license.
7  *
8  *  Copyright (c) Microsoft Corporation
9  *
10  *  All rights reserved.
11  *
12  *  BSD License
13  *
14  *  Redistribution and use in source and binary forms, with or without modification,
15  *  are permitted provided that the following conditions are met:
16  *
17  *  Redistributions of source code must retain the above copyright notice, this list
18  *  of conditions and the following disclaimer.
19  *
20  *  Redistributions in binary form must reproduce the above copyright notice, this
21  *  list of conditions and the following disclaimer in the documentation and/or
22  *  other materials provided with the distribution.
23  *
24  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS""
25  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28  *  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 /*(Auto-generated)
36  *  Created by TpmDispatch; Version 4.0 July 8,2017
37  *  Date: Feb 28, 2020  Time: 03:04:48PM
38  */
39 
40 #if CC_Startup
41 case TPM_CC_Startup:
42     break;
43 #endif // CC_Startup
44 #if CC_Shutdown
45 case TPM_CC_Shutdown:
46     break;
47 #endif // CC_Shutdown
48 #if CC_SelfTest
49 case TPM_CC_SelfTest:
50     break;
51 #endif // CC_SelfTest
52 #if CC_IncrementalSelfTest
53 case TPM_CC_IncrementalSelfTest:
54     break;
55 #endif // CC_IncrementalSelfTest
56 #if CC_GetTestResult
57 case TPM_CC_GetTestResult:
58     break;
59 #endif // CC_GetTestResult
60 #if CC_StartAuthSession
61 case TPM_CC_StartAuthSession:
62     *handleCount = 2;
63     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
64                                               bufferRemainingSize, TRUE);
65     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
66     result = TPMI_DH_ENTITY_Unmarshal(&handles[1], handleBufferStart,
67                                               bufferRemainingSize, TRUE);
68     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
69     break;
70 #endif // CC_StartAuthSession
71 #if CC_PolicyRestart
72 case TPM_CC_PolicyRestart:
73     *handleCount = 1;
74     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
75                                               bufferRemainingSize);
76     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
77     break;
78 #endif // CC_PolicyRestart
79 #if CC_Create
80 case TPM_CC_Create:
81     *handleCount = 1;
82     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
83                                               bufferRemainingSize, FALSE);
84     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
85     break;
86 #endif // CC_Create
87 #if CC_Load
88 case TPM_CC_Load:
89     *handleCount = 1;
90     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
91                                               bufferRemainingSize, FALSE);
92     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
93     break;
94 #endif // CC_Load
95 #if CC_LoadExternal
96 case TPM_CC_LoadExternal:
97     break;
98 #endif // CC_LoadExternal
99 #if CC_ReadPublic
100 case TPM_CC_ReadPublic:
101     *handleCount = 1;
102     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
103                                               bufferRemainingSize, FALSE);
104     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
105     break;
106 #endif // CC_ReadPublic
107 #if CC_ActivateCredential
108 case TPM_CC_ActivateCredential:
109     *handleCount = 2;
110     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
111                                               bufferRemainingSize, FALSE);
112     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
113     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
114                                               bufferRemainingSize, FALSE);
115     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
116     break;
117 #endif // CC_ActivateCredential
118 #if CC_MakeCredential
119 case TPM_CC_MakeCredential:
120     *handleCount = 1;
121     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
122                                               bufferRemainingSize, FALSE);
123     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
124     break;
125 #endif // CC_MakeCredential
126 #if CC_Unseal
127 case TPM_CC_Unseal:
128     *handleCount = 1;
129     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
130                                               bufferRemainingSize, FALSE);
131     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
132     break;
133 #endif // CC_Unseal
134 #if CC_ObjectChangeAuth
135 case TPM_CC_ObjectChangeAuth:
136     *handleCount = 2;
137     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
138                                               bufferRemainingSize, FALSE);
139     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
140     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
141                                               bufferRemainingSize, FALSE);
142     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
143     break;
144 #endif // CC_ObjectChangeAuth
145 #if CC_CreateLoaded
146 case TPM_CC_CreateLoaded:
147     *handleCount = 1;
148     result = TPMI_DH_PARENT_Unmarshal(&handles[0], handleBufferStart,
149                                               bufferRemainingSize, TRUE);
150     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
151     break;
152 #endif // CC_CreateLoaded
153 #if CC_Duplicate
154 case TPM_CC_Duplicate:
155     *handleCount = 2;
156     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
157                                               bufferRemainingSize, FALSE);
158     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
159     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
160                                               bufferRemainingSize, TRUE);
161     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
162     break;
163 #endif // CC_Duplicate
164 #if CC_Rewrap
165 case TPM_CC_Rewrap:
166     *handleCount = 2;
167     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
168                                               bufferRemainingSize, TRUE);
169     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
170     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
171                                               bufferRemainingSize, TRUE);
172     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
173     break;
174 #endif // CC_Rewrap
175 #if CC_Import
176 case TPM_CC_Import:
177     *handleCount = 1;
178     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
179                                               bufferRemainingSize, FALSE);
180     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
181     break;
182 #endif // CC_Import
183 #if CC_RSA_Encrypt
184 case TPM_CC_RSA_Encrypt:
185     *handleCount = 1;
186     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
187                                               bufferRemainingSize, FALSE);
188     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
189     break;
190 #endif // CC_RSA_Encrypt
191 #if CC_RSA_Decrypt
192 case TPM_CC_RSA_Decrypt:
193     *handleCount = 1;
194     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
195                                               bufferRemainingSize, FALSE);
196     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
197     break;
198 #endif // CC_RSA_Decrypt
199 #if CC_ECDH_KeyGen
200 case TPM_CC_ECDH_KeyGen:
201     *handleCount = 1;
202     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
203                                               bufferRemainingSize, FALSE);
204     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
205     break;
206 #endif // CC_ECDH_KeyGen
207 #if CC_ECDH_ZGen
208 case TPM_CC_ECDH_ZGen:
209     *handleCount = 1;
210     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
211                                               bufferRemainingSize, FALSE);
212     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
213     break;
214 #endif // CC_ECDH_ZGen
215 #if CC_ECC_Parameters
216 case TPM_CC_ECC_Parameters:
217     break;
218 #endif // CC_ECC_Parameters
219 #if CC_ZGen_2Phase
220 case TPM_CC_ZGen_2Phase:
221     *handleCount = 1;
222     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
223                                               bufferRemainingSize, FALSE);
224     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
225     break;
226 #endif // CC_ZGen_2Phase
227 #if CC_ECC_Encrypt
228 case TPM_CC_ECC_Encrypt:
229     *handleCount = 1;
230     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
231                                               bufferRemainingSize, FALSE);
232     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
233     break;
234 #endif // CC_ECC_Encrypt
235 #if CC_ECC_Decrypt
236 case TPM_CC_ECC_Decrypt:
237     *handleCount = 1;
238     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
239                                               bufferRemainingSize, FALSE);
240     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
241     break;
242 #endif // CC_ECC_Decrypt
243 #if CC_EncryptDecrypt
244 case TPM_CC_EncryptDecrypt:
245     *handleCount = 1;
246     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
247                                               bufferRemainingSize, FALSE);
248     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
249     break;
250 #endif // CC_EncryptDecrypt
251 #if CC_EncryptDecrypt2
252 case TPM_CC_EncryptDecrypt2:
253     *handleCount = 1;
254     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
255                                               bufferRemainingSize, FALSE);
256     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
257     break;
258 #endif // CC_EncryptDecrypt2
259 #if CC_Hash
260 case TPM_CC_Hash:
261     break;
262 #endif // CC_Hash
263 #if CC_HMAC
264 case TPM_CC_HMAC:
265     *handleCount = 1;
266     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
267                                               bufferRemainingSize, FALSE);
268     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
269     break;
270 #endif // CC_HMAC
271 #if CC_MAC
272 case TPM_CC_MAC:
273     *handleCount = 1;
274     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
275                                               bufferRemainingSize, FALSE);
276     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
277     break;
278 #endif // CC_MAC
279 #if CC_GetRandom
280 case TPM_CC_GetRandom:
281     break;
282 #endif // CC_GetRandom
283 #if CC_StirRandom
284 case TPM_CC_StirRandom:
285     break;
286 #endif // CC_StirRandom
287 #if CC_HMAC_Start
288 case TPM_CC_HMAC_Start:
289     *handleCount = 1;
290     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
291                                               bufferRemainingSize, FALSE);
292     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
293     break;
294 #endif // CC_HMAC_Start
295 #if CC_MAC_Start
296 case TPM_CC_MAC_Start:
297     *handleCount = 1;
298     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
299                                               bufferRemainingSize, FALSE);
300     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
301     break;
302 #endif // CC_MAC_Start
303 #if CC_HashSequenceStart
304 case TPM_CC_HashSequenceStart:
305     break;
306 #endif // CC_HashSequenceStart
307 #if CC_SequenceUpdate
308 case TPM_CC_SequenceUpdate:
309     *handleCount = 1;
310     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
311                                               bufferRemainingSize, FALSE);
312     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
313     break;
314 #endif // CC_SequenceUpdate
315 #if CC_SequenceComplete
316 case TPM_CC_SequenceComplete:
317     *handleCount = 1;
318     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
319                                               bufferRemainingSize, FALSE);
320     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
321     break;
322 #endif // CC_SequenceComplete
323 #if CC_EventSequenceComplete
324 case TPM_CC_EventSequenceComplete:
325     *handleCount = 2;
326     result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart,
327                                               bufferRemainingSize, TRUE);
328     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
329     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
330                                               bufferRemainingSize, FALSE);
331     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
332     break;
333 #endif // CC_EventSequenceComplete
334 #if CC_Certify
335 case TPM_CC_Certify:
336     *handleCount = 2;
337     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
338                                               bufferRemainingSize, FALSE);
339     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
340     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
341                                               bufferRemainingSize, TRUE);
342     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
343     break;
344 #endif // CC_Certify
345 #if CC_CertifyCreation
346 case TPM_CC_CertifyCreation:
347     *handleCount = 2;
348     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
349                                               bufferRemainingSize, TRUE);
350     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
351     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
352                                               bufferRemainingSize, FALSE);
353     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
354     break;
355 #endif // CC_CertifyCreation
356 #if CC_Quote
357 case TPM_CC_Quote:
358     *handleCount = 1;
359     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
360                                               bufferRemainingSize, TRUE);
361     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
362     break;
363 #endif // CC_Quote
364 #if CC_GetSessionAuditDigest
365 case TPM_CC_GetSessionAuditDigest:
366     *handleCount = 3;
367     result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart,
368                                               bufferRemainingSize, FALSE);
369     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
370     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
371                                               bufferRemainingSize, TRUE);
372     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
373     result = TPMI_SH_HMAC_Unmarshal(&handles[2], handleBufferStart,
374                                               bufferRemainingSize);
375     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3;
376     break;
377 #endif // CC_GetSessionAuditDigest
378 #if CC_GetCommandAuditDigest
379 case TPM_CC_GetCommandAuditDigest:
380     *handleCount = 2;
381     result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart,
382                                               bufferRemainingSize, FALSE);
383     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
384     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
385                                               bufferRemainingSize, TRUE);
386     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
387     break;
388 #endif // CC_GetCommandAuditDigest
389 #if CC_GetTime
390 case TPM_CC_GetTime:
391     *handleCount = 2;
392     result = TPMI_RH_ENDORSEMENT_Unmarshal(&handles[0], handleBufferStart,
393                                               bufferRemainingSize, FALSE);
394     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
395     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
396                                               bufferRemainingSize, TRUE);
397     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
398     break;
399 #endif // CC_GetTime
400 #if CC_CertifyX509
401 case TPM_CC_CertifyX509:
402     *handleCount = 2;
403     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
404                                               bufferRemainingSize, FALSE);
405     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
406     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
407                                               bufferRemainingSize, TRUE);
408     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
409     break;
410 #endif // CC_CertifyX509
411 #if CC_Commit
412 case TPM_CC_Commit:
413     *handleCount = 1;
414     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
415                                               bufferRemainingSize, FALSE);
416     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
417     break;
418 #endif // CC_Commit
419 #if CC_EC_Ephemeral
420 case TPM_CC_EC_Ephemeral:
421     break;
422 #endif // CC_EC_Ephemeral
423 #if CC_VerifySignature
424 case TPM_CC_VerifySignature:
425     *handleCount = 1;
426     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
427                                               bufferRemainingSize, FALSE);
428     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
429     break;
430 #endif // CC_VerifySignature
431 #if CC_Sign
432 case TPM_CC_Sign:
433     *handleCount = 1;
434     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
435                                               bufferRemainingSize, FALSE);
436     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
437     break;
438 #endif // CC_Sign
439 #if CC_SetCommandCodeAuditStatus
440 case TPM_CC_SetCommandCodeAuditStatus:
441     *handleCount = 1;
442     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
443                                               bufferRemainingSize);
444     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
445     break;
446 #endif // CC_SetCommandCodeAuditStatus
447 #if CC_PCR_Extend
448 case TPM_CC_PCR_Extend:
449     *handleCount = 1;
450     result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart,
451                                               bufferRemainingSize, TRUE);
452     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
453     break;
454 #endif // CC_PCR_Extend
455 #if CC_PCR_Event
456 case TPM_CC_PCR_Event:
457     *handleCount = 1;
458     result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart,
459                                               bufferRemainingSize, TRUE);
460     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
461     break;
462 #endif // CC_PCR_Event
463 #if CC_PCR_Read
464 case TPM_CC_PCR_Read:
465     break;
466 #endif // CC_PCR_Read
467 #if CC_PCR_Allocate
468 case TPM_CC_PCR_Allocate:
469     *handleCount = 1;
470     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
471                                               bufferRemainingSize);
472     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
473     break;
474 #endif // CC_PCR_Allocate
475 #if CC_PCR_SetAuthPolicy
476 case TPM_CC_PCR_SetAuthPolicy:
477     *handleCount = 1;
478     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
479                                               bufferRemainingSize);
480     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
481     break;
482 #endif // CC_PCR_SetAuthPolicy
483 #if CC_PCR_SetAuthValue
484 case TPM_CC_PCR_SetAuthValue:
485     *handleCount = 1;
486     result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart,
487                                               bufferRemainingSize, FALSE);
488     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
489     break;
490 #endif // CC_PCR_SetAuthValue
491 #if CC_PCR_Reset
492 case TPM_CC_PCR_Reset:
493     *handleCount = 1;
494     result = TPMI_DH_PCR_Unmarshal(&handles[0], handleBufferStart,
495                                               bufferRemainingSize, FALSE);
496     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
497     break;
498 #endif // CC_PCR_Reset
499 #if CC_PolicySigned
500 case TPM_CC_PolicySigned:
501     *handleCount = 2;
502     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
503                                               bufferRemainingSize, FALSE);
504     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
505     result = TPMI_SH_POLICY_Unmarshal(&handles[1], handleBufferStart,
506                                               bufferRemainingSize);
507     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
508     break;
509 #endif // CC_PolicySigned
510 #if CC_PolicySecret
511 case TPM_CC_PolicySecret:
512     *handleCount = 2;
513     result = TPMI_DH_ENTITY_Unmarshal(&handles[0], handleBufferStart,
514                                               bufferRemainingSize, FALSE);
515     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
516     result = TPMI_SH_POLICY_Unmarshal(&handles[1], handleBufferStart,
517                                               bufferRemainingSize);
518     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
519     break;
520 #endif // CC_PolicySecret
521 #if CC_PolicyTicket
522 case TPM_CC_PolicyTicket:
523     *handleCount = 1;
524     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
525                                               bufferRemainingSize);
526     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
527     break;
528 #endif // CC_PolicyTicket
529 #if CC_PolicyOR
530 case TPM_CC_PolicyOR:
531     *handleCount = 1;
532     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
533                                               bufferRemainingSize);
534     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
535     break;
536 #endif // CC_PolicyOR
537 #if CC_PolicyPCR
538 case TPM_CC_PolicyPCR:
539     *handleCount = 1;
540     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
541                                               bufferRemainingSize);
542     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
543     break;
544 #endif // CC_PolicyPCR
545 #if CC_PolicyLocality
546 case TPM_CC_PolicyLocality:
547     *handleCount = 1;
548     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
549                                               bufferRemainingSize);
550     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
551     break;
552 #endif // CC_PolicyLocality
553 #if CC_PolicyNV
554 case TPM_CC_PolicyNV:
555     *handleCount = 3;
556     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
557                                               bufferRemainingSize);
558     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
559     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
560                                               bufferRemainingSize);
561     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
562     result = TPMI_SH_POLICY_Unmarshal(&handles[2], handleBufferStart,
563                                               bufferRemainingSize);
564     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3;
565     break;
566 #endif // CC_PolicyNV
567 #if CC_PolicyCounterTimer
568 case TPM_CC_PolicyCounterTimer:
569     *handleCount = 1;
570     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
571                                               bufferRemainingSize);
572     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
573     break;
574 #endif // CC_PolicyCounterTimer
575 #if CC_PolicyCommandCode
576 case TPM_CC_PolicyCommandCode:
577     *handleCount = 1;
578     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
579                                               bufferRemainingSize);
580     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
581     break;
582 #endif // CC_PolicyCommandCode
583 #if CC_PolicyPhysicalPresence
584 case TPM_CC_PolicyPhysicalPresence:
585     *handleCount = 1;
586     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
587                                               bufferRemainingSize);
588     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
589     break;
590 #endif // CC_PolicyPhysicalPresence
591 #if CC_PolicyCpHash
592 case TPM_CC_PolicyCpHash:
593     *handleCount = 1;
594     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
595                                               bufferRemainingSize);
596     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
597     break;
598 #endif // CC_PolicyCpHash
599 #if CC_PolicyNameHash
600 case TPM_CC_PolicyNameHash:
601     *handleCount = 1;
602     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
603                                               bufferRemainingSize);
604     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
605     break;
606 #endif // CC_PolicyNameHash
607 #if CC_PolicyDuplicationSelect
608 case TPM_CC_PolicyDuplicationSelect:
609     *handleCount = 1;
610     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
611                                               bufferRemainingSize);
612     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
613     break;
614 #endif // CC_PolicyDuplicationSelect
615 #if CC_PolicyAuthorize
616 case TPM_CC_PolicyAuthorize:
617     *handleCount = 1;
618     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
619                                               bufferRemainingSize);
620     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
621     break;
622 #endif // CC_PolicyAuthorize
623 #if CC_PolicyAuthValue
624 case TPM_CC_PolicyAuthValue:
625     *handleCount = 1;
626     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
627                                               bufferRemainingSize);
628     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
629     break;
630 #endif // CC_PolicyAuthValue
631 #if CC_PolicyPassword
632 case TPM_CC_PolicyPassword:
633     *handleCount = 1;
634     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
635                                               bufferRemainingSize);
636     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
637     break;
638 #endif // CC_PolicyPassword
639 #if CC_PolicyGetDigest
640 case TPM_CC_PolicyGetDigest:
641     *handleCount = 1;
642     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
643                                               bufferRemainingSize);
644     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
645     break;
646 #endif // CC_PolicyGetDigest
647 #if CC_PolicyNvWritten
648 case TPM_CC_PolicyNvWritten:
649     *handleCount = 1;
650     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
651                                               bufferRemainingSize);
652     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
653     break;
654 #endif // CC_PolicyNvWritten
655 #if CC_PolicyTemplate
656 case TPM_CC_PolicyTemplate:
657     *handleCount = 1;
658     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
659                                               bufferRemainingSize);
660     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
661     break;
662 #endif // CC_PolicyTemplate
663 #if CC_PolicyAuthorizeNV
664 case TPM_CC_PolicyAuthorizeNV:
665     *handleCount = 3;
666     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
667                                               bufferRemainingSize);
668     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
669     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
670                                               bufferRemainingSize);
671     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
672     result = TPMI_SH_POLICY_Unmarshal(&handles[2], handleBufferStart,
673                                               bufferRemainingSize);
674     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3;
675     break;
676 #endif // CC_PolicyAuthorizeNV
677 #if CC_CreatePrimary
678 case TPM_CC_CreatePrimary:
679     *handleCount = 1;
680     result = TPMI_RH_HIERARCHY_Unmarshal(&handles[0], handleBufferStart,
681                                               bufferRemainingSize, TRUE);
682     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
683     break;
684 #endif // CC_CreatePrimary
685 #if CC_HierarchyControl
686 case TPM_CC_HierarchyControl:
687     *handleCount = 1;
688     result = TPMI_RH_HIERARCHY_Unmarshal(&handles[0], handleBufferStart,
689                                               bufferRemainingSize, FALSE);
690     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
691     break;
692 #endif // CC_HierarchyControl
693 #if CC_SetPrimaryPolicy
694 case TPM_CC_SetPrimaryPolicy:
695     *handleCount = 1;
696     result = TPMI_RH_HIERARCHY_POLICY_Unmarshal(&handles[0], handleBufferStart,
697                                               bufferRemainingSize);
698     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
699     break;
700 #endif // CC_SetPrimaryPolicy
701 #if CC_ChangePPS
702 case TPM_CC_ChangePPS:
703     *handleCount = 1;
704     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
705                                               bufferRemainingSize);
706     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
707     break;
708 #endif // CC_ChangePPS
709 #if CC_ChangeEPS
710 case TPM_CC_ChangeEPS:
711     *handleCount = 1;
712     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
713                                               bufferRemainingSize);
714     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
715     break;
716 #endif // CC_ChangeEPS
717 #if CC_Clear
718 case TPM_CC_Clear:
719     *handleCount = 1;
720     result = TPMI_RH_CLEAR_Unmarshal(&handles[0], handleBufferStart,
721                                               bufferRemainingSize);
722     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
723     break;
724 #endif // CC_Clear
725 #if CC_ClearControl
726 case TPM_CC_ClearControl:
727     *handleCount = 1;
728     result = TPMI_RH_CLEAR_Unmarshal(&handles[0], handleBufferStart,
729                                               bufferRemainingSize);
730     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
731     break;
732 #endif // CC_ClearControl
733 #if CC_HierarchyChangeAuth
734 case TPM_CC_HierarchyChangeAuth:
735     *handleCount = 1;
736     result = TPMI_RH_HIERARCHY_AUTH_Unmarshal(&handles[0], handleBufferStart,
737                                               bufferRemainingSize);
738     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
739     break;
740 #endif // CC_HierarchyChangeAuth
741 #if CC_DictionaryAttackLockReset
742 case TPM_CC_DictionaryAttackLockReset:
743     *handleCount = 1;
744     result = TPMI_RH_LOCKOUT_Unmarshal(&handles[0], handleBufferStart,
745                                               bufferRemainingSize);
746     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
747     break;
748 #endif // CC_DictionaryAttackLockReset
749 #if CC_DictionaryAttackParameters
750 case TPM_CC_DictionaryAttackParameters:
751     *handleCount = 1;
752     result = TPMI_RH_LOCKOUT_Unmarshal(&handles[0], handleBufferStart,
753                                               bufferRemainingSize);
754     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
755     break;
756 #endif // CC_DictionaryAttackParameters
757 #if CC_PP_Commands
758 case TPM_CC_PP_Commands:
759     *handleCount = 1;
760     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
761                                               bufferRemainingSize);
762     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
763     break;
764 #endif // CC_PP_Commands
765 #if CC_SetAlgorithmSet
766 case TPM_CC_SetAlgorithmSet:
767     *handleCount = 1;
768     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
769                                               bufferRemainingSize);
770     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
771     break;
772 #endif // CC_SetAlgorithmSet
773 #if CC_FieldUpgradeStart
774 case TPM_CC_FieldUpgradeStart:
775     *handleCount = 2;
776     result = TPMI_RH_PLATFORM_Unmarshal(&handles[0], handleBufferStart,
777                                               bufferRemainingSize);
778     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
779     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
780                                               bufferRemainingSize, FALSE);
781     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
782     break;
783 #endif // CC_FieldUpgradeStart
784 #if CC_FieldUpgradeData
785 case TPM_CC_FieldUpgradeData:
786     break;
787 #endif // CC_FieldUpgradeData
788 #if CC_FirmwareRead
789 case TPM_CC_FirmwareRead:
790     break;
791 #endif // CC_FirmwareRead
792 #if CC_ContextSave
793 case TPM_CC_ContextSave:
794     *handleCount = 1;
795     result = TPMI_DH_CONTEXT_Unmarshal(&handles[0], handleBufferStart,
796                                               bufferRemainingSize);
797     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
798     break;
799 #endif // CC_ContextSave
800 #if CC_ContextLoad
801 case TPM_CC_ContextLoad:
802     break;
803 #endif // CC_ContextLoad
804 #if CC_FlushContext
805 case TPM_CC_FlushContext:
806     break;
807 #endif // CC_FlushContext
808 #if CC_EvictControl
809 case TPM_CC_EvictControl:
810     *handleCount = 2;
811     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
812                                               bufferRemainingSize);
813     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
814     result = TPMI_DH_OBJECT_Unmarshal(&handles[1], handleBufferStart,
815                                               bufferRemainingSize, FALSE);
816     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
817     break;
818 #endif // CC_EvictControl
819 #if CC_ReadClock
820 case TPM_CC_ReadClock:
821     break;
822 #endif // CC_ReadClock
823 #if CC_ClockSet
824 case TPM_CC_ClockSet:
825     *handleCount = 1;
826     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
827                                               bufferRemainingSize);
828     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
829     break;
830 #endif // CC_ClockSet
831 #if CC_ClockRateAdjust
832 case TPM_CC_ClockRateAdjust:
833     *handleCount = 1;
834     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
835                                               bufferRemainingSize);
836     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
837     break;
838 #endif // CC_ClockRateAdjust
839 #if CC_GetCapability
840 case TPM_CC_GetCapability:
841     break;
842 #endif // CC_GetCapability
843 #if CC_TestParms
844 case TPM_CC_TestParms:
845     break;
846 #endif // CC_TestParms
847 #if CC_NV_DefineSpace
848 case TPM_CC_NV_DefineSpace:
849     *handleCount = 1;
850     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
851                                               bufferRemainingSize);
852     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
853     break;
854 #endif // CC_NV_DefineSpace
855 #if CC_NV_UndefineSpace
856 case TPM_CC_NV_UndefineSpace:
857     *handleCount = 2;
858     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
859                                               bufferRemainingSize);
860     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
861     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
862                                               bufferRemainingSize);
863     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
864     break;
865 #endif // CC_NV_UndefineSpace
866 #if CC_NV_UndefineSpaceSpecial
867 case TPM_CC_NV_UndefineSpaceSpecial:
868     *handleCount = 2;
869     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart,
870                                               bufferRemainingSize);
871     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
872     result = TPMI_RH_PLATFORM_Unmarshal(&handles[1], handleBufferStart,
873                                               bufferRemainingSize);
874     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
875     break;
876 #endif // CC_NV_UndefineSpaceSpecial
877 #if CC_NV_ReadPublic
878 case TPM_CC_NV_ReadPublic:
879     *handleCount = 1;
880     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart,
881                                               bufferRemainingSize);
882     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
883     break;
884 #endif // CC_NV_ReadPublic
885 #if CC_NV_Write
886 case TPM_CC_NV_Write:
887     *handleCount = 2;
888     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
889                                               bufferRemainingSize);
890     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
891     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
892                                               bufferRemainingSize);
893     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
894     break;
895 #endif // CC_NV_Write
896 #if CC_NV_Increment
897 case TPM_CC_NV_Increment:
898     *handleCount = 2;
899     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
900                                               bufferRemainingSize);
901     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
902     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
903                                               bufferRemainingSize);
904     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
905     break;
906 #endif // CC_NV_Increment
907 #if CC_NV_Extend
908 case TPM_CC_NV_Extend:
909     *handleCount = 2;
910     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
911                                               bufferRemainingSize);
912     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
913     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
914                                               bufferRemainingSize);
915     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
916     break;
917 #endif // CC_NV_Extend
918 #if CC_NV_SetBits
919 case TPM_CC_NV_SetBits:
920     *handleCount = 2;
921     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
922                                               bufferRemainingSize);
923     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
924     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
925                                               bufferRemainingSize);
926     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
927     break;
928 #endif // CC_NV_SetBits
929 #if CC_NV_WriteLock
930 case TPM_CC_NV_WriteLock:
931     *handleCount = 2;
932     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
933                                               bufferRemainingSize);
934     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
935     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
936                                               bufferRemainingSize);
937     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
938     break;
939 #endif // CC_NV_WriteLock
940 #if CC_NV_GlobalWriteLock
941 case TPM_CC_NV_GlobalWriteLock:
942     *handleCount = 1;
943     result = TPMI_RH_PROVISION_Unmarshal(&handles[0], handleBufferStart,
944                                               bufferRemainingSize);
945     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
946     break;
947 #endif // CC_NV_GlobalWriteLock
948 #if CC_NV_Read
949 case TPM_CC_NV_Read:
950     *handleCount = 2;
951     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
952                                               bufferRemainingSize);
953     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
954     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
955                                               bufferRemainingSize);
956     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
957     break;
958 #endif // CC_NV_Read
959 #if CC_NV_ReadLock
960 case TPM_CC_NV_ReadLock:
961     *handleCount = 2;
962     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[0], handleBufferStart,
963                                               bufferRemainingSize);
964     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
965     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[1], handleBufferStart,
966                                               bufferRemainingSize);
967     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
968     break;
969 #endif // CC_NV_ReadLock
970 #if CC_NV_ChangeAuth
971 case TPM_CC_NV_ChangeAuth:
972     *handleCount = 1;
973     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[0], handleBufferStart,
974                                               bufferRemainingSize);
975     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
976     break;
977 #endif // CC_NV_ChangeAuth
978 #if CC_NV_Certify
979 case TPM_CC_NV_Certify:
980     *handleCount = 3;
981     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
982                                               bufferRemainingSize, TRUE);
983     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
984     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[1], handleBufferStart,
985                                               bufferRemainingSize);
986     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
987     result = TPMI_RH_NV_INDEX_Unmarshal(&handles[2], handleBufferStart,
988                                               bufferRemainingSize);
989     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3;
990     break;
991 #endif // CC_NV_Certify
992 #if CC_AC_GetCapability
993 case TPM_CC_AC_GetCapability:
994     *handleCount = 1;
995     result = TPMI_RH_AC_Unmarshal(&handles[0], handleBufferStart,
996                                               bufferRemainingSize);
997     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
998     break;
999 #endif // CC_AC_GetCapability
1000 #if CC_AC_Send
1001 case TPM_CC_AC_Send:
1002     *handleCount = 3;
1003     result = TPMI_DH_OBJECT_Unmarshal(&handles[0], handleBufferStart,
1004                                               bufferRemainingSize, FALSE);
1005     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
1006     result = TPMI_RH_NV_AUTH_Unmarshal(&handles[1], handleBufferStart,
1007                                               bufferRemainingSize);
1008     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_2;
1009     result = TPMI_RH_AC_Unmarshal(&handles[2], handleBufferStart,
1010                                               bufferRemainingSize);
1011     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_3;
1012     break;
1013 #endif // CC_AC_Send
1014 #if CC_Policy_AC_SendSelect
1015 case TPM_CC_Policy_AC_SendSelect:
1016     *handleCount = 1;
1017     result = TPMI_SH_POLICY_Unmarshal(&handles[0], handleBufferStart,
1018                                               bufferRemainingSize);
1019     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
1020     break;
1021 #endif // CC_Policy_AC_SendSelect
1022 #if CC_ACT_SetTimeout
1023 case TPM_CC_ACT_SetTimeout:
1024     *handleCount = 1;
1025     result = TPMI_RH_ACT_Unmarshal(&handles[0], handleBufferStart,
1026                                               bufferRemainingSize);
1027     if(TPM_RC_SUCCESS != result) return result + TPM_RC_H + TPM_RC_1;
1028     break;
1029 #endif // CC_ACT_SetTimeout
1030 #if CC_Vendor_TCG_Test
1031 case TPM_CC_Vendor_TCG_Test:
1032     break;
1033 #endif // CC_Vendor_TCG_Test
1034