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.

229 lines
3.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1995.
  5. //
  6. // File: util.hxx
  7. //
  8. // Contents: Misc helper functions
  9. //
  10. // History: 5-Apr-95 BruceFo Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __UTIL_HXX__
  14. #define __UTIL_HXX__
  15. #include "shares.h"
  16. VOID
  17. MyFormatMessageText(
  18. IN HRESULT dwMsgId,
  19. IN PWSTR pszBuffer,
  20. IN DWORD dwBufferSize,
  21. IN va_list * parglist
  22. );
  23. VOID
  24. MyFormatMessage(
  25. IN HRESULT dwMsgId,
  26. IN PWSTR pszBuffer,
  27. IN DWORD dwBufferSize,
  28. ...
  29. );
  30. DWORD
  31. MyCommonDialog(
  32. IN HWND hwnd,
  33. IN HRESULT dwMsgCode,
  34. IN PWSTR pszCaption,
  35. IN DWORD dwFlags,
  36. IN va_list arglist
  37. );
  38. DWORD
  39. MyConfirmationDialog(
  40. IN HWND hwnd,
  41. IN HRESULT dwMsgCode,
  42. IN DWORD dwFlags,
  43. ...
  44. );
  45. VOID
  46. MyErrorDialog(
  47. IN HWND hwnd,
  48. IN HRESULT dwErrorCode,
  49. ...
  50. );
  51. PWSTR
  52. NewDup(
  53. IN const WCHAR* psz
  54. );
  55. PWSTR
  56. GetResourceString(
  57. IN DWORD dwId
  58. );
  59. PSECURITY_DESCRIPTOR
  60. CopySecurityDescriptor(
  61. IN PSECURITY_DESCRIPTOR pSecDesc
  62. );
  63. VOID
  64. DisplayError(
  65. IN HWND hwnd,
  66. IN HRESULT dwErrorCode,
  67. IN NET_API_STATUS err,
  68. IN PWSTR pszShare
  69. );
  70. VOID
  71. DisplayLanmanError(
  72. IN HWND hwnd,
  73. IN HRESULT dwErrorCode,
  74. IN NET_API_STATUS err,
  75. IN PWSTR pszShare
  76. );
  77. BOOL
  78. IsValidShareName(
  79. IN PCWSTR pszShareName,
  80. OUT HRESULT* uId
  81. );
  82. VOID
  83. SetErrorFocus(
  84. IN HWND hwnd,
  85. IN UINT idCtrl
  86. );
  87. DWORD
  88. ConfirmReplaceShare(
  89. IN HWND hwnd,
  90. IN PCWSTR pszShareName,
  91. IN PCWSTR pszOldPath,
  92. IN PCWSTR pszNewPath
  93. );
  94. BOOL
  95. IsWorkstationProduct(
  96. VOID
  97. );
  98. BOOL
  99. DriveLetterShare(
  100. PWSTR pszShareName
  101. );
  102. #if DBG == 1
  103. VOID
  104. DumpNetEnum(
  105. IN LPVOID pBufShares,
  106. IN ULONG entriesRead
  107. );
  108. #endif // DBG == 1
  109. struct SHARE_PROPSHEETPAGE
  110. {
  111. PROPSHEETPAGE psp;
  112. PWSTR pszMachine;
  113. PWSTR pszShareName;
  114. };
  115. HRESULT
  116. ShareDoProperties(
  117. IN IUnknown* punk,
  118. IN PWSTR pszMachine,
  119. IN PWSTR pszShareName
  120. );
  121. HRESULT
  122. ShareDoDelete(
  123. IN HWND hwndOwner,
  124. IN PWSTR pszMachine,
  125. IN PWSTR pszShareName
  126. );
  127. HRESULT
  128. ShareDoNew(
  129. IN IUnknown* punk,
  130. IN PWSTR pszMachine
  131. );
  132. #ifdef WIZARDS
  133. HRESULT
  134. ShareDoSpecial(
  135. IN HWND hwndOwner,
  136. IN PWSTR pszMachine,
  137. IN BYTE bType
  138. );
  139. #endif // WIZARDS
  140. VOID FSSetStatusText(HWND hwndOwner, LPTSTR* ppszText, int iStart, int iEnd);
  141. BOOL
  142. IsLevelOk(
  143. IN PWSTR pszMachine,
  144. IN DWORD level
  145. );
  146. VOID
  147. SetDialogIconBig(
  148. IN HWND hwnd,
  149. WORD idIcon
  150. );
  151. VOID
  152. SetDialogIconSmall(
  153. IN HWND hwnd,
  154. WORD idIcon
  155. );
  156. HRESULT
  157. STRRETLoadString(
  158. UINT ids,
  159. STRRET* pstr
  160. );
  161. HRESULT
  162. STRRETCopy(
  163. LPTSTR pszString,
  164. STRRET* pstr
  165. );
  166. VOID
  167. FillSpecialID(
  168. LPIDSHARE pids,
  169. BYTE bFlags, // SHID_SHARE_*
  170. UINT idsName
  171. );
  172. VOID
  173. FillID1(
  174. LPIDSHARE pids,
  175. LPSHARE_INFO_1 pInfo
  176. );
  177. VOID
  178. FillID2(
  179. LPIDSHARE pids,
  180. LPSHARE_INFO_2 pInfo
  181. );
  182. VOID
  183. StrNCopy(
  184. OUT LPWSTR pszTarget,
  185. IN LPCWSTR pszSource,
  186. IN DWORD cchTarget
  187. );
  188. VOID
  189. TrimLeadingAndTrailingSpaces(
  190. IN OUT PWSTR psz
  191. );
  192. #endif // __UTIL_HXX__