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.

331 lines
9.2 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // code common to several pages
  4. //
  5. // 12-16-97 sburns
  6. String
  7. BrowseForDomain(HWND parent);
  8. String
  9. BrowseForFolder(HWND parent, int titleResID);
  10. // Returns true if the available space on the path is >= minSpaceMB.
  11. // "available" means "taking into account quotas."
  12. //
  13. // path - Fully qualified path to test.
  14. //
  15. // minSpaceMB - minimum disk space in megabytes to ensure is availble on that
  16. // path.
  17. bool
  18. CheckDiskSpace(const String& path, unsigned minSpaceMB);
  19. // Return true if either of the netbios or fully-qualified computer names of
  20. // the machine have been changed since the last time the computer was
  21. // restarted, false otherwise.
  22. bool
  23. ComputerWasRenamedAndNeedsReboot();
  24. // Check if a screen saver or low power sleep mode is enabled. If one is,
  25. // disable it. Also tell winlogon not to allow locking the console if
  26. // necessary.
  27. //
  28. // This is to prevent the computer or user from locking the console while a
  29. // lenthy operation is taking place. Since the user may be logged on as an
  30. // account that the operation destroys, once the machine is locked, there's no
  31. // way to unlock it. 290581, 311161
  32. void
  33. DisableConsoleLocking();
  34. // Enable winlogon console locking
  35. void
  36. EnableConsoleLocking();
  37. // Locates a domain controller for the domain specified by the user on the
  38. // credential page. Returns S_OK and sets computerName if a domain controller
  39. // is found, otherwise the error returned by DsGetDcName, converted to an
  40. // HRESULT.
  41. //
  42. // domainName - the name of the domain for which a DC should be located.
  43. //
  44. // computerName - string to receive the domain controller name, set to empty
  45. // on error.
  46. HRESULT
  47. GetDcName(const String& domainName, String& computerName);
  48. // Return the drive letter of the first NTFS 5 drive on the system (as "X:\"),
  49. // or empty if no such drive can be found.
  50. String
  51. GetFirstNtfs5HardDrive();
  52. // Return the DNS domain name of the forest root domain for the forest that
  53. // contains the given domain. Return empty string if that name can't be
  54. // determined.
  55. //
  56. // domain - in, netbios or DNS domain name of a domain in a forest.
  57. //
  58. // hr - in/out, if the caller is curious about the failure code, he can
  59. // retrieve it by passing a non-null pointer here.
  60. String
  61. GetForestName(const String& domain, HRESULT* hr = 0);
  62. // Return the DNS name of the domain that is the parent domain of the given
  63. // domain, or return the empty string if the domain is not a child domain
  64. // (i.e. is a tree root domain).
  65. //
  66. // childDomainDNSName - DNS name of the candidate child domain. It is assumed
  67. // that this domain exits.
  68. //
  69. // bindWithCredentials - true: discover the parent domain by using the the
  70. // credentials information collected on the CredentialsPage. false: use the
  71. // current logged-on user's credentials.
  72. String
  73. GetParentDomainDnsName(
  74. const String& childDomainDNSName,
  75. bool bindWithCredentials);
  76. bool
  77. IsChildDomain(bool bindWithCredentials);
  78. bool
  79. IsRootDomain(bool bindWithCredentials);
  80. bool
  81. IsForestRootDomain();
  82. // Returns true if the password and confirmation match, and the password
  83. // meets the password policy in effect on the local machine. Otherwise,
  84. // reports the reason the password is rejected, clears the edit controls,
  85. // and returns false.
  86. //
  87. // dialog - handle to the window with the password and confirmation edit
  88. // controls to test.
  89. //
  90. // passwordResId - resource ID of the password edit control.
  91. //
  92. // confirmResId - resource ID of the password confirmation edit control.
  93. //
  94. // isForSafeMode - true if the password is used for a promotion operation
  95. // i.e. the password is a candidate safe mode admin password. In this case,
  96. // the policy check is skipped if the password is blank, the wizard is
  97. // running in unattended mode, and no password was specified in the
  98. // answerfile. false otherwise, which means the policy check will always
  99. // be made.
  100. //
  101. // validatedPassword - out, if the password is accepted, then it is returned
  102. // in this parameter. If the password is rejected, the parameter is set to
  103. // the empty string.
  104. bool
  105. IsValidPassword(
  106. HWND dialog,
  107. int passwordResId,
  108. int confirmResId,
  109. bool isForSafeMode,
  110. EncryptedString& validatedPassword);
  111. String
  112. MassageUserName(const String& domainName, const String& userName);
  113. HRESULT
  114. ReadDomains(StringList& domains);
  115. // Sets the font of a given control in a dialog.
  116. //
  117. // parentDialog - Dialog containing the control.
  118. //
  119. // controlID - Res ID of the control for which the font will be
  120. // changed.
  121. //
  122. // font - handle to the new font for the control.
  123. void
  124. SetControlFont(HWND parentDialog, int controlID, HFONT font);
  125. // Sets the font of a control to a large point bold font as per Wizard '97
  126. // spec.
  127. //
  128. // dialog - handle to the dialog that is the parent of the control
  129. //
  130. // bigBoldResID - resource id of the control to change
  131. void
  132. SetLargeFont(HWND dialog, int bigBoldResID);
  133. void
  134. ShowTroubleshooter(HWND parent, int topicResID);
  135. // Validates a given file path for proper syntax and other requirements. If
  136. // validation fails, presents appropriate error messages to the user, and sets
  137. // the input focus to a given control. Returns true if the validation succeed,
  138. // false if not.
  139. //
  140. // path - file path to be validatated.
  141. //
  142. // parent - handle to the window containing the edit box that: contains the
  143. // name to be validated and receives focus if the validation fails.
  144. //
  145. // editResId - the resource id of the edit control containing the domain name
  146. // to be validated (if the domainName parameter is empty), also receives input
  147. // focus if validation fails.
  148. //
  149. // requiresNtfs5 - true if the path must refer to an NTFS 5 volume.
  150. //
  151. // requiresAsciiCharacters - true if the path may only contain 7-bit ASCII
  152. // characters.
  153. //
  154. // requiresUncompressedFolder - true if the path may not be compressed.
  155. bool
  156. ValidateDcInstallPath(
  157. const String& path,
  158. HWND parent,
  159. int editResId,
  160. bool requiresNtfs5 = false,
  161. bool requiresAsciiCharacters = false,
  162. bool requiresUncompressedFolder = false);
  163. bool
  164. ValidateChildDomainLeafNameLabel(
  165. HWND dialog,
  166. int editResID,
  167. bool gripeOnNonRfc);
  168. // Checks the candidate password against the password policy in effect on the
  169. // local machine. Returns S_OK if the password is acceptable, or one of:
  170. //
  171. // Win32ToHresult(NERR_PasswordTooShort)
  172. // Win32ToHresult(NERR_PasswordTooLong)
  173. // Win32ToHresult(NERR_PasswordNotComplexEnough)
  174. // Win32ToHresult(NERR_PasswordFilterError)
  175. //
  176. // or some other error that indicates that the policy check failed.
  177. //
  178. // password - the candidate password
  179. //
  180. // userName - the name of the account on which the password would be applied.
  181. // This is used to ensure that the password does not include the account name.
  182. // If the account does not exist, pass an empty String.
  183. HRESULT
  184. ValidatePasswordAgainstPolicy(
  185. const EncryptedString& password,
  186. const String& userName);
  187. bool
  188. ValidateSiteName(HWND dialog, int editResID);
  189. // Determine if the domain name provided refers to an existing DS domain.
  190. // Return true if it does, false if not (or if it does not refer to the domain
  191. // the user expected).
  192. //
  193. // dialog - handle to the dialog containing the edit box that: contains the
  194. // name to be validated and receives focus if the validation fails.
  195. //
  196. // domainName - the domain name to validate. If the empty string, then the
  197. // name is taken from the edit control identified by editResID.
  198. //
  199. // editResID - the resource id of the edit control containing the domain name
  200. // to be validated (if the domainName parameter is empty), also receives input
  201. // focus if validation fails.
  202. //
  203. // domainDNSName - if domainName is a netbios domain name, and it refers to a
  204. // DS domain, then this parameter receives the DNS domain name of the domain.
  205. // In this case, the user is prompted to confirm whether or not he intended to
  206. // refer to the domain (because a netbios name is also a legal DNS name). If
  207. // the user indicates yes, that was his intention, then validation succeeds
  208. // and the caller should use the value returned through this parameter as the
  209. // DNS domain name. If the answer is no, validation fails, and this parameter
  210. // is empty. If domainName does not refer to a DS domain, validation fails,
  211. // and this parameter is empty.
  212. bool
  213. ValidateDomainExists(
  214. HWND dialog,
  215. const String& domainName,
  216. int editResID,
  217. String& domainDNSName);
  218. // Overloads ValidateDomainExists such that the domain name to be
  219. // validated is taken from the edit control specified by editResID.
  220. bool
  221. ValidateDomainExists(HWND dialog, int editResID, String& domainDNSName);
  222. bool
  223. ValidateDomainDoesNotExist(
  224. HWND dialog,
  225. const String& domainName,
  226. int editResID);
  227. bool
  228. ValidateDomainDoesNotExist(
  229. HWND dialog,
  230. int editResID);