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.

245 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 routine
  49. //
  50. #define NetpLog(x) NetpLogPrintHelper x
  51. //
  52. // Procedure forwards
  53. //
  54. NET_API_STATUS
  55. NET_API_FUNCTION
  56. NetpMachineValidToJoin(
  57. IN LPWSTR lpMachine,
  58. IN BOOL fJoiningDomain
  59. );
  60. NET_API_STATUS
  61. NET_API_FUNCTION
  62. NetpChangeMachineName(
  63. IN LPWSTR lpCurrentMachine,
  64. IN LPWSTR lpNewHostName,
  65. IN LPWSTR lpDomain,
  66. IN LPWSTR lpAccount,
  67. IN LPWSTR lpPassword,
  68. IN DWORD fJoinOpts
  69. );
  70. NET_API_STATUS
  71. NET_API_FUNCTION
  72. NetpUnJoinDomain(
  73. IN PPOLICY_PRIMARY_DOMAIN_INFO pPolicyPDI,
  74. IN LPWSTR lpAccount,
  75. IN LPWSTR lpPassword,
  76. IN DWORD fJoinOpts
  77. );
  78. NET_API_STATUS
  79. NET_API_FUNCTION
  80. NetpGetLsaPrimaryDomain(
  81. IN LPWSTR lpServer, OPTIONAL
  82. OUT PPOLICY_PRIMARY_DOMAIN_INFO *ppPolicyPDI,
  83. #if(_WIN32_WINNT >= 0x0500)
  84. OUT PPOLICY_DNS_DOMAIN_INFO *ppPolicyDns,
  85. #endif
  86. OUT PLSA_HANDLE pPolicyHandle OPTIONAL
  87. );
  88. NET_API_STATUS
  89. NET_API_FUNCTION
  90. NetpBrowserCheckDomain(
  91. IN LPWSTR NewDomainName
  92. );
  93. NET_API_STATUS
  94. NET_API_FUNCTION
  95. NetpCheckNetBiosNameNotInUse(
  96. IN LPWSTR pszName,
  97. IN BOOLEAN MachineName,
  98. IN BOOLEAN UniqueName
  99. );
  100. NET_API_STATUS
  101. NET_API_FUNCTION
  102. NetpCheckDomainNameIsValid(
  103. IN LPWSTR lpName,
  104. IN LPWSTR lpAccount,
  105. IN LPWSTR lpPassword,
  106. IN BOOL fShouldExist
  107. );
  108. NET_API_STATUS
  109. NET_API_FUNCTION
  110. NetpValidateName(
  111. IN LPWSTR lpMachine,
  112. IN LPWSTR lpName,
  113. IN LPWSTR lpAccount, OPTIONAL
  114. IN LPWSTR lpPassword, OPTIONAL
  115. IN NETSETUP_NAME_TYPE NameType
  116. );
  117. NET_API_STATUS
  118. NET_API_FUNCTION
  119. NetpGetJoinInformation(
  120. IN LPWSTR lpServer OPTIONAL,
  121. OUT LPWSTR *lpNameBuffer,
  122. OUT PNETSETUP_JOIN_STATUS BufferType
  123. );
  124. NET_API_STATUS
  125. NET_API_FUNCTION
  126. NetpDoDomainJoin(
  127. IN LPWSTR lpMachine,
  128. IN LPWSTR lpDomain,
  129. IN LPWSTR lpMachineAccountOU,
  130. IN LPWSTR lpAccount,
  131. IN LPWSTR lpPassword,
  132. IN DWORD fJoinOpts
  133. );
  134. NET_API_STATUS
  135. NET_API_FUNCTION
  136. NetpGetListOfJoinableOUs(
  137. IN LPWSTR Domain,
  138. IN LPWSTR Account,
  139. IN LPWSTR Password,
  140. OUT PULONG Count,
  141. OUT PWSTR **OUs
  142. );
  143. NET_API_STATUS
  144. NET_API_FUNCTION
  145. NetpGetNewMachineName(
  146. OUT PWSTR *NewMachineName
  147. );
  148. NET_API_STATUS
  149. NET_API_FUNCTION
  150. NetpSetDnsComputerNameAsRequired(
  151. IN PWSTR DnsDomainName
  152. );
  153. EXTERN_C
  154. NET_API_STATUS
  155. NET_API_FUNCTION
  156. NetpUpgradePreNT5JoinInfo( VOID );
  157. NET_API_STATUS
  158. NET_API_FUNCTION
  159. NetpSeparateUserAndDomain(
  160. IN LPCWSTR szUserAndDomain,
  161. OUT LPWSTR* pszUser,
  162. OUT LPWSTR* pszDomain
  163. );
  164. NET_API_STATUS
  165. NET_API_FUNCTION
  166. NetpGetMachineAccountName(
  167. IN LPCWSTR szMachineName,
  168. OUT LPWSTR* pszMachineAccountName
  169. );
  170. NET_API_STATUS
  171. NET_API_FUNCTION
  172. NetpManageIPCConnect(
  173. IN LPWSTR lpServer,
  174. IN LPWSTR lpAccount,
  175. IN LPWSTR lpPassword,
  176. IN ULONG fOptions
  177. );
  178. NET_API_STATUS
  179. NET_API_FUNCTION
  180. NetpControlServices(
  181. IN DWORD SvcOpts,
  182. IN DWORD Services
  183. );
  184. VOID
  185. NetpAvoidNetlogonSpnSet(
  186. BOOL AvoidSet
  187. );
  188. NET_API_STATUS
  189. NetpQueryService(
  190. IN LPWSTR ServiceName,
  191. OUT SERVICE_STATUS *ServiceStatus,
  192. OUT LPQUERY_SERVICE_CONFIG *ServiceConfig
  193. );
  194. DWORD
  195. NetpCrackNamesStatus2Win32Error(
  196. DWORD dwStatus
  197. );
  198. #endif // __NETSETUP_H__