Leaked source code of windows server 2003
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.

1001 lines
27 KiB

  1. #include <string.h>
  2. #include <limits.h>
  3. #include <rpc.h>
  4. #include "rawrpc.h"
  5. extern RPC_DISPATCH_TABLE IRawRpc_DispatchTable;
  6. static RPC_SERVER_INTERFACE ___RpcServerInterface = {
  7. sizeof(RPC_SERVER_INTERFACE),
  8. {{0x00000145,0x0001,0x0008,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}},
  9. {0,0}},
  10. {
  11. {0x8A885D04L,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},
  12. {2,0}
  13. }
  14. ,
  15. &IRawRpc_DispatchTable,0,0,
  16. 0
  17. }
  18. ;
  19. RPC_IF_HANDLE IRawRpc_ServerIfHandle = (RPC_IF_HANDLE) &___RpcServerInterface;
  20. void __RPC_STUB IRawRpc_Quit(
  21. PRPC_MESSAGE _prpcmsg)
  22. {
  23. SCODE _ret_value;
  24. handle_t hRpc = _prpcmsg->Handle;
  25. unsigned char * _packet;
  26. unsigned char * _tempbuf;
  27. unsigned char * _savebuf;
  28. RPC_STATUS _status;
  29. _packet = _prpcmsg->Buffer;
  30. ((void)( _packet ));
  31. ((void)( _tempbuf ));
  32. ((void)( _savebuf ));
  33. RpcTryExcept
  34. {
  35. }
  36. RpcExcept(1)
  37. {
  38. RpcRaiseException(RpcExceptionCode());
  39. }
  40. RpcEndExcept
  41. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  42. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  43. if (_prpcmsg->ManagerEpv)
  44. {
  45. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->Quit(hRpc);
  46. }
  47. else
  48. {
  49. _ret_value = Quit(hRpc);
  50. }
  51. _prpcmsg->BufferLength = 4;
  52. _prpcmsg->Buffer = _packet;
  53. _status = I_RpcGetBuffer(_prpcmsg);
  54. if (_status) RpcRaiseException(_status);
  55. _packet = (unsigned char
  56. *)_prpcmsg->Buffer; /* send data from _ret_value */
  57. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  58. _prpcmsg->Buffer = _packet;
  59. }
  60. void __RPC_STUB IRawRpc_Void(
  61. PRPC_MESSAGE _prpcmsg)
  62. {
  63. handle_t hRpc = _prpcmsg->Handle;
  64. unsigned char * _packet;
  65. unsigned char * _tempbuf;
  66. unsigned char * _savebuf;
  67. RPC_STATUS _status;
  68. _packet = _prpcmsg->Buffer;
  69. ((void)( _packet ));
  70. ((void)( _tempbuf ));
  71. ((void)( _savebuf ));
  72. RpcTryExcept
  73. {
  74. }
  75. RpcExcept(1)
  76. {
  77. RpcRaiseException(RpcExceptionCode());
  78. }
  79. RpcEndExcept
  80. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  81. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  82. if (_prpcmsg->ManagerEpv)
  83. {
  84. ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->Void(hRpc);
  85. }
  86. else
  87. {
  88. Void(hRpc);
  89. }
  90. _prpcmsg->BufferLength = 0;
  91. _prpcmsg->Buffer = _packet;
  92. _status = I_RpcGetBuffer(_prpcmsg);
  93. if (_status) RpcRaiseException(_status);
  94. }
  95. void __RPC_STUB IRawRpc_VoidRC(
  96. PRPC_MESSAGE _prpcmsg)
  97. {
  98. SCODE _ret_value;
  99. handle_t hRpc = _prpcmsg->Handle;
  100. unsigned char * _packet;
  101. unsigned char * _tempbuf;
  102. unsigned char * _savebuf;
  103. RPC_STATUS _status;
  104. _packet = _prpcmsg->Buffer;
  105. ((void)( _packet ));
  106. ((void)( _tempbuf ));
  107. ((void)( _savebuf ));
  108. RpcTryExcept
  109. {
  110. }
  111. RpcExcept(1)
  112. {
  113. RpcRaiseException(RpcExceptionCode());
  114. }
  115. RpcEndExcept
  116. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  117. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  118. if (_prpcmsg->ManagerEpv)
  119. {
  120. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->VoidRC(hRpc);
  121. }
  122. else
  123. {
  124. _ret_value = VoidRC(hRpc);
  125. }
  126. _prpcmsg->BufferLength = 4;
  127. _prpcmsg->Buffer = _packet;
  128. _status = I_RpcGetBuffer(_prpcmsg);
  129. if (_status) RpcRaiseException(_status);
  130. _packet = (unsigned char
  131. *)_prpcmsg->Buffer; /* send data from _ret_value */
  132. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  133. _prpcmsg->Buffer = _packet;
  134. }
  135. void __RPC_STUB IRawRpc_VoidPtrIn(
  136. PRPC_MESSAGE _prpcmsg)
  137. {
  138. SCODE _ret_value;
  139. handle_t hRpc = _prpcmsg->Handle;
  140. ULONG cb;
  141. void *pv = 0;
  142. unsigned long _alloc_total;
  143. unsigned char * _packet;
  144. unsigned char * _tempbuf;
  145. unsigned char * _savebuf;
  146. RPC_STATUS _status;
  147. _packet = _prpcmsg->Buffer;
  148. ((void)( _alloc_total ));
  149. ((void)( _packet ));
  150. ((void)( _tempbuf ));
  151. ((void)( _savebuf ));
  152. RpcTryExcept
  153. {
  154. /* receive data into &cb */
  155. long_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned long *)&cb);
  156. _tempbuf = (unsigned char *)_prpcmsg->Buffer;
  157. // recv total number of elements
  158. long_from_ndr((PRPC_MESSAGE)_prpcmsg, &_alloc_total);
  159. if (pv ==0)
  160. {
  161. pv = (void *)MIDL_user_allocate ((size_t)(_alloc_total * sizeof(unsigned char)));
  162. }
  163. byte_array_from_ndr ((PRPC_MESSAGE)_prpcmsg, 0, _alloc_total, pv);
  164. }
  165. RpcExcept(1)
  166. {
  167. RpcRaiseException(RpcExceptionCode());
  168. }
  169. RpcEndExcept
  170. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  171. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  172. RpcTryFinally
  173. {
  174. if (_prpcmsg->ManagerEpv)
  175. {
  176. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->VoidPtrIn(hRpc, cb, pv);
  177. }
  178. else
  179. {
  180. _ret_value = VoidPtrIn(hRpc, cb, pv);
  181. }
  182. _prpcmsg->BufferLength = 4;
  183. _prpcmsg->Buffer = _packet;
  184. _status = I_RpcGetBuffer(_prpcmsg);
  185. if (_status) RpcRaiseException(_status);
  186. _packet = (unsigned char
  187. *)_prpcmsg->Buffer; /* send data from _ret_value */
  188. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  189. }
  190. RpcFinally
  191. {
  192. MIDL_user_free((void *)(pv));
  193. }
  194. RpcEndFinally
  195. _prpcmsg->Buffer = _packet;
  196. }
  197. void __RPC_STUB IRawRpc_VoidPtrOut(
  198. PRPC_MESSAGE _prpcmsg)
  199. {
  200. SCODE _ret_value;
  201. handle_t hRpc = _prpcmsg->Handle;
  202. ULONG cb;
  203. ULONG *pcb = 0;
  204. void *pv = 0;
  205. unsigned long _alloc_total;
  206. unsigned char * _packet;
  207. unsigned int _length;
  208. unsigned char * _tempbuf;
  209. unsigned char * _savebuf;
  210. RPC_STATUS _status;
  211. _packet = _prpcmsg->Buffer;
  212. ((void)( _alloc_total ));
  213. ((void)( _packet ));
  214. ((void)( _tempbuf ));
  215. ((void)( _savebuf ));
  216. ((void)( _length ));
  217. RpcTryExcept
  218. {
  219. /* receive data into &cb */
  220. long_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned long *)&cb);
  221. }
  222. RpcExcept(1)
  223. {
  224. RpcRaiseException(RpcExceptionCode());
  225. }
  226. RpcEndExcept
  227. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  228. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  229. pcb = (unsigned long *)MIDL_user_allocate ((size_t)(sizeof(long)));
  230. _alloc_total = cb;
  231. pv = (void *)MIDL_user_allocate ((size_t)(_alloc_total * sizeof(unsigned char)));
  232. RpcTryFinally
  233. {
  234. if (_prpcmsg->ManagerEpv)
  235. {
  236. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->VoidPtrOut(hRpc, cb, pcb, pv);
  237. }
  238. else
  239. {
  240. _ret_value = VoidPtrOut(hRpc, cb, pcb, pv);
  241. }
  242. _prpcmsg->BufferLength = 24;
  243. if (pv ==0)
  244. RpcRaiseException(RPC_X_NULL_REF_POINTER);
  245. if (cb)
  246. {
  247. if (((*(pcb))) > (cb)) RpcRaiseException(RPC_X_INVALID_BOUND);
  248. }
  249. else
  250. {
  251. if (((*(pcb))) != (cb)) RpcRaiseException(RPC_X_INVALID_BOUND);
  252. }
  253. _prpcmsg->BufferLength += 12;
  254. _prpcmsg->BufferLength += (unsigned int)((*(pcb)));
  255. _prpcmsg->Buffer = _packet;
  256. _status = I_RpcGetBuffer(_prpcmsg);
  257. if (_status) RpcRaiseException(_status);
  258. _packet = (unsigned char
  259. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  260. _prpcmsg->BufferLength = 0;
  261. /* send data from *pcb */
  262. *(*(long **)&_prpcmsg->Buffer)++ = (long)*pcb;
  263. // send total number of elements
  264. *(*(long **)&_prpcmsg->Buffer)++ = cb;
  265. // send valid range
  266. *(*(long **)&_prpcmsg->Buffer)++ = 0;
  267. *(*(long **)&_prpcmsg->Buffer)++ = (*(pcb));
  268. /* send data from pv */
  269. NDRcopy (_prpcmsg->Buffer, (void __RPC_FAR *) ((unsigned char *)pv+0), (unsigned int)((*(pcb))));
  270. *(unsigned long *)&_prpcmsg->Buffer += (*(pcb));
  271. /* send data from _ret_value */
  272. *(unsigned long *)&_prpcmsg->Buffer += 3;
  273. *(unsigned long *)&_prpcmsg->Buffer &= 0xfffffffc;
  274. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  275. }
  276. RpcFinally
  277. {
  278. MIDL_user_free((void *)(pv));
  279. MIDL_user_free((void *)(pcb));
  280. }
  281. RpcEndFinally
  282. _prpcmsg->Buffer = _packet;
  283. _prpcmsg->BufferLength = _length;
  284. }
  285. void __RPC_STUB IRawRpc_DwordIn(
  286. PRPC_MESSAGE _prpcmsg)
  287. {
  288. SCODE _ret_value;
  289. handle_t hRpc = _prpcmsg->Handle;
  290. DWORD dw;
  291. unsigned char * _packet;
  292. unsigned char * _tempbuf;
  293. unsigned char * _savebuf;
  294. RPC_STATUS _status;
  295. _packet = _prpcmsg->Buffer;
  296. ((void)( _packet ));
  297. ((void)( _tempbuf ));
  298. ((void)( _savebuf ));
  299. RpcTryExcept
  300. {
  301. /* receive data into &dw */
  302. long_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned long *)&dw);
  303. }
  304. RpcExcept(1)
  305. {
  306. RpcRaiseException(RpcExceptionCode());
  307. }
  308. RpcEndExcept
  309. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  310. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  311. if (_prpcmsg->ManagerEpv)
  312. {
  313. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->DwordIn(hRpc, dw);
  314. }
  315. else
  316. {
  317. _ret_value = DwordIn(hRpc, dw);
  318. }
  319. _prpcmsg->BufferLength = 4;
  320. _prpcmsg->Buffer = _packet;
  321. _status = I_RpcGetBuffer(_prpcmsg);
  322. if (_status) RpcRaiseException(_status);
  323. _packet = (unsigned char
  324. *)_prpcmsg->Buffer; /* send data from _ret_value */
  325. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  326. _prpcmsg->Buffer = _packet;
  327. }
  328. void __RPC_STUB IRawRpc_DwordOut(
  329. PRPC_MESSAGE _prpcmsg)
  330. {
  331. SCODE _ret_value;
  332. handle_t hRpc = _prpcmsg->Handle;
  333. DWORD pdw;
  334. unsigned char * _packet;
  335. unsigned int _length;
  336. unsigned char * _tempbuf;
  337. unsigned char * _savebuf;
  338. RPC_STATUS _status;
  339. _packet = _prpcmsg->Buffer;
  340. ((void)( _packet ));
  341. ((void)( _tempbuf ));
  342. ((void)( _savebuf ));
  343. ((void)( _length ));
  344. RpcTryExcept
  345. {
  346. }
  347. RpcExcept(1)
  348. {
  349. RpcRaiseException(RpcExceptionCode());
  350. }
  351. RpcEndExcept
  352. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  353. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  354. RpcTryFinally
  355. {
  356. if (_prpcmsg->ManagerEpv)
  357. {
  358. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->DwordOut(hRpc, &pdw);
  359. }
  360. else
  361. {
  362. _ret_value = DwordOut(hRpc, &pdw);
  363. }
  364. _prpcmsg->BufferLength = 8;
  365. _prpcmsg->Buffer = _packet;
  366. _status = I_RpcGetBuffer(_prpcmsg);
  367. if (_status) RpcRaiseException(_status);
  368. _packet = (unsigned char
  369. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  370. _prpcmsg->BufferLength = 0;
  371. /* send data from pdw */
  372. *(*(long **)&_prpcmsg->Buffer)++ = (long)pdw;
  373. /* send data from _ret_value */
  374. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  375. }
  376. RpcFinally
  377. {
  378. }
  379. RpcEndFinally
  380. _prpcmsg->Buffer = _packet;
  381. _prpcmsg->BufferLength = _length;
  382. }
  383. void __RPC_STUB IRawRpc_DwordInOut(
  384. PRPC_MESSAGE _prpcmsg)
  385. {
  386. SCODE _ret_value;
  387. handle_t hRpc = _prpcmsg->Handle;
  388. DWORD pdw;
  389. unsigned char * _packet;
  390. unsigned int _length;
  391. unsigned char * _tempbuf;
  392. unsigned char * _savebuf;
  393. RPC_STATUS _status;
  394. _packet = _prpcmsg->Buffer;
  395. ((void)( _packet ));
  396. ((void)( _tempbuf ));
  397. ((void)( _savebuf ));
  398. ((void)( _length ));
  399. RpcTryExcept
  400. {
  401. _tempbuf = (unsigned char *)_prpcmsg->Buffer;
  402. /* receive data into &pdw */
  403. long_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned long *)&pdw);
  404. }
  405. RpcExcept(1)
  406. {
  407. RpcRaiseException(RpcExceptionCode());
  408. }
  409. RpcEndExcept
  410. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  411. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  412. RpcTryFinally
  413. {
  414. if (_prpcmsg->ManagerEpv)
  415. {
  416. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->DwordInOut(hRpc, &pdw);
  417. }
  418. else
  419. {
  420. _ret_value = DwordInOut(hRpc, &pdw);
  421. }
  422. _prpcmsg->BufferLength = 8;
  423. _prpcmsg->Buffer = _packet;
  424. _status = I_RpcGetBuffer(_prpcmsg);
  425. if (_status) RpcRaiseException(_status);
  426. _packet = (unsigned char
  427. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  428. _prpcmsg->BufferLength = 0;
  429. /* send data from pdw */
  430. *(*(long **)&_prpcmsg->Buffer)++ = (long)pdw;
  431. /* send data from _ret_value */
  432. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  433. }
  434. RpcFinally
  435. {
  436. }
  437. RpcEndFinally
  438. _prpcmsg->Buffer = _packet;
  439. _prpcmsg->BufferLength = _length;
  440. }
  441. void __RPC_STUB IRawRpc_LiIn(
  442. PRPC_MESSAGE _prpcmsg)
  443. {
  444. SCODE _ret_value;
  445. handle_t hRpc = _prpcmsg->Handle;
  446. LARGE_INTEGER li;
  447. unsigned long _alloc_total;
  448. unsigned char * _packet;
  449. unsigned char * _tempbuf;
  450. unsigned char * _savebuf;
  451. RPC_STATUS _status;
  452. _packet = _prpcmsg->Buffer;
  453. ((void)( _alloc_total ));
  454. ((void)( _packet ));
  455. ((void)( _tempbuf ));
  456. ((void)( _savebuf ));
  457. RpcTryExcept
  458. {
  459. data_from_ndr((PRPC_MESSAGE)_prpcmsg, (void __RPC_FAR *) (&li), "4ll", 8);
  460. }
  461. RpcExcept(1)
  462. {
  463. RpcRaiseException(RpcExceptionCode());
  464. }
  465. RpcEndExcept
  466. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  467. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  468. if (_prpcmsg->ManagerEpv)
  469. {
  470. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->LiIn(hRpc, li);
  471. }
  472. else
  473. {
  474. _ret_value = LiIn(hRpc, li);
  475. }
  476. _prpcmsg->BufferLength = 4;
  477. _prpcmsg->Buffer = _packet;
  478. _status = I_RpcGetBuffer(_prpcmsg);
  479. if (_status) RpcRaiseException(_status);
  480. _packet = (unsigned char
  481. *)_prpcmsg->Buffer; /* send data from _ret_value */
  482. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  483. _prpcmsg->Buffer = _packet;
  484. }
  485. void __RPC_STUB IRawRpc_LiOut(
  486. PRPC_MESSAGE _prpcmsg)
  487. {
  488. SCODE _ret_value;
  489. handle_t hRpc = _prpcmsg->Handle;
  490. LARGE_INTEGER pli;
  491. unsigned long _alloc_total;
  492. unsigned char * _packet;
  493. unsigned int _length;
  494. unsigned char * _tempbuf;
  495. unsigned char * _savebuf;
  496. RPC_STATUS _status;
  497. _packet = _prpcmsg->Buffer;
  498. ((void)( _alloc_total ));
  499. ((void)( _packet ));
  500. ((void)( _tempbuf ));
  501. ((void)( _savebuf ));
  502. ((void)( _length ));
  503. RpcTryExcept
  504. {
  505. }
  506. RpcExcept(1)
  507. {
  508. RpcRaiseException(RpcExceptionCode());
  509. }
  510. RpcEndExcept
  511. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  512. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  513. RpcTryFinally
  514. {
  515. if (_prpcmsg->ManagerEpv)
  516. {
  517. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->LiOut(hRpc, &pli);
  518. }
  519. else
  520. {
  521. _ret_value = LiOut(hRpc, &pli);
  522. }
  523. _prpcmsg->BufferLength = 12;
  524. _prpcmsg->Buffer = _packet;
  525. _status = I_RpcGetBuffer(_prpcmsg);
  526. if (_status) RpcRaiseException(_status);
  527. _packet = (unsigned char
  528. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  529. _prpcmsg->BufferLength = 0;
  530. /* send data from &pli */
  531. NDRcopy (_prpcmsg->Buffer, (void __RPC_FAR *) (&pli), (unsigned int)(8));
  532. *(unsigned long *)&_prpcmsg->Buffer += 8;
  533. /* send data from _ret_value */
  534. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  535. }
  536. RpcFinally
  537. {
  538. }
  539. RpcEndFinally
  540. _prpcmsg->Buffer = _packet;
  541. _prpcmsg->BufferLength = _length;
  542. }
  543. void __RPC_STUB IRawRpc_ULiIn(
  544. PRPC_MESSAGE _prpcmsg)
  545. {
  546. SCODE _ret_value;
  547. handle_t hRpc = _prpcmsg->Handle;
  548. ULARGE_INTEGER uli;
  549. unsigned long _alloc_total;
  550. unsigned char * _packet;
  551. unsigned char * _tempbuf;
  552. unsigned char * _savebuf;
  553. RPC_STATUS _status;
  554. _packet = _prpcmsg->Buffer;
  555. ((void)( _alloc_total ));
  556. ((void)( _packet ));
  557. ((void)( _tempbuf ));
  558. ((void)( _savebuf ));
  559. RpcTryExcept
  560. {
  561. data_from_ndr((PRPC_MESSAGE)_prpcmsg, (void __RPC_FAR *) (&uli), "4ll", 8);
  562. }
  563. RpcExcept(1)
  564. {
  565. RpcRaiseException(RpcExceptionCode());
  566. }
  567. RpcEndExcept
  568. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  569. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  570. if (_prpcmsg->ManagerEpv)
  571. {
  572. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->ULiIn(hRpc, uli);
  573. }
  574. else
  575. {
  576. _ret_value = ULiIn(hRpc, uli);
  577. }
  578. _prpcmsg->BufferLength = 4;
  579. _prpcmsg->Buffer = _packet;
  580. _status = I_RpcGetBuffer(_prpcmsg);
  581. if (_status) RpcRaiseException(_status);
  582. _packet = (unsigned char
  583. *)_prpcmsg->Buffer; /* send data from _ret_value */
  584. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  585. _prpcmsg->Buffer = _packet;
  586. }
  587. void __RPC_STUB IRawRpc_ULiOut(
  588. PRPC_MESSAGE _prpcmsg)
  589. {
  590. SCODE _ret_value;
  591. handle_t hRpc = _prpcmsg->Handle;
  592. ULARGE_INTEGER puli;
  593. unsigned long _alloc_total;
  594. unsigned char * _packet;
  595. unsigned int _length;
  596. unsigned char * _tempbuf;
  597. unsigned char * _savebuf;
  598. RPC_STATUS _status;
  599. _packet = _prpcmsg->Buffer;
  600. ((void)( _alloc_total ));
  601. ((void)( _packet ));
  602. ((void)( _tempbuf ));
  603. ((void)( _savebuf ));
  604. ((void)( _length ));
  605. RpcTryExcept
  606. {
  607. }
  608. RpcExcept(1)
  609. {
  610. RpcRaiseException(RpcExceptionCode());
  611. }
  612. RpcEndExcept
  613. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  614. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  615. RpcTryFinally
  616. {
  617. if (_prpcmsg->ManagerEpv)
  618. {
  619. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->ULiOut(hRpc, &puli);
  620. }
  621. else
  622. {
  623. _ret_value = ULiOut(hRpc, &puli);
  624. }
  625. _prpcmsg->BufferLength = 12;
  626. _prpcmsg->Buffer = _packet;
  627. _status = I_RpcGetBuffer(_prpcmsg);
  628. if (_status) RpcRaiseException(_status);
  629. _packet = (unsigned char
  630. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  631. _prpcmsg->BufferLength = 0;
  632. /* send data from &puli */
  633. NDRcopy (_prpcmsg->Buffer, (void __RPC_FAR *) (&puli), (unsigned int)(8));
  634. *(unsigned long *)&_prpcmsg->Buffer += 8;
  635. /* send data from _ret_value */
  636. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  637. }
  638. RpcFinally
  639. {
  640. }
  641. RpcEndFinally
  642. _prpcmsg->Buffer = _packet;
  643. _prpcmsg->BufferLength = _length;
  644. }
  645. void __RPC_STUB IRawRpc_StringIn(
  646. PRPC_MESSAGE _prpcmsg)
  647. {
  648. SCODE _ret_value;
  649. handle_t hRpc = _prpcmsg->Handle;
  650. LPWSTR pwsz = 0;
  651. unsigned long _alloc_total;
  652. unsigned long _valid_lower;
  653. unsigned long _valid_total;
  654. unsigned char * _packet;
  655. unsigned int _length;
  656. unsigned char * _buffer;
  657. unsigned char * _treebuf;
  658. unsigned char * _tempbuf;
  659. unsigned char * _savebuf;
  660. RPC_STATUS _status;
  661. _packet = _prpcmsg->Buffer;
  662. ((void)( _alloc_total ));
  663. ((void)( _valid_total ));
  664. ((void)( _valid_lower ));
  665. ((void)( _packet ));
  666. ((void)( _buffer ));
  667. ((void)( _treebuf ));
  668. ((void)( _tempbuf ));
  669. ((void)( _savebuf ));
  670. ((void)( _length ));
  671. RpcTryExcept
  672. {
  673. _tempbuf = (unsigned char *)_prpcmsg->Buffer;
  674. _treebuf = 0;
  675. // recv total number of elements
  676. long_from_ndr((PRPC_MESSAGE)_prpcmsg, &_alloc_total);
  677. if (pwsz ==0)
  678. {
  679. pwsz = (WCHAR *)MIDL_user_allocate ((size_t)(_alloc_total * sizeof(WCHAR)));
  680. }
  681. data_from_ndr((PRPC_MESSAGE)_prpcmsg, (void __RPC_FAR *) (pwsz), "s2", 1);
  682. }
  683. RpcExcept(1)
  684. {
  685. RpcRaiseException(RpcExceptionCode());
  686. }
  687. RpcEndExcept
  688. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  689. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  690. RpcTryFinally
  691. {
  692. if (_prpcmsg->ManagerEpv)
  693. {
  694. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->StringIn(hRpc, pwsz);
  695. }
  696. else
  697. {
  698. _ret_value = StringIn(hRpc, pwsz);
  699. }
  700. _prpcmsg->BufferLength = 4;
  701. _prpcmsg->Buffer = _packet;
  702. _status = I_RpcGetBuffer(_prpcmsg);
  703. if (_status) RpcRaiseException(_status);
  704. _packet = (unsigned char
  705. *)_prpcmsg->Buffer; /* send data from _ret_value */
  706. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  707. }
  708. RpcFinally
  709. {
  710. MIDL_user_free((void *)(pwsz));
  711. }
  712. RpcEndFinally
  713. _prpcmsg->Buffer = _packet;
  714. }
  715. void __RPC_STUB IRawRpc_StringOut(
  716. PRPC_MESSAGE _prpcmsg)
  717. {
  718. SCODE _ret_value;
  719. handle_t hRpc = _prpcmsg->Handle;
  720. LPWSTR ppwsz = 0;
  721. unsigned long _alloc_total;
  722. unsigned char * _packet;
  723. unsigned int _length;
  724. unsigned char * _buffer;
  725. unsigned char * _treebuf;
  726. unsigned char * _tempbuf;
  727. unsigned char * _savebuf;
  728. RPC_STATUS _status;
  729. _packet = _prpcmsg->Buffer;
  730. ((void)( _alloc_total ));
  731. ((void)( _packet ));
  732. ((void)( _buffer ));
  733. ((void)( _treebuf ));
  734. ((void)( _tempbuf ));
  735. ((void)( _savebuf ));
  736. ((void)( _length ));
  737. RpcTryExcept
  738. {
  739. }
  740. RpcExcept(1)
  741. {
  742. RpcRaiseException(RpcExceptionCode());
  743. }
  744. RpcEndExcept
  745. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  746. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  747. RpcTryFinally
  748. {
  749. if (_prpcmsg->ManagerEpv)
  750. {
  751. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->StringOut(hRpc, &ppwsz);
  752. }
  753. else
  754. {
  755. _ret_value = StringOut(hRpc, &ppwsz);
  756. }
  757. _prpcmsg->BufferLength = 16;
  758. _prpcmsg->BufferLength += 4;
  759. if (ppwsz !=0)
  760. {
  761. tree_size_ndr((void __RPC_FAR *)&(ppwsz), (PRPC_MESSAGE)_prpcmsg, "s2", 1);
  762. }
  763. _prpcmsg->Buffer = _packet;
  764. _status = I_RpcGetBuffer(_prpcmsg);
  765. if (_status) RpcRaiseException(_status);
  766. _packet = (unsigned char
  767. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  768. _prpcmsg->BufferLength = 0;
  769. /* send data from ppwsz */
  770. *(*(long **)&_prpcmsg->Buffer)++ = (long)ppwsz;
  771. if (ppwsz !=0)
  772. {
  773. tree_into_ndr((void __RPC_FAR *)&(ppwsz), (PRPC_MESSAGE)_prpcmsg, "s2", 1);
  774. }
  775. /* send data from _ret_value */
  776. *(unsigned long *)&_prpcmsg->Buffer += 3;
  777. *(unsigned long *)&_prpcmsg->Buffer &= 0xfffffffc;
  778. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  779. }
  780. RpcFinally
  781. {
  782. if (ppwsz !=0)
  783. {
  784. MIDL_user_free((void *)(ppwsz));
  785. }
  786. }
  787. RpcEndFinally
  788. _prpcmsg->Buffer = _packet;
  789. _prpcmsg->BufferLength = _length;
  790. }
  791. void __RPC_STUB IRawRpc_StringInOut(
  792. PRPC_MESSAGE _prpcmsg)
  793. {
  794. SCODE _ret_value;
  795. handle_t hRpc = _prpcmsg->Handle;
  796. LPWSTR pwsz = 0;
  797. unsigned long _alloc_total;
  798. unsigned long _valid_lower;
  799. unsigned long _valid_total;
  800. unsigned char * _packet;
  801. unsigned int _length;
  802. unsigned char * _buffer;
  803. unsigned char * _treebuf;
  804. unsigned char * _tempbuf;
  805. unsigned char * _savebuf;
  806. RPC_STATUS _status;
  807. _packet = _prpcmsg->Buffer;
  808. ((void)( _alloc_total ));
  809. ((void)( _valid_total ));
  810. ((void)( _valid_lower ));
  811. ((void)( _packet ));
  812. ((void)( _buffer ));
  813. ((void)( _treebuf ));
  814. ((void)( _tempbuf ));
  815. ((void)( _savebuf ));
  816. ((void)( _length ));
  817. RpcTryExcept
  818. {
  819. _tempbuf = (unsigned char *)_prpcmsg->Buffer;
  820. _treebuf = 0;
  821. // recv total number of elements
  822. long_from_ndr((PRPC_MESSAGE)_prpcmsg, &_alloc_total);
  823. if (pwsz ==0)
  824. {
  825. pwsz = (WCHAR *)MIDL_user_allocate ((size_t)(_alloc_total * sizeof(WCHAR)));
  826. }
  827. data_from_ndr((PRPC_MESSAGE)_prpcmsg, (void __RPC_FAR *) (pwsz), "s2", 1);
  828. }
  829. RpcExcept(1)
  830. {
  831. RpcRaiseException(RpcExceptionCode());
  832. }
  833. RpcEndExcept
  834. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  835. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  836. RpcTryFinally
  837. {
  838. if (_prpcmsg->ManagerEpv)
  839. {
  840. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->StringInOut(hRpc, pwsz);
  841. }
  842. else
  843. {
  844. _ret_value = StringInOut(hRpc, pwsz);
  845. }
  846. _prpcmsg->BufferLength = 16;
  847. if (pwsz ==0)
  848. RpcRaiseException(RPC_X_NULL_REF_POINTER);
  849. tree_size_ndr((void __RPC_FAR *)&(pwsz), (PRPC_MESSAGE)_prpcmsg, "s2", 1);
  850. _prpcmsg->Buffer = _packet;
  851. _status = I_RpcGetBuffer(_prpcmsg);
  852. if (_status) RpcRaiseException(_status);
  853. _packet = (unsigned char
  854. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  855. _prpcmsg->BufferLength = 0;
  856. tree_into_ndr((void __RPC_FAR *)&(pwsz), (PRPC_MESSAGE)_prpcmsg, "s2", 1);
  857. /* send data from _ret_value */
  858. *(unsigned long *)&_prpcmsg->Buffer += 3;
  859. *(unsigned long *)&_prpcmsg->Buffer &= 0xfffffffc;
  860. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  861. }
  862. RpcFinally
  863. {
  864. MIDL_user_free((void *)(pwsz));
  865. }
  866. RpcEndFinally
  867. _prpcmsg->Buffer = _packet;
  868. _prpcmsg->BufferLength = _length;
  869. }
  870. void __RPC_STUB IRawRpc_GuidIn(
  871. PRPC_MESSAGE _prpcmsg)
  872. {
  873. SCODE _ret_value;
  874. handle_t hRpc = _prpcmsg->Handle;
  875. GUID guid;
  876. unsigned long _alloc_total;
  877. unsigned char * _packet;
  878. unsigned char * _tempbuf;
  879. unsigned char * _savebuf;
  880. RPC_STATUS _status;
  881. _packet = _prpcmsg->Buffer;
  882. ((void)( _alloc_total ));
  883. ((void)( _packet ));
  884. ((void)( _tempbuf ));
  885. ((void)( _savebuf ));
  886. RpcTryExcept
  887. {
  888. _gns__GUID ((GUID *)&guid, (PRPC_MESSAGE)_prpcmsg);
  889. }
  890. RpcExcept(1)
  891. {
  892. RpcRaiseException(RpcExceptionCode());
  893. }
  894. RpcEndExcept
  895. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  896. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  897. if (_prpcmsg->ManagerEpv)
  898. {
  899. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->GuidIn(hRpc, guid);
  900. }
  901. else
  902. {
  903. _ret_value = GuidIn(hRpc, guid);
  904. }
  905. _prpcmsg->BufferLength = 4;
  906. _prpcmsg->Buffer = _packet;
  907. _status = I_RpcGetBuffer(_prpcmsg);
  908. if (_status) RpcRaiseException(_status);
  909. _packet = (unsigned char
  910. *)_prpcmsg->Buffer; /* send data from _ret_value */
  911. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  912. _prpcmsg->Buffer = _packet;
  913. }
  914. void __RPC_STUB IRawRpc_GuidOut(
  915. PRPC_MESSAGE _prpcmsg)
  916. {
  917. SCODE _ret_value;
  918. handle_t hRpc = _prpcmsg->Handle;
  919. GUID pguid;
  920. unsigned long _alloc_total;
  921. unsigned char * _packet;
  922. unsigned int _length;
  923. unsigned char * _tempbuf;
  924. unsigned char * _savebuf;
  925. RPC_STATUS _status;
  926. _packet = _prpcmsg->Buffer;
  927. ((void)( _alloc_total ));
  928. ((void)( _packet ));
  929. ((void)( _tempbuf ));
  930. ((void)( _savebuf ));
  931. ((void)( _length ));
  932. RpcTryExcept
  933. {
  934. }
  935. RpcExcept(1)
  936. {
  937. RpcRaiseException(RpcExceptionCode());
  938. }
  939. RpcEndExcept
  940. if (((unsigned int)(((unsigned char *)_prpcmsg->Buffer) - _packet)) > _prpcmsg->BufferLength)
  941. RpcRaiseException(RPC_X_BAD_STUB_DATA);
  942. RpcTryFinally
  943. {
  944. if (_prpcmsg->ManagerEpv)
  945. {
  946. _ret_value = ((IRawRpc_SERVER_EPV *)(_prpcmsg->ManagerEpv))->GuidOut(hRpc, &pguid);
  947. }
  948. else
  949. {
  950. _ret_value = GuidOut(hRpc, &pguid);
  951. }
  952. _prpcmsg->BufferLength = 20;
  953. _prpcmsg->Buffer = _packet;
  954. _status = I_RpcGetBuffer(_prpcmsg);
  955. if (_status) RpcRaiseException(_status);
  956. _packet = (unsigned char
  957. *)_prpcmsg->Buffer; _length = _prpcmsg->BufferLength;
  958. _prpcmsg->BufferLength = 0;
  959. /* send data from &pguid */
  960. NDRcopy (_prpcmsg->Buffer, (void __RPC_FAR *) (&pguid), (unsigned int)(16));
  961. *(unsigned long *)&_prpcmsg->Buffer += 16;
  962. /* send data from _ret_value */
  963. *(*(long **)&_prpcmsg->Buffer)++ = (long)_ret_value;
  964. }
  965. RpcFinally
  966. {
  967. }
  968. RpcEndFinally
  969. _prpcmsg->Buffer = _packet;
  970. _prpcmsg->BufferLength = _length;
  971. }
  972. static RPC_DISPATCH_FUNCTION IRawRpc_table[] =
  973. {
  974. IRawRpc_Quit,
  975. IRawRpc_Void,
  976. IRawRpc_VoidRC,
  977. IRawRpc_VoidPtrIn,
  978. IRawRpc_VoidPtrOut,
  979. IRawRpc_DwordIn,
  980. IRawRpc_DwordOut,
  981. IRawRpc_DwordInOut,
  982. IRawRpc_LiIn,
  983. IRawRpc_LiOut,
  984. IRawRpc_ULiIn,
  985. IRawRpc_ULiOut,
  986. IRawRpc_StringIn,
  987. IRawRpc_StringOut,
  988. IRawRpc_StringInOut,
  989. IRawRpc_GuidIn,
  990. IRawRpc_GuidOut,
  991. 0
  992. }
  993. ;
  994. RPC_DISPATCH_TABLE IRawRpc_DispatchTable =
  995. {
  996. 17,
  997. IRawRpc_table
  998. }
  999. ;