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.

257 lines
5.1 KiB

  1. /*++
  2. Copyright (c) 1997 - 1997 Microsoft Corporation
  3. Module Name:
  4. netsetup.h
  5. Abstract:
  6. Definitions and prototypes for the Net setup apis, for joining/unjoinging
  7. domains and promoting/demoting servers
  8. Author:
  9. Mac McLain (MacM) 19-Feb-1997
  10. Environment:
  11. User mode only.
  12. Revision History:
  13. --*/
  14. #ifndef __NETSETUP_H__
  15. #define __NETSETUP_H__
  16. #include <nt.h>
  17. #include <ntrtl.h>
  18. #include <nturtl.h>
  19. #include <ntlsa.h>
  20. #define NETSETUPP_CONNECT_IPC 0x00000001
  21. #define NETSETUPP_DISCONNECT_IPC 0x00000002
  22. #define NETSETUPP_NULL_SESSION_IPC 0x00000010
  23. #define NETSETUPP_CREATE 0
  24. #define NETSETUPP_DELETE 1
  25. #define NETSETUPP_RENAME 2
  26. #define NETSETUP_SVC_STOPPED 0x00000001
  27. #define NETSETUP_SVC_STARTED 0x00000002
  28. #define NETSETUP_SVC_ENABLED 0x00000004
  29. #define NETSETUP_SVC_DISABLED 0x00000008
  30. #define NETSETUP_SVC_MANUAL 0x00000010
  31. #define NETSETUPP_SVC_NETLOGON 0x00000001
  32. #define NETSETUPP_SVC_TIMESVC 0x00000002
  33. #define NETSETUP_IGNORE_JOIN 0x80000000
  34. //
  35. // Helpful macros
  36. //
  37. //
  38. // Determines whether a bit flag is turned on or not
  39. //
  40. #define FLAG_ON(flag,bits) ((flag) & (bits))
  41. //
  42. // Determine whether the client is joined to a domain or not given the LSAs
  43. // primary domain information
  44. //
  45. #define IS_CLIENT_JOINED(plsapdinfo) \
  46. ((plsapdinfo)->Sid != NULL && (plsapdinfo)->Name.Length != 0 ? TRUE : FALSE)
  47. //
  48. // Log routines
  49. //
  50. void
  51. NetSetuppOpenLog();
  52. void
  53. NetSetuppCloseLog();
  54. void
  55. NetpLogPrintHelper(
  56. IN LPCSTR Format,
  57. ...);
  58. #define NetpLog(x) NetpLogPrintHelper x
  59. //
  60. // Procedure forwards
  61. //
  62. NET_API_STATUS
  63. NET_API_FUNCTION
  64. NetpMachineValidToJoin(
  65. IN LPWSTR lpMachine,
  66. IN BOOL fJoiningDomain
  67. );
  68. NET_API_STATUS
  69. NET_API_FUNCTION
  70. NetpChangeMachineName(
  71. IN LPWSTR lpCurrentMachine,
  72. IN LPWSTR lpNewHostName,
  73. IN LPWSTR lpDomain,
  74. IN LPWSTR lpAccount,
  75. IN LPWSTR lpPassword,
  76. IN DWORD fJoinOpts
  77. );
  78. NET_API_STATUS
  79. NET_API_FUNCTION
  80. NetpUnJoinDomain(
  81. IN PPOLICY_PRIMARY_DOMAIN_INFO pPolicyPDI,
  82. IN LPWSTR lpAccount,
  83. IN LPWSTR lpPassword,
  84. IN DWORD fJoinOpts
  85. );
  86. NET_API_STATUS
  87. NET_API_FUNCTION
  88. NetpGetLsaPrimaryDomain(
  89. IN LSA_HANDLE PolicyHandle, OPTIONAL
  90. IN LPWSTR lpServer, OPTIONAL
  91. OUT PPOLICY_PRIMARY_DOMAIN_INFO *ppPolicyPDI,
  92. #if(_WIN32_WINNT >= 0x0500)
  93. OUT PPOLICY_DNS_DOMAIN_INFO *ppPolicyDns,
  94. #endif
  95. OUT PLSA_HANDLE pPolicyHandle OPTIONAL
  96. );
  97. NET_API_STATUS
  98. NET_API_FUNCTION
  99. NetpBrowserCheckDomain(
  100. IN LPWSTR NewDomainName
  101. );
  102. NET_API_STATUS
  103. NET_API_FUNCTION
  104. NetpCheckNetBiosNameNotInUse(
  105. IN LPWSTR pszName,
  106. IN BOOLEAN MachineName,
  107. IN BOOLEAN UniqueName
  108. );
  109. NET_API_STATUS
  110. NET_API_FUNCTION
  111. NetpCheckDomainNameIsValid(
  112. IN LPWSTR lpName,
  113. IN LPWSTR lpAccount,
  114. IN LPWSTR lpPassword,
  115. IN BOOL fShouldExist
  116. );
  117. NET_API_STATUS
  118. NET_API_FUNCTION
  119. NetpValidateName(
  120. IN LPWSTR lpMachine,
  121. IN LPWSTR lpName,
  122. IN LPWSTR lpAccount, OPTIONAL
  123. IN LPWSTR lpPassword, OPTIONAL
  124. IN NETSETUP_NAME_TYPE NameType
  125. );
  126. NET_API_STATUS
  127. NET_API_FUNCTION
  128. NetpGetJoinInformation(
  129. IN LPWSTR lpServer OPTIONAL,
  130. OUT LPWSTR *lpNameBuffer,
  131. OUT PNETSETUP_JOIN_STATUS BufferType
  132. );
  133. NET_API_STATUS
  134. NET_API_FUNCTION
  135. NetpDoDomainJoin(
  136. IN LPWSTR lpMachine,
  137. IN LPWSTR lpDomain,
  138. IN LPWSTR lpMachineAccountOU,
  139. IN LPWSTR lpAccount,
  140. IN LPWSTR lpPassword,
  141. IN DWORD fJoinOpts
  142. );
  143. NET_API_STATUS
  144. NET_API_FUNCTION
  145. NetpGetListOfJoinableOUs(
  146. IN LPWSTR Domain,
  147. IN LPWSTR Account,
  148. IN LPWSTR Password,
  149. OUT PULONG Count,
  150. OUT PWSTR **OUs
  151. );
  152. NET_API_STATUS
  153. NET_API_FUNCTION
  154. NetpGetNewMachineName(
  155. OUT PWSTR *NewMachineName
  156. );
  157. NET_API_STATUS
  158. NET_API_FUNCTION
  159. NetpSetDnsComputerNameAsRequired(
  160. IN PWSTR DnsDomainName
  161. );
  162. EXTERN_C
  163. NET_API_STATUS
  164. NET_API_FUNCTION
  165. NetpUpgradePreNT5JoinInfo( VOID );
  166. NET_API_STATUS
  167. NET_API_FUNCTION
  168. NetpSeparateUserAndDomain(
  169. IN LPCWSTR szUserAndDomain,
  170. OUT LPWSTR* pszUser,
  171. OUT LPWSTR* pszDomain
  172. );
  173. NET_API_STATUS
  174. NET_API_FUNCTION
  175. NetpGetMachineAccountName(
  176. IN LPCWSTR szMachineName,
  177. OUT LPWSTR* pszMachineAccountName
  178. );
  179. NET_API_STATUS
  180. NET_API_FUNCTION
  181. NetpManageIPCConnect(
  182. IN LPWSTR lpServer,
  183. IN LPWSTR lpAccount,
  184. IN LPWSTR lpPassword,
  185. IN ULONG fOptions
  186. );
  187. NET_API_STATUS
  188. NET_API_FUNCTION
  189. NetpControlServices(
  190. IN DWORD SvcOpts,
  191. IN DWORD Services
  192. );
  193. VOID
  194. NetpAvoidNetlogonSpnSet(
  195. BOOL AvoidSet
  196. );
  197. NET_API_STATUS
  198. NetpQueryService(
  199. IN LPWSTR ServiceName,
  200. OUT SERVICE_STATUS *ServiceStatus,
  201. OUT LPQUERY_SERVICE_CONFIG *ServiceConfig
  202. );
  203. DWORD
  204. NetpCrackNamesStatus2Win32Error(
  205. DWORD dwStatus
  206. );
  207. #endif // __NETSETUP_H__