From c8a72799865b2246bb961ae4025944a3f961a16f Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Sun, 21 Nov 2021 05:40:15 -0600 Subject: [PATCH] Added static fields for some interface GUIDs --- ZuneDBApi/EBillingPaymentType.cs | 13 +++--- .../Zune/Configuration/TunerInfoHandler.cs | 14 +++---- .../Zune/Service/AccountManagement.cs | 2 +- .../Microsoft/Zune/Service/HttpWebRequest.cs | 2 +- ZuneDBApi/Microsoft/Zune/Service/Service.cs | 41 +++---------------- .../Microsoft/Zune/Service/WinLiveSignup.cs | 2 +- .../SubscriptionDataProviderItem.cs | 4 +- .../Zune/Subscription/SubscriptionManager.cs | 2 +- ZuneDBApi/Microsoft/Zune/User/UserManager.cs | 8 ++-- .../Microsoft/Zune/Util/FeatureEnablement.cs | 20 ++++----- .../Microsoft/Zune/Util/FeaturesChangedApi.cs | 2 +- .../Microsoft/Zune/Util/TaskbarPlayer.cs | 4 +- ZuneDBApi/Microsoft/Zune/Util/TelemetryAPI.cs | 18 ++++---- ZuneDBApi/MicrosoftZuneLibrary/ZuneLibrary.cs | 2 +- ZuneDBApi/Module.cs | 16 ++++++++ 15 files changed, 67 insertions(+), 83 deletions(-) diff --git a/ZuneDBApi/EBillingPaymentType.cs b/ZuneDBApi/EBillingPaymentType.cs index 9716849..230b7de 100644 --- a/ZuneDBApi/EBillingPaymentType.cs +++ b/ZuneDBApi/EBillingPaymentType.cs @@ -1,10 +1,9 @@ -using System.Runtime.CompilerServices; -using Microsoft.VisualC; - -[MiscellaneousBits(64)] -[DebugInfoInPDB] -[NativeCppClass] internal enum EBillingPaymentType { - + Unknown = -1, + None, + CreditCard, + DirectDebit, + Wholesale, + Token } diff --git a/ZuneDBApi/Microsoft/Zune/Configuration/TunerInfoHandler.cs b/ZuneDBApi/Microsoft/Zune/Configuration/TunerInfoHandler.cs index f00599c..58887e2 100644 --- a/ZuneDBApi/Microsoft/Zune/Configuration/TunerInfoHandler.cs +++ b/ZuneDBApi/Microsoft/Zune/Configuration/TunerInfoHandler.cs @@ -55,7 +55,7 @@ namespace Microsoft.Zune.Configuration //IL_0034: Expected I, but got I8 IService* ptr = null; int num = 0; - if (Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)) >= 0) + if (Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)) >= 0) { IService* intPtr = ptr; num = ((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)intPtr + 200)))((nint)intPtr); @@ -107,7 +107,7 @@ namespace Microsoft.Zune.Configuration //IL_0077: Expected I, but got I8 //IL_007b: Expected I, but got I8 IService* ptr = null; - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)); + int singleton = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)); RefreshCallback* ptr2 = (RefreshCallback*)Module.@new(24uL); RefreshCallback* ptr3; try @@ -150,7 +150,7 @@ namespace Microsoft.Zune.Configuration //IL_0090: Expected I, but got I8 //IL_0094: Expected I, but got I8 IService* ptr = null; - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)); + int singleton = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)); DeregisterCallback* ptr2 = (DeregisterCallback*)Module.@new(24uL); DeregisterCallback* ptr3; try @@ -166,9 +166,9 @@ namespace Microsoft.Zune.Configuration singleton = (((long)(nint)ptr3 == 0) ? (-2147024882) : singleton); if (singleton >= 0) { - fixed (char* info.m_tunerIdPtr = info.m_tunerId.ToCharArray()) + fixed (char* infoTunerIdPtr = info.m_tunerId.ToCharArray()) { - ushort* ptr4 = (ushort*)info.m_tunerIdPtr; + ushort* ptr4 = (ushort*)infoTunerIdPtr; try { long num = *(long*)ptr + 560; @@ -297,9 +297,9 @@ namespace Microsoft.Zune.Configuration } do { - fixed (char* list[num].m_tunerIdPtr = list[num].m_tunerId.ToCharArray()) + fixed (char* currentTunerIdPtr = list[num].m_tunerId.ToCharArray()) { - ushort* ptr = (ushort*)list[num].m_tunerIdPtr; + ushort* ptr = (ushort*)currentTunerIdPtr; try { if (2 == Module.CompareStringW(1033u, 1u, pwszTunerId, -1, ptr, -1)) diff --git a/ZuneDBApi/Microsoft/Zune/Service/AccountManagement.cs b/ZuneDBApi/Microsoft/Zune/Service/AccountManagement.cs index 584c49e..04a84ae 100644 --- a/ZuneDBApi/Microsoft/Zune/Service/AccountManagement.cs +++ b/ZuneDBApi/Microsoft/Zune/Service/AccountManagement.cs @@ -1579,7 +1579,7 @@ namespace Microsoft.Zune.Service *(long*)(&cComPtrNtv_003CIService_003E) = 0L; try { - num = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + num = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); CComPtrNtv_003CIUnknown_003E cComPtrNtv_003CIUnknown_003E; *(long*)(&cComPtrNtv_003CIUnknown_003E) = 0L; try diff --git a/ZuneDBApi/Microsoft/Zune/Service/HttpWebRequest.cs b/ZuneDBApi/Microsoft/Zune/Service/HttpWebRequest.cs index 5bcb3b6..170cf7e 100644 --- a/ZuneDBApi/Microsoft/Zune/Service/HttpWebRequest.cs +++ b/ZuneDBApi/Microsoft/Zune/Service/HttpWebRequest.cs @@ -527,7 +527,7 @@ namespace Microsoft.Zune.Service int num; try { - num = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + num = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); CComPtrNtv_003CIHttpWebRequest_003E cComPtrNtv_003CIHttpWebRequest_003E; *(long*)(&cComPtrNtv_003CIHttpWebRequest_003E) = 0L; try diff --git a/ZuneDBApi/Microsoft/Zune/Service/Service.cs b/ZuneDBApi/Microsoft/Zune/Service/Service.cs index 2b32bd9..9c8fd33 100644 --- a/ZuneDBApi/Microsoft/Zune/Service/Service.cs +++ b/ZuneDBApi/Microsoft/Zune/Service/Service.cs @@ -34,46 +34,16 @@ namespace Microsoft.Zune.Service //IL_0008: Expected I, but got I8 //IL_0011: Expected I, but got I8 IService* pService = null; - if (Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&pService)) >= 0) + if (Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&pService)) >= 0) { m_pService = pService; } } - private unsafe static int PaymentTypeToBillingPaymentType(PaymentType ePaymentType, EBillingPaymentType* pePaymentType) + private unsafe static int PaymentTypeToBillingPaymentType(PaymentType ePaymentType, ref EBillingPaymentType pePaymentType) { - if (pePaymentType == null) - { - Module._ZuneShipAssert(1001u, 501u); - return -2147467261; - } - int result = 0; - switch (ePaymentType) - { - default: - Module._ZuneShipAssert(1003u, 532u); - result = -2147024809; - break; - case PaymentType.Token: - *pePaymentType = (EBillingPaymentType)4; - break; - case PaymentType.Wholesale: - *pePaymentType = (EBillingPaymentType)3; - break; - case PaymentType.DirectDebit: - *pePaymentType = (EBillingPaymentType)2; - break; - case PaymentType.CreditCard: - *pePaymentType = (EBillingPaymentType)1; - break; - case PaymentType.None: - *pePaymentType = (EBillingPaymentType)0; - break; - case PaymentType.Unknown: - *pePaymentType = (EBillingPaymentType)(-1); - break; - } - return result; + pePaymentType = (EBillingPaymentType)(int)ePaymentType; + return 0; } private unsafe static int PaymentTypeToMediaPaymentType(PaymentType ePaymentType, EMediaPaymentType* pePaymentType) @@ -574,8 +544,7 @@ namespace Microsoft.Zune.Service IService* pService = m_pService; if (((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)num2))((nint)pService, ptr, &num) >= 0) { - bool flag = ((num != 0) ? true : false); - result = flag; + result = num != 0; } } catch diff --git a/ZuneDBApi/Microsoft/Zune/Service/WinLiveSignup.cs b/ZuneDBApi/Microsoft/Zune/Service/WinLiveSignup.cs index 8e1726e..de45905 100644 --- a/ZuneDBApi/Microsoft/Zune/Service/WinLiveSignup.cs +++ b/ZuneDBApi/Microsoft/Zune/Service/WinLiveSignup.cs @@ -308,7 +308,7 @@ namespace Microsoft.Zune.Service *(long*)(&cComPtrNtv_003CIService_003E) = 0L; try { - num = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + num = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); CComPtrNtv_003CIUnknown_003E cComPtrNtv_003CIUnknown_003E; *(long*)(&cComPtrNtv_003CIUnknown_003E) = 0L; try diff --git a/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionDataProviderItem.cs b/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionDataProviderItem.cs index 1956501..782dbc8 100644 --- a/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionDataProviderItem.cs +++ b/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionDataProviderItem.cs @@ -217,7 +217,7 @@ namespace Microsoft.Zune.Subscription int num = 1; int nSeriesId = -1; int nEpisodeId = -1; - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)); + int singleton = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)); if (singleton >= 0) { IService* intPtr = ptr; @@ -378,7 +378,7 @@ namespace Microsoft.Zune.Subscription } IService* ptr = null; int num = 1; - int num2 = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)); + int num2 = Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)); if (num2 >= 0) { IService* intPtr = ptr; diff --git a/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionManager.cs b/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionManager.cs index 3f25c52..ce00a3b 100644 --- a/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionManager.cs +++ b/ZuneDBApi/Microsoft/Zune/Subscription/SubscriptionManager.cs @@ -832,7 +832,7 @@ namespace Microsoft.Zune.Subscription //IL_003b: Expected I, but got I8 int result = 1; IService* ptr = null; - if (Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr)) >= 0) + if (Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr)) >= 0) { IService* intPtr = ptr; ((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)ptr + 384)))((nint)intPtr, null, &result); diff --git a/ZuneDBApi/Microsoft/Zune/User/UserManager.cs b/ZuneDBApi/Microsoft/Zune/User/UserManager.cs index 4cf7d63..77449f7 100644 --- a/ZuneDBApi/Microsoft/Zune/User/UserManager.cs +++ b/ZuneDBApi/Microsoft/Zune/User/UserManager.cs @@ -51,7 +51,7 @@ namespace Microsoft.Zune.User int num; try { - num = Module.GetSingleton((_GUID)Module._GUID_c9e0f18a_6c53_47d0_991e_dbd4fe395101, (void**)(&ptr)); + num = Module.GetSingleton(Module.GUID_IUserManager, (void**)(&ptr)); if (num >= 0) { IUserManager* intPtr = ptr; @@ -99,7 +99,7 @@ namespace Microsoft.Zune.User fixed (char* passportIdPtr = passportId.ToCharArray()) { ushort* ptr2 = (ushort*)passportIdPtr; - int num2 = Module.GetSingleton((_GUID)Module._GUID_c9e0f18a_6c53_47d0_991e_dbd4fe395101, (void**)(&ptr)); + int num2 = Module.GetSingleton(Module.GUID_IUserManager, (void**)(&ptr)); if (num2 >= 0) { long num3 = *(long*)ptr + 40; @@ -125,7 +125,7 @@ namespace Microsoft.Zune.User //IL_0022: Expected I, but got I8 //IL_0035: Expected I, but got I8 IUserManager* ptr = null; - int num = Module.GetSingleton((_GUID)Module._GUID_c9e0f18a_6c53_47d0_991e_dbd4fe395101, (void**)(&ptr)); + int num = Module.GetSingleton(Module.GUID_IUserManager, (void**)(&ptr)); if (num >= 0) { IUserManager* intPtr = ptr; @@ -145,7 +145,7 @@ namespace Microsoft.Zune.User //IL_0022: Expected I, but got I8 //IL_0035: Expected I, but got I8 IUserManager* ptr = null; - int num = Module.GetSingleton((_GUID)Module._GUID_c9e0f18a_6c53_47d0_991e_dbd4fe395101, (void**)(&ptr)); + int num = Module.GetSingleton(Module.GUID_IUserManager, (void**)(&ptr)); if (num >= 0) { IUserManager* intPtr = ptr; diff --git a/ZuneDBApi/Microsoft/Zune/Util/FeatureEnablement.cs b/ZuneDBApi/Microsoft/Zune/Util/FeatureEnablement.cs index 5321455..6324046 100644 --- a/ZuneDBApi/Microsoft/Zune/Util/FeatureEnablement.cs +++ b/ZuneDBApi/Microsoft/Zune/Util/FeatureEnablement.cs @@ -13,7 +13,7 @@ namespace Microsoft.Zune.Util //IL_0037: Expected I, but got I8 IFeatureEnablementManager* ptr = null; bool result = false; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; ((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (EFeatures)eFeature, &result); @@ -32,7 +32,7 @@ namespace Microsoft.Zune.Util //IL_0020: Expected I, but got I8 //IL_0033: Expected I, but got I8 IFeatureEnablementManager* ptr = null; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; ((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)ptr + 32)))((nint)intPtr, (EFeatures)eFeature); @@ -53,7 +53,7 @@ namespace Microsoft.Zune.Util IFeatureEnablementManager* ptr = null; string result = null; ushort* ptr2 = null; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; if (((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)ptr + 40)))((nint)intPtr, &ptr2) >= 0) @@ -78,7 +78,7 @@ namespace Microsoft.Zune.Util IFeatureEnablementManager* ptr = null; uint num = uint.MaxValue; uint num2 = uint.MaxValue; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; num = ((((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)ptr + 56)))((nint)intPtr, &num2) >= 0) ? num2 : num); @@ -98,7 +98,7 @@ namespace Microsoft.Zune.Util //IL_0033: Expected I, but got I8 IFeatureEnablementManager* ptr = null; int result = -1; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; result = (int)((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)intPtr + 64)))((nint)intPtr); @@ -119,7 +119,7 @@ namespace Microsoft.Zune.Util //IL_003d: Expected I, but got I8 IFeatureEnablementManager* ptr = null; bool result = false; - if (Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)) >= 0) + if (Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)) >= 0) { IFeatureEnablementManager* intPtr = ptr; bool flag = ((((delegate* unmanaged[Cdecl, Cdecl])(*(ulong*)(*(long*)intPtr + 72)))((nint)intPtr) != 0) ? true : false); @@ -147,7 +147,7 @@ namespace Microsoft.Zune.Util string result; try { - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + int singleton = Module.GetSingleton(Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); result = null; if (singleton >= 0) { @@ -212,7 +212,7 @@ namespace Microsoft.Zune.Util string result; try { - if (Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)) >= 0) + if (Module.GetSingleton(Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)) >= 0) { WBSTRString wBSTRString; Module.WBSTRString_002E_007Bctor_007D(&wBSTRString); @@ -290,7 +290,7 @@ namespace Microsoft.Zune.Util string result; try { - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + int singleton = Module.GetSingleton(Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); result = null; if (singleton >= 0) { @@ -355,7 +355,7 @@ namespace Microsoft.Zune.Util string result; try { - int singleton = Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&cComPtrNtv_003CIService_003E)); + int singleton = Module.GetSingleton(Module.GUID_IService, (void**)(&cComPtrNtv_003CIService_003E)); result = null; if (singleton >= 0) { diff --git a/ZuneDBApi/Microsoft/Zune/Util/FeaturesChangedApi.cs b/ZuneDBApi/Microsoft/Zune/Util/FeaturesChangedApi.cs index 8282c37..2128d5e 100644 --- a/ZuneDBApi/Microsoft/Zune/Util/FeaturesChangedApi.cs +++ b/ZuneDBApi/Microsoft/Zune/Util/FeaturesChangedApi.cs @@ -46,7 +46,7 @@ namespace Microsoft.Zune.Util m_featuresChangedHandler = (FeaturesChangedHandler)Delegate.Combine(m_featuresChangedHandler, value); bool featuresHaveChanged = false; IFeatureEnablementManager* ptr = null; - int singleton = Module.GetSingleton((_GUID)Module._GUID_9581b41a_b5cf_4ebf_9d1a_975477e081ca, (void**)(&ptr)); + int singleton = Module.GetSingleton(Module.GUID_IFeatureEnablementManager, (void**)(&ptr)); if (singleton >= 0) { IFeatureEnablementManager* intPtr = ptr; diff --git a/ZuneDBApi/Microsoft/Zune/Util/TaskbarPlayer.cs b/ZuneDBApi/Microsoft/Zune/Util/TaskbarPlayer.cs index 2ee4b85..96b2a43 100644 --- a/ZuneDBApi/Microsoft/Zune/Util/TaskbarPlayer.cs +++ b/ZuneDBApi/Microsoft/Zune/Util/TaskbarPlayer.cs @@ -118,7 +118,7 @@ namespace Microsoft.Zune.Util bool result = false; if (Unsafe.As(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) == 0) { - Module.CoCreateInstance((GUID*)Unsafe.AsPointer(ref Module.CLSID_TrayDeskBand), null, 4u, (_GUID*)Unsafe.AsPointer(ref Module.IID_ITrayDeskBand), (void**)Unsafe.AsPointer(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand)); + Module.CoCreateInstance(Module.CLSID_TrayDeskBand, null, 4u, Module.IID_ITrayDeskBand, (void**)Unsafe.AsPointer(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand)); } if (Unsafe.As(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) != 0L) { @@ -141,7 +141,7 @@ namespace Microsoft.Zune.Util //IL_009b: Expected I, but got I8 if (Unsafe.As(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) == 0) { - Module.CoCreateInstance((_GUID*)Unsafe.AsPointer(ref Module.CLSID_TrayDeskBand), null, 4u, (_GUID*)Unsafe.AsPointer(ref Module.IID_ITrayDeskBand), (void**)Unsafe.AsPointer(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand)); + Module.CoCreateInstance(Module.CLSID_TrayDeskBand, null, 4u, Module.IID_ITrayDeskBand, (void**)Unsafe.AsPointer(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand)); } if (Unsafe.As(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) != 0L) { diff --git a/ZuneDBApi/Microsoft/Zune/Util/TelemetryAPI.cs b/ZuneDBApi/Microsoft/Zune/Util/TelemetryAPI.cs index dadbf17..d1eae45 100644 --- a/ZuneDBApi/Microsoft/Zune/Util/TelemetryAPI.cs +++ b/ZuneDBApi/Microsoft/Zune/Util/TelemetryAPI.cs @@ -21,27 +21,27 @@ namespace Microsoft.Zune.Util foreach (DictionaryEntry item in dictionary) { int num2 = 0; - if (((DictionaryEntry)item).Key.GetType() == typeof(string)) + if (item.Key.GetType() == typeof(string)) { VARIANT tagVARIANT; IntPtr pDstNativeVariant = (IntPtr)(&tagVARIANT); - Marshal.GetNativeVariantForObject(((DictionaryEntry)item).Key, pDstNativeVariant); + Marshal.GetNativeVariantForObject(item.Key, pDstNativeVariant); VARIANT tagVARIANT2; - if (((DictionaryEntry)item).Value.GetType() == typeof(Guid)) + if (item.Value.GetType() == typeof(Guid)) { - string obj = ((DictionaryEntry)item).Value.ToString(); + string obj = item.Value.ToString(); IntPtr pDstNativeVariant2 = (IntPtr)(&tagVARIANT2); Marshal.GetNativeVariantForObject(obj, pDstNativeVariant2); } else { - if (((DictionaryEntry)item).Value.GetType() != typeof(string) && ((DictionaryEntry)item).Value.GetType() != typeof(int) && ((DictionaryEntry)item).Value.GetType() != typeof(long)) + if (item.Value.GetType() != typeof(string) && item.Value.GetType() != typeof(int) && item.Value.GetType() != typeof(long)) { num2 = -2147024809; continue; } IntPtr pDstNativeVariant3 = (IntPtr)(&tagVARIANT2); - Marshal.GetNativeVariantForObject(((DictionaryEntry)item).Value, pDstNativeVariant3); + Marshal.GetNativeVariantForObject(item.Value, pDstNativeVariant3); } Module.SafeArrayPutElement(ptr, &num, &tagVARIANT); Module.SafeArrayPutElement(ptr2, &num, &tagVARIANT2); @@ -56,7 +56,7 @@ namespace Microsoft.Zune.Util *(long*)(&cComPtrNtv_003CITelemetryManager_003E) = 0L; try { - if (Module.GetSingleton((_GUID)Module._GUID_ab28333b_a55c_4312_a7a3_2dd60d4a7154, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) + if (Module.GetSingleton(Module.GUID_ITelemetryManager, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) { long num3 = *(long*)(*(ulong*)(&cComPtrNtv_003CITelemetryManager_003E)) + 48; long num4 = *(long*)(&cComPtrNtv_003CITelemetryManager_003E); @@ -92,7 +92,7 @@ namespace Microsoft.Zune.Util *(long*)(&cComPtrNtv_003CITelemetryManager_003E) = 0L; try { - if (Module.GetSingleton((_GUID)Module._GUID_ab28333b_a55c_4312_a7a3_2dd60d4a7154, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) + if (Module.GetSingleton(Module.GUID_ITelemetryManager, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) { long num = *(long*)(*(ulong*)(&cComPtrNtv_003CITelemetryManager_003E)) + 64; long num2 = *(long*)(&cComPtrNtv_003CITelemetryManager_003E); @@ -120,7 +120,7 @@ namespace Microsoft.Zune.Util *(long*)(&cComPtrNtv_003CITelemetryManager_003E) = 0L; try { - if (Module.GetSingleton((_GUID)Module._GUID_ab28333b_a55c_4312_a7a3_2dd60d4a7154, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) + if (Module.GetSingleton(Module.GUID_ITelemetryManager, (void**)(&cComPtrNtv_003CITelemetryManager_003E)) >= 0) { long num = *(long*)(*(ulong*)(&cComPtrNtv_003CITelemetryManager_003E)) + 56; long num2 = *(long*)(&cComPtrNtv_003CITelemetryManager_003E); diff --git a/ZuneDBApi/MicrosoftZuneLibrary/ZuneLibrary.cs b/ZuneDBApi/MicrosoftZuneLibrary/ZuneLibrary.cs index 37c42b2..35557bf 100644 --- a/ZuneDBApi/MicrosoftZuneLibrary/ZuneLibrary.cs +++ b/ZuneDBApi/MicrosoftZuneLibrary/ZuneLibrary.cs @@ -1236,7 +1236,7 @@ namespace MicrosoftZuneLibrary } } IService* ptr3 = null; - if (Module.GetSingleton((_GUID)Module._GUID_bb2d1edd_1bd5_4be1_8d38_36d4f0849911, (void**)(&ptr3)) >= 0) + if (Module.GetSingleton((_GUID)Module.GUID_IService, (void**)(&ptr3)) >= 0) { IService* intPtr2 = ptr3; _GUID gUID; diff --git a/ZuneDBApi/Module.cs b/ZuneDBApi/Module.cs index 1d21f19..fd400df 100644 --- a/ZuneDBApi/Module.cs +++ b/ZuneDBApi/Module.cs @@ -10,9 +10,11 @@ global using static Vanara.PInvoke.AdvApi32; global using ZuneDBApi; global using GC = System.GC; global using HRESULT = ZuneUI.HRESULT; +global using _GUID = System.Guid; using System; using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; namespace ZuneDBApi { @@ -20,6 +22,16 @@ namespace ZuneDBApi { private static bool s_bIsLonghornOrBetter; private static bool s_bIsLonghornOrBetterInitialized; + internal static readonly string WINDOWCLASS_MsnMsgrUIManager = "MsnMsgrUIManager"; + internal static readonly _GUID GUID_IService = new("bb2d1edd-1bd5-4be1-8d38-36d4f0849911"); + internal static readonly _GUID GUID_IUserManager = new("c9e0f18a-6c53-47d0-991e-dbd4fe395101"); + internal static readonly _GUID GUID_IFeatureEnablementManager = new("9581b41a-b5cf-4ebf-9d1a-975477e081ca"); + internal static readonly _GUID GUID_ITelemetryManager = new("ab28333b-a55c-4312-a7a3-2dd60d4a7154"); + + internal static void _ZuneShipAssert(uint v1, uint v2) + { + System.Diagnostics.Debug.WriteLine($"ShipAssert: {v1:X2} {v2:X2}"); + } public static HANDLE ToHandle(void* h) => new(new IntPtr(h)); public static void* ToPointer(this HANDLE h) => h.DangerousGetHandle().ToPointer(); @@ -230,6 +242,10 @@ namespace ZuneDBApi return Gdi32.GetObject(new(new IntPtr(hgdiobj)), bufferSize, new IntPtr(lpvObject)); } + [DllImport("ZuneService", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] + [MethodImpl(MethodImplOptions.Unmanaged)] + public unsafe static extern int GetServiceEndPointUri(EServiceEndpointId endpointId, ushort** uri); + public static int GetVersionExW(ref OSVERSIONINFOEX lpVersionInformation) { return Kernel32.GetVersionEx(ref lpVersionInformation) ? 1 : 0;