private unsafe static int GetIids()

in InspectableShadow.cs [50:72]


            private unsafe static int GetIids(IntPtr thisPtr, int* iidCount, IntPtr* iids)
            {
                try
                {
                    var shadow = ToShadow<InspectableShadow>(thisPtr);
                    var callback = (IInspectable)shadow.Callback;

                    var container = callback.Shadow;

                    var countGuids = container.Guids.Length;

                    // Copy GUIDs deduced from Callback
                    iids = (IntPtr*)Marshal.AllocCoTaskMem(IntPtr.Size * countGuids);
                    *iidCount = countGuids;

                    MemoryHelpers.CopyMemory((IntPtr)iids, new ReadOnlySpan<IntPtr>(container.Guids));
                }
                catch (Exception exception)
                {
                    return (int)Result.GetResultFromException(exception);
                }
                return Result.Ok.Code;
            }