Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

896 lines
19 KiB

  1. /+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: ndsmrshl.cxx
  7. //
  8. // Contents:
  9. //
  10. // Functions:
  11. //
  12. // CopyABC1ToNDSSynId1
  13. // CopyABC2ToNDSSynId2
  14. // CopyABC3ToNDSSynId3
  15. // CopyABC4ToNDSSynId4
  16. // CopyABC5ToNDSSynId5
  17. // CopyABC6ToNDSSynId6
  18. // CopyABC7ToNDSSynId7
  19. // CopyABC8ToNDSSynId8
  20. // CopyABC9ToNDSSynId9
  21. // CopyABC10ToNDSSynId10
  22. // CopyABC11ToNDSSynId11
  23. // CopyABC12ToNDSSynId12
  24. // CopyABC13ToNDSSynId13
  25. // CopyABC14ToNDSSynId14
  26. // CopyABC15ToNDSSynId15
  27. // CopyABC16ToNDSSynId16
  28. // CopyABC17ToNDSSynId17
  29. // CopyABC18ToNDSSynId18
  30. // CopyABC19ToNDSSynId19
  31. // CopyABC20ToNDSSynId20
  32. // CopyABC21ToNDSSynId21
  33. // CopyABC22ToNDSSynId22
  34. // CopyABC23ToNDSSynId23
  35. // CopyABC24ToNDSSynId24
  36. // CopyABC25ToNDSSynId25
  37. // CopyABC26ToNDSSynId26
  38. // CopyABC27ToNDSSynId27
  39. //
  40. // History: 25-Apr-96 KrishnaG Created.
  41. //
  42. // Warnings: NDS Data type 6 is not yet supported (no problems just
  43. // not done!
  44. //
  45. // NDS Data type 16 need to complete the for loop code
  46. // NDS Data type 21 is the stream data type some stress.
  47. //----------------------------------------------------------------------------
  48. #include "nds.hxx"
  49. LPBYTE
  50. CopyNDSSynId1ToNDS1(
  51. LPBYTE lpByte,
  52. PNDSOBJECT lpNdsObject
  53. )
  54. {
  55. LPASN1_TYPE_1 lpASN1_1 = (LPASN1_TYPE_1) lpByte;
  56. lpASN1_1->DNString =
  57. (LPWSTR)AllocADsStr(
  58. lpNdsObject->NdsValue.value_1.DNString
  59. );
  60. lpByte = (LPBYTE ) lpASN1_1 + sizeof(ASN1_TYPE_1);
  61. return(lpByte);
  62. }
  63. LPBYTE
  64. CopyNDSSynId2ToNDS2(
  65. LPBYTE lpByte,
  66. PNDSOBJECT lpNdsObject
  67. )
  68. {
  69. LPASN1_TYPE_2 lpASN1_2 = (LPASN1_TYPE_2) lpByte;
  70. lpASN1_2->CaseExactString =
  71. (LPWSTR)AllocADsStr(
  72. lpNdsObject->NdsValue.value_2.CaseExactString
  73. );
  74. lpByte = (LPBYTE ) lpASN1_2 + sizeof(ASN1_TYPE_2);
  75. return(lpByte);
  76. }
  77. LPBYTE
  78. CopyNDSSynId3ToNDS3(
  79. LPBYTE lpByte,
  80. PNDSOBJECT lpNdsObject
  81. )
  82. {
  83. LPASN1_TYPE_3 lpASN1_3 = (LPASN1_TYPE_3) lpByte;
  84. lpASN1_3->CaseIgnoreString =
  85. (LPWSTR)AllocADsStr(
  86. lpNdsObject->NdsValue.value_3.CaseIgnoreString
  87. );
  88. lpByte = (LPBYTE ) lpASN1_3 + sizeof(ASN1_TYPE_3);
  89. return(lpByte);
  90. }
  91. LPBYTE
  92. CopyNDSSynId4ToNDS4(
  93. LPBYTE lpByte,
  94. PNDSOBJECT lpNdsObject
  95. )
  96. {
  97. LPASN1_TYPE_4 lpASN1_4 = (LPASN1_TYPE_4) lpByte;
  98. lpASN1_4->PrintableString =
  99. (LPWSTR)AllocADsStr(
  100. lpNdsObject->NdsValue.value_4.PrintableString
  101. );
  102. lpByte = (LPBYTE ) lpASN1_4 + sizeof(ASN1_TYPE_4);
  103. return(lpByte);
  104. }
  105. LPBYTE
  106. CopyNDSSynId5ToNDS5(
  107. LPBYTE lpByte,
  108. PNDSOBJECT lpNdsObject
  109. )
  110. {
  111. LPASN1_TYPE_5 lpASN1_5 = (LPASN1_TYPE_5) lpByte;
  112. lpASN1_5->NumericString =
  113. (LPWSTR)AllocADsStr(
  114. lpNdsObject->NdsValue.value_5.NumericString
  115. );
  116. lpByte = (LPBYTE ) lpASN1_5 + sizeof(ASN1_TYPE_5);
  117. return(lpByte);
  118. }
  119. LPBYTE
  120. CopyNDSSynId6ToNDS6(
  121. LPBYTE lpByte,
  122. PNDSOBJECT lpNdsObject
  123. )
  124. {
  125. LPASN1_TYPE_6 lpASN1_6 = (LPASN1_TYPE_6) lpByte;
  126. LPNDS_ASN1_TYPE_6 lpNdsTempASN1_6 = NULL;
  127. lpNdsTempASN1_6 = &(lpNdsObject->NdsValue.value_6);
  128. lpASN1_6->String =
  129. (LPWSTR)AllocADsStr(
  130. lpNdsTempASN1_6->String
  131. );
  132. if (!lpASN1_6->String)
  133. return NULL;
  134. while ( lpNdsTempASN1_6->Next)
  135. {
  136. lpASN1_6->Next = (LPASN1_TYPE_6)((LPBYTE)lpASN1_6 +sizeof(ASN1_TYPE_6));
  137. lpASN1_6 = (LPASN1_TYPE_6)lpASN1_6->Next;
  138. lpNdsTempASN1_6 = lpNdsTempASN1_6->Next;
  139. lpASN1_6->String =
  140. (LPWSTR)AllocADsStr(
  141. lpNdsTempASN1_6->String
  142. );
  143. if (!lpASN1_6->String)
  144. return NULL;
  145. }
  146. lpASN1_6->Next = NULL;
  147. lpByte = (LPBYTE ) lpASN1_6 + sizeof(ASN1_TYPE_6);
  148. return(lpByte);
  149. }
  150. LPBYTE
  151. CopyNDSSynId7ToNDS7(
  152. LPBYTE lpByte,
  153. PNDSOBJECT lpNdsObject
  154. )
  155. {
  156. LPASN1_TYPE_8 lpASN1_8 = (LPASN1_TYPE_8) lpByte;
  157. lpASN1_8->Integer = lpNdsObject->NdsValue.value_8.Integer;
  158. lpByte = (LPBYTE ) lpASN1_8 + sizeof(ASN1_TYPE_8);
  159. return(lpByte);
  160. }
  161. LPBYTE
  162. CopyNDSSynId8ToNDS8(
  163. LPBYTE lpByte,
  164. PNDSOBJECT lpNdsObject
  165. )
  166. {
  167. LPASN1_TYPE_8 lpASN1_8 = (LPASN1_TYPE_8) lpByte;
  168. lpASN1_8->Integer = lpNdsObject->NdsValue.value_8.Integer;
  169. lpByte = (LPBYTE ) lpASN1_8 + sizeof(ASN1_TYPE_8);
  170. return(lpByte);
  171. }
  172. LPBYTE
  173. CopyNDSSynId9ToNDS9(
  174. LPBYTE lpByte,
  175. PNDSOBJECT lpNdsObject
  176. )
  177. {
  178. LPASN1_TYPE_9 lpASN1_9 = (LPASN1_TYPE_9) lpByte;
  179. LPBYTE pBuffer = NULL;
  180. lpASN1_9->Length = lpNdsObject->NdsValue.value_9.Length;
  181. pBuffer = (LPBYTE)AllocADsMem(lpASN1_9->Length);
  182. if (!pBuffer)
  183. return NULL;
  184. memcpy(
  185. pBuffer,
  186. lpNdsObject->NdsValue.value_9.OctetString,
  187. lpASN1_9->Length
  188. );
  189. lpASN1_9->OctetString = pBuffer;
  190. lpByte = (LPBYTE ) lpASN1_9 + sizeof(ASN1_TYPE_9);
  191. return(lpByte);
  192. }
  193. LPBYTE
  194. CopyNDSSynId10ToNDS10(
  195. LPBYTE lpByte,
  196. PNDSOBJECT lpNdsObject
  197. )
  198. {
  199. LPASN1_TYPE_10 lpASN1_10 = (LPASN1_TYPE_10) lpByte;
  200. lpASN1_10->TelephoneNumber =
  201. AllocADsStr(
  202. lpNdsObject->NdsValue.value_10.TelephoneNumber
  203. );
  204. lpByte = (LPBYTE ) lpASN1_10 + sizeof(ASN1_TYPE_10);
  205. return(lpByte);
  206. }
  207. LPBYTE
  208. CopyNDSSynId11ToNDS11(
  209. LPBYTE lpByte,
  210. PNDSOBJECT lpNdsObject
  211. )
  212. {
  213. LPASN1_TYPE_11 lpASN1_11 = (LPASN1_TYPE_11) lpByte;
  214. lpASN1_11->NumberOfBits = lpNdsObject->NdsValue.value_11.NumberOfBits;
  215. lpASN1_11->TelephoneNumber =
  216. (LPWSTR)AllocADsStr(
  217. lpNdsObject->NdsValue.value_11.TelephoneNumber
  218. );
  219. if (!lpASN1_11->TelephoneNumber)
  220. return NULL;
  221. lpByte = (LPBYTE ) lpASN1_11 + sizeof(ASN1_TYPE_11);
  222. return(lpByte);
  223. }
  224. LPBYTE
  225. CopyNDSSynId12ToNDS12(
  226. LPBYTE lpByte,
  227. PNDSOBJECT lpNdsObject
  228. )
  229. {
  230. LPASN1_TYPE_12 lpASN1_12 = (LPASN1_TYPE_12) lpByte;
  231. LPBYTE pBuffer = NULL;
  232. lpASN1_12->AddressType = lpNdsObject->NdsValue.value_12.AddressType;
  233. lpASN1_12->AddressLength = lpNdsObject->NdsValue.value_12.AddressLength;
  234. pBuffer = (LPBYTE)AllocADsMem(lpASN1_12->AddressLength);
  235. if (!pBuffer)
  236. return NULL;
  237. memcpy(
  238. pBuffer,
  239. lpNdsObject->NdsValue.value_12.Address,
  240. lpASN1_12->AddressLength
  241. );
  242. lpASN1_12->Address = pBuffer;
  243. lpByte = (LPBYTE ) lpASN1_12 + sizeof(ASN1_TYPE_12);
  244. return(lpByte);
  245. }
  246. LPBYTE
  247. CopyNDSSynId13ToNDS13(
  248. LPBYTE lpByte,
  249. PNDSOBJECT lpNdsObject
  250. )
  251. {
  252. //
  253. // BugBug: KrishnaG not supported!
  254. //
  255. return(lpByte);
  256. }
  257. LPBYTE
  258. CopyNDSSynId14ToNDS14(
  259. LPBYTE lpByte,
  260. PNDSOBJECT lpNdsObject
  261. )
  262. {
  263. LPASN1_TYPE_14 lpASN1_14 = (LPASN1_TYPE_14) lpByte;
  264. lpASN1_14->Type = lpNdsObject->NdsValue.value_14.Type;
  265. lpASN1_14->Address =
  266. (LPWSTR)AllocADsStr(
  267. lpNdsObject->NdsValue.value_14.Address
  268. );
  269. lpByte = (LPBYTE ) lpASN1_14 + sizeof(ASN1_TYPE_14);
  270. return(lpByte);
  271. }
  272. LPBYTE
  273. CopyNDSSynId15ToNDS15(
  274. LPBYTE lpByte,
  275. PNDSOBJECT lpNdsObject
  276. )
  277. {
  278. LPASN1_TYPE_15 lpASN1_15 = (LPASN1_TYPE_15) lpByte;
  279. lpASN1_15->Type = lpNdsObject->NdsValue.value_15.Type;
  280. lpASN1_15->VolumeName =
  281. (LPWSTR)AllocADsStr(
  282. lpNdsObject->NdsValue.value_15.VolumeName
  283. );
  284. lpASN1_15->Path =
  285. (LPWSTR)AllocADsStr(
  286. lpNdsObject->NdsValue.value_15.Path
  287. );
  288. lpByte = (LPBYTE ) lpASN1_15 + sizeof(ASN1_TYPE_15);
  289. return(lpByte);
  290. }
  291. LPBYTE
  292. CopyNDSSynId16ToNDS16(
  293. LPBYTE lpByte,
  294. PNDSOBJECT lpNdsObject
  295. )
  296. {
  297. //
  298. // BugBug: KrishnaG not supported!
  299. //
  300. return(lpByte);
  301. }
  302. LPBYTE
  303. CopyNDSSynId17ToNDS17(
  304. LPBYTE lpByte,
  305. PNDSOBJECT lpNdsObject
  306. )
  307. {
  308. LPASN1_TYPE_17 lpASN1_17 = (LPASN1_TYPE_17) lpByte;
  309. lpASN1_17->ProtectedAttrName =
  310. (LPWSTR)AllocADsStr(
  311. lpNdsObject->NdsValue.value_17.ProtectedAttrName
  312. );
  313. lpASN1_17->SubjectName =
  314. (LPWSTR)AllocADsStr(
  315. lpNdsObject->NdsValue.value_17.SubjectName
  316. );
  317. lpASN1_17->Privileges = lpNdsObject->NdsValue.value_17.Privileges;
  318. lpByte = (LPBYTE ) lpASN1_17 + sizeof(ASN1_TYPE_17);
  319. return(lpByte);
  320. }
  321. LPBYTE
  322. CopyNDSSynId18ToNDS18(
  323. LPBYTE lpByte,
  324. PNDSOBJECT lpNdsObject
  325. )
  326. {
  327. LPASN1_TYPE_18 lpASN1_18 = (LPASN1_TYPE_18) lpByte;
  328. lpASN1_18->PostalAddress[0] =
  329. (LPWSTR)AllocADsStr(
  330. lpNdsObject->NdsValue.value_18.PostalAddress[0]
  331. );
  332. lpASN1_18->PostalAddress[1] =
  333. (LPWSTR)AllocADsStr(
  334. lpNdsObject->NdsValue.value_18.PostalAddress[1]
  335. );
  336. lpASN1_18->PostalAddress[2] =
  337. (LPWSTR)AllocADsStr(
  338. lpNdsObject->NdsValue.value_18.PostalAddress[2]
  339. );
  340. lpASN1_18->PostalAddress[3] =
  341. (LPWSTR)AllocADsStr(
  342. lpNdsObject->NdsValue.value_18.PostalAddress[3]
  343. );
  344. lpASN1_18->PostalAddress[4] =
  345. (LPWSTR)AllocADsStr(
  346. lpNdsObject->NdsValue.value_18.PostalAddress[4]
  347. );
  348. lpASN1_18->PostalAddress[5] =
  349. (LPWSTR)AllocADsStr(
  350. lpNdsObject->NdsValue.value_18.PostalAddress[5]
  351. );
  352. lpByte = (LPBYTE ) lpASN1_18 + sizeof(ASN1_TYPE_18);
  353. return(lpByte);
  354. }
  355. LPBYTE
  356. CopyNDSSynId19ToNDS19(
  357. LPBYTE lpByte,
  358. PNDSOBJECT lpNdsObject
  359. )
  360. {
  361. //
  362. // BugBug: KrishnaG not supported!
  363. //
  364. return(lpByte);
  365. LPASN1_TYPE_19 lpASN1_19 = (LPASN1_TYPE_19) lpByte;
  366. lpNdsObject->NdsType = NDS_SYNTAX_ID_19;
  367. lpASN1_19->WholeSeconds
  368. = lpNdsObject->NdsValue.value_19.WholeSeconds;
  369. lpASN1_19->EventID
  370. = lpNdsObject->NdsValue.value_19.EventID;
  371. lpByte = (LPBYTE ) lpASN1_19 + sizeof(ASN1_TYPE_19);
  372. return(lpByte);
  373. }
  374. LPBYTE
  375. CopyNDSSynId20ToNDS20(
  376. LPBYTE lpByte,
  377. PNDSOBJECT lpNdsObject
  378. )
  379. {
  380. LPASN1_TYPE_20 lpASN1_20 = (LPASN1_TYPE_20) lpByte;
  381. lpASN1_20->ClassName =
  382. (LPWSTR)AllocADsStr(
  383. lpNdsObject->NdsValue.value_20.ClassName
  384. );
  385. lpByte = (LPBYTE ) lpASN1_20 + sizeof(ASN1_TYPE_20);
  386. return(lpByte);
  387. }
  388. LPBYTE
  389. CopyNDSSynId21ToNDS21(
  390. LPBYTE lpByte,
  391. PNDSOBJECT lpNdsObject
  392. )
  393. {
  394. LPASN1_TYPE_21 lpASN1_21 = (LPASN1_TYPE_21) lpByte;
  395. //
  396. // The Length value is supposedly always zero!!
  397. //
  398. lpASN1_21->Length = lpNdsObject->NdsValue.value_21.Length;
  399. lpASN1_21->Data = NULL;
  400. lpByte = (LPBYTE ) lpASN1_21 + sizeof(ASN1_TYPE_21);
  401. return(lpByte);
  402. }
  403. LPBYTE
  404. CopyNDSSynId22ToNDS22(
  405. LPBYTE lpByte,
  406. PNDSOBJECT lpNdsObject
  407. )
  408. {
  409. LPASN1_TYPE_22 lpASN1_22 = (LPASN1_TYPE_22) lpByte;
  410. lpASN1_22->Counter = lpNdsObject->NdsValue.value_22.Counter;
  411. lpByte = (LPBYTE ) lpASN1_22 + sizeof(ASN1_TYPE_22);
  412. return(lpByte);
  413. }
  414. LPBYTE
  415. CopyNDSSynId23ToNDS23(
  416. LPBYTE lpByte,
  417. PNDSOBJECT lpNdsObject
  418. )
  419. {
  420. LPASN1_TYPE_23 lpASN1_23 = (LPASN1_TYPE_23) lpByte;
  421. lpASN1_23->RemoteID = lpNdsObject->NdsValue.value_23.RemoteID;
  422. lpASN1_23->ObjectName =
  423. (LPWSTR)AllocADsStr(
  424. lpNdsObject->NdsValue.value_23.ObjectName
  425. );
  426. lpByte = (LPBYTE ) lpASN1_23 + sizeof(ASN1_TYPE_23);
  427. return(lpByte);
  428. }
  429. LPBYTE
  430. CopyNDSSynId24ToNDS24(
  431. LPBYTE lpByte,
  432. PNDSOBJECT lpNdsObject
  433. )
  434. {
  435. LPASN1_TYPE_24 lpASN1_24 = (LPASN1_TYPE_24) lpByte;
  436. lpASN1_24->Time = lpNdsObject->NdsValue.value_24.Time;
  437. lpByte = (LPBYTE ) lpASN1_24 + sizeof(ASN1_TYPE_24);
  438. return(lpByte);
  439. }
  440. LPBYTE
  441. CopyNDSSynId25ToNDS25(
  442. LPBYTE lpByte,
  443. PNDSOBJECT lpNdsObject
  444. )
  445. {
  446. LPASN1_TYPE_25 lpASN1_25 = (LPASN1_TYPE_25) lpByte;
  447. lpASN1_25->ObjectName =
  448. (LPWSTR)AllocADsStr(
  449. lpNdsObject->NdsValue.value_25.ObjectName
  450. );
  451. lpASN1_25->Level = lpNdsObject->NdsValue.value_25.Level;
  452. lpASN1_25->Interval = lpNdsObject->NdsValue.value_25.Interval;
  453. lpByte = (LPBYTE ) lpASN1_25 + sizeof(ASN1_TYPE_25);
  454. return(lpByte);
  455. }
  456. LPBYTE
  457. CopyNDSSynId26ToNDS26(
  458. LPBYTE lpByte,
  459. PNDSOBJECT lpNdsObject
  460. )
  461. {
  462. LPASN1_TYPE_26 lpASN1_26 = (LPASN1_TYPE_26) lpByte;
  463. lpASN1_26->ObjectName =
  464. (LPWSTR)AllocADsStr(
  465. lpNdsObject->NdsValue.value_26.ObjectName
  466. );
  467. lpASN1_26->Amount = lpNdsObject->NdsValue.value_26.Amount;
  468. lpByte = (LPBYTE ) lpASN1_26 + sizeof(ASN1_TYPE_26);
  469. return(lpByte);
  470. }
  471. LPBYTE
  472. CopyNDSSynId27ToNDS27(
  473. LPBYTE lpByte,
  474. PNDSOBJECT lpNdsObject
  475. )
  476. {
  477. LPASN1_TYPE_27 lpASN1_27 = (LPASN1_TYPE_27) lpByte;
  478. lpASN1_27->Interval = lpNdsObject->NdsValue.value_27.Interval;
  479. lpByte = (LPBYTE ) lpASN1_27 + sizeof(ASN1_TYPE_27);
  480. return(lpByte);
  481. }
  482. LPBYTE
  483. CopyNDSSynIdToNDS(
  484. DWORD dwSyntaxId,
  485. LPBYTE lpByte,
  486. PNDSOBJECT lpNdsObject
  487. )
  488. {
  489. switch (dwSyntaxId) {
  490. case 1:
  491. lpByte = CopyNDSSynId1ToNDS1(
  492. lpByte,
  493. lpNdsObject
  494. );
  495. break;
  496. case 2:
  497. lpByte = CopyNDSSynId2ToNDS2(
  498. lpByte,
  499. lpNdsObject
  500. );
  501. break;
  502. case 3:
  503. lpByte = CopyNDSSynId3ToNDS3(
  504. lpByte,
  505. lpNdsObject
  506. );
  507. break;
  508. case 4:
  509. lpByte = CopyNDSSynId4ToNDS4(
  510. lpByte,
  511. lpNdsObject
  512. );
  513. break;
  514. case 5:
  515. lpByte = CopyNDSSynId5ToNDS5(
  516. lpByte,
  517. lpNdsObject
  518. );
  519. break;
  520. case 6:
  521. lpByte = CopyNDSSynId6ToNDS6(
  522. lpByte,
  523. lpNdsObject
  524. );
  525. break;
  526. case 7:
  527. lpByte = CopyNDSSynId7ToNDS7(
  528. lpByte,
  529. lpNdsObject
  530. );
  531. break;
  532. case 8:
  533. lpByte = CopyNDSSynId8ToNDS8(
  534. lpByte,
  535. lpNdsObject
  536. );
  537. break;
  538. case 9:
  539. lpByte = CopyNDSSynId9ToNDS9(
  540. lpByte,
  541. lpNdsObject
  542. );
  543. break;
  544. case 10:
  545. lpByte = CopyNDSSynId10ToNDS10(
  546. lpByte,
  547. lpNdsObject
  548. );
  549. break;
  550. case 11:
  551. lpByte = CopyNDSSynId11ToNDS11(
  552. lpByte,
  553. lpNdsObject
  554. );
  555. break;
  556. case 12:
  557. lpByte = CopyNDSSynId12ToNDS12(
  558. lpByte,
  559. lpNdsObject
  560. );
  561. break;
  562. case 13:
  563. lpByte = CopyNDSSynId13ToNDS13(
  564. lpByte,
  565. lpNdsObject
  566. );
  567. break;
  568. case 14:
  569. lpByte = CopyNDSSynId14ToNDS14(
  570. lpByte,
  571. lpNdsObject
  572. );
  573. break;
  574. case 15:
  575. lpByte = CopyNDSSynId15ToNDS15(
  576. lpByte,
  577. lpNdsObject
  578. );
  579. break;
  580. case 16:
  581. lpByte = CopyNDSSynId16ToNDS16(
  582. lpByte,
  583. lpNdsObject
  584. );
  585. break;
  586. case 17:
  587. lpByte = CopyNDSSynId17ToNDS17(
  588. lpByte,
  589. lpNdsObject
  590. );
  591. break;
  592. case 18:
  593. lpByte = CopyNDSSynId18ToNDS18(
  594. lpByte,
  595. lpNdsObject
  596. );
  597. break;
  598. case 19:
  599. lpByte = CopyNDSSynId19ToNDS19(
  600. lpByte,
  601. lpNdsObject
  602. );
  603. break;
  604. case 20:
  605. lpByte = CopyNDSSynId20ToNDS20(
  606. lpByte,
  607. lpNdsObject
  608. );
  609. break;
  610. case 21:
  611. lpByte = CopyNDSSynId21ToNDS21(
  612. lpByte,
  613. lpNdsObject
  614. );
  615. break;
  616. case 22:
  617. lpByte = CopyNDSSynId22ToNDS22(
  618. lpByte,
  619. lpNdsObject
  620. );
  621. break;
  622. case 23:
  623. lpByte = CopyNDSSynId23ToNDS23(
  624. lpByte,
  625. lpNdsObject
  626. );
  627. break;
  628. case 24:
  629. lpByte = CopyNDSSynId24ToNDS24(
  630. lpByte,
  631. lpNdsObject
  632. );
  633. break;
  634. case 25:
  635. lpByte = CopyNDSSynId25ToNDS25(
  636. lpByte,
  637. lpNdsObject
  638. );
  639. break;
  640. case 26:
  641. lpByte = CopyNDSSynId26ToNDS26(
  642. lpByte,
  643. lpNdsObject
  644. );
  645. break;
  646. case 27:
  647. lpByte = CopyNDSSynId27ToNDS27(
  648. lpByte,
  649. lpNdsObject
  650. );
  651. break;
  652. default:
  653. break;
  654. }
  655. return(lpByte);
  656. }
  657. HRESULT
  658. MarshallNDSSynIdToNDS(
  659. DWORD dwSyntaxId,
  660. PNDSOBJECT pNdsObject,
  661. DWORD dwNumValues,
  662. LPBYTE lpValue
  663. )
  664. {
  665. DWORD i = 0;
  666. HRESULT hr = S_OK;
  667. for (i = 0; i < dwNumValues; i++) {
  668. lpValue = CopyNDSSynIdToNDS(
  669. dwSyntaxId,
  670. lpValue,
  671. (pNdsObject + i)
  672. );
  673. if (!lpValue) {
  674. hr = E_OUTOFMEMORY;
  675. BAIL_ON_FAILURE(hr);
  676. }
  677. }
  678. error:
  679. RRETURN(hr);
  680. }