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.

209 lines
3.6 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: winutil.h
  3. *
  4. * Copyright (c) 1991, Microsoft Corporation
  5. *
  6. * Define windows utility functions
  7. *
  8. * History:
  9. * 12-09-91 Davidc Created.
  10. \***************************************************************************/
  11. //
  12. // Exported function prototypes
  13. //
  14. HWND
  15. CreateAniOnControl(
  16. HWND hDlg,
  17. DWORD ControlId,
  18. DWORD AniId);
  19. VOID
  20. SetupSystemMenu(
  21. HWND hwnd
  22. );
  23. VOID
  24. CentreWindow(
  25. HWND hwnd
  26. );
  27. BOOL
  28. SetPasswordFocus(
  29. HWND hDlg
  30. );
  31. VOID
  32. SetupCursor(
  33. BOOL fWait
  34. );
  35. BOOL
  36. FormatTime(
  37. IN PTIME Time,
  38. OUT PWCHAR Buffer,
  39. IN ULONG BufferLength,
  40. IN USHORT Flags
  41. );
  42. //
  43. // Define flags used by FormatTime routine
  44. //
  45. #define FT_TIME 1
  46. #define FT_DATE 2
  47. #define FT_LTR 4
  48. #define FT_RTL 8
  49. BOOL
  50. DuplicateUnicodeString(
  51. PUNICODE_STRING OutString,
  52. PUNICODE_STRING InString
  53. );
  54. LPTSTR
  55. UnicodeStringToString(
  56. PUNICODE_STRING UnicodeString
  57. );
  58. BOOL
  59. StringToUnicodeString(
  60. PUNICODE_STRING UnicodeString,
  61. LPTSTR String
  62. );
  63. BOOL
  64. OpenIniFileUserMapping(
  65. PGLOBALS pGlobals
  66. );
  67. VOID
  68. CloseIniFileUserMapping(
  69. PGLOBALS pGlobals
  70. );
  71. LPTSTR
  72. AllocAndGetDlgItemText(
  73. HWND hDlg,
  74. int iItem
  75. );
  76. BOOL
  77. ReadWinlogonBoolValue (
  78. LPTSTR lpValueName,
  79. BOOL bDefault);
  80. BOOL
  81. HandleComboBoxOK(
  82. HWND hDlg,
  83. int ComboBoxId
  84. );
  85. LPTSTR
  86. AllocAndGetPrivateProfileString(
  87. LPCTSTR lpAppName,
  88. LPCTSTR lpKeyName,
  89. LPCTSTR lpDefault,
  90. LPCTSTR lpFileName
  91. );
  92. #define AllocAndGetProfileString(App, Key, Def) \
  93. AllocAndGetPrivateProfileString(App, Key, Def, NULL)
  94. BOOL
  95. WritePrivateProfileInt(
  96. LPCTSTR lpAppName,
  97. LPCTSTR lpKeyName,
  98. UINT Value,
  99. LPCTSTR lpFileName
  100. );
  101. #define WriteProfileInt(App, Key, Value) \
  102. WritePrivateProfileInt(App, Key, Value, NULL)
  103. LPTSTR
  104. AllocAndExpandEnvironmentStrings(
  105. LPCTSTR lpszSrc
  106. );
  107. LPTSTR
  108. AllocAndRegEnumKey(
  109. HKEY hKey,
  110. DWORD iSubKey
  111. );
  112. LPTSTR
  113. AllocAndRegQueryValueEx(
  114. HKEY hKey,
  115. LPTSTR lpValueName,
  116. LPDWORD lpReserved,
  117. LPDWORD lpType
  118. );
  119. LPWSTR
  120. EncodeMultiSzW(
  121. IN LPWSTR MultiSz
  122. );
  123. //
  124. // Memory macros
  125. //
  126. #define Alloc(c) ((PVOID)LocalAlloc(LPTR, c))
  127. #define ReAlloc(p, c) ((PVOID)LocalReAlloc(p, c, LPTR | LMEM_MOVEABLE))
  128. #define Free(p) ((VOID)LocalFree(p))
  129. //
  130. // Define a winlogon debug print routine
  131. //
  132. #define WLPrint(s) KdPrint(("WINLOGON: ")); \
  133. KdPrint(s); \
  134. KdPrint(("\n"));
  135. INT_PTR TimeoutMessageBox(
  136. HWND hwnd,
  137. PGLOBALS pGlobals,
  138. UINT IdText,
  139. UINT IdCaption,
  140. UINT wType,
  141. TIMEOUT Timeout);
  142. INT_PTR TimeoutMessageBoxlpstr(
  143. HWND hwnd,
  144. PGLOBALS pGlobals,
  145. LPTSTR Text,
  146. LPTSTR Caption,
  147. UINT wType,
  148. TIMEOUT Timeout);
  149. #define TIMEOUT_VALUE_MASK (0x0fffffff)
  150. #define TIMEOUT_NOTIFY_MASK (0x10000000)
  151. #define TIMEOUT_VALUE(t) (t & TIMEOUT_VALUE_MASK)
  152. #define TIMEOUT_NOTIFY(t) (t & TIMEOUT_NOTIFY_MASK)
  153. #define TIMEOUT_SS_NOTIFY (TIMEOUT_NOTIFY_MASK)
  154. #define TIMEOUT_CURRENT (TIMEOUT_VALUE_MASK) // Use existing timeout
  155. #define TIMEOUT_NONE (0) // Disable input timeout
  156. PWSTR
  157. DupString(PWSTR pszString);
  158. PWSTR
  159. DupUnicodeString(PUNICODE_STRING pString);
  160. // Utility function used by both logon and unlock code to enable or
  161. // disable the domain combo box based on whether a UPN user name is
  162. // typed into the username edit box
  163. void EnableDomainForUPN(HWND hwndUsername, HWND hwndDomain);
  164. BOOL ForceNoDomainUI();