MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / SHGetFolderPathA_Hook

Function SHGetFolderPathA_Hook

src/Engine/Engine.cpp:1657–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1655}
1656
1657static HRESULT WINAPI SHGetFolderPathA_Hook(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
1658{
1659 BOOL shouldRedirect = (csidl == (CSIDL_COMMON_DOCUMENTS | CSIDL_FLAG_CREATE));
1660
1661 HRESULT hr = ori_SHGetFolderPathA(hwnd, shouldRedirect ? (CSIDL_MYDOCUMENTS | CSIDL_FLAG_CREATE) : csidl, hToken, dwFlags, pszPath);
1662
1663 if (SUCCEEDED(hr) && shouldRedirect)
1664 {
1665 if (PathAppendA(pszPath, "My Games") == FALSE)
1666 {
1667 return E_FAIL;
1668 }
1669 }
1670
1671 return hr;
1672}
1673
1674static BOOL WINAPI AdjustWindowRect_Hook(LPRECT lpRect, DWORD dwStyle, BOOL bMenu)
1675{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected