ReactOS 0.4.17-dev-769-g1500a35
evalcmd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SHELL32_CAssocElement_Version   _WIN32_WINNT_WINXP
 

Functions

HRESULT _PathCopyExeAndTrimWhiteSpaces (PWSTR pszBuff, size_t cchBuff, PCWSTR pszSrc, size_t cchSrc)
 
HRESULT _PathFindInFolder (_In_ INT csidl, _In_ PCWSTR pszSrc, _Out_ PWSTR pszPath, _In_ UINT cchPath)
 
HRESULT _PathFindInSystem (_Inout_ PWSTR pszPath, _In_ UINT cchPath)
 
HRESULT WINAPI AssocCreateElement (_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ PVOID *ppvObj)
 

Macro Definition Documentation

◆ SHELL32_CAssocElement_Version

#define SHELL32_CAssocElement_Version   _WIN32_WINNT_WINXP

Definition at line 23 of file evalcmd.h.

Function Documentation

◆ _PathCopyExeAndTrimWhiteSpaces()

HRESULT _PathCopyExeAndTrimWhiteSpaces ( PWSTR  pszBuff,
size_t  cchBuff,
PCWSTR  pszSrc,
size_t  cchSrc 
)

Definition at line 53 of file evalcmd.cpp.

54{
55 HRESULT hr = StringCchCopyNW(pszBuff, cchBuff, pszSrc, cchSrc);
56 if (SUCCEEDED(hr))
57 StrTrimW(pszBuff, L" \t");
58 return hr;
59}
HRESULT hr
Definition: delayimp.cpp:582
BOOL WINAPI StrTrimW(WCHAR *str, const WCHAR *trim)
Definition: string.c:804
#define L(x)
Definition: resources.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:50
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
_In_ DWORD _In_ int cchSrc
Definition: winnls.h:1275

Referenced by _ExeFromCmd(), and SHEvaluateSystemCommandTemplate().

◆ _PathFindInFolder()

HRESULT _PathFindInFolder ( _In_ INT  csidl,
_In_ PCWSTR  pszSrc,
_Out_ PWSTR  pszPath,
_In_ UINT  cchPath 
)

Definition at line 148 of file evalcmd.cpp.

149{
150 WCHAR szDir[MAX_PATH];
151 HRESULT hr = SHGetFolderPathW(0, csidl, 0, 0, szDir);
152 if (FAILED(hr))
153 return hr;
154
155 hr = PathCchCombineEx(pszPath, cchPath, szDir, pszSrc, PATHCCH_NONE);
156 if (FAILED(hr))
157 return hr;
158
159 return _PathExeExists(pszPath);
160}
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags)
Definition: path.c:674
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2717
static HRESULT _PathExeExists(_In_ PCWSTR pszPath)
Definition: evalcmd.cpp:132
#define FAILED(hr)
Definition: intsafe.h:51
@ PATHCCH_NONE
Definition: pathcch.h:39
short WCHAR
Definition: pedump.c:58

Referenced by _PathFindInSystem().

◆ _PathFindInSystem()

HRESULT _PathFindInSystem ( _Inout_ PWSTR  pszPath,
_In_ UINT  cchPath 
)

Definition at line 162 of file evalcmd.cpp.

163{
166 if (FAILED(hr))
168 if (FAILED(hr))
169 return hr;
170 return StringCchCopyW(pszPath, cchPath, szPath);
171}
EXTERN_C HRESULT _PathFindInFolder(_In_ INT csidl, _In_ PCWSTR pszSrc, _Out_ PWSTR pszPath, _In_ UINT cchPath)
Definition: evalcmd.cpp:148
LPCWSTR szPath
Definition: env.c:37
#define CSIDL_SYSTEM
Definition: shlobj.h:2227
#define CSIDL_WINDOWS
Definition: shlobj.h:2226
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149

Referenced by _ExeFromCmd(), and SHEvaluateSystemCommandTemplate().

◆ AssocCreateElement()

HRESULT WINAPI AssocCreateElement ( _In_ REFCLSID  rclsid,
_In_ REFIID  riid,
_Outptr_ PVOID ppvObj 
)

Definition at line 1612 of file elements.cpp.

1613{
1614 IAssociationElementOld* pElement;
1615 if (rclsid == CLSID_AssocShellElement)
1616 {
1617 auto pNewElement = new(std::nothrow) CAssocShellElement();
1618 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1619 }
1620 else if (rclsid == CLSID_AssocApplicationElement)
1621 {
1622 auto pNewElement = new(std::nothrow) CAssocApplicationElement();
1623 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1624 }
1625 else if (rclsid == CLSID_AssocProgidElement)
1626 {
1627 auto pNewElement = new(std::nothrow) CAssocProgidElement();
1628 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1629 }
1630 else if (rclsid == CLSID_AssocClsidElement)
1631 {
1632 auto pNewElement = new(std::nothrow) CAssocClsidElement();
1633 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1634 }
1635 else if (rclsid == CLSID_AssocSystemElement)
1636 {
1637 auto pNewElement = new(std::nothrow) CAssocSystemExtElement();
1638 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1639 }
1640 else if (rclsid == CLSID_AssocFolderElement)
1641 {
1642 auto pNewElement = new(std::nothrow) CAssocFolderElement();
1643 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1644 }
1645 else if (rclsid == CLSID_AssocStarElement)
1646 {
1647 auto pNewElement = new(std::nothrow) CAssocStarElement();
1648 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1649 }
1650 else if (rclsid == CLSID_AssocPerceivedElement)
1651 {
1652 auto pNewElement = new(std::nothrow) CAssocPerceivedElement();
1653 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1654 }
1655 else if (rclsid == CLSID_AssocClientElement)
1656 {
1657 auto pNewElement = new(std::nothrow) CAssocClientElement();
1658 pElement = static_cast<IAssociationElementOld*>(pNewElement);
1659 }
1660 else
1661 {
1662 ERR("rclsid: %s\n", wine_dbgstr_guid(&rclsid));
1663 *ppvObj = NULL;
1665 }
1666
1667 if (!pElement)
1668 {
1669 ERR("E_OUTOFMEMORY\n");
1670 return E_OUTOFMEMORY;
1671 }
1672
1673 HRESULT hr = pElement->QueryInterface(riid, ppvObj);
1674 pElement->Release();
1675 return hr;
1676}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:171
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772