Skip to content

Commit

Permalink
Fea, 添加CreateRandomAccessStreamOnFile、CreateStreamOverRandomAccessStr…
Browse files Browse the repository at this point in the history
…eam(PR #143
  • Loading branch information
HIllya51 authored and mingkuang-Chuyu committed Feb 4, 2025
1 parent 9479234 commit aa917e2
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/Build&Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
throw "YY-Thunks.UnitTest单元测试失败!"
}
- uses: dorny/test-reporter@v1
if: steps.BinCache.outputs.cache-hit != 'true' && (success() || failure())
if: contains(fromJSON('["push", "create"]'), github.event_name) && steps.BinCache.outputs.cache-hit != 'true' && (success() || failure())
with:
name: 单元测试报告
path: TestResults/*.trx
Expand Down
2 changes: 2 additions & 0 deletions ThunksList.md
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@
| GetProcessDpiAwareness | 调用 IsProcessDPIAware。
| SetProcessDpiAwareness | 调用SetProcessDPIAware。
| SetProcessDPIAware | 直接返回 TRUE。
| CreateRandomAccessStreamOnFile | 返回 E_NOTIMPL。
| CreateRandomAccessStreamOverStream | 返回 E_NOTIMPL。
| CreateStreamOverRandomAccessStream | 返回 E_NOTIMPL。

## shell32.dll
| 函数 | Fallback
Expand Down
59 changes: 59 additions & 0 deletions src/Thunks/shcore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,63 @@ namespace YY::Thunks
}
#endif


#if (YY_Thunks_Target < __WindowsNT6_2)

// 最低受支持的客户端 Windows 8 [桌面应用 |UWP 应用]
// 最低受支持的服务器 Windows Server 2012[桌面应用 | UWP 应用]
__DEFINE_THUNK(
shcore,
16,
HRESULT,
STDAPICALLTYPE,
CreateRandomAccessStreamOnFile,
_In_ PCWSTR _szFilePath,
_In_ DWORD _fAccessMode,
_In_ REFIID _Id,
_COM_Outptr_ void** _ppv
)
{
if (auto const _pfnCreateRandomAccessStreamOnFile = try_get_CreateRandomAccessStreamOnFile())
{
return _pfnCreateRandomAccessStreamOnFile(_szFilePath, _fAccessMode, _Id, _ppv);
}

if (!_ppv)
return E_POINTER;

*_ppv = nullptr;
return E_NOTIMPL;
}
#endif


#if (YY_Thunks_Target < __WindowsNT6_2)

// 最低受支持的客户端 Windows 8 [桌面应用 |UWP 应用]
// 最低受支持的服务器 Windows Server 2012[桌面应用 | UWP 应用]
__DEFINE_THUNK(
shcore,
12,
HRESULT,
STDAPICALLTYPE,
CreateStreamOverRandomAccessStream,
_In_ IUnknown* _pRandomAccessStream,
_In_ REFIID _Id,
_COM_Outptr_ void**_ppv
)
{
if (auto const _pfnCreateStreamOverRandomAccessStream = try_get_CreateStreamOverRandomAccessStream())
{
return _pfnCreateStreamOverRandomAccessStream(_pRandomAccessStream, _Id, _ppv);
}

if (!_ppv)
return E_POINTER;

*_ppv = nullptr;
return E_NOTIMPL;
}
#endif

} //namespace YY::Thunks

0 comments on commit aa917e2

Please sign in to comment.