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.

278 lines
7.2 KiB

  1. /******************************************************************\
  2. * Microsoft Windows NT *
  3. * Copyright(c) Microsoft Corp., 1992 *
  4. \******************************************************************/
  5. /*++
  6. Module Name:
  7. USERAPI.C
  8. Description:
  9. This module contains code for all the RASADMIN APIs
  10. that require RAS information from the UAS.
  11. // RasAdminUserEnum
  12. RasAdminGetUserAccountServer
  13. RasAdminUserSetInfo
  14. RasAdminUserGetInfo
  15. RasAdminGetErrorString
  16. Author:
  17. Janakiram Cherala (RamC) July 6,1992
  18. Revision History:
  19. Feb 1,1996 RamC Changes to export these APIs to 3rd parties. These APIs
  20. are now part of RASSAPI.DLL. Added a couple new routines
  21. and renamed some. RasAdminUserEnum is not exported any more.
  22. June 8,1993 RamC Changes to RasAdminUserEnum to speed up user enumeration.
  23. May 13,1993 AndyHe Modified to coexist with other apps using user parms
  24. Mar 16,1993 RamC Change to speed up User enumeration. Now, when
  25. RasAdminUserEnum is invoked, only the user name
  26. information is returned. RasAdminUserGetInfo should
  27. be invoked to get the Ras permissions and Callback
  28. information.
  29. Aug 25,1992 RamC Code review changes:
  30. o changed all lpbBuffers to actual structure
  31. pointers.
  32. o changed all LPTSTR to LPWSTR
  33. o Added a new function RasPrivilegeAndCallBackNumber
  34. July 6,1992 RamC Begun porting from RAS 1.0 (Original version
  35. written by Narendra Gidwani - nareng)
  36. --*/
  37. #include <nt.h>
  38. #include <ntrtl.h>
  39. #include <nturtl.h>
  40. #include <windows.h>
  41. #include "rassapi.h"
  42. //
  43. // Deprecated API in .Net #526819
  44. //
  45. DWORD APIENTRY
  46. RasAdminUserSetInfo(
  47. IN const WCHAR * lpszServer,
  48. IN const WCHAR * lpszUser,
  49. IN const PRAS_USER_0 pRasUser0
  50. )
  51. /*++
  52. Routine Description:
  53. This routine allows the admin to change the RAS permission for a
  54. user. If the user parms field of a user is being used by another
  55. application, it will be destroyed.
  56. Arguments:
  57. lpszServer name of the server which has the user database,
  58. eg., "\\\\UASSRVR" (the server must be one on which
  59. the UAS can be changed i.e., the name returned by
  60. RasAdminGetUserAccountServer).
  61. lpszUser user account name to retrieve information for,
  62. e.g. "USER".
  63. pRasUser0 pointer to a buffer in which user information is
  64. provided. The buffer should contain a filled
  65. RAS_USER_0 structure.
  66. Return Value:
  67. ERROR_SUCCESS on successful return.
  68. One of the following non-zero error codes indicating failure:
  69. return codes from NetUserGetInfo or NetUserSetInfo
  70. ERROR_INVALID_DATA indicates that the data in pRasUser0 is bad.
  71. --*/
  72. {
  73. DbgPrint("Unsupported Interface - RasAdminUserSetInfo");
  74. return ERROR_CALL_NOT_IMPLEMENTED;
  75. }
  76. //
  77. // Deprecated API in .Net #526819
  78. //
  79. DWORD APIENTRY
  80. RasAdminUserGetInfo(
  81. IN const WCHAR * lpszServer,
  82. IN const WCHAR * lpszUser,
  83. OUT PRAS_USER_0 pRasUser0
  84. )
  85. /*++
  86. Routine Description:
  87. This routine retrieves RAS and other UAS information for a user
  88. in the domain the specified server belongs to. It loads the caller's
  89. pRasUser0 with a RAS_USER_0 structure.
  90. Arguments:
  91. lpszServer name of the server which has the user database,
  92. eg., "\\\\UASSRVR" (the server must be one on which
  93. the UAS can be changed i.e., the name returned by
  94. RasAdminGetUserAccountServer).
  95. lpszUser user account name to retrieve information for,
  96. e.g. "USER".
  97. pRasUser0 pointer to a buffer in which user information is
  98. returned. The returned info is a RAS_USER_0 structure.
  99. Return Value:
  100. ERROR_SUCCESS on successful return.
  101. One of the following non-zero error codes indicating failure:
  102. return codes from NetUserGetInfo or NetUserSetInfo
  103. ERROR_INVALID_DATA indicates that user parms is invalid.
  104. --*/
  105. {
  106. DbgPrint("Unsupported Interface - RasAdminUserGetInfo");
  107. if (pRasUser0)
  108. {
  109. ZeroMemory(pRasUser0, sizeof(RAS_USER_0));
  110. }
  111. return ERROR_CALL_NOT_IMPLEMENTED;
  112. }
  113. //
  114. // Deprecated API in .Net #526819
  115. //
  116. DWORD APIENTRY
  117. RasAdminGetUserAccountServer(
  118. IN const WCHAR * lpszDomain,
  119. IN const WCHAR * lpszServer,
  120. OUT LPWSTR lpszUasServer
  121. )
  122. /*++
  123. Routine Description:
  124. This routine finds the server with the master UAS (the PDC) from
  125. either a domain name or a server name. Either the domain or the
  126. server (but not both) may be NULL.
  127. Arguments:
  128. lpszDomain Domain name or NULL if none.
  129. lpszServer name of the server which has the user database.
  130. lpszUasServer Caller's buffer for the returned UAS server name.
  131. The buffer should be atleast UNCLEN + 1 characters
  132. long.
  133. Return Value:
  134. ERROR_SUCCESS on successful return.
  135. ERROR_INVALID_PARAMETER if both lpszDomain and lpszServer are NULL.
  136. one of the following non-zero error codes on failure:
  137. return codes from NetGetDCName
  138. --*/
  139. {
  140. DbgPrint("Unsupported Interface - RasAdminGetUserAccountServer");
  141. if (lpszUasServer)
  142. {
  143. lpszUasServer[0] = L'\0';
  144. }
  145. return ERROR_CALL_NOT_IMPLEMENTED;
  146. }
  147. DWORD APIENTRY
  148. RasAdminSetUserParms(
  149. IN OUT WCHAR * lpszParms,
  150. IN DWORD cchNewParms,
  151. IN PRAS_USER_0 pRasUser0
  152. )
  153. {
  154. DbgPrint("Unsupported Interface - RasAdminSetUserParms");
  155. if (lpszParms)
  156. {
  157. lpszParms[0] = L'\0';
  158. }
  159. return ERROR_CALL_NOT_IMPLEMENTED;
  160. }
  161. DWORD APIENTRY
  162. RasAdminGetUserParms(
  163. IN WCHAR * lpszParms,
  164. IN OUT PRAS_USER_0 pRasUser0
  165. )
  166. {
  167. DbgPrint("Unsupported Interface - RasAdminGetUserParms");
  168. if (pRasUser0)
  169. {
  170. ZeroMemory(pRasUser0, sizeof(RAS_USER_0));
  171. }
  172. return ERROR_CALL_NOT_IMPLEMENTED;
  173. }
  174. DWORD APIENTRY
  175. RasAdminGetErrorString(
  176. IN UINT ResourceId,
  177. OUT WCHAR * lpszString,
  178. IN DWORD InBufSize )
  179. {
  180. DbgPrint("Unsupported Interface - RasAdminGetErrorString");
  181. if (lpszString)
  182. {
  183. lpszString[0] = L'\0';
  184. }
  185. return ERROR_CALL_NOT_IMPLEMENTED;
  186. }
  187. BOOL
  188. RasAdminDLLInit(
  189. IN HINSTANCE DLLHandle,
  190. IN DWORD Reason,
  191. IN LPVOID ReservedAndUnused
  192. )
  193. {
  194. DbgPrint("Unsupported Interface - RasAdminDLLInit");
  195. return FALSE;
  196. }
  197. USHORT
  198. RasAdminCompressPhoneNumber(
  199. IN LPWSTR UncompNumber,
  200. OUT LPWSTR CompNumber
  201. )
  202. {
  203. DbgPrint("Unsupported Interface - RasAdminCompressPhoneNumber");
  204. return ERROR_CALL_NOT_IMPLEMENTED;
  205. }