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.

1555 lines
70 KiB

  1. /*****************************************************************************\
  2. * *
  3. * shlwapi.h - Interface for the Windows light-weight utility APIs *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) Microsoft Corporation. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #ifndef _INC_SHLWAPI
  11. #define _INC_SHLWAPI
  12. #ifndef NOSHLWAPI
  13. #include <objbase.h>
  14. #include <shtypes.h>
  15. #ifndef _WINRESRC_
  16. #ifndef _WIN32_IE
  17. #define _WIN32_IE 0x0501
  18. #else
  19. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  20. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  21. #endif
  22. #endif
  23. #endif
  24. #ifdef UNIX
  25. typedef interface IInternetSecurityMgrSite IInternetSecurityMgrSite;
  26. typedef interface IInternetSecurityManager IInternetSecurityManager;
  27. typedef interface IInternetHostSecurityManager IInternetHostSecurityManager;
  28. #endif
  29. //
  30. // Define API decoration for direct importing of DLL references.
  31. //
  32. #ifndef WINSHLWAPI
  33. #if !defined(_SHLWAPI_)
  34. #define LWSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  35. #define LWSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  36. #define LWSTDAPIV EXTERN_C DECLSPEC_IMPORT HRESULT STDAPIVCALLTYPE
  37. #define LWSTDAPIV_(type) EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE
  38. #else
  39. #define LWSTDAPI STDAPI
  40. #define LWSTDAPI_(type) STDAPI_(type)
  41. #define LWSTDAPIV STDAPIV
  42. #define LWSTDAPIV_(type) STDAPIV_(type)
  43. #endif
  44. #endif // WINSHLWAPI
  45. #ifdef _WIN32
  46. #include <pshpack8.h>
  47. #endif
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. //
  52. // Users of this header may define any number of these constants to avoid
  53. // the definitions of each functional group.
  54. //
  55. // NO_SHLWAPI_STRFCNS String functions
  56. // NO_SHLWAPI_PATH Path functions
  57. // NO_SHLWAPI_REG Registry functions
  58. // NO_SHLWAPI_STREAM Stream functions
  59. // NO_SHLWAPI_GDI GDI helper functions
  60. #ifndef NO_SHLWAPI_STRFCNS
  61. //
  62. //=============== String Routines ===================================
  63. //
  64. LWSTDAPI_(LPSTR) StrChrA(LPCSTR lpStart, WORD wMatch);
  65. LWSTDAPI_(LPWSTR) StrChrW(LPCWSTR lpStart, WCHAR wMatch);
  66. LWSTDAPI_(LPSTR) StrChrIA(LPCSTR lpStart, WORD wMatch);
  67. LWSTDAPI_(LPWSTR) StrChrIW(LPCWSTR lpStart, WCHAR wMatch);
  68. LWSTDAPI_(int) StrCmpNA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  69. LWSTDAPI_(int) StrCmpNW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  70. LWSTDAPI_(int) StrCmpNIA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
  71. LWSTDAPI_(int) StrCmpNIW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
  72. LWSTDAPI_(int) StrCSpnA(LPCSTR lpStr, LPCSTR lpSet);
  73. LWSTDAPI_(int) StrCSpnW(LPCWSTR lpStr, LPCWSTR lpSet);
  74. LWSTDAPI_(int) StrCSpnIA(LPCSTR lpStr, LPCSTR lpSet);
  75. LWSTDAPI_(int) StrCSpnIW(LPCWSTR lpStr, LPCWSTR lpSet);
  76. LWSTDAPI_(LPSTR) StrDupA(LPCSTR lpSrch);
  77. LWSTDAPI_(LPWSTR) StrDupW(LPCWSTR lpSrch);
  78. LWSTDAPI_(LPSTR) StrFormatByteSizeA(DWORD dw, LPSTR szBuf, UINT uiBufSize);
  79. LWSTDAPI_(LPSTR) StrFormatByteSize64A(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
  80. LWSTDAPI_(LPWSTR) StrFormatByteSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
  81. LWSTDAPI_(LPWSTR) StrFormatKBSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
  82. LWSTDAPI_(LPSTR) StrFormatKBSizeA(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
  83. LWSTDAPI_(int) StrFromTimeIntervalA(LPSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
  84. LWSTDAPI_(int) StrFromTimeIntervalW(LPWSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
  85. LWSTDAPI_(BOOL) StrIsIntlEqualA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
  86. LWSTDAPI_(BOOL) StrIsIntlEqualW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
  87. LWSTDAPI_(LPSTR) StrNCatA(LPSTR psz1, LPCSTR psz2, int cchMax);
  88. LWSTDAPI_(LPWSTR) StrNCatW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
  89. LWSTDAPI_(LPSTR) StrPBrkA(LPCSTR psz, LPCSTR pszSet);
  90. LWSTDAPI_(LPWSTR) StrPBrkW(LPCWSTR psz, LPCWSTR pszSet);
  91. LWSTDAPI_(LPSTR) StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
  92. LWSTDAPI_(LPWSTR) StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
  93. LWSTDAPI_(LPSTR) StrRChrIA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
  94. LWSTDAPI_(LPWSTR) StrRChrIW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
  95. LWSTDAPI_(LPSTR) StrRStrIA(LPCSTR lpSource, LPCSTR lpLast, LPCSTR lpSrch);
  96. LWSTDAPI_(LPWSTR) StrRStrIW(LPCWSTR lpSource, LPCWSTR lpLast, LPCWSTR lpSrch);
  97. LWSTDAPI_(int) StrSpnA(LPCSTR psz, LPCSTR pszSet);
  98. LWSTDAPI_(int) StrSpnW(LPCWSTR psz, LPCWSTR pszSet);
  99. LWSTDAPI_(LPSTR) StrStrA(LPCSTR lpFirst, LPCSTR lpSrch);
  100. LWSTDAPI_(LPWSTR) StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch);
  101. LWSTDAPI_(LPSTR) StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
  102. LWSTDAPI_(LPWSTR) StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch);
  103. LWSTDAPI_(int) StrToIntA(LPCSTR lpSrc);
  104. LWSTDAPI_(int) StrToIntW(LPCWSTR lpSrc);
  105. LWSTDAPI_(BOOL) StrToIntExA(LPCSTR pszString, DWORD dwFlags, int * piRet);
  106. LWSTDAPI_(BOOL) StrToIntExW(LPCWSTR pszString, DWORD dwFlags, int * piRet);
  107. #if (_WIN32_IE >= 0x0600)
  108. LWSTDAPI_(BOOL) StrToInt64ExA(LPCSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
  109. LWSTDAPI_(BOOL) StrToInt64ExW(LPCWSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
  110. #endif
  111. LWSTDAPI_(BOOL) StrTrimA(LPSTR psz, LPCSTR pszTrimChars);
  112. LWSTDAPI_(BOOL) StrTrimW(LPWSTR psz, LPCWSTR pszTrimChars);
  113. LWSTDAPI_(LPWSTR) StrCatW(LPWSTR psz1, LPCWSTR psz2);
  114. LWSTDAPI_(int) StrCmpW(LPCWSTR psz1, LPCWSTR psz2);
  115. LWSTDAPI_(int) StrCmpIW(LPCWSTR psz1, LPCWSTR psz2);
  116. LWSTDAPI_(LPWSTR) StrCpyW(LPWSTR psz1, LPCWSTR psz2);
  117. LWSTDAPI_(LPWSTR) StrCpyNW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
  118. LWSTDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize);
  119. LWSTDAPI_(LPSTR) StrCatBuffA(LPSTR pszDest, LPCSTR pszSrc, int cchDestBuffSize);
  120. LWSTDAPI_(BOOL) ChrCmpIA(WORD w1, WORD w2);
  121. LWSTDAPI_(BOOL) ChrCmpIW(WCHAR w1, WCHAR w2);
  122. LWSTDAPI_(int) wvnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, va_list arglist);
  123. LWSTDAPI_(int) wvnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, va_list arglist);
  124. LWSTDAPIV_(int) wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...);
  125. LWSTDAPIV_(int) wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...);
  126. #define StrIntlEqNA( s1, s2, nChar) StrIsIntlEqualA( TRUE, s1, s2, nChar)
  127. #define StrIntlEqNW( s1, s2, nChar) StrIsIntlEqualW( TRUE, s1, s2, nChar)
  128. #define StrIntlEqNIA(s1, s2, nChar) StrIsIntlEqualA(FALSE, s1, s2, nChar)
  129. #define StrIntlEqNIW(s1, s2, nChar) StrIsIntlEqualW(FALSE, s1, s2, nChar)
  130. LWSTDAPI StrRetToStrA(STRRET *pstr, LPCITEMIDLIST pidl, LPSTR *ppsz);
  131. LWSTDAPI StrRetToStrW(STRRET *pstr, LPCITEMIDLIST pidl, LPWSTR *ppsz);
  132. #ifdef UNICODE
  133. #define StrRetToStr StrRetToStrW
  134. #else
  135. #define StrRetToStr StrRetToStrA
  136. #endif // !UNICODE
  137. LWSTDAPI StrRetToBufA(STRRET *pstr, LPCITEMIDLIST pidl, LPSTR pszBuf, UINT cchBuf);
  138. LWSTDAPI StrRetToBufW(STRRET *pstr, LPCITEMIDLIST pidl, LPWSTR pszBuf, UINT cchBuf);
  139. #ifdef UNICODE
  140. #define StrRetToBuf StrRetToBufW
  141. #else
  142. #define StrRetToBuf StrRetToBufA
  143. #endif // !UNICODE
  144. LWSTDAPI StrRetToBSTR(STRRET *pstr, LPCITEMIDLIST pidl, BSTR *pbstr);
  145. // helper to duplicate a string using the task allocator
  146. LWSTDAPI SHStrDupA(LPCSTR psz, WCHAR **ppwsz);
  147. LWSTDAPI SHStrDupW(LPCWSTR psz, WCHAR **ppwsz);
  148. #ifdef UNICODE
  149. #define SHStrDup SHStrDupW
  150. #else
  151. #define SHStrDup SHStrDupA
  152. #endif // !UNICODE
  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. #ifdef UNICODE
  157. #define StrChr StrChrW
  158. #define StrRChr StrRChrW
  159. #define StrChrI StrChrIW
  160. #define StrRChrI StrRChrIW
  161. #define StrCmpN StrCmpNW
  162. #define StrCmpNI StrCmpNIW
  163. #define StrStr StrStrW
  164. #define StrStrI StrStrIW
  165. #define StrDup StrDupW
  166. #define StrRStrI StrRStrIW
  167. #define StrCSpn StrCSpnW
  168. #define StrCSpnI StrCSpnIW
  169. #define StrSpn StrSpnW
  170. #define StrToInt StrToIntW
  171. #define StrPBrk StrPBrkW
  172. #define StrToIntEx StrToIntExW
  173. #if (_WIN32_IE >= 0x0600)
  174. #define StrToInt64Ex StrToInt64ExW
  175. #endif
  176. #define StrFromTimeInterval StrFromTimeIntervalW
  177. #define StrIntlEqN StrIntlEqNW
  178. #define StrIntlEqNI StrIntlEqNIW
  179. #define StrFormatByteSize StrFormatByteSizeW
  180. #define StrFormatByteSize64 StrFormatByteSizeW
  181. #define StrFormatKBSize StrFormatKBSizeW
  182. #define StrNCat StrNCatW
  183. #define StrTrim StrTrimW
  184. #define StrCatBuff StrCatBuffW
  185. #define ChrCmpI ChrCmpIW
  186. #define wvnsprintf wvnsprintfW
  187. #define wnsprintf wnsprintfW
  188. #define StrIsIntlEqual StrIsIntlEqualW
  189. #else
  190. #define StrChr StrChrA
  191. #define StrRChr StrRChrA
  192. #define StrChrI StrChrIA
  193. #define StrRChrI StrRChrIA
  194. #define StrCmpN StrCmpNA
  195. #define StrCmpNI StrCmpNIA
  196. #define StrStr StrStrA
  197. #define StrStrI StrStrIA
  198. #define StrDup StrDupA
  199. #define StrRStrI StrRStrIA
  200. #define StrCSpn StrCSpnA
  201. #define StrCSpnI StrCSpnIA
  202. #define StrSpn StrSpnA
  203. #define StrToInt StrToIntA
  204. #define StrPBrk StrPBrkA
  205. #define StrToIntEx StrToIntExA
  206. #if (_WIN32_IE >= 0x0600)
  207. #define StrToInt64Ex StrToInt64ExA
  208. #endif
  209. #define StrFromTimeInterval StrFromTimeIntervalA
  210. #define StrIntlEqN StrIntlEqNA
  211. #define StrIntlEqNI StrIntlEqNIA
  212. #define StrFormatByteSize StrFormatByteSizeA
  213. #define StrFormatByteSize64 StrFormatByteSize64A
  214. #define StrFormatKBSize StrFormatKBSizeA
  215. #define StrNCat StrNCatA
  216. #define StrTrim StrTrimA
  217. #define StrCatBuff StrCatBuffA
  218. #define ChrCmpI ChrCmpIA
  219. #define wvnsprintf wvnsprintfA
  220. #define wnsprintf wnsprintfA
  221. #define StrIsIntlEqual StrIsIntlEqualA
  222. #endif
  223. // Backward compatible to NT's non-standard naming (strictly
  224. // for comctl32)
  225. //
  226. LWSTDAPI_(BOOL) IntlStrEqWorkerA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
  227. LWSTDAPI_(BOOL) IntlStrEqWorkerW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
  228. #define IntlStrEqNA( s1, s2, nChar) IntlStrEqWorkerA( TRUE, s1, s2, nChar)
  229. #define IntlStrEqNW( s1, s2, nChar) IntlStrEqWorkerW( TRUE, s1, s2, nChar)
  230. #define IntlStrEqNIA(s1, s2, nChar) IntlStrEqWorkerA(FALSE, s1, s2, nChar)
  231. #define IntlStrEqNIW(s1, s2, nChar) IntlStrEqWorkerW(FALSE, s1, s2, nChar)
  232. #ifdef UNICODE
  233. #define IntlStrEqN IntlStrEqNW
  234. #define IntlStrEqNI IntlStrEqNIW
  235. #else
  236. #define IntlStrEqN IntlStrEqNA
  237. #define IntlStrEqNI IntlStrEqNIA
  238. #endif
  239. #define SZ_CONTENTTYPE_HTMLA "text/html"
  240. #define SZ_CONTENTTYPE_HTMLW L"text/html"
  241. #define SZ_CONTENTTYPE_CDFA "application/x-cdf"
  242. #define SZ_CONTENTTYPE_CDFW L"application/x-cdf"
  243. #ifdef UNICODE
  244. #define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLW
  245. #define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFW
  246. #else
  247. #define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLA
  248. #define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFA
  249. #endif
  250. #define PathIsHTMLFileA(pszPath) PathIsContentTypeA(pszPath, SZ_CONTENTTYPE_HTMLA)
  251. #define PathIsHTMLFileW(pszPath) PathIsContentTypeW(pszPath, SZ_CONTENTTYPE_HTMLW)
  252. // Flags for StrToIntEx
  253. #define STIF_DEFAULT 0x00000000L
  254. #define STIF_SUPPORT_HEX 0x00000001L
  255. #define StrCatA lstrcatA
  256. #define StrCmpA lstrcmpA
  257. #define StrCmpIA lstrcmpiA
  258. #define StrCpyA lstrcpyA
  259. #define StrCpyNA lstrcpynA
  260. #define StrToLong StrToInt
  261. #define StrNCmp StrCmpN
  262. #define StrNCmpI StrCmpNI
  263. #define StrNCpy StrCpyN
  264. #define StrCatN StrNCat
  265. #ifdef UNICODE
  266. #define StrCat StrCatW
  267. #define StrCmp StrCmpW
  268. #define StrCmpI StrCmpIW
  269. #define StrCpy StrCpyW
  270. #define StrCpyN StrCpyNW
  271. #define StrCatBuff StrCatBuffW
  272. #else
  273. #define StrCat lstrcatA
  274. #define StrCmp lstrcmpA
  275. #define StrCmpI lstrcmpiA
  276. #define StrCpy lstrcpyA
  277. #define StrCpyN lstrcpynA
  278. #define StrCatBuff StrCatBuffA
  279. #endif
  280. #endif // NO_SHLWAPI_STRFCNS
  281. #ifndef NO_SHLWAPI_PATH
  282. //
  283. //=============== Path Routines ===================================
  284. //
  285. LWSTDAPI_(LPSTR) PathAddBackslashA(LPSTR pszPath);
  286. LWSTDAPI_(LPWSTR) PathAddBackslashW(LPWSTR pszPath);
  287. #ifdef UNICODE
  288. #define PathAddBackslash PathAddBackslashW
  289. #else
  290. #define PathAddBackslash PathAddBackslashA
  291. #endif // !UNICODE
  292. LWSTDAPI_(BOOL) PathAddExtensionA(LPSTR pszPath, LPCSTR pszExt);
  293. LWSTDAPI_(BOOL) PathAddExtensionW(LPWSTR pszPath, LPCWSTR pszExt);
  294. #ifdef UNICODE
  295. #define PathAddExtension PathAddExtensionW
  296. #else
  297. #define PathAddExtension PathAddExtensionA
  298. #endif // !UNICODE
  299. LWSTDAPI_(BOOL) PathAppendA(LPSTR pszPath, LPCSTR pMore);
  300. LWSTDAPI_(BOOL) PathAppendW(LPWSTR pszPath, LPCWSTR pMore);
  301. LWSTDAPI_(LPSTR) PathBuildRootA(LPSTR pszRoot, int iDrive);
  302. LWSTDAPI_(LPWSTR) PathBuildRootW(LPWSTR pszRoot, int iDrive);
  303. #ifdef UNICODE
  304. #define PathBuildRoot PathBuildRootW
  305. #else
  306. #define PathBuildRoot PathBuildRootA
  307. #endif // !UNICODE
  308. LWSTDAPI_(BOOL) PathCanonicalizeA(LPSTR pszBuf, LPCSTR pszPath);
  309. LWSTDAPI_(BOOL) PathCanonicalizeW(LPWSTR pszBuf, LPCWSTR pszPath);
  310. LWSTDAPI_(LPSTR) PathCombineA(LPSTR pszDest, LPCSTR pszDir, LPCSTR pszFile);
  311. LWSTDAPI_(LPWSTR) PathCombineW(LPWSTR pszDest, LPCWSTR pszDir, LPCWSTR pszFile);
  312. #ifdef UNICODE
  313. #define PathCombine PathCombineW
  314. #else
  315. #define PathCombine PathCombineA
  316. #endif // !UNICODE
  317. LWSTDAPI_(BOOL) PathCompactPathA(HDC hDC, LPSTR pszPath, UINT dx);
  318. LWSTDAPI_(BOOL) PathCompactPathW(HDC hDC, LPWSTR pszPath, UINT dx);
  319. LWSTDAPI_(BOOL) PathCompactPathExA(LPSTR pszOut, LPCSTR pszSrc, UINT cchMax, DWORD dwFlags);
  320. LWSTDAPI_(BOOL) PathCompactPathExW(LPWSTR pszOut, LPCWSTR pszSrc, UINT cchMax, DWORD dwFlags);
  321. LWSTDAPI_(int) PathCommonPrefixA(LPCSTR pszFile1, LPCSTR pszFile2, LPSTR achPath);
  322. LWSTDAPI_(int) PathCommonPrefixW(LPCWSTR pszFile1, LPCWSTR pszFile2, LPWSTR achPath);
  323. LWSTDAPI_(BOOL) PathFileExistsA(LPCSTR pszPath);
  324. LWSTDAPI_(BOOL) PathFileExistsW(LPCWSTR pszPath);
  325. #ifdef UNICODE
  326. #define PathFileExists PathFileExistsW
  327. #else
  328. #define PathFileExists PathFileExistsA
  329. #endif // !UNICODE
  330. LWSTDAPI_(LPSTR) PathFindExtensionA(LPCSTR pszPath);
  331. LWSTDAPI_(LPWSTR) PathFindExtensionW(LPCWSTR pszPath);
  332. #ifdef UNICODE
  333. #define PathFindExtension PathFindExtensionW
  334. #else
  335. #define PathFindExtension PathFindExtensionA
  336. #endif // !UNICODE
  337. LWSTDAPI_(LPSTR) PathFindFileNameA(LPCSTR pszPath);
  338. LWSTDAPI_(LPWSTR) PathFindFileNameW(LPCWSTR pszPath);
  339. #ifdef UNICODE
  340. #define PathFindFileName PathFindFileNameW
  341. #else
  342. #define PathFindFileName PathFindFileNameA
  343. #endif // !UNICODE
  344. LWSTDAPI_(LPSTR) PathFindNextComponentA(LPCSTR pszPath);
  345. LWSTDAPI_(LPWSTR) PathFindNextComponentW(LPCWSTR pszPath);
  346. #ifdef UNICODE
  347. #define PathFindNextComponent PathFindNextComponentW
  348. #else
  349. #define PathFindNextComponent PathFindNextComponentA
  350. #endif // !UNICODE
  351. LWSTDAPI_(BOOL) PathFindOnPathA(LPSTR pszPath, LPCSTR * ppszOtherDirs);
  352. LWSTDAPI_(BOOL) PathFindOnPathW(LPWSTR pszPath, LPCWSTR * ppszOtherDirs);
  353. LWSTDAPI_(LPSTR) PathGetArgsA(LPCSTR pszPath);
  354. LWSTDAPI_(LPWSTR) PathGetArgsW(LPCWSTR pszPath);
  355. #ifdef UNICODE
  356. #define PathGetArgs PathGetArgsW
  357. #else
  358. #define PathGetArgs PathGetArgsA
  359. #endif // !UNICODE
  360. LWSTDAPI_(LPCSTR) PathFindSuffixArrayA(LPCSTR pszPath, const LPCSTR *apszSuffix, int iArraySize);
  361. LWSTDAPI_(LPCWSTR) PathFindSuffixArrayW(LPCWSTR pszPath, const LPCWSTR *apszSuffix, int iArraySize);
  362. #ifdef UNICODE
  363. #define PathFindSuffixArray PathFindSuffixArrayW
  364. #else
  365. #define PathFindSuffixArray PathFindSuffixArrayA
  366. #endif // !UNICODE
  367. LWSTDAPI_(BOOL) PathIsLFNFileSpecA(LPCSTR lpName);
  368. LWSTDAPI_(BOOL) PathIsLFNFileSpecW(LPCWSTR lpName);
  369. #ifdef UNICODE
  370. #define PathIsLFNFileSpec PathIsLFNFileSpecW
  371. #else
  372. #define PathIsLFNFileSpec PathIsLFNFileSpecA
  373. #endif // !UNICODE
  374. LWSTDAPI_(UINT) PathGetCharTypeA(UCHAR ch);
  375. LWSTDAPI_(UINT) PathGetCharTypeW(WCHAR ch);
  376. // Return flags for PathGetCharType
  377. #define GCT_INVALID 0x0000
  378. #define GCT_LFNCHAR 0x0001
  379. #define GCT_SHORTCHAR 0x0002
  380. #define GCT_WILD 0x0004
  381. #define GCT_SEPARATOR 0x0008
  382. LWSTDAPI_(int) PathGetDriveNumberA(LPCSTR pszPath);
  383. LWSTDAPI_(int) PathGetDriveNumberW(LPCWSTR pszPath);
  384. #ifdef UNICODE
  385. #define PathGetDriveNumber PathGetDriveNumberW
  386. #else
  387. #define PathGetDriveNumber PathGetDriveNumberA
  388. #endif // !UNICODE
  389. LWSTDAPI_(BOOL) PathIsDirectoryA(LPCSTR pszPath);
  390. LWSTDAPI_(BOOL) PathIsDirectoryW(LPCWSTR pszPath);
  391. #ifdef UNICODE
  392. #define PathIsDirectory PathIsDirectoryW
  393. #else
  394. #define PathIsDirectory PathIsDirectoryA
  395. #endif // !UNICODE
  396. LWSTDAPI_(BOOL) PathIsDirectoryEmptyA(LPCSTR pszPath);
  397. LWSTDAPI_(BOOL) PathIsDirectoryEmptyW(LPCWSTR pszPath);
  398. #ifdef UNICODE
  399. #define PathIsDirectoryEmpty PathIsDirectoryEmptyW
  400. #else
  401. #define PathIsDirectoryEmpty PathIsDirectoryEmptyA
  402. #endif // !UNICODE
  403. LWSTDAPI_(BOOL) PathIsFileSpecA(LPCSTR pszPath);
  404. LWSTDAPI_(BOOL) PathIsFileSpecW(LPCWSTR pszPath);
  405. #ifdef UNICODE
  406. #define PathIsFileSpec PathIsFileSpecW
  407. #else
  408. #define PathIsFileSpec PathIsFileSpecA
  409. #endif // !UNICODE
  410. LWSTDAPI_(BOOL) PathIsPrefixA(LPCSTR pszPrefix, LPCSTR pszPath);
  411. LWSTDAPI_(BOOL) PathIsPrefixW(LPCWSTR pszPrefix, LPCWSTR pszPath);
  412. #ifdef UNICODE
  413. #define PathIsPrefix PathIsPrefixW
  414. #else
  415. #define PathIsPrefix PathIsPrefixA
  416. #endif // !UNICODE
  417. LWSTDAPI_(BOOL) PathIsRelativeA(LPCSTR pszPath);
  418. LWSTDAPI_(BOOL) PathIsRelativeW(LPCWSTR pszPath);
  419. #ifdef UNICODE
  420. #define PathIsRelative PathIsRelativeW
  421. #else
  422. #define PathIsRelative PathIsRelativeA
  423. #endif // !UNICODE
  424. LWSTDAPI_(BOOL) PathIsRootA(LPCSTR pszPath);
  425. LWSTDAPI_(BOOL) PathIsRootW(LPCWSTR pszPath);
  426. #ifdef UNICODE
  427. #define PathIsRoot PathIsRootW
  428. #else
  429. #define PathIsRoot PathIsRootA
  430. #endif // !UNICODE
  431. LWSTDAPI_(BOOL) PathIsSameRootA(LPCSTR pszPath1, LPCSTR pszPath2);
  432. LWSTDAPI_(BOOL) PathIsSameRootW(LPCWSTR pszPath1, LPCWSTR pszPath2);
  433. #ifdef UNICODE
  434. #define PathIsSameRoot PathIsSameRootW
  435. #else
  436. #define PathIsSameRoot PathIsSameRootA
  437. #endif // !UNICODE
  438. LWSTDAPI_(BOOL) PathIsUNCA(LPCSTR pszPath);
  439. LWSTDAPI_(BOOL) PathIsUNCW(LPCWSTR pszPath);
  440. #ifdef UNICODE
  441. #define PathIsUNC PathIsUNCW
  442. #else
  443. #define PathIsUNC PathIsUNCA
  444. #endif // !UNICODE
  445. LWSTDAPI_(BOOL) PathIsNetworkPathA(LPCSTR pszPath);
  446. LWSTDAPI_(BOOL) PathIsNetworkPathW(LPCWSTR pszPath);
  447. #ifdef UNICODE
  448. #define PathIsNetworkPath PathIsNetworkPathW
  449. #else
  450. #define PathIsNetworkPath PathIsNetworkPathA
  451. #endif // !UNICODE
  452. LWSTDAPI_(BOOL) PathIsUNCServerA(LPCSTR pszPath);
  453. LWSTDAPI_(BOOL) PathIsUNCServerW(LPCWSTR pszPath);
  454. #ifdef UNICODE
  455. #define PathIsUNCServer PathIsUNCServerW
  456. #else
  457. #define PathIsUNCServer PathIsUNCServerA
  458. #endif // !UNICODE
  459. LWSTDAPI_(BOOL) PathIsUNCServerShareA(LPCSTR pszPath);
  460. LWSTDAPI_(BOOL) PathIsUNCServerShareW(LPCWSTR pszPath);
  461. #ifdef UNICODE
  462. #define PathIsUNCServerShare PathIsUNCServerShareW
  463. #else
  464. #define PathIsUNCServerShare PathIsUNCServerShareA
  465. #endif // !UNICODE
  466. LWSTDAPI_(BOOL) PathIsContentTypeA(LPCSTR pszPath, LPCSTR pszContentType);
  467. LWSTDAPI_(BOOL) PathIsContentTypeW(LPCWSTR pszPath, LPCWSTR pszContentType);
  468. LWSTDAPI_(BOOL) PathIsURLA(LPCSTR pszPath);
  469. LWSTDAPI_(BOOL) PathIsURLW(LPCWSTR pszPath);
  470. #ifdef UNICODE
  471. #define PathIsURL PathIsURLW
  472. #else
  473. #define PathIsURL PathIsURLA
  474. #endif // !UNICODE
  475. LWSTDAPI_(BOOL) PathMakePrettyA(LPSTR pszPath);
  476. LWSTDAPI_(BOOL) PathMakePrettyW(LPWSTR pszPath);
  477. LWSTDAPI_(BOOL) PathMatchSpecA(LPCSTR pszFile, LPCSTR pszSpec);
  478. LWSTDAPI_(BOOL) PathMatchSpecW(LPCWSTR pszFile, LPCWSTR pszSpec);
  479. LWSTDAPI_(int) PathParseIconLocationA(LPSTR pszIconFile);
  480. LWSTDAPI_(int) PathParseIconLocationW(LPWSTR pszIconFile);
  481. LWSTDAPI_(void) PathQuoteSpacesA(LPSTR lpsz);
  482. LWSTDAPI_(void) PathQuoteSpacesW(LPWSTR lpsz);
  483. LWSTDAPI_(BOOL) PathRelativePathToA(LPSTR pszPath, LPCSTR pszFrom, DWORD dwAttrFrom, LPCSTR pszTo, DWORD dwAttrTo);
  484. LWSTDAPI_(BOOL) PathRelativePathToW(LPWSTR pszPath, LPCWSTR pszFrom, DWORD dwAttrFrom, LPCWSTR pszTo, DWORD dwAttrTo);
  485. LWSTDAPI_(void) PathRemoveArgsA(LPSTR pszPath);
  486. LWSTDAPI_(void) PathRemoveArgsW(LPWSTR pszPath);
  487. LWSTDAPI_(LPSTR) PathRemoveBackslashA(LPSTR pszPath);
  488. LWSTDAPI_(LPWSTR) PathRemoveBackslashW(LPWSTR pszPath);
  489. #ifdef UNICODE
  490. #define PathRemoveBackslash PathRemoveBackslashW
  491. #else
  492. #define PathRemoveBackslash PathRemoveBackslashA
  493. #endif // !UNICODE
  494. LWSTDAPI_(void) PathRemoveBlanksA(LPSTR pszPath);
  495. LWSTDAPI_(void) PathRemoveBlanksW(LPWSTR pszPath);
  496. LWSTDAPI_(void) PathRemoveExtensionA(LPSTR pszPath);
  497. LWSTDAPI_(void) PathRemoveExtensionW(LPWSTR pszPath);
  498. LWSTDAPI_(BOOL) PathRemoveFileSpecA(LPSTR pszPath);
  499. LWSTDAPI_(BOOL) PathRemoveFileSpecW(LPWSTR pszPath);
  500. LWSTDAPI_(BOOL) PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt);
  501. LWSTDAPI_(BOOL) PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt);
  502. LWSTDAPI_(BOOL) PathSearchAndQualifyA(LPCSTR pszPath, LPSTR pszBuf, UINT cchBuf);
  503. LWSTDAPI_(BOOL) PathSearchAndQualifyW(LPCWSTR pszPath, LPWSTR pszBuf, UINT cchBuf);
  504. LWSTDAPI_(void) PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath);
  505. LWSTDAPI_(void) PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath);
  506. LWSTDAPI_(LPSTR) PathSkipRootA(LPCSTR pszPath);
  507. LWSTDAPI_(LPWSTR) PathSkipRootW(LPCWSTR pszPath);
  508. #ifdef UNICODE
  509. #define PathSkipRoot PathSkipRootW
  510. #else
  511. #define PathSkipRoot PathSkipRootA
  512. #endif // !UNICODE
  513. LWSTDAPI_(void) PathStripPathA(LPSTR pszPath);
  514. LWSTDAPI_(void) PathStripPathW(LPWSTR pszPath);
  515. #ifdef UNICODE
  516. #define PathStripPath PathStripPathW
  517. #else
  518. #define PathStripPath PathStripPathA
  519. #endif // !UNICODE
  520. LWSTDAPI_(BOOL) PathStripToRootA(LPSTR pszPath);
  521. LWSTDAPI_(BOOL) PathStripToRootW(LPWSTR pszPath);
  522. #ifdef UNICODE
  523. #define PathStripToRoot PathStripToRootW
  524. #else
  525. #define PathStripToRoot PathStripToRootA
  526. #endif // !UNICODE
  527. LWSTDAPI_(void) PathUnquoteSpacesA(LPSTR lpsz);
  528. LWSTDAPI_(void) PathUnquoteSpacesW(LPWSTR lpsz);
  529. LWSTDAPI_(BOOL) PathMakeSystemFolderA(LPCSTR pszPath);
  530. LWSTDAPI_(BOOL) PathMakeSystemFolderW(LPCWSTR pszPath);
  531. #ifdef UNICODE
  532. #define PathMakeSystemFolder PathMakeSystemFolderW
  533. #else
  534. #define PathMakeSystemFolder PathMakeSystemFolderA
  535. #endif // !UNICODE
  536. LWSTDAPI_(BOOL) PathUnmakeSystemFolderA(LPCSTR pszPath);
  537. LWSTDAPI_(BOOL) PathUnmakeSystemFolderW(LPCWSTR pszPath);
  538. #ifdef UNICODE
  539. #define PathUnmakeSystemFolder PathUnmakeSystemFolderW
  540. #else
  541. #define PathUnmakeSystemFolder PathUnmakeSystemFolderA
  542. #endif // !UNICODE
  543. LWSTDAPI_(BOOL) PathIsSystemFolderA(LPCSTR pszPath, DWORD dwAttrb);
  544. LWSTDAPI_(BOOL) PathIsSystemFolderW(LPCWSTR pszPath, DWORD dwAttrb);
  545. #ifdef UNICODE
  546. #define PathIsSystemFolder PathIsSystemFolderW
  547. #else
  548. #define PathIsSystemFolder PathIsSystemFolderA
  549. #endif // !UNICODE
  550. LWSTDAPI_(void) PathUndecorateA(LPSTR pszPath);
  551. LWSTDAPI_(void) PathUndecorateW(LPWSTR pszPath);
  552. #ifdef UNICODE
  553. #define PathUndecorate PathUndecorateW
  554. #else
  555. #define PathUndecorate PathUndecorateA
  556. #endif // !UNICODE
  557. LWSTDAPI_(BOOL) PathUnExpandEnvStringsA(LPCSTR pszPath, LPSTR pszBuf, UINT cchBuf);
  558. LWSTDAPI_(BOOL) PathUnExpandEnvStringsW(LPCWSTR pszPath, LPWSTR pszBuf, UINT cchBuf);
  559. #ifdef UNICODE
  560. #define PathUnExpandEnvStrings PathUnExpandEnvStringsW
  561. #else
  562. #define PathUnExpandEnvStrings PathUnExpandEnvStringsA
  563. #endif // !UNICODE
  564. #ifdef UNICODE
  565. #define PathAppend PathAppendW
  566. #define PathCanonicalize PathCanonicalizeW
  567. #define PathCompactPath PathCompactPathW
  568. #define PathCompactPathEx PathCompactPathExW
  569. #define PathCommonPrefix PathCommonPrefixW
  570. #define PathFindOnPath PathFindOnPathW
  571. #define PathGetCharType PathGetCharTypeW
  572. #define PathIsContentType PathIsContentTypeW
  573. #define PathIsHTMLFile PathIsHTMLFileW
  574. #define PathMakePretty PathMakePrettyW
  575. #define PathMatchSpec PathMatchSpecW
  576. #define PathParseIconLocation PathParseIconLocationW
  577. #define PathQuoteSpaces PathQuoteSpacesW
  578. #define PathRelativePathTo PathRelativePathToW
  579. #define PathRemoveArgs PathRemoveArgsW
  580. #define PathRemoveBlanks PathRemoveBlanksW
  581. #define PathRemoveExtension PathRemoveExtensionW
  582. #define PathRemoveFileSpec PathRemoveFileSpecW
  583. #define PathRenameExtension PathRenameExtensionW
  584. #define PathSearchAndQualify PathSearchAndQualifyW
  585. #define PathSetDlgItemPath PathSetDlgItemPathW
  586. #define PathUnquoteSpaces PathUnquoteSpacesW
  587. #else
  588. #define PathAppend PathAppendA
  589. #define PathCanonicalize PathCanonicalizeA
  590. #define PathCompactPath PathCompactPathA
  591. #define PathCompactPathEx PathCompactPathExA
  592. #define PathCommonPrefix PathCommonPrefixA
  593. #define PathFindOnPath PathFindOnPathA
  594. #define PathGetCharType PathGetCharTypeA
  595. #define PathIsContentType PathIsContentTypeA
  596. #define PathIsHTMLFile PathIsHTMLFileA
  597. #define PathMakePretty PathMakePrettyA
  598. #define PathMatchSpec PathMatchSpecA
  599. #define PathParseIconLocation PathParseIconLocationA
  600. #define PathQuoteSpaces PathQuoteSpacesA
  601. #define PathRelativePathTo PathRelativePathToA
  602. #define PathRemoveArgs PathRemoveArgsA
  603. #define PathRemoveBlanks PathRemoveBlanksA
  604. #define PathRemoveExtension PathRemoveExtensionA
  605. #define PathRemoveFileSpec PathRemoveFileSpecA
  606. #define PathRenameExtension PathRenameExtensionA
  607. #define PathSearchAndQualify PathSearchAndQualifyA
  608. #define PathSetDlgItemPath PathSetDlgItemPathA
  609. #define PathUnquoteSpaces PathUnquoteSpacesA
  610. #endif
  611. typedef enum {
  612. URL_SCHEME_INVALID = -1,
  613. URL_SCHEME_UNKNOWN = 0,
  614. URL_SCHEME_FTP,
  615. URL_SCHEME_HTTP,
  616. URL_SCHEME_GOPHER,
  617. URL_SCHEME_MAILTO,
  618. URL_SCHEME_NEWS,
  619. URL_SCHEME_NNTP,
  620. URL_SCHEME_TELNET,
  621. URL_SCHEME_WAIS,
  622. URL_SCHEME_FILE,
  623. URL_SCHEME_MK,
  624. URL_SCHEME_HTTPS,
  625. URL_SCHEME_SHELL,
  626. URL_SCHEME_SNEWS,
  627. URL_SCHEME_LOCAL,
  628. URL_SCHEME_JAVASCRIPT,
  629. URL_SCHEME_VBSCRIPT,
  630. URL_SCHEME_ABOUT,
  631. URL_SCHEME_RES,
  632. URL_SCHEME_MSSHELLROOTED,
  633. URL_SCHEME_MSSHELLIDLIST,
  634. URL_SCHEME_MSHELP,
  635. URL_SCHEME_MAXVALUE
  636. } URL_SCHEME;
  637. typedef enum {
  638. URL_PART_NONE = 0,
  639. URL_PART_SCHEME = 1,
  640. URL_PART_HOSTNAME,
  641. URL_PART_USERNAME,
  642. URL_PART_PASSWORD,
  643. URL_PART_PORT,
  644. URL_PART_QUERY,
  645. } URL_PART;
  646. typedef enum {
  647. URLIS_URL,
  648. URLIS_OPAQUE,
  649. URLIS_NOHISTORY,
  650. URLIS_FILEURL,
  651. URLIS_APPLIABLE,
  652. URLIS_DIRECTORY,
  653. URLIS_HASQUERY,
  654. } URLIS;
  655. #define URL_UNESCAPE 0x10000000
  656. #define URL_ESCAPE_UNSAFE 0x20000000
  657. #define URL_PLUGGABLE_PROTOCOL 0x40000000
  658. #define URL_WININET_COMPATIBILITY 0x80000000
  659. #define URL_DONT_ESCAPE_EXTRA_INFO 0x02000000
  660. #define URL_DONT_UNESCAPE_EXTRA_INFO URL_DONT_ESCAPE_EXTRA_INFO
  661. #define URL_BROWSER_MODE URL_DONT_ESCAPE_EXTRA_INFO
  662. #define URL_ESCAPE_SPACES_ONLY 0x04000000
  663. #define URL_DONT_SIMPLIFY 0x08000000
  664. #define URL_NO_META URL_DONT_SIMPLIFY
  665. #define URL_UNESCAPE_INPLACE 0x00100000
  666. #define URL_CONVERT_IF_DOSPATH 0x00200000
  667. #define URL_UNESCAPE_HIGH_ANSI_ONLY 0x00400000
  668. #define URL_INTERNAL_PATH 0x00800000 // Will escape #'s in paths
  669. #define URL_FILE_USE_PATHURL 0x00010000
  670. #define URL_ESCAPE_PERCENT 0x00001000
  671. #define URL_ESCAPE_SEGMENT_ONLY 0x00002000 // Treat the entire URL param as one URL segment.
  672. #define URL_PARTFLAG_KEEPSCHEME 0x00000001
  673. #define URL_APPLY_DEFAULT 0x00000001
  674. #define URL_APPLY_GUESSSCHEME 0x00000002
  675. #define URL_APPLY_GUESSFILE 0x00000004
  676. #define URL_APPLY_FORCEAPPLY 0x00000008
  677. LWSTDAPI_(int) UrlCompareA(LPCSTR psz1, LPCSTR psz2, BOOL fIgnoreSlash);
  678. LWSTDAPI_(int) UrlCompareW(LPCWSTR psz1, LPCWSTR psz2, BOOL fIgnoreSlash);
  679. LWSTDAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative, LPSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
  680. LWSTDAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, LPWSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
  681. LWSTDAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
  682. LWSTDAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
  683. LWSTDAPI_(BOOL) UrlIsOpaqueA(LPCSTR pszURL);
  684. LWSTDAPI_(BOOL) UrlIsOpaqueW(LPCWSTR pszURL);
  685. LWSTDAPI_(BOOL) UrlIsNoHistoryA(LPCSTR pszURL);
  686. LWSTDAPI_(BOOL) UrlIsNoHistoryW(LPCWSTR pszURL);
  687. #define UrlIsFileUrlA(pszURL) UrlIsA(pszURL, URLIS_FILEURL)
  688. #define UrlIsFileUrlW(pszURL) UrlIsW(pszURL, URLIS_FILEURL)
  689. LWSTDAPI_(BOOL) UrlIsA(LPCSTR pszUrl, URLIS UrlIs);
  690. LWSTDAPI_(BOOL) UrlIsW(LPCWSTR pszUrl, URLIS UrlIs);
  691. LWSTDAPI_(LPCSTR) UrlGetLocationA(LPCSTR psz1);
  692. LWSTDAPI_(LPCWSTR) UrlGetLocationW(LPCWSTR psz1);
  693. LWSTDAPI UrlUnescapeA(LPSTR pszUrl, LPSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
  694. LWSTDAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
  695. LWSTDAPI UrlEscapeA(LPCSTR pszUrl, LPSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
  696. LWSTDAPI UrlEscapeW(LPCWSTR pszUrl, LPWSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
  697. LWSTDAPI UrlCreateFromPathA(LPCSTR pszPath, LPSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
  698. LWSTDAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
  699. LWSTDAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
  700. LWSTDAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
  701. LWSTDAPI UrlHashA(LPCSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
  702. LWSTDAPI UrlHashW(LPCWSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
  703. LWSTDAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
  704. LWSTDAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
  705. LWSTDAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
  706. LWSTDAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
  707. LWSTDAPI HashData(LPBYTE pbData, DWORD cbData, LPBYTE pbHash, DWORD cbHash);
  708. #ifdef UNICODE
  709. #define UrlCompare UrlCompareW
  710. #define UrlCombine UrlCombineW
  711. #define UrlCanonicalize UrlCanonicalizeW
  712. #define UrlIsOpaque UrlIsOpaqueW
  713. #define UrlIsFileUrl UrlIsFileUrlW
  714. #define UrlGetLocation UrlGetLocationW
  715. #define UrlUnescape UrlUnescapeW
  716. #define UrlEscape UrlEscapeW
  717. #define UrlCreateFromPath UrlCreateFromPathW
  718. #define PathCreateFromUrl PathCreateFromUrlW
  719. #define UrlHash UrlHashW
  720. #define UrlGetPart UrlGetPartW
  721. #define UrlApplyScheme UrlApplySchemeW
  722. #define UrlIs UrlIsW
  723. #else //!UNICODE
  724. #define UrlCompare UrlCompareA
  725. #define UrlCombine UrlCombineA
  726. #define UrlCanonicalize UrlCanonicalizeA
  727. #define UrlIsOpaque UrlIsOpaqueA
  728. #define UrlIsFileUrl UrlIsFileUrlA
  729. #define UrlGetLocation UrlGetLocationA
  730. #define UrlUnescape UrlUnescapeA
  731. #define UrlEscape UrlEscapeA
  732. #define UrlCreateFromPath UrlCreateFromPathA
  733. #define PathCreateFromUrl PathCreateFromUrlA
  734. #define UrlHash UrlHashA
  735. #define UrlGetPart UrlGetPartA
  736. #define UrlApplyScheme UrlApplySchemeA
  737. #define UrlIs UrlIsA
  738. #endif //UNICODE
  739. #define UrlEscapeSpaces(pszUrl, pszEscaped, pcchEscaped) UrlCanonicalize(pszUrl, pszEscaped, pcchEscaped, URL_ESCAPE_SPACES_ONLY |URL_DONT_ESCAPE_EXTRA_INFO )
  740. #define UrlUnescapeInPlace(pszUrl, dwFlags) UrlUnescape(pszUrl, NULL, NULL, dwFlags | URL_UNESCAPE_INPLACE)
  741. #endif // NO_SHLWAPI_PATH
  742. #ifndef NO_SHLWAPI_REG
  743. //
  744. //=============== Registry Routines ===================================
  745. //
  746. // SHDeleteEmptyKey mimics RegDeleteKey as it behaves on NT.
  747. // SHDeleteKey mimics RegDeleteKey as it behaves on Win95.
  748. LWSTDAPI_(DWORD) SHDeleteEmptyKeyA(HKEY hkey, LPCSTR pszSubKey);
  749. LWSTDAPI_(DWORD) SHDeleteEmptyKeyW(HKEY hkey, LPCWSTR pszSubKey);
  750. #ifdef UNICODE
  751. #define SHDeleteEmptyKey SHDeleteEmptyKeyW
  752. #else
  753. #define SHDeleteEmptyKey SHDeleteEmptyKeyA
  754. #endif // !UNICODE
  755. LWSTDAPI_(DWORD) SHDeleteKeyA(HKEY hkey, LPCSTR pszSubKey);
  756. LWSTDAPI_(DWORD) SHDeleteKeyW(HKEY hkey, LPCWSTR pszSubKey);
  757. #ifdef UNICODE
  758. #define SHDeleteKey SHDeleteKeyW
  759. #else
  760. #define SHDeleteKey SHDeleteKeyA
  761. #endif // !UNICODE
  762. LWSTDAPI_(HKEY) SHRegDuplicateHKey(HKEY hkey);
  763. // These functions open the key, get/set/delete the value, then close
  764. // the key.
  765. LWSTDAPI_(DWORD) SHDeleteValueA(HKEY hkey, LPCSTR pszSubKey, LPCSTR pszValue);
  766. LWSTDAPI_(DWORD) SHDeleteValueW(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue);
  767. #ifdef UNICODE
  768. #define SHDeleteValue SHDeleteValueW
  769. #else
  770. #define SHDeleteValue SHDeleteValueA
  771. #endif // !UNICODE
  772. LWSTDAPI_(DWORD) SHGetValueA(HKEY hkey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
  773. LWSTDAPI_(DWORD) SHGetValueW(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
  774. #ifdef UNICODE
  775. #define SHGetValue SHGetValueW
  776. #else
  777. #define SHGetValue SHGetValueA
  778. #endif // !UNICODE
  779. LWSTDAPI_(DWORD) SHSetValueA(HKEY hkey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
  780. LWSTDAPI_(DWORD) SHSetValueW(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
  781. #ifdef UNICODE
  782. #define SHSetValue SHSetValueW
  783. #else
  784. #define SHSetValue SHSetValueA
  785. #endif // !UNICODE
  786. //
  787. // SRRF - Shell Registry Routine Flags (for SHRegGetValue)
  788. //
  789. typedef DWORD SRRF;
  790. #define SRRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (other data types will not return ERROR_SUCCESS)
  791. #define SRRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (other data types will not return ERROR_SUCCESS)
  792. #define SRRF_RT_REG_EXPAND_SZ 0x00000004 // restrict type to REG_EXPAND_SZ (other data types will not return ERROR_SUCCESS)
  793. #define SRRF_RT_REG_BINARY 0x00000008 // restrict type to REG_BINARY (other data types will not return ERROR_SUCCESS)
  794. #define SRRF_RT_REG_DWORD 0x00000010 // restrict type to REG_DWORD (other data types will not return ERROR_SUCCESS)
  795. #define SRRF_RT_REG_MULTI_SZ 0x00000020 // restrict type to REG_MULTI_SZ (other data types will not return ERROR_SUCCESS)
  796. #define SRRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (other data types will not return ERROR_SUCCESS)
  797. #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)
  798. #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)
  799. #define SRRF_RT_ANY 0x0000ffff // no type restriction
  800. #define SRRF_RM_ANY 0x00000000 // no mode restriction (default is to allow any mode)
  801. #define SRRF_RM_NORMAL 0x00010000 // restrict system startup mode to "normal boot" (other startup modes will not return ERROR_SUCCESS)
  802. #define SRRF_RM_SAFE 0x00020000 // restrict system startup mode to "safe mode" (other startup modes will not return ERROR_SUCCESS)
  803. #define SRRF_RM_SAFENETWORK 0x00040000 // restrict system startup mode to "safe mode with networking" (other startup modes will not return ERROR_SUCCESS)
  804. #define SRRF_NOEXPAND 0x10000000 // do not automatically expand environment strings if value is of type REG_EXPAND_SZ
  805. #define SRRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure
  806. // Function:
  807. //
  808. // SHRegGetValue()
  809. //
  810. // Purpose:
  811. //
  812. // Gets a registry value. SHRegGetValue() provides the following benefits:
  813. //
  814. // - data type checking
  815. // - boot mode checking
  816. // - auto-expansion of REG_EXPAND_SZ data
  817. // - guaranteed NULL termination of REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ data
  818. //
  819. // Parameters:
  820. //
  821. // hkey - handle to a currently open key.
  822. //
  823. // pszSubKey - pointer to a null-terminated string specifying the relative
  824. // path from hkey to one of its subkeys from which the data is
  825. // to be retrieved. this will be opened with KEY_READ sam.
  826. //
  827. // Note1: pszSubKey can be NULL or "". In either of these two
  828. // cases, the data is retrieved from the hkey itself.
  829. // Note2: *** PERF ***
  830. // If pszSubKey is not NULL or "", the subkey will be
  831. // automatically be opened and closed by this routine
  832. // in order to obtain the data. If you are retrieving
  833. // multiple values from the same subkey, it is better
  834. // for perf to open the subkey via RegOpenKeyEx() prior
  835. // to calling this method, and using this opened key as
  836. // hkey with pszSubKey set to NULL.
  837. //
  838. // pszValue - pointer to a null-terminated string specifying the name of
  839. // the value to query for data
  840. //
  841. // Note1: pszValue can be NULL or "". In either of these two
  842. // cases, the data is retrieved from the unnamed or
  843. // default value.
  844. //
  845. // dwFlags - bitwise or of SRRF_ flags, which cannot be 0: at least one
  846. // type restriction must be specified (SRRF_RT_...), or if any
  847. // type is desired then SRRF_RT_ANY can be specified
  848. //
  849. // Note1: SRRF_RT_ANY will allow any data type to be returned.
  850. // Note2: The following two type restrictions have special
  851. // handling semantics:
  852. //
  853. // SRRF_RT_DWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_DWORD
  854. // SRRF_RT_QWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_QWORD
  855. //
  856. // If either of these are specified, with no other type
  857. // restrictions, then in the prior case the restriction
  858. // will limit "valid" returned data to either REG_DWORD
  859. // or 32-bit REG_BINARY data, and in the latter case
  860. // the restriction will limit "valid" returned data to
  861. // either REG_QWORD or 64-bit REG_BINARY.
  862. //
  863. // pdwType - pointer to a dword which receives a code indicating the
  864. // type of data stored in the specified value
  865. //
  866. // Note1: pdwType can be NULL if no type information is wanted
  867. // Note2: If pdwType is not NULL, and the SRRF_NOEXPAND flag
  868. // has not been set, data types of REG_EXPAND_SZ will
  869. // be returned as REG_SZ since they are automatically
  870. // expanded in this method.
  871. //
  872. // pvData - pointer to a buffer that receives the value's data
  873. //
  874. // Note1: pvData can be NULL if the data is not required.
  875. // pvData is usually NULL if doing either a simple
  876. // existence test, or if interested in the size only.
  877. // Note2: *** PERF ***
  878. // Reference 'perf' note for pcbData.
  879. //
  880. // pcbData - when pvData is NULL:
  881. // optional pointer to a dword that receives a size in bytes
  882. // which would be sufficient to hold the registry data (note
  883. // this size is not guaranteed to be exact, merely sufficient)
  884. // when pvData is not NULL:
  885. // required pointer to a dword that specifies the size in
  886. // bytes of the buffer pointed to by the pvData parameter
  887. // and receives a size in bytes of:
  888. // a) the number of bytes read into pvData on ERROR_SUCCESS
  889. // (note this size is guaranteed to be exact)
  890. // b) the number of bytes which would be sufficient to hold
  891. // the registry data on ERROR_MORE_DATA -- pvData was of
  892. // insufficient size (note this size is not guaranteed to
  893. // be exact, merely sufficient)
  894. //
  895. // Note1: pcbData can be NULL only if pvData is NULL.
  896. // Note2: *** PERF ***
  897. // The potential for an 'extra' call to the registry to
  898. // read (or re-read) in the data exists when the data
  899. // type is REG_EXPAND_SZ and the SRRF_NOEXPAND flag has
  900. // not been set. The following conditions will result
  901. // in this 'extra' read operation:
  902. // i) when pvData is NULL and pcbData is not NULL
  903. // we must read in the data from the registry
  904. // anyway in order to obtain the string and perform
  905. // an expand on it to obtain and return the total
  906. // required size in pcbData
  907. // ii) when pvData is not NULL but is of insufficient
  908. // size we must re-read in the data from the
  909. // registry in order to obtain the entire string
  910. // and perform an expand on it to obtain and return
  911. // the total required size in pcbData
  912. //
  913. // Remarks:
  914. //
  915. // The key identified by hkey must have been opened with KEY_QUERY_VALUE
  916. // access. If pszSubKey is not NULL or "", it must be able to be opened
  917. // with KEY_QUERY_VALUE access in the current calling context.
  918. //
  919. // If the data type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then any
  920. // returned data is guaranteed to take into account proper null termination.
  921. // For example: if pcbData is not NULL, its returned size will include the
  922. // bytes for a null terminator if pvData is not NULL, its returned data
  923. // will be properly null terminated.
  924. //
  925. // If the data type is REG_EXPAND_SZ, then unless the SRRF_NOEXPAND flag
  926. // is set the data will be automatically expanded prior to being returned.
  927. // For example: if pdwType is not NULL, its returned type will be changed
  928. // to REG_SZ, if pcbData is not NULL, its returned size will include the
  929. // bytes for a properly expanded string. if pvData is not NULL, its
  930. // returned data will be the expanded version of the string.
  931. //
  932. // Reference MSDN documentation for RegQueryValueEx() for more information
  933. // of the behaviour when pdwType, pvData, and/or pcbData are equal to NULL.
  934. //
  935. // Return Values:
  936. //
  937. // If the function succeeds, the return value is ERROR_SUCCESS and all out
  938. // parameters requested (pdwType, pvData, pcbData) are valid.
  939. //
  940. // If the function fails due to insufficient space in a provided non-NULL
  941. // pvData, the return value is ERROR_MORE_DATA and only pdwType and pcbData
  942. // can contain valid data. The content of pvData in this case is undefined.
  943. //
  944. // Examples:
  945. //
  946. // 1) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data from the (default) value of an open hkey
  947. //
  948. // TCHAR szData[128]
  949. // DWORD cbData = sizeof(pszData)
  950. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, NULL, SRRF_RT_REG_SZ, NULL, szData, &cbData))
  951. // {
  952. // // use sz (successful read)
  953. // }
  954. //
  955. // 2) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data of unknown size from the "MyValue" value of an open hkey
  956. //
  957. // DWORD cbData
  958. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, NULL, &cbData))
  959. // {
  960. // TCHAR *pszData = new TCHAR[cbData/sizeof(TCHAR)]
  961. // if (pszData)
  962. // {
  963. // if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, pszData, &cbData))
  964. // {
  965. // // use pszData (successful read)
  966. // }
  967. // delete[] pszData
  968. // }
  969. // }
  970. //
  971. // 3) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey
  972. //
  973. // DWORD dwData
  974. // DWORD cbData = sizeof(dwData)
  975. // if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_REG_DWORD, NULL, &dwData, &cbData))
  976. // {
  977. // // use dwData (successful read)
  978. // }
  979. //
  980. // 4) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey (32-bit binary data also ok)
  981. //
  982. // DWORD dwData
  983. // DWORD cbData = sizeof(dwData)
  984. // if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_DWORD, NULL, &dwData, &cbData))
  985. // {
  986. // // use dwData (successful read)
  987. // }
  988. //
  989. // 5) determine existence of "MyValue" value of an open hkey
  990. //
  991. // BOOL bExists = ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_ANY, NULL, NULL, NULL)
  992. LWSTDAPI_(LONG) SHRegGetValueA(HKEY hkey, LPCSTR pszSubKey, LPCSTR pszValue, SRRF dwFlags, DWORD *pdwType, void *pvData, DWORD *pcbData);
  993. LWSTDAPI_(LONG) SHRegGetValueW(HKEY hkey, LPCWSTR pszSubKey, LPCWSTR pszValue, SRRF dwFlags, DWORD *pdwType, void *pvData, DWORD *pcbData);
  994. #ifdef UNICODE
  995. #define SHRegGetValue SHRegGetValueW
  996. #else
  997. #define SHRegGetValue SHRegGetValueA
  998. #endif // !UNICODE
  999. // These functions behave just like RegQueryValueEx(), except if the data
  1000. // type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then the string is
  1001. // guaranteed to be properly null terminated.
  1002. //
  1003. // Additionally, if the data type is REG_EXPAND_SZ these functions will
  1004. // go ahead and expand out the string, and "massage" the returned *pdwType
  1005. // to be REG_SZ.
  1006. LWSTDAPI_(DWORD) SHQueryValueExA(HKEY hkey, LPCSTR pszValue, DWORD *pdwReserved, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1007. LWSTDAPI_(DWORD) SHQueryValueExW(HKEY hkey, LPCWSTR pszValue, DWORD *pdwReserved, DWORD *pdwType, void *pvData, DWORD *pcbData);
  1008. #ifdef UNICODE
  1009. #define SHQueryValueEx SHQueryValueExW
  1010. #else
  1011. #define SHQueryValueEx SHQueryValueExA
  1012. #endif // !UNICODE
  1013. // Enumeration functions support.
  1014. LWSTDAPI_(LONG) SHEnumKeyExA(HKEY hkey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName);
  1015. LWSTDAPI_(LONG) SHEnumKeyExW(HKEY hkey, DWORD dwIndex, LPWSTR pszName, LPDWORD pcchName);
  1016. LWSTDAPI_(LONG) SHEnumValueA(HKEY hkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
  1017. LWSTDAPI_(LONG) SHEnumValueW(HKEY hkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
  1018. LWSTDAPI_(LONG) SHQueryInfoKeyA(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
  1019. LWSTDAPI_(LONG) SHQueryInfoKeyW(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
  1020. // recursive key copy
  1021. LWSTDAPI_(DWORD) SHCopyKeyA(HKEY hkeySrc, LPCSTR szSrcSubKey, HKEY hkeyDest, DWORD fReserved);
  1022. LWSTDAPI_(DWORD) SHCopyKeyW(HKEY hkeySrc, LPCWSTR wszSrcSubKey, HKEY hkeyDest, DWORD fReserved);
  1023. // Getting and setting file system paths with environment variables
  1024. LWSTDAPI_(DWORD) SHRegGetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPSTR pszPath, DWORD dwFlags);
  1025. LWSTDAPI_(DWORD) SHRegGetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPWSTR pszPath, DWORD dwFlags);
  1026. LWSTDAPI_(DWORD) SHRegSetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPCSTR pcszPath, DWORD dwFlags);
  1027. LWSTDAPI_(DWORD) SHRegSetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPCWSTR pcszPath, DWORD dwFlags);
  1028. #ifdef UNICODE
  1029. #define SHEnumKeyEx SHEnumKeyExW
  1030. #define SHEnumValue SHEnumValueW
  1031. #define SHQueryInfoKey SHQueryInfoKeyW
  1032. #define SHCopyKey SHCopyKeyW
  1033. #define SHRegGetPath SHRegGetPathW
  1034. #define SHRegSetPath SHRegSetPathW
  1035. #else
  1036. #define SHEnumKeyEx SHEnumKeyExA
  1037. #define SHEnumValue SHEnumValueA
  1038. #define SHQueryInfoKey SHQueryInfoKeyA
  1039. #define SHCopyKey SHCopyKeyA
  1040. #define SHRegGetPath SHRegGetPathA
  1041. #define SHRegSetPath SHRegSetPathA
  1042. #endif
  1043. //////////////////////////////////////////////
  1044. // User Specific Registry Access Functions
  1045. //////////////////////////////////////////////
  1046. //
  1047. // Type definitions.
  1048. //
  1049. typedef enum
  1050. {
  1051. SHREGDEL_DEFAULT = 0x00000000, // Delete's HKCU, or HKLM if HKCU is not found.
  1052. SHREGDEL_HKCU = 0x00000001, // Delete HKCU only
  1053. SHREGDEL_HKLM = 0x00000010, // Delete HKLM only.
  1054. SHREGDEL_BOTH = 0x00000011, // Delete both HKCU and HKLM.
  1055. } SHREGDEL_FLAGS;
  1056. typedef enum
  1057. {
  1058. SHREGENUM_DEFAULT = 0x00000000, // Enumerates HKCU or HKLM if not found.
  1059. SHREGENUM_HKCU = 0x00000001, // Enumerates HKCU only
  1060. SHREGENUM_HKLM = 0x00000010, // Enumerates HKLM only.
  1061. SHREGENUM_BOTH = 0x00000011, // Enumerates both HKCU and HKLM without duplicates.
  1062. // This option is NYI.
  1063. } SHREGENUM_FLAGS;
  1064. #define SHREGSET_HKCU 0x00000001 // Write to HKCU if empty.
  1065. #define SHREGSET_FORCE_HKCU 0x00000002 // Write to HKCU.
  1066. #define SHREGSET_HKLM 0x00000004 // Write to HKLM if empty.
  1067. #define SHREGSET_FORCE_HKLM 0x00000008 // Write to HKLM.
  1068. #define SHREGSET_DEFAULT (SHREGSET_FORCE_HKCU | SHREGSET_HKLM) // Default is SHREGSET_FORCE_HKCU | SHREGSET_HKLM.
  1069. typedef HANDLE HUSKEY; // HUSKEY is a Handle to a User Specific KEY.
  1070. typedef HUSKEY *PHUSKEY;
  1071. LWSTDAPI_(LONG) SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
  1072. LWSTDAPI_(LONG) SHRegCreateUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
  1073. LWSTDAPI_(LONG) SHRegOpenUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
  1074. LWSTDAPI_(LONG) SHRegOpenUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
  1075. LWSTDAPI_(LONG) SHRegQueryUSValueA(HUSKEY hUSKey, LPCSTR pszValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1076. LWSTDAPI_(LONG) SHRegQueryUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1077. LWSTDAPI_(LONG) SHRegWriteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1078. LWSTDAPI_(LONG) SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1079. LWSTDAPI_(LONG) SHRegDeleteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, SHREGDEL_FLAGS delRegFlags);
  1080. LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyW(HUSKEY hUSKey, LPCWSTR pwzSubKey, SHREGDEL_FLAGS delRegFlags);
  1081. LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyA(HUSKEY hUSKey, LPCSTR pszSubKey, SHREGDEL_FLAGS delRegFlags);
  1082. LWSTDAPI_(LONG) SHRegDeleteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, SHREGDEL_FLAGS delRegFlags);
  1083. LWSTDAPI_(LONG) SHRegEnumUSKeyA(HUSKEY hUSKey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
  1084. LWSTDAPI_(LONG) SHRegEnumUSKeyW(HUSKEY hUSKey, DWORD dwIndex, LPWSTR pwzName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
  1085. LWSTDAPI_(LONG) SHRegEnumUSValueA(HUSKEY hUSkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
  1086. LWSTDAPI_(LONG) SHRegEnumUSValueW(HUSKEY hUSkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
  1087. LWSTDAPI_(LONG) SHRegQueryInfoUSKeyA(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
  1088. LWSTDAPI_(LONG) SHRegQueryInfoUSKeyW(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
  1089. LWSTDAPI_(LONG) SHRegCloseUSKey(HUSKEY hUSKey);
  1090. // These calls are equal to an SHRegOpenUSKey, SHRegQueryUSValue, and then a SHRegCloseUSKey.
  1091. LWSTDAPI_(LONG) SHRegGetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1092. LWSTDAPI_(LONG) SHRegGetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
  1093. LWSTDAPI_(LONG) SHRegSetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1094. LWSTDAPI_(LONG) SHRegSetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
  1095. LWSTDAPI_(int) SHRegGetIntW(HKEY hk, LPCWSTR pwzKey, int iDefault);
  1096. #ifdef UNICODE
  1097. #define SHRegCreateUSKey SHRegCreateUSKeyW
  1098. #define SHRegOpenUSKey SHRegOpenUSKeyW
  1099. #define SHRegQueryUSValue SHRegQueryUSValueW
  1100. #define SHRegWriteUSValue SHRegWriteUSValueW
  1101. #define SHRegDeleteUSValue SHRegDeleteUSValueW
  1102. #define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyW
  1103. #define SHRegEnumUSKey SHRegEnumUSKeyW
  1104. #define SHRegEnumUSValue SHRegEnumUSValueW
  1105. #define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyW
  1106. #define SHRegGetUSValue SHRegGetUSValueW
  1107. #define SHRegSetUSValue SHRegSetUSValueW
  1108. #define SHRegGetInt SHRegGetIntW
  1109. #else
  1110. #define SHRegCreateUSKey SHRegCreateUSKeyA
  1111. #define SHRegOpenUSKey SHRegOpenUSKeyA
  1112. #define SHRegQueryUSValue SHRegQueryUSValueA
  1113. #define SHRegWriteUSValue SHRegWriteUSValueA
  1114. #define SHRegDeleteUSValue SHRegDeleteUSValueA
  1115. #define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyA
  1116. #define SHRegEnumUSKey SHRegEnumUSKeyA
  1117. #define SHRegEnumUSValue SHRegEnumUSValueA
  1118. #define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyA
  1119. #define SHRegGetUSValue SHRegGetUSValueA
  1120. #define SHRegSetUSValue SHRegSetUSValueA
  1121. #endif
  1122. LWSTDAPI_(BOOL) SHRegGetBoolUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
  1123. LWSTDAPI_(BOOL) SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
  1124. #ifdef UNICODE
  1125. #define SHRegGetBoolUSValue SHRegGetBoolUSValueW
  1126. #else
  1127. #define SHRegGetBoolUSValue SHRegGetBoolUSValueA
  1128. #endif
  1129. //
  1130. // Association APIs
  1131. //
  1132. // these APIs are to assist in accessing the data in HKCR
  1133. // getting the Command strings and exe paths
  1134. // for different verbs and extensions are simplified this way
  1135. //
  1136. enum {
  1137. ASSOCF_INIT_NOREMAPCLSID = 0x00000001, // do not remap clsids to progids
  1138. ASSOCF_INIT_BYEXENAME = 0x00000002, // executable is being passed in
  1139. ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in
  1140. ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat "*" as the BaseClass
  1141. ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat "Folder" as the BaseClass
  1142. ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU
  1143. ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string
  1144. ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
  1145. ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable
  1146. ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found
  1147. ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass
  1148. };
  1149. typedef DWORD ASSOCF;
  1150. typedef enum {
  1151. ASSOCSTR_COMMAND = 1, // shell\verb\command string
  1152. ASSOCSTR_EXECUTABLE, // the executable part of command string
  1153. ASSOCSTR_FRIENDLYDOCNAME, // friendly name of the document type
  1154. ASSOCSTR_FRIENDLYAPPNAME, // friendly name of executable
  1155. ASSOCSTR_NOOPEN, // noopen value
  1156. ASSOCSTR_SHELLNEWVALUE, // query values under the shellnew key
  1157. ASSOCSTR_DDECOMMAND, // template for DDE commands
  1158. ASSOCSTR_DDEIFEXEC, // DDECOMMAND to use if just create a process
  1159. ASSOCSTR_DDEAPPLICATION, // Application name in DDE broadcast
  1160. ASSOCSTR_DDETOPIC, // Topic Name in DDE broadcast
  1161. ASSOCSTR_INFOTIP, // info tip for an item, or list of properties to create info tip from
  1162. ASSOCSTR_QUICKTIP, // same as ASSOCSTR_INFOTIP, except, this list contains only quickly retrievable properties
  1163. ASSOCSTR_TILEINFO, // similar to ASSOCSTR_INFOTIP - lists important properties for tileview
  1164. ASSOCSTR_CONTENTTYPE, // MIME Content type
  1165. ASSOCSTR_DEFAULTICON, // Default icon source
  1166. ASSOCSTR_SHELLEXTENSION, // Guid string pointing to the Shellex\Shellextensionhandler value.
  1167. ASSOCSTR_MAX // last item in enum...
  1168. } ASSOCSTR;
  1169. typedef enum {
  1170. ASSOCKEY_SHELLEXECCLASS = 1, // the key that should be passed to ShellExec(hkeyClass)
  1171. ASSOCKEY_APP, // the "Application" key for the association
  1172. ASSOCKEY_CLASS, // the progid or class key
  1173. ASSOCKEY_BASECLASS, // the BaseClass key
  1174. ASSOCKEY_MAX // last item in enum...
  1175. } ASSOCKEY;
  1176. typedef enum {
  1177. ASSOCDATA_MSIDESCRIPTOR = 1, // Component Descriptor to pass to MSI APIs
  1178. ASSOCDATA_NOACTIVATEHANDLER, // restrict attempts to activate window
  1179. ASSOCDATA_QUERYCLASSSTORE, // should check with the NT Class Store
  1180. ASSOCDATA_HASPERUSERASSOC, // defaults to user specified association
  1181. ASSOCDATA_EDITFLAGS, // Edit flags.
  1182. ASSOCDATA_VALUE, // use pszExtra as the Value name
  1183. ASSOCDATA_MAX
  1184. } ASSOCDATA;
  1185. typedef enum {
  1186. ASSOCENUM_NONE
  1187. } ASSOCENUM;
  1188. #undef INTERFACE
  1189. #define INTERFACE IQueryAssociations
  1190. DECLARE_INTERFACE_( IQueryAssociations, IUnknown )
  1191. {
  1192. // IUnknown methods
  1193. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  1194. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  1195. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  1196. // IQueryAssociations methods
  1197. STDMETHOD (Init)(THIS_ ASSOCF flags, LPCWSTR pszAssoc, HKEY hkProgid, HWND hwnd) PURE;
  1198. STDMETHOD (GetString)(THIS_ ASSOCF flags, ASSOCSTR str, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut) PURE;
  1199. STDMETHOD (GetKey)(THIS_ ASSOCF flags, ASSOCKEY key, LPCWSTR pszExtra, HKEY *phkeyOut) PURE;
  1200. STDMETHOD (GetData)(THIS_ ASSOCF flags, ASSOCDATA data, LPCWSTR pszExtra, LPVOID pvOut, DWORD *pcbOut) PURE;
  1201. STDMETHOD (GetEnum)(THIS_ ASSOCF flags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut) PURE;
  1202. };
  1203. LWSTDAPI AssocCreate(CLSID clsid, REFIID riid, LPVOID *ppv);
  1204. // wrappers for the interface
  1205. LWSTDAPI AssocQueryStringA(ASSOCF flags, ASSOCSTR str, LPCSTR pszAssoc, LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut);
  1206. // wrappers for the interface
  1207. LWSTDAPI AssocQueryStringW(ASSOCF flags, ASSOCSTR str, LPCWSTR pszAssoc, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut);
  1208. #ifdef UNICODE
  1209. #define AssocQueryString AssocQueryStringW
  1210. #else
  1211. #define AssocQueryString AssocQueryStringA
  1212. #endif // !UNICODE
  1213. LWSTDAPI AssocQueryStringByKeyA(ASSOCF flags, ASSOCSTR str, HKEY hkAssoc, LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut);
  1214. LWSTDAPI AssocQueryStringByKeyW(ASSOCF flags, ASSOCSTR str, HKEY hkAssoc, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut);
  1215. #ifdef UNICODE
  1216. #define AssocQueryStringByKey AssocQueryStringByKeyW
  1217. #else
  1218. #define AssocQueryStringByKey AssocQueryStringByKeyA
  1219. #endif // !UNICODE
  1220. LWSTDAPI AssocQueryKeyA(ASSOCF flags, ASSOCKEY key, LPCSTR pszAssoc, LPCSTR pszExtra, HKEY *phkeyOut);
  1221. LWSTDAPI AssocQueryKeyW(ASSOCF flags, ASSOCKEY key, LPCWSTR pszAssoc, LPCWSTR pszExtra, HKEY *phkeyOut);
  1222. #ifdef UNICODE
  1223. #define AssocQueryKey AssocQueryKeyW
  1224. #else
  1225. #define AssocQueryKey AssocQueryKeyA
  1226. #endif // !UNICODE
  1227. // AssocIsDangerous() checks a file type to determine whether it is "Dangerous"
  1228. // this maps to the IE download dialog's forcing a prompt to open or save.
  1229. // dangerous file types should be handled more carefully than other file types.
  1230. //
  1231. // Parameter: pszAssoc - type to check. may be an extension or progid. (".exe" or "exefile" would both be valid)
  1232. //
  1233. // Returns: TRUE if the file type is dangerous.
  1234. //
  1235. // NOTES:
  1236. //
  1237. // this API first checks a hardcoded list of known dangerous types.
  1238. // then it checks the editflags for the file type looking for the FTA_AlwaysUnsafe bit.
  1239. // then it checks Safer policies.
  1240. //
  1241. LWSTDAPI_(BOOL) AssocIsDangerous(LPCWSTR pszAssoc);
  1242. #endif // NO_SHLWAPI_REG
  1243. #ifndef NO_SHLWAPI_STREAM
  1244. //
  1245. //=============== Stream Routines ===================================
  1246. //
  1247. LWSTDAPI_(struct IStream *) SHOpenRegStreamA(HKEY hkey, LPCSTR pszSubkey, LPCSTR pszValue, DWORD grfMode);
  1248. LWSTDAPI_(struct IStream *) SHOpenRegStreamW(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
  1249. #ifdef UNICODE
  1250. #define SHOpenRegStream SHOpenRegStreamW
  1251. #else
  1252. #define SHOpenRegStream SHOpenRegStreamA
  1253. #endif // !UNICODE
  1254. LWSTDAPI_(struct IStream *) SHOpenRegStream2A(HKEY hkey, LPCSTR pszSubkey, LPCSTR pszValue, DWORD grfMode);
  1255. LWSTDAPI_(struct IStream *) SHOpenRegStream2W(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
  1256. #ifdef UNICODE
  1257. #define SHOpenRegStream2 SHOpenRegStream2W
  1258. #else
  1259. #define SHOpenRegStream2 SHOpenRegStream2A
  1260. #endif // !UNICODE
  1261. // New code always wants new implementation...
  1262. #undef SHOpenRegStream
  1263. #define SHOpenRegStream SHOpenRegStream2
  1264. LWSTDAPI SHCreateStreamOnFileA(LPCSTR pszFile, DWORD grfMode, struct IStream **ppstm);
  1265. LWSTDAPI SHCreateStreamOnFileW(LPCWSTR pszFile, DWORD grfMode, struct IStream **ppstm);
  1266. #ifdef UNICODE
  1267. #define SHCreateStreamOnFile SHCreateStreamOnFileW
  1268. #else
  1269. #define SHCreateStreamOnFile SHCreateStreamOnFileA
  1270. #endif // !UNICODE
  1271. #if (_WIN32_IE >= 0x0600)
  1272. LWSTDAPI SHCreateStreamOnFileEx(LPCWSTR pszFile, DWORD grfMode, DWORD dwAttributes, BOOL fCreate, struct IStream * pstmTemplate, struct IStream **ppstm);
  1273. #endif // (_WIN32_IE >= 0x0600)
  1274. #endif // NO_SHLWAPI_STREAM
  1275. #if (_WIN32_IE >= 0x0500)
  1276. // SHAutoComplete
  1277. // hwndEdit - HWND of editbox, ComboBox or ComboBoxEx.
  1278. // dwFlags - Flags to indicate what to AutoAppend or AutoSuggest for the editbox.
  1279. //
  1280. // WARNING:
  1281. // Caller needs to have called CoInitialize() or OleInitialize()
  1282. // and cannot call CoUninit/OleUninit until after
  1283. // WM_DESTROY on hwndEdit.
  1284. //
  1285. // dwFlags values:
  1286. #define SHACF_DEFAULT 0x00000000 // Currently (SHACF_FILESYSTEM | SHACF_URLALL)
  1287. #define SHACF_FILESYSTEM 0x00000001 // This includes the File System as well as the rest of the shell (Desktop\My Computer\Control Panel\)
  1288. #define SHACF_URLALL (SHACF_URLHISTORY | SHACF_URLMRU)
  1289. #define SHACF_URLHISTORY 0x00000002 // URLs in the User's History
  1290. #define SHACF_URLMRU 0x00000004 // URLs in the User's Recently Used list.
  1291. #define SHACF_USETAB 0x00000008 // Use the tab to move thru the autocomplete possibilities instead of to the next dialog/window control.
  1292. #define SHACF_FILESYS_ONLY 0x00000010 // This includes the File System
  1293. #if (_WIN32_IE >= 0x0600)
  1294. #define SHACF_FILESYS_DIRS 0x00000020 // Same as SHACF_FILESYS_ONLY except it only includes directories, UNC servers, and UNC server shares.
  1295. #endif // (_WIN32_IE >= 0x0600)
  1296. #define SHACF_AUTOSUGGEST_FORCE_ON 0x10000000 // Ignore the registry default and force the feature on.
  1297. #define SHACF_AUTOSUGGEST_FORCE_OFF 0x20000000 // Ignore the registry default and force the feature off.
  1298. #define SHACF_AUTOAPPEND_FORCE_ON 0x40000000 // Ignore the registry default and force the feature on. (Also know as AutoComplete)
  1299. #define SHACF_AUTOAPPEND_FORCE_OFF 0x80000000 // Ignore the registry default and force the feature off. (Also know as AutoComplete)
  1300. LWSTDAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags);
  1301. LWSTDAPI SHSetThreadRef(IUnknown *punk);
  1302. LWSTDAPI SHGetThreadRef(IUnknown **ppunk);
  1303. LWSTDAPI_(BOOL) SHSkipJunction(struct IBindCtx* pbc, const CLSID *pclsid);
  1304. #endif // (_WIN32_IE >= 0x0500)
  1305. #define CTF_INSIST 0x00000001 // SHCreateThread() dwFlags - call pfnThreadProc synchronously if CreateThread() fails
  1306. #define CTF_THREAD_REF 0x00000002 // hold a reference to the creating thread
  1307. #define CTF_PROCESS_REF 0x00000004 // hold a reference to the creating process
  1308. #define CTF_COINIT 0x00000008 // init COM for the created thread
  1309. #define CTF_FREELIBANDEXIT 0x00000010 // hold a ref to the DLL and call FreeLibraryAndExitThread() when done
  1310. #define CTF_REF_COUNTED 0x00000020 // thread supports ref counting via SHGetThreadRef() or CTF_THREAD_REF so that child threads can keep this thread alive
  1311. #define CTF_WAIT_ALLOWCOM 0x00000040 // while waiting for pfnCallback, allow COM marshaling to the blocked calling thread
  1312. LWSTDAPI_(BOOL) SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, void *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback);
  1313. LWSTDAPI SHReleaseThreadRef(); // release a CTF_THREAD_REF reference earlier than the return of pfnThreadProc
  1314. #ifndef NO_SHLWAPI_GDI
  1315. //
  1316. //====== GDI helper functions ================================================
  1317. //
  1318. LWSTDAPI_(HPALETTE) SHCreateShellPalette(HDC hdc);
  1319. #if (_WIN32_IE >= 0x0500)
  1320. LWSTDAPI_(void) ColorRGBToHLS(COLORREF clrRGB, WORD* pwHue, WORD* pwLuminance, WORD* pwSaturation);
  1321. LWSTDAPI_(COLORREF) ColorHLSToRGB(WORD wHue, WORD wLuminance, WORD wSaturation);
  1322. LWSTDAPI_(COLORREF) ColorAdjustLuma(COLORREF clrRGB, int n, BOOL fScale);
  1323. #endif // _WIN32_IE >= 0x0500
  1324. #endif // NO_SHLWAPI_GDI
  1325. //
  1326. //====== DllGetVersion =======================================================
  1327. //
  1328. typedef struct _DLLVERSIONINFO
  1329. {
  1330. DWORD cbSize;
  1331. DWORD dwMajorVersion; // Major version
  1332. DWORD dwMinorVersion; // Minor version
  1333. DWORD dwBuildNumber; // Build number
  1334. DWORD dwPlatformID; // DLLVER_PLATFORM_*
  1335. } DLLVERSIONINFO;
  1336. // Platform IDs for DLLVERSIONINFO
  1337. #define DLLVER_PLATFORM_WINDOWS 0x00000001 // Windows 95
  1338. #define DLLVER_PLATFORM_NT 0x00000002 // Windows NT
  1339. #if (_WIN32_IE >= 0x0501)
  1340. typedef struct _DLLVERSIONINFO2
  1341. {
  1342. DLLVERSIONINFO info1;
  1343. DWORD dwFlags; // No flags currently defined
  1344. ULONGLONG ullVersion; // Encoded as:
  1345. // Major 0xFFFF 0000 0000 0000
  1346. // Minor 0x0000 FFFF 0000 0000
  1347. // Build 0x0000 0000 FFFF 0000
  1348. // QFE 0x0000 0000 0000 FFFF
  1349. } DLLVERSIONINFO2;
  1350. #define DLLVER_MAJOR_MASK 0xFFFF000000000000
  1351. #define DLLVER_MINOR_MASK 0x0000FFFF00000000
  1352. #define DLLVER_BUILD_MASK 0x00000000FFFF0000
  1353. #define DLLVER_QFE_MASK 0x000000000000FFFF
  1354. #endif
  1355. #define MAKEDLLVERULL(major, minor, build, qfe) \
  1356. (((ULONGLONG)(major) << 48) | \
  1357. ((ULONGLONG)(minor) << 32) | \
  1358. ((ULONGLONG)(build) << 16) | \
  1359. ((ULONGLONG)( qfe) << 0))
  1360. //
  1361. // The caller should always GetProcAddress("DllGetVersion"), not
  1362. // implicitly link to it.
  1363. //
  1364. typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
  1365. // DllInstall (to be implemented by self-installing DLLs)
  1366. STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine);
  1367. #ifdef __cplusplus
  1368. }
  1369. #endif
  1370. #ifdef _WIN32
  1371. #include <poppack.h>
  1372. #endif
  1373. #endif
  1374. #endif // _INC_SHLWAPI