Skip to content

Commit

Permalink
account for optional out parameters in IStream (#6345)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Kučera <miloush@users.noreply.github.com>
  • Loading branch information
miloush and miloush authored May 9, 2022
1 parent 6bce6e2 commit 6b4faa7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Microsoft.DotNet.Wpf/src/WpfGfx/core/api/exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ CManagedStreamWrapper::Seek(
__out_ecount(1) ULARGE_INTEGER* newPos
)
{
ULARGE_INTEGER newPosLocal;
if (!newPos) newPos = &newPosLocal;
RRETURN(m_sd.pfnSeek(&m_sd, offset, origin, newPos));
}

Expand All @@ -778,6 +780,8 @@ CManagedStreamWrapper::Write(
__out_ecount(1) ULONG* cbWritten
)
{
ULONG cbWrittenLocal;
if (!cbWritten) cbWritten = &cbWrittenLocal;
RRETURN(m_sd.pfnWrite(&m_sd, buf, cb, cbWritten));
}

Expand All @@ -789,6 +793,10 @@ CManagedStreamWrapper::CopyTo(
__out_ecount(1) ULARGE_INTEGER* cbWritten
)
{
ULARGE_INTEGER cbReadLocal;
ULARGE_INTEGER cbWrittenLocal;
if (!cbRead) cbRead = &cbReadLocal;
if (!cbWritten) cbWritten = &cbWrittenLocal;
RRETURN(m_sd.pfnCopyTo(&m_sd, stream,cb, cbRead, cbWritten));
}

Expand Down

0 comments on commit 6b4faa7

Please sign in to comment.