Skip to content

Commit

Permalink
Call VariantInit to initialize variants (dotnet#97349)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky authored Jan 23, 2024
1 parent bb74bb7 commit cd0a72c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumerator(IEnumVAR
HRESULT hr = S_OK;

VARIANT element;
VariantInit(&element);
ULONG numFetched;

for (int i = start; i < start + count; ++i)
Expand Down Expand Up @@ -68,6 +69,7 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumeration(IDispat
{
DISPPARAMS params{};
VARIANT result;
VariantInit(&result);
HRESULT hr = pDisp->Invoke(
DISPID_NEWENUM,
IID_NULL,
Expand Down

0 comments on commit cd0a72c

Please sign in to comment.