mirror of
https://github.com/ZuneDev/ZuneShell.dll.git
synced 2026-07-27 13:11:51 -07:00
Implemented most non-Zune functions in Module
This commit is contained in:
@@ -131,7 +131,7 @@ namespace Microsoft.Zune.Playlist
|
|||||||
long num = *(long*)m_pPlaylistManager + 24;
|
long num = *(long*)m_pPlaylistManager + 24;
|
||||||
IPlaylistManager* pPlaylistManager = m_pPlaylistManager;
|
IPlaylistManager* pPlaylistManager = m_pPlaylistManager;
|
||||||
int num2;
|
int num2;
|
||||||
hr = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, ushort*, _GUID*, int*, EPlaylistType, EPlaylistCreateConflictAction, int, tagVARIANT*, int>)(*(ulong*)num))((nint)pPlaylistManager, ptr2, ptr3, ptr, &num2, ePlaylistType, ePlaylistCreateConflictAction, flag6 ? 1 : 0, null);
|
hr = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, ushort*, _GUID*, int*, EPlaylistType, EPlaylistCreateConflictAction, int, VARIANT*, int>)(*(ulong*)num))((nint)pPlaylistManager, ptr2, ptr3, ptr, &num2, ePlaylistType, ePlaylistCreateConflictAction, flag6 ? 1 : 0, null);
|
||||||
playlistId = num2;
|
playlistId = num2;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Microsoft.Zune.Service
|
|||||||
//IL_0112: Expected I, but got I8
|
//IL_0112: Expected I, but got I8
|
||||||
//IL_0112: Expected I, but got I8
|
//IL_0112: Expected I, but got I8
|
||||||
//IL_0153: Expected I, but got I8
|
//IL_0153: Expected I, but got I8
|
||||||
int num = CreateComObject();
|
int hresult = CreateComObject();
|
||||||
CComPtrNtv_003CINewsletterSettings_003E cComPtrNtv_003CINewsletterSettings_003E;
|
CComPtrNtv_003CINewsletterSettings_003E cComPtrNtv_003CINewsletterSettings_003E;
|
||||||
Module.CComPtrNtv_003CINewsletterSettings_003E_002E_007Bctor_007D(&cComPtrNtv_003CINewsletterSettings_003E);
|
Module.CComPtrNtv_003CINewsletterSettings_003E_002E_007Bctor_007D(&cComPtrNtv_003CINewsletterSettings_003E);
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -47,47 +47,47 @@ namespace Microsoft.Zune.Service
|
|||||||
Module.CComPtrNtv_003CIPrivacySettings_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPrivacySettings_003E);
|
Module.CComPtrNtv_003CIPrivacySettings_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPrivacySettings_003E);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0 && accountSettings != null)
|
if (hresult >= 0 && accountSettings != null)
|
||||||
{
|
{
|
||||||
num = CreateAccountSettings(accountSettings, Module.CComPtrNtv_003CINewsletterSettings_003E_002E_0026(&cComPtrNtv_003CINewsletterSettings_003E), Module.CComPtrNtv_003CIPrivacySettings_003E_002E_0026(&cComPtrNtv_003CIPrivacySettings_003E));
|
hresult = CreateAccountSettings(accountSettings, Module.CComPtrNtv_003CINewsletterSettings_003E_002E_0026(&cComPtrNtv_003CINewsletterSettings_003E), Module.CComPtrNtv_003CIPrivacySettings_003E_002E_0026(&cComPtrNtv_003CIPrivacySettings_003E));
|
||||||
}
|
}
|
||||||
CComPtrNtv_003CIPassportIdentity_003E cComPtrNtv_003CIPassportIdentity_003E;
|
CComPtrNtv_003CIPassportIdentity_003E cComPtrNtv_003CIPassportIdentity_003E;
|
||||||
Module.CComPtrNtv_003CIPassportIdentity_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPassportIdentity_003E);
|
Module.CComPtrNtv_003CIPassportIdentity_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPassportIdentity_003E);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0 && passportIdentity != null)
|
if (hresult >= 0 && passportIdentity != null)
|
||||||
{
|
{
|
||||||
num = passportIdentity.GetComPointer((IPassportIdentity**)(&cComPtrNtv_003CIPassportIdentity_003E));
|
hresult = passportIdentity.GetComPointer((IPassportIdentity**)(&cComPtrNtv_003CIPassportIdentity_003E));
|
||||||
}
|
}
|
||||||
CComPtrNtv_003CIPassportIdentity_003E cComPtrNtv_003CIPassportIdentity_003E2;
|
CComPtrNtv_003CIPassportIdentity_003E cComPtrNtv_003CIPassportIdentity_003E2;
|
||||||
Module.CComPtrNtv_003CIPassportIdentity_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPassportIdentity_003E2);
|
Module.CComPtrNtv_003CIPassportIdentity_003E_002E_007Bctor_007D(&cComPtrNtv_003CIPassportIdentity_003E2);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0 && parentPassportIdentity != null)
|
if (hresult >= 0 && parentPassportIdentity != null)
|
||||||
{
|
{
|
||||||
num = parentPassportIdentity.GetComPointer((IPassportIdentity**)(&cComPtrNtv_003CIPassportIdentity_003E2));
|
hresult = parentPassportIdentity.GetComPointer((IPassportIdentity**)(&cComPtrNtv_003CIPassportIdentity_003E2));
|
||||||
}
|
}
|
||||||
CComPtrNtv_003CICreditCard_003E cComPtrNtv_003CICreditCard_003E;
|
CComPtrNtv_003CICreditCard_003E cComPtrNtv_003CICreditCard_003E;
|
||||||
*(long*)(&cComPtrNtv_003CICreditCard_003E) = 0L;
|
*(long*)(&cComPtrNtv_003CICreditCard_003E) = 0L;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0 && parentCreditCard != null)
|
if (hresult >= 0 && parentCreditCard != null)
|
||||||
{
|
{
|
||||||
num = CreateCreditCard(parentCreditCard, (ICreditCard**)(&cComPtrNtv_003CICreditCard_003E));
|
hresult = CreateCreditCard(parentCreditCard, (ICreditCard**)(&cComPtrNtv_003CICreditCard_003E));
|
||||||
}
|
}
|
||||||
CComPtrNtv_003CIAddress_003E cComPtrNtv_003CIAddress_003E;
|
CComPtrNtv_003CIAddress_003E cComPtrNtv_003CIAddress_003E;
|
||||||
*(long*)(&cComPtrNtv_003CIAddress_003E) = 0L;
|
*(long*)(&cComPtrNtv_003CIAddress_003E) = 0L;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0 && address != null)
|
if (hresult >= 0 && address != null)
|
||||||
{
|
{
|
||||||
num = CreateAddress(address, (IAddress**)(&cComPtrNtv_003CIAddress_003E));
|
hresult = CreateAddress(address, (IAddress**)(&cComPtrNtv_003CIAddress_003E));
|
||||||
}
|
}
|
||||||
CComPtrNtv_003CIServiceError_003E cComPtrNtv_003CIServiceError_003E;
|
CComPtrNtv_003CIServiceError_003E cComPtrNtv_003CIServiceError_003E;
|
||||||
*(long*)(&cComPtrNtv_003CIServiceError_003E) = 0L;
|
*(long*)(&cComPtrNtv_003CIServiceError_003E) = 0L;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (num >= 0)
|
if (hresult >= 0)
|
||||||
{
|
{
|
||||||
_SYSTEMTIME sYSTEMTIME = Module.DateTimeToSystemTime(birthday);
|
_SYSTEMTIME sYSTEMTIME = Module.DateTimeToSystemTime(birthday);
|
||||||
fixed (char* firstNamePtr = firstName.ToCharArray())
|
fixed (char* firstNamePtr = firstName.ToCharArray())
|
||||||
@@ -128,7 +128,7 @@ namespace Microsoft.Zune.Service
|
|||||||
long num6 = *(long*)(&cComPtrNtv_003CIPrivacySettings_003E);
|
long num6 = *(long*)(&cComPtrNtv_003CIPrivacySettings_003E);
|
||||||
long num7 = *(long*)(&cComPtrNtv_003CIPassportIdentity_003E2);
|
long num7 = *(long*)(&cComPtrNtv_003CIPassportIdentity_003E2);
|
||||||
long num8 = *(long*)(&cComPtrNtv_003CICreditCard_003E);
|
long num8 = *(long*)(&cComPtrNtv_003CICreditCard_003E);
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, IPassportIdentity*, ushort*, ushort*, _SYSTEMTIME*, ushort*, ushort*, ushort*, IAddress*, INewsletterSettings*, IPrivacySettings*, IPassportIdentity*, ICreditCard*, IServiceError**, int>)(*(ulong*)num2))((nint)p, (IPassportIdentity*)num3, (ushort*)(nint)val, (ushort*)(nint)val2, &sYSTEMTIME, (ushort*)(nint)val3, (ushort*)(nint)val4, (ushort*)(nint)val5, (IAddress*)num4, (INewsletterSettings*)num5, (IPrivacySettings*)num6, (IPassportIdentity*)num7, (ICreditCard*)num8, (IServiceError**)(&cComPtrNtv_003CIServiceError_003E));
|
hresult = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, IPassportIdentity*, ushort*, ushort*, _SYSTEMTIME*, ushort*, ushort*, ushort*, IAddress*, INewsletterSettings*, IPrivacySettings*, IPassportIdentity*, ICreditCard*, IServiceError**, int>)(*(ulong*)num2))((nint)p, (IPassportIdentity*)num3, (ushort*)(nint)val, (ushort*)(nint)val2, &sYSTEMTIME, (ushort*)(nint)val3, (ushort*)(nint)val4, (ushort*)(nint)val5, (IAddress*)num4, (INewsletterSettings*)num5, (IPrivacySettings*)num6, (IPassportIdentity*)num7, (ICreditCard*)num8, (IServiceError**)(&cComPtrNtv_003CIServiceError_003E));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -174,7 +174,7 @@ namespace Microsoft.Zune.Service
|
|||||||
{
|
{
|
||||||
serviceError = new ServiceError((IServiceError*)(*(ulong*)(&cComPtrNtv_003CIServiceError_003E)));
|
serviceError = new ServiceError((IServiceError*)(*(ulong*)(&cComPtrNtv_003CIServiceError_003E)));
|
||||||
}
|
}
|
||||||
result = new HRESULT(num);
|
result = new HRESULT(hresult);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -1657,7 +1657,7 @@ namespace Microsoft.Zune.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed override void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
|
|||||||
@@ -2,14 +2,15 @@ namespace Microsoft.Zune.Service
|
|||||||
{
|
{
|
||||||
public enum EContentType
|
public enum EContentType
|
||||||
{
|
{
|
||||||
Playlist = 8,
|
Unknown = -1,
|
||||||
App = 7,
|
|
||||||
PodcastSeries = 6,
|
|
||||||
PodcastEpisode = 5,
|
|
||||||
Video = 3,
|
|
||||||
MusicAlbum = 1,
|
|
||||||
MusicTrack = 0,
|
MusicTrack = 0,
|
||||||
|
MusicAlbum = 1,
|
||||||
|
|
||||||
|
Video = 3,
|
||||||
Artist = 4,
|
Artist = 4,
|
||||||
Unknown = -1
|
PodcastEpisode = 5,
|
||||||
|
PodcastSeries = 6,
|
||||||
|
App = 7,
|
||||||
|
Playlist = 8,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ namespace Microsoft.Zune.Service
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum EGetOffersFlags
|
public enum EGetOffersFlags
|
||||||
{
|
{
|
||||||
SeasonPurchase = 0x2,
|
None = 0,
|
||||||
None = 0x0,
|
SubscriptionFreeTracks = 1,
|
||||||
SubscriptionFreeTracks = 0x1
|
SeasonPurchase = 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ namespace Microsoft.Zune.Service
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum EPurchaseOffersFlags
|
public enum EPurchaseOffersFlags
|
||||||
{
|
{
|
||||||
PurchaseHD = 0x1,
|
|
||||||
PurchaseTrials = 0x8,
|
PurchaseTrials = 0x8,
|
||||||
StreamVideos = 0x4,
|
StreamVideos = 0x4,
|
||||||
RentVideos = 0x2,
|
RentVideos = 0x2,
|
||||||
|
PurchaseHD = 0x1,
|
||||||
None = 0x0
|
None = 0x0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,9 +188,9 @@ namespace Microsoft.Zune.Subscription
|
|||||||
//IL_0046: Expected I, but got I8
|
//IL_0046: Expected I, but got I8
|
||||||
if (m_nEpisodeId > 0 && propertyName == "DownloadErrorCode")
|
if (m_nEpisodeId > 0 && propertyName == "DownloadErrorCode")
|
||||||
{
|
{
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
*(short*)(&tagVARIANT) = 3;
|
*(short*)(&tagVARIANT) = 3;
|
||||||
Unsafe.As<tagVARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)) = (int)value;
|
Unsafe.As<VARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)) = (int)value;
|
||||||
DBPropertySubmitStruct dBPropertySubmitStruct;
|
DBPropertySubmitStruct dBPropertySubmitStruct;
|
||||||
*(int*)(&dBPropertySubmitStruct) = 144;
|
*(int*)(&dBPropertySubmitStruct) = 144;
|
||||||
Unsafe.As<DBPropertySubmitStruct, long>(ref Unsafe.AddByteOffset(ref dBPropertySubmitStruct, 8)) = (nint)(&tagVARIANT);
|
Unsafe.As<DBPropertySubmitStruct, long>(ref Unsafe.AddByteOffset(ref dBPropertySubmitStruct, 8)) = (nint)(&tagVARIANT);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Microsoft.Zune.Util
|
|||||||
__s_GUID gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d = Module._GUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d6;
|
__s_GUID gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d = Module._GUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d6;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d, (void**)(&ptr2));
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d, (void**)(&ptr2));
|
||||||
}
|
}
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
*(short*)(&tagVARIANT) = 0;
|
*(short*)(&tagVARIANT) = 0;
|
||||||
// IL initblk instruction
|
// IL initblk instruction
|
||||||
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
||||||
@@ -105,7 +105,7 @@ namespace Microsoft.Zune.Util
|
|||||||
{
|
{
|
||||||
long num2 = *(long*)ptr2 + 88;
|
long num2 = *(long*)ptr2 + 88;
|
||||||
IFolderProvider* intPtr2 = ptr2;
|
IFolderProvider* intPtr2 = ptr2;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, EMediaTypes, tagVARIANT*, int>)(*(ulong*)num2))((nint)intPtr2, ptr3, EMediaTypes.eMediaTypeImage, &tagVARIANT);
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, EMediaTypes, VARIANT*, int>)(*(ulong*)num2))((nint)intPtr2, ptr3, EMediaTypes.eMediaTypeImage, &tagVARIANT);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -116,7 +116,7 @@ namespace Microsoft.Zune.Util
|
|||||||
}
|
}
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
{
|
{
|
||||||
nFolderId = Unsafe.As<tagVARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
nFolderId = Unsafe.As<VARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,17 +162,17 @@ namespace Microsoft.Zune.Util
|
|||||||
__s_GUID gUID_16a9f8be_e76c_4391_ad74_8df74b7a3c = Module._GUID_16a9f8be_e76c_4391_ad74_8df74b7a3c21;
|
__s_GUID gUID_16a9f8be_e76c_4391_ad74_8df74b7a3c = Module._GUID_16a9f8be_e76c_4391_ad74_8df74b7a3c21;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_16a9f8be_e76c_4391_ad74_8df74b7a3c, (void**)(&ptr2));
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_16a9f8be_e76c_4391_ad74_8df74b7a3c, (void**)(&ptr2));
|
||||||
}
|
}
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
*(short*)(&tagVARIANT) = 0;
|
*(short*)(&tagVARIANT) = 0;
|
||||||
// IL initblk instruction
|
// IL initblk instruction
|
||||||
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
{
|
{
|
||||||
IFileProvider* intPtr2 = ptr2;
|
IFileProvider* intPtr2 = ptr2;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, int, EMediaTypes, tagVARIANT*, int>)(*(ulong*)(*(long*)ptr2 + 528)))((nint)intPtr2, nMediaId, EMediaTypes.eMediaTypeImage, &tagVARIANT);
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, int, EMediaTypes, VARIANT*, int>)(*(ulong*)(*(long*)ptr2 + 528)))((nint)intPtr2, nMediaId, EMediaTypes.eMediaTypeImage, &tagVARIANT);
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
{
|
{
|
||||||
nFolderId = Unsafe.As<tagVARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
nFolderId = Unsafe.As<VARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ namespace Microsoft.Zune.Util
|
|||||||
__s_GUID gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d = Module._GUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d6;
|
__s_GUID gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d = Module._GUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d6;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d, (void**)(&ptr2));
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, _GUID, void**, int>)(*(ulong*)(*(long*)ptr + 24)))((nint)intPtr, (_GUID)gUID_a2889317_d0c7_41d8_abc7_1eb4cb8d46d, (void**)(&ptr2));
|
||||||
}
|
}
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
*(short*)(&tagVARIANT) = 0;
|
*(short*)(&tagVARIANT) = 0;
|
||||||
// IL initblk instruction
|
// IL initblk instruction
|
||||||
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
Unsafe.InitBlockUnaligned(ref Unsafe.AddByteOffset(ref tagVARIANT, 2), 0, 22);
|
||||||
@@ -235,7 +235,7 @@ namespace Microsoft.Zune.Util
|
|||||||
{
|
{
|
||||||
long num2 = *(long*)ptr2 + 224;
|
long num2 = *(long*)ptr2 + 224;
|
||||||
IFolderProvider* intPtr2 = ptr2;
|
IFolderProvider* intPtr2 = ptr2;
|
||||||
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, int, tagVARIANT*, int>)(*(ulong*)num2))((nint)intPtr2, ptr3, nParentFolderId, &tagVARIANT);
|
num = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, ushort*, int, VARIANT*, int>)(*(ulong*)num2))((nint)intPtr2, ptr3, nParentFolderId, &tagVARIANT);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -246,7 +246,7 @@ namespace Microsoft.Zune.Util
|
|||||||
}
|
}
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
{
|
{
|
||||||
nCreatedFolderId = Unsafe.As<tagVARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
nCreatedFolderId = Unsafe.As<VARIANT, int>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace Microsoft.Zune.Util
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
if (Unsafe.As<CComPtrNtv_003CMicrosoft_003A_003AZune_003A_003AUtil_003A_003AITrayDeskBand_003E, long>(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) == 0)
|
if (Unsafe.As<CComPtrNtv_003CMicrosoft_003A_003AZune_003A_003AUtil_003A_003AITrayDeskBand_003E, long>(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((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));
|
||||||
}
|
}
|
||||||
if (Unsafe.As<CComPtrNtv_003CMicrosoft_003A_003AZune_003A_003AUtil_003A_003AITrayDeskBand_003E, long>(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) != 0L)
|
if (Unsafe.As<CComPtrNtv_003CMicrosoft_003A_003AZune_003A_003AUtil_003A_003AITrayDeskBand_003E, long>(ref Module.Microsoft_002EZune_002EUtil_002E_003FA0x0277dc26_002Es_spTrayDeskBand) != 0L)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ namespace Microsoft.Zune.Util
|
|||||||
int num2 = 0;
|
int num2 = 0;
|
||||||
if (((DictionaryEntry)item).Key.GetType() == typeof(string))
|
if (((DictionaryEntry)item).Key.GetType() == typeof(string))
|
||||||
{
|
{
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
IntPtr pDstNativeVariant = (IntPtr)(&tagVARIANT);
|
IntPtr pDstNativeVariant = (IntPtr)(&tagVARIANT);
|
||||||
Marshal.GetNativeVariantForObject(((DictionaryEntry)item).Key, pDstNativeVariant);
|
Marshal.GetNativeVariantForObject(((DictionaryEntry)item).Key, pDstNativeVariant);
|
||||||
tagVARIANT tagVARIANT2;
|
VARIANT tagVARIANT2;
|
||||||
if (((DictionaryEntry)item).Value.GetType() == typeof(Guid))
|
if (((DictionaryEntry)item).Value.GetType() == typeof(Guid))
|
||||||
{
|
{
|
||||||
string obj = ((DictionaryEntry)item).Value.ToString();
|
string obj = ((DictionaryEntry)item).Value.ToString();
|
||||||
|
|||||||
@@ -490,8 +490,8 @@ namespace MicrosoftZuneLibrary
|
|||||||
INSSProperties* ptr2 = null;
|
INSSProperties* ptr2 = null;
|
||||||
INSSProperty* ptr3 = null;
|
INSSProperty* ptr3 = null;
|
||||||
ushort* ptr4 = null;
|
ushort* ptr4 = null;
|
||||||
tagVARIANT tagVARIANT;
|
VARIANT tagVARIANT;
|
||||||
fixed (tagVARIANT* ptr5 = &Unsafe.AsRef<tagVARIANT>(&tagVARIANT))
|
fixed (VARIANT* ptr5 = &Unsafe.AsRef<VARIANT>(&tagVARIANT))
|
||||||
{
|
{
|
||||||
Module.VariantInit(ptr5);
|
Module.VariantInit(ptr5);
|
||||||
fixed (INSSDevice** ptr6 = &Unsafe.AsRef<INSSDevice*>(&ptr))
|
fixed (INSSDevice** ptr6 = &Unsafe.AsRef<INSSDevice*>(&ptr))
|
||||||
@@ -564,7 +564,7 @@ namespace MicrosoftZuneLibrary
|
|||||||
{
|
{
|
||||||
long num6 = *(long*)ptr3 + 64;
|
long num6 = *(long*)ptr3 + 64;
|
||||||
INSSProperty* intPtr4 = ptr3;
|
INSSProperty* intPtr4 = ptr3;
|
||||||
num2 = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, tagVARIANT*, int>)(*(ulong*)num6))((nint)intPtr4, ptr5);
|
num2 = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, VARIANT*, int>)(*(ulong*)num6))((nint)intPtr4, ptr5);
|
||||||
}
|
}
|
||||||
if (num2 >= 0)
|
if (num2 >= 0)
|
||||||
{
|
{
|
||||||
@@ -572,7 +572,7 @@ namespace MicrosoftZuneLibrary
|
|||||||
{
|
{
|
||||||
if (*(ushort*)(&tagVARIANT) == 8)
|
if (*(ushort*)(&tagVARIANT) == 8)
|
||||||
{
|
{
|
||||||
strName = new string((char*)Unsafe.As<tagVARIANT, ulong>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)));
|
strName = new string((char*)Unsafe.As<VARIANT, ulong>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)));
|
||||||
}
|
}
|
||||||
Module.VariantClear(ptr5);
|
Module.VariantClear(ptr5);
|
||||||
if (0L != (nint)ptr3)
|
if (0L != (nint)ptr3)
|
||||||
@@ -608,13 +608,13 @@ namespace MicrosoftZuneLibrary
|
|||||||
{
|
{
|
||||||
long num8 = *(long*)ptr3 + 64;
|
long num8 = *(long*)ptr3 + 64;
|
||||||
INSSProperty* intPtr7 = ptr3;
|
INSSProperty* intPtr7 = ptr3;
|
||||||
num2 = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, tagVARIANT*, int>)(*(ulong*)num8))((nint)intPtr7, ptr5);
|
num2 = ((delegate* unmanaged[Cdecl, Cdecl]<IntPtr, VARIANT*, int>)(*(ulong*)num8))((nint)intPtr7, ptr5);
|
||||||
}
|
}
|
||||||
if (num2 >= 0 && ptr3 != null)
|
if (num2 >= 0 && ptr3 != null)
|
||||||
{
|
{
|
||||||
if (*(ushort*)(&tagVARIANT) == 8)
|
if (*(ushort*)(&tagVARIANT) == 8)
|
||||||
{
|
{
|
||||||
strSerialNumber = new string((char*)Unsafe.As<tagVARIANT, ulong>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)));
|
strSerialNumber = new string((char*)Unsafe.As<VARIANT, ulong>(ref Unsafe.AddByteOffset(ref tagVARIANT, 8)));
|
||||||
}
|
}
|
||||||
Module.VariantClear(ptr5);
|
Module.VariantClear(ptr5);
|
||||||
if (0L != (nint)ptr3)
|
if (0L != (nint)ptr3)
|
||||||
|
|||||||
+71
-3
@@ -3,13 +3,16 @@ global using Vanara.PInvoke;
|
|||||||
global using static Vanara.PInvoke.User32;
|
global using static Vanara.PInvoke.User32;
|
||||||
global using static Vanara.PInvoke.Kernel32;
|
global using static Vanara.PInvoke.Kernel32;
|
||||||
global using static Vanara.PInvoke.Ole32;
|
global using static Vanara.PInvoke.Ole32;
|
||||||
|
global using static Vanara.PInvoke.OleAut32;
|
||||||
global using static Vanara.PInvoke.Gdi32;
|
global using static Vanara.PInvoke.Gdi32;
|
||||||
global using static Vanara.PInvoke.Shell32;
|
global using static Vanara.PInvoke.Shell32;
|
||||||
|
global using static Vanara.PInvoke.AdvApi32;
|
||||||
global using ZuneDBApi;
|
global using ZuneDBApi;
|
||||||
global using GC = System.GC;
|
global using GC = System.GC;
|
||||||
global using HRESULT = ZuneUI.HRESULT;
|
global using HRESULT = ZuneUI.HRESULT;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace ZuneDBApi
|
namespace ZuneDBApi
|
||||||
{
|
{
|
||||||
@@ -39,9 +42,9 @@ namespace ZuneDBApi
|
|||||||
return Kernel32.CloseHandle(new IntPtr(h)) ? 1 : 0;
|
return Kernel32.CloseHandle(new IntPtr(h)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int CoCreateInstance(Guid rclsid, IUnknown* pUnkOuter, uint dwClsContext, Guid riid, void** ppv)
|
public static int CoCreateInstance(Guid rclsid, object pUnkOuter, uint dwClsContext, Guid riid, out object ppv)
|
||||||
{
|
{
|
||||||
return Ole32.CoCreateInstance(rclsid, pUnkOuter, (CLSCTX)dwClsContext, riid, out ppv);
|
return Ole32.CoCreateInstance(rclsid, pUnkOuter, (CLSCTX)dwClsContext, riid, out ppv).Code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int CompareStringW(uint localeId, uint dwCmpFlags, ushort* lpString1, int cchCount1, ushort* lpString2, int cchCount2)
|
public static int CompareStringW(uint localeId, uint dwCmpFlags, ushort* lpString1, int cchCount1, ushort* lpString2, int cchCount2)
|
||||||
@@ -164,7 +167,8 @@ namespace ZuneDBApi
|
|||||||
|
|
||||||
public static uint FormatMessageW(uint dwFlags, void* lpSource, uint dwMessageId, uint dwLanguageId, ushort* lpBuffer, uint nSize, sbyte** Arguments)
|
public static uint FormatMessageW(uint dwFlags, void* lpSource, uint dwMessageId, uint dwLanguageId, ushort* lpBuffer, uint nSize, sbyte** Arguments)
|
||||||
{
|
{
|
||||||
return Kernel32.FormatMessage((FormatMessageFlags)dwFlags, ToHInstance(lpSource), dwMessageId, dwLanguageId, lpBuffer, nSize, new IntPtr(Arguments));
|
System.Text.StringBuilder builder = new(new string((char*)lpBuffer));
|
||||||
|
return (uint)Kernel32.FormatMessage((FormatMessageFlags)dwFlags, ToHInstance(lpSource), dwMessageId, dwLanguageId, builder, nSize, new IntPtr(Arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetClassInfoW(HINSTANCE* hInstance, ushort* lpClassName, ref WNDCLASS lpWndClass)
|
public static int GetClassInfoW(HINSTANCE* hInstance, ushort* lpClassName, ref WNDCLASS lpWndClass)
|
||||||
@@ -429,5 +433,69 @@ namespace ZuneDBApi
|
|||||||
{
|
{
|
||||||
return (ulong)User32.SetTimer(*hWnd, new((long)nIDEvent), uElapse, lpTimerFunc).ToInt64();
|
return (ulong)User32.SetTimer(*hWnd, new((long)nIDEvent), uElapse, lpTimerFunc).ToInt64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport("ZuneNativeLib")]
|
||||||
|
public unsafe static extern int SetUIThreadCBWorker(IUIThreadCallbackWorker* pUIThreadCallbackWorker);
|
||||||
|
|
||||||
|
[DllImport("ZuneNativeLib", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
|
||||||
|
public static extern void SQMAddNumbersToStream(string sqmDataId, uint countTotal, uint dw1);
|
||||||
|
|
||||||
|
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode)]
|
||||||
|
public static extern void SQMAddWrapper(string sqmDataId, int nData);
|
||||||
|
|
||||||
|
public static ushort* SysAllocString(ushort* psz)
|
||||||
|
{
|
||||||
|
return (ushort*)OleAut32.SysAllocString(new string((char*)psz)).DangerousGetHandle().ToPointer();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SysFreeString(ushort* psz)
|
||||||
|
{
|
||||||
|
OleAut32.SysFreeString(new IntPtr(psz));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint SysStringLen(ushort* psz)
|
||||||
|
{
|
||||||
|
return OleAut32.SysStringLen(new SafeBSTR(new(psz)));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal unsafe static DateTime SystemTimeToDateTime(SYSTEMTIME stValue)
|
||||||
|
{
|
||||||
|
FILETIME ftValue = default;
|
||||||
|
|
||||||
|
Module.SystemTimeToFileTime(&stValue, &ftValue);
|
||||||
|
return Module.FileTimeToDateTime(ftValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SystemTimeToFileTime(SYSTEMTIME* lpSystemTime, FILETIME* lpFileTime)
|
||||||
|
{
|
||||||
|
return Kernel32.SystemTimeToFileTime(in *lpSystemTime, out *lpFileTime) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint TraceEvent(ulong sessionHandle, PEVENT_TRACE_HEADER EventTrace)
|
||||||
|
{
|
||||||
|
return (uint)AdvApi32.TraceEvent(new TRACEHANDLE(sessionHandle), EventTrace).ToHRESULT().Code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint TraceMessage(ulong sessionHandle, uint MessageFlags, Guid MessageGuid, ushort MessageNumber, void* arglist)
|
||||||
|
{
|
||||||
|
return (uint)AdvApi32.TraceMessageVa(new TRACEHANDLE(sessionHandle), (TRACE_MESSAGE)MessageFlags, in MessageGuid, MessageNumber, new IntPtr(arglist)).ToHRESULT().Code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int VariantClear(VARIANT* pvarg)
|
||||||
|
{
|
||||||
|
return OleAut32.VariantClear(new IntPtr(pvarg)).Code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void VariantInit(VARIANT* pvarg)
|
||||||
|
{
|
||||||
|
OleAut32.VariantInit(ref *pvarg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint WaitForSingleObject(void* hHandle, uint dwMilliseconds)
|
||||||
|
{
|
||||||
|
return (uint)WaitForSingleObject(new IntPtr(hHandle), dwMilliseconds);
|
||||||
|
}
|
||||||
|
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
|
||||||
|
private static extern WAIT_STATUS WaitForSingleObject([In] IntPtr hHandle, uint dwMilliseconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,5 +19,6 @@
|
|||||||
<PackageReference Include="Vanara.PInvoke.Ole" Version="3.3.14" />
|
<PackageReference Include="Vanara.PInvoke.Ole" Version="3.3.14" />
|
||||||
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="3.3.14" />
|
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="3.3.14" />
|
||||||
<PackageReference Include="Vanara.PInvoke.Shell32" Version="3.3.14" />
|
<PackageReference Include="Vanara.PInvoke.Shell32" Version="3.3.14" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.Security" Version="3.3.14" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Microsoft.VisualC;
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 24)]
|
|
||||||
[DebugInfoInPDB]
|
|
||||||
[NativeCppClass]
|
|
||||||
[MiscellaneousBits(65)]
|
|
||||||
internal struct tagVARIANT
|
|
||||||
{
|
|
||||||
private long _003Calignment_0020member_003E;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user