Implemented Module.delete

This commit is contained in:
Yoshi Askharoun
2021-11-22 14:54:11 -06:00
parent 78d210fe5f
commit 82743a2d62
2 changed files with 15 additions and 3 deletions
@@ -324,15 +324,15 @@ namespace Microsoft.Zune.Playlist
num2 = Module.Microsoft_002EZune_002EPlaylist_002EPlaylistAsyncOperation_002EAsyncSavePlaylistAsStatic(ptr2, playlistId, m_pPlaylistManager, playlistAsyncOperationCompleted);
if (num2 >= 0)
{
goto IL_0066;
goto done;
}
}
if (ptr2 != null)
{
Module.Microsoft_002EZune_002EPlaylist_002EPlaylistAsyncOperation_002E__delDtor(ptr2, 1u);
}
goto IL_0066;
IL_0066:
goto done;
done:
return new HRESULT(num2);
}
+12
View File
@@ -61,6 +61,11 @@ namespace ZuneDBApi
public static HINSTANCE ToHInstance(void* h) => new(new IntPtr(h));
public static void* ToPointer(this HINSTANCE h) => h.DangerousGetHandle().ToPointer();
internal static void delete(void* ptr)
{
Marshal.FreeHGlobal((IntPtr)ptr);
}
public static T AddByteOffset<T>(ref T obj, int offset)
{
return Unsafe.AddByteOffset(ref obj, new IntPtr(offset));
@@ -268,6 +273,9 @@ namespace ZuneDBApi
[MethodImpl(MethodImplOptions.Unmanaged)]
public unsafe static extern int GetServiceEndPointUri(EServiceEndpointId endpointId, ushort** uri);
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig)]
public unsafe static extern int GetSingleton(_GUID guid, void** outReference);
public static int GetVersionExW(ref OSVERSIONINFOEX lpVersionInformation)
{
return Kernel32.GetVersionEx(ref lpVersionInformation) ? 1 : 0;
@@ -620,5 +628,9 @@ namespace ZuneDBApi
[DllImport(ZUNENATIVELIB_DLL, CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
[MethodImpl(MethodImplOptions.Unmanaged)]
public unsafe static extern int CreateEmptyPlaylist(IPlaylist** outPlaylist);
[DllImport(ZUNENATIVELIB_DLL, CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
[MethodImpl(MethodImplOptions.Unmanaged)]
public unsafe static extern int DoesFileExist(ushort* path, int* error);
}
}