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.

304 lines
7.8 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. // If the new domain name is a single DNS label, then ask the user to confirm
  25. // that name. If the user rejects the name, set focus to the domain name edit
  26. // box, return false. Otherwise, return true.
  27. //
  28. // parentDialog - HWND of the dialog with the edit box control.
  29. //
  30. // editResID - resource ID of the domain name edit box containing the name to
  31. // be confirmed.
  32. //
  33. // 309670
  34. bool
  35. ConfirmNetbiosLookingNameIsReallyDnsName(HWND parentDialog, int editResID);
  36. // Check if a screen saver or low power sleep mode is enabled. If one is,
  37. // disable it. Also tell winlogon not to allow locking the console if
  38. // necessary.
  39. //
  40. // This is to prevent the computer or user from locking the console while a
  41. // lenthy operation is taking place. Since the user may be logged on as an
  42. // account that the operation destroys, once the machine is locked, there's no
  43. // way to unlock it. 290581, 311161
  44. void
  45. DisableConsoleLocking();
  46. // Enable winlogon console locking
  47. void
  48. EnableConsoleLocking();
  49. // Locates a domain controller for the domain specified by the user on the
  50. // credential page. Returns S_OK and sets computerName if a domain controller
  51. // is found, otherwise the error returned by DsGetDcName, converted to an
  52. // HRESULT.
  53. //
  54. // domainName - the name of the domain for which a DC should be located.
  55. //
  56. // computerName - string to receive the domain controller name, set to empty
  57. // on error.
  58. HRESULT
  59. GetDcName(const String& domainName, String& computerName);
  60. // Return the drive letter of the first NTFS 5 drive on the system (as "X:\"),
  61. // or empty if no such drive can be found.
  62. String
  63. GetFirstNtfs5HardDrive();
  64. // Return the DNS domain name of the forest root domain for the forest that
  65. // contains the given domain. Return empty string if that name can't be
  66. // determined.
  67. //
  68. // domain - in, netbios or DNS domain name of a domain in a forest.
  69. //
  70. // hr - in/out, if the caller is curious about the failure code, he can
  71. // retrieve it by passing a non-null pointer here.
  72. String
  73. GetForestName(const String& domain, HRESULT* hr = 0);
  74. // Return the DNS name of the domain that is the parent domain of the given
  75. // domain, or return the empty string if the domain is not a child domain
  76. // (i.e. is a tree root domain).
  77. //
  78. // childDomainDNSName - DNS name of the candidate child domain. It is assumed
  79. // that this domain exits.
  80. //
  81. // bindWithCredentials - true: discover the parent domain by using the the
  82. // credentials information collected on the CredentialsPage. false: use the
  83. // current logged-on user's credentials.
  84. String
  85. GetParentDomainDnsName(
  86. const String& childDomainDNSName,
  87. bool bindWithCredentials);
  88. bool
  89. IsChildDomain(bool bindWithCredentials);
  90. bool
  91. IsRootDomain(bool bindWithCredentials);
  92. bool
  93. IsForestRootDomain();
  94. String
  95. MassageUserName(const String& domainName, const String& userName);
  96. HRESULT
  97. ReadDomains(StringList& domains);
  98. // Sets the font of a given control in a dialog.
  99. //
  100. // parentDialog - Dialog containing the control.
  101. //
  102. // controlID - Res ID of the control for which the font will be
  103. // changed.
  104. //
  105. // font - handle to the new font for the control.
  106. void
  107. SetControlFont(HWND parentDialog, int controlID, HFONT font);
  108. // Sets the font of a control to a large point bold font as per Wizard '97
  109. // spec.
  110. //
  111. // dialog - handle to the dialog that is the parent of the control
  112. //
  113. // bigBoldResID - resource id of the control to change
  114. void
  115. SetLargeFont(HWND dialog, int bigBoldResID);
  116. void
  117. ShowTroubleshooter(HWND parent, int topicResID);
  118. // Validates a dns domain name for proper syntax and length. If validation
  119. // fails, presents appropriate error messages to the user, and sets the input
  120. // focus to a given control. Syntactically valid but non-RFC compliant dns
  121. // names cause a warning message to be presented (but validation does not
  122. // fail). Returns true if the validation succeed, false if not.
  123. //
  124. // dialog - handle to the dialog containing the edit box that: contains the
  125. // name to be validated and receives focus if the validation fails.
  126. //
  127. // domainName - the domain name to validate. If the empty string, then the
  128. // name is taken from the edit control identified by editResID.
  129. //
  130. // editResID - the resource id of the edit control containing the domain name
  131. // to be validated (if the domainName parameter is empty), also receives input
  132. // focus if validation fails.
  133. //
  134. // warnOnNonRFC - issue a non-fatal warning if the name is not RFC compliant.
  135. //
  136. // isNonRFC - optional pointer to bool to be set to true if the name is
  137. // not a RFC-compliant name.
  138. bool
  139. ValidateDomainDnsNameSyntax(
  140. HWND dialog,
  141. const String& domainName,
  142. int editResID,
  143. bool warnOnNonRFC,
  144. bool* isNonRFC = 0);
  145. // Overloads ValidateDomainDnsNameSyntax such that the domain name to be
  146. // validated is taken from the edit control specified by editResID.
  147. bool
  148. ValidateDomainDnsNameSyntax(
  149. HWND dialog,
  150. int editResID,
  151. bool warnOnNonRFC,
  152. bool* isNonRFC = 0);
  153. bool
  154. ValidateDcInstallPath(
  155. const String& path,
  156. HWND parent,
  157. int editResID,
  158. bool requiresNTFS5 = false);
  159. bool
  160. ValidateChildDomainLeafNameLabel(HWND dialog, int editResID, bool parentIsNonRFC);
  161. bool
  162. ValidateSiteName(HWND dialog, int editResID);
  163. // Determine if the domain name provided refers to an existing DS domain.
  164. // Return true if it does, false if not (or if it does not refer to the domain
  165. // the user expected).
  166. //
  167. // dialog - handle to the dialog containing the edit box that: contains the
  168. // name to be validated and receives focus if the validation fails.
  169. //
  170. // domainName - the domain name to validate. If the empty string, then the
  171. // name is taken from the edit control identified by editResID.
  172. //
  173. // editResID - the resource id of the edit control containing the domain name
  174. // to be validated (if the domainName parameter is empty), also receives input
  175. // focus if validation fails.
  176. //
  177. // domainDNSName - if domainName is a netbios domain name, and it refers to a
  178. // DS domain, then this parameter receives the DNS domain name of the domain.
  179. // In this case, the user is prompted to confirm whether or not he intended to
  180. // refer to the domain (because a netbios name is also a legal DNS name). If
  181. // the user indicates yes, that was his intention, then validation succeeds
  182. // and the caller should use the value returned through this parameter as the
  183. // DNS domain name. If the answer is no, validation fails, and this parameter
  184. // is empty. If domainName does not refer to a DS domain, validation fails,
  185. // and this parameter is empty.
  186. bool
  187. ValidateDomainExists(
  188. HWND dialog,
  189. const String& domainName,
  190. int editResID,
  191. String& domainDNSName);
  192. // Overloads ValidateDomainExists such that the domain name to be
  193. // validated is taken from the edit control specified by editResID.
  194. bool
  195. ValidateDomainExists(HWND dialog, int editResID, String& domainDNSName);
  196. bool
  197. ValidateDomainDoesNotExist(
  198. HWND dialog,
  199. const String& domainName,
  200. int editResID);
  201. bool
  202. ValidateDomainDoesNotExist(
  203. HWND dialog,
  204. int editResID);