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.

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