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.

252 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name :
  4. gdstubs.c
  5. Abstract:
  6. Client Stubs for RPC API for Gopher server
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 16-Nov-1994
  9. Project:
  10. Gopher Server Admin DLL
  11. Functions Exported:
  12. DWORD GdGetAdminInformation(
  13. IN LPWSTR pszServer OPTIONAL,
  14. OUT LPGOPHERD_CONFIG_INFO * ppConfigInfo)
  15. DWORD GdSetAdminInformation(
  16. IN LPWSTR pszServer OPTIONAL,
  17. IN LPGOPHERD_CONFIG_INFO pConfigInfo)
  18. DWORD GdEnumerateUsers(
  19. IN LPWSTR pszServer OPTIONAL,
  20. OUT LPDWORD lpnEntriesRead,
  21. OUT LPGOPHERD_USER_INFO * lpUserBuffer)
  22. DWORD GdDisconnectUser(
  23. IN LPWSTR pszServer OPTIONAL,
  24. IN DWORD dwIdUser)
  25. DWORD GdGetStatistics(
  26. IN LPWSTR pszServer OPTIONAL,
  27. OUT LPBYTE lpStatBuffer)
  28. DWORD GdClearStatistics(
  29. IN LPWSTR pszServer OPTIONAL)
  30. Revision History:
  31. --*/
  32. /************************************************************
  33. * Include Headers
  34. ************************************************************/
  35. # include <windows.h>
  36. # include "gd_cli.h"
  37. /************************************************************
  38. * Functions
  39. ************************************************************/
  40. DWORD
  41. NET_API_FUNCTION
  42. GdGetAdminInformation(
  43. IN LPWSTR pszServer OPTIONAL,
  44. OUT LPGOPHERD_CONFIG_INFO * ppConfigInfo
  45. )
  46. {
  47. DWORD status;
  48. RpcTryExcept {
  49. //
  50. // Try the RPC call
  51. //
  52. status = R_GdGetAdminInformation(
  53. pszServer,
  54. ppConfigInfo);
  55. }
  56. RpcExcept (1) {
  57. status = RpcExceptionCode();
  58. }
  59. RpcEndExcept
  60. return ( status);
  61. } // GdGetAdminInformation()
  62. DWORD
  63. NET_API_FUNCTION
  64. GdSetAdminInformation(
  65. IN LPWSTR pszServer OPTIONAL,
  66. IN LPGOPHERD_CONFIG_INFO pConfigInfo
  67. )
  68. {
  69. DWORD status;
  70. RpcTryExcept {
  71. //
  72. // Try the RPC call
  73. //
  74. status = R_GdSetAdminInformation(
  75. pszServer,
  76. pConfigInfo);
  77. }
  78. RpcExcept (1) {
  79. status = RpcExceptionCode();
  80. }
  81. RpcEndExcept
  82. return ( status);
  83. } // GdSetAdminInformation()
  84. DWORD
  85. NET_API_FUNCTION
  86. GdEnumerateUsers(
  87. IN LPWSTR pszServer OPTIONAL,
  88. OUT LPDWORD lpnEntriesRead,
  89. OUT LPGOPHERD_USER_INFO * lpUserBuffer
  90. )
  91. {
  92. DWORD status;
  93. GOPHERD_USER_ENUM_STRUCT gdUsers;
  94. RpcTryFinally {
  95. status = R_GdEnumerateUsers(
  96. pszServer,
  97. &gdUsers
  98. );
  99. *lpnEntriesRead = gdUsers.dwEntriesRead;
  100. *lpUserBuffer = gdUsers.lpUsers;
  101. }
  102. RpcExcept( 1) {
  103. status = RpcExceptionCode();
  104. }
  105. RpcEndExcept
  106. return ( status);
  107. } // GdEnumerateUsers()
  108. DWORD
  109. NET_API_FUNCTION
  110. GdDisconnectUser(
  111. IN LPWSTR pszServer OPTIONAL,
  112. IN DWORD dwIdUser
  113. )
  114. {
  115. DWORD status;
  116. RpcTryFinally {
  117. status = R_GdDisconnectUser(
  118. pszServer,
  119. dwIdUser
  120. );
  121. }
  122. RpcExcept( 1) {
  123. status = RpcExceptionCode();
  124. }
  125. RpcEndExcept
  126. return ( status);
  127. } // GdDisconnectUser()
  128. DWORD
  129. NET_API_FUNCTION
  130. GdGetStatistics(
  131. IN LPWSTR pszServer OPTIONAL,
  132. OUT LPBYTE lpStatBuffer // pass LPGOPHERD_STATISTICS_INFO
  133. )
  134. {
  135. DWORD status;
  136. RpcTryFinally {
  137. status = R_GdGetStatistics(
  138. pszServer,
  139. ( LPGOPHERD_STATISTICS_INFO ) lpStatBuffer
  140. );
  141. }
  142. RpcExcept( 1) {
  143. status = RpcExceptionCode();
  144. }
  145. RpcEndExcept
  146. return ( status);
  147. } // GdGetStatistics()
  148. DWORD
  149. NET_API_FUNCTION
  150. GdClearStatistics(
  151. IN LPWSTR pszServer OPTIONAL
  152. )
  153. {
  154. DWORD status;
  155. RpcTryFinally {
  156. status = R_GdClearStatistics(
  157. pszServer
  158. );
  159. }
  160. RpcExcept( 1) {
  161. status = RpcExceptionCode();
  162. }
  163. RpcEndExcept
  164. return ( status);
  165. } // GdClearStatistics()
  166. /************************ End of File ***********************/