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.

194 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1997 - 1997 Microsoft Corporation
  3. Module Name:
  4. joinp.h
  5. Abstract:
  6. Private definitions and prototypes of helper functions for netjoin.
  7. This file is intended to be included only be netjoin.c & joinutl.c.
  8. Author:
  9. kumarp 17-May-1999
  10. --*/
  11. #ifndef __JOINP_H__
  12. #define __JOINP_H__
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. LPWSTR
  20. GetStrPtr(IN LPWSTR szString OPTIONAL);
  21. LPWSTR
  22. GetStrPtr(IN LPWSTR szString OPTIONAL);
  23. NET_API_STATUS
  24. NET_API_FUNCTION
  25. NetpDuplicateString(IN LPCWSTR szSrc,
  26. IN LONG cchSrc,
  27. OUT LPWSTR* pszDst);
  28. NET_API_STATUS
  29. NET_API_FUNCTION
  30. NetpGeneratePassword(
  31. IN LPCWSTR szMachine,
  32. IN BOOL fRandomPwdPreferred,
  33. IN LPCWSTR szDcName,
  34. IN BOOL fIsNt4Dc,
  35. OUT LPWSTR szPassword
  36. );
  37. NET_API_STATUS
  38. NET_API_FUNCTION
  39. NetpGenerateRandomPassword(
  40. OUT LPWSTR szPassword
  41. );
  42. void
  43. NetpGenerateDefaultPassword(
  44. IN LPCWSTR szMachine,
  45. OUT LPWSTR szPassword
  46. );
  47. BOOL
  48. NetpIsDefaultPassword(
  49. IN LPCWSTR szMachine,
  50. IN LPWSTR szPassword
  51. );
  52. NET_API_STATUS
  53. NET_API_FUNCTION
  54. NetpGetNt4RefusePasswordChangeStatus(
  55. IN LPCWSTR Nt4Dc,
  56. OUT BOOL* RefusePasswordChangeSet
  57. );
  58. NET_API_STATUS
  59. NET_API_FUNCTION
  60. NetpGetComputerNameAllocIfReqd(
  61. OUT LPWSTR* ppwszMachine,
  62. IN UINT cLen
  63. );
  64. NET_API_STATUS
  65. NET_API_FUNCTION
  66. NetpConcatStrings(IN LPCWSTR szSrc1,
  67. IN LONG cchSrc1,
  68. IN LPCWSTR szSrc2,
  69. IN LONG cchSrc2,
  70. OUT LPWSTR* pszDst);
  71. NET_API_STATUS
  72. NET_API_FUNCTION
  73. NetpConcatStrings3(IN LPCWSTR szSrc1,
  74. IN LONG cchSrc1,
  75. IN LPCWSTR szSrc2,
  76. IN LONG cchSrc2,
  77. IN LPCWSTR szSrc3,
  78. IN LONG cchSrc3,
  79. OUT LPWSTR* pszDst);
  80. NET_API_STATUS
  81. NET_API_FUNCTION
  82. NetpVerifyStrOemCompatibleOnMachine(
  83. IN LPCWSTR szRemoteMachine,
  84. IN LPCWSTR szString
  85. );
  86. #define NJA_UpdateNetlogonCache 0x00001
  87. #define NJA_SetPolicyDomainInfo 0x00002
  88. #define NJA_AddToLocalGroups 0x00004
  89. #define NJA_RemoveFromLocalGroups 0x00008
  90. #define NJA_SetNetlogonState 0x00010
  91. #define NJA_SetTimeSvcJoin 0x00020
  92. #define NJA_SetTimeSvcUnjoin 0x00040
  93. #define NJA_RecordDcInfo 0x00080
  94. #define NJA_GenMachinePassword 0x00100
  95. #define NJA_SetMachinePassword 0x00200
  96. #define NJA_CreateAccount 0x00400
  97. #define NJA_UseSpecifiedOU 0x00800
  98. #define NJA_GetPolicyDomainInfo 0x01000
  99. #define NJA_RandomPwdPreferred 0x02000
  100. #define NJA_ValidateMachineAccount 0x04000
  101. #define NJA_DeleteAccount 0x08000
  102. #define NJA_DeleteMachinePassword 0x10000
  103. #define NJA_RemoveDnsRegistrations 0x20000
  104. #define NJA_IgnoreErrors 0x40000
  105. #define NJA_RollbackOnFailure 0x80000
  106. #define NJA_SetAutoenrolSvcJoin 0x100000
  107. #define NJA_SetAutoenrolSvcUnjoin 0x200000
  108. #define NJA_AddDnsRegistrations 0x400000
  109. #define NJA_NeedDc (NJA_RecordDcInfo |\
  110. NJA_SetMachinePassword |\
  111. NJA_CreateAccount |\
  112. NJA_DeleteAccount |\
  113. NJA_GetPolicyDomainInfo |\
  114. NJA_ValidateMachineAccount \
  115. )
  116. typedef struct _NET_JOIN_STATE
  117. {
  118. LPCWSTR szOU;
  119. LPCWSTR szDomainName;
  120. POLICY_PRIMARY_DOMAIN_INFO* pPolicyPDI;
  121. POLICY_DNS_DOMAIN_INFO* pPolicyDDI;
  122. LPCWSTR szMachinePassword;
  123. USHORT uiNetlogonStartType;
  124. USHORT uiNetlogonState;
  125. } NET_JOIN_STATE;
  126. NET_API_STATUS
  127. NET_API_FUNCTION
  128. NetpApplyJoinState(
  129. IN NET_JOIN_STATE* pJoinState,
  130. IN DWORD dwJoinAction,
  131. IN LPWSTR szMachineName, OPTIONAL
  132. IN LPWSTR szUser, OPTIONAL
  133. IN LPWSTR szUserPassword, OPTIONAL
  134. IN LPWSTR szPreferredDc OPTIONAL
  135. );
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139. NET_API_STATUS
  140. NET_API_FUNCTION
  141. NetpWaitForNetlogonSc(
  142. IN LPCWSTR szDomainName
  143. );
  144. NET_API_STATUS
  145. NET_API_FUNCTION
  146. NetpUpdateW32timeConfig(
  147. IN PCSTR szW32timeJoinConfigFuncName
  148. );
  149. NET_API_STATUS
  150. NET_API_FUNCTION
  151. NetpUpdateAutoenrolConfig(
  152. IN BOOL UnjoinDomain
  153. );
  154. #endif // __JOINP_H__