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.

261 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. ftpstub.c
  5. Abstract:
  6. Client stubs of the FTP Daemon APIs.
  7. Author:
  8. Dan Hinsley (DanHi) 23-Mar-1993
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #include "ftpsvc.h" // FTP_USER_ENUM_STRUCT
  14. NET_API_STATUS
  15. I_FtpEnumerateUsers(
  16. IN LPWSTR Server OPTIONAL,
  17. OUT LPDWORD EntriesRead,
  18. OUT LPFTP_USER_INFO * Buffer
  19. )
  20. {
  21. NET_API_STATUS status;
  22. FTP_USER_ENUM_STRUCT EnumStruct;
  23. RpcTryExcept {
  24. //
  25. // Try RPC (local or remote) version of API.
  26. //
  27. status = I_FtprEnumerateUsers(
  28. Server,
  29. &EnumStruct
  30. );
  31. *EntriesRead = EnumStruct.EntriesRead;
  32. *Buffer = EnumStruct.Buffer;
  33. }
  34. RpcExcept (1) {
  35. status = RpcExceptionCode();
  36. }
  37. RpcEndExcept
  38. return (status);
  39. }
  40. NET_API_STATUS
  41. I_FtpDisconnectUser(
  42. IN LPWSTR Server OPTIONAL,
  43. IN DWORD User
  44. )
  45. {
  46. NET_API_STATUS status;
  47. RpcTryExcept {
  48. //
  49. // Try RPC (local or remote) version of API.
  50. //
  51. status = I_FtprDisconnectUser(
  52. Server,
  53. User
  54. );
  55. }
  56. RpcExcept (1) {
  57. status = RpcExceptionCode();
  58. }
  59. RpcEndExcept
  60. return (status);
  61. }
  62. NET_API_STATUS
  63. I_FtpQueryVolumeSecurity(
  64. IN LPWSTR Server OPTIONAL,
  65. OUT LPDWORD ReadAccess,
  66. OUT LPDWORD WriteAccess
  67. )
  68. {
  69. NET_API_STATUS status;
  70. RpcTryExcept {
  71. //
  72. // Try RPC (local or remote) version of API.
  73. //
  74. status = I_FtprQueryVolumeSecurity(
  75. Server,
  76. ReadAccess,
  77. WriteAccess
  78. );
  79. }
  80. RpcExcept (1) {
  81. status = RpcExceptionCode();
  82. }
  83. RpcEndExcept
  84. return (status);
  85. }
  86. NET_API_STATUS
  87. I_FtpSetVolumeSecurity(
  88. IN LPWSTR Server OPTIONAL,
  89. IN DWORD ReadAccess,
  90. IN DWORD WriteAccess
  91. )
  92. {
  93. NET_API_STATUS status;
  94. RpcTryExcept {
  95. //
  96. // Try RPC (local or remote) version of API.
  97. //
  98. status = I_FtprSetVolumeSecurity(
  99. Server,
  100. ReadAccess,
  101. WriteAccess
  102. );
  103. }
  104. RpcExcept (1) {
  105. status = RpcExceptionCode();
  106. }
  107. RpcEndExcept
  108. return (status);
  109. }
  110. NET_API_STATUS
  111. I_FtpQueryStatistics(
  112. IN LPWSTR Server OPTIONAL,
  113. IN DWORD Level,
  114. OUT LPBYTE * Buffer
  115. )
  116. {
  117. NET_API_STATUS status;
  118. *Buffer = NULL;
  119. RpcTryExcept {
  120. //
  121. // Try RPC (local or remote) version of API.
  122. //
  123. status = I_FtprQueryStatistics(
  124. Server,
  125. Level,
  126. (LPSTATISTICS_INFO)Buffer
  127. );
  128. }
  129. RpcExcept (1) {
  130. status = RpcExceptionCode();
  131. }
  132. RpcEndExcept
  133. return (status);
  134. }
  135. NET_API_STATUS
  136. I_FtpClearStatistics(
  137. IN LPWSTR Server OPTIONAL
  138. )
  139. {
  140. NET_API_STATUS status;
  141. RpcTryExcept {
  142. //
  143. // Try RPC (local or remote) version of API.
  144. //
  145. status = I_FtprClearStatistics(
  146. Server
  147. );
  148. }
  149. RpcExcept (1) {
  150. status = RpcExceptionCode();
  151. }
  152. RpcEndExcept
  153. return (status);
  154. }
  155. NET_API_STATUS
  156. NET_API_FUNCTION
  157. FtpGetAdminInformation(
  158. IN LPWSTR pszServer OPTIONAL,
  159. OUT LPFTP_CONFIG_INFO * ppConfig
  160. )
  161. {
  162. NET_API_STATUS status;
  163. RpcTryExcept {
  164. //
  165. // Try RPC (local or remote) version of API.
  166. //
  167. status = FtprGetAdminInformation(
  168. pszServer,
  169. ppConfig
  170. );
  171. }
  172. RpcExcept (1) {
  173. status = RpcExceptionCode();
  174. }
  175. RpcEndExcept
  176. return (status);
  177. }
  178. NET_API_STATUS
  179. NET_API_FUNCTION
  180. FtpSetAdminInformation(
  181. IN LPWSTR pszServer OPTIONAL,
  182. IN LPFTP_CONFIG_INFO pConfig
  183. )
  184. {
  185. NET_API_STATUS status;
  186. RpcTryExcept {
  187. //
  188. // Try RPC (local or remote) version of API.
  189. //
  190. status = FtprSetAdminInformation(
  191. pszServer,
  192. pConfig
  193. );
  194. }
  195. RpcExcept (1) {
  196. status = RpcExceptionCode();
  197. }
  198. RpcEndExcept
  199. return (status);
  200. }