fix: Fix TTS COM exception in IL2CPP

This commit is contained in:
2025-05-07 22:56:32 +08:00
parent 5daee1a01a
commit a3efe939e8
107 changed files with 3862 additions and 79 deletions

View File

@@ -0,0 +1,64 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace SpeechLib {
[ComImport]
[TypeLibType(4160)]
[Guid("CE17C09B-4EFA-44D5-A4C9-59D9585AB0CD")]
public interface ISpeechDataKey {
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
void SetBinaryValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName, [In][MarshalAs(UnmanagedType.Struct)] object Value);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(2)]
[return: MarshalAs(UnmanagedType.Struct)]
object GetBinaryValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(3)]
void SetStringValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName, [In][MarshalAs(UnmanagedType.BStr)] string Value);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(4)]
[return: MarshalAs(UnmanagedType.BStr)]
string GetStringValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(5)]
void SetLongValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName, [In] int Value);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(6)]
int GetLongValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(7)]
[return: MarshalAs(UnmanagedType.Interface)]
ISpeechDataKey OpenKey([In][MarshalAs(UnmanagedType.BStr)] string SubKeyName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(8)]
[return: MarshalAs(UnmanagedType.Interface)]
ISpeechDataKey CreateKey([In][MarshalAs(UnmanagedType.BStr)] string SubKeyName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(9)]
void DeleteKey([In][MarshalAs(UnmanagedType.BStr)] string SubKeyName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(10)]
void DeleteValue([In][MarshalAs(UnmanagedType.BStr)] string ValueName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(11)]
[return: MarshalAs(UnmanagedType.BStr)]
string EnumKeys([In] int Index);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(12)]
[return: MarshalAs(UnmanagedType.BStr)]
string EnumValues([In] int Index);
}
}