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.

392 lines
11 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. rxcanon.c
  5. Abstract:
  6. Functions which remote canonicalization routines to down-level servers
  7. RxNetpPathType
  8. RxNetpPathCanonicalize
  9. RxNetpPathCompare
  10. RxNetpNameValidate
  11. RxNetpNameCanonicalize
  12. RxNetpNameCompare
  13. RxNetpListCanonicalize
  14. Author:
  15. Richard L Firth (rfirth) 22-Jan-1992
  16. Revision History:
  17. --*/
  18. #include "downlevl.h"
  19. #include <rxcanon.h>
  20. NET_API_STATUS
  21. RxNetpPathType(
  22. IN LPTSTR ServerName,
  23. IN LPTSTR PathName,
  24. OUT LPDWORD PathType,
  25. IN DWORD Flags
  26. )
  27. /*++
  28. Routine Description:
  29. Runs I_NetPathType on a down-level server
  30. Arguments:
  31. ServerName - down-level server where this routine is run
  32. PathName - path to get type of
  33. PathType - where path type returned
  34. Flags - flags controlling server-side routine
  35. Return Value:
  36. NET_API_STATUS
  37. Success - NERR_Success
  38. Failure -
  39. --*/
  40. {
  41. return RxRemoteApi(
  42. API_WI_NetPathType, // API #
  43. ServerName, // where we're gonna do it
  44. REMSmb_I_NetPathType_P, // parameter descriptor
  45. NULL, // data descriptor 16-bit
  46. NULL, // data descriptor 32-bit
  47. NULL, // data descriptor SMB
  48. NULL, // aux data descriptor 16-bit
  49. NULL, // aux data descriptor 32-bit
  50. NULL, // aux data descriptor SMB
  51. FALSE, // can use NULL session
  52. PathName, // args to remote routine
  53. PathType, // "
  54. Flags // "
  55. );
  56. }
  57. NET_API_STATUS
  58. RxNetpPathCanonicalize(
  59. IN LPTSTR ServerName,
  60. IN LPTSTR PathName,
  61. IN LPTSTR Outbuf,
  62. IN DWORD OutbufLen,
  63. IN LPTSTR Prefix OPTIONAL,
  64. IN OUT LPDWORD PathType,
  65. IN DWORD Flags
  66. )
  67. /*++
  68. Routine Description:
  69. Runs I_NetPathCanonicalize on a down-level server
  70. Arguments:
  71. ServerName - down-level server where this routine is run
  72. PathName - path to canonicalize
  73. Outbuf - buffer where results are returned
  74. OutbufLen - size of buffer
  75. Prefix - optional prefix string
  76. PathType - type of path
  77. Flags - flags controlling server-side routine
  78. Return Value:
  79. NET_API_STATUS
  80. Success - NERR_Success
  81. Failure -
  82. --*/
  83. {
  84. return RxRemoteApi(
  85. API_WI_NetPathCanonicalize, // API #
  86. ServerName, // where we're gonna do it
  87. REMSmb_I_NetPathCanonicalize_P, // parameter descriptor
  88. NULL, // data descriptor 16-bit
  89. NULL, // data descriptor 32-bit
  90. NULL, // data descriptor SMB
  91. NULL, // aux data descriptor 16-bit
  92. NULL, // aux data descriptor 32-bit
  93. NULL, // aux data descriptor SMB
  94. FALSE, // can use NULL session
  95. PathName, // args to remote routine
  96. Outbuf, // "
  97. OutbufLen, // "
  98. Prefix, // "
  99. PathType, // "
  100. *PathType, // "
  101. Flags // "
  102. );
  103. }
  104. LONG
  105. RxNetpPathCompare(
  106. IN LPTSTR ServerName,
  107. IN LPTSTR PathName1,
  108. IN LPTSTR PathName2,
  109. IN DWORD PathType,
  110. IN DWORD Flags
  111. )
  112. /*++
  113. Routine Description:
  114. Runs I_NetPathCompare on a down-level server
  115. Arguments:
  116. ServerName - down-level server where this routine is run
  117. PathName1 - path to compare
  118. PathName2 - path to compare
  119. PathType - type of paths
  120. Flags - flags controlling server-side routine
  121. Return Value:
  122. LONG
  123. <0 - PathName1 < PathName2
  124. 0 - PathName1 = PathName2
  125. >0 - PathName1 > PathName2
  126. --*/
  127. {
  128. return (LONG)RxRemoteApi(
  129. API_WI_NetPathCompare, // API #
  130. ServerName, // where we're gonna do it
  131. REMSmb_I_NetPathCompare_P, // parameter descriptor
  132. NULL, // data descriptor 16-bit
  133. NULL, // data descriptor 32-bit
  134. NULL, // data descriptor SMB
  135. NULL, // aux data descriptor 16-bit
  136. NULL, // aux data descriptor 32-bit
  137. NULL, // aux data descriptor SMB
  138. FALSE, // can use NULL session
  139. PathName1, // args to remote routine
  140. PathName2, // "
  141. PathType, // "
  142. Flags // "
  143. );
  144. }
  145. NET_API_STATUS
  146. RxNetpNameValidate(
  147. IN LPTSTR ServerName,
  148. IN LPTSTR Name,
  149. IN DWORD NameType,
  150. IN DWORD Flags
  151. )
  152. /*++
  153. Routine Description:
  154. Runs I_NetNameValidate on a down-level server
  155. Arguments:
  156. ServerName - down-level server where this routine is run
  157. Name - name to validate
  158. NameType - type of name expected
  159. Flags - flags controlling server-side routine
  160. Return Value:
  161. NET_API_STATUS
  162. Success - NERR_Success
  163. Failure -
  164. --*/
  165. {
  166. return RxRemoteApi(
  167. API_WI_NetNameValidate, // API #
  168. ServerName, // where we're gonna do it
  169. REMSmb_I_NetNameValidate_P, // parameter descriptor
  170. NULL, // data descriptor 16-bit
  171. NULL, // data descriptor 32-bit
  172. NULL, // data descriptor SMB
  173. NULL, // aux data descriptor 16-bit
  174. NULL, // aux data descriptor 32-bit
  175. NULL, // aux data descriptor SMB
  176. FALSE, // can use NULL session
  177. Name, // args to remote routine
  178. NameType, // "
  179. Flags // "
  180. );
  181. }
  182. NET_API_STATUS
  183. RxNetpNameCanonicalize(
  184. IN LPTSTR ServerName,
  185. IN LPTSTR Name,
  186. OUT LPTSTR Outbuf,
  187. IN DWORD OutbufLen,
  188. IN DWORD NameType,
  189. IN DWORD Flags
  190. )
  191. /*++
  192. Routine Description:
  193. Runs I_NetNameCanonicalize on a down-level server
  194. Arguments:
  195. ServerName - down-level server where this routine is run
  196. Name - name to canonicalize
  197. Outbuf - buffer which receives canonicalized name
  198. OutbufLen - size of buffer (in bytes)
  199. NameType - type of canonicalized name
  200. Flags - flags controlling server-side routine
  201. Return Value:
  202. NET_API_STATUS
  203. Success - NERR_Success
  204. Failure -
  205. --*/
  206. {
  207. return RxRemoteApi(
  208. API_WI_NetNameCanonicalize, // API #
  209. ServerName, // where we're gonna do it
  210. REMSmb_I_NetNameCanonicalize_P, // parameter descriptor
  211. NULL, // data descriptor 16-bit
  212. NULL, // data descriptor 32-bit
  213. NULL, // data descriptor SMB
  214. NULL, // aux data descriptor 16-bit
  215. NULL, // aux data descriptor 32-bit
  216. NULL, // aux data descriptor SMB
  217. FALSE, // can use NULL session
  218. Name, // args to remote routine
  219. Outbuf, // "
  220. OutbufLen, // "
  221. NameType, // "
  222. Flags // "
  223. );
  224. }
  225. LONG
  226. RxNetpNameCompare(
  227. IN LPTSTR ServerName,
  228. IN LPTSTR Name1,
  229. IN LPTSTR Name2,
  230. IN DWORD NameType,
  231. IN DWORD Flags
  232. )
  233. /*++
  234. Routine Description:
  235. Runs I_NetNameCompare on a down-level server
  236. Arguments:
  237. ServerName - down-level server where this routine is run
  238. Name1 - name to compare
  239. Name2 - name to compare
  240. NameType - type of Name1, Name2
  241. Flags - flags controlling server-side routine
  242. Return Value:
  243. LONG
  244. <0 - Name1 < Name2
  245. =0 - Name1 = Name2
  246. >0 - Name1 > Name2
  247. --*/
  248. {
  249. return RxRemoteApi(
  250. API_WI_NetNameCompare, // API #
  251. ServerName, // where we're gonna do it
  252. REMSmb_I_NetNameCompare_P, // parameter descriptor
  253. NULL, // data descriptor 16-bit
  254. NULL, // data descriptor 32-bit
  255. NULL, // data descriptor SMB
  256. NULL, // aux data descriptor 16-bit
  257. NULL, // aux data descriptor 32-bit
  258. NULL, // aux data descriptor SMB
  259. FALSE, // can use NULL session
  260. Name1, // args to remote routine
  261. Name2, // "
  262. NameType, // "
  263. Flags // "
  264. );
  265. }
  266. NET_API_STATUS
  267. RxNetpListCanonicalize(
  268. IN LPTSTR ServerName,
  269. IN LPTSTR List,
  270. IN LPTSTR Delimiters,
  271. OUT LPTSTR Outbuf,
  272. IN DWORD OutbufLen,
  273. OUT LPDWORD OutCount,
  274. OUT LPDWORD PathTypes,
  275. IN DWORD PathTypesLen,
  276. IN DWORD Flags
  277. )
  278. /*++
  279. Routine Description:
  280. Runs I_NetListCanonicalize on a down-level server.
  281. NOTE: I_NetListCanonicalize is not supported as a remotable function in
  282. LanMan, so no action
  283. Arguments:
  284. ServerName - down-level server where this routine is run
  285. List - of names/paths to canonicalize
  286. Delimiters - optional string of delimiters
  287. Outbuf - buffer where canonicalized results are put
  288. OutbufLen - size of output buffer
  289. OutCount - number of items canonicalized
  290. PathTypes - array of pathtypes
  291. PathTypesLen- number of elements in path types array
  292. Flags - flags controlling server-side routine
  293. Return Value:
  294. NET_API_STATUS
  295. Success -
  296. Failure - ERROR_NOT_SUPPORTED
  297. --*/
  298. {
  299. UNREFERENCED_PARAMETER(ServerName);
  300. UNREFERENCED_PARAMETER(List);
  301. UNREFERENCED_PARAMETER(Delimiters);
  302. UNREFERENCED_PARAMETER(Outbuf);
  303. UNREFERENCED_PARAMETER(OutbufLen);
  304. UNREFERENCED_PARAMETER(OutCount);
  305. UNREFERENCED_PARAMETER(PathTypes);
  306. UNREFERENCED_PARAMETER(PathTypesLen);
  307. UNREFERENCED_PARAMETER(Flags);
  308. return ERROR_NOT_SUPPORTED;
  309. }