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
5413 lines
237 KiB
;begin_both
|
|
/*****************************************************************************\
|
|
* *
|
|
* shlwapi.h - Interface for the Windows light-weight utility APIs *
|
|
* *
|
|
* Version 1.0 *
|
|
* *
|
|
* Copyright (c) Microsoft Corporation. All rights reserved. *
|
|
* *
|
|
\*****************************************************************************/
|
|
|
|
;end_both
|
|
|
|
#ifndef _INC_SHLWAPI
|
|
#define _INC_SHLWAPI
|
|
#ifndef _INC_SHLWAPIP ;internal
|
|
#define _INC_SHLWAPIP ;internal
|
|
|
|
;begin_both
|
|
#ifndef NOSHLWAPI
|
|
|
|
#include <objbase.h>
|
|
#include <shtypes.h>
|
|
|
|
;end_both
|
|
|
|
#ifndef _WINRESRC_
|
|
#ifndef _WIN32_IE
|
|
#define _WIN32_IE 0x0501
|
|
#else
|
|
#if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
|
|
#error _WIN32_IE setting conflicts with _WIN32_WINNT setting
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef UNIX
|
|
typedef interface IInternetSecurityMgrSite IInternetSecurityMgrSite;
|
|
typedef interface IInternetSecurityManager IInternetSecurityManager;
|
|
typedef interface IInternetHostSecurityManager IInternetHostSecurityManager;
|
|
#endif
|
|
|
|
//
|
|
// Define API decoration for direct importing of DLL references.
|
|
//
|
|
#ifndef WINSHLWAPI
|
|
#if !defined(_SHLWAPI_)
|
|
#define LWSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
|
|
#define LWSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
|
|
#define LWSTDAPIV EXTERN_C DECLSPEC_IMPORT HRESULT STDAPIVCALLTYPE
|
|
#define LWSTDAPIV_(type) EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE
|
|
#else
|
|
#define LWSTDAPI STDAPI
|
|
#define LWSTDAPI_(type) STDAPI_(type)
|
|
#define LWSTDAPIV STDAPIV
|
|
#define LWSTDAPIV_(type) STDAPIV_(type)
|
|
#endif
|
|
#endif // WINSHLWAPI
|
|
|
|
;begin_both
|
|
#ifdef _WIN32
|
|
#include <pshpack8.h>
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
//
|
|
// Users of this header may define any number of these constants to avoid
|
|
// the definitions of each functional group.
|
|
//
|
|
// NO_SHLWAPI_STRFCNS String functions
|
|
// NO_SHLWAPI_PATH Path functions
|
|
// NO_SHLWAPI_REG Registry functions
|
|
// NO_SHLWAPI_UALSTR Unaligned string functions ;internal
|
|
// NO_SHLWAPI_STREAM Stream functions
|
|
// NO_SHLWAPI_HTTP HTTP helper routines ;internal
|
|
// NO_SHLWAPI_INTERNAL Other random internal things ;internal
|
|
// NO_SHLWAPI_GDI GDI helper functions
|
|
// NO_SHLWAPI_UNITHUNK Unicode wrapper functions ;internal
|
|
// NO_SHLWAPI_TPS Thread Pool Services ;internal
|
|
// NO_SHLWAPI_MLUI Multi Language UI functions ;internal
|
|
|
|
|
|
#ifndef NO_SHLWAPI_STRFCNS
|
|
//
|
|
//=============== String Routines ===================================
|
|
//
|
|
|
|
;end_both
|
|
LWSTDAPI_(LPSTR) StrChrA(LPCSTR lpStart, WORD wMatch);
|
|
LWSTDAPI_(LPWSTR) StrChrW(LPCWSTR lpStart, WCHAR wMatch);
|
|
LWSTDAPI_(LPSTR) StrChrIA(LPCSTR lpStart, WORD wMatch);
|
|
LWSTDAPI_(LPWSTR) StrChrIW(LPCWSTR lpStart, WCHAR wMatch);
|
|
LWSTDAPI_(int) StrCmpNA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNIA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNIW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCSpnA(LPCSTR lpStr, LPCSTR lpSet);
|
|
LWSTDAPI_(int) StrCSpnW(LPCWSTR lpStr, LPCWSTR lpSet);
|
|
LWSTDAPI_(int) StrCSpnIA(LPCSTR lpStr, LPCSTR lpSet);
|
|
LWSTDAPI_(int) StrCSpnIW(LPCWSTR lpStr, LPCWSTR lpSet);
|
|
LWSTDAPI_(LPSTR) StrDupA(LPCSTR lpSrch);
|
|
LWSTDAPI_(LPWSTR) StrDupW(LPCWSTR lpSrch);
|
|
LWSTDAPI_(LPSTR) StrFormatByteSizeA(DWORD dw, LPSTR szBuf, UINT uiBufSize);
|
|
LWSTDAPI_(LPSTR) StrFormatByteSize64A(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
|
|
LWSTDAPI_(LPWSTR) StrFormatByteSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
|
|
LWSTDAPI_(LPWSTR) StrFormatKBSizeW(LONGLONG qdw, LPWSTR szBuf, UINT uiBufSize);
|
|
LWSTDAPI_(LPSTR) StrFormatKBSizeA(LONGLONG qdw, LPSTR szBuf, UINT uiBufSize);
|
|
LWSTDAPI_(int) StrFromTimeIntervalA(LPSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
|
|
LWSTDAPI_(int) StrFromTimeIntervalW(LPWSTR pszOut, UINT cchMax, DWORD dwTimeMS, int digits);
|
|
LWSTDAPI_(BOOL) StrIsIntlEqualA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
|
|
LWSTDAPI_(BOOL) StrIsIntlEqualW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
|
|
LWSTDAPI_(LPSTR) StrNCatA(LPSTR psz1, LPCSTR psz2, int cchMax);
|
|
LWSTDAPI_(LPWSTR) StrNCatW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
|
|
LWSTDAPI_(LPSTR) StrPBrkA(LPCSTR psz, LPCSTR pszSet);
|
|
LWSTDAPI_(LPWSTR) StrPBrkW(LPCWSTR psz, LPCWSTR pszSet);
|
|
LWSTDAPI_(LPSTR) StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
|
|
LWSTDAPI_(LPWSTR) StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
|
|
LWSTDAPI_(LPSTR) StrRChrIA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
|
|
LWSTDAPI_(LPWSTR) StrRChrIW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
|
|
LWSTDAPI_(LPSTR) StrRStrIA(LPCSTR lpSource, LPCSTR lpLast, LPCSTR lpSrch);
|
|
LWSTDAPI_(LPWSTR) StrRStrIW(LPCWSTR lpSource, LPCWSTR lpLast, LPCWSTR lpSrch);
|
|
LWSTDAPI_(int) StrSpnA(LPCSTR psz, LPCSTR pszSet);
|
|
LWSTDAPI_(int) StrSpnW(LPCWSTR psz, LPCWSTR pszSet);
|
|
LWSTDAPI_(LPSTR) StrStrA(LPCSTR lpFirst, LPCSTR lpSrch);
|
|
LWSTDAPI_(LPWSTR) StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch);
|
|
LWSTDAPI_(LPSTR) StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
|
|
LWSTDAPI_(LPWSTR) StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch);
|
|
LWSTDAPI_(int) StrToIntA(LPCSTR lpSrc);
|
|
LWSTDAPI_(int) StrToIntW(LPCWSTR lpSrc);
|
|
LWSTDAPI_(BOOL) StrToIntExA(LPCSTR pszString, DWORD dwFlags, int * piRet);
|
|
LWSTDAPI_(BOOL) StrToIntExW(LPCWSTR pszString, DWORD dwFlags, int * piRet);
|
|
#if (_WIN32_IE >= 0x0600)
|
|
LWSTDAPI_(BOOL) StrToInt64ExA(LPCSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
|
|
LWSTDAPI_(BOOL) StrToInt64ExW(LPCWSTR pszString, DWORD dwFlags, LONGLONG * pllRet);
|
|
#endif
|
|
LWSTDAPI_(BOOL) StrTrimA(LPSTR psz, LPCSTR pszTrimChars);
|
|
LWSTDAPI_(BOOL) StrTrimW(LPWSTR psz, LPCWSTR pszTrimChars);
|
|
|
|
LWSTDAPI_(LPWSTR) StrCatW(LPWSTR psz1, LPCWSTR psz2);
|
|
LWSTDAPI_(int) StrCmpW(LPCWSTR psz1, LPCWSTR psz2);
|
|
LWSTDAPI_(int) StrCmpIW(LPCWSTR psz1, LPCWSTR psz2);
|
|
LWSTDAPI_(LPWSTR) StrCpyW(LPWSTR psz1, LPCWSTR psz2);
|
|
LWSTDAPI_(LPWSTR) StrCpyNW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
|
|
;begin_internal
|
|
LWSTDAPI_(LPSTR) StrCpyNXA(LPSTR psz1, LPCSTR psz2, int cchMax);
|
|
LWSTDAPI_(LPWSTR) StrCpyNXW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
|
|
;end_internal
|
|
|
|
LWSTDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize);
|
|
LWSTDAPI_(LPSTR) StrCatBuffA(LPSTR pszDest, LPCSTR pszSrc, int cchDestBuffSize);
|
|
|
|
LWSTDAPI_(BOOL) ChrCmpIA(WORD w1, WORD w2);
|
|
LWSTDAPI_(BOOL) ChrCmpIW(WCHAR w1, WCHAR w2);
|
|
|
|
LWSTDAPI_(int) wvnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, va_list arglist);
|
|
LWSTDAPI_(int) wvnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, va_list arglist);
|
|
LWSTDAPIV_(int) wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...);
|
|
LWSTDAPIV_(int) wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...);
|
|
|
|
#define StrIntlEqNA( s1, s2, nChar) StrIsIntlEqualA( TRUE, s1, s2, nChar)
|
|
#define StrIntlEqNW( s1, s2, nChar) StrIsIntlEqualW( TRUE, s1, s2, nChar)
|
|
#define StrIntlEqNIA(s1, s2, nChar) StrIsIntlEqualA(FALSE, s1, s2, nChar)
|
|
#define StrIntlEqNIW(s1, s2, nChar) StrIsIntlEqualW(FALSE, s1, s2, nChar)
|
|
|
|
LWSTDAPI StrRetToStr%(STRRET *pstr, LPCITEMIDLIST pidl, LPTSTR% *ppsz);
|
|
LWSTDAPI StrRetToBuf%(STRRET *pstr, LPCITEMIDLIST pidl, LPTSTR% pszBuf, UINT cchBuf);
|
|
LWSTDAPI StrRetToBSTR(STRRET *pstr, LPCITEMIDLIST pidl, BSTR *pbstr);
|
|
|
|
// helper to duplicate a string using the task allocator
|
|
|
|
LWSTDAPI SHStrDup%(LPCTSTR% psz, WCHAR **ppwsz);
|
|
|
|
LWSTDAPI_(int) StrCmpLogicalW(LPCWSTR psz1, LPCWSTR psz2);
|
|
LWSTDAPI_(DWORD) StrCatChainW(LPWSTR pszDst, DWORD cchDst, DWORD ichAt, LPCWSTR pszSrc);
|
|
|
|
LWSTDAPI SHLoadIndirectString(LPCWSTR pszSource, LPWSTR pszOutBuf, UINT cchOutBuf, void **ppvReserved);
|
|
|
|
;begin_internal
|
|
|
|
#define ORD_SHLOADREGUISTRINGA 438
|
|
#define ORD_SHLOADREGUISTRINGW 439
|
|
LWSTDAPI SHLoadRegUIString%(HKEY hkey, LPCTSTR% pszValue, LPTSTR% pszOutBuf, UINT cchOutBuf);
|
|
|
|
LWSTDAPI_(BOOL) IsCharCntrlW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) IsCharDigitW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) IsCharXDigitW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) IsCharSpaceW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) IsCharBlankW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) IsCharPunctW(WCHAR wch);
|
|
LWSTDAPI_(BOOL) GetStringType3ExW( LPCWSTR, int, LPWORD );
|
|
|
|
// StrCmp*C* - Compare strings using C runtime collation rules.
|
|
// These functions are faster than the StrCmp family of functions
|
|
// above and can be used when the character set of the strings is
|
|
// known to be limited to seven ASCII character set.
|
|
|
|
LWSTDAPI_(int) StrCmpNCA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNCW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNICA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpNICW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
|
|
LWSTDAPI_(int) StrCmpCA(LPCSTR lpStr1, LPCSTR lpStr2);
|
|
LWSTDAPI_(int) StrCmpCW(LPCWSTR lpStr1, LPCWSTR lpStr2);
|
|
LWSTDAPI_(int) StrCmpICA(LPCSTR lpStr1, LPCSTR lpStr2);
|
|
LWSTDAPI_(int) StrCmpICW(LPCWSTR lpStr1, LPCWSTR lpStr2);
|
|
|
|
// This is a true-Unicode version of CompareString. It only supports
|
|
// STRING_SORT, however. After better test coverage, it shall replace
|
|
// the CompareString Unicode wrapper itself. In the mean time, we only
|
|
// call this from the find dialog/OM method of Trident.
|
|
|
|
LWSTDAPI_(int) CompareStringAltW( LCID lcid, DWORD dwFlags, LPCWSTR lpchA, int cchA, LPCWSTR lpchB, int cchB );
|
|
|
|
;end_internal
|
|
|
|
#ifdef UNICODE
|
|
#define StrChr StrChrW
|
|
#define StrRChr StrRChrW
|
|
#define StrChrI StrChrIW
|
|
#define StrRChrI StrRChrIW
|
|
#define StrCmpN StrCmpNW
|
|
#define StrCmpNI StrCmpNIW
|
|
#define StrStr StrStrW
|
|
#define StrStrI StrStrIW
|
|
#define StrDup StrDupW
|
|
#define StrRStrI StrRStrIW
|
|
#define StrCSpn StrCSpnW
|
|
#define StrCSpnI StrCSpnIW
|
|
#define StrSpn StrSpnW
|
|
#define StrToInt StrToIntW
|
|
#define StrPBrk StrPBrkW
|
|
#define StrToIntEx StrToIntExW
|
|
#if (_WIN32_IE >= 0x0600)
|
|
#define StrToInt64Ex StrToInt64ExW
|
|
#endif
|
|
#define StrFromTimeInterval StrFromTimeIntervalW
|
|
#define StrIntlEqN StrIntlEqNW
|
|
#define StrIntlEqNI StrIntlEqNIW
|
|
#define StrFormatByteSize StrFormatByteSizeW
|
|
#define StrFormatByteSize64 StrFormatByteSizeW
|
|
#define StrFormatKBSize StrFormatKBSizeW
|
|
#define StrNCat StrNCatW
|
|
#define StrTrim StrTrimW
|
|
#define StrCatBuff StrCatBuffW
|
|
#define ChrCmpI ChrCmpIW
|
|
#define wvnsprintf wvnsprintfW
|
|
#define wnsprintf wnsprintfW
|
|
#define StrIsIntlEqual StrIsIntlEqualW
|
|
|
|
;begin_internal
|
|
//
|
|
// Macros for IsCharAlpha, IsCharAlphaNumeric, IsCharLower, IsCharUpper
|
|
// are in winuser.h
|
|
//
|
|
//
|
|
|
|
#define IsCharCntrl IsCharCntrlW
|
|
#define IsCharDigit IsCharDigitW
|
|
#define IsCharXDigit IsCharXDigitW
|
|
#define IsCharSpace IsCharSpaceW
|
|
#define IsCharBlank IsCharBlankW
|
|
#define IsCharPunct IsCharPunctW
|
|
#define GetStringType3Ex GetStringType3ExW
|
|
|
|
;end_internal
|
|
|
|
#else
|
|
#define StrChr StrChrA
|
|
#define StrRChr StrRChrA
|
|
#define StrChrI StrChrIA
|
|
#define StrRChrI StrRChrIA
|
|
#define StrCmpN StrCmpNA
|
|
#define StrCmpNI StrCmpNIA
|
|
#define StrStr StrStrA
|
|
#define StrStrI StrStrIA
|
|
#define StrDup StrDupA
|
|
#define StrRStrI StrRStrIA
|
|
#define StrCSpn StrCSpnA
|
|
#define StrCSpnI StrCSpnIA
|
|
#define StrSpn StrSpnA
|
|
#define StrToInt StrToIntA
|
|
#define StrPBrk StrPBrkA
|
|
#define StrToIntEx StrToIntExA
|
|
#if (_WIN32_IE >= 0x0600)
|
|
#define StrToInt64Ex StrToInt64ExA
|
|
#endif
|
|
#define StrFromTimeInterval StrFromTimeIntervalA
|
|
#define StrIntlEqN StrIntlEqNA
|
|
#define StrIntlEqNI StrIntlEqNIA
|
|
#define StrFormatByteSize StrFormatByteSizeA
|
|
#define StrFormatByteSize64 StrFormatByteSize64A
|
|
#define StrFormatKBSize StrFormatKBSizeA
|
|
#define StrNCat StrNCatA
|
|
#define StrTrim StrTrimA
|
|
#define StrCatBuff StrCatBuffA
|
|
#define ChrCmpI ChrCmpIA
|
|
#define wvnsprintf wvnsprintfA
|
|
#define wnsprintf wnsprintfA
|
|
#define StrIsIntlEqual StrIsIntlEqualA
|
|
#endif
|
|
|
|
;begin_internal
|
|
|
|
#ifdef UNICODE
|
|
|
|
#define StrCmpNC StrCmpNCW
|
|
#define StrCmpNIC StrCmpNICW
|
|
#define StrCmpC StrCmpCW
|
|
#define StrCmpIC StrCmpICW
|
|
#define StrCpyNX StrCpyNXW
|
|
|
|
#else
|
|
|
|
#define StrCmpNC StrCmpNCA
|
|
#define StrCmpNIC StrCmpNICA
|
|
#define StrCmpC StrCmpCA
|
|
#define StrCmpIC StrCmpICA
|
|
#define StrCpyNX StrCpyNXA
|
|
|
|
#endif
|
|
|
|
;end_internal
|
|
|
|
// Backward compatible to NT's non-standard naming (strictly
|
|
// for comctl32)
|
|
//
|
|
LWSTDAPI_(BOOL) IntlStrEqWorkerA(BOOL fCaseSens, LPCSTR lpString1, LPCSTR lpString2, int nChar);
|
|
LWSTDAPI_(BOOL) IntlStrEqWorkerW(BOOL fCaseSens, LPCWSTR lpString1, LPCWSTR lpString2, int nChar);
|
|
|
|
#define IntlStrEqNA( s1, s2, nChar) IntlStrEqWorkerA( TRUE, s1, s2, nChar)
|
|
#define IntlStrEqNW( s1, s2, nChar) IntlStrEqWorkerW( TRUE, s1, s2, nChar)
|
|
#define IntlStrEqNIA(s1, s2, nChar) IntlStrEqWorkerA(FALSE, s1, s2, nChar)
|
|
#define IntlStrEqNIW(s1, s2, nChar) IntlStrEqWorkerW(FALSE, s1, s2, nChar)
|
|
|
|
#ifdef UNICODE
|
|
#define IntlStrEqN IntlStrEqNW
|
|
#define IntlStrEqNI IntlStrEqNIW
|
|
#else
|
|
#define IntlStrEqN IntlStrEqNA
|
|
#define IntlStrEqNI IntlStrEqNIA
|
|
#endif
|
|
|
|
#define SZ_CONTENTTYPE_HTMLA "text/html"
|
|
#define SZ_CONTENTTYPE_HTMLW L"text/html"
|
|
#define SZ_CONTENTTYPE_CDFA "application/x-cdf"
|
|
#define SZ_CONTENTTYPE_CDFW L"application/x-cdf"
|
|
|
|
#ifdef UNICODE
|
|
#define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLW
|
|
#define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFW
|
|
#else
|
|
#define SZ_CONTENTTYPE_HTML SZ_CONTENTTYPE_HTMLA
|
|
#define SZ_CONTENTTYPE_CDF SZ_CONTENTTYPE_CDFA
|
|
#endif
|
|
|
|
#define PathIsHTMLFileA(pszPath) PathIsContentTypeA(pszPath, SZ_CONTENTTYPE_HTMLA)
|
|
#define PathIsHTMLFileW(pszPath) PathIsContentTypeW(pszPath, SZ_CONTENTTYPE_HTMLW)
|
|
|
|
// Flags for StrToIntEx
|
|
#define STIF_DEFAULT 0x00000000L
|
|
#define STIF_SUPPORT_HEX 0x00000001L
|
|
|
|
|
|
#define StrCatA lstrcatA
|
|
#define StrCmpA lstrcmpA
|
|
#define StrCmpIA lstrcmpiA
|
|
#define StrCpyA lstrcpyA
|
|
#define StrCpyNA lstrcpynA
|
|
|
|
|
|
#define StrToLong StrToInt
|
|
#define StrNCmp StrCmpN
|
|
#define StrNCmpI StrCmpNI
|
|
#define StrNCpy StrCpyN
|
|
#define StrCatN StrNCat
|
|
|
|
#ifdef UNICODE
|
|
#define StrCat StrCatW
|
|
#define StrCmp StrCmpW
|
|
#define StrCmpI StrCmpIW
|
|
#define StrCpy StrCpyW
|
|
#define StrCpyN StrCpyNW
|
|
#define StrCatBuff StrCatBuffW
|
|
#else
|
|
#define StrCat lstrcatA
|
|
#define StrCmp lstrcmpA
|
|
#define StrCmpI lstrcmpiA
|
|
#define StrCpy lstrcpyA
|
|
#define StrCpyN lstrcpynA
|
|
#define StrCatBuff StrCatBuffA
|
|
#endif
|
|
|
|
;begin_both
|
|
|
|
#endif // NO_SHLWAPI_STRFCNS
|
|
|
|
;end_both
|
|
;begin_both
|
|
|
|
#ifndef NO_SHLWAPI_PATH
|
|
|
|
//
|
|
//=============== Path Routines ===================================
|
|
//
|
|
|
|
;end_both
|
|
LWSTDAPI_(LPTSTR%) PathAddBackslash%(LPTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathAddExtension%(LPTSTR% pszPath, LPCTSTR% pszExt);
|
|
LWSTDAPI_(BOOL) PathAppendA(LPSTR pszPath, LPCSTR pMore);
|
|
LWSTDAPI_(BOOL) PathAppendW(LPWSTR pszPath, LPCWSTR pMore);
|
|
LWSTDAPI_(LPTSTR%) PathBuildRoot%(LPTSTR% pszRoot, int iDrive);
|
|
LWSTDAPI_(BOOL) PathCanonicalizeA(LPSTR pszBuf, LPCSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathCanonicalizeW(LPWSTR pszBuf, LPCWSTR pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathCombine%(LPTSTR% pszDest, LPCTSTR% pszDir, LPCTSTR% pszFile);
|
|
LWSTDAPI_(BOOL) PathCompactPathA(HDC hDC, LPSTR pszPath, UINT dx);
|
|
LWSTDAPI_(BOOL) PathCompactPathW(HDC hDC, LPWSTR pszPath, UINT dx);
|
|
LWSTDAPI_(BOOL) PathCompactPathExA(LPSTR pszOut, LPCSTR pszSrc, UINT cchMax, DWORD dwFlags);
|
|
LWSTDAPI_(BOOL) PathCompactPathExW(LPWSTR pszOut, LPCWSTR pszSrc, UINT cchMax, DWORD dwFlags);
|
|
LWSTDAPI_(int) PathCommonPrefixA(LPCSTR pszFile1, LPCSTR pszFile2, LPSTR achPath);
|
|
LWSTDAPI_(int) PathCommonPrefixW(LPCWSTR pszFile1, LPCWSTR pszFile2, LPWSTR achPath);
|
|
LWSTDAPI_(BOOL) PathFileExists%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathFindExtension%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathFindFileName%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathFindNextComponent%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathFindOnPathA(LPSTR pszPath, LPCSTR * ppszOtherDirs);
|
|
LWSTDAPI_(BOOL) PathFindOnPathW(LPWSTR pszPath, LPCWSTR * ppszOtherDirs);
|
|
LWSTDAPI_(LPTSTR%) PathGetArgs%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(LPCTSTR%) PathFindSuffixArray%(LPCTSTR% pszPath, const LPCTSTR% *apszSuffix, int iArraySize);
|
|
LWSTDAPI_(BOOL) PathIsLFNFileSpec%(LPCTSTR% lpName);
|
|
|
|
LWSTDAPI_(UINT) PathGetCharTypeA(UCHAR ch);
|
|
LWSTDAPI_(UINT) PathGetCharTypeW(WCHAR ch);
|
|
|
|
// Return flags for PathGetCharType
|
|
#define GCT_INVALID 0x0000
|
|
#define GCT_LFNCHAR 0x0001
|
|
#define GCT_SHORTCHAR 0x0002
|
|
#define GCT_WILD 0x0004
|
|
#define GCT_SEPARATOR 0x0008
|
|
|
|
LWSTDAPI_(int) PathGetDriveNumber%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsDirectory%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsDirectoryEmpty%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsFileSpec%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsPrefix%(LPCTSTR% pszPrefix, LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsRelative%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsRoot%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsSameRoot%(LPCTSTR% pszPath1, LPCTSTR% pszPath2);
|
|
LWSTDAPI_(BOOL) PathIsUNC%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsNetworkPath%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsUNCServer%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsUNCServerShare%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsContentTypeA(LPCSTR pszPath, LPCSTR pszContentType);
|
|
LWSTDAPI_(BOOL) PathIsContentTypeW(LPCWSTR pszPath, LPCWSTR pszContentType);
|
|
LWSTDAPI_(BOOL) PathIsURL%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathMakePrettyA(LPSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathMakePrettyW(LPWSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathMatchSpecA(LPCSTR pszFile, LPCSTR pszSpec);
|
|
LWSTDAPI_(BOOL) PathMatchSpecW(LPCWSTR pszFile, LPCWSTR pszSpec);
|
|
LWSTDAPI_(int) PathParseIconLocationA(LPSTR pszIconFile);
|
|
LWSTDAPI_(int) PathParseIconLocationW(LPWSTR pszIconFile);
|
|
LWSTDAPI_(void) PathQuoteSpacesA(LPSTR lpsz);
|
|
LWSTDAPI_(void) PathQuoteSpacesW(LPWSTR lpsz);
|
|
LWSTDAPI_(BOOL) PathRelativePathToA(LPSTR pszPath, LPCSTR pszFrom, DWORD dwAttrFrom, LPCSTR pszTo, DWORD dwAttrTo);
|
|
LWSTDAPI_(BOOL) PathRelativePathToW(LPWSTR pszPath, LPCWSTR pszFrom, DWORD dwAttrFrom, LPCWSTR pszTo, DWORD dwAttrTo);
|
|
LWSTDAPI_(void) PathRemoveArgsA(LPSTR pszPath);
|
|
LWSTDAPI_(void) PathRemoveArgsW(LPWSTR pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathRemoveBackslash%(LPTSTR% pszPath);
|
|
LWSTDAPI_(void) PathRemoveBlanksA(LPSTR pszPath);
|
|
LWSTDAPI_(void) PathRemoveBlanksW(LPWSTR pszPath);
|
|
LWSTDAPI_(void) PathRemoveExtensionA(LPSTR pszPath);
|
|
LWSTDAPI_(void) PathRemoveExtensionW(LPWSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathRemoveFileSpecA(LPSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathRemoveFileSpecW(LPWSTR pszPath);
|
|
LWSTDAPI_(BOOL) PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt);
|
|
LWSTDAPI_(BOOL) PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt);
|
|
LWSTDAPI_(BOOL) PathSearchAndQualifyA(LPCSTR pszPath, LPSTR pszBuf, UINT cchBuf);
|
|
LWSTDAPI_(BOOL) PathSearchAndQualifyW(LPCWSTR pszPath, LPWSTR pszBuf, UINT cchBuf);
|
|
LWSTDAPI_(void) PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath);
|
|
LWSTDAPI_(void) PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath);
|
|
LWSTDAPI_(LPTSTR%) PathSkipRoot%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(void) PathStripPath%(LPTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathStripToRoot%(LPTSTR% pszPath);
|
|
LWSTDAPI_(void) PathUnquoteSpacesA(LPSTR lpsz);
|
|
LWSTDAPI_(void) PathUnquoteSpacesW(LPWSTR lpsz);
|
|
LWSTDAPI_(BOOL) PathMakeSystemFolder%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathUnmakeSystemFolder%(LPCTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathIsSystemFolder%(LPCTSTR% pszPath, DWORD dwAttrb);
|
|
LWSTDAPI_(void) PathUndecorate%(LPTSTR% pszPath);
|
|
LWSTDAPI_(BOOL) PathUnExpandEnvStrings%(LPCTSTR% pszPath, LPTSTR% pszBuf, UINT cchBuf);
|
|
|
|
|
|
;begin_internal
|
|
|
|
#if (_WIN32_IE >= 0x0600)
|
|
|
|
LWSTDAPI SHEvaluateSystemCommandTemplate(PCWSTR pszCmdTemplate, PWSTR *ppszApplication, PWSTR *ppszCommandLine, PWSTR *ppszParameters);
|
|
//
|
|
// SHEvaluateSystemCommandTemplate()
|
|
// * enforces stricter validation before calling CreateProcess(). may also be
|
|
// used before calling ShellExecute().
|
|
// * should be used when caller wants the deterministic behavior from a command template
|
|
// regardless of execution context. it ignores the current process state,
|
|
// such as the %PATH%, GetCurrentDirectory(), and parent process directory.
|
|
// * should be used when the command is hardcoded.
|
|
// * is used by ShellExecute() when handling file associations from HKCR.
|
|
// * reduces CreateProcess() commandline exploits
|
|
// * is not designed for processing user input, and may generate unexpected failures.
|
|
//
|
|
// INPUT:
|
|
// pszCmdTemplate = command line, this may or may not include parameters.
|
|
// if the parameters are substitution parameters then this API
|
|
// should be called before parameters have been replaced.
|
|
// (check the examples below to see sample supported inputs.)
|
|
//
|
|
// OUTPUT on return: S_OK
|
|
// ppszApplication = verified path to the Application. this should be passed as the lpApplication
|
|
// parameter to CreateProcess() or the lpFile parameter to ShellExecute().
|
|
// (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
|
|
//
|
|
// ppszCommandLine = OPTIONAL - use if planning to call CreateProcess().
|
|
// resulting command line template. parameters should be replaced based on this template,
|
|
// and then passed as the lpCommandLine parameter to CreateProcess().
|
|
// it is guaranteed to be of a form that PathGetArgs() will always succeed correctly.
|
|
// (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
|
|
//
|
|
// ppszParameters = OPTIONAL - use if planning to call ShellExecute().
|
|
// resulting parameter list template. parameters should be replaced based on this template,
|
|
// and then passed as the lpParameters parameter to ShellExecute().
|
|
// NOTE: identical to PathGetArgs(*ppszCommandLine).
|
|
// (allocated using CoTaskMemAlloc(), free with CoTaskMemFree())
|
|
//
|
|
// OUTPUT on return: FAILED()
|
|
// all outputs will be NULL'ed on failure
|
|
//
|
|
// NOTES: the parsing logic to determine a valid Application path is non-trivial, although
|
|
// the extension is not required and if missing will be completed
|
|
// in the following standard order: { .PIF, .COM, .EXE, .BAT, .CMD }
|
|
//
|
|
// Relative Paths are System Paths - if the first token has no path qualifiers
|
|
// then the token is first checked to see if a key of the same name has
|
|
// been installed under HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths.
|
|
// if the key or default value does not exist, it is assumed to be a child
|
|
// of the system directories. the following directories will be searched
|
|
// in order for the relative token: { CSIDL_SYSTEM, CSIDL_WINDOWS }
|
|
//
|
|
// Prefer Quoted Paths - if the first token in pszCmdTemplate is quoted and appears
|
|
// to be an absolute path then the token is the only possible result.
|
|
//
|
|
// Limit Forms of Unquoted Paths - if the first token is unquoted and appears
|
|
// to be an absolute path, then it is subject to more stringent limitations.
|
|
// if the token is a substring of CSIDL_PROGRAM_FILES or does not
|
|
// exist on the file system, then SHEvaluateSystemCommandTemplate() will
|
|
// attempt to complete using a token delimited by the first space of the
|
|
// last valid path segment (usually the file name). if this token also doesnt exist,
|
|
// then the next space will be used, etc.
|
|
//
|
|
// USAGE: used before calling into CreateProcess() or ShellExecute(), callers
|
|
// would typically look like the following:
|
|
/* #if 0 // SAMPLE CODE
|
|
HRESULT MyCreateProcessPriv(PCWSTR pszCmd)
|
|
{
|
|
PWSTR pszApp;
|
|
PWSTR pszCmdLine;
|
|
HRESULT hr = SHEvaluateSystemCommandTemplate(pszCmd, &pszApp, &pszCmdLine);
|
|
if (SUCCEEDED(hr))
|
|
{
|
|
// if this was a real template, maybe some kind of wnsprintf() first?
|
|
PROCESS_INFORMATION pi;
|
|
STARTUPINFO si = {0};
|
|
si.cb = sizeof(startup);
|
|
si.wShowWindow = SW_SHOWNORMAL;
|
|
|
|
if (CreateProcess(pszApp, pszCmdLine, NULL, NULL, FALSE,
|
|
CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi))
|
|
{
|
|
// we are good
|
|
ASSERT(hr == S_OK);
|
|
CloseHandle(pi.hProcess);
|
|
CloseHandle(pi.hThread);
|
|
}
|
|
else
|
|
{
|
|
hr = HRESULT_FROM_WIN32(GetLastError());
|
|
}
|
|
|
|
CoTaskMemFree(pszApp);
|
|
CoTaskMemFree(pszCmdLine);
|
|
}
|
|
return hr;
|
|
}
|
|
|
|
HRESULT MyShellExec(PCWSTR pszCmd)
|
|
{
|
|
PWSTR pszApp;
|
|
PWSTR pszCmdLine;
|
|
HRESULT hr = SHEvaluateSystemCommandTemplate(pszCmd, &pszApp, &pszCmdLine);
|
|
if (SUCCEEDED(hr))
|
|
{
|
|
// if this was a real template, maybe some kind of wnsprintf() first?
|
|
SHELLEXECUTEINFOW sei = {
|
|
sizeof(sei), // cbSize;
|
|
0, // fMask
|
|
NULL, // hwnd
|
|
NULL, // lpVerb
|
|
pszApp, // lpFile
|
|
PathGetArgs(pszCmdLine), // lpParameters
|
|
NULL, // lpDirectory
|
|
SW_SHOWNORMAL, // nShow
|
|
0, // hInstApp
|
|
NULL, // lpIDList
|
|
NULL, // lpClass
|
|
NULL, // hkeyClass
|
|
0, // dwHotKey
|
|
NULL, // hIcon
|
|
NULL // hProcess
|
|
};
|
|
|
|
if (ShellExecuteEx(&sei))
|
|
{
|
|
// we are good
|
|
ASSERT(hr == S_OK);
|
|
}
|
|
else
|
|
{
|
|
hr = HRESULT_FROM_WIN32(GetLastError());
|
|
}
|
|
|
|
CoTaskMemFree(pszApp);
|
|
CoTaskMemFree(pszCmdLine);
|
|
}
|
|
return hr;
|
|
}
|
|
#endif // 0 // SAMPLE CODE */
|
|
|
|
// EXAMPLE: Each example will show an input parameter and the results returned by
|
|
// SHEvaluateSystemCommandTemplate(). Also included is the alternate result
|
|
// of what CreateProcess() would have created if pszCmdTemplate were
|
|
// passed directly as lpCommandLine and lpApplication were NULL.
|
|
// (results marked with an asterisk (*) indicate differences.)
|
|
//
|
|
// Assume for the examples that the following paths and values exist:
|
|
//
|
|
// SHGetFolderPath() values:
|
|
// CSIDL_SYSTEM = C:\windows\system32
|
|
// CSIDL_WINDOWS = C:\windows
|
|
// CSIDL_PROGRAM_FILES = C:\Program Files
|
|
//
|
|
// Environment settings
|
|
// GetModuleFileName(NULL) = C:\Program Files\Example\sample.exe
|
|
// GetCurrentDirectory() = \\server\share\foo
|
|
// HKLM\...\App Paths\pbrush.exe = C:\windows\system32\mspaint.exe
|
|
// HKLM\...\App Paths\mycl.exe = C:\Program Files\Compilers\mycl.exe
|
|
// PATH = c:\windows\system32;C:\windows;c:\;C:\Program Files\Compilers\
|
|
//
|
|
// Valid Application paths:
|
|
// C:\Program Files\Internet Explorer\iexplore.exe
|
|
// C:\windows\system32\rundll32.exe
|
|
// C:\windows\system32\notepad.exe
|
|
// C:\windows\notepad.exe
|
|
// C:\Program Files\Example\sample.exe
|
|
// C:\Program Files\Compilers\cl.exe
|
|
// C:\Other Programs\prog.exe
|
|
//
|
|
// Suspicious (possibly hostile) Application paths:
|
|
// C:\Program.exe
|
|
// C:\Program Files\Internet.exe
|
|
// C:\Program Files\Example\regedit.bat
|
|
// C:\mycl.exe
|
|
// \\server\share\foo\rundll32.exe
|
|
// \\server\share\foo\myapp.exe
|
|
//
|
|
//
|
|
// Relative Path Example #1
|
|
// pszCmdTemplate = notepad.exe %1
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\windows\system32\notepad.exe
|
|
// pszCommandLine = "notepad.exe" %1
|
|
// CreateProcess() would return TRUE
|
|
// new process = C:\windows\system32\notepad.exe
|
|
//
|
|
// Relative Path Example #2
|
|
// pszCmdTemplate = rundll32.exe shell32.dll,RunDll
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\windows\system32\rundll32.exe
|
|
// pszCommandLine = "rundll32.exe" shell32.dll,RunDll
|
|
// * CreateProcess() would return TRUE
|
|
// new process = \\server\share\foo\rundll32.exe
|
|
//
|
|
// Relative Path Example #3
|
|
// pszCmdTemplate = regedit %1
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\windows\system32\regedit.exe
|
|
// pszCommandLine = "regedit.exe" %1
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program Files\Example\regedit.bat
|
|
//
|
|
// Relative Path Example #4
|
|
// pszCmdTemplate = pbrush "%1"
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\windows\system32\mspaint.exe
|
|
// pszCommandLine = "mspaint.exe" "%1"
|
|
// * CreateProcess() would return FALSE
|
|
//
|
|
// Relative Path Example #5
|
|
// pszCmdTemplate = mycl "%1" "%2"
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Compilers\mycl.exe
|
|
// pszCommandLine = "mycl.exe" "%1" "%2"
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\mycl.exe
|
|
//
|
|
// Relative Path Example #6
|
|
// pszCmdTemplate = myapp.exe
|
|
// SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
|
|
// * CreateProcess() would return TRUE
|
|
// new process = \\server\share\foo\myapp.exe
|
|
//
|
|
// Quoted Path Example #1
|
|
// pszCmdTemplate = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
|
|
// pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
|
|
// CreateProcess() would return TRUE
|
|
// new process = C:\Program Files\Internet Explorer\iexplore.exe
|
|
//
|
|
// Quoted Path Example #2
|
|
// pszCmdTemplate = "C:\Program Files\Internet" -url
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet.exe
|
|
// pszCommandLine = "C:\Program Files\Internet.exe" -url
|
|
// CreateProcess() would return TRUE
|
|
// new process = C:\Program Files\internet.exe
|
|
//
|
|
// Quoted Path Example #3
|
|
// pszCmdTemplate = "C:\Program" -url
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program.exe
|
|
// pszCommandLine = "C:\Program.exe" -url
|
|
// CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #1
|
|
// pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -nohome
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
|
|
// pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #2
|
|
// pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url fool.htm
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
|
|
// pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -url fool.htm
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #3
|
|
// pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url C:\fool.htm
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet Explorer\iexplore.exe
|
|
// pszCommandLine = "C:\Program Files\Internet Explorer\iexplore.exe" -url C:\fool.htm
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #4
|
|
// pszCmdTemplate = C:\Program Files\Internet -url
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Program Files\Internet.exe
|
|
// pszCommandLine = "C:\Program Files\Internet.exe" -url
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #5
|
|
// pszCmdTemplate = C:\Other Programs\prog.exe -go %1 \fool %2
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Other Programs\prog.exe
|
|
// pszCommandLine = "C:\Other Programs\prog.exe" %1 \fool %2
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Other Programs\prog.exe
|
|
//
|
|
// Unquoted Example #6
|
|
// pszCmdTemplate = C:\Other Programs\prog.exe -go "\fool" "%1"
|
|
// SHEvaluateSystemCommandTemplate() returns: S_OK
|
|
// pszApplication = C:\Other Programs\prog.exe
|
|
// pszCommandLine = "C:\Other Programs\prog.exe" -go "\fool" "%1"
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Other Programs\prog.exe
|
|
//
|
|
// Unquoted Example #7
|
|
// pszCmdTemplate = C:\Program Files\Internet Explorer\iexplore.exe -url \fool.htm
|
|
// SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #8
|
|
// pszCmdTemplate = C:\Program -url
|
|
// SHEvaluateSystemCommandTemplate() returns: E_ACCESSDENIED
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Program.exe
|
|
//
|
|
// Unquoted Example #9
|
|
// pszCmdTemplate = C:\Other Programs\prog.exe -go \fool us
|
|
// SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Other Programs\prog.exe
|
|
//
|
|
// Unquoted Example #10
|
|
// pszCmdTemplate = C:\Other Programs\prog.exe -go \fool %1
|
|
// SHEvaluateSystemCommandTemplate() returns: CO_E_APPNOTFOUND
|
|
// * CreateProcess() would return TRUE
|
|
// new process = C:\Other Programs\prog.exe
|
|
//
|
|
#endif //(_WIN32_IE >= 0x0600)
|
|
|
|
#if (_WIN32_IE >= 0x0501)
|
|
|
|
LWSTDAPI_(BOOL) PathUnExpandEnvStringsForUser%(HANDLE hToken, LPCTSTR% pszPath, LPTSTR% pszBuf, UINT cchBuf);
|
|
LWSTDAPI_(void) PrettifyFileDescription%(LPTSTR pszDesc%, LPCTSTR% pszCutList);
|
|
|
|
#endif // (_WIN32_IE >= 0x0501)
|
|
|
|
|
|
#if defined(WINNT) && (_WIN32_IE >= 0x0550)
|
|
//====== ACL helpers ==================================================
|
|
|
|
//
|
|
// shell struct to identify user/group for each ACE
|
|
//
|
|
typedef struct _SHELL_USER_SID
|
|
{
|
|
SID_IDENTIFIER_AUTHORITY sidAuthority;
|
|
DWORD dwUserGroupID;
|
|
DWORD dwUserID;
|
|
} SHELL_USER_SID, *PSHELL_USER_SID;
|
|
|
|
//
|
|
// common SHELL_USER_SID's
|
|
//
|
|
// NOTE: you need to link to stocklib.lib to resolve these
|
|
//
|
|
extern const SHELL_USER_SID susCurrentUser; // the current user
|
|
extern const SHELL_USER_SID susSystem; // the "SYSTEM" group
|
|
extern const SHELL_USER_SID susAdministrators; // the "Administrators" group
|
|
extern const SHELL_USER_SID susPowerUsers; // the "Power Users" group
|
|
extern const SHELL_USER_SID susGuests; // the "Guests" group
|
|
extern const SHELL_USER_SID susEveryone; // the "Everyone" group
|
|
|
|
//
|
|
// shell struct that is passed to GetShellSecurityDescriptor()
|
|
//
|
|
typedef struct _SHELL_USER_PERMISSION
|
|
{
|
|
SHELL_USER_SID susID; // identifies the user for whom you want to grant permissions to
|
|
DWORD dwAccessType; // this is either ACCESS_ALLOWED_ACE_TYPE or ACCESS_DENIED_ACE_TYPE
|
|
BOOL fInherit; // the permissions inheritable? (eg a directory or reg key and you want new children to inherit this permission)
|
|
DWORD dwAccessMask; // access granted (eg FILE_LIST_CONTENTS, KEY_ALL_ACCESS, etc...)
|
|
DWORD dwInheritMask; // mask used for inheritance, usually (OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE | INHERIT_ONLY_ACE)
|
|
DWORD dwInheritAccessMask; // the inheritable access granted (eg GENERIC_ALL)
|
|
} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION;
|
|
|
|
|
|
//
|
|
// The GetShellSecurityDescriptor API takes an array of PSHELL_USER_PERMISSION's
|
|
// and returns a PSECURITY_DESCRIPTOR based on those permission (an ACL is
|
|
// contained in the PSECURITY_DESCRIPTOR).
|
|
//
|
|
// NOTE: The PSECURITY_DESCRIPTOR returned to the caller must be freed with LocalFree()
|
|
// if it is non-null.
|
|
//
|
|
//
|
|
// Parameters:
|
|
// apUserPerm - Array of shell_user_permission structs that defines what type
|
|
// of access various users are allowed
|
|
//
|
|
// cUserPerm - count of elements in apUserPerm.
|
|
//
|
|
// Returns:
|
|
// SECURITY_DESCRIPTOR* or NULL if failed.
|
|
//
|
|
LWSTDAPI_(SECURITY_DESCRIPTOR*) GetShellSecurityDescriptor(PSHELL_USER_PERMISSION* apUserPerm, int cUserPerm);
|
|
#endif // defined(WINNT) && (_WIN32_IE >= 0x0550)
|
|
|
|
;end_internal
|
|
|
|
#ifdef UNICODE
|
|
#define PathAppend PathAppendW
|
|
#define PathCanonicalize PathCanonicalizeW
|
|
#define PathCompactPath PathCompactPathW
|
|
#define PathCompactPathEx PathCompactPathExW
|
|
#define PathCommonPrefix PathCommonPrefixW
|
|
#define PathFindOnPath PathFindOnPathW
|
|
#define PathGetCharType PathGetCharTypeW
|
|
#define PathIsContentType PathIsContentTypeW
|
|
#define PathIsHTMLFile PathIsHTMLFileW
|
|
#define PathMakePretty PathMakePrettyW
|
|
#define PathMatchSpec PathMatchSpecW
|
|
#define PathParseIconLocation PathParseIconLocationW
|
|
#define PathQuoteSpaces PathQuoteSpacesW
|
|
#define PathRelativePathTo PathRelativePathToW
|
|
#define PathRemoveArgs PathRemoveArgsW
|
|
#define PathRemoveBlanks PathRemoveBlanksW
|
|
#define PathRemoveExtension PathRemoveExtensionW
|
|
#define PathRemoveFileSpec PathRemoveFileSpecW
|
|
#define PathRenameExtension PathRenameExtensionW
|
|
#define PathSearchAndQualify PathSearchAndQualifyW
|
|
#define PathSetDlgItemPath PathSetDlgItemPathW
|
|
#define PathUnquoteSpaces PathUnquoteSpacesW
|
|
#else
|
|
#define PathAppend PathAppendA
|
|
#define PathCanonicalize PathCanonicalizeA
|
|
#define PathCompactPath PathCompactPathA
|
|
#define PathCompactPathEx PathCompactPathExA
|
|
#define PathCommonPrefix PathCommonPrefixA
|
|
#define PathFindOnPath PathFindOnPathA
|
|
#define PathGetCharType PathGetCharTypeA
|
|
#define PathIsContentType PathIsContentTypeA
|
|
#define PathIsHTMLFile PathIsHTMLFileA
|
|
#define PathMakePretty PathMakePrettyA
|
|
#define PathMatchSpec PathMatchSpecA
|
|
#define PathParseIconLocation PathParseIconLocationA
|
|
#define PathQuoteSpaces PathQuoteSpacesA
|
|
#define PathRelativePathTo PathRelativePathToA
|
|
#define PathRemoveArgs PathRemoveArgsA
|
|
#define PathRemoveBlanks PathRemoveBlanksA
|
|
#define PathRemoveExtension PathRemoveExtensionA
|
|
#define PathRemoveFileSpec PathRemoveFileSpecA
|
|
#define PathRenameExtension PathRenameExtensionA
|
|
#define PathSearchAndQualify PathSearchAndQualifyA
|
|
#define PathSetDlgItemPath PathSetDlgItemPathA
|
|
#define PathUnquoteSpaces PathUnquoteSpacesA
|
|
#endif
|
|
|
|
typedef enum {
|
|
URL_SCHEME_INVALID = -1,
|
|
URL_SCHEME_UNKNOWN = 0,
|
|
URL_SCHEME_FTP,
|
|
URL_SCHEME_HTTP,
|
|
URL_SCHEME_GOPHER,
|
|
URL_SCHEME_MAILTO,
|
|
URL_SCHEME_NEWS,
|
|
URL_SCHEME_NNTP,
|
|
URL_SCHEME_TELNET,
|
|
URL_SCHEME_WAIS,
|
|
URL_SCHEME_FILE,
|
|
URL_SCHEME_MK,
|
|
URL_SCHEME_HTTPS,
|
|
URL_SCHEME_SHELL,
|
|
URL_SCHEME_SNEWS,
|
|
URL_SCHEME_LOCAL,
|
|
URL_SCHEME_JAVASCRIPT,
|
|
URL_SCHEME_VBSCRIPT,
|
|
URL_SCHEME_ABOUT,
|
|
URL_SCHEME_RES,
|
|
URL_SCHEME_MSSHELLROOTED,
|
|
URL_SCHEME_MSSHELLIDLIST,
|
|
URL_SCHEME_MSHELP,
|
|
URL_SCHEME_MAXVALUE
|
|
} URL_SCHEME;
|
|
|
|
typedef enum {
|
|
URL_PART_NONE = 0,
|
|
URL_PART_SCHEME = 1,
|
|
URL_PART_HOSTNAME,
|
|
URL_PART_USERNAME,
|
|
URL_PART_PASSWORD,
|
|
URL_PART_PORT,
|
|
URL_PART_QUERY,
|
|
} URL_PART;
|
|
|
|
typedef enum {
|
|
URLIS_URL,
|
|
URLIS_OPAQUE,
|
|
URLIS_NOHISTORY,
|
|
URLIS_FILEURL,
|
|
URLIS_APPLIABLE,
|
|
URLIS_DIRECTORY,
|
|
URLIS_HASQUERY,
|
|
} URLIS;
|
|
|
|
#define URL_UNESCAPE 0x10000000
|
|
#define URL_ESCAPE_UNSAFE 0x20000000
|
|
#define URL_PLUGGABLE_PROTOCOL 0x40000000
|
|
#define URL_WININET_COMPATIBILITY 0x80000000
|
|
#define URL_DONT_ESCAPE_EXTRA_INFO 0x02000000
|
|
#define URL_DONT_UNESCAPE_EXTRA_INFO URL_DONT_ESCAPE_EXTRA_INFO
|
|
#define URL_BROWSER_MODE URL_DONT_ESCAPE_EXTRA_INFO
|
|
#define URL_ESCAPE_SPACES_ONLY 0x04000000
|
|
#define URL_DONT_SIMPLIFY 0x08000000
|
|
#define URL_NO_META URL_DONT_SIMPLIFY
|
|
#define URL_UNESCAPE_INPLACE 0x00100000
|
|
#define URL_CONVERT_IF_DOSPATH 0x00200000
|
|
#define URL_UNESCAPE_HIGH_ANSI_ONLY 0x00400000
|
|
#define URL_INTERNAL_PATH 0x00800000 // Will escape #'s in paths
|
|
#define URL_FILE_USE_PATHURL 0x00010000
|
|
#define URL_ESCAPE_PERCENT 0x00001000
|
|
#define URL_ESCAPE_SEGMENT_ONLY 0x00002000 // Treat the entire URL param as one URL segment.
|
|
|
|
#define URL_PARTFLAG_KEEPSCHEME 0x00000001
|
|
|
|
#define URL_APPLY_DEFAULT 0x00000001
|
|
#define URL_APPLY_GUESSSCHEME 0x00000002
|
|
#define URL_APPLY_GUESSFILE 0x00000004
|
|
#define URL_APPLY_FORCEAPPLY 0x00000008
|
|
|
|
|
|
LWSTDAPI_(int) UrlCompareA(LPCSTR psz1, LPCSTR psz2, BOOL fIgnoreSlash);
|
|
LWSTDAPI_(int) UrlCompareW(LPCWSTR psz1, LPCWSTR psz2, BOOL fIgnoreSlash);
|
|
LWSTDAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative, LPSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
|
|
LWSTDAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, LPWSTR pszCombined, LPDWORD pcchCombined, DWORD dwFlags);
|
|
LWSTDAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
|
|
LWSTDAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags);
|
|
LWSTDAPI_(BOOL) UrlIsOpaqueA(LPCSTR pszURL);
|
|
LWSTDAPI_(BOOL) UrlIsOpaqueW(LPCWSTR pszURL);
|
|
LWSTDAPI_(BOOL) UrlIsNoHistoryA(LPCSTR pszURL);
|
|
LWSTDAPI_(BOOL) UrlIsNoHistoryW(LPCWSTR pszURL);
|
|
#define UrlIsFileUrlA(pszURL) UrlIsA(pszURL, URLIS_FILEURL)
|
|
#define UrlIsFileUrlW(pszURL) UrlIsW(pszURL, URLIS_FILEURL)
|
|
LWSTDAPI_(BOOL) UrlIsA(LPCSTR pszUrl, URLIS UrlIs);
|
|
LWSTDAPI_(BOOL) UrlIsW(LPCWSTR pszUrl, URLIS UrlIs);
|
|
LWSTDAPI_(LPCSTR) UrlGetLocationA(LPCSTR psz1);
|
|
LWSTDAPI_(LPCWSTR) UrlGetLocationW(LPCWSTR psz1);
|
|
LWSTDAPI UrlUnescapeA(LPSTR pszUrl, LPSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
|
|
LWSTDAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags);
|
|
LWSTDAPI UrlEscapeA(LPCSTR pszUrl, LPSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
|
|
LWSTDAPI UrlEscapeW(LPCWSTR pszUrl, LPWSTR pszEscaped, LPDWORD pcchEscaped, DWORD dwFlags);
|
|
LWSTDAPI UrlCreateFromPathA(LPCSTR pszPath, LPSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
|
|
LWSTDAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl, DWORD dwFlags);
|
|
LWSTDAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
|
|
LWSTDAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwFlags);
|
|
LWSTDAPI UrlHashA(LPCSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
|
|
LWSTDAPI UrlHashW(LPCWSTR pszUrl, LPBYTE pbHash, DWORD cbHash);
|
|
LWSTDAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
|
|
LWSTDAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags);
|
|
LWSTDAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
|
|
LWSTDAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwFlags);
|
|
LWSTDAPI HashData(LPBYTE pbData, DWORD cbData, LPBYTE pbHash, DWORD cbHash);
|
|
|
|
|
|
;begin_internal
|
|
LWSTDAPI UrlFixupW(LPCWSTR pszIn, LPWSTR pszOut, DWORD cchOut);
|
|
|
|
// NTRAID:108139 akabir We need to move the components stuff from wininet.h to shlwapi.
|
|
|
|
typedef WORD SHINTERNET_PORT;
|
|
typedef SHINTERNET_PORT * LPSHINTERNET_PORT;
|
|
|
|
//
|
|
// SHINTERNET_SCHEME - enumerated URL scheme type
|
|
//
|
|
|
|
typedef enum {
|
|
SHINTERNET_SCHEME_PARTIAL = -2,
|
|
SHINTERNET_SCHEME_UNKNOWN = -1,
|
|
SHINTERNET_SCHEME_DEFAULT = 0,
|
|
SHINTERNET_SCHEME_FTP,
|
|
SHINTERNET_SCHEME_GOPHER,
|
|
SHINTERNET_SCHEME_HTTP,
|
|
SHINTERNET_SCHEME_HTTPS,
|
|
SHINTERNET_SCHEME_FILE,
|
|
SHINTERNET_SCHEME_NEWS,
|
|
SHINTERNET_SCHEME_MAILTO,
|
|
SHINTERNET_SCHEME_SOCKS,
|
|
SHINTERNET_SCHEME_JAVASCRIPT,
|
|
SHINTERNET_SCHEME_VBSCRIPT,
|
|
SHINTERNET_SCHEME_RES,
|
|
SHINTERNET_SCHEME_FIRST = SHINTERNET_SCHEME_FTP,
|
|
SHINTERNET_SCHEME_LAST = SHINTERNET_SCHEME_RES
|
|
} SHINTERNET_SCHEME, * LPSHINTERNET_SCHEME;
|
|
|
|
//
|
|
// SHURL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl()
|
|
// and InternetCreateUrl()
|
|
//
|
|
// For InternetCrackUrl(), if a pointer field and its corresponding length field
|
|
// are both 0 then that component is not returned. If the pointer field is NULL
|
|
// but the length field is not zero, then both the pointer and length fields are
|
|
// returned if both pointer and corresponding length fields are non-zero then
|
|
// the pointer field points to a buffer where the component is copied. The
|
|
// component may be un-escaped, depending on dwFlags
|
|
//
|
|
// For InternetCreateUrl(), the pointer fields should be NULL if the component
|
|
// is not required. If the corresponding length field is zero then the pointer
|
|
// field is the address of a zero-terminated string. If the length field is not
|
|
// zero then it is the string length of the corresponding pointer field
|
|
//
|
|
|
|
#pragma warning( disable : 4121 ) // disable alignment warning
|
|
|
|
typedef struct {
|
|
DWORD dwStructSize; // size of this structure. Used in version check
|
|
LPTSTR% lpszScheme; // pointer to scheme name
|
|
DWORD dwSchemeLength; // length of scheme name
|
|
SHINTERNET_SCHEME nScheme; // enumerated scheme type (if known)
|
|
LPTSTR% lpszHostName; // pointer to host name
|
|
DWORD dwHostNameLength; // length of host name
|
|
SHINTERNET_PORT nPort; // converted port number
|
|
LPTSTR% lpszUserName; // pointer to user name
|
|
DWORD dwUserNameLength; // length of user name
|
|
LPTSTR% lpszPassword; // pointer to password
|
|
DWORD dwPasswordLength; // length of password
|
|
LPTSTR% lpszUrlPath; // pointer to URL-path
|
|
DWORD dwUrlPathLength; // length of URL-path
|
|
LPTSTR% lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
|
|
DWORD dwExtraInfoLength; // length of extra information
|
|
} SHURL_COMPONENTS%, * LPSHURL_COMPONENTS%;
|
|
|
|
|
|
BOOL WINAPI UrlCrackW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, LPSHURL_COMPONENTSW lpUrlComponents);
|
|
|
|
;end_internal
|
|
|
|
#ifdef UNICODE
|
|
#define UrlCompare UrlCompareW
|
|
#define UrlCombine UrlCombineW
|
|
#define UrlCanonicalize UrlCanonicalizeW
|
|
#define UrlIsOpaque UrlIsOpaqueW
|
|
#define UrlIsFileUrl UrlIsFileUrlW
|
|
#define UrlGetLocation UrlGetLocationW
|
|
#define UrlUnescape UrlUnescapeW
|
|
#define UrlEscape UrlEscapeW
|
|
#define UrlCreateFromPath UrlCreateFromPathW
|
|
#define PathCreateFromUrl PathCreateFromUrlW
|
|
#define UrlHash UrlHashW
|
|
#define UrlGetPart UrlGetPartW
|
|
#define UrlApplyScheme UrlApplySchemeW
|
|
#define UrlIs UrlIsW
|
|
|
|
;begin_internal
|
|
#define UrlFixup UrlFixupW
|
|
;end_internal
|
|
|
|
#else //!UNICODE
|
|
#define UrlCompare UrlCompareA
|
|
#define UrlCombine UrlCombineA
|
|
#define UrlCanonicalize UrlCanonicalizeA
|
|
#define UrlIsOpaque UrlIsOpaqueA
|
|
#define UrlIsFileUrl UrlIsFileUrlA
|
|
#define UrlGetLocation UrlGetLocationA
|
|
#define UrlUnescape UrlUnescapeA
|
|
#define UrlEscape UrlEscapeA
|
|
#define UrlCreateFromPath UrlCreateFromPathA
|
|
#define PathCreateFromUrl PathCreateFromUrlA
|
|
#define UrlHash UrlHashA
|
|
#define UrlGetPart UrlGetPartA
|
|
#define UrlApplyScheme UrlApplySchemeA
|
|
#define UrlIs UrlIsA
|
|
|
|
;begin_internal
|
|
// no UrlFixupA
|
|
;end_internal
|
|
|
|
#endif //UNICODE
|
|
|
|
#define UrlEscapeSpaces(pszUrl, pszEscaped, pcchEscaped) UrlCanonicalize(pszUrl, pszEscaped, pcchEscaped, URL_ESCAPE_SPACES_ONLY |URL_DONT_ESCAPE_EXTRA_INFO )
|
|
#define UrlUnescapeInPlace(pszUrl, dwFlags) UrlUnescape(pszUrl, NULL, NULL, dwFlags | URL_UNESCAPE_INPLACE)
|
|
|
|
;begin_internal
|
|
//
|
|
// Internal APIs which we're not yet sure whether to make public
|
|
//
|
|
|
|
// Private IHlinkFrame::Navigate flags related to history
|
|
// This navigate should not go in the History ShellFolder
|
|
#define SHHLNF_WRITENOHISTORY 0x08000000
|
|
// This navigate should not automatically select History ShellFolder
|
|
#define SHHLNF_NOAUTOSELECT 0x04000000
|
|
|
|
// The order of these flags is important. See the source before
|
|
// changing these.
|
|
|
|
#define PFOPEX_NONE 0x00000000
|
|
#define PFOPEX_PIF 0x00000001
|
|
#define PFOPEX_COM 0x00000002
|
|
#define PFOPEX_EXE 0x00000004
|
|
#define PFOPEX_BAT 0x00000008
|
|
#define PFOPEX_LNK 0x00000010
|
|
#define PFOPEX_CMD 0x00000020
|
|
#define PFOPEX_OPTIONAL 0x00000040 // Search only if Extension not present
|
|
#define PFOPEX_DEFAULT (PFOPEX_CMD | PFOPEX_COM | PFOPEX_BAT | PFOPEX_PIF | PFOPEX_EXE | PFOPEX_LNK)
|
|
|
|
LWSTDAPI_(BOOL) PathFileExistsDefExt%(LPTSTR% pszPath, UINT uFlags);
|
|
LWSTDAPI_(BOOL) PathFindOnPathEx%(LPTSTR% pszPath, LPCTSTR% * ppszOtherDirs, UINT uFlags);
|
|
LWSTDAPI_(LPCTSTR%) PathSkipLeadingSlashes%(LPCTSTR% pszURL);
|
|
|
|
LWSTDAPI_(UINT) SHGetSystemWindowsDirectory%(LPTSTR% lpBuffer, UINT uSize);
|
|
|
|
|
|
#if (_WIN32_IE >= 0x0501)
|
|
//
|
|
// These are functions that used to be duplicated in shell32, but have
|
|
// be consolidated here. They are exported privately until someone decides
|
|
// we really want to document them.
|
|
//
|
|
LWSTDAPI_(BOOL) PathFileExistsAndAttributes%(LPCTSTR% pszPath, OPTIONAL DWORD* pdwAttributes);
|
|
LWSTDAPI_(BOOL) PathFileExistsDefExtAndAttributes%(LPTSTR% pszPath, UINT uFlags, DWORD *pdwAttribs);
|
|
LWSTDAPI_(void) FixSlashesAndColon%(LPTSTR% pszPath);
|
|
LWSTDAPI_(LPCTSTR%) NextPath%(LPCTSTR% lpPath, LPTSTR% szPath, int cchPath);
|
|
LWSTDAPI_(LPTSTR%) CharUpperNoDBCS%(LPTSTR% psz);
|
|
LWSTDAPI_(LPTSTR%) CharLowerNoDBCS%(LPTSTR% psz);
|
|
|
|
|
|
//
|
|
// flags for PathIsValidChar()
|
|
//
|
|
#define PIVC_ALLOW_QUESTIONMARK 0x00000001 // treat '?' as valid
|
|
#define PIVC_ALLOW_STAR 0x00000002 // treat '*' as valid
|
|
#define PIVC_ALLOW_DOT 0x00000004 // treat '.' as valid
|
|
#define PIVC_ALLOW_SLASH 0x00000008 // treat '\\' as valid
|
|
#define PIVC_ALLOW_COLON 0x00000010 // treat ':' as valid
|
|
#define PIVC_ALLOW_SEMICOLON 0x00000020 // treat ';' as valid
|
|
#define PIVC_ALLOW_COMMA 0x00000040 // treat ',' as valid
|
|
#define PIVC_ALLOW_SPACE 0x00000080 // treat ' ' as valid
|
|
#define PIVC_ALLOW_NONALPAHABETIC 0x00000100 // treat non-alphabetic exteneded chars as valid
|
|
#define PIVC_ALLOW_QUOTE 0x00000200 // treat '"' as valid
|
|
|
|
//
|
|
// standard masks for PathIsValidChar()
|
|
//
|
|
#define PIVC_SFN_NAME (PIVC_ALLOW_DOT | PIVC_ALLOW_NONALPAHABETIC)
|
|
#define PIVC_SFN_FULLPATH (PIVC_SFN_NAME | PIVC_ALLOW_COLON | PIVC_ALLOW_SLASH)
|
|
#define PIVC_LFN_NAME (PIVC_ALLOW_DOT | PIVC_ALLOW_NONALPAHABETIC | PIVC_ALLOW_SEMICOLON | PIVC_ALLOW_COMMA | PIVC_ALLOW_SPACE)
|
|
#define PIVC_LFN_FULLPATH (PIVC_LFN_NAME | PIVC_ALLOW_COLON | PIVC_ALLOW_SLASH)
|
|
#define PIVC_SFN_FILESPEC (PIVC_SFN_FULLPATH | PIVC_ALLOW_STAR | PIVC_ALLOW_QUESTIONMARK)
|
|
#define PIVC_LFN_FILESPEC (PIVC_LFN_FULLPATH | PIVC_ALLOW_STAR | PIVC_ALLOW_QUESTIONMARK)
|
|
|
|
LWSTDAPI_(BOOL) PathIsValidCharA(UCHAR ch, DWORD dwFlags);
|
|
LWSTDAPI_(BOOL) PathIsValidCharW(WCHAR ch, DWORD dwFlags);
|
|
#ifdef UNICODE
|
|
#define PathIsValidChar PathIsValidCharW
|
|
#else
|
|
#define PathIsValidChar PathIsValidCharA
|
|
#endif // !UNICODE
|
|
|
|
#endif // (_WIN32_IE >= 0x0501)
|
|
|
|
|
|
// parsed URL information returned by ParseURL()
|
|
//
|
|
// Internet_CrackURL is the correct function for external components
|
|
// to use. URL.DLL calls this function to do some work and the shell
|
|
// uses this function as a leight-weight parsing function as well.
|
|
|
|
typedef struct tagPARSEDURL% {
|
|
DWORD cbSize;
|
|
// Pointers into the buffer that was provided to ParseURL
|
|
LPCTSTR% pszProtocol;
|
|
UINT cchProtocol;
|
|
LPCTSTR% pszSuffix;
|
|
UINT cchSuffix;
|
|
UINT nScheme; // One of URL_SCHEME_*
|
|
} PARSEDURL%, * PPARSEDURL%;
|
|
|
|
LWSTDAPI ParseURL%(LPCTSTR% pcszURL, PARSEDURL% * ppu);
|
|
|
|
|
|
;end_internal
|
|
|
|
;begin_both
|
|
|
|
#endif // NO_SHLWAPI_PATH
|
|
|
|
;end_both
|
|
|
|
;begin_both
|
|
|
|
#ifndef NO_SHLWAPI_REG
|
|
//
|
|
//=============== Registry Routines ===================================
|
|
//
|
|
|
|
;end_both
|
|
|
|
|
|
// SHDeleteEmptyKey mimics RegDeleteKey as it behaves on NT.
|
|
// SHDeleteKey mimics RegDeleteKey as it behaves on Win95.
|
|
|
|
LWSTDAPI_(DWORD) SHDeleteEmptyKey%(HKEY hkey, LPCTSTR% pszSubKey);
|
|
LWSTDAPI_(DWORD) SHDeleteKey%(HKEY hkey, LPCTSTR% pszSubKey);
|
|
LWSTDAPI_(HKEY) SHRegDuplicateHKey(HKEY hkey);
|
|
|
|
;begin_internal
|
|
// SHDeleteOrphanKey is the old name for SHDeleteEmptyKey.
|
|
// SHDeleteOrphanKey already maps to SHDeleteEmptyKey in the DLL exports.
|
|
|
|
LWSTDAPI_(DWORD) SHDeleteOrphanKey%(HKEY hkey, LPCTSTR% pszSubKey);
|
|
;end_internal
|
|
|
|
// These functions open the key, get/set/delete the value, then close
|
|
// the key.
|
|
|
|
LWSTDAPI_(DWORD) SHDeleteValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue);
|
|
LWSTDAPI_(DWORD) SHGetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
|
|
LWSTDAPI_(DWORD) SHSetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
|
|
|
|
|
|
//
|
|
// SRRF - Shell Registry Routine Flags (for SHRegGetValue)
|
|
//
|
|
|
|
typedef DWORD SRRF;
|
|
|
|
#define SRRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_EXPAND_SZ 0x00000004 // restrict type to REG_EXPAND_SZ (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_BINARY 0x00000008 // restrict type to REG_BINARY (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_DWORD 0x00000010 // restrict type to REG_DWORD (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_MULTI_SZ 0x00000020 // restrict type to REG_MULTI_SZ (other data types will not return ERROR_SUCCESS)
|
|
#define SRRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (other data types will not return ERROR_SUCCESS)
|
|
|
|
#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)
|
|
#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)
|
|
#define SRRF_RT_ANY 0x0000ffff // no type restriction
|
|
|
|
#define SRRF_RM_ANY 0x00000000 // no mode restriction (default is to allow any mode)
|
|
#define SRRF_RM_NORMAL 0x00010000 // restrict system startup mode to "normal boot" (other startup modes will not return ERROR_SUCCESS)
|
|
#define SRRF_RM_SAFE 0x00020000 // restrict system startup mode to "safe mode" (other startup modes will not return ERROR_SUCCESS)
|
|
#define SRRF_RM_SAFENETWORK 0x00040000 // restrict system startup mode to "safe mode with networking" (other startup modes will not return ERROR_SUCCESS)
|
|
|
|
#define SRRF_NOEXPAND 0x10000000 // do not automatically expand environment strings if value is of type REG_EXPAND_SZ
|
|
#define SRRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure
|
|
|
|
|
|
// Function:
|
|
//
|
|
// SHRegGetValue()
|
|
//
|
|
// Purpose:
|
|
//
|
|
// Gets a registry value. SHRegGetValue() provides the following benefits:
|
|
//
|
|
// - data type checking
|
|
// - boot mode checking
|
|
// - auto-expansion of REG_EXPAND_SZ data
|
|
// - guaranteed NULL termination of REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ data
|
|
//
|
|
;begin_internal
|
|
// This is the single, one stop shop for all your 'get registry data' needs.
|
|
// If this function doesn't do what you're looking for now, ask yourself if
|
|
// it can be enhanced in a simple way to do it before you go adding yet
|
|
// another API.
|
|
//
|
|
;end_internal
|
|
// Parameters:
|
|
//
|
|
// hkey - handle to a currently open key.
|
|
//
|
|
// pszSubKey - pointer to a null-terminated string specifying the relative
|
|
// path from hkey to one of its subkeys from which the data is
|
|
// to be retrieved. this will be opened with KEY_READ sam.
|
|
//
|
|
// Note1: pszSubKey can be NULL or "". In either of these two
|
|
// cases, the data is retrieved from the hkey itself.
|
|
// Note2: *** PERF ***
|
|
// If pszSubKey is not NULL or "", the subkey will be
|
|
// automatically be opened and closed by this routine
|
|
// in order to obtain the data. If you are retrieving
|
|
// multiple values from the same subkey, it is better
|
|
// for perf to open the subkey via RegOpenKeyEx() prior
|
|
// to calling this method, and using this opened key as
|
|
// hkey with pszSubKey set to NULL.
|
|
//
|
|
// pszValue - pointer to a null-terminated string specifying the name of
|
|
// the value to query for data
|
|
//
|
|
// Note1: pszValue can be NULL or "". In either of these two
|
|
// cases, the data is retrieved from the unnamed or
|
|
// default value.
|
|
//
|
|
// dwFlags - bitwise or of SRRF_ flags, which cannot be 0: at least one
|
|
// type restriction must be specified (SRRF_RT_...), or if any
|
|
// type is desired then SRRF_RT_ANY can be specified
|
|
//
|
|
// Note1: SRRF_RT_ANY will allow any data type to be returned.
|
|
// Note2: The following two type restrictions have special
|
|
// handling semantics:
|
|
//
|
|
// SRRF_RT_DWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_DWORD
|
|
// SRRF_RT_QWORD == SRRF_RT_REG_BINARY | SRRF_RT_REG_QWORD
|
|
//
|
|
// If either of these are specified, with no other type
|
|
// restrictions, then in the prior case the restriction
|
|
// will limit "valid" returned data to either REG_DWORD
|
|
// or 32-bit REG_BINARY data, and in the latter case
|
|
// the restriction will limit "valid" returned data to
|
|
// either REG_QWORD or 64-bit REG_BINARY.
|
|
//
|
|
// pdwType - pointer to a dword which receives a code indicating the
|
|
// type of data stored in the specified value
|
|
//
|
|
// Note1: pdwType can be NULL if no type information is wanted
|
|
// Note2: If pdwType is not NULL, and the SRRF_NOEXPAND flag
|
|
// has not been set, data types of REG_EXPAND_SZ will
|
|
// be returned as REG_SZ since they are automatically
|
|
// expanded in this method.
|
|
//
|
|
// pvData - pointer to a buffer that receives the value's data
|
|
//
|
|
// Note1: pvData can be NULL if the data is not required.
|
|
// pvData is usually NULL if doing either a simple
|
|
// existence test, or if interested in the size only.
|
|
// Note2: *** PERF ***
|
|
// Reference 'perf' note for pcbData.
|
|
//
|
|
// pcbData - when pvData is NULL:
|
|
// optional pointer to a dword that receives a size in bytes
|
|
// which would be sufficient to hold the registry data (note
|
|
// this size is not guaranteed to be exact, merely sufficient)
|
|
// when pvData is not NULL:
|
|
// required pointer to a dword that specifies the size in
|
|
// bytes of the buffer pointed to by the pvData parameter
|
|
// and receives a size in bytes of:
|
|
// a) the number of bytes read into pvData on ERROR_SUCCESS
|
|
// (note this size is guaranteed to be exact)
|
|
// b) the number of bytes which would be sufficient to hold
|
|
// the registry data on ERROR_MORE_DATA -- pvData was of
|
|
// insufficient size (note this size is not guaranteed to
|
|
// be exact, merely sufficient)
|
|
//
|
|
// Note1: pcbData can be NULL only if pvData is NULL.
|
|
// Note2: *** PERF ***
|
|
// The potential for an 'extra' call to the registry to
|
|
// read (or re-read) in the data exists when the data
|
|
// type is REG_EXPAND_SZ and the SRRF_NOEXPAND flag has
|
|
// not been set. The following conditions will result
|
|
// in this 'extra' read operation:
|
|
// i) when pvData is NULL and pcbData is not NULL
|
|
// we must read in the data from the registry
|
|
// anyway in order to obtain the string and perform
|
|
// an expand on it to obtain and return the total
|
|
// required size in pcbData
|
|
// ii) when pvData is not NULL but is of insufficient
|
|
// size we must re-read in the data from the
|
|
// registry in order to obtain the entire string
|
|
// and perform an expand on it to obtain and return
|
|
// the total required size in pcbData
|
|
//
|
|
// Remarks:
|
|
//
|
|
// The key identified by hkey must have been opened with KEY_QUERY_VALUE
|
|
// access. If pszSubKey is not NULL or "", it must be able to be opened
|
|
// with KEY_QUERY_VALUE access in the current calling context.
|
|
//
|
|
// If the data type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then any
|
|
// returned data is guaranteed to take into account proper null termination.
|
|
// For example: if pcbData is not NULL, its returned size will include the
|
|
// bytes for a null terminator if pvData is not NULL, its returned data
|
|
// will be properly null terminated.
|
|
//
|
|
// If the data type is REG_EXPAND_SZ, then unless the SRRF_NOEXPAND flag
|
|
// is set the data will be automatically expanded prior to being returned.
|
|
// For example: if pdwType is not NULL, its returned type will be changed
|
|
// to REG_SZ, if pcbData is not NULL, its returned size will include the
|
|
// bytes for a properly expanded string. if pvData is not NULL, its
|
|
// returned data will be the expanded version of the string.
|
|
//
|
|
// Reference MSDN documentation for RegQueryValueEx() for more information
|
|
// of the behaviour when pdwType, pvData, and/or pcbData are equal to NULL.
|
|
//
|
|
// Return Values:
|
|
//
|
|
// If the function succeeds, the return value is ERROR_SUCCESS and all out
|
|
// parameters requested (pdwType, pvData, pcbData) are valid.
|
|
//
|
|
// If the function fails due to insufficient space in a provided non-NULL
|
|
// pvData, the return value is ERROR_MORE_DATA and only pdwType and pcbData
|
|
// can contain valid data. The content of pvData in this case is undefined.
|
|
//
|
|
// Examples:
|
|
//
|
|
// 1) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data from the (default) value of an open hkey
|
|
//
|
|
// TCHAR szData[128]
|
|
// DWORD cbData = sizeof(pszData)
|
|
// if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, NULL, SRRF_RT_REG_SZ, NULL, szData, &cbData))
|
|
// {
|
|
// // use sz (successful read)
|
|
// }
|
|
//
|
|
// 2) read REG_SZ (or REG_EXPAND_SZ as REG_SZ) "string" data of unknown size from the "MyValue" value of an open hkey
|
|
//
|
|
// DWORD cbData
|
|
// if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, NULL, &cbData))
|
|
// {
|
|
// TCHAR *pszData = new TCHAR[cbData/sizeof(TCHAR)]
|
|
// if (pszData)
|
|
// {
|
|
// if (ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_REG_SZ, NULL, pszData, &cbData))
|
|
// {
|
|
// // use pszData (successful read)
|
|
// }
|
|
// delete[] pszData
|
|
// }
|
|
// }
|
|
//
|
|
// 3) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey
|
|
//
|
|
// DWORD dwData
|
|
// DWORD cbData = sizeof(dwData)
|
|
// if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_REG_DWORD, NULL, &dwData, &cbData))
|
|
// {
|
|
// // use dwData (successful read)
|
|
// }
|
|
//
|
|
// 4) read "dword" data from the "MyValue" value of the "MySubKey" subkey of an open hkey (32-bit binary data also ok)
|
|
//
|
|
// DWORD dwData
|
|
// DWORD cbData = sizeof(dwData)
|
|
// if (ERROR_SUCCESS == SHRegGetValue(hkey, TEXT("MySubKey"), TEXT("MyValue"), SRRF_RT_DWORD, NULL, &dwData, &cbData))
|
|
// {
|
|
// // use dwData (successful read)
|
|
// }
|
|
//
|
|
// 5) determine existence of "MyValue" value of an open hkey
|
|
//
|
|
// BOOL bExists = ERROR_SUCCESS == SHRegGetValue(hkey, NULL, TEXT("MyValue"), SRRF_RT_ANY, NULL, NULL, NULL)
|
|
|
|
LWSTDAPI_(LONG) SHRegGetValue%(HKEY hkey, LPCTSTR% pszSubKey, LPCTSTR% pszValue, SRRF dwFlags, DWORD *pdwType, void *pvData, DWORD *pcbData);
|
|
|
|
// These functions behave just like RegQueryValueEx(), except if the data
|
|
// type is REG_SZ, REG_EXPAND_SZ or REG_MULTI_SZ then the string is
|
|
// guaranteed to be properly null terminated.
|
|
//
|
|
// Additionally, if the data type is REG_EXPAND_SZ these functions will
|
|
// go ahead and expand out the string, and "massage" the returned *pdwType
|
|
// to be REG_SZ.
|
|
|
|
LWSTDAPI_(DWORD) SHQueryValueEx%(HKEY hkey, LPCTSTR% pszValue, DWORD *pdwReserved, DWORD *pdwType, void *pvData, DWORD *pcbData);
|
|
|
|
// Enumeration functions support.
|
|
|
|
LWSTDAPI_(LONG) SHEnumKeyExA(HKEY hkey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName);
|
|
LWSTDAPI_(LONG) SHEnumKeyExW(HKEY hkey, DWORD dwIndex, LPWSTR pszName, LPDWORD pcchName);
|
|
LWSTDAPI_(LONG) SHEnumValueA(HKEY hkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
|
|
LWSTDAPI_(LONG) SHEnumValueW(HKEY hkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData);
|
|
LWSTDAPI_(LONG) SHQueryInfoKeyA(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
|
|
LWSTDAPI_(LONG) SHQueryInfoKeyW(HKEY hkey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen);
|
|
|
|
// recursive key copy
|
|
LWSTDAPI_(DWORD) SHCopyKeyA(HKEY hkeySrc, LPCSTR szSrcSubKey, HKEY hkeyDest, DWORD fReserved);
|
|
LWSTDAPI_(DWORD) SHCopyKeyW(HKEY hkeySrc, LPCWSTR wszSrcSubKey, HKEY hkeyDest, DWORD fReserved);
|
|
|
|
// Getting and setting file system paths with environment variables
|
|
|
|
LWSTDAPI_(DWORD) SHRegGetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPSTR pszPath, DWORD dwFlags);
|
|
LWSTDAPI_(DWORD) SHRegGetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPWSTR pszPath, DWORD dwFlags);
|
|
LWSTDAPI_(DWORD) SHRegSetPathA(HKEY hKey, LPCSTR pcszSubKey, LPCSTR pcszValue, LPCSTR pcszPath, DWORD dwFlags);
|
|
LWSTDAPI_(DWORD) SHRegSetPathW(HKEY hKey, LPCWSTR pcszSubKey, LPCWSTR pcszValue, LPCWSTR pcszPath, DWORD dwFlags);
|
|
|
|
#ifdef UNICODE
|
|
#define SHEnumKeyEx SHEnumKeyExW
|
|
#define SHEnumValue SHEnumValueW
|
|
#define SHQueryInfoKey SHQueryInfoKeyW
|
|
#define SHCopyKey SHCopyKeyW
|
|
#define SHRegGetPath SHRegGetPathW
|
|
#define SHRegSetPath SHRegSetPathW
|
|
#else
|
|
#define SHEnumKeyEx SHEnumKeyExA
|
|
#define SHEnumValue SHEnumValueA
|
|
#define SHQueryInfoKey SHQueryInfoKeyA
|
|
#define SHCopyKey SHCopyKeyA
|
|
#define SHRegGetPath SHRegGetPathA
|
|
#define SHRegSetPath SHRegSetPathA
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////
|
|
// User Specific Registry Access Functions
|
|
//////////////////////////////////////////////
|
|
|
|
//
|
|
// Type definitions.
|
|
//
|
|
|
|
typedef enum
|
|
{
|
|
SHREGDEL_DEFAULT = 0x00000000, // Delete's HKCU, or HKLM if HKCU is not found.
|
|
SHREGDEL_HKCU = 0x00000001, // Delete HKCU only
|
|
SHREGDEL_HKLM = 0x00000010, // Delete HKLM only.
|
|
SHREGDEL_BOTH = 0x00000011, // Delete both HKCU and HKLM.
|
|
} SHREGDEL_FLAGS;
|
|
|
|
typedef enum
|
|
{
|
|
SHREGENUM_DEFAULT = 0x00000000, // Enumerates HKCU or HKLM if not found.
|
|
SHREGENUM_HKCU = 0x00000001, // Enumerates HKCU only
|
|
SHREGENUM_HKLM = 0x00000010, // Enumerates HKLM only.
|
|
SHREGENUM_BOTH = 0x00000011, // Enumerates both HKCU and HKLM without duplicates.
|
|
// This option is NYI.
|
|
} SHREGENUM_FLAGS;
|
|
|
|
#define SHREGSET_HKCU 0x00000001 // Write to HKCU if empty.
|
|
#define SHREGSET_FORCE_HKCU 0x00000002 // Write to HKCU.
|
|
#define SHREGSET_HKLM 0x00000004 // Write to HKLM if empty.
|
|
#define SHREGSET_FORCE_HKLM 0x00000008 // Write to HKLM.
|
|
#define SHREGSET_DEFAULT (SHREGSET_FORCE_HKCU | SHREGSET_HKLM) // Default is SHREGSET_FORCE_HKCU | SHREGSET_HKLM.
|
|
|
|
typedef HANDLE HUSKEY; // HUSKEY is a Handle to a User Specific KEY.
|
|
typedef HUSKEY *PHUSKEY;
|
|
|
|
LWSTDAPI_(LONG) SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
|
|
LWSTDAPI_(LONG) SHRegCreateUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags);
|
|
LWSTDAPI_(LONG) SHRegOpenUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
|
|
LWSTDAPI_(LONG) SHRegOpenUSKeyW(LPCWSTR pwzPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU);
|
|
LWSTDAPI_(LONG) SHRegQueryUSValueA(HUSKEY hUSKey, LPCSTR pszValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
|
|
LWSTDAPI_(LONG) SHRegQueryUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, LPDWORD pdwType, void *pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
|
|
LWSTDAPI_(LONG) SHRegWriteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
|
|
LWSTDAPI_(LONG) SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
|
|
LWSTDAPI_(LONG) SHRegDeleteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, SHREGDEL_FLAGS delRegFlags);
|
|
LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyW(HUSKEY hUSKey, LPCWSTR pwzSubKey, SHREGDEL_FLAGS delRegFlags);
|
|
LWSTDAPI_(LONG) SHRegDeleteEmptyUSKeyA(HUSKEY hUSKey, LPCSTR pszSubKey, SHREGDEL_FLAGS delRegFlags);
|
|
LWSTDAPI_(LONG) SHRegDeleteUSValueW(HUSKEY hUSKey, LPCWSTR pwzValue, SHREGDEL_FLAGS delRegFlags);
|
|
LWSTDAPI_(LONG) SHRegEnumUSKeyA(HUSKEY hUSKey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegEnumUSKeyW(HUSKEY hUSKey, DWORD dwIndex, LPWSTR pwzName, LPDWORD pcchName, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegEnumUSValueA(HUSKEY hUSkey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegEnumUSValueW(HUSKEY hUSkey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueName, LPDWORD pdwType, void *pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegQueryInfoUSKeyA(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegQueryInfoUSKeyW(HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags);
|
|
LWSTDAPI_(LONG) SHRegCloseUSKey(HUSKEY hUSKey);
|
|
|
|
|
|
// These calls are equal to an SHRegOpenUSKey, SHRegQueryUSValue, and then a SHRegCloseUSKey.
|
|
LWSTDAPI_(LONG) SHRegGetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
|
|
LWSTDAPI_(LONG) SHRegGetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, LPDWORD pdwType, void * pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, void *pvDefaultData, DWORD dwDefaultDataSize);
|
|
LWSTDAPI_(LONG) SHRegSetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
|
|
LWSTDAPI_(LONG) SHRegSetUSValueW(LPCWSTR pwzSubKey, LPCWSTR pwzValue, DWORD dwType, const void *pvData, DWORD cbData, DWORD dwFlags);
|
|
LWSTDAPI_(int) SHRegGetIntW(HKEY hk, LPCWSTR pwzKey, int iDefault);
|
|
|
|
#ifdef UNICODE
|
|
#define SHRegCreateUSKey SHRegCreateUSKeyW
|
|
#define SHRegOpenUSKey SHRegOpenUSKeyW
|
|
#define SHRegQueryUSValue SHRegQueryUSValueW
|
|
#define SHRegWriteUSValue SHRegWriteUSValueW
|
|
#define SHRegDeleteUSValue SHRegDeleteUSValueW
|
|
#define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyW
|
|
#define SHRegEnumUSKey SHRegEnumUSKeyW
|
|
#define SHRegEnumUSValue SHRegEnumUSValueW
|
|
#define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyW
|
|
#define SHRegGetUSValue SHRegGetUSValueW
|
|
#define SHRegSetUSValue SHRegSetUSValueW
|
|
#define SHRegGetInt SHRegGetIntW
|
|
#else
|
|
#define SHRegCreateUSKey SHRegCreateUSKeyA
|
|
#define SHRegOpenUSKey SHRegOpenUSKeyA
|
|
#define SHRegQueryUSValue SHRegQueryUSValueA
|
|
#define SHRegWriteUSValue SHRegWriteUSValueA
|
|
#define SHRegDeleteUSValue SHRegDeleteUSValueA
|
|
#define SHRegDeleteEmptyUSKey SHRegDeleteEmptyUSKeyA
|
|
#define SHRegEnumUSKey SHRegEnumUSKeyA
|
|
#define SHRegEnumUSValue SHRegEnumUSValueA
|
|
#define SHRegQueryInfoUSKey SHRegQueryInfoUSKeyA
|
|
#define SHRegGetUSValue SHRegGetUSValueA
|
|
#define SHRegSetUSValue SHRegSetUSValueA
|
|
#endif
|
|
|
|
LWSTDAPI_(BOOL) SHRegGetBoolUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
|
|
LWSTDAPI_(BOOL) SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault);
|
|
|
|
#ifdef UNICODE
|
|
#define SHRegGetBoolUSValue SHRegGetBoolUSValueW
|
|
#else
|
|
#define SHRegGetBoolUSValue SHRegGetBoolUSValueA
|
|
#endif
|
|
|
|
//
|
|
// Association APIs
|
|
//
|
|
// these APIs are to assist in accessing the data in HKCR
|
|
// getting the Command strings and exe paths
|
|
// for different verbs and extensions are simplified this way
|
|
//
|
|
|
|
enum {
|
|
ASSOCF_INIT_NOREMAPCLSID = 0x00000001, // do not remap clsids to progids
|
|
ASSOCF_INIT_BYEXENAME = 0x00000002, // executable is being passed in
|
|
ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in
|
|
ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat "*" as the BaseClass
|
|
ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat "Folder" as the BaseClass
|
|
ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU
|
|
ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string
|
|
ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
|
|
ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable
|
|
ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found
|
|
ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass
|
|
};
|
|
|
|
typedef DWORD ASSOCF;
|
|
|
|
|
|
typedef enum {
|
|
ASSOCSTR_COMMAND = 1, // shell\verb\command string
|
|
ASSOCSTR_EXECUTABLE, // the executable part of command string
|
|
ASSOCSTR_FRIENDLYDOCNAME, // friendly name of the document type
|
|
ASSOCSTR_FRIENDLYAPPNAME, // friendly name of executable
|
|
ASSOCSTR_NOOPEN, // noopen value
|
|
ASSOCSTR_SHELLNEWVALUE, // query values under the shellnew key
|
|
ASSOCSTR_DDECOMMAND, // template for DDE commands
|
|
ASSOCSTR_DDEIFEXEC, // DDECOMMAND to use if just create a process
|
|
ASSOCSTR_DDEAPPLICATION, // Application name in DDE broadcast
|
|
ASSOCSTR_DDETOPIC, // Topic Name in DDE broadcast
|
|
ASSOCSTR_INFOTIP, // info tip for an item, or list of properties to create info tip from
|
|
ASSOCSTR_QUICKTIP, // same as ASSOCSTR_INFOTIP, except, this list contains only quickly retrievable properties
|
|
ASSOCSTR_TILEINFO, // similar to ASSOCSTR_INFOTIP - lists important properties for tileview
|
|
ASSOCSTR_CONTENTTYPE, // MIME Content type
|
|
ASSOCSTR_DEFAULTICON, // Default icon source
|
|
ASSOCSTR_SHELLEXTENSION, // Guid string pointing to the Shellex\Shellextensionhandler value.
|
|
ASSOCSTR_MAX // last item in enum...
|
|
} ASSOCSTR;
|
|
|
|
typedef enum {
|
|
ASSOCKEY_SHELLEXECCLASS = 1, // the key that should be passed to ShellExec(hkeyClass)
|
|
ASSOCKEY_APP, // the "Application" key for the association
|
|
ASSOCKEY_CLASS, // the progid or class key
|
|
ASSOCKEY_BASECLASS, // the BaseClass key
|
|
ASSOCKEY_MAX // last item in enum...
|
|
} ASSOCKEY;
|
|
|
|
typedef enum {
|
|
ASSOCDATA_MSIDESCRIPTOR = 1, // Component Descriptor to pass to MSI APIs
|
|
ASSOCDATA_NOACTIVATEHANDLER, // restrict attempts to activate window
|
|
ASSOCDATA_QUERYCLASSSTORE, // should check with the NT Class Store
|
|
ASSOCDATA_HASPERUSERASSOC, // defaults to user specified association
|
|
ASSOCDATA_EDITFLAGS, // Edit flags.
|
|
ASSOCDATA_VALUE, // use pszExtra as the Value name
|
|
ASSOCDATA_MAX
|
|
} ASSOCDATA;
|
|
|
|
typedef enum {
|
|
ASSOCENUM_NONE
|
|
} ASSOCENUM;
|
|
|
|
#undef INTERFACE
|
|
#define INTERFACE IQueryAssociations
|
|
|
|
DECLARE_INTERFACE_( IQueryAssociations, IUnknown )
|
|
{
|
|
// IUnknown methods
|
|
STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
|
|
STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
|
|
STDMETHOD_(ULONG, Release) ( THIS ) PURE;
|
|
|
|
// IQueryAssociations methods
|
|
STDMETHOD (Init)(THIS_ ASSOCF flags, LPCWSTR pszAssoc, HKEY hkProgid, HWND hwnd) PURE;
|
|
STDMETHOD (GetString)(THIS_ ASSOCF flags, ASSOCSTR str, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut) PURE;
|
|
STDMETHOD (GetKey)(THIS_ ASSOCF flags, ASSOCKEY key, LPCWSTR pszExtra, HKEY *phkeyOut) PURE;
|
|
STDMETHOD (GetData)(THIS_ ASSOCF flags, ASSOCDATA data, LPCWSTR pszExtra, LPVOID pvOut, DWORD *pcbOut) PURE;
|
|
STDMETHOD (GetEnum)(THIS_ ASSOCF flags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut) PURE;
|
|
};
|
|
|
|
;begin_internal
|
|
|
|
typedef struct tagAssocDDEExec
|
|
{
|
|
LPCWSTR pszDDEExec;
|
|
LPCWSTR pszApplication;
|
|
LPCWSTR pszTopic;
|
|
BOOL fNoActivateHandler;
|
|
} ASSOCDDEEXEC;
|
|
|
|
typedef struct tagAssocVerb
|
|
{
|
|
LPCWSTR pszVerb;
|
|
LPCWSTR pszTitle;
|
|
LPCWSTR pszFriendlyAppName;
|
|
LPCWSTR pszApplication;
|
|
LPCWSTR pszParams;
|
|
ASSOCDDEEXEC *pDDEExec;
|
|
} ASSOCVERB;
|
|
|
|
typedef struct tagAssocShell
|
|
{
|
|
ASSOCVERB *rgVerbs;
|
|
DWORD cVerbs;
|
|
DWORD iDefaultVerb;
|
|
} ASSOCSHELL;
|
|
|
|
typedef struct tagAssocProgid
|
|
{
|
|
DWORD cbSize;
|
|
LPCWSTR pszProgid;
|
|
LPCWSTR pszFriendlyDocName;
|
|
LPCWSTR pszDefaultIcon;
|
|
ASSOCSHELL *pShellKey;
|
|
LPCWSTR pszExtensions;
|
|
} ASSOCPROGID;
|
|
|
|
typedef struct tagAssocApp
|
|
{
|
|
DWORD cbSize;
|
|
LPCWSTR pszFriendlyAppName;
|
|
ASSOCSHELL *pShellKey;
|
|
} ASSOCAPP;
|
|
|
|
enum {
|
|
ASSOCMAKEF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)
|
|
ASSOCMAKEF_USEEXPAND = 0x00000200, // strings have environment vars and need REG_EXPAND_SZ
|
|
ASSOCMAKEF_SUBSTENV = 0x00000400, // attempt to use std env if they match...
|
|
ASSOCMAKEF_VOLATILE = 0x00000800, // the progid will not persist between sessions
|
|
ASSOCMAKEF_DELETE = 0x00002000, // remove this association if possible
|
|
};
|
|
|
|
typedef DWORD ASSOCMAKEF;
|
|
|
|
LWSTDAPI AssocMakeProgid(ASSOCMAKEF flags, LPCWSTR pszApplication, ASSOCPROGID *pProgid, HKEY *phkProgid);
|
|
LWSTDAPI AssocMakeApp(ASSOCMAKEF flags, LPCWSTR pszApplication, ASSOCAPP *pApp, HKEY *phkApp);
|
|
|
|
LWSTDAPI AssocMakeApplicationByKey%(ASSOCMAKEF flags, HKEY hkAssoc, LPCTSTR% pszVerb);
|
|
LWSTDAPI AssocMakeFileExtsToApplication%(ASSOCMAKEF flags, LPCTSTR% pszExt, LPCTSTR% pszApplication);
|
|
|
|
LWSTDAPI AssocCopyVerbs(HKEY hkSrc, HKEY hkDst);
|
|
|
|
;end_internal
|
|
|
|
LWSTDAPI AssocCreate(CLSID clsid, REFIID riid, LPVOID *ppv);
|
|
|
|
// wrappers for the interface
|
|
LWSTDAPI AssocQueryString%(ASSOCF flags, ASSOCSTR str, LPCTSTR% pszAssoc, LPCTSTR% pszExtra, LPTSTR% pszOut, DWORD *pcchOut);
|
|
LWSTDAPI AssocQueryStringByKey%(ASSOCF flags, ASSOCSTR str, HKEY hkAssoc, LPCTSTR% pszExtra, LPTSTR% pszOut, DWORD *pcchOut);
|
|
LWSTDAPI AssocQueryKey%(ASSOCF flags, ASSOCKEY key, LPCTSTR% pszAssoc, LPCTSTR% pszExtra, HKEY *phkeyOut);
|
|
|
|
// AssocIsDangerous() checks a file type to determine whether it is "Dangerous"
|
|
// this maps to the IE download dialog's forcing a prompt to open or save.
|
|
// dangerous file types should be handled more carefully than other file types.
|
|
//
|
|
// Parameter: pszAssoc - type to check. may be an extension or progid. (".exe" or "exefile" would both be valid)
|
|
//
|
|
// Returns: TRUE if the file type is dangerous.
|
|
//
|
|
// NOTES:
|
|
//
|
|
// this API first checks a hardcoded list of known dangerous types.
|
|
// then it checks the editflags for the file type looking for the FTA_AlwaysUnsafe bit.
|
|
// then it checks Safer policies.
|
|
//
|
|
LWSTDAPI_(BOOL) AssocIsDangerous(LPCWSTR pszAssoc);
|
|
|
|
;begin_internal
|
|
|
|
typedef enum _SHELLKEY
|
|
{
|
|
SKROOT_HKCU = 0x00000001, // internal to the function
|
|
SKROOT_HKLM = 0x00000002, // internal to the function
|
|
SKROOT_MASK = 0x0000000F, // internal to the function
|
|
SKPATH_EXPLORER = 0x00000000, // internal to the function
|
|
SKPATH_SHELL = 0x00000010, // internal to the function
|
|
SKPATH_SHELLNOROAM = 0x00000020, // internal to the function
|
|
SKPATH_CLASSES = 0x00000030, // internal to the function
|
|
SKPATH_MASK = 0x00000FF0, // internal to the function
|
|
SKSUB_NONE = 0x00000000, // internal to the function
|
|
SKSUB_LOCALIZEDNAMES = 0x00001000, // internal to the function
|
|
SKSUB_HANDLERS = 0x00002000, // internal to the function
|
|
SKSUB_ASSOCIATIONS = 0x00003000, // internal to the function
|
|
SKSUB_VOLATILE = 0x00004000, // internal to the function
|
|
SKSUB_MUICACHE = 0x00005000, // internal to the function
|
|
SKSUB_FILEEXTS = 0x00006000, // internal to the function
|
|
SKSUB_MASK = 0x000FF000, // internal to the function
|
|
|
|
SHELLKEY_HKCU_EXPLORER = SKROOT_HKCU | SKPATH_EXPLORER | SKSUB_NONE,
|
|
SHELLKEY_HKLM_EXPLORER = SKROOT_HKLM | SKPATH_EXPLORER | SKSUB_NONE,
|
|
SHELLKEY_HKCU_SHELL = SKROOT_HKCU | SKPATH_SHELL | SKSUB_NONE,
|
|
SHELLKEY_HKLM_SHELL = SKROOT_HKLM | SKPATH_SHELL | SKSUB_NONE,
|
|
SHELLKEY_HKCU_SHELLNOROAM = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_NONE,
|
|
SHELLKEY_HKCULM_SHELL = SHELLKEY_HKCU_SHELLNOROAM,
|
|
SHELLKEY_HKCULM_CLASSES = SKROOT_HKCU | SKPATH_CLASSES | SKSUB_NONE,
|
|
SHELLKEY_HKCU_LOCALIZEDNAMES = SKROOT_HKCU | SKPATH_SHELL | SKSUB_LOCALIZEDNAMES,
|
|
SHELLKEY_HKCULM_HANDLERS = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_HANDLERS,
|
|
SHELLKEY_HKCULM_ASSOCIATIONS = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_ASSOCIATIONS,
|
|
SHELLKEY_HKCULM_VOLATILE = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_VOLATILE,
|
|
SHELLKEY_HKCULM_MUICACHE = SKROOT_HKCU | SKPATH_SHELLNOROAM | SKSUB_MUICACHE,
|
|
SHELLKEY_HKCU_FILEEXTS = SKROOT_HKCU | SKPATH_EXPLORER | SKSUB_FILEEXTS,
|
|
|
|
SHELLKEY_HKCULM_HANDLERS_RO = SHELLKEY_HKCULM_HANDLERS, // deprecated
|
|
SHELLKEY_HKCULM_HANDLERS_RW = SHELLKEY_HKCULM_HANDLERS, // deprecated
|
|
SHELLKEY_HKCULM_ASSOCIATIONS_RO = SHELLKEY_HKCULM_ASSOCIATIONS, // deprecated
|
|
SHELLKEY_HKCULM_ASSOCIATIONS_RW = SHELLKEY_HKCULM_ASSOCIATIONS, // deprecated
|
|
SHELLKEY_HKCULM_RO = SHELLKEY_HKCU_SHELLNOROAM, // deprecated
|
|
SHELLKEY_HKCULM_RW = SHELLKEY_HKCU_SHELLNOROAM, // deprecated
|
|
} SHELLKEY;
|
|
|
|
LWSTDAPI_(HKEY) SHGetShellKey(SHELLKEY sk, LPCWSTR pszSubKey, BOOL fCreateSub);
|
|
|
|
LWSTDAPI SKGetValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void *pvData, DWORD *pcbData);
|
|
LWSTDAPI SKSetValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD dwType, LPCVOID pvData, DWORD cbData);
|
|
LWSTDAPI SKDeleteValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue);
|
|
LWSTDAPI SKAllocValue%(SHELLKEY sk, LPCTSTR% pszSubKey, LPCTSTR% pszValue, DWORD *pdwType, void **pvData, DWORD *pcbData);
|
|
|
|
LWSTDAPI QuerySourceCreateFromKey(HKEY hk, PCWSTR pszSub, BOOL fCreate, REFIID riid, void **ppv);
|
|
|
|
;end_internal
|
|
|
|
;begin_both
|
|
|
|
#endif // NO_SHLWAPI_REG
|
|
|
|
;end_both
|
|
|
|
;begin_internal
|
|
|
|
#ifndef NO_SHLWAPI_UALSTR
|
|
#include <uastrfnc.h>
|
|
#endif // NO_SHLWAPI_UALSTR
|
|
|
|
;end_internal
|
|
;begin_both
|
|
|
|
#ifndef NO_SHLWAPI_STREAM
|
|
//
|
|
//=============== Stream Routines ===================================
|
|
//
|
|
;end_both
|
|
;begin_internal
|
|
//
|
|
// We must say "struct IStream" instead of "IStream" in case we are
|
|
// #include'd before <ole2.h>.
|
|
//
|
|
;end_internal
|
|
|
|
LWSTDAPI_(struct IStream *) SHOpenRegStream%(HKEY hkey, LPCTSTR% pszSubkey, LPCTSTR% pszValue, DWORD grfMode);
|
|
LWSTDAPI_(struct IStream *) SHOpenRegStream2%(HKEY hkey, LPCTSTR% pszSubkey, LPCTSTR% pszValue, DWORD grfMode);
|
|
// New code always wants new implementation...
|
|
#undef SHOpenRegStream
|
|
#define SHOpenRegStream SHOpenRegStream2
|
|
|
|
LWSTDAPI SHCreateStreamOnFile%(LPCTSTR% pszFile, DWORD grfMode, struct IStream **ppstm);
|
|
|
|
#if (_WIN32_IE >= 0x0600)
|
|
;begin_internal
|
|
LWSTDAPI MapWin32ErrorToSTG(HRESULT hrIn);
|
|
LWSTDAPI ModeToCreateFileFlags(DWORD grfMode, BOOL fCreate, DWORD *pdwDesiredAccess, DWORD *pdwShareMode, DWORD *pdwCreationDisposition);
|
|
|
|
// SHConvertGraphicsFile Description:
|
|
// pszFile: The source file name to convert. The file can be a JPEG, GIF, PNG, TIFF, BMP, EMF, WMF, or ICO filetype.
|
|
// pszDestFile: This is the destination file that will be created. The extension will determine type of
|
|
// format for the destiation file. If this file already exists, the function will fail with
|
|
// HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) unless the flag SHCGF_REPLACEFILE is specified.
|
|
// Return value: S_OK if the destination file was able to be created, otherwise an HRESULT error.
|
|
//
|
|
// NOTE: This is currently internal because: 1) we are using a temporary GDI+ interface, 2)
|
|
// we can't fix any bugs we find (since they are in GDI+), and 3) it's best if GDI+ owns
|
|
// the public version of this interface. GDI+ is working on version 1 of their API for
|
|
// whistler. They don't have time to create this API, make it public, and support it
|
|
// until version 2, which will be after whistler.
|
|
//
|
|
// dwFlags:
|
|
#define SHCGF_NONE 0x00000000 // Normal behavior
|
|
#define SHCGF_REPLACEFILE 0x00000001 // If pszDestFile already exists, delete it.
|
|
|
|
LWSTDAPI SHConvertGraphicsFile(IN LPCWSTR pszFile, IN LPCWSTR pszDestFile, IN DWORD dwFlags);
|
|
;end_internal
|
|
|
|
LWSTDAPI SHCreateStreamOnFileEx(LPCWSTR pszFile, DWORD grfMode, DWORD dwAttributes, BOOL fCreate, struct IStream * pstmTemplate, struct IStream **ppstm);
|
|
|
|
#endif // (_WIN32_IE >= 0x0600)
|
|
|
|
;begin_internal
|
|
|
|
LWSTDAPI_(struct IStream *) SHCreateMemStream(LPBYTE pInit, UINT cbInit);
|
|
|
|
// SHCreateStreamWrapper creates an IStream that spans multiple IStream implementations.
|
|
// NOTE: STGM_READ is the only mode currently supported
|
|
LWSTDAPI SHCreateStreamWrapper(IStream *aStreams[], UINT cStreams, DWORD grfMode, IStream **ppstm);
|
|
|
|
|
|
// These functions read, write, and maintain a list of DATABLOCK_HEADERs.
|
|
// Blocks can be of any size (cbSize) and they are added, found, and removed
|
|
// by dwSignature. Each block is guranteed to be aligned on a DWORD boundary
|
|
// in memory. The stream format is identical to Windows 95 and NT 4
|
|
// CShellLink's "EXP" data format (with one bug fix: stream data is NULL
|
|
// terminated on write...)
|
|
//
|
|
// SHReadDataBlocks and SHAddDataBlock will allocate your pdbList for you.
|
|
//
|
|
// SHFindDataBlock returns a pointer into the pdbList.
|
|
//
|
|
// SHAddDataBlock and SHRemoveDataBlock return TRUE if ppdbList modified.
|
|
//
|
|
|
|
/*
|
|
* Temporary definition because the definition doesn't show up until shlobj.w.
|
|
*/
|
|
|
|
#define LPDATABLOCK_HEADER struct tagDATABLOCKHEADER *
|
|
#define LPDBLIST struct tagDATABLOCKHEADER *
|
|
|
|
LWSTDAPI SHWriteDataBlockList(struct IStream* pstm, LPDBLIST pdbList);
|
|
LWSTDAPI SHReadDataBlockList(struct IStream* pstm, LPDBLIST * ppdbList);
|
|
LWSTDAPI_(void) SHFreeDataBlockList(LPDBLIST pdbList);
|
|
LWSTDAPI_(BOOL) SHAddDataBlock(LPDBLIST * ppdbList, LPDATABLOCK_HEADER pdb);
|
|
LWSTDAPI_(BOOL) SHRemoveDataBlock(LPDBLIST * ppdbList, DWORD dwSignature);
|
|
LWSTDAPI_(void *) SHFindDataBlock(LPDBLIST pdbList, DWORD dwSignature);
|
|
|
|
#undef LPDATABLOCK_HEADER
|
|
#undef LPDBLIST
|
|
|
|
// FUNCTION: SHCheckDiskForMedia
|
|
//
|
|
// hwnd - NULL means no UI will be displayed. Non-NULL means
|
|
// punkEnableModless - Make caller modal during UI. (OPTIONAL)
|
|
// pszPath - Path that needs verification.
|
|
// wFunc - Type of operation (FO_MOVE, FO_COPY, FO_DELETE, FO_RENAME - shellapi.h)
|
|
//
|
|
// NOTE: USE NT5's SHPathPrepareForWrite() instead, it's MUCH MUCH BETTER.
|
|
|
|
LWSTDAPI_(BOOL) SHCheckDiskForMediaA(HWND hwnd, IUnknown * punkEnableModless, LPCSTR pszPath, UINT wFunc);
|
|
LWSTDAPI_(BOOL) SHCheckDiskForMediaW(HWND hwnd, IUnknown * punkEnableModless, LPCWSTR pwzPath, UINT wFunc);
|
|
|
|
#ifdef UNICODE
|
|
#define SHCheckDiskForMedia SHCheckDiskForMediaW
|
|
#else
|
|
#define SHCheckDiskForMedia SHCheckDiskForMediaA
|
|
#endif
|
|
|
|
;end_internal
|
|
|
|
;begin_both
|
|
|
|
#endif // NO_SHLWAPI_STREAM
|
|
|
|
;end_both
|
|
|
|
|
|
;begin_internal
|
|
#ifndef NO_SHLWAPI_MLUI
|
|
//
|
|
//=============== Multi Language UI Routines ===================================
|
|
//
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
|
|
#define ORD_SHGETWEBFOLDERFILEPATHA 440
|
|
#define ORD_SHGETWEBFOLDERFILEPATHW 441
|
|
LWSTDAPI SHGetWebFolderFilePath%(LPCTSTR% pszFileName, LPTSTR% pszMUIPath, UINT cchMUIPath);
|
|
|
|
// Use MLLoadLibrary to get the ML-resource file. This function tags the file so
|
|
// all standard shlwapi wrap functions automatically get ML-behavior.
|
|
//
|
|
|
|
#define ORD_MLLOADLIBRARYA 377
|
|
#define ORD_MLLOADLIBRARYW 378
|
|
LWSTDAPI_(HINSTANCE) MLLoadLibrary%(LPCTSTR% lpLibFileName, HMODULE hModule, DWORD dwCrossCodePage);
|
|
LWSTDAPI_(BOOL) MLFreeLibrary(HMODULE hModule);
|
|
|
|
#define ML_NO_CROSSCODEPAGE 0
|
|
#define ML_CROSSCODEPAGE_NT 1
|
|
#define ML_CROSSCODEPAGE 2
|
|
#define ML_SHELL_LANGUAGE 4
|
|
#define ML_CROSSCODEPAGE_MASK 7
|
|
|
|
// If you are a global distributable a-la comctl32 that doesn't follow the IE5
|
|
// PlugUI resource layout, then load your own hinstance and poke it into shlwapi
|
|
// using these functions:
|
|
//
|
|
LWSTDAPI MLSetMLHInstance(HINSTANCE hInst, LANGID lidUI);
|
|
LWSTDAPI MLClearMLHInstance(HINSTANCE hInst);
|
|
|
|
// Of course you need to know what UI language to use:
|
|
//
|
|
#define ORD_MLGETUILANGUAGE 376
|
|
LWSTDAPI_(LANGID) MLGetUILanguage(void);
|
|
|
|
// Super internal and you probably don't need this one, but comctl32 does
|
|
// some font munging in PlugUI cases on your apps behalf:
|
|
//
|
|
LWSTDAPI_(BOOL) MLIsMLHInstance(HINSTANCE hInst);
|
|
|
|
|
|
LWSTDAPI_(HRESULT) MLBuildResURL%(LPCTSTR% szLibFile, HMODULE hModule, DWORD dwCrossCodePage, LPCTSTR% szResourceName, LPTSTR% pszResURL, int nBufSize);
|
|
#define ORD_MLWINHELPA 395
|
|
#define ORD_MLWINHELPW 397
|
|
LWSTDAPI_(BOOL) MLWinHelp%(HWND hWndCaller, LPCTSTR% lpszHelp, UINT uCommand, DWORD_PTR dwData);
|
|
#define ORD_MLHTMLHELPA 396
|
|
#define ORD_MLHTMLHELPW 398
|
|
LWSTDAPI_(HWND) MLHtmlHelp%(HWND hWndCaller, LPCTSTR% pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage);
|
|
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
|
|
#endif // NO_SHLWAPI_MLUI
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
|
|
#ifndef NO_SHLWAPI_HTTP
|
|
//
|
|
//=============== HTTP helper Routines ===================================
|
|
// The calling thread must have called CoInitialize() before using this
|
|
// function - it will create a format enumerator and associate it as a
|
|
// property with the IShellBrowser passed in, so that it will be reused.
|
|
//
|
|
|
|
;begin_internal
|
|
//
|
|
// We must say "struct IWhatever" instead of "IWhatever" in case we are
|
|
// #include'd before <ole2.h>.
|
|
//
|
|
;end_internal
|
|
LWSTDAPI RegisterDefaultAcceptHeaders(struct IBindCtx* pbc, struct IShellBrowser* psb);
|
|
|
|
LWSTDAPI RunRegCommand(HWND hwnd, HKEY hkey, LPCWSTR pszKey);
|
|
LWSTDAPI RunIndirectRegCommand(HWND hwnd, HKEY hkey, LPCWSTR pszKey, LPCWSTR pszVerb);
|
|
LWSTDAPI SHRunIndirectRegClientCommand(HWND hwnd, LPCWSTR pszClient);
|
|
|
|
LWSTDAPI GetAcceptLanguagesA(LPSTR psz, LPDWORD pcch);
|
|
LWSTDAPI GetAcceptLanguagesW(LPWSTR pwz, LPDWORD pcch);
|
|
|
|
#ifdef UNICODE
|
|
#define GetAcceptLanguages GetAcceptLanguagesW
|
|
#else
|
|
#define GetAcceptLanguages GetAcceptLanguagesA
|
|
#endif
|
|
|
|
#endif // NO_SHLWAPI_HTTP
|
|
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
|
|
LWSTDAPI_(HWND) SHHtmlHelpOnDemandW(HWND hwnd, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage, BOOL bUseML);
|
|
LWSTDAPI_(HWND) SHHtmlHelpOnDemandA(HWND hwnd, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData, DWORD dwCrossCodePage, BOOL bUseML);
|
|
LWSTDAPI_(BOOL) SHWinHelpOnDemandW(HWND hwnd, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData, BOOL bUseML);
|
|
LWSTDAPI_(BOOL) SHWinHelpOnDemandA(HWND hwnd, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData, BOOL bUseML);
|
|
LWSTDAPI_(BOOL) WINAPI Shell_GetCachedImageIndexWrapW(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
|
|
LWSTDAPI_(BOOL) WINAPI Shell_GetCachedImageIndexWrapA(LPCSTR pszIconPath, int iIconIndex, UINT uIconFlags);
|
|
|
|
#ifdef UNICODE
|
|
#define SHHtmlHelpOnDemand SHHtmlHelpOnDemandW
|
|
#define SHWinHelpOnDemand SHWinHelpOnDemandW
|
|
#define Shell_GetCachedImageIndexWrap Shell_GetCachedImageIndexWrapW
|
|
#else
|
|
#define SHHtmlHelpOnDemand SHHtmlHelpOnDemandA
|
|
#define SHWinHelpOnDemand SHWinHelpOnDemandA
|
|
#define Shell_GetCachedImageIndexWrap Shell_GetCachedImageIndexWrapA
|
|
#endif
|
|
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
#ifndef NO_SHLWAPI_STOPWATCH
|
|
//
|
|
//=============== Performance timing macros and prototypes ================
|
|
|
|
// StopWatch performance mode flags used in dwFlags param in API's and in Mode key at
|
|
// HKLM\software\microsoft\windows\currentversion\explorer\performance
|
|
// NOTE: low word is used for the mode, high word is used to change the default painter timer interval.
|
|
// If we need more mode bits then we'll need a new reg key for paint timer
|
|
#define SPMODE_SHELL 0x00000001
|
|
#define SPMODE_DEBUGOUT 0x00000002
|
|
#define SPMODE_TEST 0x00000004
|
|
#define SPMODE_BROWSER 0x00000008
|
|
#define SPMODE_FLUSH 0x00000010
|
|
#define SPMODE_EVENT 0x00000020
|
|
#define SPMODE_JAVA 0x00000040
|
|
#define SPMODE_FORMATTEXT 0x00000080
|
|
#define SPMODE_PROFILE 0x00000100
|
|
#define SPMODE_DEBUGBREAK 0x00000200
|
|
#define SPMODE_MSGTRACE 0x00000400
|
|
#define SPMODE_PERFTAGS 0x00000800
|
|
#define SPMODE_MEMWATCH 0x00001000
|
|
#define SPMODE_DBMON 0x00002000
|
|
#define SPMODE_MARS 0x00004000
|
|
#ifndef NO_ETW_TRACING
|
|
#define SPMODE_EVENTTRACE 0x00008000 // Event Tracing for Windows Enabled
|
|
#endif
|
|
#define SPMODE_RESERVED 0xffff0000
|
|
#ifndef NO_ETW_TRACING
|
|
#define SPMODES (SPMODE_SHELL | SPMODE_BROWSER | SPMODE_JAVA | SPMODE_MSGTRACE | SPMODE_MEMWATCH | SPMODE_DBMON | SPMODE_MARS | SPMODE_EVENTTRACE)
|
|
#else
|
|
#define SPMODES (SPMODE_SHELL | SPMODE_BROWSER | SPMODE_JAVA | SPMODE_MSGTRACE | SPMODE_MEMWATCH | SPMODE_DBMON | SPMODE_MARS)
|
|
#endif
|
|
|
|
#ifndef NO_ETW_TRACING
|
|
// Event tracing capability enabled by setting the mode to SPMODE_EVENTTRACE and
|
|
// selecting the part of the shell to trace in the "EventTrace" Value in the
|
|
// following key:
|
|
// HKLM\software\microsoft\windows\currentversion\explorer\performance
|
|
|
|
// BROWSER TRACING
|
|
// Do not use with SPMODE_BROWSER. If SPMODE_EVENT is used, the
|
|
// STOPWATCH_STOP_EVENT will be signaled when a web page is done loading.
|
|
#define SPTRACE_BROWSER 0x00000001
|
|
// Used to turn on/off browser event tracing. Setting the registry key enables
|
|
// event tracing use, but doesn't turn it on.
|
|
// {5576F62E-4142-45a8-9516-262A510C13F0}
|
|
DEFINE_GUID(c_BrowserControlGuid,
|
|
0x5576f62e,
|
|
0x4142,
|
|
0x45a8,
|
|
0x95, 0x16, 0x26, 0x2a, 0x51, 0xc, 0x13, 0xf0);
|
|
|
|
// Maps to the structure sent to ETW. ETW definition in
|
|
// \nt\sdktools\trace\tracedmp\mofdata.guid
|
|
// {2B992163-736F-4a68-9153-95BC5F34D884}
|
|
DEFINE_GUID(c_BrowserTraceGuid,
|
|
0x2b992163,
|
|
0x736f,
|
|
0x4a68,
|
|
0x91, 0x53, 0x95, 0xbc, 0x5f, 0x34, 0xd8, 0x84);
|
|
|
|
// BROWSING EVENTS
|
|
// See \nt\sdktools\trace\tracedmp\mofdata.guid
|
|
// The page load starts with a user keystroke message
|
|
#define EVENT_TRACE_TYPE_BROWSE_USERINPUTRET 10
|
|
#define EVENT_TRACE_TYPE_BROWSE_USERINPUTBACK 11
|
|
#define EVENT_TRACE_TYPE_BROWSE_USERINPUTLBUT 12
|
|
#define EVENT_TRACE_TYPE_BROWSE_USERINPUTNEXT 13
|
|
#define EVENT_TRACE_TYPE_BROWSE_USERINPUTPRIOR 14
|
|
#define EVENT_TRACE_TYPE_BROWSE_STARTFRAME 16
|
|
#define EVENT_TRACE_TYPE_BROWSE_LOADEDPARSED 18
|
|
#define EVENT_TRACE_TYPE_BROWSE_LAYOUT 19
|
|
#define EVENT_TRACE_TYPE_BROWSE_LAYOUTTASK 20
|
|
#define EVENT_TRACE_TYPE_BROWSE_PAINT 21
|
|
// Url the user types into the address bar.
|
|
#define EVENT_TRACE_TYPE_BROWSE_ADDRESS 22
|
|
|
|
#endif
|
|
|
|
|
|
// StopWatch node types used in memory log to identify the type of node
|
|
#define EMPTY_NODE 0x0
|
|
#define START_NODE 0x1
|
|
#define LAP_NODE 0x2
|
|
#define STOP_NODE 0x3
|
|
#define OUT_OF_NODES 0x4
|
|
|
|
// StopWatch timing ids used to identify the type of timing being performed
|
|
#define SWID_STARTUP 0x0
|
|
#define SWID_FRAME 0x1
|
|
#define SWID_COPY 0x2
|
|
#define SWID_TREE 0x3
|
|
#define SWID_BROWSER_FRAME 0x4
|
|
#define SWID_JAVA_APP 0x5
|
|
#define SWID_MENU 0x6
|
|
#define SWID_BITBUCKET 0x7
|
|
#define SWID_EXPLBAR 0x8
|
|
#define SWID_MSGDISPATCH 0x9
|
|
#define SWID_TRACEMSG 0xa
|
|
#define SWID_DBMON_DLLLOAD 0xb
|
|
#define SWID_DBMON_EXCEPTION 0xc
|
|
#define SWID_THUMBVW_CACHEREAD 0xd
|
|
#define SWID_THUMBVW_EXTRACT 0xe
|
|
#define SWID_THUMBVW_CACHEWRITE 0xf
|
|
#define SWID_THUMBVW_FETCH 0x10
|
|
#define SWID_THUMBVW_INIT 0x11
|
|
#define SWID_MASK_BROWSER_STOPBTN 0x8000000 // identifies BROWSER_FRAME stop caused by stop button
|
|
|
|
#define SWID_MASKS SWID_MASK_BROWSER_STOPBTN // add any SWID_MASK_* defines here
|
|
|
|
#define SWID(dwId) (dwId & (~SWID_MASKS))
|
|
|
|
// The following StopWatch messages are used to drive the timer msg handler. The timer proc is used
|
|
// as a means of delaying while watching paint messages. If the defined number of timer ticks has
|
|
// passed without getting any paint messages, then we mark the time of the last paint message we've
|
|
// saved as the stop time.
|
|
#define SWMSG_PAINT 1 // paint message rcvd
|
|
#define SWMSG_TIMER 2 // timer tick
|
|
#define SWMSG_CREATE 3 // init handler and create timer
|
|
#define SWMSG_STATUS 4 // get status of whether timing is active or not
|
|
|
|
#define ID_STOPWATCH_TIMER 0xabcd // Timer id
|
|
|
|
// Stopwatch defaults
|
|
#define STOPWATCH_MAX_NODES 100
|
|
#define STOPWATCH_DEFAULT_PAINT_INTERVAL 1000
|
|
#define STOPWATCH_DEFAULT_MAX_DISPATCH_TIME 150
|
|
#define STOPWATCH_DEFAULT_MAX_MSG_TIME 1000
|
|
#define STOPWATCH_DEFAULT_MAX_MSG_INTERVAL 50
|
|
#define STOPWATCH_DEFAULT_CLASSNAMES TEXT("Internet Explorer_Server") TEXT("\0") TEXT("SHELLDLL_DefView") TEXT("\0") TEXT("SysListView32") TEXT("\0\0")
|
|
|
|
#define MEMWATCH_DEFAULT_PAGES 512
|
|
#define MEMWATCH_DEFAULT_TIME 1000
|
|
#define MEMWATCH_DEFAULT_FLAGS 0
|
|
|
|
|
|
#ifdef UNICODE
|
|
#define StopWatch StopWatchW
|
|
#define StopWatchEx StopWatchExW
|
|
#else
|
|
#define StopWatch StopWatchA
|
|
#define StopWatchEx StopWatchExA
|
|
#endif
|
|
|
|
#define StopWatch_Start(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, START_NODE, dwFlags, 0)
|
|
#define StopWatch_Lap(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, LAP_NODE, dwFlags, 0)
|
|
#define StopWatch_Stop(dwId, pszDesc, dwFlags) StopWatch(dwId, pszDesc, STOP_NODE, dwFlags, 0)
|
|
#define StopWatch_StartTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, START_NODE, dwFlags, dwCount)
|
|
#define StopWatch_LapTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, LAP_NODE, dwFlags, dwCount)
|
|
#define StopWatch_StopTimed(dwId, pszDesc, dwFlags, dwCount) StopWatch(dwId, pszDesc, STOP_NODE, dwFlags, dwCount)
|
|
|
|
#define StopWatch_StartEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, START_NODE, dwFlags, 0, dwCookie)
|
|
#define StopWatch_LapEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, LAP_NODE, dwFlags, 0, dwCookie)
|
|
#define StopWatch_StopEx(dwId, pszDesc, dwFlags, dwCookie) StopWatchEx(dwId, pszDesc, STOP_NODE, dwFlags, 0, dwCookie)
|
|
#define StopWatch_StartTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, START_NODE, dwFlags, dwCount, dwCookie)
|
|
#define StopWatch_LapTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, LAP_NODE, dwFlags, dwCount, dwCookie)
|
|
#define StopWatch_StopTimedEx(dwId, pszDesc, dwFlags, dwCount, dwCookie) StopWatchEx(dwId, pszDesc, STOP_NODE, dwFlags, dwCount, dwCookie)
|
|
|
|
VOID InitStopWatchMode(VOID);
|
|
|
|
// EXPORTED FUNCTIONS
|
|
DWORD WINAPI StopWatchW(DWORD dwId, LPCWSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount);
|
|
DWORD WINAPI StopWatchA(DWORD dwId, LPCSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount);
|
|
DWORD WINAPI StopWatchExW(DWORD dwId, LPCWSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount, DWORD dwUniqueId);
|
|
DWORD WINAPI StopWatchExA(DWORD dwId, LPCSTR pszDesc, DWORD dwType, DWORD dwFlags, DWORD dwCount, DWORD dwUniqueId);
|
|
DWORD WINAPI StopWatchMode(VOID);
|
|
DWORD WINAPI StopWatchFlush(VOID);
|
|
BOOL WINAPI StopWatch_TimerHandler(HWND hwnd, UINT uInc, DWORD dwFlag, MSG *pmsg);
|
|
VOID WINAPI StopWatch_CheckMsg(HWND hwnd, MSG msg, LPCSTR lpStr);
|
|
VOID WINAPI StopWatch_MarkFrameStart(LPCSTR lpExplStr);
|
|
VOID WINAPI StopWatch_MarkSameFrameStart(HWND hwnd);
|
|
VOID WINAPI StopWatch_MarkJavaStop(LPCSTR lpStringToSend, HWND hwnd, BOOL fChType);
|
|
DWORD WINAPI GetPerfTime(VOID);
|
|
VOID WINAPI StopWatch_SetMsgLastLocation(DWORD dwLast);
|
|
DWORD WINAPI StopWatch_DispatchTime(BOOL fStartTime, MSG msg, DWORD dwStart);
|
|
#ifndef NO_ETW_TRACING
|
|
VOID WINAPI EventTraceHandler(UCHAR uchEventType, PVOID pvData);
|
|
#endif
|
|
|
|
extern DWORD g_dwStopWatchMode;
|
|
//
|
|
//=============== End Performance timing macros and prototypes ================
|
|
|
|
#endif //#ifndef NO_SHLWAPI_STOPWATCH
|
|
|
|
;end_internal
|
|
|
|
;begin_internal
|
|
|
|
#ifndef NO_SHLWAPI_INTERNAL
|
|
//
|
|
//=============== Internal helper routines ===================================
|
|
|
|
//
|
|
// Declare some OLE interfaces we need to refer to and which aren't
|
|
// already defined in objbase.h
|
|
//
|
|
|
|
#ifndef RC_INVOKED /* { rc doesn't like these long symbol names */
|
|
#ifndef __IOleCommandTarget_FWD_DEFINED__
|
|
#define __IOleCommandTarget_FWD_DEFINED__
|
|
typedef struct IOleCommandTarget IOleCommandTarget;
|
|
#endif /* __IOleCommandTarget_FWD_DEFINED__ */
|
|
|
|
#ifndef __IDropTarget_FWD_DEFINED__
|
|
#define __IDropTarget_FWD_DEFINED__
|
|
typedef struct IDropTarget IDropTarget;
|
|
#endif /* __IDropTarget_FWD_DEFINED__ */
|
|
|
|
#ifndef __IPropertyBag_FWD_DEFINED__
|
|
#define __IPropertyBag_FWD_DEFINED__
|
|
typedef struct IPropertyBag IPropertyBag;
|
|
#endif /* __IPropertyBag_FWD_DEFINED__ */
|
|
|
|
#ifndef __IConnectionPoint_FWD_DEFINED__
|
|
#define __IConnectionPoint_FWD_DEFINED__
|
|
typedef struct IConnectionPoint IConnectionPoint;
|
|
#endif /* __IConnectionPoint_FWD_DEFINED__ */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C++" {
|
|
template <typename T>
|
|
void IUnknown_SafeReleaseAndNullPtr(T *& p)
|
|
{
|
|
if (p)
|
|
{
|
|
T *pTemp = p;
|
|
p = NULL;
|
|
pTemp->Release();
|
|
}
|
|
}
|
|
}
|
|
#endif // __cplusplus
|
|
|
|
LWSTDAPI_(void) IUnknown_AtomicRelease(void ** ppunk);
|
|
LWSTDAPI_(BOOL) SHIsSameObject(IUnknown* punk1, IUnknown* punk2);
|
|
LWSTDAPI IUnknown_GetWindow(IUnknown* punk, HWND* phwnd);
|
|
LWSTDAPI IUnknown_SetOwner(IUnknown* punk, IUnknown* punkOwner);
|
|
LWSTDAPI IUnknown_SetSite(IUnknown *punk, IUnknown *punkSite);
|
|
LWSTDAPI IUnknown_GetSite(IUnknown *punk, REFIID riid, void **ppvOut);
|
|
LWSTDAPI IUnknown_EnableModeless(IUnknown * punk, BOOL fEnabled);
|
|
LWSTDAPI IUnknown_GetClassID(IUnknown *punk, CLSID *pclsid);
|
|
LWSTDAPI IUnknown_QueryService(IUnknown* punk, REFGUID guidService, REFIID riid, void ** ppvOut);
|
|
LWSTDAPI IUnknown_QueryServiceForWebBrowserApp(IUnknown* punk, REFIID riid, void **ppvOut);
|
|
LWSTDAPI IUnknown_QueryServiceExec(IUnknown* punk, REFGUID guidService, const GUID *guid,
|
|
DWORD cmdID, DWORD cmdParam, VARIANT* pvarargIn, VARIANT* pvarargOut);
|
|
LWSTDAPI IUnknown_ShowBrowserBar(IUnknown* punk, REFCLSID clsidBrowserBar, BOOL fShow);
|
|
LWSTDAPI IUnknown_HandleIRestrict(IUnknown * punk, const GUID * pguidID, DWORD dwRestrictAction, VARIANT * pvarArgs, DWORD * pdwRestrictionResult);
|
|
LWSTDAPI IUnknown_OnFocusOCS(IUnknown *punk, BOOL fGotFocus);
|
|
LWSTDAPI IUnknown_TranslateAcceleratorOCS(IUnknown *punk, LPMSG lpMsg, DWORD grfMods);
|
|
LWSTDAPI_(void) IUnknown_Set(IUnknown ** ppunk, IUnknown * punk);
|
|
LWSTDAPI IUnknown_ProfferService(IUnknown *punkSite,
|
|
REFGUID sidWhat, IServiceProvider *punkService,
|
|
DWORD *pdwCookie);
|
|
LWSTDAPI IUnknown_QueryServicePropertyBag(IUnknown* punk, DWORD dwFlags, REFIID riid, void ** ppvOut);
|
|
|
|
LWSTDAPI IUnknown_TranslateAcceleratorIO(IUnknown* punk, LPMSG lpMsg);
|
|
LWSTDAPI IUnknown_UIActivateIO(IUnknown *punk, BOOL fActivate, LPMSG lpMsg);
|
|
LWSTDAPI IUnknown_OnFocusChangeIS(IUnknown *punk, IUnknown *punkSrc, BOOL fSetFocus);
|
|
LWSTDAPI IUnknown_HasFocusIO(IUnknown *punk);
|
|
|
|
LWSTDAPI SHWeakQueryInterface(IUnknown *punkOuter, IUnknown *punkTarget, REFIID riid, void **ppvOut);
|
|
LWSTDAPI_(void) SHWeakReleaseInterface(IUnknown *punkOuter, IUnknown **ppunk);
|
|
|
|
#define IUnknown_EnableModless IUnknown_EnableModeless
|
|
|
|
// Helper macros for the Weak interface functions.
|
|
#define SHQueryInnerInterface SHWeakQueryInterface
|
|
#define SHReleaseInnerInterface SHWeakReleaseInterface
|
|
#define SHReleaseOuterInterface SHWeakReleaseInterface
|
|
|
|
__inline HRESULT SHQueryOuterInterface(IUnknown *punkOuter, REFIID riid, void **ppvOut)
|
|
{
|
|
return SHWeakQueryInterface(punkOuter, punkOuter, riid, ppvOut);
|
|
}
|
|
|
|
#if (_WIN32_IE >= 0x0600)
|
|
// App compat-aware CoCreateInstance
|
|
LWSTDAPI SHCoCreateInstanceAC(REFCLSID rclsid,
|
|
IUnknown *punkOuter, DWORD dwClsCtx,
|
|
REFIID riid, void **ppvOut);
|
|
#endif // (_WIN32_IE >= 0x0600)
|
|
|
|
#if defined(__IOleAutomationTypes_INTERFACE_DEFINED__) && \
|
|
defined(__IOleCommandTarget_INTERFACE_DEFINED__)
|
|
LWSTDAPI IUnknown_QueryStatus(IUnknown *punk, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
|
|
LWSTDAPI IUnknown_Exec(IUnknown* punk, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
|
|
|
|
// Some of the many connection point helper functions available in
|
|
// connect.cpp. We export only the ones people actually use. If
|
|
// you need a helper function, maybe it's already in connect.cpp
|
|
// and merely needs to be exported.
|
|
|
|
LWSTDAPI SHPackDispParamsV(DISPPARAMS * pdispparams, VARIANTARG *rgvt,
|
|
UINT cArgs, va_list arglist);
|
|
LWSTDAPIV SHPackDispParams(DISPPARAMS * pdispparams, VARIANTARG *rgvt,
|
|
UINT cArgs, ...);
|
|
|
|
typedef HRESULT (CALLBACK *SHINVOKECALLBACK)(IDispatch *pdisp, struct SHINVOKEPARAMS *pinv);
|
|
|
|
#include <pshpack1.h>
|
|
typedef struct SHINVOKEPARAMS {
|
|
UINT flags; // mandatory
|
|
DISPID dispidMember; // mandatory
|
|
const IID*piid; // IPFL_USEDEFAULTS will fill this in
|
|
LCID lcid; // IPFL_USEDEFAULTS will fill this in
|
|
WORD wFlags; // IPFL_USEDEFAULTS will fill this in
|
|
DISPPARAMS * pdispparams; // mandatory, may be NULL
|
|
VARIANT * pvarResult; // IPFL_USEDEFAULTS will fill this in
|
|
EXCEPINFO * pexcepinfo; // IPFL_USEDEFAULTS will fill this in
|
|
UINT * puArgErr; // IPFL_USEDEFAULTS will fill this in
|
|
SHINVOKECALLBACK Callback; // required if IPFL_USECALLBACK
|
|
} SHINVOKEPARAMS, *LPSHINVOKEPARAMS;
|
|
#include <poppack.h> /* Return to byte packing */
|
|
|
|
|
|
#define IPFL_USECALLBACK 0x0001
|
|
#define IPFL_USEDEFAULTS 0x0002
|
|
|
|
#if 0 // These functions not yet needed
|
|
LWSTDAPI IConnectionPoint_InvokeIndirect(IConnectionPoint *pcp,
|
|
SHINVOKEPARAMS *pinv);
|
|
#endif
|
|
|
|
LWSTDAPI IConnectionPoint_InvokeWithCancel(IConnectionPoint *pcp,
|
|
DISPID dispidMember, DISPPARAMS * pdispparams,
|
|
LPBOOL pfCancel, LPVOID *ppvCancel);
|
|
LWSTDAPI IConnectionPoint_SimpleInvoke(IConnectionPoint *pcp,
|
|
DISPID dispidMember, DISPPARAMS * pdispparams);
|
|
|
|
#if 0 // These functions not yet needed
|
|
LWSTDAPI IConnectionPoint_InvokeParamV(IConnectionPoint *pcp,
|
|
DISPID dispidMember, VARIANTARG *rgvarg,
|
|
UINT cArgs, va_list ap);
|
|
LWSTDAPIV IConnectionPoint_InvokeParam(IConnectionPoint *pcp,
|
|
DISPID dispidMember, VARIANTARG *rgvarg, UINT cArgs, ...)
|
|
#endif
|
|
|
|
LWSTDAPI IConnectionPoint_OnChanged(IConnectionPoint *pcp, DISPID dispid);
|
|
|
|
#if 0 // These functions not yet needed
|
|
LWSTDAPI IUnknown_FindConnectionPoint(IUnknown *punk,
|
|
REFIID riidCP, IConnectionPoint **pcpOut);
|
|
#endif
|
|
|
|
LWSTDAPI IUnknown_CPContainerInvokeIndirect(IUnknown *punk, REFIID riidCP,
|
|
SHINVOKEPARAMS *pinv);
|
|
LWSTDAPIV IUnknown_CPContainerInvokeParam(IUnknown *punk, REFIID riidCP,
|
|
DISPID dispidMember, VARIANTARG *rgvarg, UINT cArgs, ...);
|
|
LWSTDAPI IUnknown_CPContainerOnChanged(IUnknown *punk, DISPID dispid);
|
|
|
|
#endif /* IOleAutomationTypes && IOleCommandTarget */
|
|
#endif /* } !RC_INVOKED */
|
|
|
|
LWSTDAPI IStream_Read(IStream *pstm, void *pv, ULONG cb);
|
|
LWSTDAPI IStream_Write(IStream *pstm, const void *pv, ULONG cb);
|
|
LWSTDAPI IStream_Reset(IStream *pstm);
|
|
LWSTDAPI IStream_Size(IStream *pstm, ULARGE_INTEGER *pui);
|
|
LWSTDAPI IStream_WritePidl(IStream *pstm, LPCITEMIDLIST pidlWrite);
|
|
LWSTDAPI IStream_ReadPidl(IStream *pstm, LPITEMIDLIST *ppidlOut);
|
|
|
|
LWSTDAPI_(BOOL) SHIsEmptyStream(IStream* pstm);
|
|
|
|
LWSTDAPI SHSimulateDrop(IDropTarget *pdrop, IDataObject *pdtobj, DWORD grfKeyState,
|
|
const POINTL *ppt, DWORD *pdwEffect);
|
|
|
|
LWSTDAPI SHLoadFromPropertyBag(IUnknown* punk, IPropertyBag* ppg);
|
|
|
|
LWSTDAPI ConnectToConnectionPoint(IUnknown* punkThis, REFIID riidEvent, BOOL fConnect, IUnknown* punkTarget, DWORD* pdwCookie, IConnectionPoint** ppcpOut);
|
|
|
|
LWSTDAPI SHCreatePropertyBagOnRegKey(HKEY hk, LPCWSTR pszSubKey, DWORD grfMode, REFIID riid, void **ppv);
|
|
LWSTDAPI SHCreatePropertyBagOnProfileSection(LPCWSTR pszFile, LPCWSTR pszSection, DWORD grfMode, REFIID riid, void **ppv);
|
|
LWSTDAPI SHCreatePropertyBagOnMemory(DWORD grfMode, REFIID riid, void **ppv);
|
|
|
|
LWSTDAPI SHPropertyBag_ReadType(IPropertyBag* ppb, LPCWSTR pszPropName, VARIANT* pv, VARTYPE vt);
|
|
LWSTDAPI SHPropertyBag_ReadStr(IPropertyBag* ppb, LPCWSTR pwzPropName, LPWSTR psz, int cch);
|
|
LWSTDAPI SHPropertyBag_ReadBSTR(IPropertyBag *ppb, LPCWSTR pwzPropName, BSTR* pbstr);
|
|
LWSTDAPI SHPropertyBag_WriteStr(IPropertyBag* ppb, LPCWSTR pwzPropName, LPCWSTR psz);
|
|
LWSTDAPI SHPropertyBag_ReadInt(IPropertyBag* ppb, LPCWSTR pwzPropName, INT* piResult);
|
|
LWSTDAPI SHPropertyBag_WriteInt(IPropertyBag* ppb, LPCWSTR pwzPropName, INT iValue);
|
|
LWSTDAPI SHPropertyBag_ReadSHORT(IPropertyBag* ppb, LPCWSTR pwzPropName, SHORT* psh);
|
|
LWSTDAPI SHPropertyBag_WriteSHORT(IPropertyBag* ppb, LPCWSTR pwzPropName, SHORT sh);
|
|
LWSTDAPI SHPropertyBag_ReadLONG(IPropertyBag* ppb, LPCWSTR pwzPropName, LONG* pl);
|
|
LWSTDAPI SHPropertyBag_WriteLONG(IPropertyBag* ppb, LPCWSTR pwzPropName, LONG l);
|
|
LWSTDAPI SHPropertyBag_ReadDWORD(IPropertyBag* ppb, LPCWSTR pwzPropName, DWORD* pdw);
|
|
LWSTDAPI SHPropertyBag_WriteDWORD(IPropertyBag* ppb, LPCWSTR pwzPropName, DWORD dw);
|
|
LWSTDAPI SHPropertyBag_ReadBOOL(IPropertyBag* ppb, LPCWSTR pwzPropName, BOOL* pfResult);
|
|
LWSTDAPI SHPropertyBag_WriteBOOL(IPropertyBag* ppb, LPCWSTR pwzPropName, BOOL fValue);
|
|
LWSTDAPI SHPropertyBag_ReadGUID(IPropertyBag* ppb, LPCWSTR pwzPropName, GUID* pguid);
|
|
LWSTDAPI SHPropertyBag_WriteGUID(IPropertyBag* ppb, LPCWSTR pwzPropName, const GUID* pguid);
|
|
LWSTDAPI SHPropertyBag_ReadPIDL(IPropertyBag *ppb, LPCWSTR pwzPropName, LPITEMIDLIST* ppidl);
|
|
LWSTDAPI SHPropertyBag_WritePIDL(IPropertyBag *ppb, LPCWSTR pwzPropName, LPCITEMIDLIST pidl);
|
|
LWSTDAPI SHPropertyBag_ReadPOINTL(IPropertyBag* ppb, LPCWSTR pwzPropName, POINTL* ppt);
|
|
LWSTDAPI SHPropertyBag_WritePOINTL(IPropertyBag* ppb, LPCWSTR pwzPropName, const POINTL* ppt);
|
|
LWSTDAPI SHPropertyBag_ReadPOINTS(IPropertyBag* ppb, LPCWSTR pwzPropName, POINTS* ppt);
|
|
LWSTDAPI SHPropertyBag_WritePOINTS(IPropertyBag* ppb, LPCWSTR pwzPropName, const POINTS* ppt);
|
|
LWSTDAPI SHPropertyBag_ReadRECTL(IPropertyBag* ppb, LPCWSTR pwzPropName, RECTL* prc);
|
|
LWSTDAPI SHPropertyBag_WriteRECTL(IPropertyBag* ppb, LPCWSTR pwzPropName, const RECTL* prc);
|
|
LWSTDAPI SHPropertyBag_ReadStream(IPropertyBag* ppb, LPCWSTR pwzPropName, IStream** ppstm);
|
|
LWSTDAPI SHPropertyBag_WriteStream(IPropertyBag* ppb, LPCWSTR pwzPropName, IStream* pstm);
|
|
LWSTDAPI SHPropertyBag_Delete(IPropertyBag* ppb, LPCWSTR pszPropName);
|
|
|
|
// Doc'ed for DOJ compliance
|
|
;end_internal
|
|
#define SHGVSPB_PERUSER 0x00000001 // must have one of PERUSER or ALLUSERS
|
|
#define SHGVSPB_ALLUSERS 0x00000002
|
|
#define SHGVSPB_PERFOLDER 0x00000004 // must have one of PERFOLDER ALLFOLDERS or INHERIT
|
|
#define SHGVSPB_ALLFOLDERS 0x00000008
|
|
#define SHGVSPB_INHERIT 0x00000010
|
|
#define SHGVSPB_ROAM 0x00000020 // modifies the above
|
|
#define SHGVSPB_NOAUTODEFAULTS 0x80000000 // turns off read delegation to more general property bags
|
|
|
|
#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
|
|
#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS)
|
|
#define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS)
|
|
#define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS)
|
|
|
|
LWSTDAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPCWSTR pszBagName, DWORD dwFlags, REFIID riid, void** ppv);
|
|
;begin_internal
|
|
|
|
LWSTDAPI_(ULONG) SHGetPerScreenResName(WCHAR* pszRes, ULONG cch, DWORD dwVersion);
|
|
|
|
//
|
|
// SH(Get/Set)IniStringUTF7
|
|
//
|
|
// These are just like Get/WriteProfileString except that if the KeyName
|
|
// begins with SZ_CANBEUNICODE, we will use SHGetIniString instead of
|
|
// the profile functions. (The SZ_CANBEUNICODE will be stripped off
|
|
// before calling SHGetIniString.) This allows us to stash unicode
|
|
// strings into INI files (which are ASCII) by encoding them as UTF7.
|
|
//
|
|
// In other words, SHGetIniStringUTF7("Settings", SZ_CANBEUNICODE "Name", ...)
|
|
// will read from section "Settings", key name "Name", but will also
|
|
// look at the UTF7-encoded version stashed in the "Settings.W" section.
|
|
//
|
|
#define CH_CANBEUNICODEW L'@'
|
|
|
|
LWSTDAPI_(DWORD) SHGetIniStringUTF7W(LPCWSTR lpSection, LPCWSTR lpKey, LPWSTR lpBuf, DWORD nSize, LPCWSTR lpFile);
|
|
LWSTDAPI_(BOOL) SHSetIniStringUTF7W(LPCWSTR lpSection, LPCWSTR lpKey, LPCWSTR lpString, LPCWSTR lpFile);
|
|
#ifdef UNICODE
|
|
#define SZ_CANBEUNICODE TEXT("@")
|
|
#define SHSetIniStringUTF7 SHSetIniStringUTF7W
|
|
#define SHGetIniStringUTF7 SHGetIniStringUTF7W
|
|
#else
|
|
#define SZ_CANBEUNICODE TEXT("")
|
|
#define SHGetIniStringUTF7(lpSection, lpKey, lpBuf, nSize, lpFile) \
|
|
GetPrivateProfileStringA(lpSection, lpKey, "", lpBuf, nSize, lpFile)
|
|
#define SHSetIniStringUTF7 WritePrivateProfileStringA
|
|
#endif
|
|
|
|
/*
|
|
* Like PrivateProfileString except that UNICODE strings are encoded so they
|
|
* will successfully round-trip.
|
|
*/
|
|
LWSTDAPI_(DWORD) SHGetIniStringW(LPCWSTR lpSection, LPCWSTR lpKey, LPWSTR lpBuf, DWORD nSize, LPCWSTR lpFile);
|
|
#define SHGetIniStringA(lpSection, lpKey, lpBuf, nSize, lpFile) \
|
|
GetPrivateProfileStringA(lpSection, lpKey, "", lpBuf, nSize, lpFile)
|
|
|
|
LWSTDAPI_(BOOL) SHSetIniStringW(LPCWSTR lpSection, LPCWSTR lpKey, LPCWSTR lpString, LPCWSTR lpFile);
|
|
#define SHSetIniStringA WritePrivateProfileStringA
|
|
|
|
LWSTDAPI CreateURLFileContentsW(LPCWSTR pwszUrl, LPSTR *ppszOut);
|
|
LWSTDAPI CreateURLFileContentsA(LPCSTR pszUrl, LPSTR *ppszOut);
|
|
|
|
#ifdef UNICODE
|
|
#define SHGetIniString SHGetIniStringW
|
|
#define SHSetIniString SHSetIniStringW
|
|
#define CreateURLFileContents CreateURLFileContentsW
|
|
#else
|
|
#define SHGetIniString SHGetIniStringA
|
|
#define SHSetIniString SHSetIniStringA
|
|
#define CreateURLFileContents CreateURLFileContentsA
|
|
#endif // UNICODE
|
|
|
|
#define ISHGDN2_CANREMOVEFORPARSING 0x0001
|
|
LWSTDAPI IShellFolder_GetDisplayNameOf(struct IShellFolder *psf,
|
|
LPCITEMIDLIST pidl, DWORD uFlags, STRRET *pstr, DWORD dwFlags2);
|
|
|
|
LWSTDAPI IShellFolder_ParseDisplayName(struct IShellFolder *psf, HWND hwnd,
|
|
struct IBindCtx *pbc, LPWSTR pszDisplayName, ULONG *pchEaten,
|
|
LPITEMIDLIST *ppidl, ULONG *pdwAttributes);
|
|
|
|
LWSTDAPI IShellFolder_CompareIDs(struct IShellFolder *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
|
|
|
LWSTDAPI IShellFolder_EnumObjects(struct IShellFolder *psf, HWND hwnd,
|
|
DWORD grfFlags, struct IEnumIDList **ppenumIDList);
|
|
|
|
LWSTDAPI_(BOOL) SHIsExpandableFolder(struct IShellFolder *psf, LPCITEMIDLIST pidl);
|
|
LWSTDAPI IContextMenu_Invoke(struct IContextMenu* pcm, HWND hwndOwner, LPCSTR pVerb, UINT fFlags);
|
|
|
|
#ifdef UNICODE
|
|
// SHTruncateString takes a BUFFER SIZE, so subtract 1 to properly null terminate.
|
|
//
|
|
#define SHTruncateString(wzStr, cch) ((cch) ? ((wzStr)[cch-1]=L'\0', (cch-1)) : 0)
|
|
#else
|
|
LWSTDAPI_(int) SHTruncateString(CHAR *sz, int cchBufferSize);
|
|
#endif // UNICODE
|
|
|
|
// SHFormatDateTime flags
|
|
// (FDTF_SHORTDATE and FDTF_LONGDATE are mutually exclusive, as is
|
|
// FDTF_SHORTIME and FDTF_LONGTIME.)
|
|
//
|
|
#define FDTF_SHORTTIME 0x00000001 // eg, "7:48 PM"
|
|
#define FDTF_SHORTDATE 0x00000002 // eg, "3/29/98"
|
|
#define FDTF_DEFAULT (FDTF_SHORTDATE | FDTF_SHORTTIME) // eg, "3/29/98 7:48 PM"
|
|
#define FDTF_LONGDATE 0x00000004 // eg, "Monday, March 29, 1998"
|
|
#define FDTF_LONGTIME 0x00000008 // eg. "7:48:33 PM"
|
|
#define FDTF_RELATIVE 0x00000010 // uses "Yesterday", etc. if possible
|
|
#define FDTF_LTRDATE 0x00000100 // Left To Right reading order
|
|
#define FDTF_RTLDATE 0x00000200 // Right To Left reading order
|
|
|
|
LWSTDAPI_(int) SHFormatDateTime%(const FILETIME UNALIGNED * pft, DWORD * pdwFlags, LPTSTR% pszBuf, UINT cchBuf);
|
|
|
|
LWSTDAPI_(SECURITY_ATTRIBUTES*) SHGetAllAccessSA();
|
|
|
|
LWSTDAPI_(int) SHAnsiToUnicode(LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf);
|
|
LWSTDAPI_(int) SHAnsiToUnicodeCP(UINT uiCP, LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf);
|
|
LWSTDAPI_(int) SHAnsiToAnsi(LPCSTR pszSrc, LPSTR pszDst, int cchBuf);
|
|
LWSTDAPI_(int) SHUnicodeToAnsi(LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf);
|
|
LWSTDAPI_(int) SHUnicodeToAnsiCP(UINT uiCP, LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf);
|
|
LWSTDAPI_(int) SHUnicodeToUnicode(LPCWSTR pwzSrc, LPWSTR pwzDst, int cwchBuf);
|
|
LWSTDAPI_(BOOL) DoesStringRoundTripA(LPCSTR pwszIn, LPSTR pszOut, UINT cchOut);
|
|
LWSTDAPI_(BOOL) DoesStringRoundTripW(LPCWSTR pwszIn, LPSTR pszOut, UINT cchOut);
|
|
#ifdef UNICODE
|
|
#define DoesStringRoundTrip DoesStringRoundTripW
|
|
#else
|
|
#define DoesStringRoundTrip DoesStringRoundTripA
|
|
#endif
|
|
|
|
// The return value from all SH<Type>To<Type> is the size of szDest including the terminater.
|
|
#ifdef UNICODE
|
|
#define SHTCharToUnicode(wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
|
|
#define SHTCharToUnicodeCP(uiCP, wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
|
|
#define SHTCharToAnsi(wzSrc, szDest, cchSize) SHUnicodeToAnsi(wzSrc, szDest, cchSize)
|
|
#define SHTCharToAnsiCP(uiCP, wzSrc, szDest, cchSize) SHUnicodeToAnsiCP(uiCP, wzSrc, szDest, cchSize)
|
|
#define SHUnicodeToTChar(wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
|
|
#define SHUnicodeToTCharCP(uiCP, wzSrc, wzDest, cchSize) SHUnicodeToUnicode(wzSrc, wzDest, cchSize)
|
|
#define SHAnsiToTChar(szSrc, wzDest, cchSize) SHAnsiToUnicode(szSrc, wzDest, cchSize)
|
|
#define SHAnsiToTCharCP(uiCP, szSrc, wzDest, cchSize) SHAnsiToUnicodeCP(uiCP, szSrc, wzDest, cchSize)
|
|
#define SHOtherToTChar(szSrc, szDest, cchSize) SHAnsiToUnicode(szSrc, szDest, cchSize)
|
|
#define SHTCharToOther(szSrc, szDest, cchSize) SHUnicodeToAnsi(szSrc, szDest, cchSize)
|
|
#else // UNICODE
|
|
#define SHTCharToUnicode(szSrc, wzDest, cchSize) SHAnsiToUnicode(szSrc, wzDest, cchSize)
|
|
#define SHTCharToUnicodeCP(uiCP, szSrc, wzDest, cchSize) SHAnsiToUnicodeCP(uiCP, szSrc, wzDest, cchSize)
|
|
#define SHTCharToAnsi(szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
|
|
#define SHTCharToAnsiCP(uiCP, szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
|
|
#define SHUnicodeToTChar(wzSrc, szDest, cchSize) SHUnicodeToAnsi(wzSrc, szDest, cchSize)
|
|
#define SHUnicodeToTCharCP(uiCP, wzSrc, szDest, cchSize) SHUnicodeToAnsiCP(uiCP, wzSrc, szDest, cchSize)
|
|
#define SHAnsiToTChar(szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
|
|
#define SHAnsiToTCharCP(uiCP, szSrc, szDest, cchSize) SHAnsiToAnsi(szSrc, szDest, cchSize)
|
|
#define SHOtherToTChar(szSrc, szDest, cchSize) SHUnicodeToAnsi(szSrc, szDest, cchSize)
|
|
#define SHTCharToOther(szSrc, szDest, cchSize) SHAnsiToUnicode(szSrc, szDest, cchSize)
|
|
#endif // UNICODE
|
|
|
|
// Internal HRESULT-to-help-topic mapping structure
|
|
typedef struct _tagHRESULTHELPMAPPING
|
|
{
|
|
HRESULT hr;
|
|
LPCSTR szHelpFile;
|
|
LPCSTR szHelpTopic;
|
|
} HRESULTHELPMAPPING;
|
|
|
|
LWSTDAPI_(BOOL) SHRegisterClassA(const WNDCLASSA* pwc);
|
|
LWSTDAPI_(BOOL) SHRegisterClassW(const WNDCLASSW* pwc);
|
|
LWSTDAPI_(void) SHUnregisterClassesA(HINSTANCE hinst, const LPCSTR *rgpszClasses, UINT cpsz);
|
|
LWSTDAPI_(void) SHUnregisterClassesW(HINSTANCE hinst, const LPCWSTR *rgpszClasses, UINT cpsz);
|
|
LWSTDAPI_(int) SHMessageBoxHelpW(HWND hwnd, LPCWSTR pszText, LPCWSTR pszCaption, UINT uType, HRESULT hrErr, HRESULTHELPMAPPING* prghhm, DWORD chhm);
|
|
LWSTDAPI_(int) SHMessageBoxHelpA(HWND hwnd, LPCSTR pszText, LPCSTR pszCaption, UINT uType, HRESULT hrErr, HRESULTHELPMAPPING* prghhm, DWORD chhm);
|
|
LWSTDAPI_(int) SHMessageBoxCheckW(HWND hwnd, LPCWSTR pszText, LPCWSTR pszCaption, UINT uType, int iDefault, LPCWSTR pszRegVal);
|
|
LWSTDAPI_(int) SHMessageBoxCheckA(HWND hwnd, LPCSTR pszText, LPCSTR pszCaption, UINT uType, int iDefault, LPCSTR pszRegVal);
|
|
LWSTDAPI_(void) SHRestrictedMessageBox(HWND hwnd);
|
|
LWSTDAPI_(HMENU) SHGetMenuFromID(HMENU hmMain, UINT uID);
|
|
LWSTDAPI_(int) SHMenuIndexFromID(HMENU hm, UINT id);
|
|
LWSTDAPI_(void) SHRemoveDefaultDialogFont(HWND hDlg);
|
|
LWSTDAPI_(void) SHSetDefaultDialogFont(HWND hDlg, int idCtl);
|
|
LWSTDAPI_(void) SHRemoveAllSubMenus(HMENU hmenu);
|
|
LWSTDAPI_(void) SHEnableMenuItem(HMENU hmenu, UINT id, BOOL fEnable);
|
|
LWSTDAPI_(void) SHCheckMenuItem(HMENU hmenu, UINT id, BOOL fChecked);
|
|
LWSTDAPI_(DWORD) SHSetWindowBits(HWND hWnd, int iWhich, DWORD dwBits, DWORD dwValue);
|
|
LWSTDAPI_(HMENU) SHLoadMenuPopup(HINSTANCE hinst, UINT id);
|
|
|
|
#define SPM_POST 0x0000
|
|
#define SPM_SEND 0x0001
|
|
#define SPM_ONELEVEL 0x0002 // default: send to all descendants including grandkids, etc.
|
|
|
|
LWSTDAPI_(void) SHPropagateMessage(HWND hwndParent, UINT uMsg, WPARAM wParam, LPARAM lParam, int iFlags);
|
|
LWSTDAPI_(void) SHSetParentHwnd(HWND hwnd, HWND hwndParent);
|
|
LWSTDAPI_(UINT) SHGetCurColorRes();
|
|
LWSTDAPI_(DWORD) SHWaitForSendMessageThread(HANDLE hThread, DWORD dwTimeout);
|
|
LWSTDAPI SHWaitForCOMSendMessageThread(HANDLE hThread, DWORD dwTimeout);
|
|
LWSTDAPI_(BOOL) SHVerbExistsNA(LPCSTR szExtension, LPCSTR pszVerb, LPSTR pszCommand, DWORD cchCommand);
|
|
LWSTDAPI_(void) SHFillRectClr(HDC hdc, LPRECT prc, COLORREF clr);
|
|
LWSTDAPI_(int) SHSearchMapInt(const int *src, const int *dst, int cnt, int val);
|
|
LWSTDAPI_(CHAR) SHStripMneumonicA(LPSTR pszMenu);
|
|
LWSTDAPI_(WCHAR) SHStripMneumonicW(LPWSTR pszMenu);
|
|
LWSTDAPI SHIsChildOrSelf(HWND hwndParent, HWND hwnd);
|
|
LWSTDAPI_(DWORD) SHGetValueGoodBootA(HKEY hkeyParent, LPCSTR pcszSubKey,
|
|
LPCSTR pcszValue, PDWORD pdwValueType,
|
|
PBYTE pbyteBuf, PDWORD pdwcbBufLen);
|
|
LWSTDAPI_(DWORD) SHGetValueGoodBootW(HKEY hkeyParent, LPCWSTR pcwzSubKey,
|
|
LPCWSTR pcwzValue, PDWORD pdwValueType,
|
|
PBYTE pbyteBuf, PDWORD pdwcbBufLen);
|
|
LWSTDAPI_(LRESULT) SHDefWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
LWSTDAPI_(BOOL) SHGetFileDescription%(LPCTSTR% pszPath, LPCTSTR% pszVersionKeyIn, LPCTSTR% pszCutListIn, LPTSTR% pszDesc, UINT *pcchDesc);
|
|
|
|
LWSTDAPI_(int) SHMessageBoxCheckEx%(HWND hwnd, HINSTANCE hinst, LPCTSTR% pszTemplateName, DLGPROC pDlgProc, LPVOID pData, int iDefault, LPCTSTR% pszRegVal);
|
|
|
|
#define IDC_MESSAGEBOXCHECKEX 0x1202
|
|
|
|
// Prevents shell hang do to hung window on broadcast
|
|
LWSTDAPI_(LRESULT) SHSendMessageBroadcast%(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
#ifdef UNICODE
|
|
#define SHGetValueGoodBoot SHGetValueGoodBootW
|
|
#define SHStripMneumonic SHStripMneumonicW
|
|
#define SHMessageBoxHelp SHMessageBoxHelpW
|
|
#define SHMessageBoxCheck SHMessageBoxCheckW
|
|
#define SHRegisterClass SHRegisterClassW
|
|
#define SHUnregisterClasses SHUnregisterClassesW
|
|
#define SHSendMessageBroadcast SHSendMessageBroadcastW
|
|
#else // UNICODE
|
|
#define SHGetValueGoodBoot SHGetValueGoodBootA
|
|
#define SHStripMneumonic SHStripMneumonicA
|
|
#define SHMessageBoxHelp SHMessageBoxHelpA
|
|
#define SHMessageBoxCheck SHMessageBoxCheckA
|
|
#define SHRegisterClass SHRegisterClassA
|
|
#define SHUnregisterClasses SHUnregisterClassesA
|
|
#define SHSendMessageBroadcast SHSendMessageBroadcastA
|
|
#endif // UNICODE
|
|
|
|
|
|
// old IsOS() flags -- don't use these
|
|
// we have to keep them public since we shipped them in win2k ;internal
|
|
#define OS_MEMPHIS OS_WIN98ORGREATER // don't use this
|
|
#define OS_MEMPHIS_GOLD OS_WIN98_GOLD // don't use this
|
|
#define OS_WIN95GOLD OS_WIN95_GOLD
|
|
#define OS_WIN2000EMBED OS_EMBEDDED
|
|
#define OS_WIN2000 OS_WIN2000ORGREATER // lame, but IsOS(WIN2000) meant >= win2k
|
|
#define OS_WIN95 OS_WIN95ORGREATER // lame, but IsOS(WIN95) meant >= win95
|
|
#define OS_NT4 OS_NT4ORGREATER // lame, but IsOS(NT4) meant >= NT4
|
|
#define OS_NT5 OS_WIN2000ORGREATER // lame, but IsOS(NT5) meant >= wink2
|
|
#define OS_WIN98 OS_WIN98ORGREATER // lame, but IsOS(OS_WIN98) meant >= win98
|
|
#define OS_MILLENNIUM OS_MILLENNIUMORGREATER // lame, but IsOS(OS_MILLENNIUM) meant >= winMe
|
|
// end old flags
|
|
|
|
|
|
// Returns TRUE/FALSE depending on question
|
|
#define OS_WINDOWS 0 // windows vs. NT
|
|
#define OS_NT 1 // windows vs. NT
|
|
#define OS_WIN95ORGREATER 2 // Win95 or greater
|
|
#define OS_NT4ORGREATER 3 // NT4 or greater
|
|
// don't use (used to be OS_NT5) 4 // this flag is redundant w/ OS_WIN2000ORGREATER, use that instead ;internal
|
|
#define OS_WIN98ORGREATER 5 // Win98 or greater
|
|
#define OS_WIN98_GOLD 6 // Win98 Gold (Version 4.10 build 1998)
|
|
#define OS_WIN2000ORGREATER 7 // Some derivative of Win2000
|
|
|
|
;begin_internal
|
|
// NOTE: these flags are bogus, they check explicitly for (dwMajorVersion == 5) so they will fail when majorversion is bumped to 6
|
|
// !!! DO NOT USE THESE FLAGS !!!
|
|
#define OS_WIN2000PRO 8 // Windows 2000 Professional (Workstation)
|
|
#define OS_WIN2000SERVER 9 // Windows 2000 Server
|
|
#define OS_WIN2000ADVSERVER 10 // Windows 2000 Advanced Server
|
|
#define OS_WIN2000DATACENTER 11 // Windows 2000 Data Center Server
|
|
#define OS_WIN2000TERMINAL 12 // Windows 2000 Terminal Server in "Application Server" mode (now simply called "Terminal Server")
|
|
// END bogus flags
|
|
;end_internal
|
|
|
|
#define OS_EMBEDDED 13 // Embedded Windows Edition
|
|
#define OS_TERMINALCLIENT 14 // Windows Terminal Client (eg user is comming in via tsclient)
|
|
#define OS_TERMINALREMOTEADMIN 15 // Terminal Server in "Remote Administration" mode
|
|
#define OS_WIN95_GOLD 16 // Windows 95 Gold (Version 4.0 Build 1995)
|
|
#define OS_MILLENNIUMORGREATER 17 // Windows Millennium (Version 5.0)
|
|
|
|
#define OS_WHISTLERORGREATER 18 // Whistler or greater
|
|
#define OS_PERSONAL 19 // Personal (eg NOT Professional, Server, Advanced Server, or Datacenter)
|
|
#if (_WIN32_IE >= 0x0600)
|
|
#define OS_PROFESSIONAL 20 // Professional (aka Workstation; eg NOT Server, Advanced Server, or Datacenter)
|
|
#define OS_DATACENTER 21 // Datacenter (eg NOT Server, Advanced Server, Professional, or Personal)
|
|
#define OS_ADVSERVER 22 // Advanced Server (eg NOT Datacenter, Server, Professional, or Personal)
|
|
#define OS_SERVER 23 // Server (eg NOT Datacenter, Advanced Server, Professional, or Personal)
|
|
|
|
#define OS_TERMINALSERVER 24 // Terminal Server - server running in what used to be called "Application Server" mode (now simply called "Terminal Server")
|
|
// OS_TERMINALREMOTEADMIN 15 // Terminal Server - server running in "Remote Administration" mode
|
|
#define OS_PERSONALTERMINALSERVER 25 // Personal Terminal Server - per/pro machine running in single user TS mode
|
|
#define OS_FASTUSERSWITCHING 26 // Fast User Switching
|
|
#define OS_FRIENDLYLOGONUI 27 // New friendly logon UI
|
|
#define OS_DOMAINMEMBER 28 // Is this machine a member of a domain (eg NOT a workgroup)
|
|
#define OS_ANYSERVER 29 // is this machine any type of server? (eg datacenter or advanced server or server)?
|
|
#define OS_WOW6432 30 // Is this process a 32-bit process running on an 64-bit platform?
|
|
#define OS_BLADE 31 // Blade Server
|
|
#define OS_SMALLBUSINESSSERVER 32 // SBS Server
|
|
// Added for .NET Server
|
|
#define OS_TABLETPC 33 // Are we running on a TabletPC?
|
|
#define OS_SERVERADMINUI 34 // Should defaults lean towards those preferred by server administrators?
|
|
|
|
#define OS_MEDIACENTER 35 // eHome Freestyle Project
|
|
#define OS_APPLIANCE 36 // Windows .NET Appliance Server
|
|
|
|
#endif // _WIN32_IE >= 0x0600
|
|
|
|
LWSTDAPI_(BOOL) IsOS(DWORD dwOS);
|
|
|
|
///// BEGIN Private CommandTarget helpers
|
|
//*** IOleCommandTarget helpers {
|
|
|
|
//*** octd -- OleCT direction
|
|
// NOTES
|
|
// used both as a return value from IsXxxForward, and as an iUpDown
|
|
// param for MayXxxForward.
|
|
enum octd {
|
|
// do *not* change these values; we rely upon all 3 of:
|
|
// - sign +/-
|
|
// - powers of 2
|
|
// - (?) broadcast > down
|
|
OCTD_DOWN=+1,
|
|
OCTD_DOWNBROADCAST=+2,
|
|
OCTD_UP=-1
|
|
};
|
|
|
|
|
|
#ifndef RC_INVOKED /* { rc doesn't like these long symbol names */
|
|
#ifdef __IOleCommandTarget_INTERFACE_DEFINED__
|
|
HRESULT IsQSForward(const GUID *pguidCmdGroup, int cCmds, OLECMD rgCmds[]);
|
|
// WARNING: note the hoaky cast of nCmdID to a struct ptr
|
|
#define IsExecForward(pguidCmdGroup, nCmdID) \
|
|
IsQSForward(pguidCmdGroup, 1, (OLECMD *) &nCmdID)
|
|
|
|
HRESULT MayQSForward(IUnknown *punk, int iUpDown, const GUID *pguidCmdGroup,
|
|
ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
|
|
HRESULT MayExecForward(IUnknown *punk, int iUpDown, const GUID *pguidCmdGroup,
|
|
DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
|
|
#endif //__IOleCommandTarget_INTERFACE_DEFINED__
|
|
#endif /* } !RC_INVOKED */
|
|
// }
|
|
///// end
|
|
|
|
|
|
|
|
typedef struct _FDSA {
|
|
// cItem *must* be at beginning of struct for GetItemCount() to work
|
|
int cItem; // # elements
|
|
void * aItem; // data for elements (either static or dynamic)
|
|
int cItemAlloc; // # of elements currently alloc'ed (>= cItem)
|
|
int cItemGrow:8; // # of elements to grow cItemAlloc by
|
|
int cbItem:8; // sizeof element
|
|
DWORD fAllocated:1; // 1:overflowed from static to dynamic array
|
|
DWORD unused:15;
|
|
} FDSA, *PFDSA;
|
|
|
|
LWSTDAPI_(BOOL) FDSA_Initialize(int cbItem, int cItemGrow, PFDSA pfdsa, void * aItemStatic, int cItemStatic);
|
|
LWSTDAPI_(BOOL) FDSA_Destroy(PFDSA pfdsa);
|
|
LWSTDAPI_(int) FDSA_InsertItem(PFDSA pfdsa, int index, void * pitem);
|
|
LWSTDAPI_(BOOL) FDSA_DeleteItem(PFDSA pfdsa, int index);
|
|
|
|
#define FDSA_AppendItem(pfdsa, pitem) FDSA_InsertItem(pfdsa, DA_LAST, pitem)
|
|
#define FDSA_GetItemPtr(pfdsa, i, type) (&(((type *)((pfdsa)->aItem))[(i)]))
|
|
#define FDSA_GetItemCount(hdsa) (*(int *)(hdsa))
|
|
|
|
|
|
|
|
|
|
#if defined( __LPGUID_DEFINED__ )
|
|
// Copied from OLE source code
|
|
// format for string form of GUID is:
|
|
// ????{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}
|
|
#define GUIDSTR_MAX (1+ 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12 + 1 + 1)
|
|
|
|
LWSTDAPI_(BOOL) GUIDFromString%(LPCTSTR% psz, LPGUID pguid);
|
|
|
|
#endif
|
|
|
|
#ifdef _REFGUID_DEFINED
|
|
LWSTDAPI_(int) SHStringFromGUID%(UNALIGNED REFGUID rguid, LPTSTR% psz, int cchMax);
|
|
|
|
LWSTDAPI SHRegGetCLSIDKey%(UNALIGNED REFGUID rguid, LPCTSTR% lpszSubKey, BOOL fUserSpecific, BOOL fCreate, HKEY *phkey);
|
|
|
|
LWSTDAPI_(HANDLE) SHGlobalCounterCreate(REFGUID rguid);
|
|
LWSTDAPI_(HANDLE) SHGlobalCounterCreateNamed%(LPCTSTR% szName, LONG lInitialValue);
|
|
LWSTDAPI_(long) SHGlobalCounterGetValue(HANDLE hCounter);
|
|
LWSTDAPI_(long) SHGlobalCounterIncrement(HANDLE hCounter);
|
|
LWSTDAPI_(long) SHGlobalCounterDecrement(HANDLE hCounter);
|
|
#define SHGlobalCounterDestroy CloseHandle
|
|
#endif
|
|
|
|
// WNDPROCs are thunked by user to send ANSI/UNICODE messages (ex: WM_WININICHANGE)
|
|
// so providing a W version that automatically thunks to the A version
|
|
// is dangerous. but we do it anyway. if a caller needs to work on both win95 and NT
|
|
// it needs to be aware that on win95 the W version actually calls the A version.
|
|
// thus all worker windows on win95 are ANSI. this should rarely affect worker wndprocs
|
|
// because they are internal, and the messages are usually custom. but system messages
|
|
// like WM_WININICHANGE, and the WM_DDE* messages will be changed accordingly
|
|
HWND SHCreateWorkerWindowA(WNDPROC pfnWndProc, HWND hwndParent, DWORD dwExStyle, DWORD dwFlags, HMENU hmenu, void * p);
|
|
HWND SHCreateWorkerWindowW(WNDPROC pfnWndProc, HWND hwndParent, DWORD dwExStyle, DWORD dwFlags, HMENU hmenu, void * p);
|
|
#ifdef UNICODE
|
|
#define SHCreateWorkerWindow SHCreateWorkerWindowW
|
|
#else
|
|
#define SHCreateWorkerWindow SHCreateWorkerWindowA
|
|
#endif
|
|
|
|
BOOL SHAboutInfoA(LPSTR lpszInfo, DWORD cchSize);
|
|
BOOL SHAboutInfoW(LPWSTR lpszInfo, DWORD cchSize);
|
|
|
|
#ifdef UNICODE
|
|
#define SHAboutInfo SHAboutInfoW
|
|
#else
|
|
#define SHAboutInfo SHAboutInfoA
|
|
#endif
|
|
|
|
// Types for SHIsLowMemoryMachine
|
|
#define ILMM_IE4 0 // 1997-style machine
|
|
|
|
LWSTDAPI_(BOOL) SHIsLowMemoryMachine(DWORD dwType);
|
|
|
|
LWSTDAPI_(HINSTANCE) SHPinDllOfCLSID(const CLSID *pclsid);
|
|
|
|
// Menu Helpers
|
|
LWSTDAPI_(int) GetMenuPosFromID(HMENU hmenu, UINT id);
|
|
|
|
LWSTDAPI SHGetInverseCMAP(BYTE *pbMap, ULONG cbMap);
|
|
|
|
//
|
|
// Shared memory apis
|
|
//
|
|
|
|
LWSTDAPI_(HANDLE) SHAllocShared(const void *pvData, DWORD dwSize, DWORD dwProcessId);
|
|
LWSTDAPI_(BOOL) SHFreeShared(HANDLE hData,DWORD dwProcessId);
|
|
LWSTDAPI_(void *) SHLockShared(HANDLE hData, DWORD dwProcessId);
|
|
LWSTDAPI_(void *) SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL fForWriting);
|
|
LWSTDAPI_(BOOL) SHUnlockShared(void *pvData);
|
|
LWSTDAPI_(HANDLE) SHMapHandle(HANDLE h, DWORD dwProcSrc, DWORD dwProcDest, DWORD dwDesiredAccess, DWORD dwFlags);
|
|
|
|
//
|
|
// Shared memory structs
|
|
//
|
|
|
|
#define MAPHEAD_SIG 0xbaff1aff
|
|
|
|
typedef struct _shmapheader {
|
|
DWORD dwSize;
|
|
DWORD dwSig;
|
|
DWORD dwSrcId;
|
|
DWORD dwDstId;
|
|
} SHMAPHEADER; // NOTE: should always be QUADWORD alignment
|
|
|
|
|
|
#ifdef UNIX
|
|
#include <urlmon.h>
|
|
#endif /* UNIX */
|
|
|
|
//
|
|
// Zone Security APIs
|
|
//
|
|
LWSTDAPI ZoneCheckPathA(LPCSTR pszPath, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
LWSTDAPI ZoneCheckPathW(LPCWSTR pwzPath, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
|
|
LWSTDAPI ZoneCheckUrlA(LPCSTR pszUrl, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
LWSTDAPI ZoneCheckUrlW(LPCWSTR pwzUrl, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
LWSTDAPI ZoneCheckUrlExA(LPCSTR pszUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
LWSTDAPI ZoneCheckUrlExW(LPCWSTR pwzUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms);
|
|
LWSTDAPI ZoneCheckUrlExCacheA(LPCSTR pszUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize,
|
|
DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms, IInternetSecurityManager ** ppismCache);
|
|
LWSTDAPI ZoneCheckUrlExCacheW(LPCWSTR pwzUrl, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext, DWORD dwContextSize,
|
|
DWORD dwActionType, DWORD dwFlags, IInternetSecurityMgrSite * pisms, IInternetSecurityManager ** ppismCache);
|
|
|
|
LWSTDAPI ZoneCheckHost(IInternetHostSecurityManager * pihsm, DWORD dwActionType, DWORD dwFlags);
|
|
LWSTDAPI ZoneCheckHostEx(IInternetHostSecurityManager * pihsm, DWORD * pdwPolicy, DWORD dwPolicySize, DWORD * pdwContext,
|
|
DWORD dwContextSize, DWORD dwActionType, DWORD dwFlags);
|
|
LWSTDAPI_(int) ZoneComputePaneSize(HWND hwndStatus);
|
|
LWSTDAPI_(void) ZoneConfigureW(HWND hwnd, LPCWSTR pwszUrl);
|
|
|
|
#ifdef UNICODE
|
|
#define ZoneCheckUrl ZoneCheckUrlW
|
|
#define ZoneCheckPath ZoneCheckPathW
|
|
#define ZoneCheckUrlEx ZoneCheckUrlExW
|
|
#define ZoneCheckUrlExCache ZoneCheckUrlExCacheW
|
|
#else // UNICODE
|
|
#define ZoneCheckUrl ZoneCheckUrlA
|
|
#define ZoneCheckPath ZoneCheckPathA
|
|
#define ZoneCheckUrlEx ZoneCheckUrlExA
|
|
#define ZoneCheckUrlExCache ZoneCheckUrlExCacheA
|
|
#endif // UNICODE
|
|
|
|
LWSTDAPI SHRegisterValidateTemplate(LPCWSTR pwzTemplate, DWORD dwFlags);
|
|
|
|
// Flags for SHRegisterValidateTemplate
|
|
#define SHRVT_REGISTER 0x00000001
|
|
#define SHRVT_VALIDATE 0x00000002
|
|
#define SHRVT_PROMPTUSER 0x00000004
|
|
#define SHRVT_REGISTERIFPROMPTOK 0x00000008
|
|
#define SHRVT_ALLOW_INTRANET 0x00000010
|
|
#define SHRVT_VALID 0x0000001f
|
|
|
|
BOOL RegisterGlobalHotkeyW(WORD wOldHotkey, WORD wNewHotkey,LPCWSTR pcwszPath);
|
|
BOOL RegisterGlobalHotkeyA(WORD wOldHotkey, WORD wNewHotkey,LPCSTR pcszPath);
|
|
|
|
LWSTDAPI_(UINT) WhichPlatform(void);
|
|
|
|
// Return values of WhichPlatform
|
|
#define PLATFORM_UNKNOWN 0
|
|
#define PLATFORM_IE3 1 // obsolete: use PLATFORM_BROWSERONLY
|
|
#define PLATFORM_BROWSERONLY 1 // browser-only (no new shell)
|
|
#define PLATFORM_INTEGRATED 2 // integrated shell
|
|
|
|
#ifdef UNICODE
|
|
#define RegisterGlobalHotkey RegisterGlobalHotkeyW
|
|
#else // UNICODE
|
|
#define RegisterGlobalHotkey RegisterGlobalHotkeyA
|
|
#endif // UNICODE
|
|
|
|
// qistub {
|
|
|
|
//*** QueryInterface helpers
|
|
// NOTES
|
|
// ATL has a fancier version of this. if we need to extend ours, we
|
|
// should probably just switch to ATL's rather than reinvent.
|
|
// EXAMPLE
|
|
// Cfoo::QI(REFIID riid, void **ppv)
|
|
// {
|
|
// // (the IID_xxx comments make grep'ing work!)
|
|
// static const QITAB qit = {
|
|
// QITABENT(Cfoo, Iiface1), // IID_Iiface1
|
|
// ...
|
|
// QITABENT(Cfoo, IifaceN), // IID_IifaceN
|
|
// { 0 }, // n.b. don't forget the 0
|
|
// };
|
|
//
|
|
// // n.b. make sure you don't cast 'this'
|
|
// hr = QISearch(this, qit, riid, ppv);
|
|
// if (FAILED(hr))
|
|
// hr = SUPER::QI(riid, ppv);
|
|
// // custom code could be added here for FAILED() case
|
|
// return hr;
|
|
// }
|
|
|
|
typedef struct
|
|
{
|
|
const IID * piid;
|
|
int dwOffset;
|
|
} QITAB, *LPQITAB;
|
|
typedef const QITAB *LPCQITAB;
|
|
|
|
#define QITABENTMULTI(Cthis, Ifoo, Iimpl) \
|
|
{ (IID*) &IID_##Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
|
|
|
|
#define QITABENTMULTI2(Cthis, Ifoo, Iimpl) \
|
|
{ (IID*) &Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
|
|
|
|
#define QITABENT(Cthis, Ifoo) QITABENTMULTI(Cthis, Ifoo, Ifoo)
|
|
|
|
STDAPI QISearch(void* that, LPCQITAB pqit, REFIID riid, void **ppv);
|
|
|
|
|
|
#ifndef STATIC_CAST
|
|
//*** STATIC_CAST -- 'portable' static_cast<>
|
|
// NOTES
|
|
// do *not* use SAFE_CAST (see comment in OFFSETOFCLASS)
|
|
#define STATIC_CAST(typ) static_cast<typ>
|
|
#ifndef _X86_
|
|
// assume only intel compiler (>=vc5) supports static_cast for now
|
|
// we could key off of _MSC_VER >= 1100 but i'm not sure that will work
|
|
//
|
|
// a straight cast will give the correct result but no error checking,
|
|
// so we'll have to catch errors on intel.
|
|
#undef STATIC_CAST
|
|
#define STATIC_CAST(typ) (typ)
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef OFFSETOFCLASS
|
|
//*** OFFSETOFCLASS -- (stolen from ATL)
|
|
// we use STATIC_CAST not SAFE_CAST because the compiler gets confused
|
|
// (it doesn't constant-fold the ,-op in SAFE_CAST so we end up generating
|
|
// code for the table!)
|
|
|
|
#define OFFSETOFCLASS(base, derived) \
|
|
((DWORD)(DWORD_PTR)(STATIC_CAST(base*)((derived*)8))-8)
|
|
#endif
|
|
|
|
// } qistub
|
|
|
|
|
|
#if (_WIN32_IE >= 0x0500)
|
|
|
|
// SHRestrictionLookup
|
|
typedef struct
|
|
{
|
|
INT iFlag;
|
|
LPCWSTR pszKey;
|
|
LPCWSTR pszValue;
|
|
} SHRESTRICTIONITEMS;
|
|
|
|
LWSTDAPI_(DWORD) SHRestrictionLookup(INT iFlag, LPCWSTR pszBaseKey,
|
|
const SHRESTRICTIONITEMS *pRestrictions,
|
|
DWORD* rdwRestrictionItemValues);
|
|
LWSTDAPI_(DWORD) SHGetRestriction(LPCWSTR pszBaseKey, LPCWSTR pszGroup, LPCWSTR pszSubKey);
|
|
|
|
typedef INT_PTR (CALLBACK* SHDLGPROC)(void *lpData, HWND, UINT, WPARAM, LPARAM);
|
|
LWSTDAPI_(INT_PTR) SHDialogBox(HINSTANCE hInstance, LPCWSTR lpTemplateName,
|
|
HWND hwndParent, SHDLGPROC lpDlgFunc, void*lpData);
|
|
|
|
LWSTDAPI SHInvokeDefaultCommand(HWND hwnd, struct IShellFolder* psf, LPCITEMIDLIST pidl);
|
|
LWSTDAPI SHInvokeCommand(HWND hwnd, struct IShellFolder* psf, LPCITEMIDLIST pidl, LPCSTR lpVerb);
|
|
LWSTDAPI SHInvokeCommandOnContextMenu(HWND hwnd, struct IUnknown* punk, struct IContextMenu *pcm, DWORD fMask, LPCSTR lpVerb);
|
|
LWSTDAPI SHInvokeCommandsOnContextMenu(HWND hwnd, struct IUnknown* punk, struct IContextMenu *pcm, DWORD fMask, const LPCSTR rgszVerbs[], UINT cVerbs);
|
|
LWSTDAPI SHForwardContextMenuMsg(struct IContextMenu* pcm, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult, BOOL fAllowICM2);
|
|
LWSTDAPI IUnknown_DoContextMenuPopup(struct IUnknown *punkSite, struct IContextMenu* pcm, UINT fFlags, POINT pt);
|
|
|
|
#endif // _WIN32_IE >= 0x0500
|
|
|
|
//============= Internal Routines that are always to be built ================
|
|
LWSTDAPI_(DWORD)
|
|
GetLongPathNameWrapW(
|
|
LPCWSTR lpszShortPath,
|
|
LPWSTR lpszLongPath,
|
|
DWORD cchBuffer);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetLongPathNameWrapA(
|
|
LPCSTR lpszShortPath,
|
|
LPSTR lpszLongPath,
|
|
DWORD cchBuffer);
|
|
|
|
#ifdef UNICODE
|
|
#define GetLongPathNameWrap GetLongPathNameWrapW
|
|
#else
|
|
#define GetLongPathNameWrap GetLongPathNameWrapA
|
|
#endif //UNICODE
|
|
|
|
|
|
//=============== Unicode Wrapper Routines ===================================
|
|
|
|
#if (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK)
|
|
|
|
//
|
|
// There are two styles of usage for the wrap functions.
|
|
//
|
|
// * Explicit wrapping.
|
|
//
|
|
// If you explicitly call GetPropWrap (for example), then
|
|
// your UNICODE build will call the wrapper function, and your ANSI
|
|
// build will call the normal ANSI API directly.
|
|
//
|
|
// Calls to GetProp, GetPropW, and GetPropA still go
|
|
// directly to the underlying system DLL that implements them.
|
|
//
|
|
// This lets you select which calls to UNICODE APIs should get
|
|
// wrapped and which should go straight through to the OS
|
|
// (and most likely fail on Win95).
|
|
//
|
|
// * Automatic wrapping.
|
|
//
|
|
// If you #include <w95wraps.h>, then when you call GetProp,
|
|
// your UNICODE build will call the wrapper function, and your ANSI
|
|
// ANSI build will call the normal ANSI API directly.
|
|
//
|
|
// This lets you just call the UNICODE APIs normally throughout
|
|
// your code, and the wrappers will do their best.
|
|
//
|
|
// Here's a table explaining what you get under the various scenarios.
|
|
//
|
|
// You Get
|
|
// <w95wraps.h> <w95wraps.h>
|
|
// You Write UNICODE ANSI UNICODE ANSI
|
|
// ============ ============ ============ ============ ============
|
|
// GetProp GetPropW GetPropA GetPropWrapW GetPropA
|
|
// GetPropWrap GetPropWrapW GetPropA GetPropWrapW GetPropA
|
|
//
|
|
// GetPropW GetPropW GetPropW GetPropWrapW GetPropWrapW
|
|
// GetPropA GetPropA GetPropA GetPropA GetPropA
|
|
// GetPropWrapW GetPropWrapW GetPropWrapW GetPropWrapW GetPropWrapW
|
|
// GetPropWrapA GetPropA GetPropA GetPropA GetPropA
|
|
//
|
|
// Final quirk: If you are running on a non-x86 platform, then the
|
|
// wrap functions are forwarded to the unwrapped functions, since
|
|
// the only OS that runs on non-x86 is NT.
|
|
//
|
|
// Before using the wrapper functions, see the warnings at the top of
|
|
// <w95wraps.h> to make sure you understand the consequences.
|
|
//
|
|
LWSTDAPI_(BOOL) IsCharAlphaWrapW(IN WCHAR ch);
|
|
LWSTDAPI_(BOOL) IsCharUpperWrapW(IN WCHAR ch);
|
|
LWSTDAPI_(BOOL) IsCharLowerWrapW(IN WCHAR ch);
|
|
LWSTDAPI_(BOOL) IsCharAlphaNumericWrapW(IN WCHAR ch);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
AppendMenuWrapW(
|
|
IN HMENU hMenu,
|
|
IN UINT uFlags,
|
|
IN UINT_PTR uIDNewItem,
|
|
IN LPCWSTR lpNewItem
|
|
);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
CallWindowProcWrapW(
|
|
WNDPROC lpPrevWndFunc,
|
|
HWND hWnd,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
#ifdef POST_IE5_BETA
|
|
LWSTDAPI_(BOOL) CallMsgFilterWrapW(LPMSG lpMsg, int nCode);
|
|
#endif
|
|
|
|
LWSTDAPI_(LPWSTR) CharLowerWrapW( LPWSTR pch );
|
|
|
|
LWSTDAPI_(DWORD) CharLowerBuffWrapW( LPWSTR pch, DWORD cchLength );
|
|
|
|
LWSTDAPI_(LPWSTR) CharNextWrapW(LPCWSTR lpszCurrent);
|
|
LWSTDAPI_(LPWSTR) CharPrevWrapW(LPCWSTR lpszStart, LPCWSTR lpszCurrent);
|
|
LWSTDAPI_(BOOL) CharToOemWrapW(LPCWSTR lpszSrc, LPSTR lpszDst);
|
|
LWSTDAPI_(LPWSTR) CharUpperWrapW( LPWSTR pch );
|
|
LWSTDAPI_(DWORD) CharUpperBuffWrapW( LPWSTR pch, DWORD cchLength );
|
|
|
|
LWSTDAPI_(HRESULT) CLSIDFromStringWrap(LPOLESTR lpsz, LPCLSID pclsid);
|
|
LWSTDAPI_(HRESULT) CLSIDFromProgIDWrap(LPCOLESTR lpszProgID, LPCLSID lpclsid);
|
|
|
|
LWSTDAPI_(int)
|
|
CompareStringWrapW(
|
|
LCID Locale,
|
|
DWORD dwCmpFlags,
|
|
LPCWSTR lpString1,
|
|
int cchCount1,
|
|
LPCWSTR lpString2,
|
|
int cchCount2);
|
|
|
|
LWSTDAPI_(int)
|
|
CopyAcceleratorTableWrapW(
|
|
HACCEL hAccelSrc,
|
|
LPACCEL lpAccelDst,
|
|
int cAccelEntries);
|
|
|
|
LWSTDAPI_(HACCEL)
|
|
CreateAcceleratorTableWrapW(LPACCEL lpAccel, int cEntries);
|
|
|
|
LWSTDAPI_(HDC)
|
|
CreateDCWrapW(
|
|
LPCWSTR lpszDriver,
|
|
LPCWSTR lpszDevice,
|
|
LPCWSTR lpszOutput,
|
|
CONST DEVMODEW * lpInitData);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
CreateDirectoryWrapW(
|
|
LPCWSTR lpPathName,
|
|
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
CreateEventWrapW(
|
|
LPSECURITY_ATTRIBUTES lpEventAttributes,
|
|
BOOL bManualReset,
|
|
BOOL bInitialState,
|
|
LPCWSTR lpName);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
CreateFileWrapW(
|
|
LPCWSTR lpFileName,
|
|
DWORD dwDesiredAccess,
|
|
DWORD dwShareMode,
|
|
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
|
DWORD dwCreationDisposition,
|
|
DWORD dwFlagsAndAttributes,
|
|
HANDLE hTemplateFile);
|
|
|
|
|
|
LWSTDAPI_(HFONT)
|
|
CreateFontIndirectWrapW(CONST LOGFONTW * plfw);
|
|
|
|
LWSTDAPI_(HDC)
|
|
CreateICWrapW(
|
|
LPCWSTR lpszDriver,
|
|
LPCWSTR lpszDevice,
|
|
LPCWSTR lpszOutput,
|
|
CONST DEVMODEW * lpInitData);
|
|
|
|
LWSTDAPI_(HWND)
|
|
CreateWindowExWrapW(
|
|
DWORD dwExStyle,
|
|
LPCWSTR lpClassName,
|
|
LPCWSTR lpWindowName,
|
|
DWORD dwStyle,
|
|
int X,
|
|
int Y,
|
|
int nWidth,
|
|
int nHeight,
|
|
HWND hWndParent,
|
|
HMENU hMenu,
|
|
HINSTANCE hInstance,
|
|
void * lpParam);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
DefWindowProcWrapW(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
|
|
|
LWSTDAPI_(BOOL) DeleteFileWrapW(LPCWSTR pwsz);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
DispatchMessageWrapW(CONST MSG * lpMsg);
|
|
|
|
LWSTDAPI_(int)
|
|
DrawTextWrapW(
|
|
HDC hDC,
|
|
LPCWSTR lpString,
|
|
int nCount,
|
|
LPRECT lpRect,
|
|
UINT uFormat);
|
|
|
|
LWSTDAPI_(int)
|
|
EnumFontFamiliesWrapW(
|
|
HDC hdc,
|
|
LPCWSTR lpszFamily,
|
|
FONTENUMPROCW lpEnumFontProc,
|
|
LPARAM lParam);
|
|
|
|
LWSTDAPI_(int)
|
|
EnumFontFamiliesExWrapW(
|
|
HDC hdc,
|
|
LPLOGFONTW lplfw,
|
|
FONTENUMPROCW lpEnumFontProc,
|
|
LPARAM lParam,
|
|
DWORD dwFlags );
|
|
|
|
LWSTDAPI_(BOOL)
|
|
EnumResourceNamesWrapW(
|
|
HINSTANCE hModule,
|
|
LPCWSTR lpType,
|
|
ENUMRESNAMEPROCW lpEnumFunc,
|
|
LONG_PTR lParam);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
ExtTextOutWrapW(
|
|
HDC hdc,
|
|
int x,
|
|
int y,
|
|
UINT fuOptions,
|
|
CONST RECT * lprc,
|
|
LPCWSTR lpString,
|
|
UINT nCount,
|
|
CONST INT * lpDx);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
FindFirstFileWrapW(
|
|
LPCWSTR lpFileName,
|
|
LPWIN32_FIND_DATAW pwszFd);
|
|
|
|
LWSTDAPI_(HRSRC)
|
|
FindResourceWrapW(HINSTANCE hModule, LPCWSTR lpName, LPCWSTR lpType);
|
|
|
|
LWSTDAPI_(HWND)
|
|
FindWindowWrapW(LPCWSTR lpClassName, LPCWSTR lpWindowName);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
FormatMessageWrapW(
|
|
DWORD dwFlags,
|
|
LPCVOID lpSource,
|
|
DWORD dwMessageId,
|
|
DWORD dwLanguageId,
|
|
LPWSTR lpBuffer,
|
|
DWORD nSize,
|
|
va_list * Arguments);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetClassInfoWrapW(HINSTANCE hModule, LPCWSTR lpClassName, LPWNDCLASSW lpWndClassW);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetClassLongWrapW(HWND hWnd, int nIndex);
|
|
|
|
LWSTDAPI_(int)
|
|
GetClassNameWrapW(HWND hWnd, LPWSTR lpClassName, int nMaxCount);
|
|
|
|
LWSTDAPI_(int)
|
|
GetClipboardFormatNameWrapW(UINT format, LPWSTR lpFormatName, int cchFormatName);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetCurrentDirectoryWrapW(DWORD nBufferLength, LPWSTR lpBuffer);
|
|
|
|
LWSTDAPI_(UINT)
|
|
GetDlgItemTextWrapW(
|
|
HWND hWndDlg,
|
|
int idControl,
|
|
LPWSTR lpsz,
|
|
int cchMax);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetFileAttributesWrapW(LPCWSTR lpFileName);
|
|
|
|
// Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(BOOL)
|
|
GetFileVersionInfoWrapW(LPCWSTR pwzFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData);
|
|
|
|
// Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(DWORD)
|
|
GetFileVersionInfoSizeWrapW(LPCWSTR pwzFilename, LPDWORD lpdwHandle);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetFullPathNameWrapW( LPCWSTR lpFileName,
|
|
DWORD nBufferLength,
|
|
LPWSTR lpBuffer,
|
|
LPWSTR *lpFilePart);
|
|
|
|
LWSTDAPI_(int)
|
|
GetLocaleInfoWrapW(LCID Locale, LCTYPE LCType, LPWSTR lpsz, int cchData);
|
|
|
|
LWSTDAPI_(int)
|
|
GetMenuStringWrapW(
|
|
HMENU hMenu,
|
|
UINT uIDItem,
|
|
LPWSTR lpString,
|
|
int nMaxCount,
|
|
UINT uFlag);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetMessageWrapW(
|
|
LPMSG lpMsg,
|
|
HWND hWnd,
|
|
UINT wMsgFilterMin,
|
|
UINT wMsgFilterMax);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetModuleFileNameWrapW(HINSTANCE hModule, LPWSTR pwszFilename, DWORD nSize);
|
|
|
|
LWSTDAPI_(UINT)
|
|
GetSystemDirectoryWrapW(LPWSTR lpBuffer, UINT uSize);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetEnvironmentVariableWrapW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
SearchPathWrapW(
|
|
LPCWSTR lpPathName,
|
|
LPCWSTR lpFileName,
|
|
LPCWSTR lpExtension,
|
|
DWORD cchReturnBuffer,
|
|
LPWSTR lpReturnBuffer,
|
|
LPWSTR * plpfilePart);
|
|
|
|
LWSTDAPI_(HMODULE)
|
|
GetModuleHandleWrapW(LPCWSTR lpModuleName);
|
|
|
|
LWSTDAPI_(int)
|
|
GetObjectWrapW(HGDIOBJ hgdiObj, int cbBuffer, void *lpvObj);
|
|
|
|
LWSTDAPI_(UINT)
|
|
GetPrivateProfileIntWrapW(
|
|
LPCWSTR lpAppName,
|
|
LPCWSTR lpKeyName,
|
|
INT nDefault,
|
|
LPCWSTR lpFileName);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetProfileStringWrapW(
|
|
LPCWSTR lpAppName,
|
|
LPCWSTR lpKeyName,
|
|
LPCWSTR lpDefault,
|
|
LPWSTR lpBuffer,
|
|
DWORD dwBuffersize);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
GetPropWrapW(HWND hWnd, LPCWSTR lpString);
|
|
|
|
LWSTDAPI_(ATOM)
|
|
GlobalAddAtomWrapW(LPCWSTR lpAtomName);
|
|
|
|
LWSTDAPI_(ATOM)
|
|
GlobalFindAtomWrapW(LPCWSTR lpAtomName);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetShortPathNameWrapW(
|
|
LPCWSTR lpszLongPath,
|
|
LPWSTR lpszShortPath,
|
|
DWORD cchBuffer);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetStringTypeExWrapW(LCID lcid, DWORD dwInfoType, LPCWSTR lpSrcStr, int cchSrc, LPWORD lpCharType);
|
|
|
|
LWSTDAPI_(UINT)
|
|
GetTempFileNameWrapW(
|
|
LPCWSTR lpPathName,
|
|
LPCWSTR lpPrefixString,
|
|
UINT uUnique,
|
|
LPWSTR lpTempFileName);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetTempPathWrapW(DWORD nBufferLength, LPWSTR lpBuffer);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetTextExtentPoint32WrapW(
|
|
HDC hdc,
|
|
LPCWSTR pwsz,
|
|
int cb,
|
|
LPSIZE pSize);
|
|
|
|
LWSTDAPI_(int)
|
|
GetTextFaceWrapW(
|
|
HDC hdc,
|
|
int cch,
|
|
LPWSTR lpFaceName);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetTextMetricsWrapW(HDC hdc, LPTEXTMETRICW lptm);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetUserNameWrapW(LPWSTR lpUserName, LPDWORD lpcchName);
|
|
|
|
LWSTDAPI_(LONG)
|
|
GetWindowLongWrapW(HWND hWnd, int nIndex);
|
|
|
|
|
|
LWSTDAPI_(int)
|
|
GetWindowTextWrapW(HWND hWnd, LPWSTR lpString, int nMaxCount);
|
|
|
|
LWSTDAPI_(int)
|
|
GetWindowTextLengthWrapW(HWND hWnd);
|
|
|
|
LWSTDAPI_(UINT)
|
|
GetWindowsDirectoryWrapW(LPWSTR lpWinPath, UINT cch);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
InsertMenuWrapW(
|
|
HMENU hMenu,
|
|
UINT uPosition,
|
|
UINT uFlags,
|
|
UINT_PTR uIDNewItem,
|
|
LPCWSTR lpNewItem);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
IsDialogMessageWrapW(HWND hWndDlg, LPMSG lpMsg);
|
|
|
|
LWSTDAPI_(HACCEL)
|
|
LoadAcceleratorsWrapW(HINSTANCE hInstance, LPCWSTR lpTableName);
|
|
|
|
LWSTDAPI_(HBITMAP)
|
|
LoadBitmapWrapW(HINSTANCE hInstance, LPCWSTR lpBitmapName);
|
|
|
|
LWSTDAPI_(HCURSOR)
|
|
LoadCursorWrapW(HINSTANCE hInstance, LPCWSTR lpCursorName);
|
|
|
|
LWSTDAPI_(HICON)
|
|
LoadIconWrapW(HINSTANCE hInstance, LPCWSTR lpIconName);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
LoadImageWrapA(
|
|
HINSTANCE hInstance,
|
|
LPCSTR lpName,
|
|
UINT uType,
|
|
int cxDesired,
|
|
int cyDesired,
|
|
UINT fuLoad);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
LoadImageWrapW(
|
|
HINSTANCE hInstance,
|
|
LPCWSTR lpName,
|
|
UINT uType,
|
|
int cxDesired,
|
|
int cyDesired,
|
|
UINT fuLoad);
|
|
|
|
LWSTDAPI_(HINSTANCE)
|
|
LoadLibraryExWrapW(
|
|
LPCWSTR lpLibFileName,
|
|
HANDLE hFile,
|
|
DWORD dwFlags);
|
|
|
|
LWSTDAPI_(HMENU)
|
|
LoadMenuWrapW(HINSTANCE hInstance, LPCWSTR lpMenuName);
|
|
|
|
LWSTDAPI_(int)
|
|
LoadStringWrapW(HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int nBufferMax);
|
|
|
|
#ifndef UNIX
|
|
LWSTDAPI_(BOOL)
|
|
MessageBoxIndirectWrapW(CONST MSGBOXPARAMSW *pmbp);
|
|
#else
|
|
LWSTDAPI_(int)
|
|
MessageBoxIndirectWrapW(LPMSGBOXPARAMSW pmbp);
|
|
#endif /* UNIX */
|
|
|
|
LWSTDAPI_(BOOL)
|
|
ModifyMenuWrapW(
|
|
HMENU hMenu,
|
|
UINT uPosition,
|
|
UINT uFlags,
|
|
UINT_PTR uIDNewItem,
|
|
LPCWSTR lpNewItem);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
GetCharWidth32WrapW(
|
|
HDC hdc,
|
|
UINT iFirstChar,
|
|
UINT iLastChar,
|
|
LPINT lpBuffer);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
GetCharacterPlacementWrapW(
|
|
HDC hdc, // handle to device context
|
|
LPCWSTR lpString, // pointer to string
|
|
int nCount, // number of characters in string
|
|
int nMaxExtent, // maximum extent for displayed string
|
|
LPGCP_RESULTSW lpResults, // pointer to buffer for placement result
|
|
DWORD dwFlags // placement flags
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
CopyFileWrapW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, BOOL bFailIfExists);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
MoveFileWrapW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
OemToCharWrapW(LPCSTR lpszSrc, LPWSTR lpszDst);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
OpenEventWrapW(
|
|
DWORD fdwAccess,
|
|
BOOL fInherit,
|
|
LPCWSTR lpszEventName);
|
|
|
|
|
|
LWSTDAPI_(void)
|
|
OutputDebugStringWrapW(LPCWSTR lpOutputString);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
PeekMessageWrapW(
|
|
LPMSG lpMsg,
|
|
HWND hWnd,
|
|
UINT wMsgFilterMin,
|
|
UINT wMsgFilterMax,
|
|
UINT wRemoveMsg);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
PlaySoundWrapW(
|
|
LPCWSTR pszSound,
|
|
HMODULE hmod,
|
|
DWORD fdwSound);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
PostMessageWrapW(
|
|
HWND hWnd,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
PostThreadMessageWrapW(
|
|
DWORD idThread,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegCreateKeyWrapW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegCreateKeyExWrapW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegDeleteKeyWrapW(HKEY hKey, LPCWSTR pwszSubKey);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegDeleteValueWrapW(HKEY hKey, LPCWSTR pwszSubKey);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegEnumKeyWrapW(
|
|
HKEY hKey,
|
|
DWORD dwIndex,
|
|
LPWSTR lpName,
|
|
DWORD cbName);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegEnumKeyExWrapW(
|
|
HKEY hKey,
|
|
DWORD dwIndex,
|
|
LPWSTR lpName,
|
|
LPDWORD lpcbName,
|
|
LPDWORD lpReserved,
|
|
LPWSTR lpClass,
|
|
LPDWORD lpcbClass,
|
|
PFILETIME lpftLastWriteTime);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegOpenKeyWrapW(HKEY hKey, LPCWSTR pwszSubKey, PHKEY phkResult);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegOpenKeyExWrapW(
|
|
HKEY hKey,
|
|
LPCWSTR lpSubKey,
|
|
DWORD ulOptions,
|
|
REGSAM samDesired,
|
|
PHKEY phkResult);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegQueryInfoKeyWrapW(
|
|
HKEY hKey,
|
|
LPWSTR lpClass,
|
|
LPDWORD lpcbClass,
|
|
LPDWORD lpReserved,
|
|
LPDWORD lpcSubKeys,
|
|
LPDWORD lpcbMaxSubKeyLen,
|
|
LPDWORD lpcbMaxClassLen,
|
|
LPDWORD lpcValues,
|
|
LPDWORD lpcbMaxValueNameLen,
|
|
LPDWORD lpcbMaxValueLen,
|
|
LPDWORD lpcbSecurityDescriptor,
|
|
PFILETIME lpftLastWriteTime);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegQueryValueWrapW(
|
|
HKEY hKey,
|
|
LPCWSTR pwszSubKey,
|
|
LPWSTR pwszValue,
|
|
PLONG lpcbValue);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegQueryValueExWrapW(
|
|
HKEY hKey,
|
|
LPCWSTR lpValueName,
|
|
LPDWORD lpReserved,
|
|
LPDWORD lpType,
|
|
LPBYTE lpData,
|
|
LPDWORD lpcbData);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegSetValueWrapW(
|
|
HKEY hKey,
|
|
LPCWSTR lpSubKey,
|
|
DWORD dwType,
|
|
LPCWSTR lpData,
|
|
DWORD cbData);
|
|
|
|
LWSTDAPI_(LONG)
|
|
RegSetValueExWrapW(
|
|
HKEY hKey,
|
|
LPCWSTR lpValueName,
|
|
DWORD Reserved,
|
|
DWORD dwType,
|
|
CONST BYTE* lpData,
|
|
DWORD cbData);
|
|
|
|
LWSTDAPI_(ATOM)
|
|
RegisterClassWrapW(CONST WNDCLASSW * lpWndClass);
|
|
|
|
LWSTDAPI_(UINT)
|
|
RegisterClipboardFormatWrapW(LPCWSTR lpString);
|
|
|
|
LWSTDAPI_(UINT)
|
|
RegisterWindowMessageWrapW(LPCWSTR lpString);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
RemoveDirectoryWrapW(LPCWSTR lpszDir);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
RemovePropWrapW(
|
|
HWND hWnd,
|
|
LPCWSTR lpString);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
SendDlgItemMessageWrapW(
|
|
HWND hDlg,
|
|
int nIDDlgItem,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
SendMessageWrapW(
|
|
HWND hWnd,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
LWSTDAPI_(LRESULT)
|
|
SendMessageTimeoutWrapW(
|
|
HWND hWnd,
|
|
UINT Msg,
|
|
WPARAM wParam,
|
|
LPARAM lParam,
|
|
UINT uFlags,
|
|
UINT uTimeout,
|
|
PULONG_PTR lpdwResult);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SetCurrentDirectoryWrapW(LPCWSTR lpszCurDir);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SetDlgItemTextWrapW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SetMenuItemInfoWrapW(
|
|
HMENU hMenu,
|
|
UINT uItem,
|
|
BOOL fByPosition,
|
|
LPCMENUITEMINFOW lpmiiW);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SetPropWrapW(
|
|
HWND hWnd,
|
|
LPCWSTR lpString,
|
|
HANDLE hData);
|
|
|
|
LWSTDAPI_(LONG)
|
|
SetWindowLongWrapW(HWND hWnd, int nIndex, LONG dwNewLong);
|
|
|
|
LWSTDAPI_(HHOOK)
|
|
SetWindowsHookExWrapW(
|
|
int idHook,
|
|
HOOKPROC lpfn,
|
|
HINSTANCE hmod,
|
|
DWORD dwThreadId);
|
|
|
|
LWSTDAPI_(int)
|
|
StartDocWrapW( HDC hDC, const DOCINFOW * lpdi );
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SystemParametersInfoWrapW(
|
|
UINT uiAction,
|
|
UINT uiParam,
|
|
void *pvParam,
|
|
UINT fWinIni);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
TrackPopupMenuWrap(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, CONST RECT *prcRect);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
TrackPopupMenuExWrap(HMENU hMenu, UINT uFlags, int x, int y, HWND hWnd, LPTPMPARAMS lptpm);
|
|
|
|
LWSTDAPI_(int)
|
|
TranslateAcceleratorWrapW(HWND hWnd, HACCEL hAccTable, LPMSG lpMsg);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
UnregisterClassWrapW(LPCWSTR lpClassName, HINSTANCE hInstance);
|
|
|
|
// Cannot be LWSTDAPI because winver.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(BOOL)
|
|
VerQueryValueWrapW(const LPVOID pBlock, LPWSTR pwzSubBlock, LPVOID *ppBuffer, PUINT puLen);
|
|
|
|
LWSTDAPI_(SHORT)
|
|
VkKeyScanWrapW(WCHAR ch);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
WinHelpWrapW(HWND hwnd, LPCWSTR szFile, UINT uCmd, DWORD_PTR dwData);
|
|
|
|
LWSTDAPI_(int)
|
|
wvsprintfWrapW(LPWSTR pwszOut, LPCWSTR pwszFormat, va_list arglist);
|
|
|
|
// Cannot be LWSTDAPI because winnetp.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(DWORD) WNetRestoreConnectionWrapW(IN HWND hwndParent, IN LPCWSTR pwzDevice);
|
|
// Cannot be LWSTDAPI because winnetwk.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(DWORD) WNetGetLastErrorWrapW(OUT LPDWORD pdwError, OUT LPWSTR pwzErrorBuf, IN DWORD cchErrorBufSize, OUT LPWSTR pwzNameBuf, IN DWORD cchNameBufSize);
|
|
|
|
LWSTDAPI_(int) DrawTextExWrapW(HDC hdc, LPWSTR pwzText, int cchText, LPRECT lprc, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams);
|
|
LWSTDAPI_(BOOL) GetMenuItemInfoWrapW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPMENUITEMINFOW pmiiW);
|
|
LWSTDAPI_(BOOL) InsertMenuItemWrapW(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW pmiiW);
|
|
|
|
LWSTDAPI_(HFONT) CreateFontWrapW(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, DWORD fdwItalic, DWORD fdwUnderline,
|
|
DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision,
|
|
DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCWSTR lpszFace);
|
|
LWSTDAPI_(HDC) CreateMetaFileWrapW(LPCWSTR pwzFile);
|
|
LWSTDAPI_(HANDLE) CreateMutexWrapW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR pwzName);
|
|
LWSTDAPI_(DWORD) ExpandEnvironmentStringsWrapW(LPCWSTR pwszSrc, LPWSTR pwszDst, DWORD cchSize);
|
|
LWSTDAPI_(DWORD) SHExpandEnvironmentStrings%(LPCTSTR% pszSrc, LPTSTR% pszDst, DWORD cchSize);
|
|
LWSTDAPI_(DWORD) SHExpandEnvironmentStringsForUser%(HANDLE hToken, LPCTSTR% pszSrc, LPTSTR% pszDst, DWORD cchSize);
|
|
|
|
LWSTDAPI_(HANDLE) CreateSemaphoreWrapW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR pwzName);
|
|
LWSTDAPI_(BOOL) IsBadStringPtrWrapW(LPCWSTR pwzString, UINT_PTR ucchMax);
|
|
LWSTDAPI_(HINSTANCE) LoadLibraryWrapW(LPCWSTR pwzLibFileName);
|
|
LWSTDAPI_(int) GetTimeFormatWrapW(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpTime, LPCWSTR pwzFormat, LPWSTR pwzTimeStr, int cchTime);
|
|
LWSTDAPI_(int) GetDateFormatWrapW(LCID Locale, DWORD dwFlags, CONST SYSTEMTIME * lpDate, LPCWSTR pwzFormat, LPWSTR pwzDateStr, int cchDate);
|
|
LWSTDAPI_(DWORD) GetPrivateProfileStringWrapW(LPCWSTR pwzAppName, LPCWSTR pwzKeyName, LPCWSTR pwzDefault, LPWSTR pwzReturnedString, DWORD cchSize, LPCWSTR pwzFileName);
|
|
LWSTDAPI_(BOOL) WritePrivateProfileStringWrapW(LPCWSTR pwzAppName, LPCWSTR pwzKeyName, LPCWSTR pwzString, LPCWSTR pwzFileName);
|
|
|
|
#ifndef SHFILEINFO_DEFINED
|
|
#define SHFILEINFO_DEFINED
|
|
|
|
/*
|
|
* The SHGetFileInfo API provides an easy way to get attributes
|
|
* for a file given a pathname.
|
|
*
|
|
* PARAMETERS
|
|
*
|
|
* pszPath file name to get info about
|
|
* dwFileAttributes file attribs, only used with SHGFI_USEFILEATTRIBUTES
|
|
* psfi place to return file info
|
|
* cbFileInfo size of structure
|
|
* uFlags flags
|
|
*
|
|
* RETURN
|
|
* TRUE if things worked
|
|
*/
|
|
|
|
typedef struct _SHFILEINFO%
|
|
{
|
|
HICON hIcon; // out: icon
|
|
int iIcon; // out: icon index
|
|
DWORD dwAttributes; // out: SFGAO_ flags
|
|
TCHAR% szDisplayName[MAX_PATH]; // out: display name (or path)
|
|
TCHAR% szTypeName[80]; // out: type name
|
|
} SHFILEINFO%;
|
|
|
|
|
|
// NOTE: This is also in shellapi.h. Please keep in synch.
|
|
#endif // !SHFILEINFO_DEFINED
|
|
LWSTDAPI_(DWORD_PTR) SHGetFileInfoWrapW(LPCWSTR pwzPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
|
|
|
|
LWSTDAPI_(ATOM) RegisterClassExWrapW(CONST WNDCLASSEXW *pwcx);
|
|
LWSTDAPI_(BOOL) GetClassInfoExWrapW(HINSTANCE hinst, LPCWSTR pwzClass, LPWNDCLASSEXW lpwcx);
|
|
|
|
// This allows us to be included either before or after shellapi.h
|
|
#ifdef STRICT
|
|
LWSTDAPI_(UINT) DragQueryFileWrapW(struct HDROP__*,UINT,LPWSTR,UINT);
|
|
#else
|
|
LWSTDAPI_(UINT) DragQueryFileWrapW(HANDLE,UINT,LPWSTR,UINT);
|
|
#endif
|
|
|
|
LWSTDAPI_(HWND) FindWindowExWrapW(HWND hwndParent, HWND hwndChildAfter, LPCWSTR pwzClassName, LPCWSTR pwzWindowName);
|
|
LWSTDAPI_(LPITEMIDLIST) SHBrowseForFolderWrapW(struct _browseinfoW * pbiW);
|
|
LWSTDAPI_(BOOL) SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl, LPWSTR pwzPath);
|
|
LWSTDAPI_(BOOL) SHGetNewLinkInfoWrapW(LPCWSTR pszpdlLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags);
|
|
LWSTDAPI SHDefExtractIconWrapW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
|
|
LWSTDAPI_(BOOL) GetUserNameWrapW(LPWSTR pszBuffer, LPDWORD pcch);
|
|
LWSTDAPI_(LONG) RegEnumValueWrapW(HKEY hkey, DWORD dwIndex, LPWSTR lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
|
|
LWSTDAPI_(BOOL) WritePrivateProfileStructWrapW(LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
|
|
LWSTDAPI_(BOOL) GetPrivateProfileStructWrapW(LPCWSTR lpszSection, LPCWSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCWSTR szFile);
|
|
LWSTDAPI_(BOOL) CreateProcessWrapW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,
|
|
LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory,
|
|
LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
|
|
LWSTDAPI_(HICON) ExtractIconWrapW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex);
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
// Cannot be LWSTDAPI because ddeml.h declares the function as STDAPI and not DLLIMPORT
|
|
STDAPI_(UINT) DdeInitializeWrapW(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes);
|
|
STDAPI_(HSZ) DdeCreateStringHandleWrapW(DWORD idInst, LPCWSTR psz, int iCodePage);
|
|
STDAPI_(DWORD) DdeQueryStringWrapW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, int iCodePage);
|
|
|
|
LWSTDAPI_(BOOL) GetSaveFileNameWrapW(LPOPENFILENAMEW lpofn);
|
|
LWSTDAPI_(BOOL) GetOpenFileNameWrapW(LPOPENFILENAMEW lpofn);
|
|
LWSTDAPI_(BOOL) PrintDlgWrapW(LPPRINTDLGW lppd);
|
|
LWSTDAPI_(BOOL) PageSetupDlgWrapW(LPPAGESETUPDLGW lppsd);
|
|
#endif
|
|
LWSTDAPI_(void) SHChangeNotifyWrap(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
|
|
LWSTDAPI_(void) SHFlushSFCacheWrap(void);
|
|
LWSTDAPI_(BOOL) ShellExecuteExWrapW(struct _SHELLEXECUTEINFOW * pExecInfoW);
|
|
LWSTDAPI_(int) SHFileOperationWrapW(struct _SHFILEOPSTRUCTW * pFileOpW);
|
|
LWSTDAPI_(UINT) ExtractIconExWrapW(LPCWSTR pwzFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
|
|
LWSTDAPI_(BOOL) SetFileAttributesWrapW(LPCWSTR pwzFile, DWORD dwFileAttributes);
|
|
LWSTDAPI_(int) GetNumberFormatWrapW(LCID Locale, DWORD dwFlags, LPCWSTR pwzValue, CONST NUMBERFMTW * pFormatW, LPWSTR pwzNumberStr, int cchNumber);
|
|
LWSTDAPI_(int) MessageBoxWrapW(HWND hwnd, LPCWSTR pwzText, LPCWSTR pwzCaption, UINT uType);
|
|
LWSTDAPI_(BOOL) FindNextFileWrapW(HANDLE hSearchHandle, LPWIN32_FIND_DATAW pFindFileDataW);
|
|
|
|
#ifdef UNICODE
|
|
|
|
#define IsCharAlphaWrap IsCharAlphaWrapW
|
|
#define IsCharUpperWrap IsCharUpperWrapW
|
|
#define IsCharLowerWrap IsCharLowerWrapW
|
|
#define IsCharAlphaNumericWrap IsCharAlphaNumericWrapW
|
|
#define AppendMenuWrap AppendMenuWrapW
|
|
#ifdef POST_IE5_BETA
|
|
#define CallMsgFilterWrap CallMsgFilterWrapW
|
|
#endif
|
|
#define CallWindowProcWrap CallWindowProcWrapW
|
|
#define CharLowerWrap CharLowerWrapW
|
|
#define CharLowerBuffWrap CharLowerBuffWrapW
|
|
#define CharNextWrap CharNextWrapW
|
|
#define CharPrevWrap CharPrevWrapW
|
|
#define CharToOemWrap CharToOemWrapW
|
|
#define CharUpperWrap CharUpperWrapW
|
|
#define CharUpperBuffWrap CharUpperBuffWrapW
|
|
#define CompareStringWrap CompareStringWrapW
|
|
#define CopyAcceleratorTableWrap CopyAcceleratorTableWrapW
|
|
#define CreateAcceleratorTableWrap CreateAcceleratorTableWrapW
|
|
#define CreateDCWrap CreateDCWrapW
|
|
#define CreateDirectoryWrap CreateDirectoryWrapW
|
|
#define CreateEventWrap CreateEventWrapW
|
|
#define CreateFontWrap CreateFontWrapW
|
|
#define CreateFileWrap CreateFileWrapW
|
|
#define CreateFontIndirectWrap CreateFontIndirectWrapW
|
|
#define CreateICWrap CreateICWrapW
|
|
#define CreateMetaFileWrap CreateMetaFileWrapW
|
|
#define CreateMutexWrap CreateMutexWrapW
|
|
#define CreateSemaphoreWrap CreateSemaphoreWrapW
|
|
#define CreateWindowExWrap CreateWindowExWrapW
|
|
#define DefWindowProcWrap DefWindowProcWrapW
|
|
#define DeleteFileWrap DeleteFileWrapW
|
|
#define DispatchMessageWrap DispatchMessageWrapW
|
|
#define DrawTextExWrap DrawTextExWrapW
|
|
#define DrawTextWrap DrawTextWrapW
|
|
#define EnumFontFamiliesWrap EnumFontFamiliesWrapW
|
|
#define EnumFontFamiliesExWrap EnumFontFamiliesExWrapW
|
|
#define EnumResourceNamesWrap EnumResourceNamesWrapW
|
|
#define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsWrapW
|
|
#define ExtractIconExWrap ExtractIconExWrapW
|
|
#define ExtTextOutWrap ExtTextOutW
|
|
#define FindFirstFileWrap FindFirstFileWrapW
|
|
#define FindNextFileWrap FindNextFileWrapW
|
|
#define FindResourceWrap FindResourceWrapW
|
|
#define FindWindowWrap FindWindowWrapW
|
|
#define FindWindowExWrap FindWindowExWrapW
|
|
#define FormatMessageWrap FormatMessageWrapW
|
|
#define GetClassInfoWrap GetClassInfoWrapW
|
|
#define GetClassInfoExWrap GetClassInfoExWrapW
|
|
#define GetClassLongWrap GetClassLongWrapW
|
|
#define GetClassNameWrap GetClassNameWrapW
|
|
#define GetClipboardFormatNameWrap GetClipboardFormatNameWrapW
|
|
#define GetCurrentDirectoryWrap GetCurrentDirectoryWrapW
|
|
#define GetDlgItemTextWrap GetDlgItemTextWrapW
|
|
#define GetFileAttributesWrap GetFileAttributesWrapW
|
|
#define GetFullPathNameWrap GetFullPathNameWrapW
|
|
#define GetLocaleInfoWrap GetLocaleInfoWrapW
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoWrapW
|
|
#define GetMenuStringWrap GetMenuStringWrapW
|
|
#define GetMessageWrap GetMessageWrapW
|
|
#define GetModuleFileNameWrap GetModuleFileNameWrapW
|
|
#define GetNumberFormatWrap GetNumberFormatWrapW
|
|
#define GetSystemDirectoryWrap GetSystemDirectoryWrapW
|
|
#define GetEnvironmentVariableWrap GetEnvironmentVariableWrapW
|
|
#define GetModuleHandleWrap GetModuleHandleWrapW
|
|
#define GetObjectWrap GetObjectWrapW
|
|
#define GetPrivateProfileIntWrap GetPrivateProfileIntWrapW
|
|
#define GetProfileStringWrap GetProfileStringWrapW
|
|
#define GetPrivateProfileStringWrap GetPrivateProfileStringWrapW
|
|
#define WritePrivateProfileStringWrap WritePrivateProfileStringWrapW
|
|
#define GetPropWrap GetPropWrapW
|
|
#define GetStringTypeExWrap GetStringTypeExWrapW
|
|
#define GetTempFileNameWrap GetTempFileNameWrapW
|
|
#define GetTempPathWrap GetTempPathWrapW
|
|
#define GetTextExtentPoint32Wrap GetTextExtentPoint32WrapW
|
|
#define GetTextFaceWrap GetTextFaceWrapW
|
|
#define GetTextMetricsWrap GetTextMetricsWrapW
|
|
#define GetTimeFormatWrap GetTimeFormatWrapW
|
|
#define GetDateFormatWrap GetDateFormatWrapW
|
|
#define GetUserNameWrap GetUserNameWrapW
|
|
#define GetWindowLongWrap GetWindowLongWrapW
|
|
#define GetWindowTextWrap GetWindowTextWrapW
|
|
#define GetWindowTextLengthWrap GetWindowTextLengthWrapW
|
|
#define GetWindowsDirectoryWrap GetWindowsDirectoryWrapW
|
|
#define InsertMenuItemWrap InsertMenuItemWrapW
|
|
#define InsertMenuWrap InsertMenuWrapW
|
|
#define IsBadStringPtrWrap IsBadStringPtrWrapW
|
|
#define IsDialogMessageWrap IsDialogMessageWrapW
|
|
#define LoadAcceleratorsWrap LoadAcceleratorsWrapW
|
|
#define LoadBitmapWrap LoadBitmapWrapW
|
|
#define LoadCursorWrap LoadCursorWrapW
|
|
#define LoadIconWrap LoadIconWrapW
|
|
#define LoadImageWrap LoadImageWrapW
|
|
#define LoadLibraryWrap LoadLibraryWrapW
|
|
#define LoadLibraryExWrap LoadLibraryExWrapW
|
|
#define LoadMenuWrap LoadMenuWrapW
|
|
#define LoadStringWrap LoadStringWrapW
|
|
#define MessageBoxIndirectWrap MessageBoxIndirectWrapW
|
|
#define MessageBoxWrap MessageBoxWrapW
|
|
#define ModifyMenuWrap ModifyMenuWrapW
|
|
#define GetCharWidth32Wrap GetCharWidth32WrapW
|
|
#define GetCharacterPlacementWrap GetCharacterPlacementWrapW
|
|
#define CopyFileWrap CopyFileWrapW
|
|
#define MoveFileWrap MoveFileWrapW
|
|
#define OemToCharWrap OemToCharWrapW
|
|
#define OutputDebugStringWrap OutputDebugStringWrapW
|
|
#define PeekMessageWrap PeekMessageWrapW
|
|
#define PostMessageWrap PostMessageWrapW
|
|
#define PostThreadMessageWrap PostThreadMessageWrapW
|
|
#define RegCreateKeyWrap RegCreateKeyWrapW
|
|
#define RegCreateKeyExWrap RegCreateKeyExWrapW
|
|
#define RegDeleteKeyWrap RegDeleteKeyWrapW
|
|
#define RegDeleteValueWrap RegDeleteValueWrapW
|
|
#define RegEnumKeyWrap RegEnumKeyWrapW
|
|
#define RegEnumKeyExWrap RegEnumKeyExWrapW
|
|
#define RegOpenKeyWrap RegOpenKeyWrapW
|
|
#define RegOpenKeyExWrap RegOpenKeyExWrapW
|
|
#define RegQueryInfoKeyWrap RegQueryInfoKeyWrapW
|
|
#define RegQueryValueWrap RegQueryValueWrapW
|
|
#define RegQueryValueExWrap RegQueryValueExWrapW
|
|
#define RegSetValueWrap RegSetValueWrapW
|
|
#define RegSetValueExWrap RegSetValueExWrapW
|
|
#define RegisterClassWrap RegisterClassWrapW
|
|
#define RegisterClassExWrap RegisterClassExWrapW
|
|
#define RegisterClipboardFormatWrap RegisterClipboardFormatWrapW
|
|
#define RegisterWindowMessageWrap RegisterWindowMessageWrapW
|
|
#define RemovePropWrap RemovePropWrapW
|
|
#define SearchPathWrap SearchPathWrapW
|
|
#define SendDlgItemMessageWrap SendDlgItemMessageWrapW
|
|
#define SendMessageWrap SendMessageWrapW
|
|
#define SendMessageTimeoutWrap SendMessageTimeoutWrapW
|
|
#define SetCurrentDirectoryWrap SetCurrentDirectoryWrapW
|
|
#define SetDlgItemTextWrap SetDlgItemTextWrapW
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoWrapW
|
|
#define SetPropWrap SetPropWrapW
|
|
#define SetFileAttributesWrap SetFileAttributesWrapW
|
|
#define SetWindowLongWrap SetWindowLongWrapW
|
|
#define SetWindowsHookExWrap SetWindowsHookExWrapW
|
|
#define SHBrowseForFolderWrap SHBrowseForFolderWrapW
|
|
#define ShellExecuteExWrap ShellExecuteExWrapW
|
|
#define SHFileOperationWrap SHFileOperationWrapW
|
|
#define SHGetFileInfoWrap SHGetFileInfoWrapW
|
|
#define SHGetPathFromIDListWrap SHGetPathFromIDListWrapW
|
|
#define StartDocWrap StartDocWrapW
|
|
#define SystemParametersInfoWrap SystemParametersInfoWrapW
|
|
#define TranslateAcceleratorWrap TranslateAcceleratorWrapW
|
|
#define UnregisterClassWrap UnregisterClassWrapW
|
|
#define VkKeyScanWrap VkKeyScanWrapW
|
|
#define WinHelpWrap WinHelpWrapW
|
|
#define WNetRestoreConnectionWrap WNetRestoreConnectionWrapW
|
|
#define WNetGetLastErrorWrap WNetGetLastErrorWrapW
|
|
#define wvsprintfWrap wvsprintfWrapW
|
|
#define CreateFontWrap CreateFontWrapW
|
|
#define DrawTextExWrap DrawTextExWrapW
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoWrapW
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoWrapW
|
|
#define InsertMenuItemWrap InsertMenuItemWrapW
|
|
#define DragQueryFileWrap DragQueryFileWrapW
|
|
|
|
#else
|
|
|
|
#define IsCharAlphaWrap IsCharAlphaA
|
|
#define IsCharUpperWrap IsCharUpperA
|
|
#define IsCharLowerWrap IsCharLowerA
|
|
#define IsCharAlphaNumericWrap IsCharAlphaNumericA
|
|
#define AppendMenuWrap AppendMenuA
|
|
#ifdef POST_IE5_BETA
|
|
#define CallMsgFilterWrap CallMsgFilterA
|
|
#endif
|
|
#define CallWindowProcWrap CallWindowProcA
|
|
#define CharLowerWrap CharLowerA
|
|
#define CharLowerBuffWrap CharLowerBuffA
|
|
#define CharNextWrap CharNextA
|
|
#define CharPrevWrap CharPrevA
|
|
#define CharToOemWrap CharToOemA
|
|
#define CharUpperWrap CharUpperA
|
|
#define CharUpperBuffWrap CharUpperBuffA
|
|
#define CompareStringWrap CompareStringA
|
|
#define CopyAcceleratorTableWrap CopyAcceleratorTableA
|
|
#define CreateAcceleratorTableWrap CreateAcceleratorTableA
|
|
#define CreateDCWrap CreateDCA
|
|
#define CreateDirectoryWrap CreateDirectoryA
|
|
#define CreateEventWrap CreateEventA
|
|
#define CreateFontWrap CreateFontA
|
|
#define CreateFileWrap CreateFileA
|
|
#define CreateFontIndirectWrap CreateFontIndirectA
|
|
#define CreateICWrap CreateICA
|
|
#define CreateMetaFileWrap CreateMetaFileA
|
|
#define CreateMutexWrap CreateMutexA
|
|
#define CreateSemaphoreWrap CreateSemaphoreA
|
|
#define CreateWindowExWrap CreateWindowExA
|
|
#define DefWindowProcWrap DefWindowProcA
|
|
#define DeleteFileWrap DeleteFileA
|
|
#define DispatchMessageWrap DispatchMessageA
|
|
#define DrawTextExWrap DrawTextExA
|
|
#define DrawTextWrap DrawTextA
|
|
#define EnumFontFamiliesWrap EnumFontFamiliesA
|
|
#define EnumFontFamiliesExWrap EnumFontFamiliesExA
|
|
#define EnumResourceNamesWrap EnumResourceNamesA
|
|
#define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsA
|
|
#define ExtractIconExWrap ExtractIconExA
|
|
#define ExtTextOutWrap ExtTextOutA
|
|
#define FindFirstFileWrap FindFirstFileA
|
|
#define FindResourceWrap FindResourceA
|
|
#define FindNextFileWrap FindNextFileA
|
|
#define FindWindowWrap FindWindowA
|
|
#define FindWindowExWrap FindWindowExA
|
|
#define FormatMessageWrap FormatMessageA
|
|
#define GetClassInfoWrap GetClassInfoA
|
|
#define GetClassInfoExWrap GetClassInfoExA
|
|
#define GetClassLongWrap GetClassLongA
|
|
#define GetClassNameWrap GetClassNameA
|
|
#define GetClipboardFormatNameWrap GetClipboardFormatNameA
|
|
#define GetCurrentDirectoryWrap GetCurrentDirectoryA
|
|
#define GetDlgItemTextWrap GetDlgItemTextA
|
|
#define GetFileAttributesWrap GetFileAttributesA
|
|
#define GetFullPathNameWrap GetFullPathNameA
|
|
#define GetLocaleInfoWrap GetLocaleInfoA
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoA
|
|
#define GetMenuStringWrap GetMenuStringA
|
|
#define GetMessageWrap GetMessageA
|
|
#define GetModuleFileNameWrap GetModuleFileNameA
|
|
#define GetNumberFormatWrap GetNumberFormatA
|
|
#define GetPrivateProfileStringWrap GetPrivateProfileStringA
|
|
#define WritePrivateProfileStringWrap WritePrivateProfileStringA
|
|
#define GetSystemDirectoryWrap GetSystemDirectoryA
|
|
#define GetEnvironmentVariableWrap GetEnvironmentVariableA
|
|
#define SearchPathWrap SearchPathA
|
|
#define GetModuleHandleWrap GetModuleHandleA
|
|
#define GetObjectWrap GetObjectA
|
|
#define GetPrivateProfileIntWrap GetPrivateProfileIntA
|
|
#define GetProfileStringWrap GetProfileStringA
|
|
#define GetPropWrap GetPropA
|
|
#define GetStringTypeExWrap GetStringTypeExA
|
|
#define GetTempFileNameWrap GetTempFileNameA
|
|
#define GetTempPathWrap GetTempPathA
|
|
#define GetTextExtentPoint32Wrap GetTextExtentPoint32A
|
|
#define GetTextFaceWrap GetTextFaceA
|
|
#define GetTextMetricsWrap GetTextMetricsA
|
|
#define GetTimeFormatWrap GetTimeFormatA
|
|
#define GetDateFormatWrap GetDateFormatA
|
|
#define GetUserNameWrap GetUserNameA
|
|
#define GetWindowLongWrap GetWindowLongA
|
|
#define GetWindowTextWrap GetWindowTextA
|
|
#define GetWindowTextLengthWrap GetWindowTextLengthA
|
|
#define GetWindowsDirectoryWrap GetWindowsDirectoryA
|
|
#define InsertMenuItemWrap InsertMenuItemA
|
|
#define InsertMenuWrap InsertMenuA
|
|
#define IsBadStringPtrWrap IsBadStringPtrA
|
|
#define IsDialogMessageWrap IsDialogMessageA
|
|
#define LoadAcceleratorsWrap LoadAcceleratorsA
|
|
#define LoadBitmapWrap LoadBitmapA
|
|
#define LoadCursorWrap LoadCursorA
|
|
#define LoadIconWrap LoadIconA
|
|
#define LoadImageWrap LoadImageWrapA
|
|
#define LoadLibraryWrap LoadLibraryA
|
|
#define LoadLibraryExWrap LoadLibraryExA
|
|
#define LoadMenuWrap LoadMenuA
|
|
#define LoadStringWrap LoadStringA
|
|
#define MessageBoxIndirectWrap MessageBoxIndirectA
|
|
#define MessageBoxWrap MessageBoxA
|
|
#define ModifyMenuWrap ModifyMenuA
|
|
#define GetCharWidth32Wrap GetCharWidth32A
|
|
#define GetCharacterPlacementWrap GetCharacterPlacementA
|
|
#define CopyFileWrap CopyFileA
|
|
#define MoveFileWrap MoveFileA
|
|
#define OemToCharWrap OemToCharA
|
|
#define OutputDebugStringWrap OutputDebugStringA
|
|
#define PeekMessageWrap PeekMessageA
|
|
#define PostMessageWrap PostMessageA
|
|
#define PostThreadMessageWrap PostThreadMessageA
|
|
#define RegCreateKeyWrap RegCreateKeyA
|
|
#define RegCreateKeyExWrap RegCreateKeyExA
|
|
#define RegDeleteKeyWrap RegDeleteKeyA
|
|
#define RegDeleteValueWrap RegDeleteValueA
|
|
#define RegEnumKeyWrap RegEnumKeyA
|
|
#define RegEnumKeyExWrap RegEnumKeyExA
|
|
#define RegOpenKeyWrap RegOpenKeyA
|
|
#define RegOpenKeyExWrap RegOpenKeyExA
|
|
#define RegQueryInfoKeyWrap RegQueryInfoKeyA
|
|
#define RegQueryValueWrap RegQueryValueA
|
|
#define RegQueryValueExWrap RegQueryValueExA
|
|
#define RegSetValueWrap RegSetValueA
|
|
#define RegSetValueExWrap RegSetValueExA
|
|
#define RegisterClassWrap RegisterClassA
|
|
#define RegisterClassExWrap RegisterClassExA
|
|
#define RegisterClipboardFormatWrap RegisterClipboardFormatA
|
|
#define RegisterWindowMessageWrap RegisterWindowMessageA
|
|
#define RemovePropWrap RemovePropA
|
|
#define SendDlgItemMessageWrap SendDlgItemMessageA
|
|
#define SendMessageWrap SendMessageA
|
|
#define SendMessageTimeoutWrap SendMessageTimeoutA
|
|
#define SetCurrentDirectoryWrap SetCurrentDirectoryA
|
|
#define SetDlgItemTextWrap SetDlgItemTextA
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoA
|
|
#define SetPropWrap SetPropA
|
|
#define SetWindowLongWrap SetWindowLongA
|
|
#define SHBrowseForFolderWrap SHBrowseForFolderA
|
|
#define ShellExecuteExWrap ShellExecuteExA
|
|
#define SHFileOperationWrap SHFileOperationA
|
|
#define SHGetFileInfoWrap SHGetFileInfoA
|
|
#define SHGetPathFromIDListWrap SHGetPathFromIDListA
|
|
#define SetFileAttributesWrap SetFileAttributesA
|
|
#define SetWindowsHookExWrap SetWindowsHookExA
|
|
#define StartDocWrap StartDocA
|
|
#define SystemParametersInfoWrap SystemParametersInfoA
|
|
#define TranslateAcceleratorWrap TranslateAcceleratorA
|
|
#define UnregisterClassWrap UnregisterClassA
|
|
#define VkKeyScanWrap VkKeyScanA
|
|
#define WinHelpWrap WinHelpA
|
|
#define WNetRestoreConnectionWrap WNetRestoreConnectionA
|
|
#define WNetGetLastErrorWrap WNetGetLastErrorA
|
|
#define wvsprintfWrap wvsprintfA
|
|
#define CreateFontWrap CreateFontA
|
|
#define DrawTextExWrap DrawTextExA
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoA
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoA
|
|
#define InsertMenuItemWrap InsertMenuItemA
|
|
#define DragQueryFileWrap DragQueryFileA
|
|
#endif
|
|
|
|
#endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK)
|
|
|
|
#if defined(UNIX) && defined(NO_SHLWAPI_UNITHUNK)
|
|
#define SHFlushSFCacheWrap()
|
|
|
|
#ifdef UNICODE
|
|
#define IsCharAlphaWrapW IsCharAlphaW
|
|
#define IsCharUpperWrapW IsCharUpperW
|
|
#define IsCharLowerWrapW IsCharLowerW
|
|
#define IsCharAlphaNumericWrapW IsCharAlphaNumericW
|
|
#define AppendMenuWrapW AppendMenuW
|
|
#ifdef POST_IE5_BETA
|
|
#define CallMsgFilterWrapW CallMsgFilterW
|
|
#endif
|
|
#define CallWindowProcWrapW CallWindowProcW
|
|
#define CharLowerWrapW CharLowerW
|
|
#define CharLowerBuffWrapW CharLowerBuffW
|
|
#define CharNextWrapW CharNextW
|
|
#define CharPrevWrapW CharPrevW
|
|
#define CharToOemWrapW CharToOemW
|
|
#define CharUpperWrapW CharUpperW
|
|
#define CharUpperBuffWrapW CharUpperBuffW
|
|
#define CompareStringWrapW CompareStringW
|
|
#define CopyAcceleratorTableWrapW CopyAcceleratorTableW
|
|
#define CreateAcceleratorTableWrapW CreateAcceleratorTableW
|
|
#define CreateDCWrapW CreateDCW
|
|
#define CreateDirectoryWrapW CreateDirectoryW
|
|
#define CreateEventWrapW CreateEventW
|
|
#define CreateFontWrapW CreateFontW
|
|
#define CreateFileWrapW CreateFileW
|
|
#define CreateFontIndirectWrapW CreateFontIndirectW
|
|
#define CreateICWrapW CreateICW
|
|
#define CreateMetaFileWrapW CreateMetaFileW
|
|
#define CreateMutexWrapW CreateMutexW
|
|
#define CreateSemaphoreWrapW CreateSemaphoreW
|
|
#define CreateWindowExWrapW CreateWindowExW
|
|
#define DefWindowProcWrapW DefWindowProcW
|
|
#define DeleteFileWrapW DeleteFileW
|
|
#define DispatchMessageWrapW DispatchMessageW
|
|
#define DrawTextExWrapW DrawTextExW
|
|
#define DrawTextWrapW DrawTextW
|
|
#define EnumFontFamiliesWrapW EnumFontFamiliesW
|
|
#define EnumFontFamiliesExWrapW EnumFontFamiliesExW
|
|
#define EnumResourceNamesWrapW EnumResourceNamesW
|
|
#define ExpandEnvironmentStringsWrapW ExpandEnvironmentStringsW
|
|
#define ExtractIconExWrapW ExtractIconExW
|
|
#define ExtTextOutWrapW ExtTextOutW
|
|
#define FindFirstFileWrapW FindFirstFileW
|
|
#define FindNextFileWrapW FindNextFileW
|
|
#define FindResourceWrapW FindResourceW
|
|
#define FindWindowWrapW FindWindowW
|
|
#define FindWindowExWrapW FindWindowExW
|
|
#define FormatMessageWrapW FormatMessageW
|
|
#define GetClassInfoWrapW GetClassInfoW
|
|
#define GetClassInfoExWrapW GetClassInfoExW
|
|
#define GetClassLongWrapW GetClassLongW
|
|
#define GetClassNameWrapW GetClassNameW
|
|
#define GetClipboardFormatNameWrapW GetClipboardFormatNameW
|
|
#define GetCurrentDirectoryWrapW GetCurrentDirectoryW
|
|
#define GetDlgItemTextWrapW GetDlgItemTextW
|
|
#define GetFileAttributesWrapW GetFileAttributesW
|
|
#define GetFullPathNameWrapW GetFullPathNameW
|
|
#define GetLocaleInfoWrapW GetLocaleInfoW
|
|
#define GetMenuStringWrapW GetMenuStringW
|
|
#define GetMessageWrapW GetMessageW
|
|
#define GetModuleFileNameWrapW GetModuleFileNameW
|
|
#define GetNumberFormatWrapW GetNumberFormatW
|
|
#define GetSystemDirectoryWrapW GetSystemDirectoryW
|
|
#define GetModuleHandleWrapW GetModuleHandleW
|
|
#define GetObjectWrapW GetObjectW
|
|
#define GetPrivateProfileIntWrapW GetPrivateProfileIntW
|
|
#define GetProfileStringWrapW GetProfileStringW
|
|
#define GetPrivateProfileStringWrapW GetPrivateProfileStringW
|
|
#define WritePrivateProfileStringWrapW WritePrivateProfileStringW
|
|
#define GetPropWrapW GetPropW
|
|
#define GetStringTypeExWrapW GetStringTypeExW
|
|
#define GetTempFileNameWrapW GetTempFileNameW
|
|
#define GetTempPathWrapW GetTempPathW
|
|
#define GetTextExtentPoint32WrapW GetTextExtentPoint32W
|
|
#define GetTextFaceWrapW GetTextFaceW
|
|
#define GetTextMetricsWrapW GetTextMetricsW
|
|
#define GetTimeFormatWrapW GetTimeFormatW
|
|
#define GetDateFormatWrapW GetDateFormatW
|
|
#define GetUserNameWrapW GetUserNameW
|
|
#define GetWindowLongWrapW GetWindowLongW
|
|
#define GetWindowTextWrapW GetWindowTextW
|
|
#define GetWindowTextLengthWrapW GetWindowTextLengthW
|
|
#define GetWindowsDirectoryWrapW GetWindowsDirectoryW
|
|
#define InsertMenuItemWrapW InsertMenuItemW
|
|
#define InsertMenuWrapW InsertMenuW
|
|
#define IsBadStringPtrWrapW IsBadStringPtrW
|
|
#define IsDialogMessageWrapW IsDialogMessageW
|
|
#define LoadAcceleratorsWrapW LoadAcceleratorsW
|
|
#define LoadBitmapWrapW LoadBitmapW
|
|
#define LoadCursorWrapW LoadCursorW
|
|
#define LoadIconWrapW LoadIconW
|
|
#define LoadImageWrapW LoadImageW
|
|
#define LoadLibraryWrapW LoadLibraryW
|
|
#define LoadLibraryExWrapW LoadLibraryExW
|
|
#define LoadMenuWrapW LoadMenuW
|
|
#define LoadStringWrapW LoadStringW
|
|
#define MessageBoxIndirectWrapW MessageBoxIndirectW
|
|
#define MessageBoxWrapW MessageBoxW
|
|
#define ModifyMenuWrapW ModifyMenuW
|
|
#define GetCharWidth32WrapW GetCharWidth32W
|
|
#define GetCharacterPlacementWrapW GetCharacterPlacementW
|
|
#define CopyFileWrapW CopyFileW
|
|
#define MoveFileWrapW MoveFileW
|
|
#define OemToCharWrapW OemToCharW
|
|
#define OutputDebugStringWrapW OutputDebugStringW
|
|
#define PeekMessageWrapW PeekMessageW
|
|
#define PostMessageWrapW PostMessageW
|
|
#define PostThreadMessageWrapW PostThreadMessageW
|
|
#define RegCreateKeyWrapW RegCreateKeyW
|
|
#define RegCreateKeyExWrapW RegCreateKeyExW
|
|
#define RegDeleteKeyWrapW RegDeleteKeyW
|
|
#define RegDeleteValueWrapW RegDeleteValueW
|
|
#define RegEnumKeyWrapW RegEnumKeyW
|
|
#define RegEnumKeyExWrapW RegEnumKeyExW
|
|
#define RegOpenKeyWrapW RegOpenKeyW
|
|
#define RegOpenKeyExWrapW RegOpenKeyExW
|
|
#define RegQueryInfoKeyWrapW RegQueryInfoKeyW
|
|
#define RegQueryValueWrapW RegQueryValueW
|
|
#define RegQueryValueExWrapW RegQueryValueExW
|
|
#define RegSetValueWrapW RegSetValueW
|
|
#define RegSetValueExWrapW RegSetValueExW
|
|
#define RegisterClassWrapW RegisterClassW
|
|
#define RegisterClassExWrapW RegisterClassExW
|
|
#define RegisterClipboardFormatWrapWRegisterClipboardFormatW
|
|
#define RegisterWindowMessageWrapW RegisterWindowMessageW
|
|
#define RemovePropWrapW RemovePropW
|
|
#define SearchPathWrapW SearchPathW
|
|
#define SendDlgItemMessageWrapW SendDlgItemMessageW
|
|
#define SendMessageWrapW SendMessageW
|
|
#define SetCurrentDirectoryWrapW SetCurrentDirectoryW
|
|
#define SetDlgItemTextWrapW SetDlgItemTextW
|
|
#define SetMenuItemInfoWrapW SetMenuItemInfoW
|
|
#define SetPropWrapW SetPropW
|
|
#define SetFileAttributesWrapW SetFileAttributesW
|
|
#define SetWindowLongWrapW SetWindowLongW
|
|
#define SetWindowsHookExWrapW SetWindowsHookExW
|
|
#define SHBrowseForFolderWrapW SHBrowseForFolderW
|
|
#define ShellExecuteExWrapW ShellExecuteExW
|
|
#define SHFileOperationWrapW SHFileOperationW
|
|
#define SHGetFileInfoWrapW SHGetFileInfoW
|
|
#define SHGetPathFromIDListWrapW SHGetPathFromIDListW
|
|
#define StartDocWrapW StartDocW
|
|
#define SystemParametersInfoWrapW SystemParametersInfoW
|
|
#define TranslateAcceleratorWrapW TranslateAcceleratorW
|
|
#define UnregisterClassWrapW UnregisterClassW
|
|
#define VkKeyScanWrapW VkKeyScanW
|
|
#define WinHelpWrapW WinHelpW
|
|
#define WNetRestoreConnectionWrapW WNetRestoreConnectionW
|
|
#define WNetGetLastErrorWrapW WNetGetLastErrorW
|
|
#define wvsprintfWrapW wvsprintfW
|
|
#define CreateFontWrapW CreateFontW
|
|
#define DrawTextExWrapW DrawTextExW
|
|
#define SetMenuItemInfoWrapW SetMenuItemInfoW
|
|
#define InsertMenuItemWrapW InsertMenuItemW
|
|
#define DragQueryFileWrapW DragQueryFileW
|
|
|
|
#define IsCharAlphaWrap IsCharAlphaW
|
|
#define IsCharUpperWrap IsCharUpperW
|
|
#define IsCharLowerWrap IsCharLowerW
|
|
#define IsCharAlphaNumericWrap IsCharAlphaNumericW
|
|
#define AppendMenuWrap AppendMenuW
|
|
#ifdef POST_IE5_BETA
|
|
#define CallMsgFilterWrap CallMsgFilterW
|
|
#endif
|
|
#define CallWindowProcWrap CallWindowProcW
|
|
#define CharLowerWrap CharLowerW
|
|
#define CharLowerBuffWrap CharLowerBuffW
|
|
#define CharNextWrap CharNextW
|
|
#define CharPrevWrap CharPrevW
|
|
#define CharToOemWrap CharToOemW
|
|
#define CharUpperWrap CharUpperW
|
|
#define CharUpperBuffWrap CharUpperBuffW
|
|
#define CompareStringWrap CompareStringW
|
|
#define CopyAcceleratorTableWrap CopyAcceleratorTableW
|
|
#define CreateAcceleratorTableWrap CreateAcceleratorTableW
|
|
#define CreateDCWrap CreateDCW
|
|
#define CreateDirectoryWrap CreateDirectoryW
|
|
#define CreateEventWrap CreateEventW
|
|
#define CreateFontWrap CreateFontW
|
|
#define CreateFileWrap CreateFileW
|
|
#define CreateFontIndirectWrap CreateFontIndirectW
|
|
#define CreateICWrap CreateICW
|
|
#define CreateMetaFileWrap CreateMetaFileW
|
|
#define CreateMutexWrap CreateMutexW
|
|
#define CreateSemaphoreWrap CreateSemaphoreW
|
|
#define CreateWindowExWrap CreateWindowExW
|
|
#define DefWindowProcWrap DefWindowProcW
|
|
#define DeleteFileWrap DeleteFileW
|
|
#define DispatchMessageWrap DispatchMessageW
|
|
#define DrawTextExWrap DrawTextExW
|
|
#define DrawTextWrap DrawTextW
|
|
#define EnumFontFamiliesWrap EnumFontFamiliesW
|
|
#define EnumFontFamiliesExWrap EnumFontFamiliesExW
|
|
#define EnumResourceNamesWrap EnumResourceNamesW
|
|
#define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsW
|
|
#define ExtractIconExWrap ExtractIconExW
|
|
#define ExtTextOutWrap ExtTextOutW
|
|
#define FindFirstFileWrap FindFirstFileW
|
|
#define FindNextFileWrap FindNextFileW
|
|
#define FindResourceWrap FindResourceW
|
|
#define FindWindowWrap FindWindowW
|
|
#define FindWindowExWrap FindWindowExW
|
|
#define FormatMessageWrap FormatMessageW
|
|
#define GetClassInfoWrap GetClassInfoW
|
|
#define GetClassInfoExWrap GetClassInfoExW
|
|
#define GetClassLongWrap GetClassLongW
|
|
#define GetClassNameWrap GetClassNameW
|
|
#define GetClipboardFormatNameWrap GetClipboardFormatNameW
|
|
#define GetCurrentDirectoryWrap GetCurrentDirectoryW
|
|
#define GetDlgItemTextWrap GetDlgItemTextW
|
|
#define GetFileAttributesWrap GetFileAttributesW
|
|
#define GetFullPathNameWrap GetFullPathNameW
|
|
#define GetLocaleInfoWrap GetLocaleInfoW
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoWrapW
|
|
#define GetMenuStringWrap GetMenuStringW
|
|
#define GetMessageWrap GetMessageW
|
|
#define GetModuleFileNameWrap GetModuleFileNameW
|
|
#define GetNumberFormatWrap GetNumberFormatW
|
|
#define GetSystemDirectoryWrap GetSystemDirectoryW
|
|
#define GetModuleHandleWrap GetModuleHandleW
|
|
#define GetObjectWrap GetObjectW
|
|
#define GetPrivateProfileIntWrap GetPrivateProfileIntW
|
|
#define GetProfileStringWrap GetProfileStringW
|
|
#define GetPrivateProfileStringWrap GetPrivateProfileStringW
|
|
#define WritePrivateProfileStringWrap WritePrivateProfileStringW
|
|
#define GetPropWrap GetPropW
|
|
#define GetStringTypeExWrap GetStringTypeExW
|
|
#define GetTempFileNameWrap GetTempFileNameW
|
|
#define GetTempPathWrap GetTempPathW
|
|
#define GetTextExtentPoint32Wrap GetTextExtentPoint32W
|
|
#define GetTextFaceWrap GetTextFaceW
|
|
#define GetTextMetricsWrap GetTextMetricsW
|
|
#define GetTimeFormatWrap GetTimeFormatW
|
|
#define GetDateFormatWrap GetDateFormatW
|
|
#define GetUserNameWrap GetUserNameW
|
|
#define GetWindowLongWrap GetWindowLongW
|
|
#define GetWindowTextWrap GetWindowTextW
|
|
#define GetWindowTextLengthWrap GetWindowTextLengthW
|
|
#define GetWindowsDirectoryWrap GetWindowsDirectoryW
|
|
#define InsertMenuItemWrap InsertMenuItemW
|
|
#define InsertMenuWrap InsertMenuW
|
|
#define IsBadStringPtrWrap IsBadStringPtrW
|
|
#define IsDialogMessageWrap IsDialogMessageW
|
|
#define LoadAcceleratorsWrap LoadAcceleratorsW
|
|
#define LoadBitmapWrap LoadBitmapW
|
|
#define LoadCursorWrap LoadCursorW
|
|
#define LoadIconWrap LoadIconW
|
|
#define LoadImageWrap LoadImageW
|
|
#define LoadLibraryWrap LoadLibraryW
|
|
#define LoadLibraryExWrap LoadLibraryExW
|
|
#define LoadMenuWrap LoadMenuW
|
|
#define LoadStringWrap LoadStringW
|
|
#define MessageBoxIndirectWrap MessageBoxIndirectW
|
|
#define MessageBoxWrap MessageBoxW
|
|
#define ModifyMenuWrap ModifyMenuW
|
|
#define GetCharWidth32Wrap GetCharWidth32W
|
|
#define GetCharacterPlacementWrap GetCharacterPlacementW
|
|
#define CopyFileWrap CopyFileW
|
|
#define MoveFileWrap MoveFileW
|
|
#define OemToCharWrap OemToCharW
|
|
#define OutputDebugStringWrap OutputDebugStringW
|
|
#define PeekMessageWrap PeekMessageW
|
|
#define PostMessageWrap PostMessageW
|
|
#define PostThreadMessageWrap PostThreadMessageW
|
|
#define RegCreateKeyWrap RegCreateKeyW
|
|
#define RegCreateKeyExWrap RegCreateKeyExW
|
|
#define RegDeleteKeyWrap RegDeleteKeyW
|
|
#define RegDeleteValueWrap RegDeleteValueW
|
|
#define RegEnumKeyWrap RegEnumKeyW
|
|
#define RegEnumKeyExWrap RegEnumKeyExW
|
|
#define RegOpenKeyWrap RegOpenKeyW
|
|
#define RegOpenKeyExWrap RegOpenKeyExW
|
|
#define RegQueryInfoKeyWrap RegQueryInfoKeyW
|
|
#define RegQueryValueWrap RegQueryValueW
|
|
#define RegQueryValueExWrap RegQueryValueExW
|
|
#define RegSetValueWrap RegSetValueW
|
|
#define RegSetValueExWrap RegSetValueExW
|
|
#define RegisterClassWrap RegisterClassW
|
|
#define RegisterClassExWrap RegisterClassExW
|
|
#define RegisterClipboardFormatWrap RegisterClipboardFormatW
|
|
#define RegisterWindowMessageWrap RegisterWindowMessageW
|
|
#define RemovePropWrap RemovePropW
|
|
#define SearchPathWrap SearchPathW
|
|
#define SendDlgItemMessageWrap SendDlgItemMessageW
|
|
#define SendMessageWrap SendMessageW
|
|
#define SetCurrentDirectoryWrap SetCurrentDirectoryW
|
|
#define SetDlgItemTextWrap SetDlgItemTextW
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoW
|
|
#define SetPropWrap SetPropW
|
|
#define SetFileAttributesWrap SetFileAttributesW
|
|
#define SetWindowLongWrap SetWindowLongW
|
|
#define SetWindowsHookExWrap SetWindowsHookExW
|
|
#define SHBrowseForFolderWrap SHBrowseForFolderW
|
|
#define ShellExecuteExWrap ShellExecuteExW
|
|
#define SHFileOperationWrap SHFileOperationW
|
|
#define SHGetFileInfoWrap SHGetFileInfoW
|
|
#define SHGetPathFromIDListWrap SHGetPathFromIDListW
|
|
#define StartDocWrap StartDocW
|
|
#define SystemParametersInfoWrap SystemParametersInfoW
|
|
#define TranslateAcceleratorWrap TranslateAcceleratorW
|
|
#define UnregisterClassWrap UnregisterClassW
|
|
#define VkKeyScanWrap VkKeyScanW
|
|
#define WinHelpWrap WinHelpW
|
|
#define WNetRestoreConnectionWrap WNetRestoreConnectionW
|
|
#define WNetGetLastErrorWrap WNetGetLastErrorW
|
|
#define wvsprintfWrap wvsprintfW
|
|
#define CreateFontWrap CreateFontW
|
|
#define DrawTextExWrap DrawTextExW
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoWrapW
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoW
|
|
#define InsertMenuItemWrap InsertMenuItemW
|
|
#define DragQueryFileWrap DragQueryFileW
|
|
|
|
#else
|
|
|
|
#define IsCharAlphaWrap IsCharAlphaA
|
|
#define IsCharUpperWrap IsCharUpperA
|
|
#define IsCharLowerWrap IsCharLowerA
|
|
#define IsCharAlphaNumericWrap IsCharAlphaNumericA
|
|
#define AppendMenuWrap AppendMenuA
|
|
#ifdef POST_IE5_BETA
|
|
#define CallMsgFilterWrap CallMsgFilterA
|
|
#endif
|
|
#define CallWindowProcWrap CallWindowProcA
|
|
#define CharLowerWrap CharLowerA
|
|
#define CharLowerBuffWrap CharLowerBuffA
|
|
#define CharNextWrap CharNextA
|
|
#define CharPrevWrap CharPrevA
|
|
#define CharToOemWrap CharToOemA
|
|
#define CharUpperWrap CharUpperA
|
|
#define CharUpperBuffWrap CharUpperBuffA
|
|
#define CompareStringWrap CompareStringA
|
|
#define CopyAcceleratorTableWrap CopyAcceleratorTableA
|
|
#define CreateAcceleratorTableWrap CreateAcceleratorTableA
|
|
#define CreateDCWrap CreateDCA
|
|
#define CreateDirectoryWrap CreateDirectoryA
|
|
#define CreateEventWrap CreateEventA
|
|
#define CreateFontWrap CreateFontA
|
|
#define CreateFileWrap CreateFileA
|
|
#define CreateFontIndirectWrap CreateFontIndirectA
|
|
#define CreateICWrap CreateICA
|
|
#define CreateMetaFileWrap CreateMetaFileA
|
|
#define CreateMutexWrap CreateMutexA
|
|
#define CreateSemaphoreWrap CreateSemaphoreA
|
|
#define CreateWindowExWrap CreateWindowExA
|
|
#define DefWindowProcWrap DefWindowProcA
|
|
#define DeleteFileWrap DeleteFileA
|
|
#define DispatchMessageWrap DispatchMessageA
|
|
#define DrawTextExWrap DrawTextExA
|
|
#define DrawTextWrap DrawTextA
|
|
#define EnumFontFamiliesWrap EnumFontFamiliesA
|
|
#define EnumFontFamiliesExWrap EnumFontFamiliesExA
|
|
#define EnumResourceNamesWrap EnumResourceNamesA
|
|
#define ExpandEnvironmentStringsWrap ExpandEnvironmentStringsA
|
|
#define ExtractIconExWrap ExtractIconExA
|
|
#define ExtTextOutWrap ExtTextOutA
|
|
#define FindFirstFileWrap FindFirstFileA
|
|
#define FindResourceWrap FindResourceA
|
|
#define FindNextFileWrap FindNextFileA
|
|
#define FindWindowWrap FindWindowA
|
|
#define FindWindowExWrap FindWindowExA
|
|
#define FormatMessageWrap FormatMessageA
|
|
#define GetClassInfoWrap GetClassInfoA
|
|
#define GetClassInfoExWrap GetClassInfoExA
|
|
#define GetClassLongWrap GetClassLongA
|
|
#define GetClassNameWrap GetClassNameA
|
|
#define GetClipboardFormatNameWrap GetClipboardFormatNameA
|
|
#define GetCurrentDirectoryWrap GetCurrentDirectoryA
|
|
#define GetDlgItemTextWrap GetDlgItemTextA
|
|
#define GetFileAttributesWrap GetFileAttributesA
|
|
#define GetFullPathNameWrap GetFullPathNameA
|
|
#define GetLocaleInfoWrap GetLocaleInfoA
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoA
|
|
#define GetMenuStringWrap GetMenuStringA
|
|
#define GetMessageWrap GetMessageA
|
|
#define GetModuleFileNameWrap GetModuleFileNameA
|
|
#define GetNumberFormatWrap GetNumberFormatA
|
|
#define GetPrivateProfileStringWrap GetPrivateProfileStringA
|
|
#define WritePrivateProfileStringWrap WritePrivateProfileStringA
|
|
#define GetSystemDirectoryWrap GetSystemDirectoryA
|
|
#define SearchPathWrap SearchPathA
|
|
#define GetModuleHandleWrap GetModuleHandleA
|
|
#define GetObjectWrap GetObjectA
|
|
#define GetPrivateProfileIntWrap GetPrivateProfileIntA
|
|
#define GetProfileStringWrap GetProfileStringA
|
|
#define GetPropWrap GetPropA
|
|
#define GetStringTypeExWrap GetStringTypeExA
|
|
#define GetTempFileNameWrap GetTempFileNameA
|
|
#define GetTempPathWrap GetTempPathA
|
|
#define GetTextExtentPoint32Wrap GetTextExtentPoint32A
|
|
#define GetTextFaceWrap GetTextFaceA
|
|
#define GetTextMetricsWrap GetTextMetricsA
|
|
#define GetTimeFormatWrap GetTimeFormatA
|
|
#define GetDateFormatWrap GetDateFormatA
|
|
#define GetUserNameWrap GetUserNameA
|
|
#define GetWindowLongWrap GetWindowLongA
|
|
#define GetWindowTextWrap GetWindowTextA
|
|
#define GetWindowTextLengthWrap GetWindowTextLengthA
|
|
#define GetWindowsDirectoryWrap GetWindowsDirectoryA
|
|
#define InsertMenuItemWrap InsertMenuItemA
|
|
#define InsertMenuWrap InsertMenuA
|
|
#define IsBadStringPtrWrap IsBadStringPtrA
|
|
#define IsDialogMessageWrap IsDialogMessageA
|
|
#define LoadAcceleratorsWrap LoadAcceleratorsA
|
|
#define LoadBitmapWrap LoadBitmapA
|
|
#define LoadCursorWrap LoadCursorA
|
|
#define LoadIconWrap LoadIconA
|
|
#define LoadImageWrap LoadImageWrapA
|
|
#define LoadLibraryWrap LoadLibraryA
|
|
#define LoadLibraryExWrap LoadLibraryExA
|
|
#define LoadMenuWrap LoadMenuA
|
|
#define LoadStringWrap LoadStringA
|
|
#define MessageBoxIndirectWrap MessageBoxIndirectA
|
|
#define MessageBoxWrap MessageBoxA
|
|
#define ModifyMenuWrap ModifyMenuA
|
|
#define GetCharWidth32Wrap GetCharWidth32A
|
|
#define GetCharacterPlacementWrap GetCharacterPlacementA
|
|
#define CopyFileWrap CopyFileA
|
|
#define MoveFileWrap MoveFileA
|
|
#define OemToCharWrap OemToCharA
|
|
#define OutputDebugStringWrap OutputDebugStringA
|
|
#define PeekMessageWrap PeekMessageA
|
|
#define PostMessageWrap PostMessageA
|
|
#define PostThreadMessageWrap PostThreadMessageA
|
|
#define RegCreateKeyWrap RegCreateKeyA
|
|
#define RegCreateKeyExWrap RegCreateKeyExA
|
|
#define RegDeleteKeyWrap RegDeleteKeyA
|
|
#define RegDeleteValueWrap RegDeleteValueA
|
|
#define RegEnumKeyWrap RegEnumKeyA
|
|
#define RegEnumKeyExWrap RegEnumKeyExA
|
|
#define RegOpenKeyWrap RegOpenKeyA
|
|
#define RegOpenKeyExWrap RegOpenKeyExA
|
|
#define RegQueryInfoKeyWrap RegQueryInfoKeyA
|
|
#define RegQueryValueWrap RegQueryValueA
|
|
#define RegQueryValueExWrap RegQueryValueExA
|
|
#define RegSetValueWrap RegSetValueA
|
|
#define RegSetValueExWrap RegSetValueExA
|
|
#define RegisterClassWrap RegisterClassA
|
|
#define RegisterClassExWrap RegisterClassExA
|
|
#define RegisterClipboardFormatWrap RegisterClipboardFormatA
|
|
#define RegisterWindowMessageWrap RegisterWindowMessageA
|
|
#define RemovePropWrap RemovePropA
|
|
#define SendDlgItemMessageWrap SendDlgItemMessageA
|
|
#define SendMessageWrap SendMessageA
|
|
#define SetCurrentDirectoryWrap SetCurrentDirectoryA
|
|
#define SetDlgItemTextWrap SetDlgItemTextA
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoA
|
|
#define SetPropWrap SetPropA
|
|
#define SetWindowLongWrap SetWindowLongA
|
|
#define SHBrowseForFolderWrap SHBrowseForFolderA
|
|
#define ShellExecuteExWrap ShellExecuteExA
|
|
#define SHFileOperationWrap SHFileOperationA
|
|
#define SHGetFileInfoWrap SHGetFileInfoA
|
|
#define SHGetPathFromIDListWrap SHGetPathFromIDListA
|
|
#define SetFileAttributesWrap SetFileAttributesA
|
|
#define SetWindowsHookExWrap SetWindowsHookExA
|
|
#define StartDocWrap StartDocA
|
|
#define SystemParametersInfoWrap SystemParametersInfoA
|
|
#define TranslateAcceleratorWrap TranslateAcceleratorA
|
|
#define UnregisterClassWrap UnregisterClassA
|
|
#define VkKeyScanWrap VkKeyScanA
|
|
#define WinHelpWrap WinHelpA
|
|
#define WNetRestoreConnectionWrap WNetRestoreConnectionA
|
|
#define WNetGetLastErrorWrap WNetGetLastErrorA
|
|
#define wvsprintfWrap wvsprintfA
|
|
#define CreateFontWrap CreateFontA
|
|
#define DrawTextExWrap DrawTextExA
|
|
#define GetMenuItemInfoWrap GetMenuItemInfoA
|
|
#define SetMenuItemInfoWrap SetMenuItemInfoA
|
|
#define InsertMenuItemWrap InsertMenuItemA
|
|
#define DragQueryFileWrap DragQueryFileA
|
|
#endif
|
|
#endif // defined(UNIX) && defined(NO_SHLWAPI_UNITHUNK)
|
|
|
|
// Some functions are used to wrap unicode win95 functions AND to provide ML wrappers,
|
|
// so they are needed unless BOTH NO_SHLWAPI_UNITHUNG and NO_SHLWAPI_MLUI are defined
|
|
//
|
|
#if (_WIN32_IE >= 0x0500) && (!defined(NO_SHLWAPI_UNITHUNK) || !defined(NO_SHLWAPI_MLUI))
|
|
|
|
LWSTDAPI_(HWND)
|
|
CreateDialogIndirectParamWrapW(
|
|
HINSTANCE hInstance,
|
|
LPCDLGTEMPLATEW hDialogTemplate,
|
|
HWND hWndParent,
|
|
DLGPROC lpDialogFunc,
|
|
LPARAM dwInitParam);
|
|
|
|
LWSTDAPI_(HWND)
|
|
CreateDialogParamWrapW(
|
|
HINSTANCE hInstance,
|
|
LPCWSTR lpTemplateName,
|
|
HWND hWndParent,
|
|
DLGPROC lpDialogFunc,
|
|
LPARAM dwInitParam);
|
|
|
|
LWSTDAPI_(INT_PTR)
|
|
DialogBoxIndirectParamWrapW(
|
|
HINSTANCE hInstance,
|
|
LPCDLGTEMPLATEW hDialogTemplate,
|
|
HWND hWndParent,
|
|
DLGPROC lpDialogFunc,
|
|
LPARAM dwInitParam);
|
|
|
|
LWSTDAPI_(INT_PTR)
|
|
DialogBoxParamWrapW(
|
|
HINSTANCE hInstance,
|
|
LPCWSTR lpszTemplate,
|
|
HWND hWndParent,
|
|
DLGPROC lpDialogFunc,
|
|
LPARAM dwInitParam);
|
|
|
|
LWSTDAPI_(BOOL) SetWindowTextWrapW(HWND hWnd, LPCWSTR lpString);
|
|
|
|
|
|
LWSTDAPI_(BOOL) DeleteMenuWrap(HMENU hMenu, UINT uPosition, UINT uFlags);
|
|
|
|
LWSTDAPI_(BOOL) DestroyMenuWrap(HMENU hMenu);
|
|
|
|
#ifdef UNICODE
|
|
|
|
#define CreateDialogIndirectParamWrap CreateDialogIndirectParamWrapW
|
|
#define CreateDialogParamWrap CreateDialogParamWrapW
|
|
#define DialogBoxIndirectParamWrap DialogBoxIndirectParamWrapW
|
|
#define DialogBoxParamWrap DialogBoxParamWrapW
|
|
#define SetWindowTextWrap SetWindowTextWrapW
|
|
|
|
#else
|
|
|
|
#define CreateDialogIndirectParamWrap CreateDialogIndirectParamA
|
|
#define CreateDialogParamWrap CreateDialogParamA
|
|
#define DialogBoxIndirectParamWrap DialogBoxIndirectParamA
|
|
#define DialogBoxParamWrap DialogBoxParamA
|
|
#define SetWindowTextWrap SetWindowTextA
|
|
|
|
#endif // UNICODE
|
|
|
|
#endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_UNITHUNK) && !defined (NO_SHLWAPI_MLUI)
|
|
|
|
|
|
//=============== Thread Pool Services ===================================
|
|
|
|
#if (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_TPS)
|
|
|
|
//
|
|
// SHLWAPIP versions of KERNEL32 Thread Pool Services APIs
|
|
//
|
|
|
|
typedef void (NTAPI * WAITORTIMERCALLBACKFUNC)(void *, BOOLEAN);
|
|
typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
SHRegisterWaitForSingleObject(
|
|
IN HANDLE hObject,
|
|
IN WAITORTIMERCALLBACKFUNC pfnCallback,
|
|
IN LPVOID pContext,
|
|
IN DWORD dwMilliseconds,
|
|
IN LPCSTR lpszLibrary OPTIONAL,
|
|
IN DWORD dwFlags
|
|
);
|
|
|
|
//
|
|
// flags for SHRegisterWaitForSingleObject (keep separate from other TPS flags)
|
|
//
|
|
|
|
//
|
|
// SRWSO_NOREMOVE - if set, the handle is not to be removed from the list once
|
|
// signalled. Intended for use with auto-reset events that the caller wants to
|
|
// keep until unregistered
|
|
//
|
|
|
|
#define SRWSO_NOREMOVE 0x00000100
|
|
|
|
#define SRWSO_VALID_FLAGS (SRWSO_NOREMOVE)
|
|
|
|
#define SRWSO_INVALID_FLAGS (~SRWSO_VALID_FLAGS)
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHUnregisterWait(
|
|
IN HANDLE hWait
|
|
);
|
|
|
|
typedef struct {
|
|
DWORD dwStructSize;
|
|
DWORD dwMinimumWorkerThreads;
|
|
DWORD dwMaximumWorkerThreads;
|
|
DWORD dwMaximumWorkerQueueDepth;
|
|
DWORD dwWorkerThreadIdleTimeout;
|
|
DWORD dwWorkerThreadCreationDelta;
|
|
DWORD dwMinimumIoWorkerThreads;
|
|
DWORD dwMaximumIoWorkerThreads;
|
|
DWORD dwMaximumIoWorkerQueueDepth;
|
|
DWORD dwIoWorkerThreadCreationDelta;
|
|
} SH_THREAD_POOL_LIMITS, *PSH_THREAD_POOL_LIMITS;
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHSetThreadPoolLimits(
|
|
IN PSH_THREAD_POOL_LIMITS pLimits
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHTerminateThreadPool(
|
|
VOID
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHQueueUserWorkItem(
|
|
IN LPTHREAD_START_ROUTINE pfnCallback,
|
|
IN LPVOID pContext,
|
|
IN LONG lPriority,
|
|
IN DWORD_PTR dwTag,
|
|
OUT DWORD_PTR * pdwId OPTIONAL,
|
|
IN LPCSTR pszModule OPTIONAL,
|
|
IN DWORD dwFlags
|
|
);
|
|
|
|
LWSTDAPI_(DWORD)
|
|
SHCancelUserWorkItems(
|
|
IN DWORD_PTR dwTagOrId,
|
|
IN BOOL bTag
|
|
);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
SHCreateTimerQueue(
|
|
VOID
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHDeleteTimerQueue(
|
|
IN HANDLE hQueue
|
|
);
|
|
|
|
LWSTDAPI_(HANDLE)
|
|
SHSetTimerQueueTimer(
|
|
IN HANDLE hQueue,
|
|
IN WAITORTIMERCALLBACK pfnCallback,
|
|
IN LPVOID pContext,
|
|
IN DWORD dwDueTime,
|
|
IN DWORD dwPeriod,
|
|
IN LPCSTR lpszLibrary OPTIONAL,
|
|
IN DWORD dwFlags
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHChangeTimerQueueTimer(
|
|
IN HANDLE hQueue,
|
|
IN HANDLE hTimer,
|
|
IN DWORD dwDueTime,
|
|
IN DWORD dwPeriod
|
|
);
|
|
|
|
LWSTDAPI_(BOOL)
|
|
SHCancelTimerQueueTimer(
|
|
IN HANDLE hQueue,
|
|
IN HANDLE hTimer
|
|
);
|
|
|
|
//
|
|
// Thread Pool Services flags
|
|
//
|
|
|
|
//
|
|
// TPS_EXECUTEIO - execute in I/O thread (via APC). Default is non-IO thread
|
|
//
|
|
|
|
#define TPS_EXECUTEIO 0x00000001
|
|
|
|
//
|
|
// TPS_TAGGEDITEM - the dwTag parameter is meaningful
|
|
//
|
|
|
|
#define TPS_TAGGEDITEM 0x00000002
|
|
|
|
//
|
|
// TPS_DEMANDTHREAD - always create a new thread if none currently available.
|
|
// Used in situations where immediate response required
|
|
//
|
|
|
|
#define TPS_DEMANDTHREAD 0x00000004
|
|
|
|
//
|
|
// TPS_LONGEXECTIME - the work item will take relatively long time to execute.
|
|
// Used as management hint to TPS
|
|
//
|
|
|
|
#define TPS_LONGEXECTIME 0x00000008
|
|
|
|
//
|
|
// TPS_RESERVED_FLAGS - mask of bits reserved for internal use
|
|
//
|
|
|
|
#define TPS_RESERVED_FLAGS 0xFF000000
|
|
|
|
#define TPS_VALID_FLAGS (TPS_EXECUTEIO \
|
|
| TPS_TAGGEDITEM \
|
|
| TPS_DEMANDTHREAD \
|
|
| TPS_LONGEXECTIME \
|
|
)
|
|
#define TPS_INVALID_FLAGS (~TPS_VALID_FLAGS)
|
|
|
|
#endif // (_WIN32_IE >= 0x0500) && !defined(NO_SHLWAPI_TPS)
|
|
|
|
|
|
//
|
|
// Private MIME helper functions used by shdocvw & shell32
|
|
//
|
|
#if (_WIN32_IE >= 0x0500)
|
|
|
|
LWSTDAPI_(BOOL) GetMIMETypeSubKeyA(LPCSTR pszMIMEType, LPSTR pszBuf, UINT cchBuf);
|
|
LWSTDAPI_(BOOL) GetMIMETypeSubKeyW(LPCWSTR pszMIMEType, LPWSTR pszBuf, UINT cchBuf);
|
|
|
|
LWSTDAPI_(BOOL) RegisterMIMETypeForExtensionA(LPCSTR pcszExtension, LPCSTR pcszMIMEContentType);
|
|
LWSTDAPI_(BOOL) RegisterMIMETypeForExtensionW(LPCWSTR pcszExtension, LPCWSTR pcszMIMEContentType);
|
|
|
|
LWSTDAPI_(BOOL) UnregisterMIMETypeForExtensionA(LPCSTR pcszExtension);
|
|
LWSTDAPI_(BOOL) UnregisterMIMETypeForExtensionW(LPCWSTR pcszExtension);
|
|
|
|
LWSTDAPI_(BOOL) RegisterExtensionForMIMETypeA(LPCSTR pcszExtension, LPCSTR pcszMIMEContentType);
|
|
LWSTDAPI_(BOOL) RegisterExtensionForMIMETypeW(LPCWSTR pcszExtension, LPCWSTR pcszMIMEContentType);
|
|
|
|
LWSTDAPI_(BOOL) UnregisterExtensionForMIMETypeA(LPCSTR pcszMIMEContentType);
|
|
LWSTDAPI_(BOOL) UnregisterExtensionForMIMETypeW(LPCWSTR pcszMIMEContentType);
|
|
|
|
LWSTDAPI_(BOOL) MIME_GetExtensionA(LPCSTR pcszMIMEType, LPSTR pszExtensionBuf, UINT ucExtensionBufLen);
|
|
LWSTDAPI_(BOOL) MIME_GetExtensionW(LPCWSTR pcszMIMEType, LPWSTR pszExtensionBuf, UINT ucExtensionBufLen);
|
|
|
|
#ifdef UNICODE
|
|
#define GetMIMETypeSubKey GetMIMETypeSubKeyW
|
|
#define RegisterMIMETypeForExtension RegisterMIMETypeForExtensionW
|
|
#define UnregisterMIMETypeForExtension UnregisterMIMETypeForExtensionW
|
|
#define RegisterExtensionForMIMEType RegisterExtensionForMIMETypeW
|
|
#define UnregisterExtensionForMIMEType UnregisterExtensionForMIMETypeW
|
|
#define MIME_GetExtension MIME_GetExtensionW
|
|
#else
|
|
#define GetMIMETypeSubKey GetMIMETypeSubKeyA
|
|
#define RegisterMIMETypeForExtension RegisterMIMETypeForExtensionA
|
|
#define UnregisterMIMETypeForExtension UnregisterMIMETypeForExtensionA
|
|
#define RegisterExtensionForMIMEType RegisterExtensionForMIMETypeA
|
|
#define UnregisterExtensionForMIMEType UnregisterExtensionForMIMETypeA
|
|
#define MIME_GetExtension MIME_GetExtensionA
|
|
#endif
|
|
|
|
// Options for SHGetMachineInfo
|
|
|
|
//
|
|
// Note that GMI_DOCKSTATE is unreliable for ACPI laptops.
|
|
//
|
|
#define GMI_DOCKSTATE 0x0000
|
|
// Return values for SHGetMachineInfo(GMI_DOCKSTATE)
|
|
#define GMID_NOTDOCKABLE 0 // Cannot be docked
|
|
#define GMID_UNDOCKED 1 // Is undocked
|
|
#define GMID_DOCKED 2 // Is docked
|
|
|
|
//
|
|
// GMI_BATTERYSTATE reports on the presence and status of non-UPS
|
|
// batteries.
|
|
//
|
|
#define GMI_BATTERYSTATE 0x0001
|
|
// Return value for SHGetMachineInfo(GMI_BATTERYSTATE) is a bitmask
|
|
#define GMIB_HASBATTERY 0x0001 // Can run on batteries
|
|
#define GMIB_ONBATTERY 0x0002 // Is now on batteries
|
|
|
|
//
|
|
// WARNING! DANGER! EVIL!
|
|
//
|
|
// GMI_LAPTOP is not perfect. It can be fooled by particular hardware
|
|
// configurations. You are much better off asking specifically why you
|
|
// care about laptops and use one of the above GMI values instead. For
|
|
// example, if you want to scale back some intensive operation so you
|
|
// don't drain the battery, use GMI_BATTERYSTATE instead.
|
|
//
|
|
#define GMI_LAPTOP 0x0002 // Returns nonzero if might be a laptop
|
|
|
|
#if (_WIN32_IE >= 0x0501)
|
|
|
|
//
|
|
// GMI_TSCLIENT tells you whether you are running as a Terminal Server
|
|
// client and should disable your animations.
|
|
//
|
|
#define GMI_TSCLIENT 0x0003 // Returns nonzero if TS client
|
|
|
|
#endif // (_WIN32_IE >= 0x0501)
|
|
|
|
LWSTDAPI_(DWORD_PTR) SHGetMachineInfo(UINT gmi);
|
|
|
|
// support InterlockedCompareExchange() on Win95
|
|
|
|
LWSTDAPI_(void *) SHInterlockedCompareExchange(void **ppDest, void *pExch, void *pComp);
|
|
|
|
#if !defined(_X86_)
|
|
// Win95 doesn't run on Alpha/UNIX so we can use the OS function directly
|
|
// Use a #define instead of a forwarder because it's an intrinsic on most
|
|
// compilers.
|
|
#define SHInterlockedCompareExchange InterlockedCompareExchangePointer
|
|
#endif
|
|
|
|
LWSTDAPI_(BOOL) SHMirrorIcon(HICON* phiconSmall, HICON* phiconLarge);
|
|
|
|
|
|
#endif // (_WIN32_IE >= 0x0500)
|
|
|
|
|
|
// Raw Accelerator Table API
|
|
//
|
|
// Allows an accelerator table grep without having to invoke ::TranslateAccelerator.
|
|
// Useful for dealing with parent-child window accelerator conflicts.
|
|
//
|
|
|
|
// HANDLE SHLoadRawAccelerators( HINSTANCE hInst, LPCTSTR lpTableName );
|
|
// Loads the raw accelerator table.
|
|
// hInst Module instance containing the accelerator resource.
|
|
// lpTableName Names the accelerator table resource to load.
|
|
|
|
// The return value is a handle that can be passed to a SHQueryRawAcceleratorXXX function.
|
|
// When the handle is no longer required, it should be freed with LocalFree().
|
|
LWSTDAPI_(HANDLE) SHLoadRawAccelerators ( HINSTANCE hInst, LPCTSTR lpTableName );
|
|
|
|
// BOOL SHQueryRawAccelerator ( HANDLE hcaAcc, IN BYTE fVirtMask, IN BYTE fVirt, IN WPARAM wKey, OUT OPTIONAL UINT* puCmdID );
|
|
// Queries the raw accelererator table for the specified key
|
|
// hcaAcc Handle returned from SHLoadRawAccelerators().
|
|
// fVirtMask Relevant accelerator flags (any combo of FALT|FCONTROL|FNOINVERT|FSHIFT|FVIRTKEY)
|
|
// fVirt Accelerator flags to test (any combo of FALT|FCONTROL|FNOINVERT|FSHIFT|FVIRTKEY).
|
|
// wKey Accelerator key. This can either be a virtual key (FVIRTKEY) or an ASCII char code.
|
|
// puCmdID Optional address to receive command identifier for the accelerator entry if
|
|
// the key is in the table.
|
|
// Returns nonzero if the key is in the accelerator table; otherwise 0.
|
|
LWSTDAPI_(BOOL) SHQueryRawAccelerator ( HANDLE hcaAcc, IN BYTE fVirtMask, IN BYTE fVirt, IN WPARAM wKey, OUT OPTIONAL UINT* puCmdID );
|
|
|
|
// BOOL SHQueryRawAcceleratorMsg( HANDLE hcaAcc, MSG* pmsg, OUT OPTIONAL UINT* puCmdID );
|
|
// Determines whether the specified message is an accelerator message mapping to
|
|
// an entry in the raw accelerator table.
|
|
// hcaAcc Handle returned from SHLoadRawAccelerators().
|
|
// pmsg Address of the message to test.
|
|
// puCmdID Optional address to receive command identifier for the accelerator entry if
|
|
// the message maps to an accelerator in the table.
|
|
// Returns nonzero if the message is a WM_KEYUP or WM_KEYDOWN and the key is in
|
|
// the accelerator table; otherwise 0.
|
|
LWSTDAPI_(BOOL) SHQueryRawAcceleratorMsg( HANDLE hcaAcc, MSG* pmsg, OUT OPTIONAL UINT* puCmdID );
|
|
//
|
|
//
|
|
|
|
LWSTDAPI_(BOOL) SHBoolSystemParametersInfo(UINT uiAction, DWORD *pdwParam);
|
|
|
|
LWSTDAPI_(BOOL) SHAreIconsEqual(HICON hIcon1, HICON hIcon2);
|
|
|
|
LWSTDAPI_(BOOL) IEHardened(void);
|
|
|
|
//
|
|
//====== End Internal functions ===============================================
|
|
//
|
|
#endif // NO_SHLWAPI_INTERNAL
|
|
|
|
;end_internal
|
|
|
|
#if (_WIN32_IE >= 0x0500)
|
|
|
|
// SHAutoComplete
|
|
// hwndEdit - HWND of editbox, ComboBox or ComboBoxEx.
|
|
// dwFlags - Flags to indicate what to AutoAppend or AutoSuggest for the editbox.
|
|
//
|
|
// WARNING:
|
|
// Caller needs to have called CoInitialize() or OleInitialize()
|
|
// and cannot call CoUninit/OleUninit until after
|
|
// WM_DESTROY on hwndEdit.
|
|
//
|
|
// dwFlags values:
|
|
#define SHACF_DEFAULT 0x00000000 // Currently (SHACF_FILESYSTEM | SHACF_URLALL)
|
|
#define SHACF_FILESYSTEM 0x00000001 // This includes the File System as well as the rest of the shell (Desktop\My Computer\Control Panel\)
|
|
#define SHACF_URLALL (SHACF_URLHISTORY | SHACF_URLMRU)
|
|
#define SHACF_URLHISTORY 0x00000002 // URLs in the User's History
|
|
#define SHACF_URLMRU 0x00000004 // URLs in the User's Recently Used list.
|
|
#define SHACF_USETAB 0x00000008 // Use the tab to move thru the autocomplete possibilities instead of to the next dialog/window control.
|
|
#define SHACF_FILESYS_ONLY 0x00000010 // This includes the File System
|
|
|
|
#if (_WIN32_IE >= 0x0600)
|
|
#define SHACF_FILESYS_DIRS 0x00000020 // Same as SHACF_FILESYS_ONLY except it only includes directories, UNC servers, and UNC server shares.
|
|
#endif // (_WIN32_IE >= 0x0600)
|
|
|
|
#define SHACF_AUTOSUGGEST_FORCE_ON 0x10000000 // Ignore the registry default and force the feature on.
|
|
#define SHACF_AUTOSUGGEST_FORCE_OFF 0x20000000 // Ignore the registry default and force the feature off.
|
|
#define SHACF_AUTOAPPEND_FORCE_ON 0x40000000 // Ignore the registry default and force the feature on. (Also know as AutoComplete)
|
|
#define SHACF_AUTOAPPEND_FORCE_OFF 0x80000000 // Ignore the registry default and force the feature off. (Also know as AutoComplete)
|
|
|
|
LWSTDAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags);
|
|
|
|
LWSTDAPI SHSetThreadRef(IUnknown *punk);
|
|
LWSTDAPI SHGetThreadRef(IUnknown **ppunk);
|
|
|
|
LWSTDAPI_(BOOL) SHSkipJunction(struct IBindCtx* pbc, const CLSID *pclsid);
|
|
#endif // (_WIN32_IE >= 0x0500)
|
|
|
|
#define CTF_INSIST 0x00000001 // SHCreateThread() dwFlags - call pfnThreadProc synchronously if CreateThread() fails
|
|
#define CTF_THREAD_REF 0x00000002 // hold a reference to the creating thread
|
|
#define CTF_PROCESS_REF 0x00000004 // hold a reference to the creating process
|
|
#define CTF_COINIT 0x00000008 // init COM for the created thread
|
|
#define CTF_FREELIBANDEXIT 0x00000010 // hold a ref to the DLL and call FreeLibraryAndExitThread() when done
|
|
#define CTF_REF_COUNTED 0x00000020 // thread supports ref counting via SHGetThreadRef() or CTF_THREAD_REF so that child threads can keep this thread alive
|
|
#define CTF_WAIT_ALLOWCOM 0x00000040 // while waiting for pfnCallback, allow COM marshaling to the blocked calling thread
|
|
|
|
LWSTDAPI_(BOOL) SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, void *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback);
|
|
|
|
LWSTDAPI SHReleaseThreadRef(); // release a CTF_THREAD_REF reference earlier than the return of pfnThreadProc
|
|
|
|
#ifndef NO_SHLWAPI_GDI
|
|
//
|
|
//====== GDI helper functions ================================================
|
|
//
|
|
|
|
LWSTDAPI_(HPALETTE) SHCreateShellPalette(HDC hdc);
|
|
|
|
#if (_WIN32_IE >= 0x0500)
|
|
|
|
LWSTDAPI_(void) ColorRGBToHLS(COLORREF clrRGB, WORD* pwHue, WORD* pwLuminance, WORD* pwSaturation);
|
|
LWSTDAPI_(COLORREF) ColorHLSToRGB(WORD wHue, WORD wLuminance, WORD wSaturation);
|
|
LWSTDAPI_(COLORREF) ColorAdjustLuma(COLORREF clrRGB, int n, BOOL fScale);
|
|
|
|
;begin_internal
|
|
#ifdef NOTYET // once this is implemented, make this public
|
|
// SHGetCommonResourceID
|
|
//
|
|
// (use MAKEINTRESOURCE on the following IDs)
|
|
|
|
// These values are indexes into an internal table. Be careful. ;internal
|
|
#define SHGCR_BITMAP_WINDOWS_LOGO MAKEINTRESOURCE(1)
|
|
#define SHGCR_AVI_FLASHLIGHT MAKEINTRESOURCE(2)
|
|
#define SHGCR_AVI_FINDFILE MAKEINTRESOURCE(3)
|
|
#define SHGCR_AVI_FINDCOMPUTER MAKEINTRESOURCE(4)
|
|
#define SHGCR_AVI_FILEMOVE MAKEINTRESOURCE(5)
|
|
#define SHGCR_AVI_FILECOPY MAKEINTRESOURCE(6)
|
|
#define SHGCR_AVI_FILEDELETE MAKEINTRESOURCE(7)
|
|
#define SHGCR_AVI_EMPTYWASTEBASKET MAKEINTRESOURCE(8)
|
|
#define SHGCR_AVI_FILEREALDELETE MAKEINTRESOURCE(9) // Bypass Recycle Bin
|
|
#define SHGCR_AVI_DOWNLOAD MAKEINTRESOURCE(10)
|
|
|
|
LWSTDAPI SHGetCommonResourceIDA(IN LPCSTR pszID, IN DWORD dwRes, OUT HMODULE * phmod, OUT UINT * pnID);
|
|
LWSTDAPI SHGetCommonResourceIDA(IN LPCSTR pszID, IN DWORD dwRes, OUT HMODULE * phmod, OUT UINT * pnID);
|
|
|
|
#ifdef UNICODE
|
|
#define SHGetCommonResourceID SHGetCommonResourceIDW
|
|
#else
|
|
#define SHGetCommonResourceID SHGetCommonResourceIDW
|
|
#endif
|
|
#endif // NOTYET
|
|
;end_internal
|
|
|
|
#endif // _WIN32_IE >= 0x0500
|
|
|
|
#endif // NO_SHLWAPI_GDI
|
|
|
|
|
|
//
|
|
//====== DllGetVersion =======================================================
|
|
//
|
|
|
|
typedef struct _DLLVERSIONINFO
|
|
{
|
|
DWORD cbSize;
|
|
DWORD dwMajorVersion; // Major version
|
|
DWORD dwMinorVersion; // Minor version
|
|
DWORD dwBuildNumber; // Build number
|
|
DWORD dwPlatformID; // DLLVER_PLATFORM_*
|
|
} DLLVERSIONINFO;
|
|
|
|
// Platform IDs for DLLVERSIONINFO
|
|
#define DLLVER_PLATFORM_WINDOWS 0x00000001 // Windows 95
|
|
#define DLLVER_PLATFORM_NT 0x00000002 // Windows NT
|
|
|
|
#if (_WIN32_IE >= 0x0501)
|
|
|
|
typedef struct _DLLVERSIONINFO2
|
|
{
|
|
DLLVERSIONINFO info1;
|
|
// dwFlags is really for alignment purposes ;Internal
|
|
DWORD dwFlags; // No flags currently defined
|
|
ULONGLONG ullVersion; // Encoded as:
|
|
// Major 0xFFFF 0000 0000 0000
|
|
// Minor 0x0000 FFFF 0000 0000
|
|
// Build 0x0000 0000 FFFF 0000
|
|
// QFE 0x0000 0000 0000 FFFF
|
|
} DLLVERSIONINFO2;
|
|
|
|
#define DLLVER_MAJOR_MASK 0xFFFF000000000000
|
|
#define DLLVER_MINOR_MASK 0x0000FFFF00000000
|
|
#define DLLVER_BUILD_MASK 0x00000000FFFF0000
|
|
#define DLLVER_QFE_MASK 0x000000000000FFFF
|
|
|
|
#endif
|
|
|
|
#define MAKEDLLVERULL(major, minor, build, qfe) \
|
|
(((ULONGLONG)(major) << 48) | \
|
|
((ULONGLONG)(minor) << 32) | \
|
|
((ULONGLONG)(build) << 16) | \
|
|
((ULONGLONG)( qfe) << 0))
|
|
|
|
//
|
|
// The caller should always GetProcAddress("DllGetVersion"), not
|
|
// implicitly link to it.
|
|
//
|
|
|
|
typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
|
|
|
|
// DllInstall (to be implemented by self-installing DLLs)
|
|
STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine);
|
|
|
|
;begin_internal
|
|
#if (_WIN32_IE >= 0x0501)
|
|
//
|
|
// ======== SHGetAppCompatFlags ================================================
|
|
//
|
|
|
|
//===========================================================================
|
|
// Shell Application Compatability flags
|
|
|
|
// SHGetAppCompatFlags flags
|
|
#define ACF_NONE 0x00000000
|
|
#define ACF_CONTEXTMENU 0x00000001
|
|
#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
|
|
#define ACF_OLDCREATEVIEWWND 0x00000004 // PowerDesk relies on CreateViewWindow returning S_OK
|
|
#define ACF_WIN95DEFVIEW 0x00000004 // for apps that depend on win95 defview behavior
|
|
#define ACF_DOCOBJECT 0x00000002
|
|
#define ACF_FLUSHNOWAITALWAYS 0x00000001
|
|
#define ACF_MYCOMPUTERFIRST 0x00000008 // MyComp must be first item on the desktop
|
|
#define ACF_OLDREGITEMGDN 0x00000010 // Win95-compatible GetDisplayNameOf on regitems
|
|
#define ACF_LOADCOLUMNHANDLER 0x00000040 // Dont delay load column handler.
|
|
#define ACF_ANSI 0x00000080 // For Apps that Pass in ANSI Strings
|
|
#define ACF_STRIPFOLDERBIT 0x00000100 // nuke the folder GAO in file dialog (for folder shortcuts, zip & cab files)
|
|
#define ACF_WIN95SHLEXEC 0x00000200 // dont use DDEWAIT when thunking to ShellExecEx()
|
|
#define ACF_STAROFFICE5PRINTER 0x00000400 // special return values from printer folder GAO
|
|
#define ACF_NOVALIDATEFSIDS 0x00000800 // FS pidls should not be validated.
|
|
#define ACF_FILEOPENNEEDSEXT 0x00001000 // Need to show extensioin in the name box of the open file common dialog
|
|
#define ACF_WIN95BINDTOOBJECT 0x00002000 // Win95 BindToObject behavior dependencies
|
|
#define ACF_IGNOREENUMRESET 0x00004000 // App relies on IEnumIDList::Reset returning E_NOTIMPL
|
|
#define ACF_ANSIDISPLAYNAMES 0x00010000 // calling process requires the ISF::GDN in ansi
|
|
#define ACF_FILEOPENBOGUSCTRLID 0x00020000 // Requires that the toolbar in fileopen have ctrl ID == ID_OK
|
|
#define ACF_FORCELFNIDLIST 0x00040000 // forces no AltName in the FS pidls (for apps that read directly from the pidl)
|
|
#define ACF_APPISOFFICE 0x01000000 // calling app is office (95, 97, 2000, ++)
|
|
#define ACF_KNOWPERPROCESS 0x80000000 // We know the per process flags already.
|
|
|
|
// The flags that are per-process
|
|
#define ACF_PERPROCESSFLAGS (ACF_CONTEXTMENU | ACF_CORELINTERNETENUM | ACF_OLDCREATEVIEWWND | ACF_WIN95DEFVIEW | \
|
|
ACF_DOCOBJECT | ACF_FLUSHNOWAITALWAYS | ACF_MYCOMPUTERFIRST | ACF_OLDREGITEMGDN | \
|
|
ACF_LOADCOLUMNHANDLER | ACF_ANSI | ACF_WIN95SHLEXEC | ACF_STAROFFICE5PRINTER | \
|
|
ACF_NOVALIDATEFSIDS | ACF_FILEOPENNEEDSEXT | ACF_WIN95BINDTOOBJECT | \
|
|
ACF_IGNOREENUMRESET | ACF_ANSIDISPLAYNAMES | ACF_FILEOPENBOGUSCTRLID | ACF_FORCELFNIDLIST)
|
|
|
|
// Flags that are per caller
|
|
#define ACF_PERCALLFLAGS (ACF_APPISOFFICE | ACF_STRIPFOLDERBIT)
|
|
|
|
|
|
LWSTDAPI_(DWORD) SHGetAppCompatFlags (DWORD dwFlagsNeeded);
|
|
|
|
enum {
|
|
OBJCOMPATF_OTNEEDSSFCACHE = 0x00000001,
|
|
OBJCOMPATF_NO_WEBVIEW = 0x00000002,
|
|
OBJCOMPATF_UNBINDABLE = 0x00000004,
|
|
OBJCOMPATF_PINDLL = 0x00000008,
|
|
OBJCOMPATF_NEEDSFILESYSANCESTOR = 0x00000010,
|
|
OBJCOMPATF_NOTAFILESYSTEM = 0x00000020,
|
|
OBJCOMPATF_CTXMENU_NOVERBS = 0x00000040,
|
|
OBJCOMPATF_CTXMENU_LIMITEDQI = 0x00000080,
|
|
OBJCOMPATF_COCREATESHELLFOLDERONLY = 0x00000100,
|
|
OBJCOMPATF_NEEDSSTORAGEANCESTOR = 0x00000200,
|
|
OBJCOMPATF_NOLEGACYWEBVIEW = 0x00000400,
|
|
OBJCOMPATF_BLOCKSHELLSERVICEOBJECT = 0x00000800,
|
|
} ;
|
|
|
|
typedef DWORD OBJCOMPATFLAGS;
|
|
|
|
LWSTDAPI_(OBJCOMPATFLAGS) SHGetObjectCompatFlags(IUnknown *punk, const CLSID *pclsid);
|
|
|
|
#endif // (_WIN32_IE >= 0x0501)
|
|
|
|
#if (_WIN32_IE >= 0x0560)
|
|
LWSTDAPI_(UINT) GetUIVersion();
|
|
#endif // (_WIN32_IE >= 0x0560)
|
|
|
|
;end_internal
|
|
|
|
;begin_both
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
#include <poppack.h>
|
|
#endif
|
|
|
|
#endif
|
|
|
|
;end_both
|
|
|
|
#endif // _INC_SHLWAPIP ;internal
|
|
#endif // _INC_SHLWAPI
|