public static IWICBitmapDecoder CreateDecoder(this IWICImagingFactory imagingFactory, Guid guidContainerFormat, Guid?pguidVendor = null) { using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) { return(imagingFactory.CreateDecoder(guidContainerFormat, pguidVendorPtr)); } }