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.

1804 lines
40 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1992 - 1999
  3. Module Name:
  4. nsimgmt.cxx
  5. Abstract:
  6. This is the module implements the client side support for management
  7. APIs.
  8. Author:
  9. Steven Zeck (stevez) 04/23/92
  10. --*/
  11. #include <nsi.h>
  12. #include <string.h>
  13. RPC_STATUS RPC_ENTRY
  14. I_NsBindingFoundBogus(RPC_BINDING_HANDLE *BindingHandle, DWORD BindId);
  15. RPC_STATUS RPC_ENTRY
  16. I_NsClientBindSearch(RPC_BINDING_HANDLE *NsiClntBinding, DWORD *BindId);
  17. void RPC_ENTRY
  18. I_NsClientBindDone(RPC_BINDING_HANDLE *NsiClntBinding, DWORD BindId);
  19. RPC_STATUS RPC_ENTRY
  20. RpcNsGroupDeleteW(
  21. IN unsigned long GroupNameSyntax,
  22. IN unsigned short __RPC_FAR * GroupName
  23. )
  24. /*++
  25. Routine Description:
  26. Remove a group entry and all its member items.
  27. Arguments:
  28. GroupNameSyntax - This value describes the type/format of the GroupName.
  29. GroupName - Name that will be deleted.
  30. Returns:
  31. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_group_delete()
  32. --*/
  33. {
  34. RPC_STATUS status;
  35. UNSIGNED16 NsiStatus;
  36. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  37. DWORD BindId = 0;
  38. if (! GroupNameSyntax)
  39. GroupNameSyntax = DefaultSyntax;
  40. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  41. {
  42. RpcTryExcept
  43. {
  44. nsi_group_delete(NsiClntBinding, GroupNameSyntax, GroupName, &NsiStatus);
  45. }
  46. RpcExcept(1)
  47. {
  48. NsiStatus = MapException(RpcExceptionCode());
  49. }
  50. RpcEndExcept
  51. status = NsiMapStatus(NsiStatus);
  52. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  53. break;
  54. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  55. }
  56. I_NsClientBindDone(&NsiClntBinding, BindId);
  57. return(NsiMapStatus(NsiStatus));
  58. }
  59. RPC_STATUS RPC_ENTRY
  60. RpcNsGroupMbrAddW(
  61. IN unsigned long GroupNameSyntax,
  62. IN unsigned short __RPC_FAR * GroupName,
  63. IN unsigned long MemberNameSyntax,
  64. IN unsigned short __RPC_FAR * MemberName
  65. )
  66. /*++
  67. Routine Description:
  68. Add a new member to a group entry. Create the group entry on demand.
  69. Arguments:
  70. GroupNameSyntax - This value describes the type/format of the GroupName.
  71. GroupName - Name of the group that the member will be added to.
  72. MemberNameSyntax - This value describes the type/format of the MemberName.
  73. MemberName - Name of member in the group that will be added.
  74. Returns:
  75. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_group_mbr_add()
  76. --*/
  77. {
  78. RPC_STATUS status;
  79. UNSIGNED16 NsiStatus;
  80. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  81. DWORD BindId = 0;
  82. if (! GroupNameSyntax)
  83. GroupNameSyntax = DefaultSyntax;
  84. if (! MemberNameSyntax)
  85. MemberNameSyntax = DefaultSyntax;
  86. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  87. {
  88. RpcTryExcept
  89. {
  90. nsi_group_mbr_add(NsiClntBinding, GroupNameSyntax, GroupName,
  91. MemberNameSyntax, MemberName, &NsiStatus);
  92. }
  93. RpcExcept(1)
  94. {
  95. NsiStatus = MapException(RpcExceptionCode());
  96. }
  97. RpcEndExcept
  98. status = NsiMapStatus(NsiStatus);
  99. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  100. break;
  101. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  102. }
  103. I_NsClientBindDone(&NsiClntBinding, BindId);
  104. return(status);
  105. }
  106. RPC_STATUS RPC_ENTRY
  107. RpcNsGroupMbrRemoveW(
  108. IN unsigned long GroupNameSyntax,
  109. IN unsigned short __RPC_FAR * GroupName,
  110. IN unsigned long MemberNameSyntax,
  111. IN unsigned short __RPC_FAR * MemberName
  112. )
  113. /*++
  114. Routine Description:
  115. Arguments:
  116. GroupNameSyntax - This value describes the type/format of the GroupName.
  117. GroupName - Name of the group that the member will be deleted from.
  118. MemberNameSyntax - This value describes the type/format of the MemberName.
  119. MemberName - Name of member in the group that will be deleted
  120. Returns:
  121. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_group_mbr_remove()
  122. --*/
  123. {
  124. RPC_STATUS status;
  125. UNSIGNED16 NsiStatus;
  126. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  127. DWORD BindId = 0;
  128. if (! GroupNameSyntax)
  129. GroupNameSyntax = DefaultSyntax;
  130. if (! MemberNameSyntax)
  131. MemberNameSyntax = DefaultSyntax;
  132. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  133. {
  134. RpcTryExcept
  135. {
  136. nsi_group_mbr_remove(NsiClntBinding, GroupNameSyntax, GroupName,
  137. MemberNameSyntax, MemberName, &NsiStatus);
  138. }
  139. RpcExcept(1)
  140. {
  141. NsiStatus = MapException(RpcExceptionCode());
  142. }
  143. RpcEndExcept
  144. status = NsiMapStatus(NsiStatus);
  145. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  146. break;
  147. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  148. }
  149. I_NsClientBindDone(&NsiClntBinding, BindId);
  150. return status;
  151. }
  152. RPC_STATUS RPC_ENTRY
  153. RpcNsGroupMbrInqBeginW(
  154. IN unsigned long GroupNameSyntax,
  155. IN unsigned short __RPC_FAR * GroupName,
  156. IN unsigned long MemberNameSyntax,
  157. OUT RPC_NS_HANDLE *InquiryContext
  158. )
  159. /*++
  160. Routine Description:
  161. Begin a inquiry to enumerate all the members in a group entry.
  162. Arguments:
  163. GroupNameSyntax - This value describes the type/format of the GroupName.
  164. GroupName - Name of the group that the member will be deleted from.
  165. MemberNameSyntax - This controls what format the name is returned in.
  166. InquiryContext - context handle for RpcNsGroupMbrInqNextW
  167. Returns:
  168. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_group_mbr_inq_begin()
  169. --*/
  170. {
  171. RPC_STATUS status;
  172. UNSIGNED16 NsiStatus;
  173. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  174. DWORD BindId = 0;
  175. *InquiryContext = 0;
  176. if (! GroupNameSyntax)
  177. GroupNameSyntax = DefaultSyntax;
  178. if (! MemberNameSyntax)
  179. MemberNameSyntax = DefaultSyntax;
  180. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  181. {
  182. RpcTryExcept
  183. {
  184. nsi_group_mbr_inq_begin(NsiClntBinding, GroupNameSyntax, GroupName,
  185. MemberNameSyntax, InquiryContext, &NsiStatus);
  186. }
  187. RpcExcept(1)
  188. {
  189. NsiStatus = MapException(RpcExceptionCode());
  190. }
  191. RpcEndExcept
  192. status = NsiMapStatus(NsiStatus);
  193. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  194. break;
  195. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  196. }
  197. I_NsClientBindDone(&NsiClntBinding, BindId);
  198. return status;
  199. }
  200. RPC_STATUS RPC_ENTRY
  201. RpcNsGroupMbrInqNextW(
  202. OUT RPC_NS_HANDLE InquiryContext,
  203. OUT unsigned short __RPC_FAR * __RPC_FAR * MemberName
  204. )
  205. /*++
  206. Routine Description:
  207. Get the next member in a group entry.
  208. Arguments:
  209. InquiryContext - context handle from RpcNsGroupMbrInqBeginW
  210. MemberName - pointer to return results.
  211. Returns:
  212. nsi_group_mbr_inq_next()
  213. --*/
  214. {
  215. UNSIGNED16 NsiStatus;
  216. *MemberName = 0;
  217. RpcTryExcept
  218. {
  219. nsi_group_mbr_inq_next(InquiryContext, MemberName, &NsiStatus);
  220. }
  221. RpcExcept(1)
  222. {
  223. NsiStatus = MapException(RpcExceptionCode());
  224. }
  225. RpcEndExcept
  226. return(NsiMapStatus(NsiStatus));
  227. }
  228. RPC_STATUS RPC_ENTRY
  229. RpcNsGroupMbrInqDone(
  230. OUT RPC_NS_HANDLE *InquiryContext
  231. )
  232. /*++
  233. Routine Description:
  234. Finish enumerating the members of a group.
  235. Arguments:
  236. InquiryContext - context handle from RpcNsGroupMbrInqBeginW
  237. Returns:
  238. nsi_group_mbr_inq_done()
  239. --*/
  240. {
  241. UNSIGNED16 NsiStatus;
  242. RpcTryExcept
  243. {
  244. nsi_group_mbr_inq_done(InquiryContext, &NsiStatus);
  245. }
  246. RpcExcept(1)
  247. {
  248. NsiStatus = MapException(RpcExceptionCode());
  249. }
  250. RpcEndExcept
  251. return(NsiMapStatus(NsiStatus));
  252. }
  253. RPC_STATUS RPC_ENTRY
  254. RpcNsEntryObjectInqBeginW(
  255. IN unsigned long EntryNameSyntax,
  256. IN unsigned short __RPC_FAR * EntryName,
  257. OUT RPC_NS_HANDLE *InquiryContext
  258. )
  259. /*++
  260. Routine Description:
  261. Begin a inquiry to enumerate all the UUID objects in a server entry.
  262. Arguments:
  263. EntryNameSyntax - This value describes the type/format of the EntryName.
  264. EntryName - Name of the server entry to inquiry.
  265. InquiryContext - context handle for RpcNsGroupMbrInqNextW
  266. Returns:
  267. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_entry_object_inq_begin()
  268. --*/
  269. {
  270. RPC_STATUS status;
  271. UNSIGNED16 NsiStatus;
  272. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  273. DWORD BindId = 0;
  274. *InquiryContext = 0;
  275. if (! EntryNameSyntax)
  276. EntryNameSyntax = DefaultSyntax;
  277. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  278. {
  279. RpcTryExcept
  280. {
  281. nsi_entry_object_inq_begin(NsiClntBinding, EntryNameSyntax, EntryName,
  282. InquiryContext, &NsiStatus);
  283. }
  284. RpcExcept(1)
  285. {
  286. NsiStatus = MapException(RpcExceptionCode());
  287. }
  288. RpcEndExcept
  289. status = NsiMapStatus(NsiStatus);
  290. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  291. break;
  292. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  293. }
  294. I_NsClientBindDone(&NsiClntBinding, BindId);
  295. return status;
  296. }
  297. RPC_STATUS RPC_ENTRY
  298. RpcNsEntryObjectInqNext(
  299. IN RPC_NS_HANDLE InquiryContext,
  300. OUT UUID __RPC_FAR * ObjUuid
  301. )
  302. /*++
  303. Routine Description:
  304. Gets the next object UUID in the server entry.
  305. Arguments:
  306. InquiryContext - context handle from RpcNsEntryObjectInqBeginW
  307. ObjUuid - pointer to memory to return results
  308. Returns:
  309. nsi_entry_object_inq_next()
  310. --*/
  311. {
  312. UNSIGNED16 NsiStatus;
  313. RpcTryExcept
  314. {
  315. nsi_entry_object_inq_next(InquiryContext, (NSI_UUID_T *) ObjUuid, &NsiStatus);
  316. }
  317. RpcExcept(1)
  318. {
  319. NsiStatus = MapException(RpcExceptionCode());
  320. }
  321. RpcEndExcept
  322. return(NsiMapStatus(NsiStatus));
  323. }
  324. RPC_STATUS RPC_ENTRY
  325. RpcNsEntryObjectInqDone(
  326. OUT RPC_NS_HANDLE *InquiryContext
  327. )
  328. /*++
  329. Routine Description:
  330. Finish enumerating the objects of a server entry.
  331. Arguments:
  332. InquiryContext - context handle from RpcNsEntryObjectInqBeginW
  333. Returns:
  334. nsi_entry_object_inq_done()
  335. --*/
  336. {
  337. UNSIGNED16 NsiStatus;
  338. RpcTryExcept
  339. {
  340. nsi_entry_object_inq_done(InquiryContext, &NsiStatus);
  341. }
  342. RpcExcept(1)
  343. {
  344. NsiStatus = MapException(RpcExceptionCode());
  345. }
  346. RpcEndExcept
  347. return(NsiMapStatus(NsiStatus));
  348. }
  349. RPC_STATUS RPC_ENTRY
  350. RpcNsMgmtInqExpAge(
  351. OUT unsigned long *ExpirationAge
  352. )
  353. /*++
  354. Routine Description:
  355. Get the global time that a cached entry remains valide.
  356. Arguments:
  357. ExpirationAge - place to expiration age in seconds
  358. Returns:
  359. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_inq_exp_age()
  360. --*/
  361. {
  362. RPC_STATUS status;
  363. UNSIGNED16 NsiStatus;
  364. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  365. DWORD BindId = 0;
  366. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  367. {
  368. RpcTryExcept
  369. {
  370. nsi_mgmt_inq_exp_age(NsiClntBinding, ExpirationAge, &NsiStatus);
  371. }
  372. RpcExcept(1)
  373. {
  374. NsiStatus = MapException(RpcExceptionCode());
  375. }
  376. RpcEndExcept
  377. status = NsiMapStatus(NsiStatus);
  378. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  379. break;
  380. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  381. }
  382. I_NsClientBindDone(&NsiClntBinding, BindId);
  383. return status;
  384. }
  385. RPC_STATUS RPC_ENTRY
  386. RpcNsMgmtSetExpAge(
  387. IN unsigned long ExpirationAge
  388. )
  389. /*++
  390. Routine Description:
  391. set the global time that a cached entry remains valide.
  392. Arguments:
  393. ExpirationAge - new expiration age in seconds
  394. Returns:
  395. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_set_exp_age()
  396. --*/
  397. {
  398. RPC_STATUS status;
  399. UNSIGNED16 NsiStatus;
  400. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  401. DWORD BindId = 0;
  402. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  403. {
  404. RpcTryExcept
  405. {
  406. nsi_mgmt_inq_set_age(NsiClntBinding, ExpirationAge, &NsiStatus);
  407. }
  408. RpcExcept(1)
  409. {
  410. NsiStatus = MapException(RpcExceptionCode());
  411. }
  412. RpcEndExcept
  413. status = NsiMapStatus(NsiStatus);
  414. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  415. break;
  416. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  417. }
  418. I_NsClientBindDone(&NsiClntBinding, BindId);
  419. return status;
  420. }
  421. RPC_STATUS RPC_ENTRY
  422. RpcNsEntryExpandNameW(
  423. IN unsigned long EntryNameSyntax,
  424. IN unsigned short __RPC_FAR * EntryName,
  425. OUT unsigned short __RPC_FAR * __RPC_FAR * ExpandedName
  426. )
  427. /*++
  428. Routine Description:
  429. Arguments:
  430. EntryNameSyntax - This value describes the type/format of the EntryName.
  431. EntryName - Name that will be expanded.
  432. ExpandedName - fully quailified global name.
  433. Returns:
  434. --*/
  435. {
  436. RPC_STATUS status;
  437. UNSIGNED16 NsiStatus;
  438. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  439. DWORD BindId = 0;
  440. if (! EntryNameSyntax)
  441. EntryNameSyntax = DefaultSyntax;
  442. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  443. {
  444. RpcTryExcept
  445. {
  446. nsi_entry_expand_name(NsiClntBinding, EntryNameSyntax, EntryName, ExpandedName,
  447. &NsiStatus);
  448. }
  449. RpcExcept(1)
  450. {
  451. NsiStatus = MapException(RpcExceptionCode());
  452. }
  453. RpcEndExcept
  454. status = NsiMapStatus(NsiStatus);
  455. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  456. break;
  457. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  458. }
  459. I_NsClientBindDone(&NsiClntBinding, BindId);
  460. return(status);
  461. }
  462. RPC_STATUS RPC_ENTRY
  463. RpcNsMgmtBindingUnexportW(
  464. IN unsigned long EntryNameSyntax,
  465. IN unsigned short * EntryName,
  466. IN RPC_IF_ID * IfId, OPTIONAL
  467. IN unsigned long VersOption, OPTIONAL
  468. IN UUID_VECTOR * ObjectUuidVec OPTIONAL
  469. )
  470. /*++
  471. Routine Description:
  472. Remove interfaces and or objects from an server entry.
  473. Arguments:
  474. EntryNameSyntax - This value describes the type/format of the EntryName.
  475. EntryName - The server name that will be unexported.
  476. IfId - The interface to unexport, NIL means objects only.
  477. VersOption - constrains which interfaces to remove
  478. ObjectUuidVec - list of objects to remove in combination with interface.
  479. Returns:
  480. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_binding_unexport()
  481. --*/
  482. {
  483. RPC_STATUS status;
  484. UNSIGNED16 NsiStatus;
  485. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  486. DWORD BindId = 0;
  487. if (! EntryNameSyntax)
  488. EntryNameSyntax = DefaultSyntax;
  489. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  490. {
  491. RpcTryExcept
  492. {
  493. nsi_mgmt_binding_unexport(NsiClntBinding, EntryNameSyntax, EntryName,
  494. (NSI_IF_ID_P_T) IfId, VersOption,
  495. (NSI_UUID_VECTOR_T *)ObjectUuidVec, &NsiStatus);
  496. }
  497. RpcExcept(1)
  498. {
  499. NsiStatus = MapException(RpcExceptionCode());
  500. }
  501. RpcEndExcept
  502. status = NsiMapStatus(NsiStatus);
  503. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  504. break;
  505. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  506. }
  507. I_NsClientBindDone(&NsiClntBinding, BindId);
  508. return(status);
  509. }
  510. RPC_STATUS RPC_ENTRY
  511. RpcNsMgmtEntryCreateW(
  512. IN unsigned long EntryNameSyntax,
  513. IN unsigned short * EntryName
  514. )
  515. /*++
  516. Routine Description:
  517. Create an entry name that is empty. It has no type and becomes a
  518. type according to the first add API aplied (profile, groupd, server).
  519. Arguments:
  520. EntryNameSyntax - This value describes the type/format of the EntryName.
  521. EntryName - Name of the new entry.
  522. Returns:
  523. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_entry_Create()
  524. --*/
  525. {
  526. RPC_STATUS status;
  527. UNSIGNED16 NsiStatus;
  528. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  529. DWORD BindId = 0;
  530. if (! EntryNameSyntax)
  531. EntryNameSyntax = DefaultSyntax;
  532. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  533. {
  534. RpcTryExcept
  535. {
  536. nsi_mgmt_entry_create(NsiClntBinding, EntryNameSyntax, EntryName, &NsiStatus);
  537. }
  538. RpcExcept(1)
  539. {
  540. NsiStatus = MapException(RpcExceptionCode());
  541. }
  542. RpcEndExcept
  543. status = NsiMapStatus(NsiStatus);
  544. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  545. break;
  546. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  547. }
  548. I_NsClientBindDone(&NsiClntBinding, BindId);
  549. return(status);
  550. }
  551. RPC_STATUS RPC_ENTRY
  552. RpcNsMgmtEntryDeleteW(
  553. IN unsigned long EntryNameSyntax,
  554. IN unsigned short * EntryName
  555. )
  556. /*++
  557. Routine Description:
  558. Remove an entry name (server, group or profile).
  559. Arguments:
  560. EntryNameSyntax - This value describes the type/format of the EntryName.
  561. EntryName - Name that this export will be stored in. This is just a
  562. token that is passed on the the Name Server.
  563. Returns:
  564. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_entry_delete()
  565. --*/
  566. {
  567. RPC_STATUS status;
  568. UNSIGNED16 NsiStatus;
  569. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  570. DWORD BindId = 0;
  571. if (! EntryNameSyntax)
  572. EntryNameSyntax = DefaultSyntax;
  573. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  574. {
  575. RpcTryExcept
  576. {
  577. nsi_mgmt_entry_delete(NsiClntBinding, EntryNameSyntax, EntryName, &NsiStatus);
  578. }
  579. RpcExcept(1)
  580. {
  581. NsiStatus = MapException(RpcExceptionCode());
  582. }
  583. RpcEndExcept
  584. status = NsiMapStatus(NsiStatus);
  585. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  586. break;
  587. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  588. }
  589. I_NsClientBindDone(&NsiClntBinding, BindId);
  590. return(status);
  591. }
  592. RPC_STATUS RPC_ENTRY
  593. RpcNsMgmtEntryInqIfIdsW(
  594. IN unsigned long EntryNameSyntax,
  595. IN unsigned short * EntryName,
  596. OUT RPC_IF_ID_VECTOR ** IfIdVec
  597. )
  598. /*++
  599. Routine Description:
  600. Get all the interface identifiers in a server entry.
  601. Arguments:
  602. EntryNameSyntax - This value describes the type/format of the EntryName.
  603. EntryName - Name that this export will be stored in. This is just a
  604. token that is passed on the the Name Server.
  605. IfIdVec - pointer to return results in
  606. Returns:
  607. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_entry_inq_ifids()
  608. --*/
  609. {
  610. RPC_STATUS status;
  611. UNSIGNED16 NsiStatus;
  612. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  613. DWORD BindId = 0;
  614. if (! EntryNameSyntax)
  615. EntryNameSyntax = DefaultSyntax;
  616. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  617. {
  618. *IfIdVec = 0;
  619. RpcTryExcept
  620. {
  621. nsi_mgmt_entry_inq_if_ids(NsiClntBinding, EntryNameSyntax, EntryName,
  622. (NSI_IF_ID_VECTOR_T **) IfIdVec, &NsiStatus);
  623. }
  624. RpcExcept(1)
  625. {
  626. NsiStatus = MapException(RpcExceptionCode());
  627. }
  628. RpcEndExcept
  629. status = NsiMapStatus(NsiStatus);
  630. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  631. break;
  632. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  633. }
  634. I_NsClientBindDone(&NsiClntBinding, BindId);
  635. return(status);
  636. }
  637. RPC_STATUS RPC_ENTRY
  638. RpcNsProfileDeleteW(
  639. IN unsigned long ProfileNameSyntax,
  640. IN unsigned short __RPC_FAR * ProfileName
  641. )
  642. /*++
  643. Routine Description:
  644. Remove a profile entry and all its member items.
  645. Arguments:
  646. profileNameSyntax - This value describes the type/format of the profile ame.
  647. profileName - Name that will be deleted.
  648. Returns:
  649. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_profile_delete()
  650. --*/
  651. {
  652. RPC_STATUS status;
  653. UNSIGNED16 NsiStatus;
  654. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  655. DWORD BindId = 0;
  656. if (! ProfileNameSyntax)
  657. ProfileNameSyntax = DefaultSyntax;
  658. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  659. {
  660. RpcTryExcept
  661. {
  662. nsi_profile_delete(NsiClntBinding, ProfileNameSyntax, ProfileName, &NsiStatus);
  663. }
  664. RpcExcept(1)
  665. {
  666. NsiStatus = MapException(RpcExceptionCode());
  667. }
  668. RpcEndExcept
  669. status = NsiMapStatus(NsiStatus);
  670. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  671. break;
  672. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  673. }
  674. I_NsClientBindDone(&NsiClntBinding, BindId);
  675. return(status);
  676. }
  677. RPC_STATUS RPC_ENTRY
  678. RpcNsProfileEltAddW(
  679. IN unsigned long ProfileNameSyntax,
  680. IN unsigned short __RPC_FAR * ProfileName,
  681. IN RPC_IF_ID * IfId,
  682. IN unsigned long MemberNameSyntax,
  683. IN unsigned short __RPC_FAR * MemberName,
  684. IN unsigned long Priority,
  685. IN unsigned short __RPC_FAR * Annotation
  686. )
  687. /*++
  688. Routine Description:
  689. Add elements to the profile entry
  690. Arguments:
  691. ProfileNameSyntax - This value describes the type/format of the ProfileName.
  692. ProfileName - The server name that will be unexported.
  693. IfId - The interface to unexport, NIL means objects only.
  694. MemberNameSyntax - This value describes the type/format of the MemberName.
  695. MemberName - The server name that will be unexported.
  696. Priority - Place to insert member in profile
  697. Annotation - comment for member
  698. Returns:
  699. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_profile_elt_add()
  700. --*/
  701. {
  702. RPC_STATUS status;
  703. UNSIGNED16 NsiStatus;
  704. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  705. DWORD BindId = 0;
  706. if (! ProfileNameSyntax)
  707. ProfileNameSyntax = DefaultSyntax;
  708. if (! MemberNameSyntax)
  709. MemberNameSyntax = DefaultSyntax;
  710. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  711. {
  712. RpcTryExcept
  713. {
  714. nsi_profile_elt_add(NsiClntBinding, ProfileNameSyntax, ProfileName,
  715. (NSI_IF_ID_P_T) IfId,
  716. MemberNameSyntax, MemberName, Priority, Annotation, &NsiStatus);
  717. }
  718. RpcExcept(1)
  719. {
  720. NsiStatus = MapException(RpcExceptionCode());
  721. }
  722. RpcEndExcept
  723. status = NsiMapStatus(NsiStatus);
  724. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  725. break;
  726. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  727. }
  728. I_NsClientBindDone(&NsiClntBinding, BindId);
  729. return(status);
  730. }
  731. RPC_STATUS RPC_ENTRY
  732. RpcNsProfileEltRemoveW(
  733. IN unsigned long ProfileNameSyntax,
  734. IN unsigned short __RPC_FAR * ProfileName,
  735. IN RPC_IF_ID * IfId,
  736. IN unsigned long MemberNameSyntax,
  737. IN unsigned short __RPC_FAR * MemberName
  738. )
  739. /*++
  740. Routine Description:
  741. Remove an element from a profile entry.
  742. Arguments:
  743. ProfileNameSyntax - This value describes the type/format of the ProfileName.
  744. ProfileName - The server name that will be unexported.
  745. IfId - The interface to unexport, NIL means objects only.
  746. MemberNameSyntax - This value describes the type/format of the MemberName.
  747. MemberName - The server name that will be unexported.
  748. Returns:
  749. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_mgmt_binding_unexport()
  750. --*/
  751. {
  752. RPC_STATUS status;
  753. UNSIGNED16 NsiStatus;
  754. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  755. DWORD BindId = 0;
  756. if (! ProfileNameSyntax)
  757. ProfileNameSyntax = DefaultSyntax;
  758. if (! MemberNameSyntax)
  759. MemberNameSyntax = DefaultSyntax;
  760. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  761. {
  762. RpcTryExcept
  763. {
  764. nsi_profile_elt_remove(NsiClntBinding, ProfileNameSyntax, ProfileName,
  765. (NSI_IF_ID_P_T) IfId, MemberNameSyntax, MemberName, &NsiStatus);
  766. }
  767. RpcExcept(1)
  768. {
  769. NsiStatus = MapException(RpcExceptionCode());
  770. }
  771. RpcEndExcept
  772. status = NsiMapStatus(NsiStatus);
  773. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  774. break;
  775. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  776. }
  777. I_NsClientBindDone(&NsiClntBinding, BindId);
  778. return(status);
  779. }
  780. RPC_STATUS RPC_ENTRY
  781. RpcNsProfileEltInqBeginW(
  782. IN unsigned long ProfileNameSyntax,
  783. IN unsigned short __RPC_FAR * ProfileName,
  784. IN unsigned long InquiryType,
  785. IN RPC_IF_ID * IfId,
  786. IN unsigned long VersOption,
  787. IN unsigned long MemberNameSyntax,
  788. IN unsigned short __RPC_FAR * MemberName,
  789. OUT RPC_NS_HANDLE *InquiryContext
  790. )
  791. /*++
  792. Routine Description:
  793. Remove an element from a profile entry.
  794. Arguments:
  795. ProfileNameSyntax - This value describes the type/format of the ProfileName.
  796. ProfileName - The server name that will be unexported.
  797. InquiryType - Type of inquiry, one of RpcCProfile* constants
  798. IfId - The interface to unexport, NIL means objects only.
  799. VersOption - Version options, one of RpcCVers* constants
  800. MemberNameSyntax - This value describes the type/format of the MemberName.
  801. MemberName - The server name that will be unexported.
  802. InquiryContext - context handle for use wiht RpcNsProfileEltInqNextW
  803. Returns:
  804. NSI_S_NAME_SERVICE_UNAVAILABLE, nsi_profile_elt_inq_begin()
  805. --*/
  806. {
  807. RPC_STATUS status;
  808. UNSIGNED16 NsiStatus;
  809. RPC_BINDING_HANDLE NsiClntBinding = NULL;
  810. DWORD BindId = 0;
  811. if (InquiryContext)
  812. *InquiryContext = NULL;
  813. if (! ProfileNameSyntax)
  814. ProfileNameSyntax = DefaultSyntax;
  815. if (! MemberNameSyntax)
  816. MemberNameSyntax = DefaultSyntax;
  817. while ((status = I_NsClientBindSearch(&NsiClntBinding, &BindId)) == RPC_S_OK)
  818. {
  819. RpcTryExcept
  820. {
  821. nsi_profile_elt_inq_begin(NsiClntBinding, ProfileNameSyntax, ProfileName, InquiryType,
  822. (NSI_IF_ID_P_T) IfId, VersOption,
  823. MemberNameSyntax, MemberName, InquiryContext, &NsiStatus);
  824. }
  825. RpcExcept(1)
  826. {
  827. NsiStatus = MapException(RpcExceptionCode());
  828. }
  829. RpcEndExcept
  830. status = NsiMapStatus(NsiStatus);
  831. if (NsiStatus != NSI_S_NAME_SERVICE_UNAVAILABLE)
  832. break;
  833. I_NsBindingFoundBogus(&NsiClntBinding, BindId);
  834. }
  835. I_NsClientBindDone(&NsiClntBinding, BindId);
  836. return(status);
  837. }
  838. RPC_STATUS RPC_ENTRY
  839. RpcNsProfileEltInqNextW(
  840. IN RPC_NS_HANDLE InquiryContext,
  841. OUT RPC_IF_ID * IfId,
  842. OUT unsigned short __RPC_FAR * __RPC_FAR * MemberName,
  843. OUT unsigned long __RPC_FAR * Priority,
  844. OUT unsigned short __RPC_FAR * __RPC_FAR * Annotation
  845. )
  846. /*++
  847. Routine Description:
  848. Gets the next element in the profile entry.
  849. Arguments:
  850. InquiryContext - context handle from RpcNsEntryObjectInqBeginW
  851. MemberName - place to put profile element name
  852. IfId - place to return interface
  853. Priority - place to put profile element priority
  854. Annotation - place to put profile element comment
  855. Returns:
  856. nsi_profile_elt_inq_next()
  857. --*/
  858. {
  859. unsigned short * pAnnotation;
  860. unsigned short * pMemberName;
  861. unsigned short ** ppAnnotation;
  862. unsigned short ** ppMemberName;
  863. UNSIGNED16 NsiStatus;
  864. if (Annotation)
  865. ppAnnotation = Annotation;
  866. else
  867. ppAnnotation = &pAnnotation;
  868. *ppAnnotation = NULL;
  869. if (MemberName)
  870. ppMemberName = MemberName;
  871. else
  872. ppMemberName = &pMemberName;
  873. *ppMemberName = NULL;
  874. RpcTryExcept
  875. {
  876. nsi_profile_elt_inq_next(InquiryContext, (NSI_IF_ID_P_T) IfId,
  877. ppMemberName, Priority, ppAnnotation, &NsiStatus);
  878. }
  879. RpcExcept(1)
  880. {
  881. NsiStatus = MapException(RpcExceptionCode());
  882. }
  883. RpcEndExcept
  884. if (!Annotation)
  885. RpcStringFreeW(ppAnnotation);
  886. if (!MemberName)
  887. RpcStringFreeW(ppMemberName);
  888. return(NsiMapStatus(NsiStatus));
  889. }
  890. RPC_STATUS RPC_ENTRY
  891. RpcNsProfileEltInqDone(
  892. OUT RPC_NS_HANDLE *InquiryContext
  893. )
  894. /*++
  895. Routine Description:
  896. Finish enumerating the objects of a profile entry.
  897. Arguments:
  898. InquiryContext - context handle from RpcNsProfileEltInqBeginW
  899. Returns:
  900. nsi_profile_elt_inq_done()
  901. --*/
  902. {
  903. UNSIGNED16 NsiStatus;
  904. RpcTryExcept
  905. {
  906. nsi_profile_elt_inq_done(InquiryContext, &NsiStatus);
  907. }
  908. RpcExcept(1)
  909. {
  910. NsiStatus = MapException(RpcExceptionCode());
  911. }
  912. RpcEndExcept
  913. return(NsiMapStatus(NsiStatus));
  914. }
  915. // The following are ASCII wrappers to the UNICODE API's
  916. RPC_STATUS RPC_ENTRY
  917. RpcNsGroupDeleteA(
  918. IN unsigned long GroupNameSyntax,
  919. IN unsigned char __RPC_FAR * GroupName
  920. )
  921. /*++
  922. Routine Description:
  923. This is an ASCII wrapper to the UNICODE version of the API. It
  924. converts all char * -> short * strings and calls the UNICODE version.
  925. --*/
  926. {
  927. WIDE_STRING GroupNameW(GroupName);
  928. if (GroupNameW.OutOfMemory())
  929. return(RPC_S_OUT_OF_MEMORY);
  930. return(RpcNsGroupDeleteW(GroupNameSyntax, &GroupNameW));
  931. }
  932. RPC_STATUS RPC_ENTRY
  933. RpcNsGroupMbrAddA(
  934. IN unsigned long GroupNameSyntax,
  935. IN unsigned char __RPC_FAR * GroupName,
  936. IN unsigned long MemberNameSyntax,
  937. IN unsigned char __RPC_FAR * MemberName
  938. )
  939. /*++
  940. Routine Description:
  941. This is an ASCII wrapper to the UNICODE version of the API. It
  942. converts all char * -> short * strings and calls the UNICODE version.
  943. --*/
  944. {
  945. WIDE_STRING GroupNameW(GroupName);
  946. WIDE_STRING MemberNameW(MemberName);
  947. if (GroupNameW.OutOfMemory())
  948. return(RPC_S_OUT_OF_MEMORY);
  949. if (MemberNameW.OutOfMemory())
  950. return(RPC_S_OUT_OF_MEMORY);
  951. return(RpcNsGroupMbrAddW(GroupNameSyntax, &GroupNameW,
  952. MemberNameSyntax, &MemberNameW));
  953. }
  954. RPC_STATUS RPC_ENTRY
  955. RpcNsGroupMbrRemoveA(
  956. IN unsigned long GroupNameSyntax,
  957. IN unsigned char __RPC_FAR * GroupName,
  958. IN unsigned long MemberNameSyntax,
  959. IN unsigned char __RPC_FAR * MemberName
  960. )
  961. /*++
  962. Routine Description:
  963. This is an ASCII wrapper to the UNICODE version of the API. It
  964. converts all char * -> short * strings and calls the UNICODE version.
  965. --*/
  966. {
  967. WIDE_STRING GroupNameW(GroupName);
  968. WIDE_STRING MemberNameW(MemberName);
  969. if (GroupNameW.OutOfMemory())
  970. return(RPC_S_OUT_OF_MEMORY);
  971. if (MemberNameW.OutOfMemory())
  972. return(RPC_S_OUT_OF_MEMORY);
  973. return(RpcNsGroupMbrRemoveW(GroupNameSyntax, &GroupNameW,
  974. MemberNameSyntax, &MemberNameW));
  975. }
  976. RPC_STATUS RPC_ENTRY
  977. RpcNsGroupMbrInqBeginA(
  978. IN unsigned long GroupNameSyntax,
  979. IN unsigned char __RPC_FAR * GroupName,
  980. IN unsigned long MemberNameSyntax,
  981. OUT RPC_NS_HANDLE *InquiryContext
  982. )
  983. /*++
  984. Routine Description:
  985. This is an ASCII wrapper to the UNICODE version of the API. It
  986. converts all char * -> short * strings and calls the UNICODE version.
  987. --*/
  988. {
  989. WIDE_STRING GroupNameW(GroupName);
  990. if (GroupNameW.OutOfMemory())
  991. return(RPC_S_OUT_OF_MEMORY);
  992. return(RpcNsGroupMbrInqBeginW(GroupNameSyntax, &GroupNameW,
  993. MemberNameSyntax, InquiryContext));
  994. }
  995. RPC_STATUS RPC_ENTRY
  996. RpcNsGroupMbrInqNextA(
  997. OUT RPC_NS_HANDLE InquiryContext,
  998. OUT unsigned char __RPC_FAR * __RPC_FAR * MemberName
  999. )
  1000. /*++
  1001. Routine Description:
  1002. This is an ASCII wrapper to the UNICODE version of the API. It
  1003. converts all char * -> short * strings and calls the UNICODE version.
  1004. --*/
  1005. {
  1006. RPC_STATUS Status;
  1007. Status = RpcNsGroupMbrInqNextW(InquiryContext,
  1008. (unsigned short __RPC_FAR * __RPC_FAR *) MemberName);
  1009. if (Status)
  1010. return(Status);
  1011. return(UnicodeToAscii((unsigned short *) *MemberName));
  1012. }
  1013. RPC_STATUS RPC_ENTRY
  1014. RpcNsEntryObjectInqBeginA(
  1015. IN unsigned long EntryNameSyntax,
  1016. IN unsigned char __RPC_FAR * EntryName,
  1017. OUT RPC_NS_HANDLE *InquiryContext
  1018. )
  1019. /*++
  1020. Routine Description:
  1021. This is an ASCII wrapper to the UNICODE version of the API. It
  1022. converts all char * -> short * strings and calls the UNICODE version.
  1023. --*/
  1024. {
  1025. WIDE_STRING EntryNameW(EntryName);
  1026. if (EntryNameW.OutOfMemory())
  1027. return(RPC_S_OUT_OF_MEMORY);
  1028. return(RpcNsEntryObjectInqBeginW(EntryNameSyntax, &EntryNameW,
  1029. InquiryContext));
  1030. }
  1031. RPC_STATUS RPC_ENTRY
  1032. RpcNsEntryExpandNameA(
  1033. IN unsigned long EntryNameSyntax,
  1034. IN unsigned char __RPC_FAR * EntryName,
  1035. OUT unsigned char __RPC_FAR * __RPC_FAR * ExpandedName
  1036. )
  1037. /*++
  1038. Routine Description:
  1039. This is an ASCII wrapper to the UNICODE version of the API. It
  1040. converts all char * -> short * strings and calls the UNICODE version.
  1041. --*/
  1042. {
  1043. RPC_STATUS Status;
  1044. WIDE_STRING EntryNameW(EntryName);
  1045. if (EntryNameW.OutOfMemory())
  1046. return(RPC_S_OUT_OF_MEMORY);
  1047. Status = RpcNsEntryExpandNameW(EntryNameSyntax, &EntryNameW,
  1048. (unsigned short __RPC_FAR * __RPC_FAR *) ExpandedName);
  1049. if (Status)
  1050. return(Status);
  1051. return(UnicodeToAscii((unsigned short *) *ExpandedName));
  1052. }
  1053. RPC_STATUS RPC_ENTRY
  1054. RpcNsMgmtBindingUnexportA(
  1055. IN unsigned long EntryNameSyntax,
  1056. IN unsigned char * EntryName,
  1057. IN RPC_IF_ID * IfId,
  1058. IN unsigned long VersOption,
  1059. IN UUID_VECTOR * ObjectUuidVec OPTIONAL
  1060. )
  1061. /*++
  1062. Routine Description:
  1063. This is an ASCII wrapper to the UNICODE version of the API. It
  1064. converts all char * -> short * strings and calls the UNICODE version.
  1065. --*/
  1066. {
  1067. WIDE_STRING EntryNameW(EntryName);
  1068. if (EntryNameW.OutOfMemory())
  1069. return(RPC_S_OUT_OF_MEMORY);
  1070. return(RpcNsMgmtBindingUnexportW(EntryNameSyntax, &EntryNameW,
  1071. IfId, VersOption, ObjectUuidVec));
  1072. }
  1073. RPC_STATUS RPC_ENTRY
  1074. RpcNsMgmtEntryCreateA(
  1075. IN unsigned long EntryNameSyntax,
  1076. IN unsigned char * EntryName
  1077. )
  1078. /*++
  1079. Routine Description:
  1080. This is an ASCII wrapper to the UNICODE version of the API. It
  1081. converts all char * -> short * strings and calls the UNICODE version.
  1082. --*/
  1083. {
  1084. WIDE_STRING EntryNameW(EntryName);
  1085. if (EntryNameW.OutOfMemory())
  1086. return(RPC_S_OUT_OF_MEMORY);
  1087. return(RpcNsMgmtEntryCreateW(EntryNameSyntax, &EntryNameW));
  1088. }
  1089. RPC_STATUS RPC_ENTRY
  1090. RpcNsMgmtEntryDeleteA(
  1091. IN unsigned long EntryNameSyntax,
  1092. IN unsigned char * EntryName
  1093. )
  1094. /*++
  1095. Routine Description:
  1096. This is an ASCII wrapper to the UNICODE version of the API. It
  1097. converts all char * -> short * strings and calls the UNICODE version.
  1098. --*/
  1099. {
  1100. WIDE_STRING EntryNameW(EntryName);
  1101. if (EntryNameW.OutOfMemory())
  1102. return(RPC_S_OUT_OF_MEMORY);
  1103. return(RpcNsMgmtEntryDeleteW(EntryNameSyntax, &EntryNameW));
  1104. }
  1105. RPC_STATUS RPC_ENTRY
  1106. RpcNsMgmtEntryInqIfIdsA(
  1107. IN unsigned long EntryNameSyntax,
  1108. IN unsigned char * EntryName,
  1109. OUT RPC_IF_ID_VECTOR ** IfIdVec
  1110. )
  1111. /*++
  1112. Routine Description:
  1113. This is an ASCII wrapper to the UNICODE version of the API. It
  1114. converts all char * -> short * strings and calls the UNICODE version.
  1115. --*/
  1116. {
  1117. WIDE_STRING EntryNameW(EntryName);
  1118. if (EntryNameW.OutOfMemory())
  1119. return(RPC_S_OUT_OF_MEMORY);
  1120. return(RpcNsMgmtEntryInqIfIdsW(EntryNameSyntax, &EntryNameW,
  1121. IfIdVec));
  1122. }
  1123. RPC_STATUS RPC_ENTRY
  1124. RpcNsProfileDeleteA(
  1125. IN unsigned long ProfileNameSyntax,
  1126. IN unsigned char __RPC_FAR * ProfileName
  1127. )
  1128. /*++
  1129. Routine Description:
  1130. This is an ASCII wrapper to the UNICODE version of the API. It
  1131. converts all char * -> short * strings and calls the UNICODE version.
  1132. --*/
  1133. {
  1134. WIDE_STRING ProfileNameW(ProfileName);
  1135. if (ProfileNameW.OutOfMemory())
  1136. return(RPC_S_OUT_OF_MEMORY);
  1137. return(RpcNsProfileDeleteW(ProfileNameSyntax, &ProfileNameW));
  1138. }
  1139. RPC_STATUS RPC_ENTRY
  1140. RpcNsProfileEltAddA(
  1141. IN unsigned long ProfileNameSyntax,
  1142. IN unsigned char __RPC_FAR * ProfileName,
  1143. IN RPC_IF_ID * IfId,
  1144. IN unsigned long MemberNameSyntax,
  1145. IN unsigned char __RPC_FAR * MemberName,
  1146. IN unsigned long Priority,
  1147. IN unsigned char __RPC_FAR * Annotation
  1148. )
  1149. /*++
  1150. Routine Description:
  1151. This is an ASCII wrapper to the UNICODE version of the API. It
  1152. converts all char * -> short * strings and calls the UNICODE version.
  1153. --*/
  1154. {
  1155. WIDE_STRING ProfileNameW(ProfileName);
  1156. WIDE_STRING MemberNameW(MemberName);
  1157. WIDE_STRING AnnotationW(Annotation);
  1158. if (ProfileNameW.OutOfMemory())
  1159. return(RPC_S_OUT_OF_MEMORY);
  1160. if (MemberNameW.OutOfMemory())
  1161. return(RPC_S_OUT_OF_MEMORY);
  1162. if (AnnotationW.OutOfMemory())
  1163. return(RPC_S_OUT_OF_MEMORY);
  1164. return(RpcNsProfileEltAddW(ProfileNameSyntax, &ProfileNameW,
  1165. IfId, MemberNameSyntax, &MemberNameW, Priority, &AnnotationW));
  1166. }
  1167. RPC_STATUS RPC_ENTRY
  1168. RpcNsProfileEltRemoveA(
  1169. IN unsigned long ProfileNameSyntax,
  1170. IN unsigned char __RPC_FAR * ProfileName,
  1171. IN RPC_IF_ID * IfId,
  1172. IN unsigned long MemberNameSyntax,
  1173. IN unsigned char __RPC_FAR * MemberName
  1174. )
  1175. /*++
  1176. Routine Description:
  1177. This is an ASCII wrapper to the UNICODE version of the API. It
  1178. converts all char * -> short * strings and calls the UNICODE version.
  1179. --*/
  1180. {
  1181. WIDE_STRING ProfileNameW(ProfileName);
  1182. WIDE_STRING MemberNameW(MemberName);
  1183. if (ProfileNameW.OutOfMemory())
  1184. return(RPC_S_OUT_OF_MEMORY);
  1185. if (MemberNameW.OutOfMemory())
  1186. return(RPC_S_OUT_OF_MEMORY);
  1187. return(RpcNsProfileEltRemoveW(ProfileNameSyntax, &ProfileNameW,
  1188. IfId, MemberNameSyntax, &MemberNameW));
  1189. }
  1190. RPC_STATUS RPC_ENTRY
  1191. RpcNsProfileEltInqBeginA(
  1192. IN unsigned long ProfileNameSyntax,
  1193. IN unsigned char __RPC_FAR * ProfileName,
  1194. IN unsigned long InquiryType,
  1195. IN RPC_IF_ID * IfId,
  1196. IN unsigned long VersOption,
  1197. IN unsigned long MemberNameSyntax,
  1198. IN unsigned char __RPC_FAR * MemberName,
  1199. OUT RPC_NS_HANDLE *InquiryContext
  1200. )
  1201. /*++
  1202. Routine Description:
  1203. This is an ASCII wrapper to the UNICODE version of the API. It
  1204. converts all char * -> short * strings and calls the UNICODE version.
  1205. --*/
  1206. {
  1207. WIDE_STRING ProfileNameW(ProfileName);
  1208. WIDE_STRING MemberNameW(MemberName);
  1209. if (ProfileNameW.OutOfMemory())
  1210. return(RPC_S_OUT_OF_MEMORY);
  1211. if (MemberNameW.OutOfMemory())
  1212. return(RPC_S_OUT_OF_MEMORY);
  1213. return(RpcNsProfileEltInqBeginW(ProfileNameSyntax, &ProfileNameW,
  1214. InquiryType, IfId, VersOption, MemberNameSyntax, &MemberNameW,
  1215. InquiryContext));
  1216. }
  1217. RPC_STATUS RPC_ENTRY
  1218. RpcNsProfileEltInqNextA(
  1219. IN RPC_NS_HANDLE InquiryContext,
  1220. OUT RPC_IF_ID * IfId,
  1221. OUT unsigned char __RPC_FAR * __RPC_FAR * MemberName,
  1222. OUT unsigned long __RPC_FAR * Priority,
  1223. OUT unsigned char __RPC_FAR * __RPC_FAR * Annotation
  1224. )
  1225. /*++
  1226. Routine Description:
  1227. This is an ASCII wrapper to the UNICODE version of the API. It
  1228. converts all char * -> short * strings and calls the UNICODE version.
  1229. --*/
  1230. {
  1231. RPC_STATUS Status;
  1232. Status = RpcNsProfileEltInqNextW(InquiryContext, IfId,
  1233. (unsigned short __RPC_FAR * __RPC_FAR *) MemberName, Priority,
  1234. (unsigned short __RPC_FAR * __RPC_FAR *) Annotation);
  1235. if (Status)
  1236. return(Status);
  1237. if (Status = UnicodeToAscii((unsigned short *) *MemberName))
  1238. return(Status);
  1239. if (Annotation)
  1240. return(UnicodeToAscii((unsigned short *) *Annotation));
  1241. return Status;
  1242. }