Added fields for NewsletterOptions

This commit is contained in:
Yoshi Askharoun
2021-11-30 01:13:09 -06:00
parent bbffb8a24f
commit 0502215213
3 changed files with 12 additions and 9 deletions
@@ -1125,10 +1125,12 @@ namespace Microsoft.Zune.Service
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, INewsletterSettings**, int>)(*(ulong*)(*(long*)p + 48)))((nint)p, (INewsletterSettings**)(cComPtrNtv_003CINewsletterSettings_003E.p));
if (num >= 0)
{
NewsletterOptions newsletterOptions;
*(EmailFormat*)(&newsletterOptions) = accountSettings.EmailFormat;
Unsafe.As<NewsletterOptions, int>(ref Unsafe.AddByteOffset(ref newsletterOptions, 4)) = (accountSettings.AllowZuneEmails ? 1 : 0);
Unsafe.As<NewsletterOptions, int>(ref Unsafe.AddByteOffset(ref newsletterOptions, 8)) = (accountSettings.AllowPartnerEmails ? 1 : 0);
NewsletterOptions newsletterOptions = new()
{
emailFormat = accountSettings.EmailFormat,
allowZuneEmails = accountSettings.AllowZuneEmails ? 1 : 0,
allowPartnerEmails = accountSettings.AllowPartnerEmails ? 1 : 0
};
long num2 = *(long*)(cComPtrNtv_003CINewsletterSettings_003E.p);
NewsletterOptions newsletterOptions2 = newsletterOptions;
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, NewsletterOptions, int>)(*(ulong*)(*(long*)(*(ulong*)(cComPtrNtv_003CINewsletterSettings_003E.p)) + 24)))((nint)num2, newsletterOptions2);
@@ -78,8 +78,8 @@ namespace Microsoft.Zune.Service
return;
}
m_emailFormat = *(EmailFormat*)(&newsletterOptions);
bool flag = (m_allowZuneEmails = ((Unsafe.As<NewsletterOptions, int>(ref Unsafe.AddByteOffset(ref newsletterOptions, 4)) != 0) ? true : false));
bool flag2 = (m_allowPartnerEmails = ((Unsafe.As<NewsletterOptions, int>(ref Unsafe.AddByteOffset(ref newsletterOptions, 8)) != 0) ? true : false));
m_allowZuneEmails = newsletterOptions.allowZuneEmails != 0;
m_allowPartnerEmails = newsletterOptions.allowPartnerEmails != 0;
int num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, int>)(*(ulong*)(*(long*)pPrivacySettings + 32)))((nint)pPrivacySettings);
int num2 = 0;
if (0 >= num)
+4 -3
View File
@@ -1,9 +1,10 @@
using System.Runtime.CompilerServices;
using Microsoft.Zune.Service;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Size = 12)]
[NativeCppClass]
public struct NewsletterOptions
{
private int _003Calignment_0020member_003E;
public EmailFormat emailFormat;
public int allowZuneEmails = 0;
public int allowPartnerEmails = 0;
}