diff --git a/PInvoke/Ole/PropSys/PropvarUtil.cs b/PInvoke/Ole/PropSys/PropvarUtil.cs index 4cb0c1612..d5f6f7ef7 100644 --- a/PInvoke/Ole/PropSys/PropvarUtil.cs +++ b/PInvoke/Ole/PropSys/PropvarUtil.cs @@ -4180,6 +4180,26 @@ public static HRESULT PropVariantToStringVector([In] PROPVARIANT propvar, out st [PInvokeData("propvarutil.h", MSDNShortId = "f8ca7844-057f-4e95-a4a9-f03f1d2ad492")] public static extern string VariantToStringWithDefault(in VARIANT varIn, string pszDefault); + /// If the source variant is a VT_BSTR, extracts string and places it into a STRRET structure. + /// + /// Type: REFVARIANT + /// Reference to a source variant structure. + /// + /// + /// Type: STRRET* + /// Pointer to the extracted string if one exists. + /// This is one of those cross-reference scenarios. STRRET is defined in the Shell32 assembly. + /// + /// + /// Type: HRESULT + /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/propvarutil/nf-propvarutil-varianttostrret + // PSSTDAPI VariantToStrRet( REFVARIANT varIn, STRRET *pstrret ); + [DllImport(Lib.PropSys, SetLastError = false, ExactSpelling = true)] + [PInvokeData("propvarutil.h", MSDNShortId = "NF:propvarutil.VariantToStrRet")] + public static extern HRESULT VariantToStrRet(in VARIANT varIn, IntPtr pstrret); + /// /// Extracts an unsigned Int16 property value of a variant structure. If no value can be extracted, then a default value is /// assigned by this function.