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.

5413 lines
237 KiB

  1. ;begin_both
  2. /*****************************************************************************\
  3. * *
  4. * shlwapi.h - Interface for the Windows light-weight utility APIs *
  5. * *
  6. * Version 1.0 *
  7. * *
  8. * Copyright (c) Microsoft Corporation. All rights reserved. *
  9. * *
  10. \*****************************************************************************/
  11. ;end_both
  12. #ifndef _INC_SHLWAPI
  13. #define _INC_SHLWAPI
  14. #ifndef _INC_SHLWAPIP ;internal
  15. #define _INC_SHLWAPIP ;internal
  16. ;begin_both
  17. #ifndef NOSHLWAPI
  18. #include <objbase.h>
  19. #include <shtypes.h>
  20. ;end_both
  21. #ifndef _WINRESRC_
  22. #ifndef _WIN32_IE
  23. #define _WIN32_IE 0x0501
  24. #else
  25. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  26. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  27. #endif
  28. #endif
  29. #endif
  30. #ifdef UNIX
  31. typedef interface IInternetSecurityMgrSite IInternetSecurityMgrSite;
  32. typedef interface IInternetSecurityManager IInternetSecurityManager;
  33. typedef interface IInternetHostSecurityManager IInternetHostSecurityManager;
  34. #endif
  35. //
  36. // Define API decoration for direct importing of DLL references.
  37. //
  38. #ifndef WINSHLWAPI
  39. #if !defined(_SHLWAPI_)
  40. #define LWSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  41. #define LWSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  42. #define LWSTDAPIV EXTERN_C DECLSPEC_IMPORT HRESULT STDAPIVCALLTYPE
  43. #define LWSTDAPIV_(type) EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE
  44. #else
  45. #define LWSTDAPI STDAPI
  46. #define LWSTDAPI_(type) STDAPI_(type)
  47. #define LWSTDAPIV STDAPIV
  48. #define LWSTDAPIV_(type) STDAPIV_(type)
  49. #endif
  50. #endif // WINSHLWAPI
  51. ;begin_both
  52. #ifdef _WIN32
  53. #include <pshpack8.h>
  54. #endif
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. //
  59. // Users of this header may define any number of these constants to avoid
  60. // the definitions of each functional group.
  61. //
  62. // NO_SHLWAPI_STRFCNS String functions
  63. // NO_SHLWAPI_PATH Path functions
  64. // NO_SHLWAPI_REG Registry functions
  65. // NO_SHLWAPI_UALSTR Unaligned string functions ;internal
  66. // NO_SHLWAPI_STREAM Stream functions
  67. // NO_SHLWAPI_HTTP HTTP helper routines ;internal
  68. // NO_SHLWAPI_INTERNAL Other random internal things ;internal
  69. // NO_SHLWAPI_GDI GDI helper functions
  70. // NO_SHLWAPI_UNITHUNK Unicode wrapper functions ;internal
  71. // NO_SHLWAPI_TPS Thread Pool Services ;internal
  72. // NO_SHLWAPI_MLUI Multi Language UI functions ;internal
  73. #ifndef NO_SHLWAPI_STRFCNS
  74. //
  75. //=============== String Routines ===================================
  76. //
  77. ;end_both
  78. LWSTDAPI_(LPSTR) StrChrA(LPCSTR lpStart, WORD wMatch);
  79. LWSTDAPI_(LPWSTR) StrChrW(LPCWSTR lpStart, WCHAR wMatch);
  80. LWSTDAPI_(LPSTR) StrChrIA(LPCSTR lpStart, WORD wMatch);
  81. LWSTDAPI_(LPWSTR) StrChrIW(LPCWSTR lpStart, WCHAR wMatch);
  82. LWSTDAPI_(int) StrCmpNA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  83. LWSTDAPI_(int) StrCmpNW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  84. LWSTDAPI_(int) StrCmpNIA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  85. LWSTDAPI_(int) StrCmpNIW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  86. LWSTDAPI_(int) StrCSpnA(LPCSTR lpStr, LPCSTR lpSet);
  87. LWSTDAPI_(int) StrCSpnW(LPCWSTR lpStr, LPCWSTR lpSet);
  88. LWSTDAPI_(int) StrCSpnIA(LPCSTR lpStr, LPCSTR lpSet);
  89. LWSTDAPI_(int) StrCSpnIW(LPCWSTR lpStr, LPCWSTR lpSet);
  90. LWSTDAPI_(LPSTR) StrDupA(LPCSTR lpSrch);
  91. LWSTDAPI_(LPWSTR) StrDupW(LPCWSTR lpSrch);
  92. LWSTDAPI_(LPSTR) StrFormatByteSizeA(DWORD dw, LPSTR szBuf, UINT uiBufSize);
  93. LWSTDAPI_(LPSTR) StrFormatByteSize64A(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
  94. LWSTDAPI_(LPWSTR) StrFormatByteSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
  95. LWSTDAPI_(LPWSTR) StrFormatKBSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
  96. LWSTDAPI_(LPSTR) StrFormatKBSizeA(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
  97. LWSTDAPI_(int) StrFromTimeIntervalA(LPSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
  98. LWSTDAPI_(int) StrFromTimeIntervalW(LPWSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
  99. LWSTDAPI_(BOOL) StrIsIntlEqualA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
  100. LWSTDAPI_(BOOL) StrIsIntlEqualW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
  101. LWSTDAPI_(LPSTR) StrNCatA(LPSTR psz1, LPCSTR psz2, int cchMax);
  102. LWSTDAPI_(LPWSTR) StrNCatW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
  103. LWSTDAPI_(LPSTR) StrPBrkA(LPCSTR psz, LPCSTR pszSet);
  104. LWSTDAPI_(LPWSTR) StrPBrkW(LPCWSTR psz, LPCWSTR pszSet);
  105. LWSTDAPI_(LPSTR) StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
  106. LWSTDAPI_(LPWSTR) StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
  107. LWSTDAPI_(LPSTR) StrRChrIA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
  108. LWSTDAPI_(LPWSTR) StrRChrIW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
  109. LWSTDAPI_(LPSTR) StrRStrIA(LPCSTR lpSource, LPCSTR lpLast, LPCSTR lpSrch);
  110. LWSTDAPI_(LPWSTR) StrRStrIW(LPCWSTR lpSource, LPCWSTR lpLast, LPCWSTR lpSrch);
  111. LWSTDAPI_(int) StrSpnA(LPCSTR psz, LPCSTR pszSet);
  112. LWSTDAPI_(int) StrSpnW(LPCWSTR psz, LPCWSTR pszSet);
  113. LWSTDAPI_(LPSTR) StrStrA(LPCSTR lpFirst, LPCSTR lpSrch);
  114. LWSTDAPI_(LPWSTR) StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch);
  115. LWSTDAPI_(LPSTR) StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
  116. LWSTDAPI_(LPWSTR) StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch);
  117. LWSTDAPI_(int) StrToIntA(LPCSTR lpSrc);
  118. LWSTDAPI_(int) StrToIntW(LPCWSTR lpSrc);
  119. LWSTDAPI_(BOOL) StrToIntExA(LPCSTR pszString, DWORD dwFlags, int * piRet);
  120. LWSTDAPI_(BOOL) StrToIntExW(LPCWSTR pszString, DWORD dwFlags, int * piRet);
  121. #if (_WIN32_IE >= 0x0600)
  122. LWSTDAPI_(BOOL) StrToInt64ExA(LPCSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
  123. LWSTDAPI_(BOOL) StrToInt64ExW(LPCWSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
  124. #endif
  125. LWSTDAPI_(BOOL) StrTrimA(LPSTR psz, LPCSTR pszTrimChars);
  126. LWSTDAPI_(BOOL) StrTrimW(LPWSTR psz, LPCWSTR pszTrimChars);
  127. LWSTDAPI_(LPWSTR) StrCatW(LPWSTR psz1, LPCWSTR psz2);
  128. LWSTDAPI_(int) StrCmpW(LPCWSTR psz1, LPCWSTR psz2);
  129. LWSTDAPI_(int) StrCmpIW(LPCWSTR psz1, LPCWSTR psz2);
  130. LWSTDAPI_(LPWSTR) StrCpyW(LPWSTR psz1, LPCWSTR psz2);
  131. LWSTDAPI_(LPWSTR) StrCpyNW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
  132. ;begin_internal
  133. LWSTDAPI_(LPSTR) StrCpyNXA(LPSTR psz1, LPCSTR psz2, int cchMax);
  134. LWSTDAPI_(LPWSTR) StrCpyNXW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
  135. ;end_internal
  136. LWSTDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize);
  137. LWSTDAPI_(LPSTR) StrCatBuffA(LPSTR pszDest, LPCSTR pszSrc, int cchDestBuffSize);
  138. LWSTDAPI_(BOOL) ChrCmpIA(WORD w1, WORD w2);
  139. LWSTDAPI_(BOOL) ChrCmpIW(WCHAR w1, WCHAR w2);
  140. LWSTDAPI_(int) wvnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, va_list arglist);
  141. LWSTDAPI_(int) wvnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, va_list arglist);
  142. LWSTDAPIV_(int) wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...);
  143. LWSTDAPIV_(int) wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...);
  144. #define StrIntlEqNA( s1, s2, nChar) StrIsIntlEqualA( TRUE, s1, s2, nChar)
  145. #define StrIntlEqNW( s1, s2, nChar) StrIsIntlEqualW( TRUE, s1, s2, nChar)
  146. #define StrIntlEqNIA(s1, s2, nChar) StrIsIntlEqualA(FALSE, s1, s2, nChar)
  147. #define StrIntlEqNIW(s1, s2, nChar) StrIsIntlEqualW(FALSE, s1, s2, nChar)
  148. LWSTDAPI StrRetToStr%(STRRET *pstr, LPCITEMIDLIST pidl, LPTSTR% *ppsz);
  149. LWSTDAPI StrRetToBuf%(STRRET *pstr, LPCITEMIDLIST pidl, LPTSTR% pszBuf, UINT cchBuf);
  150. LWSTDAPI StrRetToBSTR(STRRET *pstr, LPCITEMIDLIST pidl, BSTR *pbstr);
  151. // helper to duplicate a string using the task allocator
  152. LWSTDAPI SHStrDup%(LPCTSTR% psz, WCHAR **ppwsz);
  153. LWSTDAPI_(int) StrCmpLogicalW(LPCWSTR psz1, LPCWSTR psz2);
  154. LWSTDAPI_(DWORD) StrCatChainW(LPWSTR pszDst, DWORD cchDst, DWORD ichAt, LPCWSTR pszSrc);
  155. LWSTDAPI SHLoadIndirectString(LPCWSTR pszSource, LPWSTR pszOutBuf, UINT cchOutBuf, void **ppvReserved);
  156. ;begin_internal
  157. #define ORD_SHLOADREGUISTRINGA 438
  158. #define ORD_SHLOADREGUISTRINGW 439
  159. LWSTDAPI SHLoadRegUIString%(HKEY hkey, LPCTSTR% pszValue, LPTSTR% pszOutBuf, UINT cchOutBuf);
  160. LWSTDAPI_(BOOL) IsCharCntrlW(WCHAR wch);
  161. LWSTDAPI_(BOOL) IsCharDigitW(WCHAR wch);
  162. LWSTDAPI_(BOOL) IsCharXDigitW(WCHAR wch);
  163. LWSTDAPI_(BOOL) IsCharSpaceW(WCHAR wch);
  164. LWSTDAPI_(BOOL) IsCharBlankW(WCHAR wch);
  165. LWSTDAPI_(BOOL) IsCharPunctW(WCHAR wch);
  166. LWSTDAPI_(BOOL) GetStringType3ExW( LPCWSTR, int, LPWORD );
  167. // StrCmp*C* - Compare strings using C runtime collation rules.
  168. // These functions are faster than the StrCmp family of functions
  169. // above and can be used when the character set of the strings is
  170. // known to be limited to seven ASCII character set.
  171. LWSTDAPI_(int) StrCmpNCA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  172. LWSTDAPI_(int) StrCmpNCW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  173. LWSTDAPI_(int) StrCmpNICA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  174. LWSTDAPI_(int) StrCmpNICW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  175. LWSTDAPI_(int) StrCmpCA(LPCSTR lpStr1, LPCSTR lpStr2);
  176. LWSTDAPI_(int) StrCmpCW(LPCWSTR lpStr1, LPCWSTR lpStr2);
  177. LWSTDAPI_(int) StrCmpICA(LPCSTR lpStr1, LPCSTR lpStr2);
  178. LWSTDAPI_(int) StrCmpICW(LPCWSTR lpStr1, LPCWSTR lpStr2);
  179. // This is a true-Unicode version of CompareString. It only supports
  180. // STRING_SORT, however. After better test coverage, it shall replace
  181. // the CompareString Unicode wrapper itself. In the mean time, we only
  182. // call this from the find dialog/OM method of Trident.
  183. LWSTDAPI_(int) CompareStringAltW( LCID lcid, DWORD dwFlags, LPCWSTR lpchA, int cchA, LPCWSTR lpchB, int cchB );
  184. ;end_internal
  185. #ifdef UNICODE
  186. #define StrChr StrChrW
  187. #define StrRChr StrRChrW
  188. #define StrChrI StrChrIW
  189. #define StrRChrI StrRChrIW
  190. #define StrCmpN StrCmpNW
  191. #define StrCmpNI StrCmpNIW
  192. #define StrStr StrStrW
  193. #define StrStrI StrStrIW
  194. #define StrDup StrDupW
  195. #define StrRStrI StrRStrIW
  196. #define StrCSpn StrCSpnW
  197. #define StrCSpnI StrCSpnIW
  198. #define StrSpn StrSpnW
  199. #define StrToInt StrToIntW
  200. #define StrPBrk StrPBrkW
  201. #define StrToIntEx StrToIntExW
  202. #if (_WIN32_IE >= 0x0600)
  203. #define StrToInt64Ex StrToInt64ExW
  204. #endif
  205. #define StrFromTimeInterval StrFromTimeIntervalW
  206. #define StrIntlEqN StrIntlEqNW
  207. #define StrIntlEqNI StrIntlEqNIW
  208. #define StrFormatByteSize StrFormatByteSizeW
  209. #define StrFormatByteSize64 StrFormatByteSizeW
  210. #define StrFormatKBSize StrFormatKBSizeW
  211. #define StrNCat StrNCatW
  212. #define StrTrim StrTrimW
  213. #define StrCatBuff StrCatBuffW
  214. #define ChrCmpI ChrCmpIW
  215. #define wvnsprintf wvnsprintfW
  216. #define wnsprintf wnsprintfW
  217. #define StrIsIntlEqual StrIsIntlEqualW
  218. ;begin_internal
  219. //
  220. // Macros for IsCharAlpha, IsCharAlphaNumeric, IsCharLower, IsCharUpper
  221. // are in winuser.h
  222. //
  223. //
  224. #define IsCharCntrl IsCharCntrlW
  225. #define IsCharDigit IsCharDigitW
  226. #define IsCharXDigit IsCharXDigitW
  227. #define IsCharSpace IsCharSpaceW
  228. #define IsCharBlank IsCharBlankW
  229. #define IsCharPunct IsCharPunctW
  230. #define GetStringType3Ex GetStringType3ExW
  231. ;end_internal
  232. #else
  233. #define StrChr StrChrA
  234. #define StrRChr StrRChrA
  235. #define StrChrI StrChrIA
  236. #define StrRChrI StrRChrIA
  237. #define StrCmpN StrCmpNA
  238. #define StrCmpNI StrCmpNIA
  239. #define StrStr StrStrA
  240. #define StrStrI StrStrIA
  241. #define StrDup StrDupA
  242. #define StrRStrI StrRStrIA
  243. #define StrCSpn StrCSpnA
  244. #define StrCSpnI StrCSpnIA
  245. #define StrSpn StrSpnA
  246. #define StrToInt StrToIntA
  247. #define StrPBrk StrPBrkA
  248. #define StrToIntEx StrToIntExA
  249. #if (_WIN32_IE >= 0x0600)
  250. #define StrToInt64Ex StrToInt64ExA
  251. #endif
  252. #define StrFromTimeInterval StrFromTimeIntervalA
  253. #define StrIntlEqN StrIntlEqNA
  254. #define StrIntlEqNI StrIntlEqNIA
  255. #define StrFormatByteSize StrFormatByteSizeA
  256. #define StrFormatByteSize64 StrFormatByteSize64A
  257. #define StrFormatKBSize StrFormatKBSizeA
  258. #define StrNCat StrNCatA
  259. #define StrTrim StrTrimA
  260. #define StrCatBuff StrCatBuffA
  261. #define ChrCmpI ChrCmpIA
  262. #define wvnsprintf wvnsprintfA
  263. #define wnsprintf wnsprintfA
  264. #define StrIsIntlEqual StrIsIntlEqualA
  265. #endif
  266. ;begin_internal
  267. #ifdef UNICODE
  268. #define StrCmpNC StrCmpNCW
  269. #define StrCmpNIC StrCmpNICW
  270. #define StrCmpC StrCmpCW
  271. #define StrCmpIC StrCmpICW
  272. #define StrCpyNX StrCpyNXW
  273. #else
  274. #define StrCmpNC StrCmpNCA
  275. #define StrCmpNIC StrCmpNICA
  276. #define StrCmpC StrCmpCA
  277. #define StrCmpIC StrCmpICA
  278. #define StrCpyNX StrCpyNXA
  279. #endif
  280. ;end_internal
  281. // Backward compatible to NT's non-standard naming (strictly
  282. // for comctl32)
  283. //
  284. LWSTDAPI_(BOOL) IntlStrEqWorkerA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
  285. LWSTDAPI_(BOOL) IntlStrEqWorkerW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
  286. #define IntlStrEqNA( s1, s2, nChar) IntlStrEqWorkerA( TRUE, s1, s2, nChar)
  287. #define IntlStrEqNW( s1, s2, nChar) IntlStrEqWorkerW( TRUE, s1, s2, nChar)
  288. #define IntlStrEqNIA(s1, s2, nChar) IntlStrEqWorkerA(FALSE, s1, s2, nChar)
  289. #define IntlStrEqNIW(s1, s2, nChar) IntlStrEqWorkerW(FALSE, s1, s2, nChar)
  290. #ifdef UNICODE
  291. #define IntlStrEqN IntlStrEqNW
  292. #define IntlStrEqNI IntlStrEqNIW
  293. #else
  294. #define IntlStrEqN IntlStrEqNA
  295. #define IntlStrEqNI IntlStrEqNIA
  296. #endif
  297. #define SZ_CONTENTTYPE_HTMLA "text/html"
  298. #define SZ_CONTENTTYPE_HTMLW L"text/html"
  299. #define SZ_CONTENTTYPE_CDFA "application/x-cdf"
  300. #define SZ_CONTENTTYPE_CDFW L"application/x-cdf"
  301. #ifdef UNICODE
  302. #define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLW
  303. #define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFW
  304. #else
  305. #define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLA
  306. #define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFA
  307. #endif
  308. #define PathIsHTMLFileA(pszPath) PathIsContentTypeA(pszPath, SZ_CONTENTTYPE_HTMLA)
  309. #define PathIsHTMLFileW(pszPath) PathIsContentTypeW(pszPath, SZ_CONTENTTYPE_HTMLW)
  310. // Flags for StrToIntEx
  311. #define STIF_DEFAULT 0x00000000L
  312. #define STIF_SUPPORT_HEX 0x00000001L
  313. #define StrCatA lstrcatA
  314. #define StrCmpA lstrcmpA
  315. #define StrCmpIA lstrcmpiA
  316. #define StrCpyA lstrcpyA
  317. #define StrCpyNA lstrcpynA
  318. #define StrToLong StrToInt
  319. #define StrNCmp StrCmpN
  320. #define StrNCmpI StrCmpNI
  321. #define StrNCpy StrCpyN
  322. #define StrCatN StrNCat
  323. #ifdef UNICODE
  324. #define StrCat StrCatW
  325. #define StrCmp StrCmpW
  326. #define StrCmpI StrCmpIW
  327. #define StrCpy StrCpyW
  328. #define StrCpyN StrCpyNW
  329. #define StrCatBuff StrCatBuffW
  330. #else
  331. #define StrCat lstrcatA
  332. #define StrCmp lstrcmpA
  333. #define StrCmpI lstrcmpiA
  334. #define StrCpy lstrcpyA
  335. #define StrCpyN lstrcpynA
  336. #define StrCatBuff StrCatBuffA
  337. #endif
  338. ;begin_both
  339. #endif // NO_SHLWAPI_STRFCNS
  340. ;end_both
  341. ;begin_both
  342. #ifndef NO_SHLWAPI_PATH
  343. //
  344. //=============== Path Routines ===================================
  345. //
  346. ;end_both
  347. LWSTDAPI_(LPTSTR%) PathAddBackslash%(LPTSTR% pszPath);
  348. LWSTDAPI_(BOOL) PathAddExtension%(LPTSTR% pszPath, LPCTSTR% pszExt);
  349. LWSTDAPI_(BOOL) PathAppendA(LPSTR pszPath, LPCSTR pMore);
  350. LWSTDAPI_(BOOL) PathAppendW(LPWSTR pszPath, LPCWSTR pMore);
  351. LWSTDAPI_(LPTSTR%) PathBuildRoot%(LPTSTR% pszRoot, int iDrive);
  352. LWSTDAPI_(BOOL) PathCanonicalizeA(LPSTR pszBuf, LPCSTR pszPath);
  353. LWSTDAPI_(BOOL) PathCanonicalizeW(LPWSTR pszBuf, LPCWSTR pszPath);
  354. LWSTDAPI_(LPTSTR%) PathCombine%(LPTSTR% pszDest, LPCTSTR% pszDir, LPCTSTR% pszFile);
  355. LWSTDAPI_(BOOL) PathCompactPathA(HDC hDC, LPSTR pszPath, UINT dx);
  356. LWSTDAPI_(BOOL) PathCompactPathW(HDC hDC, LPWSTR pszPath, UINT dx);
  357. LWSTDAPI_(BOOL) PathCompactPathExA(LPSTR pszOut, LPCSTR pszSrc, UINT cchMax, DWORD dwFlags);
  358. LWSTDAPI_(BOOL) PathCompactPathExW(LPWSTR pszOut, LPCWSTR pszSrc, UINT cchMax, DWORD dwFlags);
  359. LWSTDAPI_(int) PathCommonPrefixA(LPCSTR pszFile1, LPCSTR pszFile2, LPSTR achPath);
  360. LWSTDAPI_(int) PathCommonPrefixW(LPCWSTR pszFile1, LPCWSTR pszFile2, LPWSTR achPath);
  361. LWSTDAPI_(BOOL) PathFileExists%(LPCTSTR% pszPath);
  362. LWSTDAPI_(LPTSTR%) PathFindExtension%(LPCTSTR% pszPath);
  363. LWSTDAPI_(LPTSTR%) PathFindFileName%(LPCTSTR% pszPath);
  364. LWSTDAPI_(LPTSTR%) PathFindNextComponent%(LPCTSTR% pszPath);
  365. LWSTDAPI_(BOOL) PathFindOnPathA(LPSTR pszPath, LPCSTR * ppszOtherDirs);
  366. LWSTDAPI_(BOOL) PathFindOnPathW(LPWSTR pszPath, LPCWSTR * ppszOtherDirs);
  367. LWSTDAPI_(LPTSTR%) PathGetArgs%(LPCTSTR% pszPath);
  368. LWSTDAPI_(LPCTSTR%) PathFindSuffixArray%(LPCTSTR% pszPath, const LPCTSTR% *apszSuffix, int iArraySize);
  369. LWSTDAPI_(BOOL) PathIsLFNFileSpec%(LPCTSTR% lpName);
  370. LWSTDAPI_(UINT) PathGetCharTypeA(UCHAR ch);
  371. LWSTDAPI_(UINT) PathGetCharTypeW(WCHAR ch);
  372. // Return flags for PathGetCharType
  373. #define GCT_INVALID 0x0000
  374. #define GCT_LFNCHAR 0x0001
  375. #define GCT_SHORTCHAR 0x0002
  376. #define GCT_WILD 0x0004
  377. #define GCT_SEPARATOR 0x0008
  378. LWSTDAPI_(int) PathGetDriveNumber%(LPCTSTR% pszPath);
  379. LWSTDAPI_(BOOL) PathIsDirectory%(LPCTSTR% pszPath);
  380. LWSTDAPI_(BOOL) PathIsDirectoryEmpty%(LPCTSTR% pszPath);
  381. LWSTDAPI_(BOOL) PathIsFileSpec%(LPCTSTR% pszPath);
  382. LWSTDAPI_(BOOL) PathIsPrefix%(LPCTSTR% pszPrefix, LPCTSTR% pszPath);
  383. LWSTDAPI_(BOOL) PathIsRelative%(LPCTSTR% pszPath);
  384. LWSTDAPI_(BOOL) PathIsRoot%(LPCTSTR% pszPath);
  385. LWSTDAPI_(BOOL) PathIsSameRoot%(LPCTSTR% pszPath1, LPCTSTR% pszPath2);
  386. LWSTDAPI_(BOOL) PathIsUNC%(LPCTSTR% pszPath);
  387. LWSTDAPI_(BOOL) PathIsNetworkPath%(LPCTSTR% pszPath);
  388. LWSTDAPI_(BOOL) PathIsUNCServer%(LPCTSTR% pszPath);
  389. LWSTDAPI_(BOOL) PathIsUNCServerShare%(LPCTSTR% pszPath);
  390. LWSTDAPI_(BOOL) PathIsContentTypeA(LPCSTR pszPath, LPCSTR pszContentType);
  391. LWSTDAPI_(BOOL) PathIsContentTypeW(LPCWSTR pszPath, LPCWSTR pszContentType);
  392. LWSTDAPI_(BOOL) PathIsURL%(LPCTSTR% pszPath);
  393. LWSTDAPI_(BOOL) PathMakePrettyA(LPSTR pszPath);
  394. LWSTDAPI_(BOOL) PathMakePrettyW(LPWSTR pszPath);
  395. LWSTDAPI_(BOOL) PathMatchSpecA(LPCSTR pszFile, LPCSTR pszSpec);
  396. LWSTDAPI_(BOOL) PathMatchSpecW(LPCWSTR pszFile, LPCWSTR pszSpec);
  397. LWSTDAPI_(int) PathParseIconLocationA(LPSTR pszIconFile);
  398. LWSTDAPI_(int) PathParseIconLocationW(LPWSTR pszIconFile);
  399. LWSTDAPI_(void) PathQuoteSpacesA(LPSTR lpsz);
  400. LWSTDAPI_(void) PathQuoteSpacesW(LPWSTR lpsz);
  401. LWSTDAPI_(BOOL) PathRelativePathToA(LPSTR pszPath, LPCSTR pszFrom, DWORD dwAttrFrom, LPCSTR pszTo, DWORD dwAttrTo);
  402. LWSTDAPI_(BOOL) PathRelativePathToW(LPWSTR pszPath, LPCWSTR pszFrom, DWORD dwAttrFrom, LPCWSTR pszTo, DWORD dwAttrTo);
  403. LWSTDAPI_(void) PathRemoveArgsA(LPSTR pszPath);
  404. LWSTDAPI_(void) PathRemoveArgsW(LPWSTR pszPath);
  405. LWSTDAPI_(LPTSTR%) PathRemoveBackslash%(LPTSTR% pszPath);
  406. LWSTDAPI_(void) PathRemoveBlanksA(LPSTR pszPath);
  407. LWSTDAPI_(void) PathRemoveBlanksW(LPWSTR pszPath);
  408. LWSTDAPI_(void) PathRemoveExtensionA(LPSTR pszPath);
  409. LWSTDAPI_(void) PathRemoveExtensionW(LPWSTR pszPath);
  410. LWSTDAPI_(BOOL) PathRemoveFileSpecA(LPSTR pszPath);
  411. LWSTDAPI_(BOOL) PathRemoveFileSpecW(LPWSTR pszPath);
  412. LWSTDAPI_(BOOL) PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt);
  413. LWSTDAPI_(BOOL) PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt);
  414. LWSTDAPI_(BOOL) PathSearchAndQualifyA(LPCSTR pszPath, LPSTR pszBuf, UINT cchBuf);
  415. LWSTDAPI_(BOOL) PathSearchAndQualifyW(LPCWSTR pszPath, LPWSTR pszBuf, UINT cchBuf);
  416. LWSTDAPI_(void) PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath);
  417. LWSTDAPI_(void) PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath);
  418. LWSTDAPI_(LPTSTR%) PathSkipRoot%(LPCTSTR% pszPath);
  419. LWSTDAPI_(void) PathStripPath%(LPTSTR% pszPath);
  420. LWSTDAPI_(BOOL) PathStripToRoot%(LPTSTR% pszPath);
  421. LWSTDAPI_(void) PathUnquoteSpacesA(LPSTR lpsz);
  422. LWSTDAPI_(void) PathUnquoteSpacesW(LPWSTR lpsz);
  423. LWSTDAPI_(BOOL) PathMakeSystemFolder%(LPCTSTR% pszPath);
  424. LWSTDAPI_(BOOL) PathUnmakeSystemFolder%(LPCTSTR% pszPath);
  425. LWSTDAPI_(BOOL) PathIsSystemFolder%(LPCTSTR% pszPath, DWORD dwAttrb);
  426. LWSTDAPI_(void) PathUndecorate%(LPTSTR% pszPath);
  427. LWSTDAPI_(BOOL) PathUnExpandEnvStrings%(LPCTSTR% pszPath, LPTSTR% pszBuf, UINT cchBuf);
  428. ;begin_internal
  429. #if (_WIN32_IE >= 0x0600)
  430. LWSTDAPI SHEvaluateSystemCommandTemplate(PCWSTR pszCmdTemplate, PWSTR *ppszApplication, PWSTR *ppszCommandLine, PWSTR *ppszParameters);
  431. //
  432. // SHEvaluateSystemCommandTemplate()
  433. // * enforces stricter validation before calling CreateProcess(). may also be
  434. // used before calling ShellExecute().
  435. // * should be used when caller wants the deterministic behavior from a command template
  436. // regardless of execution context. it ignores the current process state,
  437. // such as the %PATH%, GetCurrentDirectory(), and parent process directory.
  438. // * should be used when the command is hardcoded.
  439. // * is used by ShellExecute() when handling file associations from HKCR.
  440. // * reduces CreateProcess() commandline exploits
  441. // * is not designed for processing user input, and may generate unexpected failures.
  442. //
  443. // INPUT:
  444. // pszCmdTemplate = command line, this may or may not include parameters.
  445. // if the parameters are substitution parameters then this API
  446. // should be called before parameters have been replaced.
  447. // (check the examples below to see sample supported inputs.)
  448. //
  449. // OUTPUT on return: S_OK
  450. // ppszApplication = verified path to the Application. this should be passed as the lpApplication
  451. // parameter to CreateProcess() or the lpFile parameter to ShellExecute().
  452. // (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
  453. //
  454. // ppszCommandLine = OPTIONAL - use if planning to call CreateProcess().
  455. // resulting command line template. parameters should be replaced based on this template,
  456. // and then passed as the lpCommandLine parameter to CreateProcess().
  457. // it is guaranteed to be of a form that PathGetArgs() will always succeed correctly.
  458. // (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
  459. //
  460. // ppszParameters = OPTIONAL - use if planning to call ShellExecute().
  461. // resulting parameter list template. parameters should be replaced based on this template,
  462. // and then passed as the lpParameters parameter to ShellExecute().
  463. // NOTE: identical to PathGetArgs(*ppszCommandLine).
  464. // (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
  465. //
  466. // OUTPUT on return: FAILED()
  467. // all outputs will be NULL'ed on failure
  468. //
  469. // NOTES: the parsing logic to determine a valid Application path is non-trivial, although
  470. // the extension is not required and if missing will be completed
  471. // in the following standard order: { .PIF, .COM, .EXE, .BAT, .CMD }
  472. //
  473. // Relative Paths are System Paths - if the first token has no path qualifiers
  474. // then the token is first checked to see if a key of the same name has
  475. // been installed under HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths.
  476. // if the key or default value does not exist, it is assumed to be a child
  477. // of the system directories. the following directories will be searched
  478. // in order for the relative token: { CSIDL_SYSTEM, CSIDL_WINDOWS }
  479. //
  480. // Prefer Quoted Paths - if the first token in pszCmdTemplate is quoted and appears
  481. // to be an absolute path then the token is the only possible result.
  482. //
  483. // Limit Forms of Unquoted Paths - if the first token is unquoted and appears
  484. // to be an absolute path, then it is subject to more stringent limitations.
  485. // if the token is a substring of CSIDL_PROGRAM_FILES or does not
  486. // exist on the file system, then SHEvaluateSystemCommandTemplate() will
  487. // attempt to complete using a token delimited by the first space of the
  488. // last valid path segment (usually the file name). if this token also doesnt exist,
  489. // then the next space will be used, etc.
  490. //
  491. // USAGE: used before calling into CreateProcess() or ShellExecute(), callers
  492. // would typically look like the following:
  493. /* #if 0 // SAMPLE CODE
  494. HRESULT MyCreateProcessPriv(PCWSTR pszCmd)
  495. {
  496. PWSTR pszApp;
  497. PWSTR pszCmdLine;
  498. HRESULT hr = SHEvaluateSystemCommandTemplate(pszCmd, &pszApp, &pszCmdLine);
  499. if (SUCCEEDED(hr))
  500. {
  501. // if this was a real template, maybe some kind of wnsprintf() first?
  502. PROCESS_INFORMATION pi;
  503. STARTUPINFO si = {0};
  504. si.cb = sizeof(startup);
  505. si.wShowWindow = SW_SHOWNORMAL;
  506. if (CreateProcess(pszApp, pszCmdLine, NULL, NULL, FALSE,
  507. CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi))
  508. {
  509. // we are good
  510. ASSERT(hr == S_OK);
  511. CloseHandle(pi.hProcess);
  512. CloseHandle(pi.hThread);
  513. }
  514. else
  515. {
  516. hr = HRESULT_FROM_WIN32(GetLastError());
  517. }
  518. CoTaskMemFree(pszApp);
  519. CoTaskMemFree(pszCmdLine);
  520. }
  521. return hr;
  522. }
  523. HRESULT MyShellExec(PCWSTR pszCmd)
  524. {
  525. PWSTR pszApp;
  526. PWSTR pszCmdLine;
  527. HRESULT hr = SHEvaluateSystemCommandTemplate(pszCmd, &pszApp, &pszCmdLine);
  528. if (SUCCEEDED(hr))
  529. {
  530. // if this was a real template, maybe some kind of wnsprintf() first?
  531. SHELLEXECUTEINFOW sei = {
  532. sizeof(sei), // cbSize;
  533. 0, // fMask
  534. NULL, // hwnd
  535. NULL, // lpVerb
  536. pszApp, // lpFile
  537. PathGetArgs(pszCmdLine), // lpParameters
  538. NULL, // lpDirectory
  539. SW_SHOWNORMAL, // nShow
  540. 0, // hInstApp
  541. NULL, // lpIDList
  542. NULL, // lpClass
  543. NULL, // hkeyClass
  544. 0, // dwHotKey
  545. NULL, // hIcon
  546. NULL // hProcess
  547. };
  548. if (ShellExecuteEx(&sei))
  549. {
  550. // we are good
  551. ASSERT(hr == S_OK);
  552. }
  553. else
  554. {
  555. hr = HRESULT_FROM_WIN32(GetLastError());
  556. }
  557. CoTaskMemFree(pszApp);
  558. CoTaskMemFree(pszCmdLine);
  559. }
  560. return hr;
  561. }
  562. #endif // 0 // SAMPLE CODE */
  563. // EXAMPLE: Each example will show an input parameter and the results returned by
  564. // SHEvaluateSystemCommandTemplate(). Also included is the alternate result
  565. // of what CreateProcess() would have created if pszCmdTemplate were
  566. // passed directly as lpCommandLine and lpApplication were NULL.
  567. // (results marked with an asterisk (*) indicate differences.)
  568. //
  569. // Assume for the examples that the following paths and values exist:
  570. //
  571. // SHGetFolderPath() values:
  572. // CSIDL_SYSTEM = C:\windows\system32
  573. // CSIDL_WINDOWS = C:\windows
  574. // CSIDL_PROGRAM_FILES = C:\Program Files
  575. //
  576. // Environment settings
  577. // GetModuleFileName(NULL) = C:\Program Files\Example\sample.exe
  578. // GetCurrentDirectory() = \\server\share\foo
  579. // HKLM\...\App Paths\pbrush.exe = C:\windows\system32\mspaint.exe
  580. // HKLM\...\App Paths\mycl.exe = C:\Program Files\Compilers\mycl.exe
  581. // PATH = c:\windows\system32;C:\windows;c:\;C:\Program Files\Compilers\
  582. //
  583. // Valid Application paths:
  584. // C:\Program Files\Internet Explorer\iexplore.exe
  585. // C:\windows\system32\rundll32.exe
  586. // C:\windows\system32\notepad.exe
  587. // C:\windows\notepad.exe
  588. // C:\Program Files\Example\sample.exe
  589. // C:\Program Files\Compilers\cl.exe
  590. // C:\Other Programs\prog.exe
  591. //
  592. // Suspicious (possibly hostile) Application paths:
  593. // C:\Program.exe
  594. // C:\Program Files\Internet.exe
  595. // C:\Program Files\Example\regedit.bat
  596. // C:\mycl.exe
  597. // \\server\share\foo\rundll32.exe
  598. // \\server\share\foo\myapp.exe
  599. //
  600. //
  601. // Relative Path Example #1
  602. // pszCmdTemplate = notepad.exe %1
  603. // SHEvaluateSystemCommandTemplate() returns: S_OK
  604. // pszApplication = C:\windows\system32\notepad.exe
  605. // pszCommandLine = "notepad.exe" %1
  606. // CreateProcess() would return TRUE
  607. // new process = C:\windows\system32\notepad.exe
  608. //
  609. // Relative Path Example #2
  610. // pszCmdTemplate = rundll32.exe shell32.dll,RunDll
  611. // SHEvaluateSystemCommandTemplate() returns: S_OK
  612. // pszApplication = C:\windows\system32\rundll32.exe
  613. // pszCommandLine = "rundll32.exe" shell32.dll,RunDll
  614. // * CreateProcess() would return TRUE
  615. // new process = \\server\share\foo\rundll32.exe
  616. //
  617. // Relative Path Example #3
  618. // pszCmdTemplate = regedit %1
  619. // SHEvaluateSystemCommandTemplate() returns: S_OK
  620. // pszApplication = C:\windows\system32\regedit.exe
  621. // pszCommandLine = "regedit.exe" %1
  622. // * CreateProcess() would return TRUE
  623. // new process = C:\Program Files\Example\regedit.bat
  624. //
  625. // Relative Path Example #4
  626. // pszCmdTemplate = pbrush "%1"
  627. // SHEvaluateSystemCommandTemplate() returns: S_OK
  628. // pszApplication = C:\windows\system32\mspaint.exe
  629. // pszCommandLine = "mspaint.exe" "%1"
  630. // * CreateProcess() would return FALSE
  631. //
  632. // Relative Path Example #5
  633. // pszCmdTemplate = mycl "%1" "%2"
  634. // SHEvaluateSystemCommandTemplate() returns: S_OK
  635. // pszApplication = C:\Program Files\Compilers\mycl.exe
  636. // pszCommandLine = "mycl.exe" "%1" "%2"
  637. // * CreateProcess() would return TRUE
  638. // new process = C:\mycl.exe
  639. //
  640. // Relative Path Example #6
  641. // pszCmdTemplate = myapp.exe
  642. // SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
  643. // * CreateProcess() would return TRUE
  644. // new process = \\server\share\foo\myapp.exe
  645. //
  646. // Quoted Path Example #1
  647. // pszCmdTemplate = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
  648. // SHEvaluateSystemCommandTemplate() returns: S_OK
  649. // pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
  650. // pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
  651. // CreateProcess() would return TRUE
  652. // new process = C:\Program Files\Internet Explorer\iexplore.exe
  653. //
  654. // Quoted Path Example #2
  655. // pszCmdTemplate = "C:\Program Files\Internet" -url
  656. // SHEvaluateSystemCommandTemplate() returns: S_OK
  657. // pszApplication = C:\Program Files\Internet.exe
  658. // pszCommandLine = "C:\Program Files\Internet.exe" -url
  659. // CreateProcess() would return TRUE
  660. // new process = C:\Program Files\internet.exe
  661. //
  662. // Quoted Path Example #3
  663. // pszCmdTemplate = "C:\Program" -url
  664. // SHEvaluateSystemCommandTemplate() returns: S_OK
  665. // pszApplication = C:\Program.exe
  666. // pszCommandLine = "C:\Program.exe" -url
  667. // CreateProcess() would return TRUE
  668. // new process = C:\Program.exe
  669. //
  670. // Unquoted Example #1
  671. // pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -nohome
  672. // SHEvaluateSystemCommandTemplate() returns: S_OK
  673. // pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
  674. // pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
  675. // * CreateProcess() would return TRUE
  676. // new process = C:\Program.exe
  677. //
  678. // Unquoted Example #2
  679. // pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url fool.htm
  680. // SHEvaluateSystemCommandTemplate() returns: S_OK
  681. // pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
  682. // pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -url fool.htm
  683. // * CreateProcess() would return TRUE
  684. // new process = C:\Program.exe
  685. //
  686. // Unquoted Example #3
  687. // pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url C:\fool.htm
  688. // SHEvaluateSystemCommandTemplate() returns: S_OK
  689. // pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
  690. // pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -url C:\fool.htm
  691. // * CreateProcess() would return TRUE
  692. // new process = C:\Program.exe
  693. //
  694. // Unquoted Example #4
  695. // pszCmdTemplate = C:\Program Files\Internet -url
  696. // SHEvaluateSystemCommandTemplate() returns: S_OK
  697. // pszApplication = C:\Program Files\Internet.exe
  698. // pszCommandLine = "C:\Program Files\Internet.exe" -url
  699. // * CreateProcess() would return TRUE
  700. // new process = C:\Program.exe
  701. //
  702. // Unquoted Example #5
  703. // pszCmdTemplate = C:\Other Programs\prog.exe -go %1 \fool %2
  704. // SHEvaluateSystemCommandTemplate() returns: S_OK
  705. // pszApplication = C:\Other Programs\prog.exe
  706. // pszCommandLine = "C:\Other Programs\prog.exe" %1 \fool %2
  707. // * CreateProcess() would return TRUE
  708. // new process = C:\Other Programs\prog.exe
  709. //
  710. // Unquoted Example #6
  711. // pszCmdTemplate = C:\Other Programs\prog.exe -go "\fool" "%1"
  712. // SHEvaluateSystemCommandTemplate() returns: S_OK
  713. // pszApplication = C:\Other Programs\prog.exe
  714. // pszCommandLine = "C:\Other Programs\prog.exe" -go "\fool" "%1"
  715. // * CreateProcess() would return TRUE
  716. // new process = C:\Other Programs\prog.exe
  717. //
  718. // Unquoted Example #7
  719. // pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url \fool.htm
  720. // SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
  721. // * CreateProcess() would return TRUE
  722. // new process = C:\Program.exe
  723. //
  724. // Unquoted Example #8
  725. // pszCmdTemplate = C:\Program -url
  726. // SHEvaluateSystemCommandTemplate() returns: E_ACCESSDENIED
  727. // * CreateProcess() would return TRUE
  728. // new process = C:\Program.exe
  729. //
  730. // Unquoted Example #9
  731. // pszCmdTemplate = C:\Other Programs\prog.exe -go \fool us
  732. // SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
  733. // * CreateProcess() would return TRUE
  734. // new process = C:\Other Programs\prog.exe
  735. //
  736. // Unquoted Example #10
  737. // pszCmdTemplate = C:\Other Programs\prog.exe -go \fool %1
  738. // SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
  739. // * CreateProcess() would return TRUE
  740. // new process = C:\Other Programs\prog.exe
  741. //
  742. #endif //(_WIN32_IE >= 0x0600)
  743. #if (_WIN32_IE >= 0x0501)
  744. LWSTDAPI_(BOOL) PathUnExpandEnvStringsForUser%(HANDLE hToken, LPCTSTR% pszPath, LPTSTR% pszBuf, UINT cchBuf);
  745. LWSTDAPI_(void) PrettifyFileDescription%(LPTSTR pszDesc%, LPCTSTR% pszCutList);
  746. #endif // (_WIN32_IE >= 0x0501)
  747. #if defined(WINNT) && (_WIN32_IE >= 0x0550)
  748. //====== ACL helpers ==================================================
  749. //
  750. // shell struct to identify user/group for each ACE
  751. //
  752. typedef struct _SHELL_USER_SID
  753. {
  754. SID_IDENTIFIER_AUTHORITY sidAuthority;
  755. DWORD dwUserGroupID;
  756. DWORD dwUserID;
  757. } SHELL_USER_SID, *PSHELL_USER_SID;
  758. //
  759. // common SHELL_USER_SID's
  760. //
  761. // NOTE: you need to link to stocklib.lib to resolve these
  762. //
  763. extern const SHELL_USER_SID susCurrentUser; // the current user
  764. extern const SHELL_USER_SID susSystem; // the "SYSTEM" group
  765. extern const SHELL_USER_SID susAdministrators; // the "Administrators" group
  766. extern const SHELL_USER_SID susPowerUsers; // the "Power Users" group
  767. extern const SHELL_USER_SID susGuests; // the "Guests" group
  768. extern const SHELL_USER_SID susEveryone; // the "Everyone" group
  769. //
  770. // shell struct that is passed to GetShellSecurityDescriptor()
  771. //
  772. typedef struct _SHELL_USER_PERMISSION
  773. {
  774. SHELL_USER_SID susID; // identifies the user for whom you want to grant permissions to
  775. DWORD dwAccessType; // this is either ACCESS_ALLOWED_ACE_TYPE or ACCESS_DENIED_ACE_TYPE
  776. BOOL fInherit; // the permissions inheritable? (eg a directory or reg key and you want new children to inherit this permission)
  777. DWORD dwAccessMask; // access granted (eg FILE_LIST_CONTENTS, KEY_ALL_ACCESS, etc...)
  778. DWORD dwInheritMask; // mask used for inheritance, usually (OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERIT_ONLY_ACE)
  779. DWORD dwInheritAccessMask; // the inheritable access granted (eg GENERIC_ALL)
  780. } SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION;
  781. //
  782. // The GetShellSecurityDescriptor API takes an array of PSHELL_USER_PERMISSION's
  783. // and returns a PSECURITY_DESCRIPTOR based on those permission (an ACL is
  784. // contained in the PSECURITY_DESCRIPTOR).
  785. //
  786. // NOTE: The PSECURITY_DESCRIPTOR returned to the caller must be freed with LocalFree()
  787. // if it is non-null.
  788. //
  789. //
  790. // Parameters:
  791. // apUserPerm - Array of shell_user_permission structs that defines what type
  792. // of access various users are allowed
  793. //
  794. // cUserPerm - count of elements in apUserPerm.
  795. //
  796. // Returns:
  797. // SECURITY_DESCRIPTOR* or NULL if failed.
  798. //
  799. LWSTDAPI_(SECURITY_DESCRIPTOR*) GetShellSecurityDescriptor(PSHELL_USER_PERMISSION* apUserPerm, int cUserPerm);
  800. #endif // defined(WINNT) && (_WIN32_IE >= 0x0550)
  801. ;end_internal
  802. #ifdef UNICODE
  803. #define PathAppend PathAppendW
  804. #define PathCanonicalize PathCanonicalizeW
  805. #define PathCompactPath PathCompactPathW
  806. #define PathCompactPathEx PathCompactPathExW
  807. #define PathCommonPrefix PathCommonPrefixW
  808. #define PathFindOnPath PathFindOnPathW
  809. #define PathGetCharType PathGetCharTypeW
  810. #define PathIsContentType PathIsContentTypeW
  811. #define PathIsHTMLFile PathIsHTMLFileW
  812. #define PathMakePretty PathMakePrettyW
  813. #define PathMatchSpec PathMatchSpecW
  814. #define PathParseIconLocation PathParseIconLocationW
  815. #define PathQuoteSpaces PathQuoteSpacesW
  816. #define PathRelativePathTo PathRelativePathToW
  817. #define PathRemoveArgs PathRemoveArgsW
  818. #define PathRemoveBlanks PathRemoveBlanksW
  819. #define PathRemoveExtension PathRemoveExtensionW
  820. #define PathRemoveFileSpec PathRemoveFileSpecW
  821. #define PathRenameExtension PathRenameExtensionW
  822. #define PathSearchAndQualify PathSearchAndQualifyW
  823. #define PathSetDlgItemPath PathSetDlgItemPathW
  824. #define PathUnquoteSpaces PathUnquoteSpacesW
  825. #else
  826. #define PathAppend PathAppendA
  827. #define PathCanonicalize PathCanonicalizeA
  828. #define PathCompactPath PathCompactPathA
  829. #define PathCompactPathEx PathCompactPathExA
  830. #define PathCommonPrefix PathCommonPrefixA
  831. #define PathFindOnPath PathFindOnPathA
  832. #define PathGetCharType PathGetCharTypeA
  833. #define PathIsContentType PathIsContentTypeA
  834. #define PathIsHTMLFile PathIsHTMLFileA
  835. #define PathMakePretty PathMakePrettyA
  836. #define PathMatchSpec PathMatchSpecA
  837. #define PathParseIconLocation PathParseIconLocationA
  838. #define PathQuoteSpaces PathQuoteSpacesA
  839. #define PathRelativePathTo PathRelativePathToA
  840. #define PathRemoveArgs PathRemoveArgsA
  841. #define PathRemoveBlanks PathRemoveBlanksA
  842. #define PathRemoveExtension PathRemoveExtensionA
  843. #define PathRemoveFileSpec PathRemoveFileSpecA
  844. #define PathRenameExtension PathRenameExtensionA
  845. #define PathSearchAndQualify PathSearchAndQualifyA
  846. #define PathSetDlgItemPath PathSetDlgItemPathA
  847. #define PathUnquoteSpaces PathUnquoteSpacesA
  848. #endif
  849. typedef enum {
  850. URL_SCHEME_INVALID = -1,
  851. URL_SCHEME_UNKNOWN = 0,
  852. URL_SCHEME_FTP,
  853. URL_SCHEME_HTTP,
  854. URL_SCHEME_GOPHER,
  855. URL_SCHEME_MAILTO,
  856. URL_SCHEME_NEWS,
  857. URL_SCHEME_NNTP,
  858. URL_SCHEME_TELNET,
  859. URL_SCHEME_WAIS,
  860. URL_SCHEME_FILE,
  861. URL_SCHEME_MK,
  862. URL_SCHEME_HTTPS,
  863. URL_SCHEME_SHELL,
  864. URL_SCHEME_SNEWS,
  865. URL_SCHEME_LOCAL,
  866. URL_SCHEME_JAVASCRIPT,
  867. URL_SCHEME_VBSCRIPT,
  868. URL_SCHEME_ABOUT,
  869. URL_SCHEME_RES,
  870. URL_SCHEME_MSSHELLROOTED,
  871. URL_SCHEME_MSSHELLIDLIST,
  872. URL_SCHEME_MSHELP,
  873. URL_SCHEME_MAXVALUE
  874. } URL_SCHEME;
  875. typedef enum {
  876. URL_PART_NONE = 0,
  877. URL_PART_SCHEME = 1,
  878. URL_PART_HOSTNAME,
  879. URL_PART_USERNAME,
  880. URL_PART_PASSWORD,
  881. URL_PART_PORT,
  882. URL_PART_QUERY,
  883. } URL_PART;
  884. typedef enum {
  885. URLIS_URL,
  886. URLIS_OPAQUE,
  887. URLIS_NOHISTORY,
  888. URLIS_FILEURL,
  889. URLIS_APPLIABLE,
  890. URLIS_DIRECTORY,
  891. URLIS_HASQUERY,
  892. } URLIS;
  893. #define URL_UNESCAPE 0x10000000
  894. #define URL_ESCAPE_UNSAFE 0x20000000
  895. #define URL_PLUGGABLE_PROTOCOL 0x40000000
  896. #define URL_WININET_COMPATIBILITY 0x80000000
  897. #define URL_DONT_ESCAPE_EXTRA_INFO 0x02000000
  898. #define URL_DONT_UNESCAPE_EXTRA_INFO URL_DONT_ESCAPE_EXTRA_INFO
  899. #define URL_BROWSER_MODE URL_DONT_ESCAPE_EXTRA_INFO
  900. #define URL_ESCAPE_SPACES_ONLY 0x04000000
  901. #define URL_DONT_SIMPLIFY 0x08000000
  902. #define URL_NO_META URL_DONT_SIMPLIFY
  903. #define URL_UNESCAPE_INPLACE 0x00100000
  904. #define URL_CONVERT_IF_DOSPATH 0x00200000
  905. #define URL_UNESCAPE_HIGH_ANSI_ONLY 0x00400000
  906. #define URL_INTERNAL_PATH 0x00800000 // Will escape #'s in paths
  907. #define URL_FILE_USE_PATHURL 0x00010000
  908. #define URL_ESCAPE_PERCENT 0x00001000
  909. #define URL_ESCAPE_SEGMENT_ONLY 0x00002000 // Treat the entire URL param as one URL segment.
  910. #define URL_PARTFLAG_KEEPSCHEME 0x00000001
  911. #define URL_APPLY_DEFAULT 0x00000001
  912. #define URL_APPLY_GUESSSCHEME 0x00000002
  913. #define URL_APPLY_GUESSFILE 0x00000004
  914. #define URL_APPLY_FORCEAPPLY 0x00000008
  915. LWSTDAPI_(int) UrlCompareA(LPCSTR psz1, LPCSTR psz2, BOOL fIgnoreSlash);
  916. LWSTDAPI_(int) UrlCompareW(LPCWSTR psz1, LPCWSTR psz2, BOOL fIgnoreSlash);
  917. LWSTDAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative, LPSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
  918. LWSTDAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, LPWSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
  919. LWSTDAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
  920. LWSTDAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
  921. LWSTDAPI_(BOOL) UrlIsOpaqueA(LPCSTR pszURL);
  922. LWSTDAPI_(BOOL) UrlIsOpaqueW(LPCWSTR pszURL);
  923. LWSTDAPI_(BOOL) UrlIsNoHistoryA(LPCSTR pszURL);
  924. LWSTDAPI_(BOOL) UrlIsNoHistoryW(LPCWSTR pszURL);
  925. #define UrlIsFileUrlA(pszURL) UrlIsA(pszURL, URLIS_FILEURL)
  926. #define UrlIsFileUrlW(pszURL) UrlIsW(pszURL, URLIS_FILEURL)
  927. LWSTDAPI_(BOOL) UrlIsA(LPCSTR pszUrl, URLIS UrlIs);
  928. LWSTDAPI_(BOOL) UrlIsW(LPCWSTR pszUrl, URLIS UrlIs);
  929. LWSTDAPI_(LPCSTR) UrlGetLocationA(LPCSTR psz1);
  930. LWSTDAPI_(LPCWSTR) UrlGetLocationW(LPCWSTR psz1);
  931. LWSTDAPI UrlUnescapeA(LPSTR pszUrl, LPSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
  932. LWSTDAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
  933. LWSTDAPI UrlEscapeA(LPCSTR pszUrl, LPSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
  934. LWSTDAPI UrlEscapeW(LPCWSTR pszUrl, LPWSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
  935. LWSTDAPI UrlCreateFromPathA(LPCSTR pszPath, LPSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
  936. LWSTDAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
  937. LWSTDAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
  938. LWSTDAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
  939. LWSTDAPI UrlHashA(LPCSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
  940. LWSTDAPI UrlHashW(LPCWSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
  941. LWSTDAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
  942. LWSTDAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
  943. LWSTDAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
  944. LWSTDAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
  945. LWSTDAPI HashData(LPBYTE pbData, DWORD cbData, LPBYTE pbHash, DWORD cbHash);
  946. ;begin_internal
  947. LWSTDAPI UrlFixupW(LPCWSTR pszIn, LPWSTR pszOut, DWORD cchOut);
  948. // NTRAID:108139 akabir We need to move the components stuff from wininet.h to shlwapi.
  949. typedef WORD SHINTERNET_PORT;
  950. typedef SHINTERNET_PORT * LPSHINTERNET_PORT;
  951. //
  952. // SHINTERNET_SCHEME - enumerated URL scheme type
  953. //
  954. typedef enum {
  955. SHINTERNET_SCHEME_PARTIAL = -2,
  956. SHINTERNET_SCHEME_UNKNOWN = -1,
  957. SHINTERNET_SCHEME_DEFAULT = 0,
  958. SHINTERNET_SCHEME_FTP,
  959. SHINTERNET_SCHEME_GOPHER,
  960. SHINTERNET_SCHEME_HTTP,
  961. SHINTERNET_SCHEME_HTTPS,
  962. SHINTERNET_SCHEME_FILE,
  963. SHINTERNET_SCHEME_NEWS,
  964. SHINTERNET_SCHEME_MAILTO,
  965. SHINTERNET_SCHEME_SOCKS,
  966. SHINTERNET_SCHEME_JAVASCRIPT,
  967. SHINTERNET_SCHEME_VBSCRIPT,
  968. SHINTERNET_SCHEME_RES,
  969. SHINTERNET_SCHEME_FIRST = SHINTERNET_SCHEME_FTP,
  970. SHINTERNET_SCHEME_LAST = SHINTERNET_SCHEME_RES
  971. } SHINTERNET_SCHEME, * LPSHINTERNET_SCHEME;
  972. //
  973. // SHURL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl()
  974. // and InternetCreateUrl()
  975. //
  976. // For InternetCrackUrl(), if a pointer field and its corresponding length field
  977. // are both 0 then that component is not returned. If the pointer field is NULL
  978. // but the length field is not zero, then both the pointer and length fields are
  979. // returned if both pointer and corresponding length fields are non-zero then
  980. // the pointer field points to a buffer where the component is copied. The
  981. // component may be un-escaped, depending on dwFlags
  982. //
  983. // For InternetCreateUrl(), the pointer fields should be NULL if the component
  984. // is not required. If the corresponding length field is zero then the pointer
  985. // field is the address of a zero-terminated string. If the length field is not
  986. // zero then it is the string length of the corresponding pointer field
  987. //
  988. #pragma warning( disable : 4121 ) // disable alignment warning
  989. typedef struct {
  990. DWORD dwStructSize; // size of this structure. Used in version check
  991. LPTSTR% lpszScheme; // pointer to scheme name
  992. DWORD dwSchemeLength; // length of scheme name
  993. SHINTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  994. LPTSTR% lpszHostName; // pointer to host name
  995. DWORD dwHostNameLength; // length of host name
  996. SHINTERNET_PORT nPort; // converted port number
  997. LPTSTR% lpszUserName; // pointer to user name
  998. DWORD dwUserNameLength; // length of user name
  999. LPTSTR% lpszPassword; // pointer to password
  1000. DWORD dwPasswordLength; // length of password
  1001. LPTSTR% lpszUrlPath; // pointer to URL-path
  1002. DWORD dwUrlPathLength; // length of URL-path
  1003. LPTSTR% lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  1004. DWORD dwExtraInfoLength; // length of extra information
  1005. } SHURL_COMPONENTS%, * LPSHURL_COMPONENTS%;
  1006. BOOL WINAPI UrlCrackW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, LPSHURL_COMPONENTSW lpUrlComponents);
  1007. ;end_internal
  1008. #ifdef UNICODE
  1009. #define UrlCompare UrlCompareW
  1010. #define UrlCombine UrlCombineW
  1011. #define UrlCanonicalize UrlCanonicalizeW
  1012. #define UrlIsOpaque UrlIsOpaqueW
  1013. #define UrlIsFileUrl UrlIsFileUrlW
  1014. #define UrlGetLocation UrlGetLocationW
  1015. #define UrlUnescape UrlUnescapeW
  1016. #define UrlEscape UrlEscapeW
  1017. #define UrlCreateFromPath UrlCreateFromPathW
  1018. #define PathCreateFromUrl PathCreateFromUrlW
  1019. #define UrlHash UrlHashW
  1020. #define UrlGetPart UrlGetPartW
  1021. #define UrlApplyScheme UrlApplySchemeW
  1022. #define UrlIs UrlIsW
  1023. ;begin_internal
  1024. #define UrlFixup UrlFixupW
  1025. ;end_internal
  1026. #else //!UNICODE
  1027. #define UrlCompare UrlCompareA
  1028. #define UrlCombine UrlCombineA
  1029. #define UrlCanonicalize UrlCanonicalizeA
  1030. #define UrlIsOpaque UrlIsOpaqueA
  1031. #define UrlIsFileUrl UrlIsFileUrlA
  1032. #define UrlGetLocation UrlGetLocationA
  1033. #define UrlUnescape UrlUnescapeA
  1034. #define UrlEscape UrlEscapeA
  1035. #define UrlCreateFromPath UrlCreateFromPathA
  1036. #define PathCreateFromUrl PathCreateFromUrlA
  1037. #define UrlHash UrlHashA
  1038. #define UrlGetPart UrlGetPartA
  1039. #define UrlApplyScheme UrlApplySchemeA
  1040. #define UrlIs UrlIsA
  1041. ;begin_internal
  1042. // no UrlFixupA
  1043. ;end_internal
  1044. #endif //UNICODE
  1045. #define UrlEscapeSpaces(pszUrl, pszEscaped, pcchEscaped) UrlCanonicalize(pszUrl, pszEscaped, pcchEscaped, URL_ESCAPE_SPACES_ONLY |URL_DONT_ESCAPE_EXTRA_INFO )
  1046. #define UrlUnescapeInPlace(pszUrl, dwFlags) UrlUnescape(pszUrl, NULL, NULL, dwFlags | URL_UNESCAPE_INPLACE)
  1047. ;begin_internal
  1048. //
  1049. // Internal APIs which we're not yet sure whether to make public
  1050. //
  1051. // Private IHlinkFrame::Navigate flags related to history
  1052. // This navigate should not go in the History ShellFolder
  1053. #define SHHLNF_WRITENOHISTORY 0x08000000
  1054. // This navigate should not automatically select History ShellFolder
  1055. #define SHHLNF_NOAUTOSELECT 0x04000000
  1056. // The order of these flags is important. See the source before
  1057. // changing these.
  1058. #define PFOPEX_NONE 0x00000000
  1059. #define PFOPEX_PIF 0x00000001
  1060. #define PFOPEX_COM 0x00000002
  1061. #define PFOPEX_EXE 0x00000004
  1062. #define PFOPEX_BAT 0x00000008
  1063. #define PFOPEX_LNK 0x00000010
  1064. #define PFOPEX_CMD 0x00000020
  1065. #define PFOPEX_OPTIONAL 0x00000040 // Search only if Extension not present
  1066. #define PFOPEX_DEFAULT (PFOPEX_CMD | PFOPEX_COM | PFOPEX_BAT | PFOPEX_PIF | PFOPEX_EXE | PFOPEX_LNK)
  1067. LWSTDAPI_(BOOL) PathFileExistsDefExt%(LPTSTR% pszPath, UINT uFlags);
  1068. LWSTDAPI_(BOOL) PathFindOnPathEx%(LPTSTR% pszPath, LPCTSTR% * ppszOtherDirs, UINT uFlags);
  1069. LWSTDAPI_(LPCTSTR%) PathSkipLeadingSlashes%(LPCTSTR% pszURL);
  1070. LWSTDAPI_(UINT) SHGetSystemWindowsDirectory%(LPTSTR% lpBuffer, UINT uSize);
  1071. #if (_WIN32_IE >= 0x0501)
  1072. //
  1073. // These are functions that used to be duplicated in shell32, but have
  1074. // be consolidated here. They are exported privately until someone decides
  1075. // we really want to document them.
  1076. //
  1077. LWSTDAPI_(BOOL) PathFileExistsAndAttributes%(LPCTSTR% pszPath, OPTIONAL DWORD* pdwAttributes);
  1078. LWSTDAPI_(BOOL) PathFileExistsDefExtAndAttributes%(LPTSTR% pszPath, UINT uFlags, DWORD *pdwAttribs);
  1079. LWSTDAPI_(void) FixSlashesAndColon%(LPTSTR% pszPath);
  1080. LWSTDAPI_(LPCTSTR%) NextPath%(LPCTSTR% lpPath, LPTSTR% szPath, int cchPath);
  1081. LWSTDAPI_(LPTSTR%) CharUpperNoDBCS%(LPTSTR% psz);
  1082. LWSTDAPI_(LPTSTR%) CharLowerNoDBCS%(LPTSTR% psz);
  1083. //
  1084. // flags for PathIsValidChar()
  1085. //
  1086. #define PIVC_ALLOW_QUESTIONMARK 0x00000001 // treat '?' as valid
  1087. #define PIVC_ALLOW_STAR 0x00000002 // treat '*' as valid
  1088. #define PIVC_ALLOW_DOT 0x00000004 // treat '.' as valid
  1089. #define PIVC_ALLOW_SLASH 0x00000008 // treat '\\' as valid
  1090. #define PIVC_ALLOW_COLON 0x00000010 // treat ':' as valid
  1091. #define PIVC_ALLOW_SEMICOLON 0x00000020 // treat ';' as valid
  1092. #define PIVC_ALLOW_COMMA 0x00000040 // treat ',' as valid
  1093. #define PIVC_ALLOW_SPACE 0x00000080 // treat ' ' as valid
  1094. #define PIVC_ALLOW_NONALPAHABETIC 0x00000100 // treat non-alphabetic exteneded chars as valid
  1095. #define PIVC_ALLOW_QUOTE 0x00000200 // treat '"' as valid
  1096. //
  1097. // standard masks for PathIsValidChar()
  1098. //
  1099. #define PIVC_SFN_NAME (PIVC_ALLOW_DOT | PIVC_ALLOW_NONALPAHABETIC)
  1100. #define PIVC_SFN_FULLPATH (PIVC_SFN_NAME | PIVC_ALLOW_COLON | PIVC_ALLOW_SLASH)
  1101. #define PIVC_LFN_NAME (PIVC_ALLOW_DOT | PIVC_ALLOW_NONALPAHABETIC | PIVC_ALLOW_SEMICOLON | PIVC_ALLOW_COMMA | PIVC_ALLOW_SPACE)
  1102. #define PIVC_LFN_FULLPATH (PIVC_LFN_NAME | PIVC_ALLOW_COLON | PIVC_ALLOW_SLASH)
  1103. #define PIVC_SFN_FILESPEC (PIVC_SFN_FULLPATH | PIVC_ALLOW_STAR | PIVC_ALLOW_QUESTIONMARK)
  1104. #define PIVC_LFN_FILESPEC (PIVC_LFN_FULLPATH | PIVC_ALLOW_STAR | PIVC_ALLOW_QUESTIONMARK)
  1105. LWSTDAPI_(BOOL) PathIsValidCharA(UCHAR ch, DWORD dwFlags);
  1106. LWSTDAPI_(BOOL) PathIsValidCharW(WCHAR ch, DWORD dwFlags);
  1107. #ifdef UNICODE
  1108. #define PathIsValidChar PathIsValidCharW
  1109. #else
  1110. #define PathIsValidChar PathIsValidCharA
  1111. #endif // !UNICODE
  1112. #endif // (_WIN32_IE >= 0x0501)
  1113. // parsed URL information returned by ParseURL()
  1114. //
  1115. // Internet_CrackURL is the correct function for external components
  1116. // to use. URL.DLL calls this function to do some work and the shell
  1117. // uses this function as a leight-weight parsing function as well.
  1118. typedef struct tagPARSEDURL% {
  1119. DWORD cbSize;
  1120. // Pointers into the buffer that was provided to ParseURL
  1121. LPCTSTR% pszProtocol;
  1122. UINT cchProtocol;
  1123. LPCTSTR% pszSuffix;
  1124. UINT cchSuffix;
  1125. UINT nScheme; // One of URL_SCHEME_*
  1126. } PARSEDURL%, * PPARSEDURL%;
  1127. LWSTDAPI ParseURL%(LPCTSTR% pcszURL, PARSEDURL% * ppu);
  1128. ;end_internal
  1129. ;begin_both
  1130. #endif // NO_SHLWAPI_PATH
  1131. ;end_both
  1132. ;begin_both
  1133. #ifndef NO_SHLWAPI_REG
  1134. //
  1135. //=============== Registry Routines ===================================
  1136. //
  1137. ;end_both
  1138. // SHDeleteEmptyKey mimics RegDeleteKey as it behaves on NT.
  1139. // SHDeleteKey mimics RegDeleteKey as it behaves on Win95.
  1140. LWSTDAPI_(DWORD) SHDeleteEmptyKey%(HKEY hkey, LPCTSTR% pszSubKey);
  1141. LWSTDAPI_(DWORD) SHDeleteKey%(HKEY hkey, LPCTSTR% pszSubKey);
  1142. LWSTDAPI_(HKEY) SHRegDuplicateHKey(HKEY hkey);
  1143. ;begin_internal
  1144. // SHDeleteOrphanKey is the old name for SHDeleteEmptyKey.
  1145. // SHDeleteOrphanKey already maps to SHDeleteEmptyKey in the DLL exports.
  1146. LWSTDAPI_(DWORD) SHDeleteOrphanKey%(HKEY hkey, LPCTSTR% pszSubKey);
  1147. ;end_internal
  1148. // These functions open the key, get/set/delete the value, then close
  1149. // the key.
  1150. LWSTDAPI_(DWORD) SHDeleteValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue);
  1151. LWSTDAPI_(DWORD) SHGetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1152. LWSTDAPI_(DWORD) SHSetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
  1153. //
  1154. // SRRF - Shell Registry Routine Flags (for SHRegGetValue)
  1155. //
  1156. typedef DWORD SRRF;
  1157. #define SRRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (other data types will not return ERROR_SUCCESS)
  1158. #define SRRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (other data types will not return ERROR_SUCCESS)
  1159. #define SRRF_RT_REG_EXPAND_SZ 0x00000004 // restrict type to REG_EXPAND_SZ (other data types will not return ERROR_SUCCESS)
  1160. #define SRRF_RT_REG_BINARY 0x00000008 // restrict type to REG_BINARY (other data types will not return ERROR_SUCCESS)
  1161. #define SRRF_RT_REG_DWORD 0x00000010 // restrict type to REG_DWORD (other data types will not return ERROR_SUCCESS)
  1162. #define SRRF_RT_REG_MULTI_SZ 0x00000020 // restrict type to REG_MULTI_SZ (other data types will not return ERROR_SUCCESS)
  1163. #define SRRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (other data types will not return ERROR_SUCCESS)
  1164. #define SRRF_RT_DWORD (SRRF_RT_REG_BINARY | SRRF_RT_REG_DWORD) // restrict type to *32-bit* SRRF_RT_REG_BINARY or SRRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
  1165. #define SRRF_RT_QWORD (SRRF_RT_REG_BINARY | SRRF_RT_REG_QWORD) // restrict type to *64-bit* SRRF_RT_REG_BINARY or SRRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
  1166. #define SRRF_RT_ANY 0x0000ffff // no type restriction
  1167. #define SRRF_RM_ANY 0x00000000 // no mode restriction (default is to allow any mode)
  1168. #define SRRF_RM_NORMAL 0x00010000 // restrict system startup mode to "normal boot" (other startup modes will not return ERROR_SUCCESS)
  1169. #define SRRF_RM_SAFE 0x00020000 // restrict system startup mode to "safe mode" (other startup modes will not return ERROR_SUCCESS)
  1170. #define SRRF_RM_SAFENETWORK 0x00040000 // restrict system startup mode to "safe mode with networking" (other startup modes will not return ERROR_SUCCESS)
  1171. #define SRRF_NOEXPAND 0x10000000 // do not automatically expand environment strings if value is of type REG_EXPAND_SZ
  1172. #define SRRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure
  1173. // Function:
  1174. //
  1175. // SHRegGetValue()
  1176. //
  1177. // Purpose:
  1178. //
  1179. // Gets a registry value. SHRegGetValue() provides the following benefits:
  1180. //
  1181. // - data type checking
  1182. // - boot mode checking
  1183. // - auto-expansion of REG_EXPAND_SZ data
  1184. // - guaranteed NULL termination of REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ data
  1185. //
  1186. ;begin_internal
  1187. // This is the single, one stop shop for all your 'get registry data' needs.
  1188. // If this function doesn't do what you're looking for now, ask yourself if
  1189. // it can be enhanced in a simple way to do it before you go adding yet
  1190. // another API.
  1191. //
  1192. ;end_internal
  1193. // Parameters:
  1194. //
  1195. // hkey - handle to a currently open key.
  1196. //
  1197. // pszSubKey - pointer to a null-terminated string specifying the relative
  1198. // path from hkey to one of its subkeys from which the data is
  1199. // to be retrieved. this will be opened with KEY_READ sam.
  1200. //
  1201. // Note1: pszSubKey can be NULL or "". In either of these two
  1202. // cases, the data is retrieved from the hkey itself.
  1203. // Note2: *** PERF ***
  1204. // If pszSubKey is not NULL or "", the subkey will be
  1205. // automatically be opened and closed by this routine
  1206. // in order to obtain the data. If you are retrieving
  1207. // multiple values from the same subkey, it is better
  1208. // for perf to open the subkey via RegOpenKeyEx() prior
  1209. // to calling this method, and using this opened key as
  1210. // hkey with pszSubKey set to NULL.
  1211. //
  1212. // pszValue - pointer to a null-terminated string specifying the name of
  1213. // the value to query for data
  1214. //
  1215. // Note1: pszValue can be NULL or "". In either of these two
  1216. // cases, the data is retrieved from the unnamed or
  1217. // default value.
  1218. //
  1219. // dwFlags - bitwise or of SRRF_ flags, which cannot be 0: at least one
  1220. // type restriction must be specified (SRRF_RT_...), or if any
  1221. // type is desired then SRRF_RT_ANY can be specified
  1222. //
  1223. // Note1: SRRF_RT_ANY will allow any data type to be returned.
  1224. // Note2: The following two type restrictions have special
  1225. // handling semantics:
  1226. //
  1227. // SRRF_RT_DWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_DWORD
  1228. // SRRF_RT_QWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_QWORD
  1229. //
  1230. // If either of these are specified, with no other type
  1231. // restrictions, then in the prior case the restriction
  1232. // will limit "valid" returned data to either REG_DWORD
  1233. // or 32-bit REG_BINARY data, and in the latter case
  1234. // the restriction will limit "valid" returned data to
  1235. // either REG_QWORD or 64-bit REG_BINARY.
  1236. //
  1237. // pdwType - pointer to a dword which receives a code indicating the
  1238. // type of data stored in the specified value
  1239. //
  1240. // Note1: pdwType can be NULL if no type information is wanted
  1241. // Note2: If pdwType is not NULL, and the SRRF_NOEXPAND flag
  1242. // has not been set, data types of REG_EXPAND_SZ will
  1243. // be returned as REG_SZ since they are automatically
  1244. // expanded in this method.
  1245. //
  1246. // pvData - pointer to a buffer that receives the value's data
  1247. //
  1248. // Note1: pvData can be NULL if the data is not required.
  1249. // pvData is usually NULL if doing either a simple
  1250. // existence test, or if interested in the size only.
  1251. // Note2: *** PERF ***
  1252. // Reference 'perf' note for pcbData.
  1253. //
  1254. // pcbData - when pvData is NULL:
  1255. // optional pointer to a dword that receives a size in bytes
  1256. // which would be sufficient to hold the registry data (note
  1257. // this size is not guaranteed to be exact, merely sufficient)
  1258. // when pvData is not NULL:
  1259. // required pointer to a dword that specifies the size in
  1260. // bytes of the buffer pointed to by the pvData parameter
  1261. // and receives a size in bytes of:
  1262. // a) the number of bytes read into pvData on ERROR_SUCCESS
  1263. // (note this size is guaranteed to be exact)
  1264. // b) the number of bytes which would be sufficient to hold
  1265. // the registry data on ERROR_MORE_DATA -- pvData was of
  1266. // insufficient size (note this size is not guaranteed to
  1267. // be exact, merely sufficient)
  1268. //
  1269. // Note1: pcbData can be NULL only if pvData is NULL.
  1270. // Note2: *** PERF ***
  1271. // The potential for an 'extra' call to the registry to
  1272. // read (or re-read) in the data exists when the data
  1273. // type is REG_EXPAND_SZ and the SRRF_NOEXPAND flag has
  1274. // not been set. The following conditions will result
  1275. // in this 'extra' read operation:
  1276. // i) when pvData is NULL and pcbData is not NULL
  1277. // we must read in the data from the registry
  1278. // anyway in order to obtain the string and perform
  1279. // an expand on it to obtain and return the total
  1280. // required size in pcbData
  1281. // ii) when pvData is not NULL but is of insufficient
  1282. // size we must re-read in the data from the
  1283. // registry in order to obtain the entire string
  1284. // and perform an expand on it to obtain and return
  1285. // the total required size in pcbData
  1286. //
  1287. // Remarks:
  1288. //
  1289. // The key identified by hkey must have been opened with KEY_QUERY_VALUE
  1290. // access. If pszSubKey is not NULL or "", it must be able to be opened
  1291. // with KEY_QUERY_VALUE access in the current calling context.
  1292. //
  1293. // If the data type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then any
  1294. // returned data is guaranteed to take into account proper null termination.
  1295. // For example: if pcbData is not NULL, its returned size will include the
  1296. // bytes for a null terminator if pvData is not NULL, its returned data
  1297. // will be properly null terminated.
  1298. //
  1299. // If the data type is REG_EXPAND_SZ, then unless the SRRF_NOEXPAND flag
  1300. // is set the data will be automatically expanded prior to being returned.
  1301. // For example: if pdwType is not NULL, its returned type will be changed
  1302. // to REG_SZ, if pcbData is not NULL, its returned size will include the
  1303. // bytes for a properly expanded string. if pvData is not NULL, its
  1304. // returned data will be the expanded version of the string.
  1305. //
  1306. // Reference MSDN documentation for RegQueryValueEx() for more information
  1307. // of the behaviour when pdwType, pvData, and/or pcbData are equal to NULL.
  1308. //
  1309. // Return Values:
  1310. //
  1311. // If the function succeeds, the return value is ERROR_SUCCESS and all out
  1312. // parameters requested (pdwType, pvData, pcbData) are valid.
  1313. //
  1314. // If the function fails due to insufficient space in a provided non-NULL
  1315. // pvData, the return value is ERROR_MORE_DATA and only pdwType and pcbData
  1316. // can contain valid data. The content of pvData in this case is undefined.
  1317. //
  1318. // Examples:
  1319. //
  1320. // 1) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data from the (default) value of an open hkey
  1321. //
  1322. // TCHAR szData[128]
  1323. // DWORD cbData = sizeof(pszData)
  1324. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, NULL, SRRF_RT_REG_SZ, NULL, szData, &cbData))
  1325. // {
  1326. // // use sz (successful read)
  1327. // }
  1328. //
  1329. // 2) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data of unknown size from the "MyValue" value of an open hkey
  1330. //
  1331. // DWORD cbData
  1332. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, NULL, &cbData))
  1333. // {
  1334. // TCHAR *pszData = new TCHAR[cbData/sizeof(TCHAR)]
  1335. // if (pszData)
  1336. // {
  1337. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, pszData, &cbData))
  1338. // {
  1339. // // use pszData (successful read)
  1340. // }
  1341. // delete[] pszData
  1342. // }
  1343. // }
  1344. //
  1345. // 3) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey
  1346. //
  1347. // DWORD dwData
  1348. // DWORD cbData = sizeof(dwData)
  1349. // if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_REG_DWORD, NULL, &dwData, &cbData))
  1350. // {
  1351. // // use dwData (successful read)
  1352. // }
  1353. //
  1354. // 4) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey (32-bit binary data also ok)
  1355. //
  1356. // DWORD dwData
  1357. // DWORD cbData = sizeof(dwData)
  1358. // if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_DWORD, NULL, &dwData, &cbData))
  1359. // {
  1360. // // use dwData (successful read)
  1361. // }
  1362. //
  1363. // 5) determine existence of "MyValue" value of an open hkey
  1364. //
  1365. // BOOL bExists = ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_ANY, NULL, NULL, NULL)
  1366. LWSTDAPI_(LONG) SHRegGetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, SRRF dwFlags, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1367. // These functions behave just like RegQueryValueEx(), except if the data
  1368. // type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then the string is
  1369. // guaranteed to be properly null terminated.
  1370. //
  1371. // Additionally, if the data type is REG_EXPAND_SZ these functions will
  1372. // go ahead and expand out the string, and "massage" the returned *pdwType
  1373. // to be REG_SZ.
  1374. LWSTDAPI_(DWORD) SHQueryValueEx%(HKEY hkey, LPCTSTR% pszValue, DWORD *pdwReserved, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1375. // Enumeration functions support.
  1376. LWSTDAPI_(LONG) SHEnumKeyExA(HKEY hkey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName);
  1377. LWSTDAPI_(LONG) SHEnumKeyExW(HKEY hkey, DWORD dwIndex, LPWSTR pszName, LPDWORD pcchName);
  1378. LWSTDAPI_(LONG) SHEnumValueA(HKEY hkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
  1379. LWSTDAPI_(LONG) SHEnumValueW(HKEY hkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
  1380. LWSTDAPI_(LONG) SHQueryInfoKeyA(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
  1381. LWSTDAPI_(LONG) SHQueryInfoKeyW(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
  1382. // recursive key copy
  1383. LWSTDAPI_(DWORD) SHCopyKeyA(HKEY hkeySrc, LPCSTR szSrcSubKey, HKEY hkeyDest, DWORD fReserved);
  1384. LWSTDAPI_(DWORD) SHCopyKeyW(HKEY hkeySrc, LPCWSTR wszSrcSubKey, HKEY hkeyDest, DWORD fReserved);
  1385. // Getting and setting file system paths with environment variables
  1386. LWSTDAPI_(DWORD) SHRegGetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPSTR pszPath, DWORD dwFlags);
  1387. LWSTDAPI_(DWORD) SHRegGetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPWSTR pszPath, DWORD dwFlags);
  1388. LWSTDAPI_(DWORD) SHRegSetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPCSTR pcszPath, DWORD dwFlags);
  1389. LWSTDAPI_(DWORD) SHRegSetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPCWSTR pcszPath, DWORD dwFlags);
  1390. #ifdef UNICODE
  1391. #define SHEnumKeyEx SHEnumKeyExW
  1392. #define SHEnumValue SHEnumValueW
  1393. #define SHQueryInfoKey SHQueryInfoKeyW
  1394. #define SHCopyKey SHCopyKeyW
  1395. #define SHRegGetPath SHRegGetPathW
  1396. #define SHRegSetPath SHRegSetPathW
  1397. #else
  1398. #define SHEnumKeyEx SHEnumKeyExA
  1399. #define SHEnumValue SHEnumValueA
  1400. #define SHQueryInfoKey SHQueryInfoKeyA
  1401. #define SHCopyKey SHCopyKeyA
  1402. #define SHRegGetPath SHRegGetPathA
  1403. #define SHRegSetPath SHRegSetPathA
  1404. #endif
  1405. //////////////////////////////////////////////
  1406. // User Specific Registry Access Functions
  1407. //////////////////////////////////////////////
  1408. //
  1409. // Type definitions.
  1410. //
  1411. typedef enum
  1412. {
  1413. SHREGDEL_DEFAULT = 0x00000000, // Delete's HKCU, or HKLM if HKCU is not found.
  1414. SHREGDEL_HKCU = 0x00000001, // Delete HKCU only
  1415. SHREGDEL_HKLM = 0x00000010, // Delete HKLM only.
  1416. SHREGDEL_BOTH = 0x00000011, // Delete both HKCU and HKLM.
  1417. } SHREGDEL_FLAGS;
  1418. typedef enum
  1419. {
  1420. SHREGENUM_DEFAULT = 0x00000000, // Enumerates HKCU or HKLM if not found.
  1421. SHREGENUM_HKCU = 0x00000001, // Enumerates HKCU only
  1422. SHREGENUM_HKLM = 0x00000010, // Enumerates HKLM only.
  1423. SHREGENUM_BOTH = 0x00000011, // Enumerates both HKCU and HKLM without duplicates.
  1424. // This option is NYI.
  1425. } SHREGENUM_FLAGS;
  1426. #define SHREGSET_HKCU 0x00000001 // Write to HKCU if empty.
  1427. #define SHREGSET_FORCE_HKCU 0x00000002 // Write to HKCU.
  1428. #define SHREGSET_HKLM 0x00000004 // Write to HKLM if empty.
  1429. #define SHREGSET_FORCE_HKLM 0x00000008 // Write to HKLM.
  1430. #define SHREGSET_DEFAULT (SHREGSET_FORCE_HKCU | SHREGSET_HKLM) // Default is SHREGSET_FORCE_HKCU | SHREGSET_HKLM.
  1431. typedef HANDLE HUSKEY; // HUSKEY is a Handle to a User Specific KEY.
  1432. typedef HUSKEY *PHUSKEY;
  1433. LWSTDAPI_(LONG) SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
  1434. LWSTDAPI_(LONG) SHRegCreateUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
  1435. LWSTDAPI_(LONG) SHRegOpenUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
  1436. LWSTDAPI_(LONG) SHRegOpenUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
  1437. LWSTDAPI_(LONG) SHRegQueryUSValueA(HUSKEY hUSKey, LPCSTR pszValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1438. LWSTDAPI_(LONG) SHRegQueryUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1439. LWSTDAPI_(LONG) SHRegWriteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1440. LWSTDAPI_(LONG) SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1441. LWSTDAPI_(LONG) SHRegDeleteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, SHREGDEL_FLAGS delRegFlags);
  1442. LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyW(HUSKEY hUSKey, LPCWSTR pwzSubKey, SHREGDEL_FLAGS delRegFlags);
  1443. LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyA(HUSKEY hUSKey, LPCSTR pszSubKey, SHREGDEL_FLAGS delRegFlags);
  1444. LWSTDAPI_(LONG) SHRegDeleteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, SHREGDEL_FLAGS delRegFlags);
  1445. LWSTDAPI_(LONG) SHRegEnumUSKeyA(HUSKEY hUSKey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
  1446. LWSTDAPI_(LONG) SHRegEnumUSKeyW(HUSKEY hUSKey, DWORD dwIndex, LPWSTR pwzName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
  1447. LWSTDAPI_(LONG) SHRegEnumUSValueA(HUSKEY hUSkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
  1448. LWSTDAPI_(LONG) SHRegEnumUSValueW(HUSKEY hUSkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
  1449. LWSTDAPI_(LONG) SHRegQueryInfoUSKeyA(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
  1450. LWSTDAPI_(LONG) SHRegQueryInfoUSKeyW(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
  1451. LWSTDAPI_(LONG) SHRegCloseUSKey(HUSKEY hUSKey);
  1452. // These calls are equal to an SHRegOpenUSKey, SHRegQueryUSValue, and then a SHRegCloseUSKey.
  1453. LWSTDAPI_(LONG) SHRegGetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1454. LWSTDAPI_(LONG) SHRegGetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1455. LWSTDAPI_(LONG) SHRegSetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1456. LWSTDAPI_(LONG) SHRegSetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1457. LWSTDAPI_(int) SHRegGetIntW(HKEY hk, LPCWSTR pwzKey, int iDefault);
  1458. #ifdef UNICODE
  1459. #define SHRegCreateUSKey SHRegCreateUSKeyW
  1460. #define SHRegOpenUSKey SHRegOpenUSKeyW
  1461. #define SHRegQueryUSValue SHRegQueryUSValueW
  1462. #define SHRegWriteUSValue SHRegWriteUSValueW
  1463. #define SHRegDeleteUSValue SHRegDeleteUSValueW
  1464. #define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyW
  1465. #define SHRegEnumUSKey SHRegEnumUSKeyW
  1466. #define SHRegEnumUSValue SHRegEnumUSValueW
  1467. #define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyW
  1468. #define SHRegGetUSValue SHRegGetUSValueW
  1469. #define SHRegSetUSValue SHRegSetUSValueW
  1470. #define SHRegGetInt SHRegGetIntW
  1471. #else
  1472. #define SHRegCreateUSKey SHRegCreateUSKeyA
  1473. #define SHRegOpenUSKey SHRegOpenUSKeyA
  1474. #define SHRegQueryUSValue SHRegQueryUSValueA
  1475. #define SHRegWriteUSValue SHRegWriteUSValueA
  1476. #define SHRegDeleteUSValue SHRegDeleteUSValueA
  1477. #define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyA
  1478. #define SHRegEnumUSKey SHRegEnumUSKeyA
  1479. #define SHRegEnumUSValue SHRegEnumUSValueA
  1480. #define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyA
  1481. #define SHRegGetUSValue SHRegGetUSValueA
  1482. #define SHRegSetUSValue SHRegSetUSValueA
  1483. #endif
  1484. LWSTDAPI_(BOOL) SHRegGetBoolUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
  1485. LWSTDAPI_(BOOL) SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
  1486. #ifdef UNICODE
  1487. #define SHRegGetBoolUSValue SHRegGetBoolUSValueW
  1488. #else
  1489. #define SHRegGetBoolUSValue SHRegGetBoolUSValueA
  1490. #endif
  1491. //
  1492. // Association APIs
  1493. //
  1494. // these APIs are to assist in accessing the data in HKCR
  1495. // getting the Command strings and exe paths
  1496. // for different verbs and extensions are simplified this way
  1497. //
  1498. enum {
  1499. ASSOCF_INIT_NOREMAPCLSID = 0x00000001, // do not remap clsids to progids
  1500. ASSOCF_INIT_BYEXENAME = 0x00000002, // executable is being passed in
  1501. ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in
  1502. ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat "*" as the BaseClass
  1503. ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat "Folder" as the BaseClass
  1504. ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU
  1505. ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string
  1506. ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
  1507. ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable
  1508. ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found
  1509. ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass
  1510. };
  1511. typedef DWORD ASSOCF;
  1512. typedef enum {
  1513. ASSOCSTR_COMMAND = 1, // shell\verb\command string
  1514. ASSOCSTR_EXECUTABLE, // the executable part of command string
  1515. ASSOCSTR_FRIENDLYDOCNAME, // friendly name of the document type
  1516. ASSOCSTR_FRIENDLYAPPNAME, // friendly name of executable
  1517. ASSOCSTR_NOOPEN, // noopen value
  1518. ASSOCSTR_SHELLNEWVALUE, // query values under the shellnew key
  1519. ASSOCSTR_DDECOMMAND, // template for DDE commands
  1520. ASSOCSTR_DDEIFEXEC, // DDECOMMAND to use if just create a process
  1521. ASSOCSTR_DDEAPPLICATION, // Application name in DDE broadcast
  1522. ASSOCSTR_DDETOPIC, // Topic Name in DDE broadcast
  1523. ASSOCSTR_INFOTIP, // info tip for an item, or list of properties to create info tip from
  1524. ASSOCSTR_QUICKTIP, // same as ASSOCSTR_INFOTIP, except, this list contains only quickly retrievable properties
  1525. ASSOCSTR_TILEINFO, // similar to ASSOCSTR_INFOTIP - lists important properties for tileview
  1526. ASSOCSTR_CONTENTTYPE, // MIME Content type
  1527. ASSOCSTR_DEFAULTICON, // Default icon source
  1528. ASSOCSTR_SHELLEXTENSION, // Guid string pointing to the Shellex\Shellextensionhandler value.
  1529. ASSOCSTR_MAX // last item in enum...
  1530. } ASSOCSTR;
  1531. typedef enum {
  1532. ASSOCKEY_SHELLEXECCLASS = 1, // the key that should be passed to ShellExec(hkeyClass)
  1533. ASSOCKEY_APP, // the "Application" key for the association
  1534. ASSOCKEY_CLASS, // the progid or class key
  1535. ASSOCKEY_BASECLASS, // the BaseClass key
  1536. ASSOCKEY_MAX // last item in enum...
  1537. } ASSOCKEY;
  1538. typedef enum {
  1539. ASSOCDATA_MSIDESCRIPTOR = 1, // Component Descriptor to pass to MSI APIs
  1540. ASSOCDATA_NOACTIVATEHANDLER, // restrict attempts to activate window
  1541. ASSOCDATA_QUERYCLASSSTORE, // should check with the NT Class Store
  1542. ASSOCDATA_HASPERUSERASSOC, // defaults to user specified association
  1543. ASSOCDATA_EDITFLAGS, // Edit flags.
  1544. ASSOCDATA_VALUE, // use pszExtra as the Value name
  1545. ASSOCDATA_MAX
  1546. } ASSOCDATA;
  1547. typedef enum {
  1548. ASSOCENUM_NONE
  1549. } ASSOCENUM;
  1550. #undef INTERFACE
  1551. #define INTERFACE IQueryAssociations
  1552. DECLARE_INTERFACE_( IQueryAssociations, IUnknown )
  1553. {
  1554. // IUnknown methods
  1555. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  1556. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  1557. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  1558. // IQueryAssociations methods
  1559. STDMETHOD (Init)(THIS_ ASSOCF flags, LPCWSTR pszAssoc, HKEY hkProgid, HWND hwnd) PURE;
  1560. STDMETHOD (GetString)(THIS_ ASSOCF flags, ASSOCSTR str, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut) PURE;
  1561. STDMETHOD (GetKey)(THIS_ ASSOCF flags, ASSOCKEY key, LPCWSTR pszExtra, HKEY *phkeyOut) PURE;
  1562. STDMETHOD (GetData)(THIS_ ASSOCF flags, ASSOCDATA data, LPCWSTR pszExtra, LPVOID pvOut, DWORD *pcbOut) PURE;
  1563. STDMETHOD (GetEnum)(THIS_ ASSOCF flags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut) PURE;
  1564. };
  1565. ;begin_internal
  1566. typedef struct tagAssocDDEExec
  1567. {
  1568. LPCWSTR pszDDEExec;
  1569. LPCWSTR pszApplication;
  1570. LPCWSTR pszTopic;
  1571. BOOL fNoActivateHandler;
  1572. } ASSOCDDEEXEC;
  1573. typedef struct tagAssocVerb
  1574. {
  1575. LPCWSTR pszVerb;
  1576. LPCWSTR pszTitle;
  1577. LPCWSTR pszFriendlyAppName;
  1578. LPCWSTR pszApplication;
  1579. LPCWSTR pszParams;
  1580. ASSOCDDEEXEC *pDDEExec;
  1581. } ASSOCVERB;
  1582. typedef struct tagAssocShell
  1583. {
  1584. ASSOCVERB *rgVerbs;
  1585. DWORD cVerbs;
  1586. DWORD iDefaultVerb;
  1587. } ASSOCSHELL;
  1588. typedef struct tagAssocProgid
  1589. {
  1590. DWORD cbSize;
  1591. LPCWSTR pszProgid;
  1592. LPCWSTR pszFriendlyDocName;
  1593. LPCWSTR pszDefaultIcon;
  1594. ASSOCSHELL *pShellKey;
  1595. LPCWSTR pszExtensions;
  1596. } ASSOCPROGID;
  1597. typedef struct tagAssocApp
  1598. {
  1599. DWORD cbSize;
  1600. LPCWSTR pszFriendlyAppName;
  1601. ASSOCSHELL *pShellKey;
  1602. } ASSOCAPP;
  1603. enum {
  1604. ASSOCMAKEF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
  1605. ASSOCMAKEF_USEEXPAND = 0x00000200, // strings have environment vars and need REG_EXPAND_SZ
  1606. ASSOCMAKEF_SUBSTENV = 0x00000400, // attempt to use std env if they match...
  1607. ASSOCMAKEF_VOLATILE = 0x00000800, // the progid will not persist between sessions
  1608. ASSOCMAKEF_DELETE = 0x00002000, // remove this association if possible
  1609. };
  1610. typedef DWORD ASSOCMAKEF;
  1611. LWSTDAPI AssocMakeProgid(ASSOCMAKEF flags, LPCWSTR pszApplication, ASSOCPROGID *pProgid, HKEY *phkProgid);
  1612. LWSTDAPI AssocMakeApp(ASSOCMAKEF flags, LPCWSTR pszApplication, ASSOCAPP *pApp, HKEY *phkApp);
  1613. LWSTDAPI AssocMakeApplicationByKey%(ASSOCMAKEF flags, HKEY hkAssoc, LPCTSTR% pszVerb);
  1614. LWSTDAPI AssocMakeFileExtsToApplication%(ASSOCMAKEF flags, LPCTSTR% pszExt, LPCTSTR% pszApplication);
  1615. LWSTDAPI AssocCopyVerbs(HKEY hkSrc, HKEY hkDst);
  1616. ;end_internal
  1617. LWSTDAPI AssocCreate(CLSID clsid, REFIID riid, LPVOID *ppv);
  1618. // wrappers for the interface
  1619. LWSTDAPI AssocQueryString%(ASSOCF flags, ASSOCSTR str, LPCTSTR% pszAssoc, LPCTSTR% pszExtra, LPTSTR% pszOut, DWORD *pcchOut);
  1620. LWSTDAPI AssocQueryStringByKey%(ASSOCF flags, ASSOCSTR str, HKEY hkAssoc, LPCTSTR% pszExtra, LPTSTR% pszOut, DWORD *pcchOut);
  1621. LWSTDAPI AssocQueryKey%(ASSOCF flags, ASSOCKEY key, LPCTSTR% pszAssoc, LPCTSTR% pszExtra, HKEY *phkeyOut);
  1622. // AssocIsDangerous() checks a file type to determine whether it is "Dangerous"
  1623. // this maps to the IE download dialog's forcing a prompt to open or save.
  1624. // dangerous file types should be handled more carefully than other file types.
  1625. //
  1626. // Parameter: pszAssoc - type to check. may be an extension or progid. (".exe" or "exefile" would both be valid)
  1627. //
  1628. // Returns: TRUE if the file type is dangerous.
  1629. //
  1630. // NOTES:
  1631. //
  1632. // this API first checks a hardcoded list of known dangerous types.
  1633. // then it checks the editflags for the file type looking for the FTA_AlwaysUnsafe bit.
  1634. // then it checks Safer policies.
  1635. //
  1636. LWSTDAPI_(BOOL) AssocIsDangerous(LPCWSTR pszAssoc);
  1637. ;begin_internal
  1638. typedef enum _SHELLKEY
  1639. {
  1640. SKROOT_HKCU = 0x00000001, // internal to the function
  1641. SKROOT_HKLM = 0x00000002, // internal to the function
  1642. SKROOT_MASK = 0x0000000F, // internal to the function
  1643. SKPATH_EXPLORER = 0x00000000, // internal to the function
  1644. SKPATH_SHELL = 0x00000010, // internal to the function
  1645. SKPATH_SHELLNOROAM = 0x00000020, // internal to the function
  1646. SKPATH_CLASSES = 0x00000030, // internal to the function
  1647. SKPATH_MASK = 0x00000FF0, // internal to the function
  1648. SKSUB_NONE = 0x00000000, // internal to the function
  1649. SKSUB_LOCALIZEDNAMES = 0x00001000, // internal to the function
  1650. SKSUB_HANDLERS = 0x00002000, // internal to the function
  1651. SKSUB_ASSOCIATIONS = 0x00003000, // internal to the function
  1652. SKSUB_VOLATILE = 0x00004000, // internal to the function
  1653. SKSUB_MUICACHE = 0x00005000, // internal to the function
  1654. SKSUB_FILEEXTS = 0x00006000, // internal to the function
  1655. SKSUB_MASK = 0x000FF000, // internal to the function
  1656. SHELLKEY_HKCU_EXPLORER = SKROOT_HKCU | SKPATH_EXPLORER | SKSUB_NONE,
  1657. SHELLKEY_HKLM_EXPLORER = SKROOT_HKLM | SKPATH_EXPLORER | SKSUB_NONE,
  1658. SHELLKEY_HKCU_SHELL = SKROOT_HKCU | SKPATH_SHELL | SKSUB_NONE,
  1659. SHELLKEY_HKLM_SHELL = SKROOT_HKLM | SKPATH_SHELL | SKSUB_NONE,
  1660. SHELLKEY_HKCU_SHELLNOROAM = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_NONE,
  1661. SHELLKEY_HKCULM_SHELL = SHELLKEY_HKCU_SHELLNOROAM,
  1662. SHELLKEY_HKCULM_CLASSES = SKROOT_HKCU | SKPATH_CLASSES | SKSUB_NONE,
  1663. SHELLKEY_HKCU_LOCALIZEDNAMES = SKROOT_HKCU | SKPATH_SHELL | SKSUB_LOCALIZEDNAMES,
  1664. SHELLKEY_HKCULM_HANDLERS = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_HANDLERS,
  1665. SHELLKEY_HKCULM_ASSOCIATIONS = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_ASSOCIATIONS,
  1666. SHELLKEY_HKCULM_VOLATILE = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_VOLATILE,
  1667. SHELLKEY_HKCULM_MUICACHE = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_MUICACHE,
  1668. SHELLKEY_HKCU_FILEEXTS = SKROOT_HKCU | SKPATH_EXPLORER | SKSUB_FILEEXTS,
  1669. SHELLKEY_HKCULM_HANDLERS_RO = SHELLKEY_HKCULM_HANDLERS, // deprecated
  1670. SHELLKEY_HKCULM_HANDLERS_RW = SHELLKEY_HKCULM_HANDLERS, // deprecated
  1671. SHELLKEY_HKCULM_ASSOCIATIONS_RO = SHELLKEY_HKCULM_ASSOCIATIONS, // deprecated
  1672. SHELLKEY_HKCULM_ASSOCIATIONS_RW = SHELLKEY_HKCULM_ASSOCIATIONS, // deprecated
  1673. SHELLKEY_HKCULM_RO = SHELLKEY_HKCU_SHELLNOROAM, // deprecated
  1674. SHELLKEY_HKCULM_RW = SHELLKEY_HKCU_SHELLNOROAM, // deprecated
  1675. } SHELLKEY;
  1676. LWSTDAPI_(HKEY) SHGetShellKey(SHELLKEY sk, LPCWSTR pszSubKey, BOOL fCreateSub);
  1677. LWSTDAPI SKGetValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1678. LWSTDAPI SKSetValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
  1679. LWSTDAPI SKDeleteValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue);
  1680. LWSTDAPI SKAllocValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void **pvData, DWORD *pcbData);
  1681. LWSTDAPI QuerySourceCreateFromKey(HKEY hk, PCWSTR pszSub, BOOL fCreate, REFIID riid, void **ppv);
  1682. ;end_internal
  1683. ;begin_both
  1684. #endif // NO_SHLWAPI_REG
  1685. ;end_both
  1686. ;begin_internal
  1687. #ifndef NO_SHLWAPI_UALSTR
  1688. #include <uastrfnc.h>
  1689. #endif // NO_SHLWAPI_UALSTR
  1690. ;end_internal
  1691. ;begin_both
  1692. #ifndef NO_SHLWAPI_STREAM
  1693. //
  1694. //=============== Stream Routines ===================================
  1695. //
  1696. ;end_both
  1697. ;begin_internal
  1698. //
  1699. // We must say "struct IStream" instead of "IStream" in case we are
  1700. // #include'd before <ole2.h>.
  1701. //
  1702. ;end_internal
  1703. LWSTDAPI_(struct IStream *) SHOpenRegStream%(HKEY hkey, LPCTSTR% pszSubkey, LPCTSTR% pszValue, DWORD grfMode);
  1704. LWSTDAPI_(struct IStream *) SHOpenRegStream2%(HKEY hkey, LPCTSTR% pszSubkey, LPCTSTR% pszValue, DWORD grfMode);
  1705. // New code always wants new implementation...
  1706. #undef SHOpenRegStream
  1707. #define SHOpenRegStream SHOpenRegStream2
  1708. LWSTDAPI SHCreateStreamOnFile%(LPCTSTR% pszFile, DWORD grfMode, struct IStream **ppstm);
  1709. #if (_WIN32_IE >= 0x0600)
  1710. ;begin_internal
  1711. LWSTDAPI MapWin32ErrorToSTG(HRESULT hrIn);
  1712. LWSTDAPI ModeToCreateFileFlags(DWORD grfMode, BOOL fCreate, DWORD *pdwDesiredAccess, DWORD *pdwShareMode, DWORD *pdwCreationDisposition);
  1713. // SHConvertGraphicsFile Description:
  1714. // pszFile: The source file name to convert. The file can be a JPEG, GIF, PNG, TIFF, BMP, EMF, WMF, or ICO filetype.
  1715. // pszDestFile: This is the destination file that will be created. The extension will determine type of
  1716. // format for the destiation file. If this file already exists, the function will fail with
  1717. // HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) unless the flag SHCGF_REPLACEFILE is specified.
  1718. // Return value: S_OK if the destination file was able to be created, otherwise an HRESULT error.
  1719. //
  1720. // NOTE: This is currently internal because: 1) we are using a temporary GDI+ interface, 2)
  1721. // we can't fix any bugs we find (since they are in GDI+), and 3) it's best if GDI+ owns
  1722. // the public version of this interface. GDI+ is working on version 1 of their API for
  1723. // whistler. They don't have time to create this API, make it public, and support it
  1724. // until version 2, which will be after whistler.
  1725. //
  1726. // dwFlags:
  1727. #define SHCGF_NONE 0x00000000 // Normal behavior
  1728. #define SHCGF_REPLACEFILE 0x00000001 // If pszDestFile already exists, delete it.
  1729. LWSTDAPI SHConvertGraphicsFile(IN LPCWSTR pszFile, IN LPCWSTR pszDestFile, IN DWORD dwFlags);
  1730. ;end_internal
  1731. LWSTDAPI SHCreateStreamOnFileEx(LPCWSTR pszFile, DWORD grfMode, DWORD dwAttributes, BOOL fCreate, struct IStream * pstmTemplate, struct IStream **ppstm);
  1732. #endif // (_WIN32_IE >= 0x0600)
  1733. ;begin_internal
  1734. LWSTDAPI_(struct IStream *) SHCreateMemStream(LPBYTE pInit, UINT cbInit);
  1735. // SHCreateStreamWrapper creates an IStream that spans multiple IStream implementations.
  1736. // NOTE: STGM_READ is the only mode currently supported
  1737. LWSTDAPI SHCreateStreamWrapper(IStream *aStreams[], UINT cStreams, DWORD grfMode, IStream **ppstm);
  1738. // These functions read, write, and maintain a list of DATABLOCK_HEADERs.
  1739. // Blocks can be of any size (cbSize) and they are added, found, and removed
  1740. // by dwSignature. Each block is guranteed to be aligned on a DWORD boundary
  1741. // in memory. The stream format is identical to Windows 95 and NT 4
  1742. // CShellLink's "EXP" data format (with one bug fix: stream data is NULL
  1743. // terminated on write...)
  1744. //
  1745. // SHReadDataBlocks and SHAddDataBlock will allocate your pdbList for you.
  1746. //
  1747. // SHFindDataBlock returns a pointer into the pdbList.
  1748. //
  1749. // SHAddDataBlock and SHRemoveDataBlock return TRUE if ppdbList modified.
  1750. //
  1751. /*
  1752. * Temporary definition because the definition doesn't show up until shlobj.w.
  1753. */
  1754. #define LPDATABLOCK_HEADER struct tagDATABLOCKHEADER *
  1755. #define LPDBLIST struct tagDATABLOCKHEADER *
  1756. LWSTDAPI SHWriteDataBlockList(struct IStream* pstm, LPDBLIST pdbList);
  1757. LWSTDAPI SHReadDataBlockList(struct IStream* pstm, LPDBLIST * ppdbList);
  1758. LWSTDAPI_(void) SHFreeDataBlockList(LPDBLIST pdbList);
  1759. LWSTDAPI_(BOOL) SHAddDataBlock(LPDBLIST * ppdbList, LPDATABLOCK_HEADER pdb);
  1760. LWSTDAPI_(BOOL) SHRemoveDataBlock(LPDBLIST * ppdbList, DWORD dwSignature);
  1761. LWSTDAPI_(void *) SHFindDataBlock(LPDBLIST pdbList, DWORD dwSignature);
  1762. #undef LPDATABLOCK_HEADER
  1763. #undef LPDBLIST
  1764. // FUNCTION: SHCheckDiskForMedia
  1765. //
  1766. // hwnd - NULL means no UI will be displayed. Non-NULL means
  1767. // punkEnableModless - Make caller modal during UI. (OPTIONAL)
  1768. // pszPath - Path that needs verification.
  1769. // wFunc - Type of operation (FO_MOVE, FO_COPY, FO_DELETE, FO_RENAME - shellapi.h)
  1770. //
  1771. // NOTE: USE NT5's SHPathPrepareForWrite() instead, it's MUCH MUCH BETTER.
  1772. LWSTDAPI_(BOOL) SHCheckDiskForMediaA(HWND hwnd, IUnknown * punkEnableModless, LPCSTR pszPath, UINT wFunc);
  1773. LWSTDAPI_(BOOL) SHCheckDiskForMediaW(HWND hwnd, IUnknown * punkEnableModless, LPCWSTR pwzPath, UINT wFunc);
  1774. #ifdef UNICODE
  1775. #define SHCheckDiskForMedia SHCheckDiskForMediaW
  1776. #else
  1777. #define SHCheckDiskForMedia SHCheckDiskForMediaA
  1778. #endif
  1779. ;end_internal
  1780. ;begin_both
  1781. #endif // NO_SHLWAPI_STREAM
  1782. ;end_both
  1783. ;begin_internal
  1784. #ifndef NO_SHLWAPI_MLUI
  1785. //
  1786. //=============== Multi Language UI Routines ===================================
  1787. //
  1788. ;end_internal
  1789. ;begin_internal
  1790. #define ORD_SHGETWEBFOLDERFILEPATHA 440
  1791. #define ORD_SHGETWEBFOLDERFILEPATHW 441
  1792. LWSTDAPI SHGetWebFolderFilePath%(LPCTSTR% pszFileName, LPTSTR% pszMUIPath, UINT cchMUIPath);
  1793. // Use MLLoadLibrary to get the ML-resource file. This function tags the file so
  1794. // all standard shlwapi wrap functions automatically get ML-behavior.
  1795. //
  1796. #define ORD_MLLOADLIBRARYA 377
  1797. #define ORD_MLLOADLIBRARYW 378
  1798. LWSTDAPI_(HINSTANCE) MLLoadLibrary%(LPCTSTR% lpLibFileName, HMODULE hModule, DWORD dwCrossCodePage);
  1799. LWSTDAPI_(BOOL) MLFreeLibrary(HMODULE hModule);
  1800. #define ML_NO_CROSSCODEPAGE 0
  1801. #define ML_CROSSCODEPAGE_NT 1
  1802. #define ML_CROSSCODEPAGE 2
  1803. #define ML_SHELL_LANGUAGE 4
  1804. #define ML_CROSSCODEPAGE_MASK 7
  1805. // If you are a global distributable a-la comctl32 that doesn't follow the IE5
  1806. // PlugUI resource layout, then load your own hinstance and poke it into shlwapi
  1807. // using these functions:
  1808. //
  1809. LWSTDAPI MLSetMLHInstance(HINSTANCE hInst, LANGID lidUI);
  1810. LWSTDAPI MLClearMLHInstance(HINSTANCE hInst);
  1811. // Of course you need to know what UI language to use:
  1812. //
  1813. #define ORD_MLGETUILANGUAGE 376
  1814. LWSTDAPI_(LANGID) MLGetUILanguage(void);
  1815. // Super internal and you probably don't need this one, but comctl32 does
  1816. // some font munging in PlugUI cases on your apps behalf:
  1817. //
  1818. LWSTDAPI_(BOOL) MLIsMLHInstance(HINSTANCE hInst);
  1819. LWSTDAPI_(HRESULT) MLBuildResURL%(LPCTSTR% szLibFile, HMODULE hModule, DWORD dwCrossCodePage, LPCTSTR% szResourceName, LPTSTR% pszResURL, int nBufSize);
  1820. #define ORD_MLWINHELPA 395
  1821. #define ORD_MLWINHELPW 397
  1822. LWSTDAPI_(BOOL) MLWinHelp%(HWND hWndCaller, LPCTSTR% lpszHelp, UINT uCommand, DWORD_PTR dwData);
  1823. #define ORD_MLHTMLHELPA 396
  1824. #define ORD_MLHTMLHELPW 398
  1825. LWSTDAPI_(HWND) MLHtmlHelp%(HWND hWndCaller, LPCTSTR% pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage);
  1826. ;end_internal
  1827. ;begin_internal
  1828. #endif // NO_SHLWAPI_MLUI
  1829. ;end_internal
  1830. ;begin_internal
  1831. #ifndef NO_SHLWAPI_HTTP
  1832. //
  1833. //=============== HTTP helper Routines ===================================
  1834. // The calling thread must have called CoInitialize() before using this
  1835. // function - it will create a format enumerator and associate it as a
  1836. // property with the IShellBrowser passed in, so that it will be reused.
  1837. //
  1838. ;begin_internal
  1839. //
  1840. // We must say "struct IWhatever" instead of "IWhatever" in case we are
  1841. // #include'd before <ole2.h>.
  1842. //
  1843. ;end_internal
  1844. LWSTDAPI RegisterDefaultAcceptHeaders(struct IBindCtx* pbc, struct IShellBrowser* psb);
  1845. LWSTDAPI RunRegCommand(HWND hwnd, HKEY hkey, LPCWSTR pszKey);
  1846. LWSTDAPI RunIndirectRegCommand(HWND hwnd, HKEY hkey, LPCWSTR pszKey, LPCWSTR pszVerb);
  1847. LWSTDAPI SHRunIndirectRegClientCommand(HWND hwnd, LPCWSTR pszClient);
  1848. LWSTDAPI GetAcceptLanguagesA(LPSTR psz, LPDWORD pcch);
  1849. LWSTDAPI GetAcceptLanguagesW(LPWSTR pwz, LPDWORD pcch);
  1850. #ifdef UNICODE
  1851. #define GetAcceptLanguages GetAcceptLanguagesW
  1852. #else
  1853. #define GetAcceptLanguages GetAcceptLanguagesA
  1854. #endif
  1855. #endif // NO_SHLWAPI_HTTP
  1856. ;end_internal
  1857. ;begin_internal
  1858. LWSTDAPI_(HWND) SHHtmlHelpOnDemandW(HWND hwnd, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage, BOOL bUseML);
  1859. LWSTDAPI_(HWND) SHHtmlHelpOnDemandA(HWND hwnd, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage, BOOL bUseML);
  1860. LWSTDAPI_(BOOL) SHWinHelpOnDemandW(HWND hwnd, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData, BOOL bUseML);
  1861. LWSTDAPI_(BOOL) SHWinHelpOnDemandA(HWND hwnd, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData, BOOL bUseML);
  1862. LWSTDAPI_(BOOL) WINAPI Shell_GetCachedImageIndexWrapW(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  1863. LWSTDAPI_(BOOL) WINAPI Shell_GetCachedImageIndexWrapA(LPCSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  1864. #ifdef UNICODE
  1865. #define SHHtmlHelpOnDemand SHHtmlHelpOnDemandW
  1866. #define SHWinHelpOnDemand SHWinHelpOnDemandW
  1867. #define Shell_GetCachedImageIndexWrap Shell_GetCachedImageIndexWrapW
  1868. #else
  1869. #define SHHtmlHelpOnDemand SHHtmlHelpOnDemandA
  1870. #define SHWinHelpOnDemand SHWinHelpOnDemandA
  1871. #define Shell_GetCachedImageIndexWrap Shell_GetCachedImageIndexWrapA
  1872. #endif
  1873. ;end_internal
  1874. ;begin_internal
  1875. #ifndef NO_SHLWAPI_STOPWATCH
  1876. //
  1877. //=============== Performance timing macros and prototypes ================
  1878. // StopWatch performance mode flags used in dwFlags param in API's and in Mode key at
  1879. // HKLM\software\microsoft\windows\currentversion\explorer\performance
  1880. // NOTE: low word is used for the mode, high word is used to change the default painter timer interval.
  1881. // If we need more mode bits then we'll need a new reg key for paint timer
  1882. #define SPMODE_SHELL 0x00000001
  1883. #define SPMODE_DEBUGOUT 0x00000002
  1884. #define SPMODE_TEST 0x00000004
  1885. #define SPMODE_BROWSER 0x00000008
  1886. #define SPMODE_FLUSH 0x00000010
  1887. #define SPMODE_EVENT 0x00000020
  1888. #define SPMODE_JAVA 0x00000040
  1889. #define SPMODE_FORMATTEXT 0x00000080
  1890. #define SPMODE_PROFILE 0x00000100
  1891. #define SPMODE_DEBUGBREAK 0x00000200
  1892. #define SPMODE_MSGTRACE 0x00000400
  1893. #define SPMODE_PERFTAGS 0x00000800
  1894. #define SPMODE_MEMWATCH 0x00001000
  1895. #define SPMODE_DBMON 0x00002000
  1896. #define SPMODE_MARS 0x00004000
  1897. #ifndef NO_ETW_TRACING
  1898. #define SPMODE_EVENTTRACE 0x00008000 // Event Tracing for Windows Enabled
  1899. #endif
  1900. #define SPMODE_RESERVED 0xffff0000
  1901. #ifndef NO_ETW_TRACING
  1902. #define SPMODES (SPMODE_SHELL | SPMODE_BROWSER | SPMODE_JAVA | SPMODE_MSGTRACE | SPMODE_MEMWATCH | SPMODE_DBMON | SPMODE_MARS | SPMODE_EVENTTRACE)
  1903. #else
  1904. #define SPMODES (SPMODE_SHELL | SPMODE_BROWSER | SPMODE_JAVA | SPMODE_MSGTRACE | SPMODE_MEMWATCH | SPMODE_DBMON | SPMODE_MARS)
  1905. #endif
  1906. #ifndef NO_ETW_TRACING
  1907. // Event tracing capability enabled by setting the mode to SPMODE_EVENTTRACE and
  1908. // selecting the part of the shell to trace in the "EventTrace" Value in the
  1909. // following key:
  1910. // HKLM\software\microsoft\windows\currentversion\explorer\performance
  1911. // BROWSER TRACING
  1912. // Do not use with SPMODE_BROWSER. If SPMODE_EVENT is used, the
  1913. // STOPWATCH_STOP_EVENT will be signaled when a web page is done loading.
  1914. #define SPTRACE_BROWSER 0x00000001
  1915. // Used to turn on/off browser event tracing. Setting the registry key enables
  1916. // event tracing use, but doesn't turn it on.
  1917. // {5576F62E-4142-45a8-9516-262A510C13F0}
  1918. DEFINE_GUID(c_BrowserControlGuid,
  1919. 0x5576f62e,
  1920. 0x4142,
  1921. 0x45a8,
  1922. 0x95, 0x16, 0x26, 0x2a, 0x51, 0xc, 0x13, 0xf0);
  1923. // Maps to the structure sent to ETW. ETW definition in
  1924. // \nt\sdktools\trace\tracedmp\mofdata.guid
  1925. // {2B992163-736F-4a68-9153-95BC5F34D884}
  1926. DEFINE_GUID(c_BrowserTraceGuid,
  1927. 0x2b992163,
  1928. 0x736f,
  1929. 0x4a68,
  1930. 0x91, 0x53, 0x95, 0xbc, 0x5f, 0x34, 0xd8, 0x84);
  1931. // BROWSING EVENTS
  1932. // See \nt\sdktools\trace\tracedmp\mofdata.guid
  1933. // The page load starts with a user keystroke message
  1934. #define EVENT_TRACE_TYPE_BROWSE_USERINPUTRET 10
  1935. #define EVENT_TRACE_TYPE_BROWSE_USERINPUTBACK 11
  1936. #define EVENT_TRACE_TYPE_BROWSE_USERINPUTLBUT 12
  1937. #define EVENT_TRACE_TYPE_BROWSE_USERINPUTNEXT 13
  1938. #define EVENT_TRACE_TYPE_BROWSE_USERINPUTPRIOR 14
  1939. #define EVENT_TRACE_TYPE_BROWSE_STARTFRAME 16
  1940. #define EVENT_TRACE_TYPE_BROWSE_LOADEDPARSED 18
  1941. #define EVENT_TRACE_TYPE_BROWSE_LAYOUT 19
  1942. #define EVENT_TRACE_TYPE_BROWSE_LAYOUTTASK 20
  1943. #define EVENT_TRACE_TYPE_BROWSE_PAINT 21
  1944. // Url the user types into the address bar.
  1945. #define EVENT_TRACE_TYPE_BROWSE_ADDRESS 22
  1946. #endif
  1947. // StopWatch node types used in memory log to identify the type of node
  1948. #define EMPTY_NODE 0x0
  1949. #define START_NODE 0x1
  1950. #define LAP_NODE 0x2
  1951. #define STOP_NODE 0x3
  1952. #define OUT_OF_NODES 0x4
  1953. // StopWatch timing ids used to identify the type of timing being performed
  1954. #define SWID_STARTUP 0x0
  1955. #define SWID_FRAME 0x1
  1956. #define SWID_COPY 0x2
  1957. #define SWID_TREE 0x3
  1958. #define SWID_BROWSER_FRAME 0x4
  1959. #define SWID_JAVA_APP 0x5
  1960. #define SWID_MENU 0x6
  1961. #define SWID_BITBUCKET 0x7
  1962. #define SWID_EXPLBAR 0x8
  1963. #define SWID_MSGDISPATCH 0x9
  1964. #define SWID_TRACEMSG 0xa
  1965. #define SWID_DBMON_DLLLOAD 0xb
  1966. #define SWID_DBMON_EXCEPTION 0xc
  1967. #define SWID_THUMBVW_CACHEREAD 0xd
  1968. #define SWID_THUMBVW_EXTRACT 0xe
  1969. #define SWID_THUMBVW_CACHEWRITE 0xf
  1970. #define SWID_THUMBVW_FETCH 0x10
  1971. #define SWID_THUMBVW_INIT 0x11
  1972. #define SWID_MASK_BROWSER_STOPBTN 0x8000000 // identifies BROWSER_FRAME stop caused by stop button
  1973. #define SWID_MASKS SWID_MASK_BROWSER_STOPBTN // add any SWID_MASK_* defines here
  1974. #define SWID(dwId) (dwId & (~SWID_MASKS))
  1975. // The following StopWatch messages are used to drive the timer msg handler. The timer proc is used
  1976. // as a means of delaying while watching paint messages. If the defined number of timer ticks has
  1977. // passed without getting any paint messages, then we mark the time of the last paint message we've
  1978. // saved as the stop time.
  1979. #define SWMSG_PAINT 1 // paint message rcvd
  1980. #define SWMSG_TIMER 2 // timer tick
  1981. #define SWMSG_CREATE 3 // init handler and create timer
  1982. #define SWMSG_STATUS 4 // get status of whether timing is active or not
  1983. #define ID_STOPWATCH_TIMER 0xabcd // Timer id
  1984. // Stopwatch defaults
  1985. #define STOPWATCH_MAX_NODES 100
  1986. #define STOPWATCH_DEFAULT_PAINT_INTERVAL 1000
  1987. #define STOPWATCH_DEFAULT_MAX_DISPATCH_TIME 150
  1988. #define STOPWATCH_DEFAULT_MAX_MSG_TIME 1000
  1989. #define STOPWATCH_DEFAULT_MAX_MSG_INTERVAL 50
  1990. #define STOPWATCH_DEFAULT_CLASSNAMES TEXT("Internet Explorer_Server") TEXT("\0") TEXT("SHELLDLL_DefView") TEXT("\0") TEXT("SysListView32") TEXT("\0\0")
  1991. #define MEMWATCH_DEFAULT_PAGES 512
  1992. #define MEMWATCH_DEFAULT_TIME 1000
  1993. #define MEMWATCH_DEFAULT_FLAGS 0
  1994. #ifdef UNICODE
  1995. #define StopWatch StopWatchW
  1996. #define StopWatchEx StopWatchExW
  1997. #else
  1998. #define StopWatch StopWatchA
  1999. #define StopWatchEx StopWatchExA
  2000. #endif
  2001. #define StopWatch_Start(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, START_NODE, dwFlags, 0)
  2002. #define StopWatch_Lap(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, LAP_NODE, dwFlags, 0)
  2003. #define StopWatch_Stop(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, STOP_NODE, dwFlags, 0)
  2004. #define StopWatch_StartTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, START_NODE, dwFlags, dwCount)
  2005. #define StopWatch_LapTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, LAP_NODE, dwFlags, dwCount)
  2006. #define StopWatch_StopTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, STOP_NODE, dwFlags, dwCount)
  2007. #define StopWatch_StartEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, START_NODE, dwFlags, 0, dwCookie)
  2008. #define StopWatch_LapEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, LAP_NODE, dwFlags, 0, dwCookie)
  2009. #define StopWatch_StopEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, STOP_NODE, dwFlags, 0, dwCookie)
  2010. #define StopWatch_StartTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, START_NODE, dwFlags, dwCount, dwCookie)
  2011. #define StopWatch_LapTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, LAP_NODE, dwFlags, dwCount, dwCookie)
  2012. #define StopWatch_StopTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, STOP_NODE, dwFlags, dwCount, dwCookie)
  2013. VOID InitStopWatchMode(VOID);
  2014. // EXPORTED FUNCTIONS
  2015. DWORD WINAPI StopWatchW(DWORD dwId, LPCWSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount);
  2016. DWORD WINAPI StopWatchA(DWORD dwId, LPCSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount);
  2017. DWORD WINAPI StopWatchExW(DWORD dwId, LPCWSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount, DWORD dwUniqueId);
  2018. DWORD WINAPI StopWatchExA(DWORD dwId, LPCSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount, DWORD dwUniqueId);
  2019. DWORD WINAPI StopWatchMode(VOID);
  2020. DWORD WINAPI StopWatchFlush(VOID);
  2021. BOOL WINAPI StopWatch_TimerHandler(HWND hwnd, UINT uInc, DWORD dwFlag, MSG *pmsg);
  2022. VOID WINAPI StopWatch_CheckMsg(HWND hwnd, MSG msg, LPCSTR lpStr);
  2023. VOID WINAPI StopWatch_MarkFrameStart(LPCSTR lpExplStr);
  2024. VOID WINAPI StopWatch_MarkSameFrameStart(HWND hwnd);
  2025. VOID WINAPI StopWatch_MarkJavaStop(LPCSTR lpStringToSend, HWND hwnd, BOOL fChType);
  2026. DWORD WINAPI GetPerfTime(VOID);
  2027. VOID WINAPI StopWatch_SetMsgLastLocation(DWORD dwLast);
  2028. DWORD WINAPI StopWatch_DispatchTime(BOOL fStartTime, MSG msg, DWORD dwStart);
  2029. #ifndef NO_ETW_TRACING
  2030. VOID WINAPI EventTraceHandler(UCHAR uchEventType, PVOID pvData);
  2031. #endif
  2032. extern DWORD g_dwStopWatchMode;
  2033. //
  2034. //=============== End Performance timing macros and prototypes ================
  2035. #endif //#ifndef NO_SHLWAPI_STOPWATCH
  2036. ;end_internal
  2037. ;begin_internal
  2038. #ifndef NO_SHLWAPI_INTERNAL
  2039. //
  2040. //=============== Internal helper routines ===================================
  2041. //
  2042. // Declare some OLE interfaces we need to refer to and which aren't
  2043. // already defined in objbase.h
  2044. //
  2045. #ifndef RC_INVOKED /* { rc doesn't like these long symbol names */
  2046. #ifndef __IOleCommandTarget_FWD_DEFINED__
  2047. #define __IOleCommandTarget_FWD_DEFINED__
  2048. typedef struct IOleCommandTarget IOleCommandTarget;
  2049. #endif /* __IOleCommandTarget_FWD_DEFINED__ */
  2050. #ifndef __IDropTarget_FWD_DEFINED__
  2051. #define __IDropTarget_FWD_DEFINED__
  2052. typedef struct IDropTarget IDropTarget;
  2053. #endif /* __IDropTarget_FWD_DEFINED__ */
  2054. #ifndef __IPropertyBag_FWD_DEFINED__
  2055. #define __IPropertyBag_FWD_DEFINED__
  2056. typedef struct IPropertyBag IPropertyBag;
  2057. #endif /* __IPropertyBag_FWD_DEFINED__ */
  2058. #ifndef __IConnectionPoint_FWD_DEFINED__
  2059. #define __IConnectionPoint_FWD_DEFINED__
  2060. typedef struct IConnectionPoint IConnectionPoint;
  2061. #endif /* __IConnectionPoint_FWD_DEFINED__ */
  2062. #ifdef __cplusplus
  2063. extern "C++" {
  2064. template <typename T>
  2065. void IUnknown_SafeReleaseAndNullPtr(T *& p)
  2066. {
  2067. if (p)
  2068. {
  2069. T *pTemp = p;
  2070. p = NULL;
  2071. pTemp->Release();
  2072. }
  2073. }
  2074. }
  2075. #endif // __cplusplus
  2076. LWSTDAPI_(void) IUnknown_AtomicRelease(void ** ppunk);
  2077. LWSTDAPI_(BOOL) SHIsSameObject(IUnknown* punk1, IUnknown* punk2);
  2078. LWSTDAPI IUnknown_GetWindow(IUnknown* punk, HWND* phwnd);
  2079. LWSTDAPI IUnknown_SetOwner(IUnknown* punk, IUnknown* punkOwner);
  2080. LWSTDAPI IUnknown_SetSite(IUnknown *punk, IUnknown *punkSite);
  2081. LWSTDAPI IUnknown_GetSite(IUnknown *punk, REFIID riid, void **ppvOut);
  2082. LWSTDAPI IUnknown_EnableModeless(IUnknown * punk, BOOL fEnabled);
  2083. LWSTDAPI IUnknown_GetClassID(IUnknown *punk, CLSID *pclsid);
  2084. LWSTDAPI IUnknown_QueryService(IUnknown* punk, REFGUID guidService, REFIID riid, void ** ppvOut);
  2085. LWSTDAPI IUnknown_QueryServiceForWebBrowserApp(IUnknown* punk, REFIID riid, void **ppvOut);
  2086. LWSTDAPI IUnknown_QueryServiceExec(IUnknown* punk, REFGUID guidService, const GUID *guid,
  2087. DWORD cmdID, DWORD cmdParam, VARIANT* pvarargIn, VARIANT* pvarargOut);
  2088. LWSTDAPI IUnknown_ShowBrowserBar(IUnknown* punk, REFCLSID clsidBrowserBar, BOOL fShow);
  2089. LWSTDAPI IUnknown_HandleIRestrict(IUnknown * punk, const GUID * pguidID, DWORD dwRestrictAction, VARIANT * pvarArgs, DWORD * pdwRestrictionResult);
  2090. LWSTDAPI IUnknown_OnFocusOCS(IUnknown *punk, BOOL fGotFocus);
  2091. LWSTDAPI IUnknown_TranslateAcceleratorOCS(IUnknown *punk, LPMSG lpMsg, DWORD grfMods);
  2092. LWSTDAPI_(void) IUnknown_Set(IUnknown ** ppunk, IUnknown * punk);
  2093. LWSTDAPI IUnknown_ProfferService(IUnknown *punkSite,
  2094. REFGUID sidWhat, IServiceProvider *punkService,
  2095. DWORD *pdwCookie);
  2096. LWSTDAPI IUnknown_QueryServicePropertyBag(IUnknown* punk, DWORD dwFlags, REFIID riid, void ** ppvOut);
  2097. LWSTDAPI IUnknown_TranslateAcceleratorIO(IUnknown* punk, LPMSG lpMsg);
  2098. LWSTDAPI IUnknown_UIActivateIO(IUnknown *punk, BOOL fActivate, LPMSG lpMsg);
  2099. LWSTDAPI IUnknown_OnFocusChangeIS(IUnknown *punk, IUnknown *punkSrc, BOOL fSetFocus);
  2100. LWSTDAPI IUnknown_HasFocusIO(IUnknown *punk);
  2101. LWSTDAPI SHWeakQueryInterface(IUnknown *punkOuter, IUnknown *punkTarget, REFIID riid, void **ppvOut);
  2102. LWSTDAPI_(void) SHWeakReleaseInterface(IUnknown *punkOuter, IUnknown **ppunk);
  2103. #define IUnknown_EnableModless IUnknown_EnableModeless
  2104. // Helper macros for the Weak interface functions.
  2105. #define SHQueryInnerInterface SHWeakQueryInterface
  2106. #define SHReleaseInnerInterface SHWeakReleaseInterface
  2107. #define SHReleaseOuterInterface SHWeakReleaseInterface
  2108. __inline HRESULT SHQueryOuterInterface(IUnknown *punkOuter, REFIID riid, void **ppvOut)
  2109. {
  2110. return SHWeakQueryInterface(punkOuter, punkOuter, riid, ppvOut);
  2111. }
  2112. #if (_WIN32_IE >= 0x0600)
  2113. // App compat-aware CoCreateInstance
  2114. LWSTDAPI SHCoCreateInstanceAC(REFCLSID rclsid,
  2115. IUnknown *punkOuter, DWORD dwClsCtx,
  2116. REFIID riid, void **ppvOut);
  2117. #endif // (_WIN32_IE >= 0x0600)
  2118. #if defined(__IOleAutomationTypes_INTERFACE_DEFINED__) && \
  2119. defined(__IOleCommandTarget_INTERFACE_DEFINED__)
  2120. LWSTDAPI IUnknown_QueryStatus(IUnknown *punk, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  2121. LWSTDAPI IUnknown_Exec(IUnknown* punk, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  2122. // Some of the many connection point helper functions available in
  2123. // connect.cpp. We export only the ones people actually use. If
  2124. // you need a helper function, maybe it's already in connect.cpp
  2125. // and merely needs to be exported.
  2126. LWSTDAPI SHPackDispParamsV(DISPPARAMS * pdispparams, VARIANTARG *rgvt,
  2127. UINT cArgs, va_list arglist);
  2128. LWSTDAPIV SHPackDispParams(DISPPARAMS * pdispparams, VARIANTARG *rgvt,
  2129. UINT cArgs, ...);
  2130. typedef HRESULT (CALLBACK *SHINVOKECALLBACK)(IDispatch *pdisp, struct SHINVOKEPARAMS *pinv);
  2131. #include <pshpack1.h>
  2132. typedef struct SHINVOKEPARAMS {
  2133. UINT flags; // mandatory
  2134. DISPID dispidMember; // mandatory
  2135. const IID*piid; // IPFL_USEDEFAULTS will fill this in
  2136. LCID lcid; // IPFL_USEDEFAULTS will fill this in
  2137. WORD wFlags; // IPFL_USEDEFAULTS will fill this in
  2138. DISPPARAMS * pdispparams; // mandatory, may be NULL
  2139. VARIANT * pvarResult; // IPFL_USEDEFAULTS will fill this in
  2140. EXCEPINFO * pexcepinfo; // IPFL_USEDEFAULTS will fill this in
  2141. UINT * puArgErr; // IPFL_USEDEFAULTS will fill this in
  2142. SHINVOKECALLBACK Callback; // required if IPFL_USECALLBACK
  2143. } SHINVOKEPARAMS, *LPSHINVOKEPARAMS;
  2144. #include <poppack.h> /* Return to byte packing */
  2145. #define IPFL_USECALLBACK 0x0001
  2146. #define IPFL_USEDEFAULTS 0x0002
  2147. #if 0 // These functions not yet needed
  2148. LWSTDAPI IConnectionPoint_InvokeIndirect(IConnectionPoint *pcp,
  2149. SHINVOKEPARAMS *pinv);
  2150. #endif
  2151. LWSTDAPI IConnectionPoint_InvokeWithCancel(IConnectionPoint *pcp,
  2152. DISPID dispidMember, DISPPARAMS * pdispparams,
  2153. LPBOOL pfCancel, LPVOID *ppvCancel);
  2154. LWSTDAPI IConnectionPoint_SimpleInvoke(IConnectionPoint *pcp,
  2155. DISPID dispidMember, DISPPARAMS * pdispparams);
  2156. #if 0 // These functions not yet needed
  2157. LWSTDAPI IConnectionPoint_InvokeParamV(IConnectionPoint *pcp,
  2158. DISPID dispidMember, VARIANTARG *rgvarg,
  2159. UINT cArgs, va_list ap);
  2160. LWSTDAPIV IConnectionPoint_InvokeParam(IConnectionPoint *pcp,
  2161. DISPID dispidMember, VARIANTARG *rgvarg, UINT cArgs, ...)
  2162. #endif
  2163. LWSTDAPI IConnectionPoint_OnChanged(IConnectionPoint *pcp, DISPID dispid);
  2164. #if 0 // These functions not yet needed
  2165. LWSTDAPI IUnknown_FindConnectionPoint(IUnknown *punk,
  2166. REFIID riidCP, IConnectionPoint **pcpOut);
  2167. #endif
  2168. LWSTDAPI IUnknown_CPContainerInvokeIndirect(IUnknown *punk, REFIID riidCP,
  2169. SHINVOKEPARAMS *pinv);
  2170. LWSTDAPIV IUnknown_CPContainerInvokeParam(IUnknown *punk, REFIID riidCP,
  2171. DISPID dispidMember, VARIANTARG *rgvarg, UINT cArgs, ...);
  2172. LWSTDAPI IUnknown_CPContainerOnChanged(IUnknown *punk, DISPID dispid);
  2173. #endif /* IOleAutomationTypes && IOleCommandTarget */
  2174. #endif /* } !RC_INVOKED */
  2175. LWSTDAPI IStream_Read(IStream *pstm, void *pv, ULONG cb);
  2176. LWSTDAPI IStream_Write(IStream *pstm, const void *pv, ULONG cb);
  2177. LWSTDAPI IStream_Reset(IStream *pstm);
  2178. LWSTDAPI IStream_Size(IStream *pstm, ULARGE_INTEGER *pui);
  2179. LWSTDAPI IStream_WritePidl(IStream *pstm, LPCITEMIDLIST pidlWrite);
  2180. LWSTDAPI IStream_ReadPidl(IStream *pstm, LPITEMIDLIST *ppidlOut);
  2181. LWSTDAPI_(BOOL) SHIsEmptyStream(IStream* pstm);
  2182. LWSTDAPI SHSimulateDrop(IDropTarget *pdrop, IDataObject *pdtobj, DWORD grfKeyState,
  2183. const POINTL *ppt, DWORD *pdwEffect);
  2184. LWSTDAPI SHLoadFromPropertyBag(IUnknown* punk, IPropertyBag* ppg);
  2185. LWSTDAPI ConnectToConnectionPoint(IUnknown* punkThis, REFIID riidEvent, BOOL fConnect, IUnknown* punkTarget, DWORD* pdwCookie, IConnectionPoint** ppcpOut);
  2186. LWSTDAPI SHCreatePropertyBagOnRegKey(HKEY hk, LPCWSTR pszSubKey, DWORD grfMode, REFIID riid, void **ppv);
  2187. LWSTDAPI SHCreatePropertyBagOnProfileSection(LPCWSTR pszFile, LPCWSTR pszSection, DWORD grfMode, REFIID riid, void **ppv);
  2188. LWSTDAPI SHCreatePropertyBagOnMemory(DWORD grfMode, REFIID riid, void **ppv);
  2189. LWSTDAPI SHPropertyBag_ReadType(IPropertyBag* ppb, LPCWSTR pszPropName, VARIANT* pv, VARTYPE vt);
  2190. LWSTDAPI SHPropertyBag_ReadStr(IPropertyBag* ppb, LPCWSTR pwzPropName, LPWSTR psz, int cch);
  2191. LWSTDAPI SHPropertyBag_ReadBSTR(IPropertyBag *ppb, LPCWSTR pwzPropName, BSTR* pbstr);
  2192. LWSTDAPI SHPropertyBag_WriteStr(IPropertyBag* ppb, LPCWSTR pwzPropName, LPCWSTR psz);
  2193. LWSTDAPI SHPropertyBag_ReadInt(IPropertyBag* ppb, LPCWSTR pwzPropName, INT* piResult);
  2194. LWSTDAPI SHPropertyBag_WriteInt(IPropertyBag* ppb, LPCWSTR pwzPropName, INT iValue);
  2195. LWSTDAPI SHPropertyBag_ReadSHORT(IPropertyBag* ppb, LPCWSTR pwzPropName, SHORT* psh);
  2196. LWSTDAPI SHPropertyBag_WriteSHORT(IPropertyBag* ppb, LPCWSTR pwzPropName, SHORT sh);
  2197. LWSTDAPI SHPropertyBag_ReadLONG(IPropertyBag* ppb, LPCWSTR pwzPropName, LONG* pl);
  2198. LWSTDAPI SHPropertyBag_WriteLONG(IPropertyBag* ppb, LPCWSTR pwzPropName, LONG l);
  2199. LWSTDAPI SHPropertyBag_ReadDWORD(IPropertyBag* ppb, LPCWSTR pwzPropName, DWORD* pdw);
  2200. LWSTDAPI SHPropertyBag_WriteDWORD(IPropertyBag* ppb, LPCWSTR pwzPropName, DWORD dw);
  2201. LWSTDAPI SHPropertyBag_ReadBOOL(IPropertyBag* ppb, LPCWSTR pwzPropName, BOOL* pfResult);
  2202. LWSTDAPI SHPropertyBag_WriteBOOL(IPropertyBag* ppb, LPCWSTR pwzPropName, BOOL fValue);
  2203. LWSTDAPI SHPropertyBag_ReadGUID(IPropertyBag* ppb, LPCWSTR pwzPropName, GUID* pguid);
  2204. LWSTDAPI SHPropertyBag_WriteGUID(IPropertyBag* ppb, LPCWSTR pwzPropName, const GUID* pguid);
  2205. LWSTDAPI SHPropertyBag_ReadPIDL(IPropertyBag *ppb, LPCWSTR pwzPropName, LPITEMIDLIST* ppidl);
  2206. LWSTDAPI SHPropertyBag_WritePIDL(IPropertyBag *ppb, LPCWSTR pwzPropName, LPCITEMIDLIST pidl);
  2207. LWSTDAPI SHPropertyBag_ReadPOINTL(IPropertyBag* ppb, LPCWSTR pwzPropName, POINTL* ppt);
  2208. LWSTDAPI SHPropertyBag_WritePOINTL(IPropertyBag* ppb, LPCWSTR pwzPropName, const POINTL* ppt);
  2209. LWSTDAPI SHPropertyBag_ReadPOINTS(IPropertyBag* ppb, LPCWSTR pwzPropName, POINTS* ppt);
  2210. LWSTDAPI SHPropertyBag_WritePOINTS(IPropertyBag* ppb, LPCWSTR pwzPropName, const POINTS* ppt);
  2211. LWSTDAPI SHPropertyBag_ReadRECTL(IPropertyBag* ppb, LPCWSTR pwzPropName, RECTL* prc);
  2212. LWSTDAPI SHPropertyBag_WriteRECTL(IPropertyBag* ppb, LPCWSTR pwzPropName, const RECTL* prc);
  2213. LWSTDAPI SHPropertyBag_ReadStream(IPropertyBag* ppb, LPCWSTR pwzPropName, IStream** ppstm);
  2214. LWSTDAPI SHPropertyBag_WriteStream(IPropertyBag* ppb, LPCWSTR pwzPropName, IStream* pstm);
  2215. LWSTDAPI SHPropertyBag_Delete(IPropertyBag* ppb, LPCWSTR pszPropName);
  2216. // Doc'ed for DOJ compliance
  2217. ;end_internal
  2218. #define SHGVSPB_PERUSER 0x00000001 // must have one of PERUSER or ALLUSERS
  2219. #define SHGVSPB_ALLUSERS 0x00000002
  2220. #define SHGVSPB_PERFOLDER 0x00000004 // must have one of PERFOLDER ALLFOLDERS or INHERIT
  2221. #define SHGVSPB_ALLFOLDERS 0x00000008
  2222. #define SHGVSPB_INHERIT 0x00000010
  2223. #define SHGVSPB_ROAM 0x00000020 // modifies the above
  2224. #define SHGVSPB_NOAUTODEFAULTS 0x80000000 // turns off read delegation to more general property bags
  2225. #define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
  2226. #define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS)
  2227. #define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS)
  2228. #define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS)
  2229. LWSTDAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPCWSTR pszBagName, DWORD dwFlags, REFIID riid, void** ppv);
  2230. ;begin_internal
  2231. LWSTDAPI_(ULONG) SHGetPerScreenResName(WCHAR* pszRes, ULONG cch, DWORD dwVersion);
  2232. //
  2233. // SH(Get/Set)IniStringUTF7
  2234. //
  2235. // These are just like Get/WriteProfileString except that if the KeyName
  2236. // begins with SZ_CANBEUNICODE, we will use SHGetIniString instead of
  2237. // the profile functions. (The SZ_CANBEUNICODE will be stripped off
  2238. // before calling SHGetIniString.) This allows us to stash unicode
  2239. // strings into INI files (which are ASCII) by encoding them as UTF7.
  2240. //
  2241. // In other words, SHGetIniStringUTF7("Settings", SZ_CANBEUNICODE "Name", ...)
  2242. // will read from section "Settings", key name "Name", but will also
  2243. // look at the UTF7-encoded version stashed in the "Settings.W" section.
  2244. //
  2245. #define CH_CANBEUNICODEW L'@'
  2246. LWSTDAPI_(DWORD) SHGetIniStringUTF7W(LPCWSTR lpSection, LPCWSTR lpKey, LPWSTR lpBuf, DWORD nSize, LPCWSTR lpFile);
  2247. LWSTDAPI_(BOOL) SHSetIniStringUTF7W(LPCWSTR lpSection, LPCWSTR lpKey, LPCWSTR lpString, LPCWSTR lpFile);
  2248. #ifdef UNICODE
  2249. #define SZ_CANBEUNICODE TEXT("@")
  2250. #define SHSetIniStringUTF7 SHSetIniStringUTF7W
  2251. #define SHGetIniStringUTF7 SHGetIniStringUTF7W
  2252. #else
  2253. #define SZ_CANBEUNICODE TEXT("")
  2254. #define SHGetIniStringUTF7(lpSection, lpKey, lpBuf, nSize, lpFile) \
  2255. GetPrivateProfileStringA(lpSection, lpKey, "", lpBuf, nSize, lpFile)
  2256. #define SHSetIniStringUTF7 WritePrivateProfileStringA
  2257. #endif
  2258. /*
  2259. * Like PrivateProfileString except that UNICODE strings are encoded so they
  2260. * will successfully round-trip.
  2261. */
  2262. LWSTDAPI_(DWORD) SHGetIniStringW(LPCWSTR lpSection, LPCWSTR lpKey, LPWSTR lpBuf, DWORD nSize, LPCWSTR lpFile);
  2263. #define SHGetIniStringA(lpSection, lpKey, lpBuf, nSize, lpFile) \
  2264. GetPrivateProfileStringA(lpSection, lpKey, "", lpBuf, nSize, lpFile)
  2265. LWSTDAPI_(BOOL) SHSetIniStringW(LPCWSTR lpSection, LPCWSTR lpKey, LPCWSTR lpString, LPCWSTR lpFile);
  2266. #define SHSetIniStringA WritePrivateProfileStringA
  2267. LWSTDAPI CreateURLFileContentsW(LPCWSTR pwszUrl, LPSTR *ppszOut);
  2268. LWSTDAPI CreateURLFileContentsA(LPCSTR pszUrl, LPSTR *ppszOut);
  2269. #ifdef UNICODE
  2270. #define SHGetIniString SHGetIniStringW
  2271. #define SHSetIniString SHSetIniStringW
  2272. #define CreateURLFileContents CreateURLFileContentsW
  2273. #else
  2274. #define SHGetIniString SHGetIniStringA
  2275. #define SHSetIniString SHSetIniStringA
  2276. #define CreateURLFileContents CreateURLFileContentsA
  2277. #endif // UNICODE
  2278. #define ISHGDN2_CANREMOVEFORPARSING 0x0001
  2279. LWSTDAPI IShellFolder_GetDisplayNameOf(struct IShellFolder *psf,
  2280. LPCITEMIDLIST pidl, DWORD uFlags, STRRET *pstr, DWORD dwFlags2);
  2281. LWSTDAPI IShellFolder_ParseDisplayName(struct IShellFolder *psf, HWND hwnd,
  2282. struct IBindCtx *pbc, LPWSTR pszDisplayName, ULONG *pchEaten,
  2283. LPITEMIDLIST *ppidl, ULONG *pdwAttributes);
  2284. LWSTDAPI IShellFolder_CompareIDs(struct IShellFolder *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  2285. LWSTDAPI IShellFolder_EnumObjects(struct IShellFolder *psf, HWND hwnd,
  2286. DWORD grfFlags, struct IEnumIDList **ppenumIDList);
  2287. LWSTDAPI_(BOOL) SHIsExpandableFolder(struct IShellFolder *psf, LPCITEMIDLIST pidl);
  2288. LWSTDAPI IContextMenu_Invoke(struct IContextMenu* pcm, HWND hwndOwner, LPCSTR pVerb, UINT fFlags);
  2289. #ifdef UNICODE
  2290. // SHTruncateString takes a BUFFER SIZE, so subtract 1 to properly null terminate.
  2291. //
  2292. #define SHTruncateString(wzStr, cch) ((cch) ? ((wzStr)[cch-1]=L'\0', (cch-1)) : 0)
  2293. #else
  2294. LWSTDAPI_(int) SHTruncateString(CHAR *sz, int cchBufferSize);
  2295. #endif // UNICODE
  2296. // SHFormatDateTime flags
  2297. // (FDTF_SHORTDATE and FDTF_LONGDATE are mutually exclusive, as is
  2298. // FDTF_SHORTIME and FDTF_LONGTIME.)
  2299. //
  2300. #define FDTF_SHORTTIME 0x00000001 // eg, "7:48 PM"
  2301. #define FDTF_SHORTDATE 0x00000002 // eg, "3/29/98"
  2302. #define FDTF_DEFAULT (FDTF_SHORTDATE | FDTF_SHORTTIME) // eg, "3/29/98 7:48 PM"
  2303. #define FDTF_LONGDATE 0x00000004 // eg, "Monday, March 29, 1998"
  2304. #define FDTF_LONGTIME 0x00000008 // eg. "7:48:33 PM"
  2305. #define FDTF_RELATIVE 0x00000010 // uses "Yesterday", etc. if possible
  2306. #define FDTF_LTRDATE 0x00000100 // Left To Right reading order
  2307. #define FDTF_RTLDATE 0x00000200 // Right To Left reading order
  2308. LWSTDAPI_(int) SHFormatDateTime%(const FILETIME UNALIGNED * pft, DWORD * pdwFlags, LPTSTR% pszBuf, UINT cchBuf);
  2309. LWSTDAPI_(SECURITY_ATTRIBUTES*) SHGetAllAccessSA();
  2310. LWSTDAPI_(int) SHAnsiToUnicode(LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf);
  2311. LWSTDAPI_(int) SHAnsiToUnicodeCP(UINT uiCP, LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf);
  2312. LWSTDAPI_(int) SHAnsiToAnsi(LPCSTR pszSrc, LPSTR pszDst, int cchBuf);
  2313. LWSTDAPI_(int) SHUnicodeToAnsi(LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf);
  2314. LWSTDAPI_(int) SHUnicodeToAnsiCP(UINT uiCP, LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf);
  2315. LWSTDAPI_(int) SHUnicodeToUnicode(LPCWSTR pwzSrc, LPWSTR pwzDst, int cwchBuf);
  2316. LWSTDAPI_(BOOL) DoesStringRoundTripA(LPCSTR pwszIn, LPSTR pszOut, UINT cchOut);
  2317. LWSTDAPI_(BOOL) DoesStringRoundTripW(LPCWSTR pwszIn, LPSTR pszOut, UINT cchOut);
  2318. #ifdef UNICODE
  2319. #define DoesStringRoundTrip DoesStringRoundTripW
  2320. #else
  2321. #define DoesStringRoundTrip DoesStringRoundTripA
  2322. #endif
  2323. // The return value from all SH<Type>To<Type> is the size of szDest including the terminater.
  2324. #ifdef UNICODE
  2325. #define SHTCharToUnicode(wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
  2326. #define SHTCharToUnicodeCP(uiCP, wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
  2327. #define SHTCharToAnsi(wzSrc, szDest, cchSize) SHUnicodeToAnsi(wzSrc, szDest, cchSize)
  2328. #define SHTCharToAnsiCP(uiCP, wzSrc, szDest, cchSize) SHUnicodeToAnsiCP(uiCP, wzSrc, szDest, cchSize)
  2329. #define SHUnicodeToTChar(wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
  2330. #define SHUnicodeToTCharCP(uiCP, wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
  2331. #define SHAnsiToTChar(szSrc, wzDest, cchSize) SHAnsiToUnicode(szSrc, wzDest, cchSize)
  2332. #define SHAnsiToTCharCP(uiCP, szSrc, wzDest, cchSize) SHAnsiToUnicodeCP(uiCP, szSrc, wzDest, cchSize)
  2333. #define SHOtherToTChar(szSrc, szDest, cchSize) SHAnsiToUnicode(szSrc, szDest, cchSize)
  2334. #define SHTCharToOther(szSrc, szDest, cchSize) SHUnicodeToAnsi(szSrc, szDest, cchSize)
  2335. #else // UNICODE
  2336. #define SHTCharToUnicode(szSrc, wzDest, cchSize) SHAnsiToUnicode(szSrc, wzDest, cchSize)
  2337. #define SHTCharToUnicodeCP(uiCP, szSrc, wzDest, cchSize) SHAnsiToUnicodeCP(uiCP, szSrc, wzDest, cchSize)
  2338. #define SHTCharToAnsi(szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
  2339. #define SHTCharToAnsiCP(uiCP, szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
  2340. #define SHUnicodeToTChar(wzSrc, szDest, cchSize) SHUnicodeToAnsi(wzSrc, szDest, cchSize)
  2341. #define SHUnicodeToTCharCP(uiCP, wzSrc, szDest, cchSize) SHUnicodeToAnsiCP(uiCP, wzSrc, szDest, cchSize)
  2342. #define SHAnsiToTChar(szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
  2343. #define SHAnsiToTCharCP(uiCP, szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
  2344. #define SHOtherToTChar(szSrc, szDest, cchSize) SHUnicodeToAnsi(szSrc, szDest, cchSize)
  2345. #define SHTCharToOther(szSrc, szDest, cchSize) SHAnsiToUnicode(szSrc, szDest, cchSize)
  2346. #endif // UNICODE
  2347. // Internal HRESULT-to-help-topic mapping structure
  2348. typedef struct _tagHRESULTHELPMAPPING
  2349. {
  2350. HRESULT hr;
  2351. LPCSTR szHelpFile;
  2352. LPCSTR szHelpTopic;
  2353. } HRESULTHELPMAPPING;
  2354. LWSTDAPI_(BOOL) SHRegisterClassA(const WNDCLASSA* pwc);
  2355. LWSTDAPI_(BOOL) SHRegisterClassW(const WNDCLASSW* pwc);
  2356. LWSTDAPI_(void) SHUnregisterClassesA(HINSTANCE hinst, const LPCSTR *rgpszClasses, UINT cpsz);
  2357. LWSTDAPI_(void) SHUnregisterClassesW(HINSTANCE hinst, const LPCWSTR *rgpszClasses, UINT cpsz);
  2358. LWSTDAPI_(int) SHMessageBoxHelpW(HWND hwnd, LPCWSTR pszText, LPCWSTR pszCaption, UINT uType, HRESULT hrErr, HRESULTHELPMAPPING* prghhm, DWORD chhm);
  2359. LWSTDAPI_(int) SHMessageBoxHelpA(HWND hwnd, LPCSTR pszText, LPCSTR pszCaption, UINT uType, HRESULT hrErr, HRESULTHELPMAPPING* prghhm, DWORD chhm);
  2360. LWSTDAPI_(int) SHMessageBoxCheckW(HWND hwnd, LPCWSTR pszText, LPCWSTR pszCaption, UINT uType, int iDefault, LPCWSTR pszRegVal);
  2361. LWSTDAPI_(int) SHMessageBoxCheckA(HWND hwnd, LPCSTR pszText, LPCSTR pszCaption, UINT uType, int iDefault, LPCSTR pszRegVal);
  2362. LWSTDAPI_(void) SHRestrictedMessageBox(HWND hwnd);
  2363. LWSTDAPI_(HMENU) SHGetMenuFromID(HMENU hmMain, UINT uID);
  2364. LWSTDAPI_(int) SHMenuIndexFromID(HMENU hm, UINT id);
  2365. LWSTDAPI_(void) SHRemoveDefaultDialogFont(HWND hDlg);
  2366. LWSTDAPI_(void) SHSetDefaultDialogFont(HWND hDlg, int idCtl);
  2367. LWSTDAPI_(void) SHRemoveAllSubMenus(HMENU hmenu);
  2368. LWSTDAPI_(void) SHEnableMenuItem(HMENU hmenu, UINT id, BOOL fEnable);
  2369. LWSTDAPI_(void) SHCheckMenuItem(HMENU hmenu, UINT id, BOOL fChecked);
  2370. LWSTDAPI_(DWORD) SHSetWindowBits(HWND hWnd, int iWhich, DWORD dwBits, DWORD dwValue);
  2371. LWSTDAPI_(HMENU) SHLoadMenuPopup(HINSTANCE hinst, UINT id);
  2372. #define SPM_POST 0x0000
  2373. #define SPM_SEND 0x0001
  2374. #define SPM_ONELEVEL 0x0002 // default: send to all descendants including grandkids, etc.
  2375. LWSTDAPI_(void) SHPropagateMessage(HWND hwndParent, UINT uMsg, WPARAM wParam, LPARAM lParam, int iFlags);
  2376. LWSTDAPI_(void) SHSetParentHwnd(HWND hwnd, HWND hwndParent);
  2377. LWSTDAPI_(UINT) SHGetCurColorRes();
  2378. LWSTDAPI_(DWORD) SHWaitForSendMessageThread(HANDLE hThread, DWORD dwTimeout);
  2379. LWSTDAPI SHWaitForCOMSendMessageThread(HANDLE hThread, DWORD dwTimeout);
  2380. LWSTDAPI_(BOOL) SHVerbExistsNA(LPCSTR szExtension, LPCSTR pszVerb, LPSTR pszCommand, DWORD cchCommand);
  2381. LWSTDAPI_(void) SHFillRectClr(HDC hdc, LPRECT prc, COLORREF clr);
  2382. LWSTDAPI_(int) SHSearchMapInt(const int *src, const int *dst, int cnt, int val);
  2383. LWSTDAPI_(CHAR) SHStripMneumonicA(LPSTR pszMenu);
  2384. LWSTDAPI_(WCHAR) SHStripMneumonicW(LPWSTR pszMenu);
  2385. LWSTDAPI SHIsChildOrSelf(HWND hwndParent, HWND hwnd);
  2386. LWSTDAPI_(DWORD) SHGetValueGoodBootA(HKEY hkeyParent, LPCSTR pcszSubKey,
  2387. LPCSTR pcszValue, PDWORD pdwValueType,
  2388. PBYTE pbyteBuf, PDWORD pdwcbBufLen);
  2389. LWSTDAPI_(DWORD) SHGetValueGoodBootW(HKEY hkeyParent, LPCWSTR pcwzSubKey,
  2390. LPCWSTR pcwzValue, PDWORD pdwValueType,
  2391. PBYTE pbyteBuf, PDWORD pdwcbBufLen);
  2392. LWSTDAPI_(LRESULT) SHDefWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  2393. LWSTDAPI_(BOOL) SHGetFileDescription%(LPCTSTR% pszPath, LPCTSTR% pszVersionKeyIn, LPCTSTR% pszCutListIn, LPTSTR% pszDesc, UINT *pcchDesc);
  2394. LWSTDAPI_(int) SHMessageBoxCheckEx%(HWND hwnd, HINSTANCE hinst, LPCTSTR% pszTemplateName, DLGPROC pDlgProc, LPVOID pData, int iDefault, LPCTSTR% pszRegVal);
  2395. #define IDC_MESSAGEBOXCHECKEX 0x1202
  2396. // Prevents shell hang do to hung window on broadcast
  2397. LWSTDAPI_(LRESULT) SHSendMessageBroadcast%(UINT uMsg, WPARAM wParam, LPARAM lParam);
  2398. #ifdef UNICODE
  2399. #define SHGetValueGoodBoot SHGetValueGoodBootW
  2400. #define SHStripMneumonic SHStripMneumonicW
  2401. #define SHMessageBoxHelp SHMessageBoxHelpW
  2402. #define SHMessageBoxCheck SHMessageBoxCheckW
  2403. #define SHRegisterClass SHRegisterClassW
  2404. #define SHUnregisterClasses SHUnregisterClassesW
  2405. #define SHSendMessageBroadcast SHSendMessageBroadcastW
  2406. #else // UNICODE
  2407. #define SHGetValueGoodBoot SHGetValueGoodBootA
  2408. #define SHStripMneumonic SHStripMneumonicA
  2409. #define SHMessageBoxHelp SHMessageBoxHelpA
  2410. #define SHMessageBoxCheck SHMessageBoxCheckA
  2411. #define SHRegisterClass SHRegisterClassA
  2412. #define SHUnregisterClasses SHUnregisterClassesA
  2413. #define SHSendMessageBroadcast SHSendMessageBroadcastA
  2414. #endif // UNICODE
  2415. // old IsOS() flags -- don't use these
  2416. // we have to keep them public since we shipped them in win2k ;internal
  2417. #define OS_MEMPHIS OS_WIN98ORGREATER // don't use this
  2418. #define OS_MEMPHIS_GOLD OS_WIN98_GOLD // don't use this
  2419. #define OS_WIN95GOLD OS_WIN95_GOLD
  2420. #define OS_WIN2000EMBED OS_EMBEDDED
  2421. #define OS_WIN2000 OS_WIN2000ORGREATER // lame, but IsOS(WIN2000) meant >= win2k
  2422. #define OS_WIN95 OS_WIN95ORGREATER // lame, but IsOS(WIN95) meant >= win95
  2423. #define OS_NT4 OS_NT4ORGREATER // lame, but IsOS(NT4) meant >= NT4
  2424. #define OS_NT5 OS_WIN2000ORGREATER // lame, but IsOS(NT5) meant >= wink2
  2425. #define OS_WIN98 OS_WIN98ORGREATER // lame, but IsOS(OS_WIN98) meant >= win98
  2426. #define OS_MILLENNIUM OS_MILLENNIUMORGREATER // lame, but IsOS(OS_MILLENNIUM) meant >= winMe
  2427. // end old flags
  2428. // Returns TRUE/FALSE depending on question
  2429. #define OS_WINDOWS 0 // windows vs. NT
  2430. #define OS_NT 1 // windows vs. NT
  2431. #define OS_WIN95ORGREATER 2 // Win95 or greater
  2432. #define OS_NT4ORGREATER 3 // NT4 or greater
  2433. // don't use (used to be OS_NT5) 4 // this flag is redundant w/ OS_WIN2000ORGREATER, use that instead ;internal
  2434. #define OS_WIN98ORGREATER 5 // Win98 or greater
  2435. #define OS_WIN98_GOLD 6 // Win98 Gold (Version 4.10 build 1998)
  2436. #define OS_WIN2000ORGREATER 7 // Some derivative of Win2000
  2437. ;begin_internal
  2438. // NOTE: these flags are bogus, they check explicitly for (dwMajorVersion == 5) so they will fail when majorversion is bumped to 6
  2439. // !!! DO NOT USE THESE FLAGS !!!
  2440. #define OS_WIN2000PRO 8 // Windows 2000 Professional (Workstation)
  2441. #define OS_WIN2000SERVER 9 // Windows 2000 Server
  2442. #define OS_WIN2000ADVSERVER 10 // Windows 2000 Advanced Server
  2443. #define OS_WIN2000DATACENTER 11 // Windows 2000 Data Center Server
  2444. #define OS_WIN2000TERMINAL 12 // Windows 2000 Terminal Server in "Application Server" mode (now simply called "Terminal Server")
  2445. // END bogus flags
  2446. ;end_internal
  2447. #define OS_EMBEDDED 13 // Embedded Windows Edition
  2448. #define OS_TERMINALCLIENT 14 // Windows Terminal Client (eg user is comming in via tsclient)
  2449. #define OS_TERMINALREMOTEADMIN 15 // Terminal Server in "Remote Administration" mode
  2450. #define OS_WIN95_GOLD 16 // Windows 95 Gold (Version 4.0 Build 1995)
  2451. #define OS_MILLENNIUMORGREATER 17 // Windows Millennium (Version 5.0)
  2452. #define OS_WHISTLERORGREATER 18 // Whistler or greater
  2453. #define OS_PERSONAL 19 // Personal (eg NOT Professional, Server, Advanced Server, or Datacenter)
  2454. #if (_WIN32_IE >= 0x0600)
  2455. #define OS_PROFESSIONAL 20 // Professional (aka Workstation; eg NOT Server, Advanced Server, or Datacenter)
  2456. #define OS_DATACENTER 21 // Datacenter (eg NOT Server, Advanced Server, Professional, or Personal)
  2457. #define OS_ADVSERVER 22 // Advanced Server (eg NOT Datacenter, Server, Professional, or Personal)
  2458. #define OS_SERVER 23 // Server (eg NOT Datacenter, Advanced Server, Professional, or Personal)
  2459. #define OS_TERMINALSERVER 24 // Terminal Server - server running in what used to be called "Application Server" mode (now simply called "Terminal Server")
  2460. // OS_TERMINALREMOTEADMIN 15 // Terminal Server - server running in "Remote Administration" mode
  2461. #define OS_PERSONALTERMINALSERVER 25 // Personal Terminal Server - per/pro machine running in single user TS mode
  2462. #define OS_FASTUSERSWITCHING 26 // Fast User Switching
  2463. #define OS_FRIENDLYLOGONUI 27 // New friendly logon UI
  2464. #define OS_DOMAINMEMBER 28 // Is this machine a member of a domain (eg NOT a workgroup)
  2465. #define OS_ANYSERVER 29 // is this machine any type of server? (eg datacenter or advanced server or server)?
  2466. #define OS_WOW6432 30 // Is this process a 32-bit process running on an 64-bit platform?
  2467. #define OS_BLADE 31 // Blade Server
  2468. #define OS_SMALLBUSINESSSERVER 32 // SBS Server
  2469. // Added for .NET Server
  2470. #define OS_TABLETPC 33 // Are we running on a TabletPC?
  2471. #define OS_SERVERADMINUI 34 // Should defaults lean towards those preferred by server administrators?
  2472. #define OS_MEDIACENTER 35 // eHome Freestyle Project
  2473. #define OS_APPLIANCE 36 // Windows .NET Appliance Server
  2474. #endif // _WIN32_IE >= 0x0600
  2475. LWSTDAPI_(BOOL) IsOS(DWORD dwOS);
  2476. ///// BEGIN Private CommandTarget helpers
  2477. //*** IOleCommandTarget helpers {
  2478. //*** octd -- OleCT direction
  2479. // NOTES
  2480. // used both as a return value from IsXxxForward, and as an iUpDown
  2481. // param for MayXxxForward.
  2482. enum octd {
  2483. // do *not* change these values; we rely upon all 3 of:
  2484. // - sign +/-
  2485. // - powers of 2
  2486. // - (?) broadcast > down
  2487. OCTD_DOWN=+1,
  2488. OCTD_DOWNBROADCAST=+2,
  2489. OCTD_UP=-1
  2490. };
  2491. #ifndef RC_INVOKED /* { rc doesn't like these long symbol names */
  2492. #ifdef __IOleCommandTarget_INTERFACE_DEFINED__
  2493. HRESULT IsQSForward(const GUID *pguidCmdGroup, int cCmds, OLECMD rgCmds[]);
  2494. // WARNING: note the hoaky cast of nCmdID to a struct ptr
  2495. #define IsExecForward(pguidCmdGroup, nCmdID) \
  2496. IsQSForward(pguidCmdGroup, 1, (OLECMD *) &nCmdID)
  2497. HRESULT MayQSForward(IUnknown *punk, int iUpDown, const GUID *pguidCmdGroup,
  2498. ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  2499. HRESULT MayExecForward(IUnknown *punk, int iUpDown, const GUID *pguidCmdGroup,
  2500. DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  2501. #endif //__IOleCommandTarget_INTERFACE_DEFINED__
  2502. #endif /* } !RC_INVOKED */
  2503. // }
  2504. ///// end
  2505. typedef struct _FDSA {
  2506. // cItem *must* be at beginning of struct for GetItemCount() to work
  2507. int cItem; // # elements
  2508. void * aItem; // data for elements (either static or dynamic)
  2509. int cItemAlloc; // # of elements currently alloc'ed (>= cItem)
  2510. int cItemGrow:8; // # of elements to grow cItemAlloc by
  2511. int cbItem:8; // sizeof element
  2512. DWORD fAllocated:1; // 1:overflowed from static to dynamic array
  2513. DWORD unused:15;
  2514. } FDSA, *PFDSA;
  2515. LWSTDAPI_(BOOL) FDSA_Initialize(int cbItem, int cItemGrow, PFDSA pfdsa, void * aItemStatic, int cItemStatic);
  2516. LWSTDAPI_(BOOL) FDSA_Destroy(PFDSA pfdsa);
  2517. LWSTDAPI_(int) FDSA_InsertItem(PFDSA pfdsa, int index, void * pitem);
  2518. LWSTDAPI_(BOOL) FDSA_DeleteItem(PFDSA pfdsa, int index);
  2519. #define FDSA_AppendItem(pfdsa, pitem) FDSA_InsertItem(pfdsa, DA_LAST, pitem)
  2520. #define FDSA_GetItemPtr(pfdsa, i, type) (&(((type *)((pfdsa)->aItem))[(i)]))
  2521. #define FDSA_GetItemCount(hdsa) (*(int *)(hdsa))
  2522. #if defined( __LPGUID_DEFINED__ )
  2523. // Copied from OLE source code
  2524. // format for string form of GUID is:
  2525. // ????{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}
  2526. #define GUIDSTR_MAX (1+ 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12 + 1 + 1)
  2527. LWSTDAPI_(BOOL) GUIDFromString%(LPCTSTR% psz, LPGUID pguid);
  2528. #endif
  2529. #ifdef _REFGUID_DEFINED
  2530. LWSTDAPI_(int) SHStringFromGUID%(UNALIGNED REFGUID rguid, LPTSTR% psz, int cchMax);
  2531. LWSTDAPI SHRegGetCLSIDKey%(UNALIGNED REFGUID rguid, LPCTSTR% lpszSubKey, BOOL fUserSpecific, BOOL fCreate, HKEY *phkey);
  2532. LWSTDAPI_(HANDLE) SHGlobalCounterCreate(REFGUID rguid);
  2533. LWSTDAPI_(HANDLE) SHGlobalCounterCreateNamed%(LPCTSTR% szName, LONG lInitialValue);
  2534. LWSTDAPI_(long) SHGlobalCounterGetValue(HANDLE hCounter);
  2535. LWSTDAPI_(long) SHGlobalCounterIncrement(HANDLE hCounter);
  2536. LWSTDAPI_(long) SHGlobalCounterDecrement(HANDLE hCounter);
  2537. #define SHGlobalCounterDestroy CloseHandle
  2538. #endif
  2539. // WNDPROCs are thunked by user to send ANSI/UNICODE messages (ex: WM_WININICHANGE)
  2540. // so providing a W version that automatically thunks to the A version
  2541. // is dangerous. but we do it anyway. if a caller needs to work on both win95 and NT
  2542. // it needs to be aware that on win95 the W version actually calls the A version.
  2543. // thus all worker windows on win95 are ANSI. this should rarely affect worker wndprocs
  2544. // because they are internal, and the messages are usually custom. but system messages
  2545. // like WM_WININICHANGE, and the WM_DDE* messages will be changed accordingly
  2546. HWND SHCreateWorkerWindowA(WNDPROC pfnWndProc, HWND hwndParent, DWORD dwExStyle, DWORD dwFlags, HMENU hmenu, void * p);
  2547. HWND SHCreateWorkerWindowW(WNDPROC pfnWndProc, HWND hwndParent, DWORD dwExStyle, DWORD dwFlags, HMENU hmenu, void * p);
  2548. #ifdef UNICODE
  2549. #define SHCreateWorkerWindow SHCreateWorkerWindowW
  2550. #else
  2551. #define SHCreateWorkerWindow SHCreateWorkerWindowA
  2552. #endif
  2553. BOOL SHAboutInfoA(LPSTR lpszInfo, DWORD cchSize);
  2554. BOOL SHAboutInfoW(LPWSTR lpszInfo, DWORD cchSize);
  2555. #ifdef UNICODE
  2556. #define SHAboutInfo SHAboutInfoW
  2557. #else
  2558. #define SHAboutInfo SHAboutInfoA
  2559. #endif
  2560. // Types for SHIsLowMemoryMachine
  2561. #define ILMM_IE4 0 // 1997-style machine
  2562. LWSTDAPI_(BOOL) SHIsLowMemoryMachine(DWORD dwType);
  2563. LWSTDAPI_(HINSTANCE) SHPinDllOfCLSID(const CLSID *pclsid);
  2564. // Menu Helpers
  2565. LWSTDAPI_(int) GetMenuPosFromID(HMENU hmenu, UINT id);
  2566. LWSTDAPI SHGetInverseCMAP(BYTE *pbMap, ULONG cbMap);
  2567. //
  2568. // Shared memory apis
  2569. //
  2570. LWSTDAPI_(HANDLE) SHAllocShared(const void *pvData, DWORD dwSize, DWORD dwProcessId);
  2571. LWSTDAPI_(BOOL) SHFreeShared(HANDLE hData,DWORD dwProcessId);
  2572. LWSTDAPI_(void *) SHLockShared(HANDLE hData, DWORD dwProcessId);
  2573. LWSTDAPI_(void *) SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL fForWriting);
  2574. LWSTDAPI_(BOOL) SHUnlockShared(void *pvData);
  2575. LWSTDAPI_(HANDLE) SHMapHandle(HANDLE h, DWORD dwProcSrc, DWORD dwProcDest, DWORD dwDesiredAccess, DWORD dwFlags);
  2576. //
  2577. // Shared memory structs
  2578. //
  2579. #define MAPHEAD_SIG 0xbaff1aff
  2580. typedef struct _shmapheader {
  2581. DWORD dwSize;
  2582. DWORD dwSig;
  2583. DWORD dwSrcId;
  2584. DWORD dwDstId;
  2585. } SHMAPHEADER; // NOTE: should always be QUADWORD alignment
  2586. #ifdef UNIX
  2587. #include <urlmon.h>
  2588. #endif /* UNIX */
  2589. //
  2590. // Zone Security APIs
  2591. //
  2592. LWSTDAPI ZoneCheckPathA(LPCSTR pszPath, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2593. LWSTDAPI ZoneCheckPathW(LPCWSTR pwzPath, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2594. LWSTDAPI ZoneCheckUrlA(LPCSTR pszUrl, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2595. LWSTDAPI ZoneCheckUrlW(LPCWSTR pwzUrl, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2596. LWSTDAPI ZoneCheckUrlExA(LPCSTR pszUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2597. LWSTDAPI ZoneCheckUrlExW(LPCWSTR pwzUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
  2598. LWSTDAPI ZoneCheckUrlExCacheA(LPCSTR pszUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize,
  2599. DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms, IInternetSecurityManager ** ppismCache);
  2600. LWSTDAPI ZoneCheckUrlExCacheW(LPCWSTR pwzUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize,
  2601. DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms, IInternetSecurityManager ** ppismCache);
  2602. LWSTDAPI ZoneCheckHost(IInternetHostSecurityManager * pihsm, DWORD dwActionType, DWORD dwFlags);
  2603. LWSTDAPI ZoneCheckHostEx(IInternetHostSecurityManager * pihsm, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext,
  2604. DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags);
  2605. LWSTDAPI_(int) ZoneComputePaneSize(HWND hwndStatus);
  2606. LWSTDAPI_(void) ZoneConfigureW(HWND hwnd, LPCWSTR pwszUrl);
  2607. #ifdef UNICODE
  2608. #define ZoneCheckUrl ZoneCheckUrlW
  2609. #define ZoneCheckPath ZoneCheckPathW
  2610. #define ZoneCheckUrlEx ZoneCheckUrlExW
  2611. #define ZoneCheckUrlExCache ZoneCheckUrlExCacheW
  2612. #else // UNICODE
  2613. #define ZoneCheckUrl ZoneCheckUrlA
  2614. #define ZoneCheckPath ZoneCheckPathA
  2615. #define ZoneCheckUrlEx ZoneCheckUrlExA
  2616. #define ZoneCheckUrlExCache ZoneCheckUrlExCacheA
  2617. #endif // UNICODE
  2618. LWSTDAPI SHRegisterValidateTemplate(LPCWSTR pwzTemplate, DWORD dwFlags);
  2619. // Flags for SHRegisterValidateTemplate
  2620. #define SHRVT_REGISTER 0x00000001
  2621. #define SHRVT_VALIDATE 0x00000002
  2622. #define SHRVT_PROMPTUSER 0x00000004
  2623. #define SHRVT_REGISTERIFPROMPTOK 0x00000008
  2624. #define SHRVT_ALLOW_INTRANET 0x00000010
  2625. #define SHRVT_VALID 0x0000001f
  2626. BOOL RegisterGlobalHotkeyW(WORD wOldHotkey, WORD wNewHotkey,LPCWSTR pcwszPath);
  2627. BOOL RegisterGlobalHotkeyA(WORD wOldHotkey, WORD wNewHotkey,LPCSTR pcszPath);
  2628. LWSTDAPI_(UINT) WhichPlatform(void);
  2629. // Return values of WhichPlatform
  2630. #define PLATFORM_UNKNOWN 0
  2631. #define PLATFORM_IE3 1 // obsolete: use PLATFORM_BROWSERONLY
  2632. #define PLATFORM_BROWSERONLY 1 // browser-only (no new shell)
  2633. #define PLATFORM_INTEGRATED 2 // integrated shell
  2634. #ifdef UNICODE
  2635. #define RegisterGlobalHotkey RegisterGlobalHotkeyW
  2636. #else // UNICODE
  2637. #define RegisterGlobalHotkey RegisterGlobalHotkeyA
  2638. #endif // UNICODE
  2639. // qistub {
  2640. //*** QueryInterface helpers
  2641. // NOTES
  2642. // ATL has a fancier version of this. if we need to extend ours, we
  2643. // should probably just switch to ATL's rather than reinvent.
  2644. // EXAMPLE
  2645. // Cfoo::QI(REFIID riid, void **ppv)
  2646. // {
  2647. // // (the IID_xxx comments make grep'ing work!)
  2648. // static const QITAB qit = {
  2649. // QITABENT(Cfoo, Iiface1), // IID_Iiface1
  2650. // ...
  2651. // QITABENT(Cfoo, IifaceN), // IID_IifaceN
  2652. // { 0 }, // n.b. don't forget the 0
  2653. // };
  2654. //
  2655. // // n.b. make sure you don't cast 'this'
  2656. // hr = QISearch(this, qit, riid, ppv);
  2657. // if (FAILED(hr))
  2658. // hr = SUPER::QI(riid, ppv);
  2659. // // custom code could be added here for FAILED() case
  2660. // return hr;
  2661. // }
  2662. typedef struct
  2663. {
  2664. const IID * piid;
  2665. int dwOffset;
  2666. } QITAB, *LPQITAB;
  2667. typedef const QITAB *LPCQITAB;
  2668. #define QITABENTMULTI(Cthis, Ifoo, Iimpl) \
  2669. { (IID*) &IID_##Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
  2670. #define QITABENTMULTI2(Cthis, Ifoo, Iimpl) \
  2671. { (IID*) &Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
  2672. #define QITABENT(Cthis, Ifoo) QITABENTMULTI(Cthis, Ifoo, Ifoo)
  2673. STDAPI QISearch(void* that, LPCQITAB pqit, REFIID riid, void **ppv);
  2674. #ifndef STATIC_CAST
  2675. //*** STATIC_CAST -- 'portable' static_cast<>
  2676. // NOTES
  2677. // do *not* use SAFE_CAST (see comment in OFFSETOFCLASS)
  2678. #define STATIC_CAST(typ) static_cast<typ>
  2679. #ifndef _X86_
  2680. // assume only intel compiler (>=vc5) supports static_cast for now
  2681. // we could key off of _MSC_VER >= 1100 but i'm not sure that will work
  2682. //
  2683. // a straight cast will give the correct result but no error checking,
  2684. // so we'll have to catch errors on intel.
  2685. #undef STATIC_CAST
  2686. #define STATIC_CAST(typ) (typ)
  2687. #endif
  2688. #endif
  2689. #ifndef OFFSETOFCLASS
  2690. //*** OFFSETOFCLASS -- (stolen from ATL)
  2691. // we use STATIC_CAST not SAFE_CAST because the compiler gets confused
  2692. // (it doesn't constant-fold the ,-op in SAFE_CAST so we end up generating
  2693. // code for the table!)
  2694. #define OFFSETOFCLASS(base, derived) \
  2695. ((DWORD)(DWORD_PTR)(STATIC_CAST(base*)((derived*)8))-8)
  2696. #endif
  2697. // } qistub
  2698. #if (_WIN32_IE >= 0x0500)
  2699. // SHRestrictionLookup
  2700. typedef struct
  2701. {
  2702. INT iFlag;
  2703. LPCWSTR pszKey;
  2704. LPCWSTR pszValue;
  2705. } SHRESTRICTIONITEMS;
  2706. LWSTDAPI_(DWORD) SHRestrictionLookup(INT iFlag, LPCWSTR pszBaseKey,
  2707. const SHRESTRICTIONITEMS *pRestrictions,
  2708. DWORD* rdwRestrictionItemValues);
  2709. LWSTDAPI_(DWORD) SHGetRestriction(LPCWSTR pszBaseKey, LPCWSTR pszGroup, LPCWSTR pszSubKey);
  2710. typedef INT_PTR (CALLBACK* SHDLGPROC)(void *lpData, HWND, UINT, WPARAM, LPARAM);
  2711. LWSTDAPI_(INT_PTR) SHDialogBox(HINSTANCE hInstance, LPCWSTR lpTemplateName,
  2712. HWND hwndParent, SHDLGPROC lpDlgFunc, void*lpData);
  2713. LWSTDAPI SHInvokeDefaultCommand(HWND hwnd, struct IShellFolder* psf, LPCITEMIDLIST pidl);
  2714. LWSTDAPI SHInvokeCommand(HWND hwnd, struct IShellFolder* psf, LPCITEMIDLIST pidl, LPCSTR lpVerb);
  2715. LWSTDAPI SHInvokeCommandOnContextMenu(HWND hwnd, struct IUnknown* punk, struct IContextMenu *pcm, DWORD fMask, LPCSTR lpVerb);
  2716. LWSTDAPI SHInvokeCommandsOnContextMenu(HWND hwnd, struct IUnknown* punk, struct IContextMenu *pcm, DWORD fMask, const LPCSTR rgszVerbs[], UINT cVerbs);
  2717. LWSTDAPI SHForwardContextMenuMsg(struct IContextMenu* pcm, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult, BOOL fAllowICM2);
  2718. LWSTDAPI IUnknown_DoContextMenuPopup(struct IUnknown *punkSite, struct IContextMenu* pcm, UINT fFlags, POINT pt);
  2719. #endif // _WIN32_IE >= 0x0500
  2720. //============= Internal Routines that are always to be built ================
  2721. LWSTDAPI_(DWORD)
  2722. GetLongPathNameWrapW(
  2723. LPCWSTR lpszShortPath,
  2724. LPWSTR lpszLongPath,
  2725. DWORD cchBuffer);
  2726. LWSTDAPI_(DWORD)
  2727. GetLongPathNameWrapA(
  2728. LPCSTR lpszShortPath,
  2729. LPSTR lpszLongPath,
  2730. DWORD cchBuffer);
  2731. #ifdef UNICODE
  2732. #define GetLongPathNameWrap GetLongPathNameWrapW
  2733. #else
  2734. #define GetLongPathNameWrap GetLongPathNameWrapA
  2735. #endif //UNICODE
  2736. //=============== Unicode Wrapper Routines ===================================
  2737. #if (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK)
  2738. //
  2739. // There are two styles of usage for the wrap functions.
  2740. //
  2741. // * Explicit wrapping.
  2742. //
  2743. // If you explicitly call GetPropWrap (for example), then
  2744. // your UNICODE build will call the wrapper function, and your ANSI
  2745. // build will call the normal ANSI API directly.
  2746. //
  2747. // Calls to GetProp, GetPropW, and GetPropA still go
  2748. // directly to the underlying system DLL that implements them.
  2749. //
  2750. // This lets you select which calls to UNICODE APIs should get
  2751. // wrapped and which should go straight through to the OS
  2752. // (and most likely fail on Win95).
  2753. //
  2754. // * Automatic wrapping.
  2755. //
  2756. // If you #include <w95wraps.h>, then when you call GetProp,
  2757. // your UNICODE build will call the wrapper function, and your ANSI
  2758. // ANSI build will call the normal ANSI API directly.
  2759. //
  2760. // This lets you just call the UNICODE APIs normally throughout
  2761. // your code, and the wrappers will do their best.
  2762. //
  2763. // Here's a table explaining what you get under the various scenarios.
  2764. //
  2765. // You Get
  2766. // <w95wraps.h> <w95wraps.h>
  2767. // You Write UNICODE ANSI UNICODE ANSI
  2768. // ============ ============ ============ ============ ============
  2769. // GetProp GetPropW GetPropA GetPropWrapW GetPropA
  2770. // GetPropWrap GetPropWrapW GetPropA GetPropWrapW GetPropA
  2771. //
  2772. // GetPropW GetPropW GetPropW GetPropWrapW GetPropWrapW
  2773. // GetPropA GetPropA GetPropA GetPropA GetPropA
  2774. // GetPropWrapW GetPropWrapW GetPropWrapW GetPropWrapW GetPropWrapW
  2775. // GetPropWrapA GetPropA GetPropA GetPropA GetPropA
  2776. //
  2777. // Final quirk: If you are running on a non-x86 platform, then the
  2778. // wrap functions are forwarded to the unwrapped functions, since
  2779. // the only OS that runs on non-x86 is NT.
  2780. //
  2781. // Before using the wrapper functions, see the warnings at the top of
  2782. // <w95wraps.h> to make sure you understand the consequences.
  2783. //
  2784. LWSTDAPI_(BOOL) IsCharAlphaWrapW(IN WCHAR ch);
  2785. LWSTDAPI_(BOOL) IsCharUpperWrapW(IN WCHAR ch);
  2786. LWSTDAPI_(BOOL) IsCharLowerWrapW(IN WCHAR ch);
  2787. LWSTDAPI_(BOOL) IsCharAlphaNumericWrapW(IN WCHAR ch);
  2788. LWSTDAPI_(BOOL)
  2789. AppendMenuWrapW(
  2790. IN HMENU hMenu,
  2791. IN UINT uFlags,
  2792. IN UINT_PTR uIDNewItem,
  2793. IN LPCWSTR lpNewItem
  2794. );
  2795. LWSTDAPI_(LRESULT)
  2796. CallWindowProcWrapW(
  2797. WNDPROC lpPrevWndFunc,
  2798. HWND hWnd,
  2799. UINT Msg,
  2800. WPARAM wParam,
  2801. LPARAM lParam);
  2802. #ifdef POST_IE5_BETA
  2803. LWSTDAPI_(BOOL) CallMsgFilterWrapW(LPMSG lpMsg, int nCode);
  2804. #endif
  2805. LWSTDAPI_(LPWSTR) CharLowerWrapW( LPWSTR pch );
  2806. LWSTDAPI_(DWORD) CharLowerBuffWrapW( LPWSTR pch, DWORD cchLength );
  2807. LWSTDAPI_(LPWSTR) CharNextWrapW(LPCWSTR lpszCurrent);
  2808. LWSTDAPI_(LPWSTR) CharPrevWrapW(LPCWSTR lpszStart, LPCWSTR lpszCurrent);
  2809. LWSTDAPI_(BOOL) CharToOemWrapW(LPCWSTR lpszSrc, LPSTR lpszDst);
  2810. LWSTDAPI_(LPWSTR) CharUpperWrapW( LPWSTR pch );
  2811. LWSTDAPI_(DWORD) CharUpperBuffWrapW( LPWSTR pch, DWORD cchLength );
  2812. LWSTDAPI_(HRESULT) CLSIDFromStringWrap(LPOLESTR lpsz, LPCLSID pclsid);
  2813. LWSTDAPI_(HRESULT) CLSIDFromProgIDWrap(LPCOLESTR lpszProgID, LPCLSID lpclsid);
  2814. LWSTDAPI_(int)
  2815. CompareStringWrapW(
  2816. LCID Locale,
  2817. DWORD dwCmpFlags,
  2818. LPCWSTR lpString1,
  2819. int cchCount1,
  2820. LPCWSTR lpString2,
  2821. int cchCount2);
  2822. LWSTDAPI_(int)
  2823. CopyAcceleratorTableWrapW(
  2824. HACCEL hAccelSrc,
  2825. LPACCEL lpAccelDst,
  2826. int cAccelEntries);
  2827. LWSTDAPI_(HACCEL)
  2828. CreateAcceleratorTableWrapW(LPACCEL lpAccel, int cEntries);
  2829. LWSTDAPI_(HDC)
  2830. CreateDCWrapW(
  2831. LPCWSTR lpszDriver,
  2832. LPCWSTR lpszDevice,
  2833. LPCWSTR lpszOutput,
  2834. CONST DEVMODEW * lpInitData);
  2835. LWSTDAPI_(BOOL)
  2836. CreateDirectoryWrapW(
  2837. LPCWSTR lpPathName,
  2838. LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  2839. LWSTDAPI_(HANDLE)
  2840. CreateEventWrapW(
  2841. LPSECURITY_ATTRIBUTES lpEventAttributes,
  2842. BOOL bManualReset,
  2843. BOOL bInitialState,
  2844. LPCWSTR lpName);
  2845. LWSTDAPI_(HANDLE)
  2846. CreateFileWrapW(
  2847. LPCWSTR lpFileName,
  2848. DWORD dwDesiredAccess,
  2849. DWORD dwShareMode,
  2850. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  2851. DWORD dwCreationDisposition,
  2852. DWORD dwFlagsAndAttributes,
  2853. HANDLE hTemplateFile);
  2854. LWSTDAPI_(HFONT)
  2855. CreateFontIndirectWrapW(CONST LOGFONTW * plfw);
  2856. LWSTDAPI_(HDC)
  2857. CreateICWrapW(
  2858. LPCWSTR lpszDriver,
  2859. LPCWSTR lpszDevice,
  2860. LPCWSTR lpszOutput,
  2861. CONST DEVMODEW * lpInitData);
  2862. LWSTDAPI_(HWND)
  2863. CreateWindowExWrapW(
  2864. DWORD dwExStyle,
  2865. LPCWSTR lpClassName,
  2866. LPCWSTR lpWindowName,
  2867. DWORD dwStyle,
  2868. int X,
  2869. int Y,
  2870. int nWidth,
  2871. int nHeight,
  2872. HWND hWndParent,
  2873. HMENU hMenu,
  2874. HINSTANCE hInstance,
  2875. void * lpParam);
  2876. LWSTDAPI_(LRESULT)
  2877. DefWindowProcWrapW(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  2878. LWSTDAPI_(BOOL) DeleteFileWrapW(LPCWSTR pwsz);
  2879. LWSTDAPI_(LRESULT)
  2880. DispatchMessageWrapW(CONST MSG * lpMsg);
  2881. LWSTDAPI_(int)
  2882. DrawTextWrapW(
  2883. HDC hDC,
  2884. LPCWSTR lpString,
  2885. int nCount,
  2886. LPRECT lpRect,
  2887. UINT uFormat);
  2888. LWSTDAPI_(int)
  2889. EnumFontFamiliesWrapW(
  2890. HDC hdc,
  2891. LPCWSTR lpszFamily,
  2892. FONTENUMPROCW lpEnumFontProc,
  2893. LPARAM lParam);
  2894. LWSTDAPI_(int)
  2895. EnumFontFamiliesExWrapW(
  2896. HDC hdc,
  2897. LPLOGFONTW lplfw,
  2898. FONTENUMPROCW lpEnumFontProc,
  2899. LPARAM lParam,
  2900. DWORD dwFlags );
  2901. LWSTDAPI_(BOOL)
  2902. EnumResourceNamesWrapW(
  2903. HINSTANCE hModule,
  2904. LPCWSTR lpType,
  2905. ENUMRESNAMEPROCW lpEnumFunc,
  2906. LONG_PTR lParam);
  2907. LWSTDAPI_(BOOL)
  2908. ExtTextOutWrapW(
  2909. HDC hdc,
  2910. int x,
  2911. int y,
  2912. UINT fuOptions,
  2913. CONST RECT * lprc,
  2914. LPCWSTR lpString,
  2915. UINT nCount,
  2916. CONST INT * lpDx);
  2917. LWSTDAPI_(HANDLE)
  2918. FindFirstFileWrapW(
  2919. LPCWSTR lpFileName,
  2920. LPWIN32_FIND_DATAW pwszFd);
  2921. LWSTDAPI_(HRSRC)
  2922. FindResourceWrapW(HINSTANCE hModule, LPCWSTR lpName, LPCWSTR lpType);
  2923. LWSTDAPI_(HWND)
  2924. FindWindowWrapW(LPCWSTR lpClassName, LPCWSTR lpWindowName);
  2925. LWSTDAPI_(DWORD)
  2926. FormatMessageWrapW(
  2927. DWORD dwFlags,
  2928. LPCVOID lpSource,
  2929. DWORD dwMessageId,
  2930. DWORD dwLanguageId,
  2931. LPWSTR lpBuffer,
  2932. DWORD nSize,
  2933. va_list * Arguments);
  2934. LWSTDAPI_(BOOL)
  2935. GetClassInfoWrapW(HINSTANCE hModule, LPCWSTR lpClassName, LPWNDCLASSW lpWndClassW);
  2936. LWSTDAPI_(DWORD)
  2937. GetClassLongWrapW(HWND hWnd, int nIndex);
  2938. LWSTDAPI_(int)
  2939. GetClassNameWrapW(HWND hWnd, LPWSTR lpClassName, int nMaxCount);
  2940. LWSTDAPI_(int)
  2941. GetClipboardFormatNameWrapW(UINT format, LPWSTR lpFormatName, int cchFormatName);
  2942. LWSTDAPI_(DWORD)
  2943. GetCurrentDirectoryWrapW(DWORD nBufferLength, LPWSTR lpBuffer);
  2944. LWSTDAPI_(UINT)
  2945. GetDlgItemTextWrapW(
  2946. HWND hWndDlg,
  2947. int idControl,
  2948. LPWSTR lpsz,
  2949. int cchMax);
  2950. LWSTDAPI_(DWORD)
  2951. GetFileAttributesWrapW(LPCWSTR lpFileName);
  2952. // Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
  2953. STDAPI_(BOOL)
  2954. GetFileVersionInfoWrapW(LPCWSTR pwzFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData);
  2955. // Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
  2956. STDAPI_(DWORD)
  2957. GetFileVersionInfoSizeWrapW(LPCWSTR pwzFilename, LPDWORD lpdwHandle);
  2958. LWSTDAPI_(DWORD)
  2959. GetFullPathNameWrapW( LPCWSTR lpFileName,
  2960. DWORD nBufferLength,
  2961. LPWSTR lpBuffer,
  2962. LPWSTR *lpFilePart);
  2963. LWSTDAPI_(int)
  2964. GetLocaleInfoWrapW(LCID Locale, LCTYPE LCType, LPWSTR lpsz, int cchData);
  2965. LWSTDAPI_(int)
  2966. GetMenuStringWrapW(
  2967. HMENU hMenu,
  2968. UINT uIDItem,
  2969. LPWSTR lpString,
  2970. int nMaxCount,
  2971. UINT uFlag);
  2972. LWSTDAPI_(BOOL)
  2973. GetMessageWrapW(
  2974. LPMSG lpMsg,
  2975. HWND hWnd,
  2976. UINT wMsgFilterMin,
  2977. UINT wMsgFilterMax);
  2978. LWSTDAPI_(DWORD)
  2979. GetModuleFileNameWrapW(HINSTANCE hModule, LPWSTR pwszFilename, DWORD nSize);
  2980. LWSTDAPI_(UINT)
  2981. GetSystemDirectoryWrapW(LPWSTR lpBuffer, UINT uSize);
  2982. LWSTDAPI_(DWORD)
  2983. GetEnvironmentVariableWrapW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize);
  2984. LWSTDAPI_(DWORD)
  2985. SearchPathWrapW(
  2986. LPCWSTR lpPathName,
  2987. LPCWSTR lpFileName,
  2988. LPCWSTR lpExtension,
  2989. DWORD cchReturnBuffer,
  2990. LPWSTR lpReturnBuffer,
  2991. LPWSTR * plpfilePart);
  2992. LWSTDAPI_(HMODULE)
  2993. GetModuleHandleWrapW(LPCWSTR lpModuleName);
  2994. LWSTDAPI_(int)
  2995. GetObjectWrapW(HGDIOBJ hgdiObj, int cbBuffer, void *lpvObj);
  2996. LWSTDAPI_(UINT)
  2997. GetPrivateProfileIntWrapW(
  2998. LPCWSTR lpAppName,
  2999. LPCWSTR lpKeyName,
  3000. INT nDefault,
  3001. LPCWSTR lpFileName);
  3002. LWSTDAPI_(DWORD)
  3003. GetProfileStringWrapW(
  3004. LPCWSTR lpAppName,
  3005. LPCWSTR lpKeyName,
  3006. LPCWSTR lpDefault,
  3007. LPWSTR lpBuffer,
  3008. DWORD dwBuffersize);
  3009. LWSTDAPI_(HANDLE)
  3010. GetPropWrapW(HWND hWnd, LPCWSTR lpString);
  3011. LWSTDAPI_(ATOM)
  3012. GlobalAddAtomWrapW(LPCWSTR lpAtomName);
  3013. LWSTDAPI_(ATOM)
  3014. GlobalFindAtomWrapW(LPCWSTR lpAtomName);
  3015. LWSTDAPI_(DWORD)
  3016. GetShortPathNameWrapW(
  3017. LPCWSTR lpszLongPath,
  3018. LPWSTR lpszShortPath,
  3019. DWORD cchBuffer);
  3020. LWSTDAPI_(BOOL)
  3021. GetStringTypeExWrapW(LCID lcid, DWORD dwInfoType, LPCWSTR lpSrcStr, int cchSrc, LPWORD lpCharType);
  3022. LWSTDAPI_(UINT)
  3023. GetTempFileNameWrapW(
  3024. LPCWSTR lpPathName,
  3025. LPCWSTR lpPrefixString,
  3026. UINT uUnique,
  3027. LPWSTR lpTempFileName);
  3028. LWSTDAPI_(DWORD)
  3029. GetTempPathWrapW(DWORD nBufferLength, LPWSTR lpBuffer);
  3030. LWSTDAPI_(BOOL)
  3031. GetTextExtentPoint32WrapW(
  3032. HDC hdc,
  3033. LPCWSTR pwsz,
  3034. int cb,
  3035. LPSIZE pSize);
  3036. LWSTDAPI_(int)
  3037. GetTextFaceWrapW(
  3038. HDC hdc,
  3039. int cch,
  3040. LPWSTR lpFaceName);
  3041. LWSTDAPI_(BOOL)
  3042. GetTextMetricsWrapW(HDC hdc, LPTEXTMETRICW lptm);
  3043. LWSTDAPI_(BOOL)
  3044. GetUserNameWrapW(LPWSTR lpUserName, LPDWORD lpcchName);
  3045. LWSTDAPI_(LONG)
  3046. GetWindowLongWrapW(HWND hWnd, int nIndex);
  3047. LWSTDAPI_(int)
  3048. GetWindowTextWrapW(HWND hWnd, LPWSTR lpString, int nMaxCount);
  3049. LWSTDAPI_(int)
  3050. GetWindowTextLengthWrapW(HWND hWnd);
  3051. LWSTDAPI_(UINT)
  3052. GetWindowsDirectoryWrapW(LPWSTR lpWinPath, UINT cch);
  3053. LWSTDAPI_(BOOL)
  3054. InsertMenuWrapW(
  3055. HMENU hMenu,
  3056. UINT uPosition,
  3057. UINT uFlags,
  3058. UINT_PTR uIDNewItem,
  3059. LPCWSTR lpNewItem);
  3060. LWSTDAPI_(BOOL)
  3061. IsDialogMessageWrapW(HWND hWndDlg, LPMSG lpMsg);
  3062. LWSTDAPI_(HACCEL)
  3063. LoadAcceleratorsWrapW(HINSTANCE hInstance, LPCWSTR lpTableName);
  3064. LWSTDAPI_(HBITMAP)
  3065. LoadBitmapWrapW(HINSTANCE hInstance, LPCWSTR lpBitmapName);
  3066. LWSTDAPI_(HCURSOR)
  3067. LoadCursorWrapW(HINSTANCE hInstance, LPCWSTR lpCursorName);
  3068. LWSTDAPI_(HICON)
  3069. LoadIconWrapW(HINSTANCE hInstance, LPCWSTR lpIconName);
  3070. LWSTDAPI_(HANDLE)
  3071. LoadImageWrapA(
  3072. HINSTANCE hInstance,
  3073. LPCSTR lpName,
  3074. UINT uType,
  3075. int cxDesired,
  3076. int cyDesired,
  3077. UINT fuLoad);
  3078. LWSTDAPI_(HANDLE)
  3079. LoadImageWrapW(
  3080. HINSTANCE hInstance,
  3081. LPCWSTR lpName,
  3082. UINT uType,
  3083. int cxDesired,
  3084. int cyDesired,
  3085. UINT fuLoad);
  3086. LWSTDAPI_(HINSTANCE)
  3087. LoadLibraryExWrapW(
  3088. LPCWSTR lpLibFileName,
  3089. HANDLE hFile,
  3090. DWORD dwFlags);
  3091. LWSTDAPI_(HMENU)
  3092. LoadMenuWrapW(HINSTANCE hInstance, LPCWSTR lpMenuName);
  3093. LWSTDAPI_(int)
  3094. LoadStringWrapW(HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int nBufferMax);
  3095. #ifndef UNIX
  3096. LWSTDAPI_(BOOL)
  3097. MessageBoxIndirectWrapW(CONST MSGBOXPARAMSW *pmbp);
  3098. #else
  3099. LWSTDAPI_(int)
  3100. MessageBoxIndirectWrapW(LPMSGBOXPARAMSW pmbp);
  3101. #endif /* UNIX */
  3102. LWSTDAPI_(BOOL)
  3103. ModifyMenuWrapW(
  3104. HMENU hMenu,
  3105. UINT uPosition,
  3106. UINT uFlags,
  3107. UINT_PTR uIDNewItem,
  3108. LPCWSTR lpNewItem);
  3109. LWSTDAPI_(BOOL)
  3110. GetCharWidth32WrapW(
  3111. HDC hdc,
  3112. UINT iFirstChar,
  3113. UINT iLastChar,
  3114. LPINT lpBuffer);
  3115. LWSTDAPI_(DWORD)
  3116. GetCharacterPlacementWrapW(
  3117. HDC hdc, // handle to device context
  3118. LPCWSTR lpString, // pointer to string
  3119. int nCount, // number of characters in string
  3120. int nMaxExtent, // maximum extent for displayed string
  3121. LPGCP_RESULTSW lpResults, // pointer to buffer for placement result
  3122. DWORD dwFlags // placement flags
  3123. );
  3124. LWSTDAPI_(BOOL)
  3125. CopyFileWrapW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, BOOL bFailIfExists);
  3126. LWSTDAPI_(BOOL)
  3127. MoveFileWrapW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName);
  3128. LWSTDAPI_(BOOL)
  3129. OemToCharWrapW(LPCSTR lpszSrc, LPWSTR lpszDst);
  3130. LWSTDAPI_(HANDLE)
  3131. OpenEventWrapW(
  3132. DWORD fdwAccess,
  3133. BOOL fInherit,
  3134. LPCWSTR lpszEventName);
  3135. LWSTDAPI_(void)
  3136. OutputDebugStringWrapW(LPCWSTR lpOutputString);
  3137. LWSTDAPI_(BOOL)
  3138. PeekMessageWrapW(
  3139. LPMSG lpMsg,
  3140. HWND hWnd,
  3141. UINT wMsgFilterMin,
  3142. UINT wMsgFilterMax,
  3143. UINT wRemoveMsg);
  3144. LWSTDAPI_(BOOL)
  3145. PlaySoundWrapW(
  3146. LPCWSTR pszSound,
  3147. HMODULE hmod,
  3148. DWORD fdwSound);
  3149. LWSTDAPI_(BOOL)
  3150. PostMessageWrapW(
  3151. HWND hWnd,
  3152. UINT Msg,
  3153. WPARAM wParam,
  3154. LPARAM lParam);
  3155. LWSTDAPI_(BOOL)
  3156. PostThreadMessageWrapW(
  3157. DWORD idThread,
  3158. UINT Msg,
  3159. WPARAM wParam,
  3160. LPARAM lParam);
  3161. LWSTDAPI_(LONG)
  3162. RegCreateKeyWrapW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult);
  3163. LWSTDAPI_(LONG)
  3164. RegCreateKeyExWrapW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
  3165. LWSTDAPI_(LONG)
  3166. RegDeleteKeyWrapW(HKEY hKey, LPCWSTR pwszSubKey);
  3167. LWSTDAPI_(LONG)
  3168. RegDeleteValueWrapW(HKEY hKey, LPCWSTR pwszSubKey);
  3169. LWSTDAPI_(LONG)
  3170. RegEnumKeyWrapW(
  3171. HKEY hKey,
  3172. DWORD dwIndex,
  3173. LPWSTR lpName,
  3174. DWORD cbName);
  3175. LWSTDAPI_(LONG)
  3176. RegEnumKeyExWrapW(
  3177. HKEY hKey,
  3178. DWORD dwIndex,
  3179. LPWSTR lpName,
  3180. LPDWORD lpcbName,
  3181. LPDWORD lpReserved,
  3182. LPWSTR lpClass,
  3183. LPDWORD lpcbClass,
  3184. PFILETIME lpftLastWriteTime);
  3185. LWSTDAPI_(LONG)
  3186. RegOpenKeyWrapW(HKEY hKey, LPCWSTR pwszSubKey, PHKEY phkResult);
  3187. LWSTDAPI_(LONG)
  3188. RegOpenKeyExWrapW(
  3189. HKEY hKey,
  3190. LPCWSTR lpSubKey,
  3191. DWORD ulOptions,
  3192. REGSAM samDesired,
  3193. PHKEY phkResult);
  3194. LWSTDAPI_(LONG)
  3195. RegQueryInfoKeyWrapW(
  3196. HKEY hKey,
  3197. LPWSTR lpClass,
  3198. LPDWORD lpcbClass,
  3199. LPDWORD lpReserved,
  3200. LPDWORD lpcSubKeys,
  3201. LPDWORD lpcbMaxSubKeyLen,
  3202. LPDWORD lpcbMaxClassLen,
  3203. LPDWORD lpcValues,
  3204. LPDWORD lpcbMaxValueNameLen,
  3205. LPDWORD lpcbMaxValueLen,
  3206. LPDWORD lpcbSecurityDescriptor,
  3207. PFILETIME lpftLastWriteTime);
  3208. LWSTDAPI_(LONG)
  3209. RegQueryValueWrapW(
  3210. HKEY hKey,
  3211. LPCWSTR pwszSubKey,
  3212. LPWSTR pwszValue,
  3213. PLONG lpcbValue);
  3214. LWSTDAPI_(LONG)
  3215. RegQueryValueExWrapW(
  3216. HKEY hKey,
  3217. LPCWSTR lpValueName,
  3218. LPDWORD lpReserved,
  3219. LPDWORD lpType,
  3220. LPBYTE lpData,
  3221. LPDWORD lpcbData);
  3222. LWSTDAPI_(LONG)
  3223. RegSetValueWrapW(
  3224. HKEY hKey,
  3225. LPCWSTR lpSubKey,
  3226. DWORD dwType,
  3227. LPCWSTR lpData,
  3228. DWORD cbData);
  3229. LWSTDAPI_(LONG)
  3230. RegSetValueExWrapW(
  3231. HKEY hKey,
  3232. LPCWSTR lpValueName,
  3233. DWORD Reserved,
  3234. DWORD dwType,
  3235. CONST BYTE* lpData,
  3236. DWORD cbData);
  3237. LWSTDAPI_(ATOM)
  3238. RegisterClassWrapW(CONST WNDCLASSW * lpWndClass);
  3239. LWSTDAPI_(UINT)
  3240. RegisterClipboardFormatWrapW(LPCWSTR lpString);
  3241. LWSTDAPI_(UINT)
  3242. RegisterWindowMessageWrapW(LPCWSTR lpString);
  3243. LWSTDAPI_(BOOL)
  3244. RemoveDirectoryWrapW(LPCWSTR lpszDir);
  3245. LWSTDAPI_(HANDLE)
  3246. RemovePropWrapW(
  3247. HWND hWnd,
  3248. LPCWSTR lpString);
  3249. LWSTDAPI_(LRESULT)
  3250. SendDlgItemMessageWrapW(
  3251. HWND hDlg,
  3252. int nIDDlgItem,
  3253. UINT Msg,
  3254. WPARAM wParam,
  3255. LPARAM lParam);
  3256. LWSTDAPI_(LRESULT)
  3257. SendMessageWrapW(
  3258. HWND hWnd,
  3259. UINT Msg,
  3260. WPARAM wParam,
  3261. LPARAM lParam);
  3262. LWSTDAPI_(LRESULT)
  3263. SendMessageTimeoutWrapW(
  3264. HWND hWnd,
  3265. UINT Msg,
  3266. WPARAM wParam,
  3267. LPARAM lParam,
  3268. UINT uFlags,
  3269. UINT uTimeout,
  3270. PULONG_PTR lpdwResult);
  3271. LWSTDAPI_(BOOL)
  3272. SetCurrentDirectoryWrapW(LPCWSTR lpszCurDir);
  3273. LWSTDAPI_(BOOL)
  3274. SetDlgItemTextWrapW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString);
  3275. LWSTDAPI_(BOOL)
  3276. SetMenuItemInfoWrapW(
  3277. HMENU hMenu,
  3278. UINT uItem,
  3279. BOOL fByPosition,
  3280. LPCMENUITEMINFOW lpmiiW);
  3281. LWSTDAPI_(BOOL)
  3282. SetPropWrapW(
  3283. HWND hWnd,
  3284. LPCWSTR lpString,
  3285. HANDLE hData);
  3286. LWSTDAPI_(LONG)
  3287. SetWindowLongWrapW(HWND hWnd, int nIndex, LONG dwNewLong);
  3288. LWSTDAPI_(HHOOK)
  3289. SetWindowsHookExWrapW(
  3290. int idHook,
  3291. HOOKPROC lpfn,
  3292. HINSTANCE hmod,
  3293. DWORD dwThreadId);
  3294. LWSTDAPI_(int)
  3295. StartDocWrapW( HDC hDC, const DOCINFOW * lpdi );
  3296. LWSTDAPI_(BOOL)
  3297. SystemParametersInfoWrapW(
  3298. UINT uiAction,
  3299. UINT uiParam,
  3300. void *pvParam,
  3301. UINT fWinIni);
  3302. LWSTDAPI_(BOOL)
  3303. TrackPopupMenuWrap(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, CONST RECT *prcRect);
  3304. LWSTDAPI_(BOOL)
  3305. TrackPopupMenuExWrap(HMENU hMenu, UINT uFlags, int x, int y, HWND hWnd, LPTPMPARAMS lptpm);
  3306. LWSTDAPI_(int)
  3307. TranslateAcceleratorWrapW(HWND hWnd, HACCEL hAccTable, LPMSG lpMsg);
  3308. LWSTDAPI_(BOOL)
  3309. UnregisterClassWrapW(LPCWSTR lpClassName, HINSTANCE hInstance);
  3310. // Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
  3311. STDAPI_(BOOL)
  3312. VerQueryValueWrapW(const LPVOID pBlock, LPWSTR pwzSubBlock, LPVOID *ppBuffer, PUINT puLen);
  3313. LWSTDAPI_(SHORT)
  3314. VkKeyScanWrapW(WCHAR ch);
  3315. LWSTDAPI_(BOOL)
  3316. WinHelpWrapW(HWND hwnd, LPCWSTR szFile, UINT uCmd, DWORD_PTR dwData);
  3317. LWSTDAPI_(int)
  3318. wvsprintfWrapW(LPWSTR pwszOut, LPCWSTR pwszFormat, va_list arglist);
  3319. // Cannot be LWSTDAPI because winnetp.h declares the function as STDAPI and not DLLIMPORT
  3320. STDAPI_(DWORD) WNetRestoreConnectionWrapW(IN HWND hwndParent, IN LPCWSTR pwzDevice);
  3321. // Cannot be LWSTDAPI because winnetwk.h declares the function as STDAPI and not DLLIMPORT
  3322. STDAPI_(DWORD) WNetGetLastErrorWrapW(OUT LPDWORD pdwError, OUT LPWSTR pwzErrorBuf, IN DWORD cchErrorBufSize, OUT LPWSTR pwzNameBuf, IN DWORD cchNameBufSize);
  3323. LWSTDAPI_(int) DrawTextExWrapW(HDC hdc, LPWSTR pwzText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams);
  3324. LWSTDAPI_(BOOL) GetMenuItemInfoWrapW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOW pmiiW);
  3325. LWSTDAPI_(BOOL) InsertMenuItemWrapW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW pmiiW);
  3326. LWSTDAPI_(HFONT) CreateFontWrapW(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, DWORD fdwItalic, DWORD fdwUnderline,
  3327. DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision,
  3328. DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCWSTR lpszFace);
  3329. LWSTDAPI_(HDC) CreateMetaFileWrapW(LPCWSTR pwzFile);
  3330. LWSTDAPI_(HANDLE) CreateMutexWrapW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR pwzName);
  3331. LWSTDAPI_(DWORD) ExpandEnvironmentStringsWrapW(LPCWSTR pwszSrc, LPWSTR pwszDst, DWORD cchSize);
  3332. LWSTDAPI_(DWORD) SHExpandEnvironmentStrings%(LPCTSTR% pszSrc, LPTSTR% pszDst, DWORD cchSize);
  3333. LWSTDAPI_(DWORD) SHExpandEnvironmentStringsForUser%(HANDLE hToken, LPCTSTR% pszSrc, LPTSTR% pszDst, DWORD cchSize);
  3334. LWSTDAPI_(HANDLE) CreateSemaphoreWrapW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR pwzName);
  3335. LWSTDAPI_(BOOL) IsBadStringPtrWrapW(LPCWSTR pwzString, UINT_PTR ucchMax);
  3336. LWSTDAPI_(HINSTANCE) LoadLibraryWrapW(LPCWSTR pwzLibFileName);
  3337. LWSTDAPI_(int) GetTimeFormatWrapW(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpTime, LPCWSTR pwzFormat, LPWSTR pwzTimeStr, int cchTime);
  3338. LWSTDAPI_(int) GetDateFormatWrapW(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpDate, LPCWSTR pwzFormat, LPWSTR pwzDateStr, int cchDate);
  3339. LWSTDAPI_(DWORD) GetPrivateProfileStringWrapW(LPCWSTR pwzAppName, LPCWSTR pwzKeyName, LPCWSTR pwzDefault, LPWSTR pwzReturnedString, DWORD cchSize, LPCWSTR pwzFileName);
  3340. LWSTDAPI_(BOOL) WritePrivateProfileStringWrapW(LPCWSTR pwzAppName, LPCWSTR pwzKeyName, LPCWSTR pwzString, LPCWSTR pwzFileName);
  3341. #ifndef SHFILEINFO_DEFINED
  3342. #define SHFILEINFO_DEFINED
  3343. /*
  3344. * The SHGetFileInfo API provides an easy way to get attributes
  3345. * for a file given a pathname.
  3346. *
  3347. * PARAMETERS
  3348. *
  3349. * pszPath file name to get info about
  3350. * dwFileAttributes file attribs, only used with SHGFI_USEFILEATTRIBUTES
  3351. * psfi place to return file info
  3352. * cbFileInfo size of structure
  3353. * uFlags flags
  3354. *
  3355. * RETURN
  3356. * TRUE if things worked
  3357. */
  3358. typedef struct _SHFILEINFO%
  3359. {
  3360. HICON hIcon; // out: icon
  3361. int iIcon; // out: icon index
  3362. DWORD dwAttributes; // out: SFGAO_ flags
  3363. TCHAR% szDisplayName[MAX_PATH]; // out: display name (or path)
  3364. TCHAR% szTypeName[80]; // out: type name
  3365. } SHFILEINFO%;
  3366. // NOTE: This is also in shellapi.h. Please keep in synch.
  3367. #endif // !SHFILEINFO_DEFINED
  3368. LWSTDAPI_(DWORD_PTR) SHGetFileInfoWrapW(LPCWSTR pwzPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
  3369. LWSTDAPI_(ATOM) RegisterClassExWrapW(CONST WNDCLASSEXW *pwcx);
  3370. LWSTDAPI_(BOOL) GetClassInfoExWrapW(HINSTANCE hinst, LPCWSTR pwzClass, LPWNDCLASSEXW lpwcx);
  3371. // This allows us to be included either before or after shellapi.h
  3372. #ifdef STRICT
  3373. LWSTDAPI_(UINT) DragQueryFileWrapW(struct HDROP__*,UINT,LPWSTR,UINT);
  3374. #else
  3375. LWSTDAPI_(UINT) DragQueryFileWrapW(HANDLE,UINT,LPWSTR,UINT);
  3376. #endif
  3377. LWSTDAPI_(HWND) FindWindowExWrapW(HWND hwndParent, HWND hwndChildAfter, LPCWSTR pwzClassName, LPCWSTR pwzWindowName);
  3378. LWSTDAPI_(LPITEMIDLIST) SHBrowseForFolderWrapW(struct _browseinfoW * pbiW);
  3379. LWSTDAPI_(BOOL) SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl, LPWSTR pwzPath);
  3380. LWSTDAPI_(BOOL) SHGetNewLinkInfoWrapW(LPCWSTR pszpdlLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  3381. LWSTDAPI SHDefExtractIconWrapW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  3382. LWSTDAPI_(BOOL) GetUserNameWrapW(LPWSTR pszBuffer, LPDWORD pcch);
  3383. LWSTDAPI_(LONG) RegEnumValueWrapW(HKEY hkey, DWORD dwIndex, LPWSTR lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
  3384. LWSTDAPI_(BOOL) WritePrivateProfileStructWrapW(LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
  3385. LWSTDAPI_(BOOL) GetPrivateProfileStructWrapW(LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
  3386. LWSTDAPI_(BOOL) CreateProcessWrapW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,
  3387. LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory,
  3388. LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
  3389. LWSTDAPI_(HICON) ExtractIconWrapW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex);
  3390. #ifndef WIN32_LEAN_AND_MEAN
  3391. // Cannot be LWSTDAPI because ddeml.h declares the function as STDAPI and not DLLIMPORT
  3392. STDAPI_(UINT) DdeInitializeWrapW(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes);
  3393. STDAPI_(HSZ) DdeCreateStringHandleWrapW(DWORD idInst, LPCWSTR psz, int iCodePage);
  3394. STDAPI_(DWORD) DdeQueryStringWrapW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, int iCodePage);
  3395. LWSTDAPI_(BOOL) GetSaveFileNameWrapW(LPOPENFILENAMEW lpofn);
  3396. LWSTDAPI_(BOOL) GetOpenFileNameWrapW(LPOPENFILENAMEW lpofn);
  3397. LWSTDAPI_(BOOL) PrintDlgWrapW(LPPRINTDLGW lppd);
  3398. LWSTDAPI_(BOOL) PageSetupDlgWrapW(LPPAGESETUPDLGW lppsd);
  3399. #endif
  3400. LWSTDAPI_(void) SHChangeNotifyWrap(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  3401. LWSTDAPI_(void) SHFlushSFCacheWrap(void);
  3402. LWSTDAPI_(BOOL) ShellExecuteExWrapW(struct _SHELLEXECUTEINFOW * pExecInfoW);
  3403. LWSTDAPI_(int) SHFileOperationWrapW(struct _SHFILEOPSTRUCTW * pFileOpW);
  3404. LWSTDAPI_(UINT) ExtractIconExWrapW(LPCWSTR pwzFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
  3405. LWSTDAPI_(BOOL) SetFileAttributesWrapW(LPCWSTR pwzFile, DWORD dwFileAttributes);
  3406. LWSTDAPI_(int) GetNumberFormatWrapW(LCID Locale, DWORD dwFlags, LPCWSTR pwzValue, CONST NUMBERFMTW * pFormatW, LPWSTR pwzNumberStr, int cchNumber);
  3407. LWSTDAPI_(int) MessageBoxWrapW(HWND hwnd, LPCWSTR pwzText, LPCWSTR pwzCaption, UINT uType);
  3408. LWSTDAPI_(BOOL) FindNextFileWrapW(HANDLE hSearchHandle, LPWIN32_FIND_DATAW pFindFileDataW);
  3409. #ifdef UNICODE
  3410. #define IsCharAlphaWrap IsCharAlphaWrapW
  3411. #define IsCharUpperWrap IsCharUpperWrapW
  3412. #define IsCharLowerWrap IsCharLowerWrapW
  3413. #define IsCharAlphaNumericWrap IsCharAlphaNumericWrapW
  3414. #define AppendMenuWrap AppendMenuWrapW
  3415. #ifdef POST_IE5_BETA
  3416. #define CallMsgFilterWrap CallMsgFilterWrapW
  3417. #endif
  3418. #define CallWindowProcWrap CallWindowProcWrapW
  3419. #define CharLowerWrap CharLowerWrapW
  3420. #define CharLowerBuffWrap CharLowerBuffWrapW
  3421. #define CharNextWrap CharNextWrapW
  3422. #define CharPrevWrap CharPrevWrapW
  3423. #define CharToOemWrap CharToOemWrapW
  3424. #define CharUpperWrap CharUpperWrapW
  3425. #define CharUpperBuffWrap CharUpperBuffWrapW
  3426. #define CompareStringWrap CompareStringWrapW
  3427. #define CopyAcceleratorTableWrap CopyAcceleratorTableWrapW
  3428. #define CreateAcceleratorTableWrap CreateAcceleratorTableWrapW
  3429. #define CreateDCWrap CreateDCWrapW
  3430. #define CreateDirectoryWrap CreateDirectoryWrapW
  3431. #define CreateEventWrap CreateEventWrapW
  3432. #define CreateFontWrap CreateFontWrapW
  3433. #define CreateFileWrap CreateFileWrapW
  3434. #define CreateFontIndirectWrap CreateFontIndirectWrapW
  3435. #define CreateICWrap CreateICWrapW
  3436. #define CreateMetaFileWrap CreateMetaFileWrapW
  3437. #define CreateMutexWrap CreateMutexWrapW
  3438. #define CreateSemaphoreWrap CreateSemaphoreWrapW
  3439. #define CreateWindowExWrap CreateWindowExWrapW
  3440. #define DefWindowProcWrap DefWindowProcWrapW
  3441. #define DeleteFileWrap DeleteFileWrapW
  3442. #define DispatchMessageWrap DispatchMessageWrapW
  3443. #define DrawTextExWrap DrawTextExWrapW
  3444. #define DrawTextWrap DrawTextWrapW
  3445. #define EnumFontFamiliesWrap EnumFontFamiliesWrapW
  3446. #define EnumFontFamiliesExWrap EnumFontFamiliesExWrapW
  3447. #define EnumResourceNamesWrap EnumResourceNamesWrapW
  3448. #define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsWrapW
  3449. #define ExtractIconExWrap ExtractIconExWrapW
  3450. #define ExtTextOutWrap ExtTextOutW
  3451. #define FindFirstFileWrap FindFirstFileWrapW
  3452. #define FindNextFileWrap FindNextFileWrapW
  3453. #define FindResourceWrap FindResourceWrapW
  3454. #define FindWindowWrap FindWindowWrapW
  3455. #define FindWindowExWrap FindWindowExWrapW
  3456. #define FormatMessageWrap FormatMessageWrapW
  3457. #define GetClassInfoWrap GetClassInfoWrapW
  3458. #define GetClassInfoExWrap GetClassInfoExWrapW
  3459. #define GetClassLongWrap GetClassLongWrapW
  3460. #define GetClassNameWrap GetClassNameWrapW
  3461. #define GetClipboardFormatNameWrap GetClipboardFormatNameWrapW
  3462. #define GetCurrentDirectoryWrap GetCurrentDirectoryWrapW
  3463. #define GetDlgItemTextWrap GetDlgItemTextWrapW
  3464. #define GetFileAttributesWrap GetFileAttributesWrapW
  3465. #define GetFullPathNameWrap GetFullPathNameWrapW
  3466. #define GetLocaleInfoWrap GetLocaleInfoWrapW
  3467. #define GetMenuItemInfoWrap GetMenuItemInfoWrapW
  3468. #define GetMenuStringWrap GetMenuStringWrapW
  3469. #define GetMessageWrap GetMessageWrapW
  3470. #define GetModuleFileNameWrap GetModuleFileNameWrapW
  3471. #define GetNumberFormatWrap GetNumberFormatWrapW
  3472. #define GetSystemDirectoryWrap GetSystemDirectoryWrapW
  3473. #define GetEnvironmentVariableWrap GetEnvironmentVariableWrapW
  3474. #define GetModuleHandleWrap GetModuleHandleWrapW
  3475. #define GetObjectWrap GetObjectWrapW
  3476. #define GetPrivateProfileIntWrap GetPrivateProfileIntWrapW
  3477. #define GetProfileStringWrap GetProfileStringWrapW
  3478. #define GetPrivateProfileStringWrap GetPrivateProfileStringWrapW
  3479. #define WritePrivateProfileStringWrap WritePrivateProfileStringWrapW
  3480. #define GetPropWrap GetPropWrapW
  3481. #define GetStringTypeExWrap GetStringTypeExWrapW
  3482. #define GetTempFileNameWrap GetTempFileNameWrapW
  3483. #define GetTempPathWrap GetTempPathWrapW
  3484. #define GetTextExtentPoint32Wrap GetTextExtentPoint32WrapW
  3485. #define GetTextFaceWrap GetTextFaceWrapW
  3486. #define GetTextMetricsWrap GetTextMetricsWrapW
  3487. #define GetTimeFormatWrap GetTimeFormatWrapW
  3488. #define GetDateFormatWrap GetDateFormatWrapW
  3489. #define GetUserNameWrap GetUserNameWrapW
  3490. #define GetWindowLongWrap GetWindowLongWrapW
  3491. #define GetWindowTextWrap GetWindowTextWrapW
  3492. #define GetWindowTextLengthWrap GetWindowTextLengthWrapW
  3493. #define GetWindowsDirectoryWrap GetWindowsDirectoryWrapW
  3494. #define InsertMenuItemWrap InsertMenuItemWrapW
  3495. #define InsertMenuWrap InsertMenuWrapW
  3496. #define IsBadStringPtrWrap IsBadStringPtrWrapW
  3497. #define IsDialogMessageWrap IsDialogMessageWrapW
  3498. #define LoadAcceleratorsWrap LoadAcceleratorsWrapW
  3499. #define LoadBitmapWrap LoadBitmapWrapW
  3500. #define LoadCursorWrap LoadCursorWrapW
  3501. #define LoadIconWrap LoadIconWrapW
  3502. #define LoadImageWrap LoadImageWrapW
  3503. #define LoadLibraryWrap LoadLibraryWrapW
  3504. #define LoadLibraryExWrap LoadLibraryExWrapW
  3505. #define LoadMenuWrap LoadMenuWrapW
  3506. #define LoadStringWrap LoadStringWrapW
  3507. #define MessageBoxIndirectWrap MessageBoxIndirectWrapW
  3508. #define MessageBoxWrap MessageBoxWrapW
  3509. #define ModifyMenuWrap ModifyMenuWrapW
  3510. #define GetCharWidth32Wrap GetCharWidth32WrapW
  3511. #define GetCharacterPlacementWrap GetCharacterPlacementWrapW
  3512. #define CopyFileWrap CopyFileWrapW
  3513. #define MoveFileWrap MoveFileWrapW
  3514. #define OemToCharWrap OemToCharWrapW
  3515. #define OutputDebugStringWrap OutputDebugStringWrapW
  3516. #define PeekMessageWrap PeekMessageWrapW
  3517. #define PostMessageWrap PostMessageWrapW
  3518. #define PostThreadMessageWrap PostThreadMessageWrapW
  3519. #define RegCreateKeyWrap RegCreateKeyWrapW
  3520. #define RegCreateKeyExWrap RegCreateKeyExWrapW
  3521. #define RegDeleteKeyWrap RegDeleteKeyWrapW
  3522. #define RegDeleteValueWrap RegDeleteValueWrapW
  3523. #define RegEnumKeyWrap RegEnumKeyWrapW
  3524. #define RegEnumKeyExWrap RegEnumKeyExWrapW
  3525. #define RegOpenKeyWrap RegOpenKeyWrapW
  3526. #define RegOpenKeyExWrap RegOpenKeyExWrapW
  3527. #define RegQueryInfoKeyWrap RegQueryInfoKeyWrapW
  3528. #define RegQueryValueWrap RegQueryValueWrapW
  3529. #define RegQueryValueExWrap RegQueryValueExWrapW
  3530. #define RegSetValueWrap RegSetValueWrapW
  3531. #define RegSetValueExWrap RegSetValueExWrapW
  3532. #define RegisterClassWrap RegisterClassWrapW
  3533. #define RegisterClassExWrap RegisterClassExWrapW
  3534. #define RegisterClipboardFormatWrap RegisterClipboardFormatWrapW
  3535. #define RegisterWindowMessageWrap RegisterWindowMessageWrapW
  3536. #define RemovePropWrap RemovePropWrapW
  3537. #define SearchPathWrap SearchPathWrapW
  3538. #define SendDlgItemMessageWrap SendDlgItemMessageWrapW
  3539. #define SendMessageWrap SendMessageWrapW
  3540. #define SendMessageTimeoutWrap SendMessageTimeoutWrapW
  3541. #define SetCurrentDirectoryWrap SetCurrentDirectoryWrapW
  3542. #define SetDlgItemTextWrap SetDlgItemTextWrapW
  3543. #define SetMenuItemInfoWrap SetMenuItemInfoWrapW
  3544. #define SetPropWrap SetPropWrapW
  3545. #define SetFileAttributesWrap SetFileAttributesWrapW
  3546. #define SetWindowLongWrap SetWindowLongWrapW
  3547. #define SetWindowsHookExWrap SetWindowsHookExWrapW
  3548. #define SHBrowseForFolderWrap SHBrowseForFolderWrapW
  3549. #define ShellExecuteExWrap ShellExecuteExWrapW
  3550. #define SHFileOperationWrap SHFileOperationWrapW
  3551. #define SHGetFileInfoWrap SHGetFileInfoWrapW
  3552. #define SHGetPathFromIDListWrap SHGetPathFromIDListWrapW
  3553. #define StartDocWrap StartDocWrapW
  3554. #define SystemParametersInfoWrap SystemParametersInfoWrapW
  3555. #define TranslateAcceleratorWrap TranslateAcceleratorWrapW
  3556. #define UnregisterClassWrap UnregisterClassWrapW
  3557. #define VkKeyScanWrap VkKeyScanWrapW
  3558. #define WinHelpWrap WinHelpWrapW
  3559. #define WNetRestoreConnectionWrap WNetRestoreConnectionWrapW
  3560. #define WNetGetLastErrorWrap WNetGetLastErrorWrapW
  3561. #define wvsprintfWrap wvsprintfWrapW
  3562. #define CreateFontWrap CreateFontWrapW
  3563. #define DrawTextExWrap DrawTextExWrapW
  3564. #define GetMenuItemInfoWrap GetMenuItemInfoWrapW
  3565. #define SetMenuItemInfoWrap SetMenuItemInfoWrapW
  3566. #define InsertMenuItemWrap InsertMenuItemWrapW
  3567. #define DragQueryFileWrap DragQueryFileWrapW
  3568. #else
  3569. #define IsCharAlphaWrap IsCharAlphaA
  3570. #define IsCharUpperWrap IsCharUpperA
  3571. #define IsCharLowerWrap IsCharLowerA
  3572. #define IsCharAlphaNumericWrap IsCharAlphaNumericA
  3573. #define AppendMenuWrap AppendMenuA
  3574. #ifdef POST_IE5_BETA
  3575. #define CallMsgFilterWrap CallMsgFilterA
  3576. #endif
  3577. #define CallWindowProcWrap CallWindowProcA
  3578. #define CharLowerWrap CharLowerA
  3579. #define CharLowerBuffWrap CharLowerBuffA
  3580. #define CharNextWrap CharNextA
  3581. #define CharPrevWrap CharPrevA
  3582. #define CharToOemWrap CharToOemA
  3583. #define CharUpperWrap CharUpperA
  3584. #define CharUpperBuffWrap CharUpperBuffA
  3585. #define CompareStringWrap CompareStringA
  3586. #define CopyAcceleratorTableWrap CopyAcceleratorTableA
  3587. #define CreateAcceleratorTableWrap CreateAcceleratorTableA
  3588. #define CreateDCWrap CreateDCA
  3589. #define CreateDirectoryWrap CreateDirectoryA
  3590. #define CreateEventWrap CreateEventA
  3591. #define CreateFontWrap CreateFontA
  3592. #define CreateFileWrap CreateFileA
  3593. #define CreateFontIndirectWrap CreateFontIndirectA
  3594. #define CreateICWrap CreateICA
  3595. #define CreateMetaFileWrap CreateMetaFileA
  3596. #define CreateMutexWrap CreateMutexA
  3597. #define CreateSemaphoreWrap CreateSemaphoreA
  3598. #define CreateWindowExWrap CreateWindowExA
  3599. #define DefWindowProcWrap DefWindowProcA
  3600. #define DeleteFileWrap DeleteFileA
  3601. #define DispatchMessageWrap DispatchMessageA
  3602. #define DrawTextExWrap DrawTextExA
  3603. #define DrawTextWrap DrawTextA
  3604. #define EnumFontFamiliesWrap EnumFontFamiliesA
  3605. #define EnumFontFamiliesExWrap EnumFontFamiliesExA
  3606. #define EnumResourceNamesWrap EnumResourceNamesA
  3607. #define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsA
  3608. #define ExtractIconExWrap ExtractIconExA
  3609. #define ExtTextOutWrap ExtTextOutA
  3610. #define FindFirstFileWrap FindFirstFileA
  3611. #define FindResourceWrap FindResourceA
  3612. #define FindNextFileWrap FindNextFileA
  3613. #define FindWindowWrap FindWindowA
  3614. #define FindWindowExWrap FindWindowExA
  3615. #define FormatMessageWrap FormatMessageA
  3616. #define GetClassInfoWrap GetClassInfoA
  3617. #define GetClassInfoExWrap GetClassInfoExA
  3618. #define GetClassLongWrap GetClassLongA
  3619. #define GetClassNameWrap GetClassNameA
  3620. #define GetClipboardFormatNameWrap GetClipboardFormatNameA
  3621. #define GetCurrentDirectoryWrap GetCurrentDirectoryA
  3622. #define GetDlgItemTextWrap GetDlgItemTextA
  3623. #define GetFileAttributesWrap GetFileAttributesA
  3624. #define GetFullPathNameWrap GetFullPathNameA
  3625. #define GetLocaleInfoWrap GetLocaleInfoA
  3626. #define GetMenuItemInfoWrap GetMenuItemInfoA
  3627. #define GetMenuStringWrap GetMenuStringA
  3628. #define GetMessageWrap GetMessageA
  3629. #define GetModuleFileNameWrap GetModuleFileNameA
  3630. #define GetNumberFormatWrap GetNumberFormatA
  3631. #define GetPrivateProfileStringWrap GetPrivateProfileStringA
  3632. #define WritePrivateProfileStringWrap WritePrivateProfileStringA
  3633. #define GetSystemDirectoryWrap GetSystemDirectoryA
  3634. #define GetEnvironmentVariableWrap GetEnvironmentVariableA
  3635. #define SearchPathWrap SearchPathA
  3636. #define GetModuleHandleWrap GetModuleHandleA
  3637. #define GetObjectWrap GetObjectA
  3638. #define GetPrivateProfileIntWrap GetPrivateProfileIntA
  3639. #define GetProfileStringWrap GetProfileStringA
  3640. #define GetPropWrap GetPropA
  3641. #define GetStringTypeExWrap GetStringTypeExA
  3642. #define GetTempFileNameWrap GetTempFileNameA
  3643. #define GetTempPathWrap GetTempPathA
  3644. #define GetTextExtentPoint32Wrap GetTextExtentPoint32A
  3645. #define GetTextFaceWrap GetTextFaceA
  3646. #define GetTextMetricsWrap GetTextMetricsA
  3647. #define GetTimeFormatWrap GetTimeFormatA
  3648. #define GetDateFormatWrap GetDateFormatA
  3649. #define GetUserNameWrap GetUserNameA
  3650. #define GetWindowLongWrap GetWindowLongA
  3651. #define GetWindowTextWrap GetWindowTextA
  3652. #define GetWindowTextLengthWrap GetWindowTextLengthA
  3653. #define GetWindowsDirectoryWrap GetWindowsDirectoryA
  3654. #define InsertMenuItemWrap InsertMenuItemA
  3655. #define InsertMenuWrap InsertMenuA
  3656. #define IsBadStringPtrWrap IsBadStringPtrA
  3657. #define IsDialogMessageWrap IsDialogMessageA
  3658. #define LoadAcceleratorsWrap LoadAcceleratorsA
  3659. #define LoadBitmapWrap LoadBitmapA
  3660. #define LoadCursorWrap LoadCursorA
  3661. #define LoadIconWrap LoadIconA
  3662. #define LoadImageWrap LoadImageWrapA
  3663. #define LoadLibraryWrap LoadLibraryA
  3664. #define LoadLibraryExWrap LoadLibraryExA
  3665. #define LoadMenuWrap LoadMenuA
  3666. #define LoadStringWrap LoadStringA
  3667. #define MessageBoxIndirectWrap MessageBoxIndirectA
  3668. #define MessageBoxWrap MessageBoxA
  3669. #define ModifyMenuWrap ModifyMenuA
  3670. #define GetCharWidth32Wrap GetCharWidth32A
  3671. #define GetCharacterPlacementWrap GetCharacterPlacementA
  3672. #define CopyFileWrap CopyFileA
  3673. #define MoveFileWrap MoveFileA
  3674. #define OemToCharWrap OemToCharA
  3675. #define OutputDebugStringWrap OutputDebugStringA
  3676. #define PeekMessageWrap PeekMessageA
  3677. #define PostMessageWrap PostMessageA
  3678. #define PostThreadMessageWrap PostThreadMessageA
  3679. #define RegCreateKeyWrap RegCreateKeyA
  3680. #define RegCreateKeyExWrap RegCreateKeyExA
  3681. #define RegDeleteKeyWrap RegDeleteKeyA
  3682. #define RegDeleteValueWrap RegDeleteValueA
  3683. #define RegEnumKeyWrap RegEnumKeyA
  3684. #define RegEnumKeyExWrap RegEnumKeyExA
  3685. #define RegOpenKeyWrap RegOpenKeyA
  3686. #define RegOpenKeyExWrap RegOpenKeyExA
  3687. #define RegQueryInfoKeyWrap RegQueryInfoKeyA
  3688. #define RegQueryValueWrap RegQueryValueA
  3689. #define RegQueryValueExWrap RegQueryValueExA
  3690. #define RegSetValueWrap RegSetValueA
  3691. #define RegSetValueExWrap RegSetValueExA
  3692. #define RegisterClassWrap RegisterClassA
  3693. #define RegisterClassExWrap RegisterClassExA
  3694. #define RegisterClipboardFormatWrap RegisterClipboardFormatA
  3695. #define RegisterWindowMessageWrap RegisterWindowMessageA
  3696. #define RemovePropWrap RemovePropA
  3697. #define SendDlgItemMessageWrap SendDlgItemMessageA
  3698. #define SendMessageWrap SendMessageA
  3699. #define SendMessageTimeoutWrap SendMessageTimeoutA
  3700. #define SetCurrentDirectoryWrap SetCurrentDirectoryA
  3701. #define SetDlgItemTextWrap SetDlgItemTextA
  3702. #define SetMenuItemInfoWrap SetMenuItemInfoA
  3703. #define SetPropWrap SetPropA
  3704. #define SetWindowLongWrap SetWindowLongA
  3705. #define SHBrowseForFolderWrap SHBrowseForFolderA
  3706. #define ShellExecuteExWrap ShellExecuteExA
  3707. #define SHFileOperationWrap SHFileOperationA
  3708. #define SHGetFileInfoWrap SHGetFileInfoA
  3709. #define SHGetPathFromIDListWrap SHGetPathFromIDListA
  3710. #define SetFileAttributesWrap SetFileAttributesA
  3711. #define SetWindowsHookExWrap SetWindowsHookExA
  3712. #define StartDocWrap StartDocA
  3713. #define SystemParametersInfoWrap SystemParametersInfoA
  3714. #define TranslateAcceleratorWrap TranslateAcceleratorA
  3715. #define UnregisterClassWrap UnregisterClassA
  3716. #define VkKeyScanWrap VkKeyScanA
  3717. #define WinHelpWrap WinHelpA
  3718. #define WNetRestoreConnectionWrap WNetRestoreConnectionA
  3719. #define WNetGetLastErrorWrap WNetGetLastErrorA
  3720. #define wvsprintfWrap wvsprintfA
  3721. #define CreateFontWrap CreateFontA
  3722. #define DrawTextExWrap DrawTextExA
  3723. #define GetMenuItemInfoWrap GetMenuItemInfoA
  3724. #define SetMenuItemInfoWrap SetMenuItemInfoA
  3725. #define InsertMenuItemWrap InsertMenuItemA
  3726. #define DragQueryFileWrap DragQueryFileA
  3727. #endif
  3728. #endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK)
  3729. #if defined(UNIX) && defined(NO_SHLWAPI_UNITHUNK)
  3730. #define SHFlushSFCacheWrap()
  3731. #ifdef UNICODE
  3732. #define IsCharAlphaWrapW IsCharAlphaW
  3733. #define IsCharUpperWrapW IsCharUpperW
  3734. #define IsCharLowerWrapW IsCharLowerW
  3735. #define IsCharAlphaNumericWrapW IsCharAlphaNumericW
  3736. #define AppendMenuWrapW AppendMenuW
  3737. #ifdef POST_IE5_BETA
  3738. #define CallMsgFilterWrapW CallMsgFilterW
  3739. #endif
  3740. #define CallWindowProcWrapW CallWindowProcW
  3741. #define CharLowerWrapW CharLowerW
  3742. #define CharLowerBuffWrapW CharLowerBuffW
  3743. #define CharNextWrapW CharNextW
  3744. #define CharPrevWrapW CharPrevW
  3745. #define CharToOemWrapW CharToOemW
  3746. #define CharUpperWrapW CharUpperW
  3747. #define CharUpperBuffWrapW CharUpperBuffW
  3748. #define CompareStringWrapW CompareStringW
  3749. #define CopyAcceleratorTableWrapW CopyAcceleratorTableW
  3750. #define CreateAcceleratorTableWrapW CreateAcceleratorTableW
  3751. #define CreateDCWrapW CreateDCW
  3752. #define CreateDirectoryWrapW CreateDirectoryW
  3753. #define CreateEventWrapW CreateEventW
  3754. #define CreateFontWrapW CreateFontW
  3755. #define CreateFileWrapW CreateFileW
  3756. #define CreateFontIndirectWrapW CreateFontIndirectW
  3757. #define CreateICWrapW CreateICW
  3758. #define CreateMetaFileWrapW CreateMetaFileW
  3759. #define CreateMutexWrapW CreateMutexW
  3760. #define CreateSemaphoreWrapW CreateSemaphoreW
  3761. #define CreateWindowExWrapW CreateWindowExW
  3762. #define DefWindowProcWrapW DefWindowProcW
  3763. #define DeleteFileWrapW DeleteFileW
  3764. #define DispatchMessageWrapW DispatchMessageW
  3765. #define DrawTextExWrapW DrawTextExW
  3766. #define DrawTextWrapW DrawTextW
  3767. #define EnumFontFamiliesWrapW EnumFontFamiliesW
  3768. #define EnumFontFamiliesExWrapW EnumFontFamiliesExW
  3769. #define EnumResourceNamesWrapW EnumResourceNamesW
  3770. #define ExpandEnvironmentStringsWrapW ExpandEnvironmentStringsW
  3771. #define ExtractIconExWrapW ExtractIconExW
  3772. #define ExtTextOutWrapW ExtTextOutW
  3773. #define FindFirstFileWrapW FindFirstFileW
  3774. #define FindNextFileWrapW FindNextFileW
  3775. #define FindResourceWrapW FindResourceW
  3776. #define FindWindowWrapW FindWindowW
  3777. #define FindWindowExWrapW FindWindowExW
  3778. #define FormatMessageWrapW FormatMessageW
  3779. #define GetClassInfoWrapW GetClassInfoW
  3780. #define GetClassInfoExWrapW GetClassInfoExW
  3781. #define GetClassLongWrapW GetClassLongW
  3782. #define GetClassNameWrapW GetClassNameW
  3783. #define GetClipboardFormatNameWrapW GetClipboardFormatNameW
  3784. #define GetCurrentDirectoryWrapW GetCurrentDirectoryW
  3785. #define GetDlgItemTextWrapW GetDlgItemTextW
  3786. #define GetFileAttributesWrapW GetFileAttributesW
  3787. #define GetFullPathNameWrapW GetFullPathNameW
  3788. #define GetLocaleInfoWrapW GetLocaleInfoW
  3789. #define GetMenuStringWrapW GetMenuStringW
  3790. #define GetMessageWrapW GetMessageW
  3791. #define GetModuleFileNameWrapW GetModuleFileNameW
  3792. #define GetNumberFormatWrapW GetNumberFormatW
  3793. #define GetSystemDirectoryWrapW GetSystemDirectoryW
  3794. #define GetModuleHandleWrapW GetModuleHandleW
  3795. #define GetObjectWrapW GetObjectW
  3796. #define GetPrivateProfileIntWrapW GetPrivateProfileIntW
  3797. #define GetProfileStringWrapW GetProfileStringW
  3798. #define GetPrivateProfileStringWrapW GetPrivateProfileStringW
  3799. #define WritePrivateProfileStringWrapW WritePrivateProfileStringW
  3800. #define GetPropWrapW GetPropW
  3801. #define GetStringTypeExWrapW GetStringTypeExW
  3802. #define GetTempFileNameWrapW GetTempFileNameW
  3803. #define GetTempPathWrapW GetTempPathW
  3804. #define GetTextExtentPoint32WrapW GetTextExtentPoint32W
  3805. #define GetTextFaceWrapW GetTextFaceW
  3806. #define GetTextMetricsWrapW GetTextMetricsW
  3807. #define GetTimeFormatWrapW GetTimeFormatW
  3808. #define GetDateFormatWrapW GetDateFormatW
  3809. #define GetUserNameWrapW GetUserNameW
  3810. #define GetWindowLongWrapW GetWindowLongW
  3811. #define GetWindowTextWrapW GetWindowTextW
  3812. #define GetWindowTextLengthWrapW GetWindowTextLengthW
  3813. #define GetWindowsDirectoryWrapW GetWindowsDirectoryW
  3814. #define InsertMenuItemWrapW InsertMenuItemW
  3815. #define InsertMenuWrapW InsertMenuW
  3816. #define IsBadStringPtrWrapW IsBadStringPtrW
  3817. #define IsDialogMessageWrapW IsDialogMessageW
  3818. #define LoadAcceleratorsWrapW LoadAcceleratorsW
  3819. #define LoadBitmapWrapW LoadBitmapW
  3820. #define LoadCursorWrapW LoadCursorW
  3821. #define LoadIconWrapW LoadIconW
  3822. #define LoadImageWrapW LoadImageW
  3823. #define LoadLibraryWrapW LoadLibraryW
  3824. #define LoadLibraryExWrapW LoadLibraryExW
  3825. #define LoadMenuWrapW LoadMenuW
  3826. #define LoadStringWrapW LoadStringW
  3827. #define MessageBoxIndirectWrapW MessageBoxIndirectW
  3828. #define MessageBoxWrapW MessageBoxW
  3829. #define ModifyMenuWrapW ModifyMenuW
  3830. #define GetCharWidth32WrapW GetCharWidth32W
  3831. #define GetCharacterPlacementWrapW GetCharacterPlacementW
  3832. #define CopyFileWrapW CopyFileW
  3833. #define MoveFileWrapW MoveFileW
  3834. #define OemToCharWrapW OemToCharW
  3835. #define OutputDebugStringWrapW OutputDebugStringW
  3836. #define PeekMessageWrapW PeekMessageW
  3837. #define PostMessageWrapW PostMessageW
  3838. #define PostThreadMessageWrapW PostThreadMessageW
  3839. #define RegCreateKeyWrapW RegCreateKeyW
  3840. #define RegCreateKeyExWrapW RegCreateKeyExW
  3841. #define RegDeleteKeyWrapW RegDeleteKeyW
  3842. #define RegDeleteValueWrapW RegDeleteValueW
  3843. #define RegEnumKeyWrapW RegEnumKeyW
  3844. #define RegEnumKeyExWrapW RegEnumKeyExW
  3845. #define RegOpenKeyWrapW RegOpenKeyW
  3846. #define RegOpenKeyExWrapW RegOpenKeyExW
  3847. #define RegQueryInfoKeyWrapW RegQueryInfoKeyW
  3848. #define RegQueryValueWrapW RegQueryValueW
  3849. #define RegQueryValueExWrapW RegQueryValueExW
  3850. #define RegSetValueWrapW RegSetValueW
  3851. #define RegSetValueExWrapW RegSetValueExW
  3852. #define RegisterClassWrapW RegisterClassW
  3853. #define RegisterClassExWrapW RegisterClassExW
  3854. #define RegisterClipboardFormatWrapWRegisterClipboardFormatW
  3855. #define RegisterWindowMessageWrapW RegisterWindowMessageW
  3856. #define RemovePropWrapW RemovePropW
  3857. #define SearchPathWrapW SearchPathW
  3858. #define SendDlgItemMessageWrapW SendDlgItemMessageW
  3859. #define SendMessageWrapW SendMessageW
  3860. #define SetCurrentDirectoryWrapW SetCurrentDirectoryW
  3861. #define SetDlgItemTextWrapW SetDlgItemTextW
  3862. #define SetMenuItemInfoWrapW SetMenuItemInfoW
  3863. #define SetPropWrapW SetPropW
  3864. #define SetFileAttributesWrapW SetFileAttributesW
  3865. #define SetWindowLongWrapW SetWindowLongW
  3866. #define SetWindowsHookExWrapW SetWindowsHookExW
  3867. #define SHBrowseForFolderWrapW SHBrowseForFolderW
  3868. #define ShellExecuteExWrapW ShellExecuteExW
  3869. #define SHFileOperationWrapW SHFileOperationW
  3870. #define SHGetFileInfoWrapW SHGetFileInfoW
  3871. #define SHGetPathFromIDListWrapW SHGetPathFromIDListW
  3872. #define StartDocWrapW StartDocW
  3873. #define SystemParametersInfoWrapW SystemParametersInfoW
  3874. #define TranslateAcceleratorWrapW TranslateAcceleratorW
  3875. #define UnregisterClassWrapW UnregisterClassW
  3876. #define VkKeyScanWrapW VkKeyScanW
  3877. #define WinHelpWrapW WinHelpW
  3878. #define WNetRestoreConnectionWrapW WNetRestoreConnectionW
  3879. #define WNetGetLastErrorWrapW WNetGetLastErrorW
  3880. #define wvsprintfWrapW wvsprintfW
  3881. #define CreateFontWrapW CreateFontW
  3882. #define DrawTextExWrapW DrawTextExW
  3883. #define SetMenuItemInfoWrapW SetMenuItemInfoW
  3884. #define InsertMenuItemWrapW InsertMenuItemW
  3885. #define DragQueryFileWrapW DragQueryFileW
  3886. #define IsCharAlphaWrap IsCharAlphaW
  3887. #define IsCharUpperWrap IsCharUpperW
  3888. #define IsCharLowerWrap IsCharLowerW
  3889. #define IsCharAlphaNumericWrap IsCharAlphaNumericW
  3890. #define AppendMenuWrap AppendMenuW
  3891. #ifdef POST_IE5_BETA
  3892. #define CallMsgFilterWrap CallMsgFilterW
  3893. #endif
  3894. #define CallWindowProcWrap CallWindowProcW
  3895. #define CharLowerWrap CharLowerW
  3896. #define CharLowerBuffWrap CharLowerBuffW
  3897. #define CharNextWrap CharNextW
  3898. #define CharPrevWrap CharPrevW
  3899. #define CharToOemWrap CharToOemW
  3900. #define CharUpperWrap CharUpperW
  3901. #define CharUpperBuffWrap CharUpperBuffW
  3902. #define CompareStringWrap CompareStringW
  3903. #define CopyAcceleratorTableWrap CopyAcceleratorTableW
  3904. #define CreateAcceleratorTableWrap CreateAcceleratorTableW
  3905. #define CreateDCWrap CreateDCW
  3906. #define CreateDirectoryWrap CreateDirectoryW
  3907. #define CreateEventWrap CreateEventW
  3908. #define CreateFontWrap CreateFontW
  3909. #define CreateFileWrap CreateFileW
  3910. #define CreateFontIndirectWrap CreateFontIndirectW
  3911. #define CreateICWrap CreateICW
  3912. #define CreateMetaFileWrap CreateMetaFileW
  3913. #define CreateMutexWrap CreateMutexW
  3914. #define CreateSemaphoreWrap CreateSemaphoreW
  3915. #define CreateWindowExWrap CreateWindowExW
  3916. #define DefWindowProcWrap DefWindowProcW
  3917. #define DeleteFileWrap DeleteFileW
  3918. #define DispatchMessageWrap DispatchMessageW
  3919. #define DrawTextExWrap DrawTextExW
  3920. #define DrawTextWrap DrawTextW
  3921. #define EnumFontFamiliesWrap EnumFontFamiliesW
  3922. #define EnumFontFamiliesExWrap EnumFontFamiliesExW
  3923. #define EnumResourceNamesWrap EnumResourceNamesW
  3924. #define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsW
  3925. #define ExtractIconExWrap ExtractIconExW
  3926. #define ExtTextOutWrap ExtTextOutW
  3927. #define FindFirstFileWrap FindFirstFileW
  3928. #define FindNextFileWrap FindNextFileW
  3929. #define FindResourceWrap FindResourceW
  3930. #define FindWindowWrap FindWindowW
  3931. #define FindWindowExWrap FindWindowExW
  3932. #define FormatMessageWrap FormatMessageW
  3933. #define GetClassInfoWrap GetClassInfoW
  3934. #define GetClassInfoExWrap GetClassInfoExW
  3935. #define GetClassLongWrap GetClassLongW
  3936. #define GetClassNameWrap GetClassNameW
  3937. #define GetClipboardFormatNameWrap GetClipboardFormatNameW
  3938. #define GetCurrentDirectoryWrap GetCurrentDirectoryW
  3939. #define GetDlgItemTextWrap GetDlgItemTextW
  3940. #define GetFileAttributesWrap GetFileAttributesW
  3941. #define GetFullPathNameWrap GetFullPathNameW
  3942. #define GetLocaleInfoWrap GetLocaleInfoW
  3943. #define GetMenuItemInfoWrap GetMenuItemInfoWrapW
  3944. #define GetMenuStringWrap GetMenuStringW
  3945. #define GetMessageWrap GetMessageW
  3946. #define GetModuleFileNameWrap GetModuleFileNameW
  3947. #define GetNumberFormatWrap GetNumberFormatW
  3948. #define GetSystemDirectoryWrap GetSystemDirectoryW
  3949. #define GetModuleHandleWrap GetModuleHandleW
  3950. #define GetObjectWrap GetObjectW
  3951. #define GetPrivateProfileIntWrap GetPrivateProfileIntW
  3952. #define GetProfileStringWrap GetProfileStringW
  3953. #define GetPrivateProfileStringWrap GetPrivateProfileStringW
  3954. #define WritePrivateProfileStringWrap WritePrivateProfileStringW
  3955. #define GetPropWrap GetPropW
  3956. #define GetStringTypeExWrap GetStringTypeExW
  3957. #define GetTempFileNameWrap GetTempFileNameW
  3958. #define GetTempPathWrap GetTempPathW
  3959. #define GetTextExtentPoint32Wrap GetTextExtentPoint32W
  3960. #define GetTextFaceWrap GetTextFaceW
  3961. #define GetTextMetricsWrap GetTextMetricsW
  3962. #define GetTimeFormatWrap GetTimeFormatW
  3963. #define GetDateFormatWrap GetDateFormatW
  3964. #define GetUserNameWrap GetUserNameW
  3965. #define GetWindowLongWrap GetWindowLongW
  3966. #define GetWindowTextWrap GetWindowTextW
  3967. #define GetWindowTextLengthWrap GetWindowTextLengthW
  3968. #define GetWindowsDirectoryWrap GetWindowsDirectoryW
  3969. #define InsertMenuItemWrap InsertMenuItemW
  3970. #define InsertMenuWrap InsertMenuW
  3971. #define IsBadStringPtrWrap IsBadStringPtrW
  3972. #define IsDialogMessageWrap IsDialogMessageW
  3973. #define LoadAcceleratorsWrap LoadAcceleratorsW
  3974. #define LoadBitmapWrap LoadBitmapW
  3975. #define LoadCursorWrap LoadCursorW
  3976. #define LoadIconWrap LoadIconW
  3977. #define LoadImageWrap LoadImageW
  3978. #define LoadLibraryWrap LoadLibraryW
  3979. #define LoadLibraryExWrap LoadLibraryExW
  3980. #define LoadMenuWrap LoadMenuW
  3981. #define LoadStringWrap LoadStringW
  3982. #define MessageBoxIndirectWrap MessageBoxIndirectW
  3983. #define MessageBoxWrap MessageBoxW
  3984. #define ModifyMenuWrap ModifyMenuW
  3985. #define GetCharWidth32Wrap GetCharWidth32W
  3986. #define GetCharacterPlacementWrap GetCharacterPlacementW
  3987. #define CopyFileWrap CopyFileW
  3988. #define MoveFileWrap MoveFileW
  3989. #define OemToCharWrap OemToCharW
  3990. #define OutputDebugStringWrap OutputDebugStringW
  3991. #define PeekMessageWrap PeekMessageW
  3992. #define PostMessageWrap PostMessageW
  3993. #define PostThreadMessageWrap PostThreadMessageW
  3994. #define RegCreateKeyWrap RegCreateKeyW
  3995. #define RegCreateKeyExWrap RegCreateKeyExW
  3996. #define RegDeleteKeyWrap RegDeleteKeyW
  3997. #define RegDeleteValueWrap RegDeleteValueW
  3998. #define RegEnumKeyWrap RegEnumKeyW
  3999. #define RegEnumKeyExWrap RegEnumKeyExW
  4000. #define RegOpenKeyWrap RegOpenKeyW
  4001. #define RegOpenKeyExWrap RegOpenKeyExW
  4002. #define RegQueryInfoKeyWrap RegQueryInfoKeyW
  4003. #define RegQueryValueWrap RegQueryValueW
  4004. #define RegQueryValueExWrap RegQueryValueExW
  4005. #define RegSetValueWrap RegSetValueW
  4006. #define RegSetValueExWrap RegSetValueExW
  4007. #define RegisterClassWrap RegisterClassW
  4008. #define RegisterClassExWrap RegisterClassExW
  4009. #define RegisterClipboardFormatWrap RegisterClipboardFormatW
  4010. #define RegisterWindowMessageWrap RegisterWindowMessageW
  4011. #define RemovePropWrap RemovePropW
  4012. #define SearchPathWrap SearchPathW
  4013. #define SendDlgItemMessageWrap SendDlgItemMessageW
  4014. #define SendMessageWrap SendMessageW
  4015. #define SetCurrentDirectoryWrap SetCurrentDirectoryW
  4016. #define SetDlgItemTextWrap SetDlgItemTextW
  4017. #define SetMenuItemInfoWrap SetMenuItemInfoW
  4018. #define SetPropWrap SetPropW
  4019. #define SetFileAttributesWrap SetFileAttributesW
  4020. #define SetWindowLongWrap SetWindowLongW
  4021. #define SetWindowsHookExWrap SetWindowsHookExW
  4022. #define SHBrowseForFolderWrap SHBrowseForFolderW
  4023. #define ShellExecuteExWrap ShellExecuteExW
  4024. #define SHFileOperationWrap SHFileOperationW
  4025. #define SHGetFileInfoWrap SHGetFileInfoW
  4026. #define SHGetPathFromIDListWrap SHGetPathFromIDListW
  4027. #define StartDocWrap StartDocW
  4028. #define SystemParametersInfoWrap SystemParametersInfoW
  4029. #define TranslateAcceleratorWrap TranslateAcceleratorW
  4030. #define UnregisterClassWrap UnregisterClassW
  4031. #define VkKeyScanWrap VkKeyScanW
  4032. #define WinHelpWrap WinHelpW
  4033. #define WNetRestoreConnectionWrap WNetRestoreConnectionW
  4034. #define WNetGetLastErrorWrap WNetGetLastErrorW
  4035. #define wvsprintfWrap wvsprintfW
  4036. #define CreateFontWrap CreateFontW
  4037. #define DrawTextExWrap DrawTextExW
  4038. #define GetMenuItemInfoWrap GetMenuItemInfoWrapW
  4039. #define SetMenuItemInfoWrap SetMenuItemInfoW
  4040. #define InsertMenuItemWrap InsertMenuItemW
  4041. #define DragQueryFileWrap DragQueryFileW
  4042. #else
  4043. #define IsCharAlphaWrap IsCharAlphaA
  4044. #define IsCharUpperWrap IsCharUpperA
  4045. #define IsCharLowerWrap IsCharLowerA
  4046. #define IsCharAlphaNumericWrap IsCharAlphaNumericA
  4047. #define AppendMenuWrap AppendMenuA
  4048. #ifdef POST_IE5_BETA
  4049. #define CallMsgFilterWrap CallMsgFilterA
  4050. #endif
  4051. #define CallWindowProcWrap CallWindowProcA
  4052. #define CharLowerWrap CharLowerA
  4053. #define CharLowerBuffWrap CharLowerBuffA
  4054. #define CharNextWrap CharNextA
  4055. #define CharPrevWrap CharPrevA
  4056. #define CharToOemWrap CharToOemA
  4057. #define CharUpperWrap CharUpperA
  4058. #define CharUpperBuffWrap CharUpperBuffA
  4059. #define CompareStringWrap CompareStringA
  4060. #define CopyAcceleratorTableWrap CopyAcceleratorTableA
  4061. #define CreateAcceleratorTableWrap CreateAcceleratorTableA
  4062. #define CreateDCWrap CreateDCA
  4063. #define CreateDirectoryWrap CreateDirectoryA
  4064. #define CreateEventWrap CreateEventA
  4065. #define CreateFontWrap CreateFontA
  4066. #define CreateFileWrap CreateFileA
  4067. #define CreateFontIndirectWrap CreateFontIndirectA
  4068. #define CreateICWrap CreateICA
  4069. #define CreateMetaFileWrap CreateMetaFileA
  4070. #define CreateMutexWrap CreateMutexA
  4071. #define CreateSemaphoreWrap CreateSemaphoreA
  4072. #define CreateWindowExWrap CreateWindowExA
  4073. #define DefWindowProcWrap DefWindowProcA
  4074. #define DeleteFileWrap DeleteFileA
  4075. #define DispatchMessageWrap DispatchMessageA
  4076. #define DrawTextExWrap DrawTextExA
  4077. #define DrawTextWrap DrawTextA
  4078. #define EnumFontFamiliesWrap EnumFontFamiliesA
  4079. #define EnumFontFamiliesExWrap EnumFontFamiliesExA
  4080. #define EnumResourceNamesWrap EnumResourceNamesA
  4081. #define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsA
  4082. #define ExtractIconExWrap ExtractIconExA
  4083. #define ExtTextOutWrap ExtTextOutA
  4084. #define FindFirstFileWrap FindFirstFileA
  4085. #define FindResourceWrap FindResourceA
  4086. #define FindNextFileWrap FindNextFileA
  4087. #define FindWindowWrap FindWindowA
  4088. #define FindWindowExWrap FindWindowExA
  4089. #define FormatMessageWrap FormatMessageA
  4090. #define GetClassInfoWrap GetClassInfoA
  4091. #define GetClassInfoExWrap GetClassInfoExA
  4092. #define GetClassLongWrap GetClassLongA
  4093. #define GetClassNameWrap GetClassNameA
  4094. #define GetClipboardFormatNameWrap GetClipboardFormatNameA
  4095. #define GetCurrentDirectoryWrap GetCurrentDirectoryA
  4096. #define GetDlgItemTextWrap GetDlgItemTextA
  4097. #define GetFileAttributesWrap GetFileAttributesA
  4098. #define GetFullPathNameWrap GetFullPathNameA
  4099. #define GetLocaleInfoWrap GetLocaleInfoA
  4100. #define GetMenuItemInfoWrap GetMenuItemInfoA
  4101. #define GetMenuStringWrap GetMenuStringA
  4102. #define GetMessageWrap GetMessageA
  4103. #define GetModuleFileNameWrap GetModuleFileNameA
  4104. #define GetNumberFormatWrap GetNumberFormatA
  4105. #define GetPrivateProfileStringWrap GetPrivateProfileStringA
  4106. #define WritePrivateProfileStringWrap WritePrivateProfileStringA
  4107. #define GetSystemDirectoryWrap GetSystemDirectoryA
  4108. #define SearchPathWrap SearchPathA
  4109. #define GetModuleHandleWrap GetModuleHandleA
  4110. #define GetObjectWrap GetObjectA
  4111. #define GetPrivateProfileIntWrap GetPrivateProfileIntA
  4112. #define GetProfileStringWrap GetProfileStringA
  4113. #define GetPropWrap GetPropA
  4114. #define GetStringTypeExWrap GetStringTypeExA
  4115. #define GetTempFileNameWrap GetTempFileNameA
  4116. #define GetTempPathWrap GetTempPathA
  4117. #define GetTextExtentPoint32Wrap GetTextExtentPoint32A
  4118. #define GetTextFaceWrap GetTextFaceA
  4119. #define GetTextMetricsWrap GetTextMetricsA
  4120. #define GetTimeFormatWrap GetTimeFormatA
  4121. #define GetDateFormatWrap GetDateFormatA
  4122. #define GetUserNameWrap GetUserNameA
  4123. #define GetWindowLongWrap GetWindowLongA
  4124. #define GetWindowTextWrap GetWindowTextA
  4125. #define GetWindowTextLengthWrap GetWindowTextLengthA
  4126. #define GetWindowsDirectoryWrap GetWindowsDirectoryA
  4127. #define InsertMenuItemWrap InsertMenuItemA
  4128. #define InsertMenuWrap InsertMenuA
  4129. #define IsBadStringPtrWrap IsBadStringPtrA
  4130. #define IsDialogMessageWrap IsDialogMessageA
  4131. #define LoadAcceleratorsWrap LoadAcceleratorsA
  4132. #define LoadBitmapWrap LoadBitmapA
  4133. #define LoadCursorWrap LoadCursorA
  4134. #define LoadIconWrap LoadIconA
  4135. #define LoadImageWrap LoadImageWrapA
  4136. #define LoadLibraryWrap LoadLibraryA
  4137. #define LoadLibraryExWrap LoadLibraryExA
  4138. #define LoadMenuWrap LoadMenuA
  4139. #define LoadStringWrap LoadStringA
  4140. #define MessageBoxIndirectWrap MessageBoxIndirectA
  4141. #define MessageBoxWrap MessageBoxA
  4142. #define ModifyMenuWrap ModifyMenuA
  4143. #define GetCharWidth32Wrap GetCharWidth32A
  4144. #define GetCharacterPlacementWrap GetCharacterPlacementA
  4145. #define CopyFileWrap CopyFileA
  4146. #define MoveFileWrap MoveFileA
  4147. #define OemToCharWrap OemToCharA
  4148. #define OutputDebugStringWrap OutputDebugStringA
  4149. #define PeekMessageWrap PeekMessageA
  4150. #define PostMessageWrap PostMessageA
  4151. #define PostThreadMessageWrap PostThreadMessageA
  4152. #define RegCreateKeyWrap RegCreateKeyA
  4153. #define RegCreateKeyExWrap RegCreateKeyExA
  4154. #define RegDeleteKeyWrap RegDeleteKeyA
  4155. #define RegDeleteValueWrap RegDeleteValueA
  4156. #define RegEnumKeyWrap RegEnumKeyA
  4157. #define RegEnumKeyExWrap RegEnumKeyExA
  4158. #define RegOpenKeyWrap RegOpenKeyA
  4159. #define RegOpenKeyExWrap RegOpenKeyExA
  4160. #define RegQueryInfoKeyWrap RegQueryInfoKeyA
  4161. #define RegQueryValueWrap RegQueryValueA
  4162. #define RegQueryValueExWrap RegQueryValueExA
  4163. #define RegSetValueWrap RegSetValueA
  4164. #define RegSetValueExWrap RegSetValueExA
  4165. #define RegisterClassWrap RegisterClassA
  4166. #define RegisterClassExWrap RegisterClassExA
  4167. #define RegisterClipboardFormatWrap RegisterClipboardFormatA
  4168. #define RegisterWindowMessageWrap RegisterWindowMessageA
  4169. #define RemovePropWrap RemovePropA
  4170. #define SendDlgItemMessageWrap SendDlgItemMessageA
  4171. #define SendMessageWrap SendMessageA
  4172. #define SetCurrentDirectoryWrap SetCurrentDirectoryA
  4173. #define SetDlgItemTextWrap SetDlgItemTextA
  4174. #define SetMenuItemInfoWrap SetMenuItemInfoA
  4175. #define SetPropWrap SetPropA
  4176. #define SetWindowLongWrap SetWindowLongA
  4177. #define SHBrowseForFolderWrap SHBrowseForFolderA
  4178. #define ShellExecuteExWrap ShellExecuteExA
  4179. #define SHFileOperationWrap SHFileOperationA
  4180. #define SHGetFileInfoWrap SHGetFileInfoA
  4181. #define SHGetPathFromIDListWrap SHGetPathFromIDListA
  4182. #define SetFileAttributesWrap SetFileAttributesA
  4183. #define SetWindowsHookExWrap SetWindowsHookExA
  4184. #define StartDocWrap StartDocA
  4185. #define SystemParametersInfoWrap SystemParametersInfoA
  4186. #define TranslateAcceleratorWrap TranslateAcceleratorA
  4187. #define UnregisterClassWrap UnregisterClassA
  4188. #define VkKeyScanWrap VkKeyScanA
  4189. #define WinHelpWrap WinHelpA
  4190. #define WNetRestoreConnectionWrap WNetRestoreConnectionA
  4191. #define WNetGetLastErrorWrap WNetGetLastErrorA
  4192. #define wvsprintfWrap wvsprintfA
  4193. #define CreateFontWrap CreateFontA
  4194. #define DrawTextExWrap DrawTextExA
  4195. #define GetMenuItemInfoWrap GetMenuItemInfoA
  4196. #define SetMenuItemInfoWrap SetMenuItemInfoA
  4197. #define InsertMenuItemWrap InsertMenuItemA
  4198. #define DragQueryFileWrap DragQueryFileA
  4199. #endif
  4200. #endif // defined(UNIX) && defined(NO_SHLWAPI_UNITHUNK)
  4201. // Some functions are used to wrap unicode win95 functions AND to provide ML wrappers,
  4202. // so they are needed unless BOTH NO_SHLWAPI_UNITHUNG and NO_SHLWAPI_MLUI are defined
  4203. //
  4204. #if (_WIN32_IE >= 0x0500) && (!defined(NO_SHLWAPI_UNITHUNK) || !defined(NO_SHLWAPI_MLUI))
  4205. LWSTDAPI_(HWND)
  4206. CreateDialogIndirectParamWrapW(
  4207. HINSTANCE hInstance,
  4208. LPCDLGTEMPLATEW hDialogTemplate,
  4209. HWND hWndParent,
  4210. DLGPROC lpDialogFunc,
  4211. LPARAM dwInitParam);
  4212. LWSTDAPI_(HWND)
  4213. CreateDialogParamWrapW(
  4214. HINSTANCE hInstance,
  4215. LPCWSTR lpTemplateName,
  4216. HWND hWndParent,
  4217. DLGPROC lpDialogFunc,
  4218. LPARAM dwInitParam);
  4219. LWSTDAPI_(INT_PTR)
  4220. DialogBoxIndirectParamWrapW(
  4221. HINSTANCE hInstance,
  4222. LPCDLGTEMPLATEW hDialogTemplate,
  4223. HWND hWndParent,
  4224. DLGPROC lpDialogFunc,
  4225. LPARAM dwInitParam);
  4226. LWSTDAPI_(INT_PTR)
  4227. DialogBoxParamWrapW(
  4228. HINSTANCE hInstance,
  4229. LPCWSTR lpszTemplate,
  4230. HWND hWndParent,
  4231. DLGPROC lpDialogFunc,
  4232. LPARAM dwInitParam);
  4233. LWSTDAPI_(BOOL) SetWindowTextWrapW(HWND hWnd, LPCWSTR lpString);
  4234. LWSTDAPI_(BOOL) DeleteMenuWrap(HMENU hMenu, UINT uPosition, UINT uFlags);
  4235. LWSTDAPI_(BOOL) DestroyMenuWrap(HMENU hMenu);
  4236. #ifdef UNICODE
  4237. #define CreateDialogIndirectParamWrap CreateDialogIndirectParamWrapW
  4238. #define CreateDialogParamWrap CreateDialogParamWrapW
  4239. #define DialogBoxIndirectParamWrap DialogBoxIndirectParamWrapW
  4240. #define DialogBoxParamWrap DialogBoxParamWrapW
  4241. #define SetWindowTextWrap SetWindowTextWrapW
  4242. #else
  4243. #define CreateDialogIndirectParamWrap CreateDialogIndirectParamA
  4244. #define CreateDialogParamWrap CreateDialogParamA
  4245. #define DialogBoxIndirectParamWrap DialogBoxIndirectParamA
  4246. #define DialogBoxParamWrap DialogBoxParamA
  4247. #define SetWindowTextWrap SetWindowTextA
  4248. #endif // UNICODE
  4249. #endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK) && !defined (NO_SHLWAPI_MLUI)
  4250. //=============== Thread Pool Services ===================================
  4251. #if (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_TPS)
  4252. //
  4253. // SHLWAPIP versions of KERNEL32 Thread Pool Services APIs
  4254. //
  4255. typedef void (NTAPI * WAITORTIMERCALLBACKFUNC)(void *, BOOLEAN);
  4256. typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
  4257. LWSTDAPI_(HANDLE)
  4258. SHRegisterWaitForSingleObject(
  4259. IN HANDLE hObject,
  4260. IN WAITORTIMERCALLBACKFUNC pfnCallback,
  4261. IN LPVOID pContext,
  4262. IN DWORD dwMilliseconds,
  4263. IN LPCSTR lpszLibrary OPTIONAL,
  4264. IN DWORD dwFlags
  4265. );
  4266. //
  4267. // flags for SHRegisterWaitForSingleObject (keep separate from other TPS flags)
  4268. //
  4269. //
  4270. // SRWSO_NOREMOVE - if set, the handle is not to be removed from the list once
  4271. // signalled. Intended for use with auto-reset events that the caller wants to
  4272. // keep until unregistered
  4273. //
  4274. #define SRWSO_NOREMOVE 0x00000100
  4275. #define SRWSO_VALID_FLAGS (SRWSO_NOREMOVE)
  4276. #define SRWSO_INVALID_FLAGS (~SRWSO_VALID_FLAGS)
  4277. LWSTDAPI_(BOOL)
  4278. SHUnregisterWait(
  4279. IN HANDLE hWait
  4280. );
  4281. typedef struct {
  4282. DWORD dwStructSize;
  4283. DWORD dwMinimumWorkerThreads;
  4284. DWORD dwMaximumWorkerThreads;
  4285. DWORD dwMaximumWorkerQueueDepth;
  4286. DWORD dwWorkerThreadIdleTimeout;
  4287. DWORD dwWorkerThreadCreationDelta;
  4288. DWORD dwMinimumIoWorkerThreads;
  4289. DWORD dwMaximumIoWorkerThreads;
  4290. DWORD dwMaximumIoWorkerQueueDepth;
  4291. DWORD dwIoWorkerThreadCreationDelta;
  4292. } SH_THREAD_POOL_LIMITS, *PSH_THREAD_POOL_LIMITS;
  4293. LWSTDAPI_(BOOL)
  4294. SHSetThreadPoolLimits(
  4295. IN PSH_THREAD_POOL_LIMITS pLimits
  4296. );
  4297. LWSTDAPI_(BOOL)
  4298. SHTerminateThreadPool(
  4299. VOID
  4300. );
  4301. LWSTDAPI_(BOOL)
  4302. SHQueueUserWorkItem(
  4303. IN LPTHREAD_START_ROUTINE pfnCallback,
  4304. IN LPVOID pContext,
  4305. IN LONG lPriority,
  4306. IN DWORD_PTR dwTag,
  4307. OUT DWORD_PTR * pdwId OPTIONAL,
  4308. IN LPCSTR pszModule OPTIONAL,
  4309. IN DWORD dwFlags
  4310. );
  4311. LWSTDAPI_(DWORD)
  4312. SHCancelUserWorkItems(
  4313. IN DWORD_PTR dwTagOrId,
  4314. IN BOOL bTag
  4315. );
  4316. LWSTDAPI_(HANDLE)
  4317. SHCreateTimerQueue(
  4318. VOID
  4319. );
  4320. LWSTDAPI_(BOOL)
  4321. SHDeleteTimerQueue(
  4322. IN HANDLE hQueue
  4323. );
  4324. LWSTDAPI_(HANDLE)
  4325. SHSetTimerQueueTimer(
  4326. IN HANDLE hQueue,
  4327. IN WAITORTIMERCALLBACK pfnCallback,
  4328. IN LPVOID pContext,
  4329. IN DWORD dwDueTime,
  4330. IN DWORD dwPeriod,
  4331. IN LPCSTR lpszLibrary OPTIONAL,
  4332. IN DWORD dwFlags
  4333. );
  4334. LWSTDAPI_(BOOL)
  4335. SHChangeTimerQueueTimer(
  4336. IN HANDLE hQueue,
  4337. IN HANDLE hTimer,
  4338. IN DWORD dwDueTime,
  4339. IN DWORD dwPeriod
  4340. );
  4341. LWSTDAPI_(BOOL)
  4342. SHCancelTimerQueueTimer(
  4343. IN HANDLE hQueue,
  4344. IN HANDLE hTimer
  4345. );
  4346. //
  4347. // Thread Pool Services flags
  4348. //
  4349. //
  4350. // TPS_EXECUTEIO - execute in I/O thread (via APC). Default is non-IO thread
  4351. //
  4352. #define TPS_EXECUTEIO 0x00000001
  4353. //
  4354. // TPS_TAGGEDITEM - the dwTag parameter is meaningful
  4355. //
  4356. #define TPS_TAGGEDITEM 0x00000002
  4357. //
  4358. // TPS_DEMANDTHREAD - always create a new thread if none currently available.
  4359. // Used in situations where immediate response required
  4360. //
  4361. #define TPS_DEMANDTHREAD 0x00000004
  4362. //
  4363. // TPS_LONGEXECTIME - the work item will take relatively long time to execute.
  4364. // Used as management hint to TPS
  4365. //
  4366. #define TPS_LONGEXECTIME 0x00000008
  4367. //
  4368. // TPS_RESERVED_FLAGS - mask of bits reserved for internal use
  4369. //
  4370. #define TPS_RESERVED_FLAGS 0xFF000000
  4371. #define TPS_VALID_FLAGS (TPS_EXECUTEIO \
  4372. | TPS_TAGGEDITEM \
  4373. | TPS_DEMANDTHREAD \
  4374. | TPS_LONGEXECTIME \
  4375. )
  4376. #define TPS_INVALID_FLAGS (~TPS_VALID_FLAGS)
  4377. #endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_TPS)
  4378. //
  4379. // Private MIME helper functions used by shdocvw & shell32
  4380. //
  4381. #if (_WIN32_IE >= 0x0500)
  4382. LWSTDAPI_(BOOL) GetMIMETypeSubKeyA(LPCSTR pszMIMEType, LPSTR pszBuf, UINT cchBuf);
  4383. LWSTDAPI_(BOOL) GetMIMETypeSubKeyW(LPCWSTR pszMIMEType, LPWSTR pszBuf, UINT cchBuf);
  4384. LWSTDAPI_(BOOL) RegisterMIMETypeForExtensionA(LPCSTR pcszExtension, LPCSTR pcszMIMEContentType);
  4385. LWSTDAPI_(BOOL) RegisterMIMETypeForExtensionW(LPCWSTR pcszExtension, LPCWSTR pcszMIMEContentType);
  4386. LWSTDAPI_(BOOL) UnregisterMIMETypeForExtensionA(LPCSTR pcszExtension);
  4387. LWSTDAPI_(BOOL) UnregisterMIMETypeForExtensionW(LPCWSTR pcszExtension);
  4388. LWSTDAPI_(BOOL) RegisterExtensionForMIMETypeA(LPCSTR pcszExtension, LPCSTR pcszMIMEContentType);
  4389. LWSTDAPI_(BOOL) RegisterExtensionForMIMETypeW(LPCWSTR pcszExtension, LPCWSTR pcszMIMEContentType);
  4390. LWSTDAPI_(BOOL) UnregisterExtensionForMIMETypeA(LPCSTR pcszMIMEContentType);
  4391. LWSTDAPI_(BOOL) UnregisterExtensionForMIMETypeW(LPCWSTR pcszMIMEContentType);
  4392. LWSTDAPI_(BOOL) MIME_GetExtensionA(LPCSTR pcszMIMEType, LPSTR pszExtensionBuf, UINT ucExtensionBufLen);
  4393. LWSTDAPI_(BOOL) MIME_GetExtensionW(LPCWSTR pcszMIMEType, LPWSTR pszExtensionBuf, UINT ucExtensionBufLen);
  4394. #ifdef UNICODE
  4395. #define GetMIMETypeSubKey GetMIMETypeSubKeyW
  4396. #define RegisterMIMETypeForExtension RegisterMIMETypeForExtensionW
  4397. #define UnregisterMIMETypeForExtension UnregisterMIMETypeForExtensionW
  4398. #define RegisterExtensionForMIMEType RegisterExtensionForMIMETypeW
  4399. #define UnregisterExtensionForMIMEType UnregisterExtensionForMIMETypeW
  4400. #define MIME_GetExtension MIME_GetExtensionW
  4401. #else
  4402. #define GetMIMETypeSubKey GetMIMETypeSubKeyA
  4403. #define RegisterMIMETypeForExtension RegisterMIMETypeForExtensionA
  4404. #define UnregisterMIMETypeForExtension UnregisterMIMETypeForExtensionA
  4405. #define RegisterExtensionForMIMEType RegisterExtensionForMIMETypeA
  4406. #define UnregisterExtensionForMIMEType UnregisterExtensionForMIMETypeA
  4407. #define MIME_GetExtension MIME_GetExtensionA
  4408. #endif
  4409. // Options for SHGetMachineInfo
  4410. //
  4411. // Note that GMI_DOCKSTATE is unreliable for ACPI laptops.
  4412. //
  4413. #define GMI_DOCKSTATE 0x0000
  4414. // Return values for SHGetMachineInfo(GMI_DOCKSTATE)
  4415. #define GMID_NOTDOCKABLE 0 // Cannot be docked
  4416. #define GMID_UNDOCKED 1 // Is undocked
  4417. #define GMID_DOCKED 2 // Is docked
  4418. //
  4419. // GMI_BATTERYSTATE reports on the presence and status of non-UPS
  4420. // batteries.
  4421. //
  4422. #define GMI_BATTERYSTATE 0x0001
  4423. // Return value for SHGetMachineInfo(GMI_BATTERYSTATE) is a bitmask
  4424. #define GMIB_HASBATTERY 0x0001 // Can run on batteries
  4425. #define GMIB_ONBATTERY 0x0002 // Is now on batteries
  4426. //
  4427. // WARNING! DANGER! EVIL!
  4428. //
  4429. // GMI_LAPTOP is not perfect. It can be fooled by particular hardware
  4430. // configurations. You are much better off asking specifically why you
  4431. // care about laptops and use one of the above GMI values instead. For
  4432. // example, if you want to scale back some intensive operation so you
  4433. // don't drain the battery, use GMI_BATTERYSTATE instead.
  4434. //
  4435. #define GMI_LAPTOP 0x0002 // Returns nonzero if might be a laptop
  4436. #if (_WIN32_IE >= 0x0501)
  4437. //
  4438. // GMI_TSCLIENT tells you whether you are running as a Terminal Server
  4439. // client and should disable your animations.
  4440. //
  4441. #define GMI_TSCLIENT 0x0003 // Returns nonzero if TS client
  4442. #endif // (_WIN32_IE >= 0x0501)
  4443. LWSTDAPI_(DWORD_PTR) SHGetMachineInfo(UINT gmi);
  4444. // support InterlockedCompareExchange() on Win95
  4445. LWSTDAPI_(void *) SHInterlockedCompareExchange(void **ppDest, void *pExch, void *pComp);
  4446. #if !defined(_X86_)
  4447. // Win95 doesn't run on Alpha/UNIX so we can use the OS function directly
  4448. // Use a #define instead of a forwarder because it's an intrinsic on most
  4449. // compilers.
  4450. #define SHInterlockedCompareExchange InterlockedCompareExchangePointer
  4451. #endif
  4452. LWSTDAPI_(BOOL) SHMirrorIcon(HICON* phiconSmall, HICON* phiconLarge);
  4453. #endif // (_WIN32_IE >= 0x0500)
  4454. // Raw Accelerator Table API
  4455. //
  4456. // Allows an accelerator table grep without having to invoke ::TranslateAccelerator.
  4457. // Useful for dealing with parent-child window accelerator conflicts.
  4458. //
  4459. // HANDLE SHLoadRawAccelerators( HINSTANCE hInst, LPCTSTR lpTableName );
  4460. // Loads the raw accelerator table.
  4461. // hInst Module instance containing the accelerator resource.
  4462. // lpTableName Names the accelerator table resource to load.
  4463. // The return value is a handle that can be passed to a SHQueryRawAcceleratorXXX function.
  4464. // When the handle is no longer required, it should be freed with LocalFree().
  4465. LWSTDAPI_(HANDLE) SHLoadRawAccelerators ( HINSTANCE hInst, LPCTSTR lpTableName );
  4466. // BOOL SHQueryRawAccelerator ( HANDLE hcaAcc, IN BYTE fVirtMask, IN BYTE fVirt, IN WPARAM wKey, OUT OPTIONAL UINT* puCmdID );
  4467. // Queries the raw accelererator table for the specified key
  4468. // hcaAcc Handle returned from SHLoadRawAccelerators().
  4469. // fVirtMask Relevant accelerator flags (any combo of FALT|FCONTROL|FNOINVERT|FSHIFT|FVIRTKEY)
  4470. // fVirt Accelerator flags to test (any combo of FALT|FCONTROL|FNOINVERT|FSHIFT|FVIRTKEY).
  4471. // wKey Accelerator key. This can either be a virtual key (FVIRTKEY) or an ASCII char code.
  4472. // puCmdID Optional address to receive command identifier for the accelerator entry if
  4473. // the key is in the table.
  4474. // Returns nonzero if the key is in the accelerator table; otherwise 0.
  4475. LWSTDAPI_(BOOL) SHQueryRawAccelerator ( HANDLE hcaAcc, IN BYTE fVirtMask, IN BYTE fVirt, IN WPARAM wKey, OUT OPTIONAL UINT* puCmdID );
  4476. // BOOL SHQueryRawAcceleratorMsg( HANDLE hcaAcc, MSG* pmsg, OUT OPTIONAL UINT* puCmdID );
  4477. // Determines whether the specified message is an accelerator message mapping to
  4478. // an entry in the raw accelerator table.
  4479. // hcaAcc Handle returned from SHLoadRawAccelerators().
  4480. // pmsg Address of the message to test.
  4481. // puCmdID Optional address to receive command identifier for the accelerator entry if
  4482. // the message maps to an accelerator in the table.
  4483. // Returns nonzero if the message is a WM_KEYUP or WM_KEYDOWN and the key is in
  4484. // the accelerator table; otherwise 0.
  4485. LWSTDAPI_(BOOL) SHQueryRawAcceleratorMsg( HANDLE hcaAcc, MSG* pmsg, OUT OPTIONAL UINT* puCmdID );
  4486. //
  4487. //
  4488. LWSTDAPI_(BOOL) SHBoolSystemParametersInfo(UINT uiAction, DWORD *pdwParam);
  4489. LWSTDAPI_(BOOL) SHAreIconsEqual(HICON hIcon1, HICON hIcon2);
  4490. LWSTDAPI_(BOOL) IEHardened(void);
  4491. //
  4492. //====== End Internal functions ===============================================
  4493. //
  4494. #endif // NO_SHLWAPI_INTERNAL
  4495. ;end_internal
  4496. #if (_WIN32_IE >= 0x0500)
  4497. // SHAutoComplete
  4498. // hwndEdit - HWND of editbox, ComboBox or ComboBoxEx.
  4499. // dwFlags - Flags to indicate what to AutoAppend or AutoSuggest for the editbox.
  4500. //
  4501. // WARNING:
  4502. // Caller needs to have called CoInitialize() or OleInitialize()
  4503. // and cannot call CoUninit/OleUninit until after
  4504. // WM_DESTROY on hwndEdit.
  4505. //
  4506. // dwFlags values:
  4507. #define SHACF_DEFAULT 0x00000000 // Currently (SHACF_FILESYSTEM | SHACF_URLALL)
  4508. #define SHACF_FILESYSTEM 0x00000001 // This includes the File System as well as the rest of the shell (Desktop\My Computer\Control Panel\)
  4509. #define SHACF_URLALL (SHACF_URLHISTORY | SHACF_URLMRU)
  4510. #define SHACF_URLHISTORY 0x00000002 // URLs in the User's History
  4511. #define SHACF_URLMRU 0x00000004 // URLs in the User's Recently Used list.
  4512. #define SHACF_USETAB 0x00000008 // Use the tab to move thru the autocomplete possibilities instead of to the next dialog/window control.
  4513. #define SHACF_FILESYS_ONLY 0x00000010 // This includes the File System
  4514. #if (_WIN32_IE >= 0x0600)
  4515. #define SHACF_FILESYS_DIRS 0x00000020 // Same as SHACF_FILESYS_ONLY except it only includes directories, UNC servers, and UNC server shares.
  4516. #endif // (_WIN32_IE >= 0x0600)
  4517. #define SHACF_AUTOSUGGEST_FORCE_ON 0x10000000 // Ignore the registry default and force the feature on.
  4518. #define SHACF_AUTOSUGGEST_FORCE_OFF 0x20000000 // Ignore the registry default and force the feature off.
  4519. #define SHACF_AUTOAPPEND_FORCE_ON 0x40000000 // Ignore the registry default and force the feature on. (Also know as AutoComplete)
  4520. #define SHACF_AUTOAPPEND_FORCE_OFF 0x80000000 // Ignore the registry default and force the feature off. (Also know as AutoComplete)
  4521. LWSTDAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags);
  4522. LWSTDAPI SHSetThreadRef(IUnknown *punk);
  4523. LWSTDAPI SHGetThreadRef(IUnknown **ppunk);
  4524. LWSTDAPI_(BOOL) SHSkipJunction(struct IBindCtx* pbc, const CLSID *pclsid);
  4525. #endif // (_WIN32_IE >= 0x0500)
  4526. #define CTF_INSIST 0x00000001 // SHCreateThread() dwFlags - call pfnThreadProc synchronously if CreateThread() fails
  4527. #define CTF_THREAD_REF 0x00000002 // hold a reference to the creating thread
  4528. #define CTF_PROCESS_REF 0x00000004 // hold a reference to the creating process
  4529. #define CTF_COINIT 0x00000008 // init COM for the created thread
  4530. #define CTF_FREELIBANDEXIT 0x00000010 // hold a ref to the DLL and call FreeLibraryAndExitThread() when done
  4531. #define CTF_REF_COUNTED 0x00000020 // thread supports ref counting via SHGetThreadRef() or CTF_THREAD_REF so that child threads can keep this thread alive
  4532. #define CTF_WAIT_ALLOWCOM 0x00000040 // while waiting for pfnCallback, allow COM marshaling to the blocked calling thread
  4533. LWSTDAPI_(BOOL) SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, void *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback);
  4534. LWSTDAPI SHReleaseThreadRef(); // release a CTF_THREAD_REF reference earlier than the return of pfnThreadProc
  4535. #ifndef NO_SHLWAPI_GDI
  4536. //
  4537. //====== GDI helper functions ================================================
  4538. //
  4539. LWSTDAPI_(HPALETTE) SHCreateShellPalette(HDC hdc);
  4540. #if (_WIN32_IE >= 0x0500)
  4541. LWSTDAPI_(void) ColorRGBToHLS(COLORREF clrRGB, WORD* pwHue, WORD* pwLuminance, WORD* pwSaturation);
  4542. LWSTDAPI_(COLORREF) ColorHLSToRGB(WORD wHue, WORD wLuminance, WORD wSaturation);
  4543. LWSTDAPI_(COLORREF) ColorAdjustLuma(COLORREF clrRGB, int n, BOOL fScale);
  4544. ;begin_internal
  4545. #ifdef NOTYET // once this is implemented, make this public
  4546. // SHGetCommonResourceID
  4547. //
  4548. // (use MAKEINTRESOURCE on the following IDs)
  4549. // These values are indexes into an internal table. Be careful. ;internal
  4550. #define SHGCR_BITMAP_WINDOWS_LOGO MAKEINTRESOURCE(1)
  4551. #define SHGCR_AVI_FLASHLIGHT MAKEINTRESOURCE(2)
  4552. #define SHGCR_AVI_FINDFILE MAKEINTRESOURCE(3)
  4553. #define SHGCR_AVI_FINDCOMPUTER MAKEINTRESOURCE(4)
  4554. #define SHGCR_AVI_FILEMOVE MAKEINTRESOURCE(5)
  4555. #define SHGCR_AVI_FILECOPY MAKEINTRESOURCE(6)
  4556. #define SHGCR_AVI_FILEDELETE MAKEINTRESOURCE(7)
  4557. #define SHGCR_AVI_EMPTYWASTEBASKET MAKEINTRESOURCE(8)
  4558. #define SHGCR_AVI_FILEREALDELETE MAKEINTRESOURCE(9) // Bypass Recycle Bin
  4559. #define SHGCR_AVI_DOWNLOAD MAKEINTRESOURCE(10)
  4560. LWSTDAPI SHGetCommonResourceIDA(IN LPCSTR pszID, IN DWORD dwRes, OUT HMODULE * phmod, OUT UINT * pnID);
  4561. LWSTDAPI SHGetCommonResourceIDA(IN LPCSTR pszID, IN DWORD dwRes, OUT HMODULE * phmod, OUT UINT * pnID);
  4562. #ifdef UNICODE
  4563. #define SHGetCommonResourceID SHGetCommonResourceIDW
  4564. #else
  4565. #define SHGetCommonResourceID SHGetCommonResourceIDW
  4566. #endif
  4567. #endif // NOTYET
  4568. ;end_internal
  4569. #endif // _WIN32_IE >= 0x0500
  4570. #endif // NO_SHLWAPI_GDI
  4571. //
  4572. //====== DllGetVersion =======================================================
  4573. //
  4574. typedef struct _DLLVERSIONINFO
  4575. {
  4576. DWORD cbSize;
  4577. DWORD dwMajorVersion; // Major version
  4578. DWORD dwMinorVersion; // Minor version
  4579. DWORD dwBuildNumber; // Build number
  4580. DWORD dwPlatformID; // DLLVER_PLATFORM_*
  4581. } DLLVERSIONINFO;
  4582. // Platform IDs for DLLVERSIONINFO
  4583. #define DLLVER_PLATFORM_WINDOWS 0x00000001 // Windows 95
  4584. #define DLLVER_PLATFORM_NT 0x00000002 // Windows NT
  4585. #if (_WIN32_IE >= 0x0501)
  4586. typedef struct _DLLVERSIONINFO2
  4587. {
  4588. DLLVERSIONINFO info1;
  4589. // dwFlags is really for alignment purposes ;Internal
  4590. DWORD dwFlags; // No flags currently defined
  4591. ULONGLONG ullVersion; // Encoded as:
  4592. // Major 0xFFFF 0000 0000 0000
  4593. // Minor 0x0000 FFFF 0000 0000
  4594. // Build 0x0000 0000 FFFF 0000
  4595. // QFE 0x0000 0000 0000 FFFF
  4596. } DLLVERSIONINFO2;
  4597. #define DLLVER_MAJOR_MASK 0xFFFF000000000000
  4598. #define DLLVER_MINOR_MASK 0x0000FFFF00000000
  4599. #define DLLVER_BUILD_MASK 0x00000000FFFF0000
  4600. #define DLLVER_QFE_MASK 0x000000000000FFFF
  4601. #endif
  4602. #define MAKEDLLVERULL(major, minor, build, qfe) \
  4603. (((ULONGLONG)(major) << 48) | \
  4604. ((ULONGLONG)(minor) << 32) | \
  4605. ((ULONGLONG)(build) << 16) | \
  4606. ((ULONGLONG)( qfe) << 0))
  4607. //
  4608. // The caller should always GetProcAddress("DllGetVersion"), not
  4609. // implicitly link to it.
  4610. //
  4611. typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
  4612. // DllInstall (to be implemented by self-installing DLLs)
  4613. STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine);
  4614. ;begin_internal
  4615. #if (_WIN32_IE >= 0x0501)
  4616. //
  4617. // ======== SHGetAppCompatFlags ================================================
  4618. //
  4619. //===========================================================================
  4620. // Shell Application Compatability flags
  4621. // SHGetAppCompatFlags flags
  4622. #define ACF_NONE 0x00000000
  4623. #define ACF_CONTEXTMENU 0x00000001
  4624. #define ACF_CORELINTERNETENUM 0x00000004 // corel suite 8 has this same problem as suite 7 but does not have context menu one so need new bit
  4625. #define ACF_OLDCREATEVIEWWND 0x00000004 // PowerDesk relies on CreateViewWindow returning S_OK
  4626. #define ACF_WIN95DEFVIEW 0x00000004 // for apps that depend on win95 defview behavior
  4627. #define ACF_DOCOBJECT 0x00000002
  4628. #define ACF_FLUSHNOWAITALWAYS 0x00000001
  4629. #define ACF_MYCOMPUTERFIRST 0x00000008 // MyComp must be first item on the desktop
  4630. #define ACF_OLDREGITEMGDN 0x00000010 // Win95-compatible GetDisplayNameOf on regitems
  4631. #define ACF_LOADCOLUMNHANDLER 0x00000040 // Dont delay load column handler.
  4632. #define ACF_ANSI 0x00000080 // For Apps that Pass in ANSI Strings
  4633. #define ACF_STRIPFOLDERBIT 0x00000100 // nuke the folder GAO in file dialog (for folder shortcuts, zip & cab files)
  4634. #define ACF_WIN95SHLEXEC 0x00000200 // dont use DDEWAIT when thunking to ShellExecEx()
  4635. #define ACF_STAROFFICE5PRINTER 0x00000400 // special return values from printer folder GAO
  4636. #define ACF_NOVALIDATEFSIDS 0x00000800 // FS pidls should not be validated.
  4637. #define ACF_FILEOPENNEEDSEXT 0x00001000 // Need to show extensioin in the name box of the open file common dialog
  4638. #define ACF_WIN95BINDTOOBJECT 0x00002000 // Win95 BindToObject behavior dependencies
  4639. #define ACF_IGNOREENUMRESET 0x00004000 // App relies on IEnumIDList::Reset returning E_NOTIMPL
  4640. #define ACF_ANSIDISPLAYNAMES 0x00010000 // calling process requires the ISF::GDN in ansi
  4641. #define ACF_FILEOPENBOGUSCTRLID 0x00020000 // Requires that the toolbar in fileopen have ctrl ID == ID_OK
  4642. #define ACF_FORCELFNIDLIST 0x00040000 // forces no AltName in the FS pidls (for apps that read directly from the pidl)
  4643. #define ACF_APPISOFFICE 0x01000000 // calling app is office (95, 97, 2000, ++)
  4644. #define ACF_KNOWPERPROCESS 0x80000000 // We know the per process flags already.
  4645. // The flags that are per-process
  4646. #define ACF_PERPROCESSFLAGS (ACF_CONTEXTMENU | ACF_CORELINTERNETENUM | ACF_OLDCREATEVIEWWND | ACF_WIN95DEFVIEW | \
  4647. ACF_DOCOBJECT | ACF_FLUSHNOWAITALWAYS | ACF_MYCOMPUTERFIRST | ACF_OLDREGITEMGDN | \
  4648. ACF_LOADCOLUMNHANDLER | ACF_ANSI | ACF_WIN95SHLEXEC | ACF_STAROFFICE5PRINTER | \
  4649. ACF_NOVALIDATEFSIDS | ACF_FILEOPENNEEDSEXT | ACF_WIN95BINDTOOBJECT | \
  4650. ACF_IGNOREENUMRESET | ACF_ANSIDISPLAYNAMES | ACF_FILEOPENBOGUSCTRLID | ACF_FORCELFNIDLIST)
  4651. // Flags that are per caller
  4652. #define ACF_PERCALLFLAGS (ACF_APPISOFFICE | ACF_STRIPFOLDERBIT)
  4653. LWSTDAPI_(DWORD) SHGetAppCompatFlags (DWORD dwFlagsNeeded);
  4654. enum {
  4655. OBJCOMPATF_OTNEEDSSFCACHE = 0x00000001,
  4656. OBJCOMPATF_NO_WEBVIEW = 0x00000002,
  4657. OBJCOMPATF_UNBINDABLE = 0x00000004,
  4658. OBJCOMPATF_PINDLL = 0x00000008,
  4659. OBJCOMPATF_NEEDSFILESYSANCESTOR = 0x00000010,
  4660. OBJCOMPATF_NOTAFILESYSTEM = 0x00000020,
  4661. OBJCOMPATF_CTXMENU_NOVERBS = 0x00000040,
  4662. OBJCOMPATF_CTXMENU_LIMITEDQI = 0x00000080,
  4663. OBJCOMPATF_COCREATESHELLFOLDERONLY = 0x00000100,
  4664. OBJCOMPATF_NEEDSSTORAGEANCESTOR = 0x00000200,
  4665. OBJCOMPATF_NOLEGACYWEBVIEW = 0x00000400,
  4666. OBJCOMPATF_BLOCKSHELLSERVICEOBJECT = 0x00000800,
  4667. } ;
  4668. typedef DWORD OBJCOMPATFLAGS;
  4669. LWSTDAPI_(OBJCOMPATFLAGS) SHGetObjectCompatFlags(IUnknown *punk, const CLSID *pclsid);
  4670. #endif // (_WIN32_IE >= 0x0501)
  4671. #if (_WIN32_IE >= 0x0560)
  4672. LWSTDAPI_(UINT) GetUIVersion();
  4673. #endif // (_WIN32_IE >= 0x0560)
  4674. ;end_internal
  4675. ;begin_both
  4676. #ifdef __cplusplus
  4677. }
  4678. #endif
  4679. #ifdef _WIN32
  4680. #include <poppack.h>
  4681. #endif
  4682. #endif
  4683. ;end_both
  4684. #endif // _INC_SHLWAPIP ;internal
  4685. #endif // _INC_SHLWAPI