Some additional information followup regarding @Rytmis's post.
From https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/interop-pinvokes.mdhttps://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices#guids:
Guids are usable directly in signatures. When passed by ref they can either be passed by
refor with theDO NOT Use[MarshalAs(UnmanagedType.LPStruct)]attribute.
[MarshalAs(UnmanagedType.LPStruct)]should only be used for byanything other than ref GuidsGUID parameters.