From aa87fe557fa0578b4361bf0f23848d64d0c94a79 Mon Sep 17 00:00:00 2001 From: Rohan Singh Date: Thu, 20 Mar 2025 17:44:19 -0400 Subject: [PATCH] Get rid of ICustomMarshaler (strings to native, possible IL2CPP bug workaround) and remaining Encoding.UTF8 usages --- ...kingSocketsTest.TestConnectionInterface.cs | 4 +- ...tworkingSocketsTest.TestSocketInterface.cs | 4 +- Facepunch.Steamworks/Classes/SteamApi.cs | 5 +- Facepunch.Steamworks/Classes/SteamInternal.cs | 6 +- .../Generated/Interfaces/ISteamApps.cs | 55 +++-- .../Generated/Interfaces/ISteamClient.cs | 182 ++++++++------ .../Generated/Interfaces/ISteamController.cs | 21 +- .../Generated/Interfaces/ISteamFriends.cs | 78 +++--- .../Generated/Interfaces/ISteamGameSearch.cs | 29 ++- .../Generated/Interfaces/ISteamGameServer.cs | 85 ++++--- .../Interfaces/ISteamGameServerStats.cs | 56 +++-- .../Generated/Interfaces/ISteamHTMLSurface.cs | 55 +++-- .../Generated/Interfaces/ISteamHTTP.cs | 60 +++-- .../Generated/Interfaces/ISteamInput.cs | 28 ++- .../Generated/Interfaces/ISteamInventory.cs | 65 ++--- .../Generated/Interfaces/ISteamMatchmaking.cs | 69 +++--- .../ISteamMatchmakingPlayersResponse.cs | 7 +- .../ISteamMatchmakingRulesResponse.cs | 8 +- .../Generated/Interfaces/ISteamMusicRemote.cs | 35 +-- .../Interfaces/ISteamNetworkingSockets.cs | 26 +- .../Interfaces/ISteamNetworkingUtils.cs | 53 ++-- .../Generated/Interfaces/ISteamParties.cs | 20 +- .../Interfaces/ISteamRemoteStorage.cs | 105 ++++---- .../Generated/Interfaces/ISteamScreenshots.cs | 23 +- .../Generated/Interfaces/ISteamTimeline.cs | 81 ++++--- .../Generated/Interfaces/ISteamUGC.cs | 228 ++++++++++-------- .../Generated/Interfaces/ISteamUser.cs | 27 ++- .../Generated/Interfaces/ISteamUserStats.cs | 188 ++++++++------- .../Generated/Interfaces/ISteamUtils.cs | 32 +-- .../Generated/Interfaces/ISteamVideo.cs | 6 +- .../Generated/SteamCallbacks.cs | 52 ++-- .../Generated/SteamStructFunctions.cs | 12 +- .../Generated/SteamStructs.cs | 24 +- Facepunch.Steamworks/Networking/Connection.cs | 2 +- .../Networking/ConnectionManager.cs | 4 +- Facepunch.Steamworks/SteamNetworkingUtils.cs | 4 +- Facepunch.Steamworks/Structs/Lobby.cs | 2 +- Facepunch.Steamworks/Utility/Helpers.cs | 2 +- Facepunch.Steamworks/Utility/Utf8String.cs | 53 ++-- Facepunch.Steamworks/Utility/Utility.cs | 4 +- Generator/CodeWriter/Interface.cs | 10 +- Generator/CodeWriter/Struct.cs | 2 +- Generator/Generator.csproj | 2 +- Generator/Types/ConstCharType.cs | 7 +- Generator/Types/FetchStringType.cs | 2 +- 45 files changed, 1035 insertions(+), 788 deletions(-) diff --git a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs index 03661cd..888ee64 100644 --- a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs +++ b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs @@ -84,7 +84,7 @@ namespace Steamworks public override unsafe void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel ) { // We're only sending strings, so it's fine to read this like this - var str = UTF8Encoding.UTF8.GetString( (byte*) data, size ); + var str = Utility.Utf8NoBom.GetString( (byte*) data, size ); Console.WriteLine( $"[Connection][{messageNum}][{recvTime}][{channel}] \"{str}\"" ); @@ -127,4 +127,4 @@ namespace Steamworks } } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs index ed5b9bd..b3aafaf 100644 --- a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs +++ b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs @@ -115,7 +115,7 @@ namespace Steamworks public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel ) { // We're only sending strings, so it's fine to read this like this - var str = UTF8Encoding.UTF8.GetString( (byte*)data, size ); + var str = Utility.Utf8NoBom.GetString( (byte*)data, size ); Console.WriteLine( $"[SOCKET][{connection}[{identity}][{messageNum}][{recvTime}][{channel}] \"{str}\"" ); @@ -134,4 +134,4 @@ namespace Steamworks } } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks/Classes/SteamApi.cs b/Facepunch.Steamworks/Classes/SteamApi.cs index 051d4ae..14ec7f9 100644 --- a/Facepunch.Steamworks/Classes/SteamApi.cs +++ b/Facepunch.Steamworks/Classes/SteamApi.cs @@ -12,7 +12,7 @@ namespace Steamworks internal static class Native { [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_SteamAPI_Init", CallingConvention = CallingConvention.Cdecl )] - public static extern SteamAPIInitResult SteamInternal_SteamAPI_Init( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszInternalCheckInterfaceVersions, IntPtr pOutErrMsg ); + public static extern SteamAPIInitResult SteamInternal_SteamAPI_Init( IntPtr pszInternalCheckInterfaceVersions, IntPtr pOutErrMsg ); [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_Shutdown", CallingConvention = CallingConvention.Cdecl )] public static extern void SteamAPI_Shutdown(); @@ -28,8 +28,9 @@ namespace Steamworks static internal SteamAPIInitResult Init( string pszInternalCheckInterfaceVersions, out string pOutErrMsg ) { + using var interfaceVersionsStr = new Utf8StringToNative( pszInternalCheckInterfaceVersions ); using var buffer = Helpers.Memory.Take(); - var result = Native.SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, buffer.Ptr ); + var result = Native.SteamInternal_SteamAPI_Init( interfaceVersionsStr.Pointer, buffer.Ptr ); pOutErrMsg = Helpers.MemoryToString( buffer.Ptr ); return result; } diff --git a/Facepunch.Steamworks/Classes/SteamInternal.cs b/Facepunch.Steamworks/Classes/SteamInternal.cs index dfccdd0..0f76c88 100644 --- a/Facepunch.Steamworks/Classes/SteamInternal.cs +++ b/Facepunch.Steamworks/Classes/SteamInternal.cs @@ -12,13 +12,15 @@ namespace Steamworks internal static class Native { [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_GameServer_Init_V2", CallingConvention = CallingConvention.Cdecl )] - public static extern SteamAPIInitResult SteamInternal_GameServer_Init_V2( uint unIP, ushort usGamePort, ushort usQueryPort, int eServerMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszInternalCheckInterfaceVersions, IntPtr pOutErrMsg ); + public static extern SteamAPIInitResult SteamInternal_GameServer_Init_V2( uint unIP, ushort usGamePort, ushort usQueryPort, int eServerMode, IntPtr pchVersionString, IntPtr pszInternalCheckInterfaceVersions, IntPtr pOutErrMsg ); } static internal SteamAPIInitResult GameServer_Init( uint unIP, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString, string pszInternalCheckInterfaceVersions, out string pOutErrMsg ) { + using var versionStr = new Utf8StringToNative( pchVersionString ); + using var interfaceVersionsStr = new Utf8StringToNative( pszInternalCheckInterfaceVersions ); using var buffer = Helpers.Memory.Take(); - var result = Native.SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, buffer.Ptr ); + var result = Native.SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, versionStr.Pointer, interfaceVersionsStr.Pointer, buffer.Ptr ); pOutErrMsg = Helpers.MemoryToString( buffer.Ptr ); return result; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index 8ce6bea..5896734 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -157,9 +157,9 @@ namespace Steamworks #endregion internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, out string pchName ) { - using var mempchName = Helpers.TakeMemory(); - var returnValue = _BGetDLCDataByIndex( Self, iDLC, ref pAppID, ref pbAvailable, mempchName, (1024 * 32) ); - pchName = Helpers.MemoryToString( mempchName ); + using var mem__pchName = Helpers.TakeMemory(); + var returnValue = _BGetDLCDataByIndex( Self, iDLC, ref pAppID, ref pbAvailable, mem__pchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mem__pchName ); return returnValue; } @@ -201,9 +201,9 @@ namespace Steamworks #endregion internal bool GetCurrentBetaName( out string pchName ) { - using var mempchName = Helpers.TakeMemory(); - var returnValue = _GetCurrentBetaName( Self, mempchName, (1024 * 32) ); - pchName = Helpers.MemoryToString( mempchName ); + using var mem__pchName = Helpers.TakeMemory(); + var returnValue = _GetCurrentBetaName( Self, mem__pchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mem__pchName ); return returnValue; } @@ -237,9 +237,9 @@ namespace Steamworks #endregion internal uint GetAppInstallDir( AppId appID, out string pchFolder ) { - using var mempchFolder = Helpers.TakeMemory(); - var returnValue = _GetAppInstallDir( Self, appID, mempchFolder, (1024 * 32) ); - pchFolder = Helpers.MemoryToString( mempchFolder ); + using var mem__pchFolder = Helpers.TakeMemory(); + var returnValue = _GetAppInstallDir( Self, appID, mem__pchFolder, (1024 * 32) ); + pchFolder = Helpers.MemoryToString( mem__pchFolder ); return returnValue; } @@ -268,12 +268,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetLaunchQueryParam", CallingConvention = Platform.CC)] - private static extern Utf8StringPointer _GetLaunchQueryParam( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern Utf8StringPointer _GetLaunchQueryParam( IntPtr self, IntPtr pchKey ); #endregion - internal string GetLaunchQueryParam( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal string GetLaunchQueryParam( string pchKey ) { - var returnValue = _GetLaunchQueryParam( Self, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _GetLaunchQueryParam( Self, str__pchKey.Pointer ); return returnValue; } @@ -312,12 +313,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetFileDetails", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); + private static extern SteamAPICall_t _GetFileDetails( IntPtr self, IntPtr pszFileName ); #endregion - internal CallResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) + internal CallResult GetFileDetails( string pszFileName ) { - var returnValue = _GetFileDetails( Self, pszFileName ); + using var str__pszFileName = new Utf8StringToNative( pszFileName ); + var returnValue = _GetFileDetails( Self, str__pszFileName.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -328,9 +330,9 @@ namespace Steamworks #endregion internal int GetLaunchCommandLine( out string pszCommandLine ) { - using var mempszCommandLine = Helpers.TakeMemory(); - var returnValue = _GetLaunchCommandLine( Self, mempszCommandLine, (1024 * 32) ); - pszCommandLine = Helpers.MemoryToString( mempszCommandLine ); + using var mem__pszCommandLine = Helpers.TakeMemory(); + var returnValue = _GetLaunchCommandLine( Self, mem__pszCommandLine, (1024 * 32) ); + pszCommandLine = Helpers.MemoryToString( mem__pszCommandLine ); return returnValue; } @@ -389,23 +391,24 @@ namespace Steamworks #endregion internal bool GetBetaInfo( int iBetaIndex, ref uint punFlags, ref uint punBuildID, out string pchBetaName, out string pchDescription ) { - using var mempchBetaName = Helpers.TakeMemory(); - using var mempchDescription = Helpers.TakeMemory(); - var returnValue = _GetBetaInfo( Self, iBetaIndex, ref punFlags, ref punBuildID, mempchBetaName, (1024 * 32), mempchDescription, (1024 * 32) ); - pchBetaName = Helpers.MemoryToString( mempchBetaName ); - pchDescription = Helpers.MemoryToString( mempchDescription ); + using var mem__pchBetaName = Helpers.TakeMemory(); + using var mem__pchDescription = Helpers.TakeMemory(); + var returnValue = _GetBetaInfo( Self, iBetaIndex, ref punFlags, ref punBuildID, mem__pchBetaName, (1024 * 32), mem__pchDescription, (1024 * 32) ); + pchBetaName = Helpers.MemoryToString( mem__pchBetaName ); + pchDescription = Helpers.MemoryToString( mem__pchDescription ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_SetActiveBeta", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetActiveBeta( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchBetaName ); + private static extern bool _SetActiveBeta( IntPtr self, IntPtr pchBetaName ); #endregion - internal bool SetActiveBeta( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchBetaName ) + internal bool SetActiveBeta( string pchBetaName ) { - var returnValue = _SetActiveBeta( Self, pchBetaName ); + using var str__pchBetaName = new Utf8StringToNative( pchBetaName ); + var returnValue = _SetActiveBeta( Self, str__pchBetaName.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs index 2cafdf2..ff610e1 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs @@ -71,23 +71,25 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUser", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamUser( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamUser( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamUser( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamUser( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServer", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamGameServer( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamGameServer( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamGameServer( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamGameServer( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } @@ -103,133 +105,145 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamFriends", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamFriends( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamFriends( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamFriends( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamFriends( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUtils", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamUtils( IntPtr self, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamUtils( IntPtr self, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamUtils( HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamUtils( HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamUtils( Self, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamUtils( Self, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmaking", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamMatchmaking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamMatchmaking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamMatchmaking( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamMatchmaking( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmakingServers", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamMatchmakingServers( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamMatchmakingServers( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamMatchmakingServers( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamMatchmakingServers( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGenericInterface", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamGenericInterface( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamGenericInterface( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamGenericInterface( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamGenericInterface( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUserStats", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamUserStats( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamUserStats( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamUserStats( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamUserStats( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServerStats", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamGameServerStats( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamGameServerStats( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamGameServerStats( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamGameServerStats( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamApps", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamApps( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamApps( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamApps( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamApps( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamNetworking", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamNetworking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamNetworking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamNetworking( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamNetworking( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemoteStorage", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamRemoteStorage( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamRemoteStorage( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamRemoteStorage( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamRemoteStorage( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamScreenshots( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamScreenshots( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamScreenshots( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamScreenshots( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameSearch", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamGameSearch( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamGameSearch( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamGameSearch( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamGameSearch( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } @@ -268,133 +282,145 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTTP", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamHTTP( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamHTTP( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamHTTP( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamHTTP( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamController", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamController( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamController( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamController( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamController( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUGC", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamUGC( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamUGC( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamUGC( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamUGC( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusic", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamMusic( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamMusic( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamMusic( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamMusic( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusicRemote", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamMusicRemote( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamMusicRemote( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamMusicRemote( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamMusicRemote( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamMusicRemote( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamMusicRemote( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTMLSurface", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamHTMLSurface( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamHTMLSurface( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamHTMLSurface( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamHTMLSurface( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamHTMLSurface( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamHTMLSurface( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamInventory", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamInventory( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamInventory( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamInventory( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamInventory( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamVideo", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamVideo( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamVideo( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamVideo( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamVideo( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamParentalSettings", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamParentalSettings( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamParentalSettings( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamParentalSettings( Self, hSteamuser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamParentalSettings( Self, hSteamuser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamInput", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamInput( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamInput( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamInput( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamInput( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamParties", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamParties( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamParties( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamParties( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamParties( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemotePlay", CallingConvention = Platform.CC)] - private static extern IntPtr _GetISteamRemotePlay( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + private static extern IntPtr _GetISteamRemotePlay( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, IntPtr pchVersion ); #endregion - internal IntPtr GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + internal IntPtr GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion ) { - var returnValue = _GetISteamRemotePlay( Self, hSteamUser, hSteamPipe, pchVersion ); + using var str__pchVersion = new Utf8StringToNative( pchVersion ); + var returnValue = _GetISteamRemotePlay( Self, hSteamUser, hSteamPipe, str__pchVersion.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs index 98f8720..95b1f59 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs @@ -68,12 +68,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle", CallingConvention = Platform.CC)] - private static extern ControllerActionSetHandle_t _GetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); + private static extern ControllerActionSetHandle_t _GetActionSetHandle( IntPtr self, IntPtr pszActionSetName ); #endregion - internal ControllerActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) + internal ControllerActionSetHandle_t GetActionSetHandle( string pszActionSetName ) { - var returnValue = _GetActionSetHandle( Self, pszActionSetName ); + using var str__pszActionSetName = new Utf8StringToNative( pszActionSetName ); + var returnValue = _GetActionSetHandle( Self, str__pszActionSetName.Pointer ); return returnValue; } @@ -141,12 +142,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle", CallingConvention = Platform.CC)] - private static extern ControllerDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private static extern ControllerDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, IntPtr pszActionName ); #endregion - internal ControllerDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + internal ControllerDigitalActionHandle_t GetDigitalActionHandle( string pszActionName ) { - var returnValue = _GetDigitalActionHandle( Self, pszActionName ); + using var str__pszActionName = new Utf8StringToNative( pszActionName ); + var returnValue = _GetDigitalActionHandle( Self, str__pszActionName.Pointer ); return returnValue; } @@ -174,12 +176,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle", CallingConvention = Platform.CC)] - private static extern ControllerAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private static extern ControllerAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, IntPtr pszActionName ); #endregion - internal ControllerAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + internal ControllerAnalogActionHandle_t GetAnalogActionHandle( string pszActionName ) { - var returnValue = _GetAnalogActionHandle( Self, pszActionName ); + using var str__pszActionName = new Utf8StringToNative( pszActionName ); + var returnValue = _GetAnalogActionHandle( Self, str__pszActionName.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index bb0da49..b4be58e 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -34,12 +34,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); + private static extern SteamAPICall_t _SetPersonaName( IntPtr self, IntPtr pchPersonaName ); #endregion - internal CallResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) + internal CallResult SetPersonaName( string pchPersonaName ) { - var returnValue = _SetPersonaName( Self, pchPersonaName ); + using var str__pchPersonaName = new Utf8StringToNative( pchPersonaName ); + var returnValue = _SetPersonaName( Self, str__pchPersonaName.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -333,32 +334,35 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlay", CallingConvention = Platform.CC)] - private static extern void _ActivateGameOverlay( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ); + private static extern void _ActivateGameOverlay( IntPtr self, IntPtr pchDialog ); #endregion - internal void ActivateGameOverlay( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ) + internal void ActivateGameOverlay( string pchDialog ) { - _ActivateGameOverlay( Self, pchDialog ); + using var str__pchDialog = new Utf8StringToNative( pchDialog ); + _ActivateGameOverlay( Self, str__pchDialog.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser", CallingConvention = Platform.CC)] - private static extern void _ActivateGameOverlayToUser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ); + private static extern void _ActivateGameOverlayToUser( IntPtr self, IntPtr pchDialog, SteamId steamID ); #endregion - internal void ActivateGameOverlayToUser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ) + internal void ActivateGameOverlayToUser( string pchDialog, SteamId steamID ) { - _ActivateGameOverlayToUser( Self, pchDialog, steamID ); + using var str__pchDialog = new Utf8StringToNative( pchDialog ); + _ActivateGameOverlayToUser( Self, str__pchDialog.Pointer, steamID ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage", CallingConvention = Platform.CC)] - private static extern void _ActivateGameOverlayToWebPage( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ); + private static extern void _ActivateGameOverlayToWebPage( IntPtr self, IntPtr pchURL, ActivateGameOverlayToWebPageMode eMode ); #endregion - internal void ActivateGameOverlayToWebPage( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ) + internal void ActivateGameOverlayToWebPage( string pchURL, ActivateGameOverlayToWebPageMode eMode ) { - _ActivateGameOverlayToWebPage( Self, pchURL, eMode ); + using var str__pchURL = new Utf8StringToNative( pchURL ); + _ActivateGameOverlayToWebPage( Self, str__pchURL.Pointer, eMode ); } #region FunctionMeta @@ -494,12 +498,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetRichPresence", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetRichPresence( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern bool _SetRichPresence( IntPtr self, IntPtr pchKey, IntPtr pchValue ); #endregion - internal bool SetRichPresence( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal bool SetRichPresence( string pchKey, string pchValue ) { - var returnValue = _SetRichPresence( Self, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + var returnValue = _SetRichPresence( Self, str__pchKey.Pointer, str__pchValue.Pointer ); return returnValue; } @@ -515,12 +521,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresence", CallingConvention = Platform.CC)] - private static extern Utf8StringPointer _GetFriendRichPresence( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern Utf8StringPointer _GetFriendRichPresence( IntPtr self, SteamId steamIDFriend, IntPtr pchKey ); #endregion - internal string GetFriendRichPresence( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal string GetFriendRichPresence( SteamId steamIDFriend, string pchKey ) { - var returnValue = _GetFriendRichPresence( Self, steamIDFriend, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _GetFriendRichPresence( Self, steamIDFriend, str__pchKey.Pointer ); return returnValue; } @@ -559,12 +566,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_InviteUserToGame", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _InviteUserToGame( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); + private static extern bool _InviteUserToGame( IntPtr self, SteamId steamIDFriend, IntPtr pchConnectString ); #endregion - internal bool InviteUserToGame( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ) + internal bool InviteUserToGame( SteamId steamIDFriend, string pchConnectString ) { - var returnValue = _InviteUserToGame( Self, steamIDFriend, pchConnectString ); + using var str__pchConnectString = new Utf8StringToNative( pchConnectString ); + var returnValue = _InviteUserToGame( Self, steamIDFriend, str__pchConnectString.Pointer ); return returnValue; } @@ -660,12 +668,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SendClanChatMessage", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SendClanChatMessage( IntPtr self, SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); + private static extern bool _SendClanChatMessage( IntPtr self, SteamId steamIDClanChat, IntPtr pchText ); #endregion - internal bool SendClanChatMessage( SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) + internal bool SendClanChatMessage( SteamId steamIDClanChat, string pchText ) { - var returnValue = _SendClanChatMessage( Self, steamIDClanChat, pchText ); + using var str__pchText = new Utf8StringToNative( pchText ); + var returnValue = _SendClanChatMessage( Self, steamIDClanChat, str__pchText.Pointer ); return returnValue; } @@ -743,12 +752,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ReplyToFriendMessage", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _ReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ); + private static extern bool _ReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, IntPtr pchMsgToSend ); #endregion - internal bool ReplyToFriendMessage( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ) + internal bool ReplyToFriendMessage( SteamId steamIDFriend, string pchMsgToSend ) { - var returnValue = _ReplyToFriendMessage( Self, steamIDFriend, pchMsgToSend ); + using var str__pchMsgToSend = new Utf8StringToNative( pchMsgToSend ); + var returnValue = _ReplyToFriendMessage( Self, steamIDFriend, str__pchMsgToSend.Pointer ); return returnValue; } @@ -844,23 +854,25 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RegisterProtocolInOverlayBrowser", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _RegisterProtocolInOverlayBrowser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchProtocol ); + private static extern bool _RegisterProtocolInOverlayBrowser( IntPtr self, IntPtr pchProtocol ); #endregion - internal bool RegisterProtocolInOverlayBrowser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchProtocol ) + internal bool RegisterProtocolInOverlayBrowser( string pchProtocol ) { - var returnValue = _RegisterProtocolInOverlayBrowser( Self, pchProtocol ); + using var str__pchProtocol = new Utf8StringToNative( pchProtocol ); + var returnValue = _RegisterProtocolInOverlayBrowser( Self, str__pchProtocol.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectString", CallingConvention = Platform.CC)] - private static extern void _ActivateGameOverlayInviteDialogConnectString( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); + private static extern void _ActivateGameOverlayInviteDialogConnectString( IntPtr self, IntPtr pchConnectString ); #endregion - internal void ActivateGameOverlayInviteDialogConnectString( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ) + internal void ActivateGameOverlayInviteDialogConnectString( string pchConnectString ) { - _ActivateGameOverlayInviteDialogConnectString( Self, pchConnectString ); + using var str__pchConnectString = new Utf8StringToNative( pchConnectString ); + _ActivateGameOverlayInviteDialogConnectString( Self, str__pchConnectString.Pointer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs index cb5b83f..23566ee 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs @@ -23,12 +23,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams", CallingConvention = Platform.CC)] - private static extern GameSearchErrorCode_t _AddGameSearchParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind ); + private static extern GameSearchErrorCode_t _AddGameSearchParams( IntPtr self, IntPtr pchKeyToFind, IntPtr pchValuesToFind ); #endregion - internal GameSearchErrorCode_t AddGameSearchParams( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind ) + internal GameSearchErrorCode_t AddGameSearchParams( string pchKeyToFind, string pchValuesToFind ) { - var returnValue = _AddGameSearchParams( Self, pchKeyToFind, pchValuesToFind ); + using var str__pchKeyToFind = new Utf8StringToNative( pchKeyToFind ); + using var str__pchValuesToFind = new Utf8StringToNative( pchValuesToFind ); + var returnValue = _AddGameSearchParams( Self, str__pchKeyToFind.Pointer, str__pchValuesToFind.Pointer ); return returnValue; } @@ -83,9 +85,9 @@ namespace Steamworks #endregion internal GameSearchErrorCode_t RetrieveConnectionDetails( SteamId steamIDHost, out string pchConnectionDetails ) { - using var mempchConnectionDetails = Helpers.TakeMemory(); - var returnValue = _RetrieveConnectionDetails( Self, steamIDHost, mempchConnectionDetails, (1024 * 32) ); - pchConnectionDetails = Helpers.MemoryToString( mempchConnectionDetails ); + using var mem__pchConnectionDetails = Helpers.TakeMemory(); + var returnValue = _RetrieveConnectionDetails( Self, steamIDHost, mem__pchConnectionDetails, (1024 * 32) ); + pchConnectionDetails = Helpers.MemoryToString( mem__pchConnectionDetails ); return returnValue; } @@ -102,23 +104,26 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SetGameHostParams", CallingConvention = Platform.CC)] - private static extern GameSearchErrorCode_t _SetGameHostParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern GameSearchErrorCode_t _SetGameHostParams( IntPtr self, IntPtr pchKey, IntPtr pchValue ); #endregion - internal GameSearchErrorCode_t SetGameHostParams( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal GameSearchErrorCode_t SetGameHostParams( string pchKey, string pchValue ) { - var returnValue = _SetGameHostParams( Self, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + var returnValue = _SetGameHostParams( Self, str__pchKey.Pointer, str__pchValue.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SetConnectionDetails", CallingConvention = Platform.CC)] - private static extern GameSearchErrorCode_t _SetConnectionDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectionDetails, int cubConnectionDetails ); + private static extern GameSearchErrorCode_t _SetConnectionDetails( IntPtr self, IntPtr pchConnectionDetails, int cubConnectionDetails ); #endregion - internal GameSearchErrorCode_t SetConnectionDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectionDetails, int cubConnectionDetails ) + internal GameSearchErrorCode_t SetConnectionDetails( string pchConnectionDetails, int cubConnectionDetails ) { - var returnValue = _SetConnectionDetails( Self, pchConnectionDetails, cubConnectionDetails ); + using var str__pchConnectionDetails = new Utf8StringToNative( pchConnectionDetails ); + var returnValue = _SetConnectionDetails( Self, str__pchConnectionDetails.Pointer, cubConnectionDetails ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs index 9aa7483..f9cccce 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -23,32 +23,35 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct", CallingConvention = Platform.CC)] - private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); + private static extern void _SetProduct( IntPtr self, IntPtr pszProduct ); #endregion - internal void SetProduct( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ) + internal void SetProduct( string pszProduct ) { - _SetProduct( Self, pszProduct ); + using var str__pszProduct = new Utf8StringToNative( pszProduct ); + _SetProduct( Self, str__pszProduct.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameDescription", CallingConvention = Platform.CC)] - private static extern void _SetGameDescription( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ); + private static extern void _SetGameDescription( IntPtr self, IntPtr pszGameDescription ); #endregion - internal void SetGameDescription( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ) + internal void SetGameDescription( string pszGameDescription ) { - _SetGameDescription( Self, pszGameDescription ); + using var str__pszGameDescription = new Utf8StringToNative( pszGameDescription ); + _SetGameDescription( Self, str__pszGameDescription.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetModDir", CallingConvention = Platform.CC)] - private static extern void _SetModDir( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ); + private static extern void _SetModDir( IntPtr self, IntPtr pszModDir ); #endregion - internal void SetModDir( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ) + internal void SetModDir( string pszModDir ) { - _SetModDir( Self, pszModDir ); + using var str__pszModDir = new Utf8StringToNative( pszModDir ); + _SetModDir( Self, str__pszModDir.Pointer ); } #region FunctionMeta @@ -63,12 +66,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOn", CallingConvention = Platform.CC)] - private static extern void _LogOn( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ); + private static extern void _LogOn( IntPtr self, IntPtr pszToken ); #endregion - internal void LogOn( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ) + internal void LogOn( string pszToken ) { - _LogOn( Self, pszToken ); + using var str__pszToken = new Utf8StringToNative( pszToken ); + _LogOn( Self, str__pszToken.Pointer ); } #region FunctionMeta @@ -160,22 +164,24 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetServerName", CallingConvention = Platform.CC)] - private static extern void _SetServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ); + private static extern void _SetServerName( IntPtr self, IntPtr pszServerName ); #endregion - internal void SetServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ) + internal void SetServerName( string pszServerName ) { - _SetServerName( Self, pszServerName ); + using var str__pszServerName = new Utf8StringToNative( pszServerName ); + _SetServerName( Self, str__pszServerName.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetMapName", CallingConvention = Platform.CC)] - private static extern void _SetMapName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ); + private static extern void _SetMapName( IntPtr self, IntPtr pszMapName ); #endregion - internal void SetMapName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ) + internal void SetMapName( string pszMapName ) { - _SetMapName( Self, pszMapName ); + using var str__pszMapName = new Utf8StringToNative( pszMapName ); + _SetMapName( Self, str__pszMapName.Pointer ); } #region FunctionMeta @@ -200,12 +206,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorServerName", CallingConvention = Platform.CC)] - private static extern void _SetSpectatorServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ); + private static extern void _SetSpectatorServerName( IntPtr self, IntPtr pszSpectatorServerName ); #endregion - internal void SetSpectatorServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ) + internal void SetSpectatorServerName( string pszSpectatorServerName ) { - _SetSpectatorServerName( Self, pszSpectatorServerName ); + using var str__pszSpectatorServerName = new Utf8StringToNative( pszSpectatorServerName ); + _SetSpectatorServerName( Self, str__pszSpectatorServerName.Pointer ); } #region FunctionMeta @@ -220,42 +227,47 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetKeyValue", CallingConvention = Platform.CC)] - private static extern void _SetKeyValue( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + private static extern void _SetKeyValue( IntPtr self, IntPtr pKey, IntPtr pValue ); #endregion - internal void SetKeyValue( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + internal void SetKeyValue( string pKey, string pValue ) { - _SetKeyValue( Self, pKey, pValue ); + using var str__pKey = new Utf8StringToNative( pKey ); + using var str__pValue = new Utf8StringToNative( pValue ); + _SetKeyValue( Self, str__pKey.Pointer, str__pValue.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameTags", CallingConvention = Platform.CC)] - private static extern void _SetGameTags( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ); + private static extern void _SetGameTags( IntPtr self, IntPtr pchGameTags ); #endregion - internal void SetGameTags( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ) + internal void SetGameTags( string pchGameTags ) { - _SetGameTags( Self, pchGameTags ); + using var str__pchGameTags = new Utf8StringToNative( pchGameTags ); + _SetGameTags( Self, str__pchGameTags.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameData", CallingConvention = Platform.CC)] - private static extern void _SetGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ); + private static extern void _SetGameData( IntPtr self, IntPtr pchGameData ); #endregion - internal void SetGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ) + internal void SetGameData( string pchGameData ) { - _SetGameData( Self, pchGameData ); + using var str__pchGameData = new Utf8StringToNative( pchGameData ); + _SetGameData( Self, str__pchGameData.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetRegion", CallingConvention = Platform.CC)] - private static extern void _SetRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ); + private static extern void _SetRegion( IntPtr self, IntPtr pszRegion ); #endregion - internal void SetRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ) + internal void SetRegion( string pszRegion ) { - _SetRegion( Self, pszRegion ); + using var str__pszRegion = new Utf8StringToNative( pszRegion ); + _SetRegion( Self, str__pszRegion.Pointer ); } #region FunctionMeta @@ -446,12 +458,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BUpdateUserData", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _BUpdateUserData( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ); + private static extern bool _BUpdateUserData( IntPtr self, SteamId steamIDUser, IntPtr pchPlayerName, uint uScore ); #endregion - internal bool BUpdateUserData( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ) + internal bool BUpdateUserData( SteamId steamIDUser, string pchPlayerName, uint uScore ) { - var returnValue = _BUpdateUserData( Self, steamIDUser, pchPlayerName, uScore ); + using var str__pchPlayerName = new Utf8StringToNative( pchPlayerName ); + var returnValue = _BUpdateUserData( Self, steamIDUser, str__pchPlayerName.Pointer, uScore ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs index 1fc0106..04c7b41 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -35,96 +35,104 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, ref int pData ); #endregion - internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetUserStat( SteamId steamIDUser, string pchName, ref int pData ) { - var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserStat( Self, steamIDUser, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, ref float pData ); #endregion - internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetUserStat( SteamId steamIDUser, string pchName, ref float pData ) { - var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserStat( Self, steamIDUser, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, IntPtr pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion - internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + internal bool GetUserAchievement( SteamId steamIDUser, string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) { - var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserAchievement( Self, steamIDUser, str__pchName.Pointer, ref pbAchieved ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, int nData ); #endregion - internal bool SetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + internal bool SetUserStat( SteamId steamIDUser, string pchName, int nData ) { - var returnValue = _SetUserStat( Self, steamIDUser, pchName, nData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetUserStat( Self, steamIDUser, str__pchName.Pointer, nData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, float fData ); #endregion - internal bool SetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + internal bool SetUserStat( SteamId steamIDUser, string pchName, float fData ) { - var returnValue = _SetUserStat( Self, steamIDUser, pchName, fData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetUserStat( Self, steamIDUser, str__pchName.Pointer, fData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _UpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + private static extern bool _UpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, float flCountThisSession, double dSessionLength ); #endregion - internal bool UpdateUserAvgRateStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + internal bool UpdateUserAvgRateStat( SteamId steamIDUser, string pchName, float flCountThisSession, double dSessionLength ) { - var returnValue = _UpdateUserAvgRateStat( Self, steamIDUser, pchName, flCountThisSession, dSessionLength ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _UpdateUserAvgRateStat( Self, steamIDUser, str__pchName.Pointer, flCountThisSession, dSessionLength ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern bool _SetUserAchievement( IntPtr self, SteamId steamIDUser, IntPtr pchName ); #endregion - internal bool SetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal bool SetUserAchievement( SteamId steamIDUser, string pchName ) { - var returnValue = _SetUserAchievement( Self, steamIDUser, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetUserAchievement( Self, steamIDUser, str__pchName.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_ClearUserAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _ClearUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern bool _ClearUserAchievement( IntPtr self, SteamId steamIDUser, IntPtr pchName ); #endregion - internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal bool ClearUserAchievement( SteamId steamIDUser, string pchName ) { - var returnValue = _ClearUserAchievement( Self, steamIDUser, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _ClearUserAchievement( Self, steamIDUser, str__pchName.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs index a175ddb..04863e7 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs @@ -47,12 +47,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_CreateBrowser", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _CreateBrowser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserCSS ); + private static extern SteamAPICall_t _CreateBrowser( IntPtr self, IntPtr pchUserAgent, IntPtr pchUserCSS ); #endregion - internal CallResult CreateBrowser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserCSS ) + internal CallResult CreateBrowser( string pchUserAgent, string pchUserCSS ) { - var returnValue = _CreateBrowser( Self, pchUserAgent, pchUserCSS ); + using var str__pchUserAgent = new Utf8StringToNative( pchUserAgent ); + using var str__pchUserCSS = new Utf8StringToNative( pchUserCSS ); + var returnValue = _CreateBrowser( Self, str__pchUserAgent.Pointer, str__pchUserCSS.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -68,12 +70,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_LoadURL", CallingConvention = Platform.CC)] - private static extern void _LoadURL( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPostData ); + private static extern void _LoadURL( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr pchURL, IntPtr pchPostData ); #endregion - internal void LoadURL( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPostData ) + internal void LoadURL( HHTMLBrowser unBrowserHandle, string pchURL, string pchPostData ) { - _LoadURL( Self, unBrowserHandle, pchURL, pchPostData ); + using var str__pchURL = new Utf8StringToNative( pchURL ); + using var str__pchPostData = new Utf8StringToNative( pchPostData ); + _LoadURL( Self, unBrowserHandle, str__pchURL.Pointer, str__pchPostData.Pointer ); } #region FunctionMeta @@ -128,22 +132,25 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_AddHeader", CallingConvention = Platform.CC)] - private static extern void _AddHeader( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern void _AddHeader( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr pchKey, IntPtr pchValue ); #endregion - internal void AddHeader( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal void AddHeader( HHTMLBrowser unBrowserHandle, string pchKey, string pchValue ) { - _AddHeader( Self, unBrowserHandle, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + _AddHeader( Self, unBrowserHandle, str__pchKey.Pointer, str__pchValue.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_ExecuteJavascript", CallingConvention = Platform.CC)] - private static extern void _ExecuteJavascript( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchScript ); + private static extern void _ExecuteJavascript( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr pchScript ); #endregion - internal void ExecuteJavascript( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchScript ) + internal void ExecuteJavascript( HHTMLBrowser unBrowserHandle, string pchScript ) { - _ExecuteJavascript( Self, unBrowserHandle, pchScript ); + using var str__pchScript = new Utf8StringToNative( pchScript ); + _ExecuteJavascript( Self, unBrowserHandle, str__pchScript.Pointer ); } #region FunctionMeta @@ -288,12 +295,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Find", CallingConvention = Platform.CC)] - private static extern void _Find( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ); + private static extern void _Find( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ); #endregion - internal void Find( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ) + internal void Find( HHTMLBrowser unBrowserHandle, string pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ) { - _Find( Self, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse ); + using var str__pchSearchStr = new Utf8StringToNative( pchSearchStr ); + _Find( Self, unBrowserHandle, str__pchSearchStr.Pointer, bCurrentlyInFind, bReverse ); } #region FunctionMeta @@ -318,12 +326,16 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetCookie", CallingConvention = Platform.CC)] - private static extern void _SetCookie( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHostname, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ); + private static extern void _SetCookie( IntPtr self, IntPtr pchHostname, IntPtr pchKey, IntPtr pchValue, IntPtr pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ); #endregion - internal void SetCookie( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHostname, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ) + internal void SetCookie( string pchHostname, string pchKey, string pchValue, string pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ) { - _SetCookie( Self, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly ); + using var str__pchHostname = new Utf8StringToNative( pchHostname ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + using var str__pchPath = new Utf8StringToNative( pchPath ); + _SetCookie( Self, str__pchHostname.Pointer, str__pchKey.Pointer, str__pchValue.Pointer, str__pchPath.Pointer, nExpires, bSecure, bHTTPOnly ); } #region FunctionMeta @@ -388,12 +400,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse", CallingConvention = Platform.CC)] - private static extern void _FileLoadDialogResponse( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSelectedFiles ); + private static extern void _FileLoadDialogResponse( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr pchSelectedFiles ); #endregion - internal void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSelectedFiles ) + internal void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, string pchSelectedFiles ) { - _FileLoadDialogResponse( Self, unBrowserHandle, pchSelectedFiles ); + using var str__pchSelectedFiles = new Utf8StringToNative( pchSelectedFiles ); + _FileLoadDialogResponse( Self, unBrowserHandle, str__pchSelectedFiles.Pointer ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs index 12755a1..5f3cccb 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs @@ -26,12 +26,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest", CallingConvention = Platform.CC)] - private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ); + private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, IntPtr pchAbsoluteURL ); #endregion - internal HTTPRequestHandle CreateHTTPRequest( HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ) + internal HTTPRequestHandle CreateHTTPRequest( HTTPMethod eHTTPRequestMethod, string pchAbsoluteURL ) { - var returnValue = _CreateHTTPRequest( Self, eHTTPRequestMethod, pchAbsoluteURL ); + using var str__pchAbsoluteURL = new Utf8StringToNative( pchAbsoluteURL ); + var returnValue = _CreateHTTPRequest( Self, eHTTPRequestMethod, str__pchAbsoluteURL.Pointer ); return returnValue; } @@ -62,24 +63,28 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetHTTPRequestHeaderValue( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderValue ); + private static extern bool _SetHTTPRequestHeaderValue( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchHeaderName, IntPtr pchHeaderValue ); #endregion - internal bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderValue ) + internal bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue ) { - var returnValue = _SetHTTPRequestHeaderValue( Self, hRequest, pchHeaderName, pchHeaderValue ); + using var str__pchHeaderName = new Utf8StringToNative( pchHeaderName ); + using var str__pchHeaderValue = new Utf8StringToNative( pchHeaderValue ); + var returnValue = _SetHTTPRequestHeaderValue( Self, hRequest, str__pchHeaderName.Pointer, str__pchHeaderValue.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetHTTPRequestGetOrPostParameter( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamValue ); + private static extern bool _SetHTTPRequestGetOrPostParameter( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchParamName, IntPtr pchParamValue ); #endregion - internal bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamValue ) + internal bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, string pchParamName, string pchParamValue ) { - var returnValue = _SetHTTPRequestGetOrPostParameter( Self, hRequest, pchParamName, pchParamValue ); + using var str__pchParamName = new Utf8StringToNative( pchParamName ); + using var str__pchParamValue = new Utf8StringToNative( pchParamValue ); + var returnValue = _SetHTTPRequestGetOrPostParameter( Self, hRequest, str__pchParamName.Pointer, str__pchParamValue.Pointer ); return returnValue; } @@ -134,24 +139,26 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetHTTPResponseHeaderSize( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref uint unResponseHeaderSize ); + private static extern bool _GetHTTPResponseHeaderSize( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchHeaderName, ref uint unResponseHeaderSize ); #endregion - internal bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref uint unResponseHeaderSize ) + internal bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, string pchHeaderName, ref uint unResponseHeaderSize ) { - var returnValue = _GetHTTPResponseHeaderSize( Self, hRequest, pchHeaderName, ref unResponseHeaderSize ); + using var str__pchHeaderName = new Utf8StringToNative( pchHeaderName ); + var returnValue = _GetHTTPResponseHeaderSize( Self, hRequest, str__pchHeaderName.Pointer, ref unResponseHeaderSize ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetHTTPResponseHeaderValue( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ); + private static extern bool _GetHTTPResponseHeaderValue( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ); #endregion - internal bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ) + internal bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, string pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ) { - var returnValue = _GetHTTPResponseHeaderValue( Self, hRequest, pchHeaderName, ref pHeaderValueBuffer, unBufferSize ); + using var str__pchHeaderName = new Utf8StringToNative( pchHeaderName ); + var returnValue = _GetHTTPResponseHeaderValue( Self, hRequest, str__pchHeaderName.Pointer, ref pHeaderValueBuffer, unBufferSize ); return returnValue; } @@ -218,12 +225,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetHTTPRequestRawPostBody( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ); + private static extern bool _SetHTTPRequestRawPostBody( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ); #endregion - internal bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ) + internal bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, string pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ) { - var returnValue = _SetHTTPRequestRawPostBody( Self, hRequest, pchContentType, pubBody, unBodyLen ); + using var str__pchContentType = new Utf8StringToNative( pchContentType ); + var returnValue = _SetHTTPRequestRawPostBody( Self, hRequest, str__pchContentType.Pointer, pubBody, unBodyLen ); return returnValue; } @@ -253,12 +261,15 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetCookie", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetCookie( IntPtr self, HTTPCookieContainerHandle hCookieContainer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHost, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUrl, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCookie ); + private static extern bool _SetCookie( IntPtr self, HTTPCookieContainerHandle hCookieContainer, IntPtr pchHost, IntPtr pchUrl, IntPtr pchCookie ); #endregion - internal bool SetCookie( HTTPCookieContainerHandle hCookieContainer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHost, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUrl, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCookie ) + internal bool SetCookie( HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie ) { - var returnValue = _SetCookie( Self, hCookieContainer, pchHost, pchUrl, pchCookie ); + using var str__pchHost = new Utf8StringToNative( pchHost ); + using var str__pchUrl = new Utf8StringToNative( pchUrl ); + using var str__pchCookie = new Utf8StringToNative( pchCookie ); + var returnValue = _SetCookie( Self, hCookieContainer, str__pchHost.Pointer, str__pchUrl.Pointer, str__pchCookie.Pointer ); return returnValue; } @@ -277,12 +288,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetHTTPRequestUserAgentInfo( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgentInfo ); + private static extern bool _SetHTTPRequestUserAgentInfo( IntPtr self, HTTPRequestHandle hRequest, IntPtr pchUserAgentInfo ); #endregion - internal bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgentInfo ) + internal bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, string pchUserAgentInfo ) { - var returnValue = _SetHTTPRequestUserAgentInfo( Self, hRequest, pchUserAgentInfo ); + using var str__pchUserAgentInfo = new Utf8StringToNative( pchUserAgentInfo ); + var returnValue = _SetHTTPRequestUserAgentInfo( Self, hRequest, str__pchUserAgentInfo.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs index 1b1008c..b591f67 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -48,12 +48,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_SetInputActionManifestFilePath", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetInputActionManifestFilePath( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputActionManifestAbsolutePath ); + private static extern bool _SetInputActionManifestFilePath( IntPtr self, IntPtr pchInputActionManifestAbsolutePath ); #endregion - internal bool SetInputActionManifestFilePath( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputActionManifestAbsolutePath ) + internal bool SetInputActionManifestFilePath( string pchInputActionManifestAbsolutePath ) { - var returnValue = _SetInputActionManifestFilePath( Self, pchInputActionManifestAbsolutePath ); + using var str__pchInputActionManifestAbsolutePath = new Utf8StringToNative( pchInputActionManifestAbsolutePath ); + var returnValue = _SetInputActionManifestFilePath( Self, str__pchInputActionManifestAbsolutePath.Pointer ); return returnValue; } @@ -114,12 +115,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle", CallingConvention = Platform.CC)] - private static extern InputActionSetHandle_t _GetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); + private static extern InputActionSetHandle_t _GetActionSetHandle( IntPtr self, IntPtr pszActionSetName ); #endregion - internal InputActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) + internal InputActionSetHandle_t GetActionSetHandle( string pszActionSetName ) { - var returnValue = _GetActionSetHandle( Self, pszActionSetName ); + using var str__pszActionSetName = new Utf8StringToNative( pszActionSetName ); + var returnValue = _GetActionSetHandle( Self, str__pszActionSetName.Pointer ); return returnValue; } @@ -187,12 +189,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle", CallingConvention = Platform.CC)] - private static extern InputDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private static extern InputDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, IntPtr pszActionName ); #endregion - internal InputDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + internal InputDigitalActionHandle_t GetDigitalActionHandle( string pszActionName ) { - var returnValue = _GetDigitalActionHandle( Self, pszActionName ); + using var str__pszActionName = new Utf8StringToNative( pszActionName ); + var returnValue = _GetDigitalActionHandle( Self, str__pszActionName.Pointer ); return returnValue; } @@ -231,12 +234,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle", CallingConvention = Platform.CC)] - private static extern InputAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private static extern InputAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, IntPtr pszActionName ); #endregion - internal InputAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + internal InputAnalogActionHandle_t GetAnalogActionHandle( string pszActionName ) { - var returnValue = _GetAnalogActionHandle( Self, pszActionName ); + using var str__pszActionName = new Utf8StringToNative( pszActionName ); + var returnValue = _GetAnalogActionHandle( Self, str__pszActionName.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs index adfdba2..9045bb4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -50,15 +50,16 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultItemProperty", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + private static extern bool _GetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, IntPtr pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); #endregion - internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer ) + internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer ) { - using var mempchValueBuffer = Helpers.TakeMemory(); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + using var mem__pchValueBuffer = Helpers.TakeMemory(); uint szpunValueBufferSizeOut = (1024 * 32); - var returnValue = _GetResultItemProperty( Self, resultHandle, unItemIndex, pchPropertyName, mempchValueBuffer, ref szpunValueBufferSizeOut ); - pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + var returnValue = _GetResultItemProperty( Self, resultHandle, unItemIndex, str__pchPropertyName.Pointer, mem__pchValueBuffer, ref szpunValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mem__pchValueBuffer ); return returnValue; } @@ -288,15 +289,16 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + private static extern bool _GetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, IntPtr pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); #endregion - internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer ) + internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, string pchPropertyName, out string pchValueBuffer ) { - using var mempchValueBuffer = Helpers.TakeMemory(); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + using var mem__pchValueBuffer = Helpers.TakeMemory(); uint szpunValueBufferSizeOut = (1024 * 32); - var returnValue = _GetItemDefinitionProperty( Self, iDefinition, pchPropertyName, mempchValueBuffer, ref szpunValueBufferSizeOut ); - pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + var returnValue = _GetItemDefinitionProperty( Self, iDefinition, str__pchPropertyName.Pointer, mem__pchValueBuffer, ref szpunValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mem__pchValueBuffer ); return returnValue; } @@ -394,60 +396,66 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _RemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ); + private static extern bool _RemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, IntPtr pchPropertyName ); #endregion - internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ) + internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, string pchPropertyName ) { - var returnValue = _RemoveProperty( Self, handle, nItemID, pchPropertyName ); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + var returnValue = _RemoveProperty( Self, handle, nItemID, str__pchPropertyName.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ); + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, IntPtr pchPropertyName, IntPtr pchPropertyValue ); #endregion - internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ) + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, string pchPropertyName, string pchPropertyValue ) { - var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, pchPropertyValue ); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + using var str__pchPropertyValue = new Utf8StringToNative( pchPropertyValue ); + var returnValue = _SetProperty( Self, handle, nItemID, str__pchPropertyName.Pointer, str__pchPropertyValue.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyBool", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, IntPtr pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); #endregion - internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) { - var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, bValue ); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + var returnValue = _SetProperty( Self, handle, nItemID, str__pchPropertyName.Pointer, bValue ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyInt64", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ); + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, IntPtr pchPropertyName, long nValue ); #endregion - internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ) + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, string pchPropertyName, long nValue ) { - var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, nValue ); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + var returnValue = _SetProperty( Self, handle, nItemID, str__pchPropertyName.Pointer, nValue ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ); + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, IntPtr pchPropertyName, float flValue ); #endregion - internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ) + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, string pchPropertyName, float flValue ) { - var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, flValue ); + using var str__pchPropertyName = new Utf8StringToNative( pchPropertyName ); + var returnValue = _SetProperty( Self, handle, nItemID, str__pchPropertyName.Pointer, flValue ); return returnValue; } @@ -466,12 +474,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_InspectItem", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _InspectItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchItemToken ); + private static extern bool _InspectItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, IntPtr pchItemToken ); #endregion - internal bool InspectItem( ref SteamInventoryResult_t pResultHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchItemToken ) + internal bool InspectItem( ref SteamInventoryResult_t pResultHandle, string pchItemToken ) { - var returnValue = _InspectItem( Self, ref pResultHandle, pchItemToken ); + using var str__pchItemToken = new Utf8StringToNative( pchItemToken ); + var returnValue = _InspectItem( Self, ref pResultHandle, str__pchItemToken.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs index be6719b..8d952d9 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -80,32 +80,36 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter", CallingConvention = Platform.CC)] - private static extern void _AddRequestLobbyListStringFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ); + private static extern void _AddRequestLobbyListStringFilter( IntPtr self, IntPtr pchKeyToMatch, IntPtr pchValueToMatch, LobbyComparison eComparisonType ); #endregion - internal void AddRequestLobbyListStringFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ) + internal void AddRequestLobbyListStringFilter( string pchKeyToMatch, string pchValueToMatch, LobbyComparison eComparisonType ) { - _AddRequestLobbyListStringFilter( Self, pchKeyToMatch, pchValueToMatch, eComparisonType ); + using var str__pchKeyToMatch = new Utf8StringToNative( pchKeyToMatch ); + using var str__pchValueToMatch = new Utf8StringToNative( pchValueToMatch ); + _AddRequestLobbyListStringFilter( Self, str__pchKeyToMatch.Pointer, str__pchValueToMatch.Pointer, eComparisonType ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter", CallingConvention = Platform.CC)] - private static extern void _AddRequestLobbyListNumericalFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); + private static extern void _AddRequestLobbyListNumericalFilter( IntPtr self, IntPtr pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); #endregion - internal void AddRequestLobbyListNumericalFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ) + internal void AddRequestLobbyListNumericalFilter( string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ) { - _AddRequestLobbyListNumericalFilter( Self, pchKeyToMatch, nValueToMatch, eComparisonType ); + using var str__pchKeyToMatch = new Utf8StringToNative( pchKeyToMatch ); + _AddRequestLobbyListNumericalFilter( Self, str__pchKeyToMatch.Pointer, nValueToMatch, eComparisonType ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter", CallingConvention = Platform.CC)] - private static extern void _AddRequestLobbyListNearValueFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ); + private static extern void _AddRequestLobbyListNearValueFilter( IntPtr self, IntPtr pchKeyToMatch, int nValueToBeCloseTo ); #endregion - internal void AddRequestLobbyListNearValueFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ) + internal void AddRequestLobbyListNearValueFilter( string pchKeyToMatch, int nValueToBeCloseTo ) { - _AddRequestLobbyListNearValueFilter( Self, pchKeyToMatch, nValueToBeCloseTo ); + using var str__pchKeyToMatch = new Utf8StringToNative( pchKeyToMatch ); + _AddRequestLobbyListNearValueFilter( Self, str__pchKeyToMatch.Pointer, nValueToBeCloseTo ); } #region FunctionMeta @@ -227,24 +231,27 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData", CallingConvention = Platform.CC)] - private static extern Utf8StringPointer _GetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern Utf8StringPointer _GetLobbyData( IntPtr self, SteamId steamIDLobby, IntPtr pchKey ); #endregion - internal string GetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal string GetLobbyData( SteamId steamIDLobby, string pchKey ) { - var returnValue = _GetLobbyData( Self, steamIDLobby, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _GetLobbyData( Self, steamIDLobby, str__pchKey.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern bool _SetLobbyData( IntPtr self, SteamId steamIDLobby, IntPtr pchKey, IntPtr pchValue ); #endregion - internal bool SetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal bool SetLobbyData( SteamId steamIDLobby, string pchKey, string pchValue ) { - var returnValue = _SetLobbyData( Self, steamIDLobby, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + var returnValue = _SetLobbyData( Self, steamIDLobby, str__pchKey.Pointer, str__pchValue.Pointer ); return returnValue; } @@ -267,45 +274,49 @@ namespace Steamworks #endregion internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out string pchKey, out string pchValue ) { - using var mempchKey = Helpers.TakeMemory(); - using var mempchValue = Helpers.TakeMemory(); - var returnValue = _GetLobbyDataByIndex( Self, steamIDLobby, iLobbyData, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); - pchKey = Helpers.MemoryToString( mempchKey ); - pchValue = Helpers.MemoryToString( mempchValue ); + using var mem__pchKey = Helpers.TakeMemory(); + using var mem__pchValue = Helpers.TakeMemory(); + var returnValue = _GetLobbyDataByIndex( Self, steamIDLobby, iLobbyData, mem__pchKey, (1024 * 32), mem__pchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mem__pchKey ); + pchValue = Helpers.MemoryToString( mem__pchValue ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _DeleteLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern bool _DeleteLobbyData( IntPtr self, SteamId steamIDLobby, IntPtr pchKey ); #endregion - internal bool DeleteLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal bool DeleteLobbyData( SteamId steamIDLobby, string pchKey ) { - var returnValue = _DeleteLobbyData( Self, steamIDLobby, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _DeleteLobbyData( Self, steamIDLobby, str__pchKey.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData", CallingConvention = Platform.CC)] - private static extern Utf8StringPointer _GetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern Utf8StringPointer _GetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, IntPtr pchKey ); #endregion - internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, string pchKey ) { - var returnValue = _GetLobbyMemberData( Self, steamIDLobby, steamIDUser, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _GetLobbyMemberData( Self, steamIDLobby, steamIDUser, str__pchKey.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData", CallingConvention = Platform.CC)] - private static extern void _SetLobbyMemberData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern void _SetLobbyMemberData( IntPtr self, SteamId steamIDLobby, IntPtr pchKey, IntPtr pchValue ); #endregion - internal void SetLobbyMemberData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal void SetLobbyMemberData( SteamId steamIDLobby, string pchKey, string pchValue ) { - _SetLobbyMemberData( Self, steamIDLobby, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + _SetLobbyMemberData( Self, steamIDLobby, str__pchKey.Pointer, str__pchValue.Pointer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs index 853a7fa..bd57a7d 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs @@ -16,12 +16,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList", CallingConvention = Platform.CC)] - private static extern void _AddPlayerToList( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nScore, float flTimePlayed ); + private static extern void _AddPlayerToList( IntPtr self, IntPtr pchName, int nScore, float flTimePlayed ); #endregion - internal void AddPlayerToList( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nScore, float flTimePlayed ) + internal void AddPlayerToList( string pchName, int nScore, float flTimePlayed ) { - _AddPlayerToList( Self, pchName, nScore, flTimePlayed ); + using var str__pchName = new Utf8StringToNative( pchName ); + _AddPlayerToList( Self, str__pchName.Pointer, nScore, flTimePlayed ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs index 2b2dce2..7bee06b 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs @@ -16,12 +16,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded", CallingConvention = Platform.CC)] - private static extern void _RulesResponded( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRule, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern void _RulesResponded( IntPtr self, IntPtr pchRule, IntPtr pchValue ); #endregion - internal void RulesResponded( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRule, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal void RulesResponded( string pchRule, string pchValue ) { - _RulesResponded( Self, pchRule, pchValue ); + using var str__pchRule = new Utf8StringToNative( pchRule ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + _RulesResponded( Self, str__pchRule.Pointer, str__pchValue.Pointer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs index 8499236..5008293 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs @@ -24,12 +24,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _RegisterSteamMusicRemote( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern bool _RegisterSteamMusicRemote( IntPtr self, IntPtr pchName ); #endregion - internal bool RegisterSteamMusicRemote( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal bool RegisterSteamMusicRemote( string pchName ) { - var returnValue = _RegisterSteamMusicRemote( Self, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _RegisterSteamMusicRemote( Self, str__pchName.Pointer ); return returnValue; } @@ -72,12 +73,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetDisplayName", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetDisplayName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDisplayName ); + private static extern bool _SetDisplayName( IntPtr self, IntPtr pchDisplayName ); #endregion - internal bool SetDisplayName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDisplayName ) + internal bool SetDisplayName( string pchDisplayName ) { - var returnValue = _SetDisplayName( Self, pchDisplayName ); + using var str__pchDisplayName = new Utf8StringToNative( pchDisplayName ); + var returnValue = _SetDisplayName( Self, str__pchDisplayName.Pointer ); return returnValue; } @@ -240,12 +242,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _UpdateCurrentEntryText( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); + private static extern bool _UpdateCurrentEntryText( IntPtr self, IntPtr pchText ); #endregion - internal bool UpdateCurrentEntryText( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) + internal bool UpdateCurrentEntryText( string pchText ) { - var returnValue = _UpdateCurrentEntryText( Self, pchText ); + using var str__pchText = new Utf8StringToNative( pchText ); + var returnValue = _UpdateCurrentEntryText( Self, str__pchText.Pointer ); return returnValue; } @@ -312,12 +315,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetQueueEntry", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetQueueEntry( IntPtr self, int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ); + private static extern bool _SetQueueEntry( IntPtr self, int nID, int nPosition, IntPtr pchEntryText ); #endregion - internal bool SetQueueEntry( int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ) + internal bool SetQueueEntry( int nID, int nPosition, string pchEntryText ) { - var returnValue = _SetQueueEntry( Self, nID, nPosition, pchEntryText ); + using var str__pchEntryText = new Utf8StringToNative( pchEntryText ); + var returnValue = _SetQueueEntry( Self, nID, nPosition, str__pchEntryText.Pointer ); return returnValue; } @@ -372,12 +376,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetPlaylistEntry", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetPlaylistEntry( IntPtr self, int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ); + private static extern bool _SetPlaylistEntry( IntPtr self, int nID, int nPosition, IntPtr pchEntryText ); #endregion - internal bool SetPlaylistEntry( int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ) + internal bool SetPlaylistEntry( int nID, int nPosition, string pchEntryText ) { - var returnValue = _SetPlaylistEntry( Self, nID, nPosition, pchEntryText ); + using var str__pchEntryText = new Utf8StringToNative( pchEntryText ); + var returnValue = _SetPlaylistEntry( Self, nID, nPosition, str__pchEntryText.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs index 8cb5671..da9ff46 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -82,12 +82,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CloseConnection", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _CloseConnection( IntPtr self, Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ); + private static extern bool _CloseConnection( IntPtr self, Connection hPeer, int nReason, IntPtr pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ); #endregion - internal bool CloseConnection( Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ) + internal bool CloseConnection( Connection hPeer, int nReason, string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ) { - var returnValue = _CloseConnection( Self, hPeer, nReason, pszDebug, bEnableLinger ); + using var str__pszDebug = new Utf8StringToNative( pszDebug ); + var returnValue = _CloseConnection( Self, hPeer, nReason, str__pszDebug.Pointer, bEnableLinger ); return returnValue; } @@ -128,12 +129,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionName", CallingConvention = Platform.CC)] - private static extern void _SetConnectionName( IntPtr self, Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ); + private static extern void _SetConnectionName( IntPtr self, Connection hPeer, IntPtr pszName ); #endregion - internal void SetConnectionName( Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ) + internal void SetConnectionName( Connection hPeer, string pszName ) { - _SetConnectionName( Self, hPeer, pszName ); + using var str__pszName = new Utf8StringToNative( pszName ); + _SetConnectionName( Self, hPeer, str__pszName.Pointer ); } #region FunctionMeta @@ -144,9 +146,9 @@ namespace Steamworks #endregion internal bool GetConnectionName( Connection hPeer, out string pszName ) { - using var mempszName = Helpers.TakeMemory(); - var returnValue = _GetConnectionName( Self, hPeer, mempszName, (1024 * 32) ); - pszName = Helpers.MemoryToString( mempszName ); + using var mem__pszName = Helpers.TakeMemory(); + var returnValue = _GetConnectionName( Self, hPeer, mem__pszName, (1024 * 32) ); + pszName = Helpers.MemoryToString( mem__pszName ); return returnValue; } @@ -223,9 +225,9 @@ namespace Steamworks #endregion internal int GetDetailedConnectionStatus( Connection hConn, out string pszBuf ) { - using var mempszBuf = Helpers.TakeMemory(); - var returnValue = _GetDetailedConnectionStatus( Self, hConn, mempszBuf, (1024 * 32) ); - pszBuf = Helpers.MemoryToString( mempszBuf ); + using var mem__pszBuf = Helpers.TakeMemory(); + var returnValue = _GetDetailedConnectionStatus( Self, hConn, mem__pszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mem__pszBuf ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index 28d67d2..3a2522a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -93,20 +93,21 @@ namespace Steamworks #endregion internal void ConvertPingLocationToString( ref NetPingLocation location, out string pszBuf ) { - using var mempszBuf = Helpers.TakeMemory(); - _ConvertPingLocationToString( Self, ref location, mempszBuf, (1024 * 32) ); - pszBuf = Helpers.MemoryToString( mempszBuf ); + using var mem__pszBuf = Helpers.TakeMemory(); + _ConvertPingLocationToString( Self, ref location, mem__pszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mem__pszBuf ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_ParsePingLocationString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _ParsePingLocationString( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref NetPingLocation result ); + private static extern bool _ParsePingLocationString( IntPtr self, IntPtr pszString, ref NetPingLocation result ); #endregion - internal bool ParsePingLocationString( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref NetPingLocation result ) + internal bool ParsePingLocationString( string pszString, ref NetPingLocation result ) { - var returnValue = _ParsePingLocationString( Self, pszString, ref result ); + using var str__pszString = new Utf8StringToNative( pszString ); + var returnValue = _ParsePingLocationString( Self, str__pszString.Pointer, ref result ); return returnValue; } @@ -248,12 +249,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetGlobalConfigValueString( IntPtr self, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ); + private static extern bool _SetGlobalConfigValueString( IntPtr self, NetConfig eValue, IntPtr val ); #endregion - internal bool SetGlobalConfigValueString( NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ) + internal bool SetGlobalConfigValueString( NetConfig eValue, string val ) { - var returnValue = _SetGlobalConfigValueString( Self, eValue, val ); + using var str__val = new Utf8StringToNative( val ); + var returnValue = _SetGlobalConfigValueString( Self, eValue, str__val.Pointer ); return returnValue; } @@ -296,12 +298,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetConnectionConfigValueString( IntPtr self, Connection hConn, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ); + private static extern bool _SetConnectionConfigValueString( IntPtr self, Connection hConn, NetConfig eValue, IntPtr val ); #endregion - internal bool SetConnectionConfigValueString( Connection hConn, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ) + internal bool SetConnectionConfigValueString( Connection hConn, NetConfig eValue, string val ) { - var returnValue = _SetConnectionConfigValueString( Self, hConn, eValue, val ); + using var str__val = new Utf8StringToNative( val ); + var returnValue = _SetConnectionConfigValueString( Self, hConn, eValue, str__val.Pointer ); return returnValue; } @@ -441,20 +444,21 @@ namespace Steamworks #endregion internal void SteamNetworkingIPAddr_ToString( ref NetAddress addr, out string buf, [MarshalAs( UnmanagedType.U1 )] bool bWithPort ) { - using var membuf = Helpers.TakeMemory(); - _SteamNetworkingIPAddr_ToString( Self, ref addr, membuf, (1024 * 32), bWithPort ); - buf = Helpers.MemoryToString( membuf ); + using var mem__buf = Helpers.TakeMemory(); + _SteamNetworkingIPAddr_ToString( Self, ref addr, mem__buf, (1024 * 32), bWithPort ); + buf = Helpers.MemoryToString( mem__buf ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SteamNetworkingIPAddr_ParseString( IntPtr self, ref NetAddress pAddr, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + private static extern bool _SteamNetworkingIPAddr_ParseString( IntPtr self, ref NetAddress pAddr, IntPtr pszStr ); #endregion - internal bool SteamNetworkingIPAddr_ParseString( ref NetAddress pAddr, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ) + internal bool SteamNetworkingIPAddr_ParseString( ref NetAddress pAddr, string pszStr ) { - var returnValue = _SteamNetworkingIPAddr_ParseString( Self, ref pAddr, pszStr ); + using var str__pszStr = new Utf8StringToNative( pszStr ); + var returnValue = _SteamNetworkingIPAddr_ParseString( Self, ref pAddr, str__pszStr.Pointer ); return returnValue; } @@ -476,20 +480,21 @@ namespace Steamworks #endregion internal void SteamNetworkingIdentity_ToString( ref NetIdentity identity, out string buf ) { - using var membuf = Helpers.TakeMemory(); - _SteamNetworkingIdentity_ToString( Self, ref identity, membuf, (1024 * 32) ); - buf = Helpers.MemoryToString( membuf ); + using var mem__buf = Helpers.TakeMemory(); + _SteamNetworkingIdentity_ToString( Self, ref identity, mem__buf, (1024 * 32) ); + buf = Helpers.MemoryToString( mem__buf ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SteamNetworkingIdentity_ParseString( IntPtr self, ref NetIdentity pIdentity, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + private static extern bool _SteamNetworkingIdentity_ParseString( IntPtr self, ref NetIdentity pIdentity, IntPtr pszStr ); #endregion - internal bool SteamNetworkingIdentity_ParseString( ref NetIdentity pIdentity, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ) + internal bool SteamNetworkingIdentity_ParseString( ref NetIdentity pIdentity, string pszStr ) { - var returnValue = _SteamNetworkingIdentity_ParseString( Self, ref pIdentity, pszStr ); + using var str__pszStr = new Utf8StringToNative( pszStr ); + var returnValue = _SteamNetworkingIdentity_ParseString( Self, ref pIdentity, str__pszStr.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs index 3abe7cd..c6a0520 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -51,9 +51,9 @@ namespace Steamworks #endregion internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, out string pchMetadata ) { - using var mempchMetadata = Helpers.TakeMemory(); - var returnValue = _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, mempchMetadata, (1024 * 32) ); - pchMetadata = Helpers.MemoryToString( mempchMetadata ); + using var mem__pchMetadata = Helpers.TakeMemory(); + var returnValue = _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, mem__pchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mem__pchMetadata ); return returnValue; } @@ -94,12 +94,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _CreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); + private static extern SteamAPICall_t _CreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, IntPtr pchConnectString, IntPtr pchMetadata ); #endregion - internal CallResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) + internal CallResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata ) { - var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ); + using var str__pchConnectString = new Utf8StringToNative( pchConnectString ); + using var str__pchMetadata = new Utf8StringToNative( pchMetadata ); + var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, str__pchConnectString.Pointer, str__pchMetadata.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -154,9 +156,9 @@ namespace Steamworks #endregion internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, out string pchDataStringOut ) { - using var mempchDataStringOut = Helpers.TakeMemory(); - var returnValue = _GetBeaconLocationData( Self, BeaconLocation, eData, mempchDataStringOut, (1024 * 32) ); - pchDataStringOut = Helpers.MemoryToString( mempchDataStringOut ); + using var mem__pchDataStringOut = Helpers.TakeMemory(); + var returnValue = _GetBeaconLocationData( Self, BeaconLocation, eData, mem__pchDataStringOut, (1024 * 32) ); + pchDataStringOut = Helpers.MemoryToString( mem__pchDataStringOut ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs index 166d615..c22f502 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -24,45 +24,49 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _FileWrite( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ); + private static extern bool _FileWrite( IntPtr self, IntPtr pchFile, IntPtr pvData, int cubData ); #endregion - internal bool FileWrite( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ) + internal bool FileWrite( string pchFile, IntPtr pvData, int cubData ) { - var returnValue = _FileWrite( Self, pchFile, pvData, cubData ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileWrite( Self, str__pchFile.Pointer, pvData, cubData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead", CallingConvention = Platform.CC)] - private static extern int _FileRead( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ); + private static extern int _FileRead( IntPtr self, IntPtr pchFile, IntPtr pvData, int cubDataToRead ); #endregion - internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ) + internal int FileRead( string pchFile, IntPtr pvData, int cubDataToRead ) { - var returnValue = _FileRead( Self, pchFile, pvData, cubDataToRead ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileRead( Self, str__pchFile.Pointer, pvData, cubDataToRead ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteAsync", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); + private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, IntPtr pchFile, IntPtr pvData, uint cubData ); #endregion - internal CallResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) + internal CallResult FileWriteAsync( string pchFile, IntPtr pvData, uint cubData ) { - var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileWriteAsync( Self, str__pchFile.Pointer, pvData, cubData ); return new CallResult( returnValue, IsServer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsync", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _FileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); + private static extern SteamAPICall_t _FileReadAsync( IntPtr self, IntPtr pchFile, uint nOffset, uint cubToRead ); #endregion - internal CallResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) + internal CallResult FileReadAsync( string pchFile, uint nOffset, uint cubToRead ) { - var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileReadAsync( Self, str__pchFile.Pointer, nOffset, cubToRead ); return new CallResult( returnValue, IsServer ); } @@ -81,58 +85,63 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileForget", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _FileForget( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern bool _FileForget( IntPtr self, IntPtr pchFile ); #endregion - internal bool FileForget( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal bool FileForget( string pchFile ) { - var returnValue = _FileForget( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileForget( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileDelete", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _FileDelete( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern bool _FileDelete( IntPtr self, IntPtr pchFile ); #endregion - internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal bool FileDelete( string pchFile ) { - var returnValue = _FileDelete( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileDelete( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileShare", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _FileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern SteamAPICall_t _FileShare( IntPtr self, IntPtr pchFile ); #endregion - internal CallResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal CallResult FileShare( string pchFile ) { - var returnValue = _FileShare( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileShare( Self, str__pchFile.Pointer ); return new CallResult( returnValue, IsServer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); + private static extern bool _SetSyncPlatforms( IntPtr self, IntPtr pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); #endregion - internal bool SetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ) + internal bool SetSyncPlatforms( string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ) { - var returnValue = _SetSyncPlatforms( Self, pchFile, eRemoteStoragePlatform ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _SetSyncPlatforms( Self, str__pchFile.Pointer, eRemoteStoragePlatform ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen", CallingConvention = Platform.CC)] - private static extern UGCFileWriteStreamHandle_t _FileWriteStreamOpen( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern UGCFileWriteStreamHandle_t _FileWriteStreamOpen( IntPtr self, IntPtr pchFile ); #endregion - internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( string pchFile ) { - var returnValue = _FileWriteStreamOpen( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileWriteStreamOpen( Self, str__pchFile.Pointer ); return returnValue; } @@ -175,57 +184,62 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileExists", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _FileExists( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern bool _FileExists( IntPtr self, IntPtr pchFile ); #endregion - internal bool FileExists( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal bool FileExists( string pchFile ) { - var returnValue = _FileExists( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FileExists( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FilePersisted", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _FilePersisted( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern bool _FilePersisted( IntPtr self, IntPtr pchFile ); #endregion - internal bool FilePersisted( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal bool FilePersisted( string pchFile ) { - var returnValue = _FilePersisted( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _FilePersisted( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileSize", CallingConvention = Platform.CC)] - private static extern int _GetFileSize( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern int _GetFileSize( IntPtr self, IntPtr pchFile ); #endregion - internal int GetFileSize( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal int GetFileSize( string pchFile ) { - var returnValue = _GetFileSize( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _GetFileSize( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileTimestamp", CallingConvention = Platform.CC)] - private static extern long _GetFileTimestamp( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern long _GetFileTimestamp( IntPtr self, IntPtr pchFile ); #endregion - internal long GetFileTimestamp( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal long GetFileTimestamp( string pchFile ) { - var returnValue = _GetFileTimestamp( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _GetFileTimestamp( Self, str__pchFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms", CallingConvention = Platform.CC)] - private static extern RemoteStoragePlatform _GetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private static extern RemoteStoragePlatform _GetSyncPlatforms( IntPtr self, IntPtr pchFile ); #endregion - internal RemoteStoragePlatform GetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal RemoteStoragePlatform GetSyncPlatforms( string pchFile ) { - var returnValue = _GetSyncPlatforms( Self, pchFile ); + using var str__pchFile = new Utf8StringToNative( pchFile ); + var returnValue = _GetSyncPlatforms( Self, str__pchFile.Pointer ); return returnValue; } @@ -367,12 +381,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); + private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, IntPtr pchLocation, uint unPriority ); #endregion - internal CallResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) + internal CallResult UGCDownloadToLocation( UGCHandle_t hContent, string pchLocation, uint unPriority ) { - var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); + using var str__pchLocation = new Utf8StringToNative( pchLocation ); + var returnValue = _UGCDownloadToLocation( Self, hContent, str__pchLocation.Pointer, unPriority ); return new CallResult( returnValue, IsServer ); } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs index 070fc96..a341eb2 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -34,12 +34,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary", CallingConvention = Platform.CC)] - private static extern ScreenshotHandle _AddScreenshotToLibrary( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ); + private static extern ScreenshotHandle _AddScreenshotToLibrary( IntPtr self, IntPtr pchFilename, IntPtr pchThumbnailFilename, int nWidth, int nHeight ); #endregion - internal ScreenshotHandle AddScreenshotToLibrary( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ) + internal ScreenshotHandle AddScreenshotToLibrary( string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight ) { - var returnValue = _AddScreenshotToLibrary( Self, pchFilename, pchThumbnailFilename, nWidth, nHeight ); + using var str__pchFilename = new Utf8StringToNative( pchFilename ); + using var str__pchThumbnailFilename = new Utf8StringToNative( pchThumbnailFilename ); + var returnValue = _AddScreenshotToLibrary( Self, str__pchFilename.Pointer, str__pchThumbnailFilename.Pointer, nWidth, nHeight ); return returnValue; } @@ -66,12 +68,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_SetLocation", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetLocation( IntPtr self, ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ); + private static extern bool _SetLocation( IntPtr self, ScreenshotHandle hScreenshot, IntPtr pchLocation ); #endregion - internal bool SetLocation( ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ) + internal bool SetLocation( ScreenshotHandle hScreenshot, string pchLocation ) { - var returnValue = _SetLocation( Self, hScreenshot, pchLocation ); + using var str__pchLocation = new Utf8StringToNative( pchLocation ); + var returnValue = _SetLocation( Self, hScreenshot, str__pchLocation.Pointer ); return returnValue; } @@ -113,12 +116,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary", CallingConvention = Platform.CC)] - private static extern ScreenshotHandle _AddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ); + private static extern ScreenshotHandle _AddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, IntPtr pchFilename, IntPtr pchVRFilename ); #endregion - internal ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ) + internal ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType, string pchFilename, string pchVRFilename ) { - var returnValue = _AddVRScreenshotToLibrary( Self, eType, pchFilename, pchVRFilename ); + using var str__pchFilename = new Utf8StringToNative( pchFilename ); + using var str__pchVRFilename = new Utf8StringToNative( pchVRFilename ); + var returnValue = _AddVRScreenshotToLibrary( Self, eType, str__pchFilename.Pointer, str__pchVRFilename.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamTimeline.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamTimeline.cs index 16bc516..8be80a7 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamTimeline.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamTimeline.cs @@ -23,12 +23,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_SetTimelineTooltip", CallingConvention = Platform.CC)] - private static extern void _SetTimelineTooltip( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, float flTimeDelta ); + private static extern void _SetTimelineTooltip( IntPtr self, IntPtr pchDescription, float flTimeDelta ); #endregion - internal void SetTimelineTooltip( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, float flTimeDelta ) + internal void SetTimelineTooltip( string pchDescription, float flTimeDelta ) { - _SetTimelineTooltip( Self, pchDescription, flTimeDelta ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + _SetTimelineTooltip( Self, str__pchDescription.Pointer, flTimeDelta ); } #region FunctionMeta @@ -53,45 +54,57 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent", CallingConvention = Platform.CC)] - private static extern TimelineEventHandle _AddInstantaneousTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ); + private static extern TimelineEventHandle _AddInstantaneousTimelineEvent( IntPtr self, IntPtr pchTitle, IntPtr pchDescription, IntPtr pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ); #endregion - internal TimelineEventHandle AddInstantaneousTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ) + internal TimelineEventHandle AddInstantaneousTimelineEvent( string pchTitle, string pchDescription, string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ) { - var returnValue = _AddInstantaneousTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip ); + using var str__pchTitle = new Utf8StringToNative( pchTitle ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + using var str__pchIcon = new Utf8StringToNative( pchIcon ); + var returnValue = _AddInstantaneousTimelineEvent( Self, str__pchTitle.Pointer, str__pchDescription.Pointer, str__pchIcon.Pointer, unIconPriority, flStartOffsetSeconds, ePossibleClip ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddRangeTimelineEvent", CallingConvention = Platform.CC)] - private static extern TimelineEventHandle _AddRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip ); + private static extern TimelineEventHandle _AddRangeTimelineEvent( IntPtr self, IntPtr pchTitle, IntPtr pchDescription, IntPtr pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip ); #endregion - internal TimelineEventHandle AddRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip ) + internal TimelineEventHandle AddRangeTimelineEvent( string pchTitle, string pchDescription, string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip ) { - var returnValue = _AddRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip ); + using var str__pchTitle = new Utf8StringToNative( pchTitle ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + using var str__pchIcon = new Utf8StringToNative( pchIcon ); + var returnValue = _AddRangeTimelineEvent( Self, str__pchTitle.Pointer, str__pchDescription.Pointer, str__pchIcon.Pointer, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_StartRangeTimelineEvent", CallingConvention = Platform.CC)] - private static extern TimelineEventHandle _StartRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ); + private static extern TimelineEventHandle _StartRangeTimelineEvent( IntPtr self, IntPtr pchTitle, IntPtr pchDescription, IntPtr pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ); #endregion - internal TimelineEventHandle StartRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ) + internal TimelineEventHandle StartRangeTimelineEvent( string pchTitle, string pchDescription, string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip ) { - var returnValue = _StartRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unPriority, flStartOffsetSeconds, ePossibleClip ); + using var str__pchTitle = new Utf8StringToNative( pchTitle ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + using var str__pchIcon = new Utf8StringToNative( pchIcon ); + var returnValue = _StartRangeTimelineEvent( Self, str__pchTitle.Pointer, str__pchDescription.Pointer, str__pchIcon.Pointer, unPriority, flStartOffsetSeconds, ePossibleClip ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent", CallingConvention = Platform.CC)] - private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip ); + private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, IntPtr pchTitle, IntPtr pchDescription, IntPtr pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip ); #endregion - internal void UpdateRangeTimelineEvent( TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip ) + internal void UpdateRangeTimelineEvent( TimelineEventHandle ulEvent, string pchTitle, string pchDescription, string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip ) { - _UpdateRangeTimelineEvent( Self, ulEvent, pchTitle, pchDescription, pchIcon, unPriority, ePossibleClip ); + using var str__pchTitle = new Utf8StringToNative( pchTitle ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + using var str__pchIcon = new Utf8StringToNative( pchIcon ); + _UpdateRangeTimelineEvent( Self, ulEvent, str__pchTitle.Pointer, str__pchDescription.Pointer, str__pchIcon.Pointer, unPriority, ePossibleClip ); } #region FunctionMeta @@ -147,53 +160,61 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_SetGamePhaseID", CallingConvention = Platform.CC)] - private static extern void _SetGamePhaseID( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ); + private static extern void _SetGamePhaseID( IntPtr self, IntPtr pchPhaseID ); #endregion - internal void SetGamePhaseID( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ) + internal void SetGamePhaseID( string pchPhaseID ) { - _SetGamePhaseID( Self, pchPhaseID ); + using var str__pchPhaseID = new Utf8StringToNative( pchPhaseID ); + _SetGamePhaseID( Self, str__pchPhaseID.Pointer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_DoesGamePhaseRecordingExist", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _DoesGamePhaseRecordingExist( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ); + private static extern SteamAPICall_t _DoesGamePhaseRecordingExist( IntPtr self, IntPtr pchPhaseID ); #endregion - internal CallResult DoesGamePhaseRecordingExist( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ) + internal CallResult DoesGamePhaseRecordingExist( string pchPhaseID ) { - var returnValue = _DoesGamePhaseRecordingExist( Self, pchPhaseID ); + using var str__pchPhaseID = new Utf8StringToNative( pchPhaseID ); + var returnValue = _DoesGamePhaseRecordingExist( Self, str__pchPhaseID.Pointer ); return new CallResult( returnValue, IsServer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddGamePhaseTag", CallingConvention = Platform.CC)] - private static extern void _AddGamePhaseTag( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagIcon, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagGroup, uint unPriority ); + private static extern void _AddGamePhaseTag( IntPtr self, IntPtr pchTagName, IntPtr pchTagIcon, IntPtr pchTagGroup, uint unPriority ); #endregion - internal void AddGamePhaseTag( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagIcon, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTagGroup, uint unPriority ) + internal void AddGamePhaseTag( string pchTagName, string pchTagIcon, string pchTagGroup, uint unPriority ) { - _AddGamePhaseTag( Self, pchTagName, pchTagIcon, pchTagGroup, unPriority ); + using var str__pchTagName = new Utf8StringToNative( pchTagName ); + using var str__pchTagIcon = new Utf8StringToNative( pchTagIcon ); + using var str__pchTagGroup = new Utf8StringToNative( pchTagGroup ); + _AddGamePhaseTag( Self, str__pchTagName.Pointer, str__pchTagIcon.Pointer, str__pchTagGroup.Pointer, unPriority ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_SetGamePhaseAttribute", CallingConvention = Platform.CC)] - private static extern void _SetGamePhaseAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAttributeGroup, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAttributeValue, uint unPriority ); + private static extern void _SetGamePhaseAttribute( IntPtr self, IntPtr pchAttributeGroup, IntPtr pchAttributeValue, uint unPriority ); #endregion - internal void SetGamePhaseAttribute( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAttributeGroup, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAttributeValue, uint unPriority ) + internal void SetGamePhaseAttribute( string pchAttributeGroup, string pchAttributeValue, uint unPriority ) { - _SetGamePhaseAttribute( Self, pchAttributeGroup, pchAttributeValue, unPriority ); + using var str__pchAttributeGroup = new Utf8StringToNative( pchAttributeGroup ); + using var str__pchAttributeValue = new Utf8StringToNative( pchAttributeValue ); + _SetGamePhaseAttribute( Self, str__pchAttributeGroup.Pointer, str__pchAttributeValue.Pointer, unPriority ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_OpenOverlayToGamePhase", CallingConvention = Platform.CC)] - private static extern void _OpenOverlayToGamePhase( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ); + private static extern void _OpenOverlayToGamePhase( IntPtr self, IntPtr pchPhaseID ); #endregion - internal void OpenOverlayToGamePhase( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPhaseID ) + internal void OpenOverlayToGamePhase( string pchPhaseID ) { - _OpenOverlayToGamePhase( Self, pchPhaseID ); + using var str__pchPhaseID = new Utf8StringToNative( pchPhaseID ); + _OpenOverlayToGamePhase( Self, str__pchPhaseID.Pointer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index 1866b4d..f7f69a4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -48,12 +48,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor", CallingConvention = Platform.CC)] - private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ); + private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, IntPtr pchCursor ); #endregion - internal UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ) + internal UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, string pchCursor ) { - var returnValue = _CreateQueryAllUGCRequest( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor ); + using var str__pchCursor = new Utf8StringToNative( pchCursor ); + var returnValue = _CreateQueryAllUGCRequest( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, str__pchCursor.Pointer ); return returnValue; } @@ -110,9 +111,9 @@ namespace Steamworks #endregion internal bool GetQueryUGCTag( UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue ) { - using var mempchValue = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCTag( Self, handle, index, indexTag, mempchValue, (1024 * 32) ); - pchValue = Helpers.MemoryToString( mempchValue ); + using var mem__pchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCTag( Self, handle, index, indexTag, mem__pchValue, (1024 * 32) ); + pchValue = Helpers.MemoryToString( mem__pchValue ); return returnValue; } @@ -124,9 +125,9 @@ namespace Steamworks #endregion internal bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue ) { - using var mempchValue = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCTagDisplayName( Self, handle, index, indexTag, mempchValue, (1024 * 32) ); - pchValue = Helpers.MemoryToString( mempchValue ); + using var mem__pchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCTagDisplayName( Self, handle, index, indexTag, mem__pchValue, (1024 * 32) ); + pchValue = Helpers.MemoryToString( mem__pchValue ); return returnValue; } @@ -138,9 +139,9 @@ namespace Steamworks #endregion internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out string pchURL ) { - using var mempchURL = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCPreviewURL( Self, handle, index, mempchURL, (1024 * 32) ); - pchURL = Helpers.MemoryToString( mempchURL ); + using var mem__pchURL = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCPreviewURL( Self, handle, index, mem__pchURL, (1024 * 32) ); + pchURL = Helpers.MemoryToString( mem__pchURL ); return returnValue; } @@ -152,9 +153,9 @@ namespace Steamworks #endregion internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out string pchMetadata ) { - using var mempchMetadata = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCMetadata( Self, handle, index, mempchMetadata, (1024 * 32) ); - pchMetadata = Helpers.MemoryToString( mempchMetadata ); + using var mem__pchMetadata = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCMetadata( Self, handle, index, mem__pchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mem__pchMetadata ); return returnValue; } @@ -201,11 +202,11 @@ namespace Steamworks #endregion internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, out string pchOriginalFileName, ref ItemPreviewType pPreviewType ) { - using var mempchURLOrVideoID = Helpers.TakeMemory(); - using var mempchOriginalFileName = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCAdditionalPreview( Self, handle, index, previewIndex, mempchURLOrVideoID, (1024 * 32), mempchOriginalFileName, (1024 * 32), ref pPreviewType ); - pchURLOrVideoID = Helpers.MemoryToString( mempchURLOrVideoID ); - pchOriginalFileName = Helpers.MemoryToString( mempchOriginalFileName ); + using var mem__pchURLOrVideoID = Helpers.TakeMemory(); + using var mem__pchOriginalFileName = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCAdditionalPreview( Self, handle, index, previewIndex, mem__pchURLOrVideoID, (1024 * 32), mem__pchOriginalFileName, (1024 * 32), ref pPreviewType ); + pchURLOrVideoID = Helpers.MemoryToString( mem__pchURLOrVideoID ); + pchOriginalFileName = Helpers.MemoryToString( mem__pchOriginalFileName ); return returnValue; } @@ -228,25 +229,26 @@ namespace Steamworks #endregion internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, out string pchValue ) { - using var mempchKey = Helpers.TakeMemory(); - using var mempchValue = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, keyValueTagIndex, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); - pchKey = Helpers.MemoryToString( mempchKey ); - pchValue = Helpers.MemoryToString( mempchValue ); + using var mem__pchKey = Helpers.TakeMemory(); + using var mem__pchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, keyValueTagIndex, mem__pchKey, (1024 * 32), mem__pchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mem__pchKey ); + pchValue = Helpers.MemoryToString( mem__pchValue ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, IntPtr pchValue, uint cchValueSize ); + private static extern bool _GetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchKey, IntPtr pchValue, uint cchValueSize ); #endregion - internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, out string pchValue ) + internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, string pchKey, out string pchValue ) { - using var mempchValue = Helpers.TakeMemory(); - var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, pchKey, mempchValue, (1024 * 32) ); - pchValue = Helpers.MemoryToString( mempchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var mem__pchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, str__pchKey.Pointer, mem__pchValue, (1024 * 32) ); + pchValue = Helpers.MemoryToString( mem__pchValue ); return returnValue; } @@ -269,11 +271,11 @@ namespace Steamworks #endregion internal bool GetSupportedGameVersionData( UGCQueryHandle_t handle, uint index, uint versionIndex, out string pchGameBranchMin, out string pchGameBranchMax ) { - using var mempchGameBranchMin = Helpers.TakeMemory(); - using var mempchGameBranchMax = Helpers.TakeMemory(); - var returnValue = _GetSupportedGameVersionData( Self, handle, index, versionIndex, mempchGameBranchMin, mempchGameBranchMax, (1024 * 32) ); - pchGameBranchMin = Helpers.MemoryToString( mempchGameBranchMin ); - pchGameBranchMax = Helpers.MemoryToString( mempchGameBranchMax ); + using var mem__pchGameBranchMin = Helpers.TakeMemory(); + using var mem__pchGameBranchMax = Helpers.TakeMemory(); + var returnValue = _GetSupportedGameVersionData( Self, handle, index, versionIndex, mem__pchGameBranchMin, mem__pchGameBranchMax, (1024 * 32) ); + pchGameBranchMin = Helpers.MemoryToString( mem__pchGameBranchMin ); + pchGameBranchMax = Helpers.MemoryToString( mem__pchGameBranchMax ); return returnValue; } @@ -303,12 +305,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTag", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddRequiredTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + private static extern bool _AddRequiredTag( IntPtr self, UGCQueryHandle_t handle, IntPtr pTagName ); #endregion - internal bool AddRequiredTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + internal bool AddRequiredTag( UGCQueryHandle_t handle, string pTagName ) { - var returnValue = _AddRequiredTag( Self, handle, pTagName ); + using var str__pTagName = new Utf8StringToNative( pTagName ); + var returnValue = _AddRequiredTag( Self, handle, str__pTagName.Pointer ); return returnValue; } @@ -327,12 +330,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddExcludedTag", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddExcludedTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + private static extern bool _AddExcludedTag( IntPtr self, UGCQueryHandle_t handle, IntPtr pTagName ); #endregion - internal bool AddExcludedTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + internal bool AddExcludedTag( UGCQueryHandle_t handle, string pTagName ) { - var returnValue = _AddExcludedTag( Self, handle, pTagName ); + using var str__pTagName = new Utf8StringToNative( pTagName ); + var returnValue = _AddExcludedTag( Self, handle, str__pTagName.Pointer ); return returnValue; } @@ -435,12 +439,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetLanguage", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetLanguage( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + private static extern bool _SetLanguage( IntPtr self, UGCQueryHandle_t handle, IntPtr pchLanguage ); #endregion - internal bool SetLanguage( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + internal bool SetLanguage( UGCQueryHandle_t handle, string pchLanguage ) { - var returnValue = _SetLanguage( Self, handle, pchLanguage ); + using var str__pchLanguage = new Utf8StringToNative( pchLanguage ); + var returnValue = _SetLanguage( Self, handle, str__pchLanguage.Pointer ); return returnValue; } @@ -471,12 +476,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetCloudFileNameFilter", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ); + private static extern bool _SetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, IntPtr pMatchCloudFileName ); #endregion - internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ) + internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, string pMatchCloudFileName ) { - var returnValue = _SetCloudFileNameFilter( Self, handle, pMatchCloudFileName ); + using var str__pMatchCloudFileName = new Utf8StringToNative( pMatchCloudFileName ); + var returnValue = _SetCloudFileNameFilter( Self, handle, str__pMatchCloudFileName.Pointer ); return returnValue; } @@ -495,12 +501,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetSearchText", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetSearchText( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ); + private static extern bool _SetSearchText( IntPtr self, UGCQueryHandle_t handle, IntPtr pSearchText ); #endregion - internal bool SetSearchText( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ) + internal bool SetSearchText( UGCQueryHandle_t handle, string pSearchText ) { - var returnValue = _SetSearchText( Self, handle, pSearchText ); + using var str__pSearchText = new Utf8StringToNative( pSearchText ); + var returnValue = _SetSearchText( Self, handle, str__pSearchText.Pointer ); return returnValue; } @@ -543,12 +550,14 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredKeyValueTag", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + private static extern bool _AddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, IntPtr pKey, IntPtr pValue ); #endregion - internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, string pKey, string pValue ) { - var returnValue = _AddRequiredKeyValueTag( Self, handle, pKey, pValue ); + using var str__pKey = new Utf8StringToNative( pKey ); + using var str__pValue = new Utf8StringToNative( pValue ); + var returnValue = _AddRequiredKeyValueTag( Self, handle, str__pKey.Pointer, str__pValue.Pointer ); return returnValue; } @@ -577,48 +586,52 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemTitle", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemTitle( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ); + private static extern bool _SetItemTitle( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchTitle ); #endregion - internal bool SetItemTitle( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ) + internal bool SetItemTitle( UGCUpdateHandle_t handle, string pchTitle ) { - var returnValue = _SetItemTitle( Self, handle, pchTitle ); + using var str__pchTitle = new Utf8StringToNative( pchTitle ); + var returnValue = _SetItemTitle( Self, handle, str__pchTitle.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemDescription", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemDescription( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ); + private static extern bool _SetItemDescription( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchDescription ); #endregion - internal bool SetItemDescription( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ) + internal bool SetItemDescription( UGCUpdateHandle_t handle, string pchDescription ) { - var returnValue = _SetItemDescription( Self, handle, pchDescription ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + var returnValue = _SetItemDescription( Self, handle, str__pchDescription.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemUpdateLanguage", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + private static extern bool _SetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchLanguage ); #endregion - internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, string pchLanguage ) { - var returnValue = _SetItemUpdateLanguage( Self, handle, pchLanguage ); + using var str__pchLanguage = new Utf8StringToNative( pchLanguage ); + var returnValue = _SetItemUpdateLanguage( Self, handle, str__pchLanguage.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemMetadata", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ); + private static extern bool _SetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchMetaData ); #endregion - internal bool SetItemMetadata( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ) + internal bool SetItemMetadata( UGCUpdateHandle_t handle, string pchMetaData ) { - var returnValue = _SetItemMetadata( Self, handle, pchMetaData ); + using var str__pchMetaData = new Utf8StringToNative( pchMetaData ); + var returnValue = _SetItemMetadata( Self, handle, str__pchMetaData.Pointer ); return returnValue; } @@ -649,24 +662,26 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemContent", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemContent( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ); + private static extern bool _SetItemContent( IntPtr self, UGCUpdateHandle_t handle, IntPtr pszContentFolder ); #endregion - internal bool SetItemContent( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ) + internal bool SetItemContent( UGCUpdateHandle_t handle, string pszContentFolder ) { - var returnValue = _SetItemContent( Self, handle, pszContentFolder ); + using var str__pszContentFolder = new Utf8StringToNative( pszContentFolder ); + var returnValue = _SetItemContent( Self, handle, str__pszContentFolder.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetItemPreview( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + private static extern bool _SetItemPreview( IntPtr self, UGCUpdateHandle_t handle, IntPtr pszPreviewFile ); #endregion - internal bool SetItemPreview( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + internal bool SetItemPreview( UGCUpdateHandle_t handle, string pszPreviewFile ) { - var returnValue = _SetItemPreview( Self, handle, pszPreviewFile ); + using var str__pszPreviewFile = new Utf8StringToNative( pszPreviewFile ); + var returnValue = _SetItemPreview( Self, handle, str__pszPreviewFile.Pointer ); return returnValue; } @@ -697,72 +712,79 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _RemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern bool _RemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchKey ); #endregion - internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, string pchKey ) { - var returnValue = _RemoveItemKeyValueTags( Self, handle, pchKey ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _RemoveItemKeyValueTags( Self, handle, str__pchKey.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private static extern bool _AddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchKey, IntPtr pchValue ); #endregion - internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, string pchKey, string pchValue ) { - var returnValue = _AddItemKeyValueTag( Self, handle, pchKey, pchValue ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + using var str__pchValue = new Utf8StringToNative( pchValue ); + var returnValue = _AddItemKeyValueTag( Self, handle, str__pchKey.Pointer, str__pchValue.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewFile", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ); + private static extern bool _AddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, IntPtr pszPreviewFile, ItemPreviewType type ); #endregion - internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ) + internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, string pszPreviewFile, ItemPreviewType type ) { - var returnValue = _AddItemPreviewFile( Self, handle, pszPreviewFile, type ); + using var str__pszPreviewFile = new Utf8StringToNative( pszPreviewFile ); + var returnValue = _AddItemPreviewFile( Self, handle, str__pszPreviewFile.Pointer, type ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewVideo", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _AddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + private static extern bool _AddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, IntPtr pszVideoID ); #endregion - internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, string pszVideoID ) { - var returnValue = _AddItemPreviewVideo( Self, handle, pszVideoID ); + using var str__pszVideoID = new Utf8StringToNative( pszVideoID ); + var returnValue = _AddItemPreviewVideo( Self, handle, str__pszVideoID.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewFile", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _UpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + private static extern bool _UpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, IntPtr pszPreviewFile ); #endregion - internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, string pszPreviewFile ) { - var returnValue = _UpdateItemPreviewFile( Self, handle, index, pszPreviewFile ); + using var str__pszPreviewFile = new Utf8StringToNative( pszPreviewFile ); + var returnValue = _UpdateItemPreviewFile( Self, handle, index, str__pszPreviewFile.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewVideo", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _UpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + private static extern bool _UpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, IntPtr pszVideoID ); #endregion - internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, string pszVideoID ) { - var returnValue = _UpdateItemPreviewVideo( Self, handle, index, pszVideoID ); + using var str__pszVideoID = new Utf8StringToNative( pszVideoID ); + var returnValue = _UpdateItemPreviewVideo( Self, handle, index, str__pszVideoID.Pointer ); return returnValue; } @@ -805,23 +827,26 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetRequiredGameVersions", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetRequiredGameVersions( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameBranchMin, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameBranchMax ); + private static extern bool _SetRequiredGameVersions( IntPtr self, UGCUpdateHandle_t handle, IntPtr pszGameBranchMin, IntPtr pszGameBranchMax ); #endregion - internal bool SetRequiredGameVersions( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameBranchMin, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameBranchMax ) + internal bool SetRequiredGameVersions( UGCUpdateHandle_t handle, string pszGameBranchMin, string pszGameBranchMax ) { - var returnValue = _SetRequiredGameVersions( Self, handle, pszGameBranchMin, pszGameBranchMax ); + using var str__pszGameBranchMin = new Utf8StringToNative( pszGameBranchMin ); + using var str__pszGameBranchMax = new Utf8StringToNative( pszGameBranchMax ); + var returnValue = _SetRequiredGameVersions( Self, handle, str__pszGameBranchMin.Pointer, str__pszGameBranchMax.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); + private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, IntPtr pchChangeNote ); #endregion - internal CallResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) + internal CallResult SubmitItemUpdate( UGCUpdateHandle_t handle, string pchChangeNote ) { - var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); + using var str__pchChangeNote = new Utf8StringToNative( pchChangeNote ); + var returnValue = _SubmitItemUpdate( Self, handle, str__pchChangeNote.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -943,9 +968,9 @@ namespace Steamworks #endregion internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, out string pchFolder, ref uint punTimeStamp ) { - using var mempchFolder = Helpers.TakeMemory(); - var returnValue = _GetItemInstallInfo( Self, nPublishedFileID, ref punSizeOnDisk, mempchFolder, (1024 * 32), ref punTimeStamp ); - pchFolder = Helpers.MemoryToString( mempchFolder ); + using var mem__pchFolder = Helpers.TakeMemory(); + var returnValue = _GetItemInstallInfo( Self, nPublishedFileID, ref punSizeOnDisk, mem__pchFolder, (1024 * 32), ref punTimeStamp ); + pchFolder = Helpers.MemoryToString( mem__pchFolder ); return returnValue; } @@ -976,12 +1001,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_BInitWorkshopForGameServer", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _BInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ); + private static extern bool _BInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, IntPtr pszFolder ); #endregion - internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ) + internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, string pszFolder ) { - var returnValue = _BInitWorkshopForGameServer( Self, unWorkshopDepotID, pszFolder ); + using var str__pszFolder = new Utf8StringToNative( pszFolder ); + var returnValue = _BInitWorkshopForGameServer( Self, unWorkshopDepotID, str__pszFolder.Pointer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs index 3b8f1f0..5325c61 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -78,12 +78,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_TrackAppUsageEvent", CallingConvention = Platform.CC)] - private static extern void _TrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ); + private static extern void _TrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, IntPtr pchExtraInfo ); #endregion - internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ) + internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, string pchExtraInfo ) { - _TrackAppUsageEvent( Self, gameID, eAppUsageEvent, pchExtraInfo ); + using var str__pchExtraInfo = new Utf8StringToNative( pchExtraInfo ); + _TrackAppUsageEvent( Self, gameID, eAppUsageEvent, str__pchExtraInfo.Pointer ); } #region FunctionMeta @@ -94,9 +95,9 @@ namespace Steamworks #endregion internal bool GetUserDataFolder( out string pchBuffer ) { - using var mempchBuffer = Helpers.TakeMemory(); - var returnValue = _GetUserDataFolder( Self, mempchBuffer, (1024 * 32) ); - pchBuffer = Helpers.MemoryToString( mempchBuffer ); + using var mem__pchBuffer = Helpers.TakeMemory(); + var returnValue = _GetUserDataFolder( Self, mem__pchBuffer, (1024 * 32) ); + pchBuffer = Helpers.MemoryToString( mem__pchBuffer ); return returnValue; } @@ -177,12 +178,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAuthTicketForWebApi", CallingConvention = Platform.CC)] - private static extern HAuthTicket _GetAuthTicketForWebApi( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIdentity ); + private static extern HAuthTicket _GetAuthTicketForWebApi( IntPtr self, IntPtr pchIdentity ); #endregion - internal HAuthTicket GetAuthTicketForWebApi( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIdentity ) + internal HAuthTicket GetAuthTicketForWebApi( string pchIdentity ) { - var returnValue = _GetAuthTicketForWebApi( Self, pchIdentity ); + using var str__pchIdentity = new Utf8StringToNative( pchIdentity ); + var returnValue = _GetAuthTicketForWebApi( Self, str__pchIdentity.Pointer ); return returnValue; } @@ -297,12 +299,13 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_RequestStoreAuthURL", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); + private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, IntPtr pchRedirectURL ); #endregion - internal CallResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) + internal CallResult RequestStoreAuthURL( string pchRedirectURL ) { - var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); + using var str__pchRedirectURL = new Utf8StringToNative( pchRedirectURL ); + var returnValue = _RequestStoreAuthURL( Self, str__pchRedirectURL.Pointer ); return new CallResult( returnValue, IsServer ); } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs index 4cd5382..9dc4bfd 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -24,108 +24,117 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStatInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private static extern bool _GetStat( IntPtr self, IntPtr pchName, ref int pData ); #endregion - internal bool GetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetStat( string pchName, ref int pData ) { - var returnValue = _GetStat( Self, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetStat( Self, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStatFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private static extern bool _GetStat( IntPtr self, IntPtr pchName, ref float pData ); #endregion - internal bool GetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetStat( string pchName, ref float pData ) { - var returnValue = _GetStat( Self, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetStat( Self, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStatInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + private static extern bool _SetStat( IntPtr self, IntPtr pchName, int nData ); #endregion - internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + internal bool SetStat( string pchName, int nData ) { - var returnValue = _SetStat( Self, pchName, nData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetStat( Self, str__pchName.Pointer, nData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStatFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + private static extern bool _SetStat( IntPtr self, IntPtr pchName, float fData ); #endregion - internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + internal bool SetStat( string pchName, float fData ) { - var returnValue = _SetStat( Self, pchName, fData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetStat( Self, str__pchName.Pointer, fData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UpdateAvgRateStat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _UpdateAvgRateStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + private static extern bool _UpdateAvgRateStat( IntPtr self, IntPtr pchName, float flCountThisSession, double dSessionLength ); #endregion - internal bool UpdateAvgRateStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + internal bool UpdateAvgRateStat( string pchName, float flCountThisSession, double dSessionLength ) { - var returnValue = _UpdateAvgRateStat( Self, pchName, flCountThisSession, dSessionLength ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _UpdateAvgRateStat( Self, str__pchName.Pointer, flCountThisSession, dSessionLength ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private static extern bool _GetAchievement( IntPtr self, IntPtr pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion - internal bool GetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + internal bool GetAchievement( string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) { - var returnValue = _GetAchievement( Self, pchName, ref pbAchieved ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievement( Self, str__pchName.Pointer, ref pbAchieved ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern bool _SetAchievement( IntPtr self, IntPtr pchName ); #endregion - internal bool SetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal bool SetAchievement( string pchName ) { - var returnValue = _SetAchievement( Self, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _SetAchievement( Self, str__pchName.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_ClearAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _ClearAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern bool _ClearAchievement( IntPtr self, IntPtr pchName ); #endregion - internal bool ClearAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal bool ClearAchievement( string pchName ) { - var returnValue = _ClearAchievement( Self, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _ClearAchievement( Self, str__pchName.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetAchievementAndUnlockTime( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + private static extern bool _GetAchievementAndUnlockTime( IntPtr self, IntPtr pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); #endregion - internal bool GetAchievementAndUnlockTime( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + internal bool GetAchievementAndUnlockTime( string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) { - var returnValue = _GetAchievementAndUnlockTime( Self, pchName, ref pbAchieved, ref punUnlockTime ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievementAndUnlockTime( Self, str__pchName.Pointer, ref pbAchieved, ref punUnlockTime ); return returnValue; } @@ -143,35 +152,39 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementIcon", CallingConvention = Platform.CC)] - private static extern int _GetAchievementIcon( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private static extern int _GetAchievementIcon( IntPtr self, IntPtr pchName ); #endregion - internal int GetAchievementIcon( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + internal int GetAchievementIcon( string pchName ) { - var returnValue = _GetAchievementIcon( Self, pchName ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievementIcon( Self, str__pchName.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute", CallingConvention = Platform.CC)] - private static extern Utf8StringPointer _GetAchievementDisplayAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private static extern Utf8StringPointer _GetAchievementDisplayAttribute( IntPtr self, IntPtr pchName, IntPtr pchKey ); #endregion - internal string GetAchievementDisplayAttribute( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + internal string GetAchievementDisplayAttribute( string pchName, string pchKey ) { - var returnValue = _GetAchievementDisplayAttribute( Self, pchName, pchKey ); + using var str__pchName = new Utf8StringToNative( pchName ); + using var str__pchKey = new Utf8StringToNative( pchKey ); + var returnValue = _GetAchievementDisplayAttribute( Self, str__pchName.Pointer, str__pchKey.Pointer ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_IndicateAchievementProgress", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _IndicateAchievementProgress( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ); + private static extern bool _IndicateAchievementProgress( IntPtr self, IntPtr pchName, uint nCurProgress, uint nMaxProgress ); #endregion - internal bool IndicateAchievementProgress( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ) + internal bool IndicateAchievementProgress( string pchName, uint nCurProgress, uint nMaxProgress ) { - var returnValue = _IndicateAchievementProgress( Self, pchName, nCurProgress, nMaxProgress ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _IndicateAchievementProgress( Self, str__pchName.Pointer, nCurProgress, nMaxProgress ); return returnValue; } @@ -211,48 +224,52 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, ref int pData ); #endregion - internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetUserStat( SteamId steamIDUser, string pchName, ref int pData ) { - var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserStat( Self, steamIDUser, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, IntPtr pchName, ref float pData ); #endregion - internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetUserStat( SteamId steamIDUser, string pchName, ref float pData ) { - var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserStat( Self, steamIDUser, str__pchName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievement", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, IntPtr pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion - internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + internal bool GetUserAchievement( SteamId steamIDUser, string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) { - var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserAchievement( Self, steamIDUser, str__pchName.Pointer, ref pbAchieved ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + private static extern bool _GetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, IntPtr pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); #endregion - internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) { - var returnValue = _GetUserAchievementAndUnlockTime( Self, steamIDUser, pchName, ref pbAchieved, ref punUnlockTime ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetUserAchievementAndUnlockTime( Self, steamIDUser, str__pchName.Pointer, ref pbAchieved, ref punUnlockTime ); return returnValue; } @@ -270,23 +287,25 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); + private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, IntPtr pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); #endregion - internal CallResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) + internal CallResult FindOrCreateLeaderboard( string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) { - var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); + using var str__pchLeaderboardName = new Utf8StringToNative( pchLeaderboardName ); + var returnValue = _FindOrCreateLeaderboard( Self, str__pchLeaderboardName.Pointer, eLeaderboardSortMethod, eLeaderboardDisplayType ); return new CallResult( returnValue, IsServer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindLeaderboard", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); + private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, IntPtr pchLeaderboardName ); #endregion - internal CallResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) + internal CallResult FindLeaderboard( string pchLeaderboardName ) { - var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); + using var str__pchLeaderboardName = new Utf8StringToNative( pchLeaderboardName ); + var returnValue = _FindLeaderboard( Self, str__pchLeaderboardName.Pointer ); return new CallResult( returnValue, IsServer ); } @@ -419,9 +438,9 @@ namespace Steamworks #endregion internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) { - using var mempchName = Helpers.TakeMemory(); - var returnValue = _GetMostAchievedAchievementInfo( Self, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); - pchName = Helpers.MemoryToString( mempchName ); + using var mem__pchName = Helpers.TakeMemory(); + var returnValue = _GetMostAchievedAchievementInfo( Self, mem__pchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mem__pchName ); return returnValue; } @@ -432,21 +451,22 @@ namespace Steamworks #endregion internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) { - using var mempchName = Helpers.TakeMemory(); - var returnValue = _GetNextMostAchievedAchievementInfo( Self, iIteratorPrevious, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); - pchName = Helpers.MemoryToString( mempchName ); + using var mem__pchName = Helpers.TakeMemory(); + var returnValue = _GetNextMostAchievedAchievementInfo( Self, iIteratorPrevious, mem__pchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mem__pchName ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetAchievementAchievedPercent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ); + private static extern bool _GetAchievementAchievedPercent( IntPtr self, IntPtr pchName, ref float pflPercent ); #endregion - internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ) + internal bool GetAchievementAchievedPercent( string pchName, ref float pflPercent ) { - var returnValue = _GetAchievementAchievedPercent( Self, pchName, ref pflPercent ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievementAchievedPercent( Self, str__pchName.Pointer, ref pflPercent ); return returnValue; } @@ -464,70 +484,76 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatInt64", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetGlobalStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ); + private static extern bool _GetGlobalStat( IntPtr self, IntPtr pchStatName, ref long pData ); #endregion - internal bool GetGlobalStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ) + internal bool GetGlobalStat( string pchStatName, ref long pData ) { - var returnValue = _GetGlobalStat( Self, pchStatName, ref pData ); + using var str__pchStatName = new Utf8StringToNative( pchStatName ); + var returnValue = _GetGlobalStat( Self, str__pchStatName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatDouble", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetGlobalStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ); + private static extern bool _GetGlobalStat( IntPtr self, IntPtr pchStatName, ref double pData ); #endregion - internal bool GetGlobalStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ) + internal bool GetGlobalStat( string pchStatName, ref double pData ) { - var returnValue = _GetGlobalStat( Self, pchStatName, ref pData ); + using var str__pchStatName = new Utf8StringToNative( pchStatName ); + var returnValue = _GetGlobalStat( Self, str__pchStatName.Pointer, ref pData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryInt64", CallingConvention = Platform.CC)] - private static extern int _GetGlobalStatHistory( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ); + private static extern int _GetGlobalStatHistory( IntPtr self, IntPtr pchStatName, [In,Out] long[] pData, uint cubData ); #endregion - internal int GetGlobalStatHistory( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ) + internal int GetGlobalStatHistory( string pchStatName, [In,Out] long[] pData, uint cubData ) { - var returnValue = _GetGlobalStatHistory( Self, pchStatName, pData, cubData ); + using var str__pchStatName = new Utf8StringToNative( pchStatName ); + var returnValue = _GetGlobalStatHistory( Self, str__pchStatName.Pointer, pData, cubData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryDouble", CallingConvention = Platform.CC)] - private static extern int _GetGlobalStatHistory( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ); + private static extern int _GetGlobalStatHistory( IntPtr self, IntPtr pchStatName, [In,Out] double[] pData, uint cubData ); #endregion - internal int GetGlobalStatHistory( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ) + internal int GetGlobalStatHistory( string pchStatName, [In,Out] double[] pData, uint cubData ) { - var returnValue = _GetGlobalStatHistory( Self, pchStatName, pData, cubData ); + using var str__pchStatName = new Utf8StringToNative( pchStatName ); + var returnValue = _GetGlobalStatHistory( Self, str__pchStatName.Pointer, pData, cubData ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementProgressLimitsInt32", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetAchievementProgressLimits( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pnMinProgress, ref int pnMaxProgress ); + private static extern bool _GetAchievementProgressLimits( IntPtr self, IntPtr pchName, ref int pnMinProgress, ref int pnMaxProgress ); #endregion - internal bool GetAchievementProgressLimits( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pnMinProgress, ref int pnMaxProgress ) + internal bool GetAchievementProgressLimits( string pchName, ref int pnMinProgress, ref int pnMaxProgress ) { - var returnValue = _GetAchievementProgressLimits( Self, pchName, ref pnMinProgress, ref pnMaxProgress ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievementProgressLimits( Self, str__pchName.Pointer, ref pnMinProgress, ref pnMaxProgress ); return returnValue; } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementProgressLimitsFloat", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _GetAchievementProgressLimits( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pfMinProgress, ref float pfMaxProgress ); + private static extern bool _GetAchievementProgressLimits( IntPtr self, IntPtr pchName, ref float pfMinProgress, ref float pfMaxProgress ); #endregion - internal bool GetAchievementProgressLimits( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pfMinProgress, ref float pfMaxProgress ) + internal bool GetAchievementProgressLimits( string pchName, ref float pfMinProgress, ref float pfMaxProgress ) { - var returnValue = _GetAchievementProgressLimits( Self, pchName, ref pfMinProgress, ref pfMaxProgress ); + using var str__pchName = new Utf8StringToNative( pchName ); + var returnValue = _GetAchievementProgressLimits( Self, str__pchName.Pointer, ref pfMinProgress, ref pfMaxProgress ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs index e99f108..472b7f3 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -217,24 +217,27 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_CheckFileSignature", CallingConvention = Platform.CC)] - private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); + private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, IntPtr szFileName ); #endregion - internal CallResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) + internal CallResult CheckFileSignature( string szFileName ) { - var returnValue = _CheckFileSignature( Self, szFileName ); + using var str__szFileName = new Utf8StringToNative( szFileName ); + var returnValue = _CheckFileSignature( Self, str__szFileName.Pointer ); return new CallResult( returnValue, IsServer ); } #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_ShowGamepadTextInput", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _ShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ); + private static extern bool _ShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, IntPtr pchDescription, uint unCharMax, IntPtr pchExistingText ); #endregion - internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ) + internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText ) { - var returnValue = _ShowGamepadTextInput( Self, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText ); + using var str__pchDescription = new Utf8StringToNative( pchDescription ); + using var str__pchExistingText = new Utf8StringToNative( pchExistingText ); + var returnValue = _ShowGamepadTextInput( Self, eInputMode, eLineInputMode, str__pchDescription.Pointer, unCharMax, str__pchExistingText.Pointer ); return returnValue; } @@ -257,9 +260,9 @@ namespace Steamworks #endregion internal bool GetEnteredGamepadTextInput( out string pchText ) { - using var mempchText = Helpers.TakeMemory(); - var returnValue = _GetEnteredGamepadTextInput( Self, mempchText, (1024 * 32) ); - pchText = Helpers.MemoryToString( mempchText ); + using var mem__pchText = Helpers.TakeMemory(); + var returnValue = _GetEnteredGamepadTextInput( Self, mem__pchText, (1024 * 32) ); + pchText = Helpers.MemoryToString( mem__pchText ); return returnValue; } @@ -366,14 +369,15 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_FilterText", CallingConvention = Platform.CC)] - private static extern int _FilterText( IntPtr self, TextFilteringContext eContext, SteamId sourceSteamID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputMessage, IntPtr pchOutFilteredText, uint nByteSizeOutFilteredText ); + private static extern int _FilterText( IntPtr self, TextFilteringContext eContext, SteamId sourceSteamID, IntPtr pchInputMessage, IntPtr pchOutFilteredText, uint nByteSizeOutFilteredText ); #endregion - internal int FilterText( TextFilteringContext eContext, SteamId sourceSteamID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputMessage, out string pchOutFilteredText ) + internal int FilterText( TextFilteringContext eContext, SteamId sourceSteamID, string pchInputMessage, out string pchOutFilteredText ) { - using var mempchOutFilteredText = Helpers.TakeMemory(); - var returnValue = _FilterText( Self, eContext, sourceSteamID, pchInputMessage, mempchOutFilteredText, (1024 * 32) ); - pchOutFilteredText = Helpers.MemoryToString( mempchOutFilteredText ); + using var str__pchInputMessage = new Utf8StringToNative( pchInputMessage ); + using var mem__pchOutFilteredText = Helpers.TakeMemory(); + var returnValue = _FilterText( Self, eContext, sourceSteamID, str__pchInputMessage.Pointer, mem__pchOutFilteredText, (1024 * 32) ); + pchOutFilteredText = Helpers.MemoryToString( mem__pchOutFilteredText ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs index 028b705..b40b859 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -61,10 +61,10 @@ namespace Steamworks #endregion internal bool GetOPFStringForApp( AppId unVideoAppID, out string pchBuffer ) { - using var mempchBuffer = Helpers.TakeMemory(); + using var mem__pchBuffer = Helpers.TakeMemory(); int szpnBufferSize = (1024 * 32); - var returnValue = _GetOPFStringForApp( Self, unVideoAppID, mempchBuffer, ref szpnBufferSize ); - pchBuffer = Helpers.MemoryToString( mempchBuffer ); + var returnValue = _GetOPFStringForApp( Self, unVideoAppID, mem__pchBuffer, ref szpnBufferSize ); + pchBuffer = Helpers.MemoryToString( mem__pchBuffer ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/SteamCallbacks.cs b/Facepunch.Steamworks/Generated/SteamCallbacks.cs index d9c399d..e674544 100644 --- a/Facepunch.Steamworks/Generated/SteamCallbacks.cs +++ b/Facepunch.Steamworks/Generated/SteamCallbacks.cs @@ -144,7 +144,7 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct GameWebCallback_t : ICallbackData { - internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + internal string URLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szURL internal byte[] URL; // m_szURL char [256] @@ -158,7 +158,7 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct StoreAuthURLResponse_t : ICallbackData { - internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + internal string URLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] // byte[] m_szURL internal byte[] URL; // m_szURL char [512] @@ -254,10 +254,10 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct GameServerChangeRequested_t : ICallbackData { - internal string ServerUTF8() => System.Text.Encoding.UTF8.GetString( Server, 0, System.Array.IndexOf( Server, 0 ) ); + internal string ServerUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Server, 0, System.Array.IndexOf( Server, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchServer internal byte[] Server; // m_rgchServer char [64] - internal string PasswordUTF8() => System.Text.Encoding.UTF8.GetString( Password, 0, System.Array.IndexOf( Password, 0 ) ); + internal string PasswordUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Password, 0, System.Array.IndexOf( Password, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchPassword internal byte[] Password; // m_rgchPassword char [64] @@ -327,7 +327,7 @@ namespace Steamworks.Data internal struct GameRichPresenceJoinRequested_t : ICallbackData { internal ulong SteamIDFriend; // m_steamIDFriend CSteamID - internal string ConnectUTF8() => System.Text.Encoding.UTF8.GetString( Connect, 0, System.Array.IndexOf( Connect, 0 ) ); + internal string ConnectUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Connect, 0, System.Array.IndexOf( Connect, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnect internal byte[] Connect; // m_rgchConnect char [256] @@ -496,7 +496,7 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct OverlayBrowserProtocolNavigation_t : ICallbackData { - internal string RgchURIUTF8() => System.Text.Encoding.UTF8.GetString( RgchURI, 0, System.Array.IndexOf( RgchURI, 0 ) ); + internal string RgchURIUTF8() => Steamworks.Utility.Utf8NoBom.GetString( RgchURI, 0, System.Array.IndexOf( RgchURI, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] // byte[] rgchURI internal byte[] RgchURI; // rgchURI char [1024] @@ -949,7 +949,7 @@ namespace Steamworks.Data internal Result Result; // m_eResult EResult internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t internal ulong SteamIDBeaconOwner; // m_SteamIDBeaconOwner CSteamID - internal string ConnectStringUTF8() => System.Text.Encoding.UTF8.GetString( ConnectString, 0, System.Array.IndexOf( ConnectString, 0 ) ); + internal string ConnectStringUTF8() => Steamworks.Utility.Utf8NoBom.GetString( ConnectString, 0, System.Array.IndexOf( ConnectString, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnectString internal byte[] ConnectString; // m_rgchConnectString char [256] @@ -1025,7 +1025,7 @@ namespace Steamworks.Data { internal Result Result; // m_eResult EResult internal ulong File; // m_hFile UGCHandle_t - internal string FilenameUTF8() => System.Text.Encoding.UTF8.GetString( Filename, 0, System.Array.IndexOf( Filename, 0 ) ); + internal string FilenameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Filename, 0, System.Array.IndexOf( Filename, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchFilename internal byte[] Filename; // m_rgchFilename char [260] @@ -1146,7 +1146,7 @@ namespace Steamworks.Data internal ulong File; // m_hFile UGCHandle_t internal AppId AppID; // m_nAppID AppId_t internal int SizeInBytes; // m_nSizeInBytes int32 - internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + internal string PchFileNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName internal byte[] PchFileName; // m_pchFileName char [260] internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 @@ -1165,10 +1165,10 @@ namespace Steamworks.Data internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId CreatorAppID; // m_nCreatorAppID AppId_t internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t - internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + internal string TitleUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle internal byte[] Title; // m_rgchTitle char [129] - internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + internal string DescriptionUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription internal byte[] Description; // m_rgchDescription char [8000] internal ulong File; // m_hFile UGCHandle_t @@ -1179,17 +1179,17 @@ namespace Steamworks.Data internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility ERemoteStoragePublishedFileVisibility [MarshalAs(UnmanagedType.I1)] internal bool Banned; // m_bBanned bool - internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + internal string TagsUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags internal byte[] Tags; // m_rgchTags char [1025] [MarshalAs(UnmanagedType.I1)] internal bool TagsTruncated; // m_bTagsTruncated bool - internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + internal string PchFileNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName internal byte[] PchFileName; // m_pchFileName char [260] internal int FileSize; // m_nFileSize int32 internal int PreviewFileSize; // m_nPreviewFileSize int32 - internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + internal string URLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL internal byte[] URL; // m_rgchURL char [256] internal WorkshopFileType FileType; // m_eFileType EWorkshopFileType @@ -1454,7 +1454,7 @@ namespace Steamworks.Data internal ulong GameID; // m_nGameID uint64 [MarshalAs(UnmanagedType.I1)] internal bool GroupAchievement; // m_bGroupAchievement bool - internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + internal string AchievementNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName internal byte[] AchievementName; // m_rgchAchievementName char [128] internal uint CurProgress; // m_nCurProgress uint32 @@ -1540,7 +1540,7 @@ namespace Steamworks.Data internal struct UserAchievementIconFetched_t : ICallbackData { internal GameId GameID; // m_nGameID CGameID - internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + internal string AchievementNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName internal byte[] AchievementName; // m_rgchAchievementName char [128] [MarshalAs(UnmanagedType.I1)] @@ -1622,7 +1622,7 @@ namespace Steamworks.Data internal Result Result; // m_eResult EResult internal uint AppID; // m_nAppID uint32 internal uint CchKeyLength; // m_cchKeyLength uint32 - internal string KeyUTF8() => System.Text.Encoding.UTF8.GetString( Key, 0, System.Array.IndexOf( Key, 0 ) ); + internal string KeyUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Key, 0, System.Array.IndexOf( Key, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 240)] // byte[] m_rgchKey internal byte[] Key; // m_rgchKey char [240] @@ -2013,7 +2013,7 @@ namespace Steamworks.Data internal uint TotalMatchingResults; // m_unTotalMatchingResults uint32 [MarshalAs(UnmanagedType.I1)] internal bool CachedData; // m_bCachedData bool - internal string NextCursorUTF8() => System.Text.Encoding.UTF8.GetString( NextCursor, 0, System.Array.IndexOf( NextCursor, 0 ) ); + internal string NextCursorUTF8() => Steamworks.Utility.Utf8NoBom.GetString( NextCursor, 0, System.Array.IndexOf( NextCursor, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchNextCursor internal byte[] NextCursor; // m_rgchNextCursor char [256] @@ -2700,7 +2700,7 @@ namespace Steamworks.Data internal struct SteamInventoryRequestPricesResult_t : ICallbackData { internal Result Result; // m_result EResult - internal string CurrencyUTF8() => System.Text.Encoding.UTF8.GetString( Currency, 0, System.Array.IndexOf( Currency, 0 ) ); + internal string CurrencyUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Currency, 0, System.Array.IndexOf( Currency, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] // byte[] m_rgchCurrency internal byte[] Currency; // m_rgchCurrency char [4] @@ -2714,7 +2714,7 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct SteamTimelineGamePhaseRecordingExists_t : ICallbackData { - internal string PhaseIDUTF8() => System.Text.Encoding.UTF8.GetString( PhaseID, 0, System.Array.IndexOf( PhaseID, 0 ) ); + internal string PhaseIDUTF8() => Steamworks.Utility.Utf8NoBom.GetString( PhaseID, 0, System.Array.IndexOf( PhaseID, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchPhaseID internal byte[] PhaseID; // m_rgchPhaseID char [64] internal ulong RecordingMS; // m_ulRecordingMS uint64 @@ -2748,7 +2748,7 @@ namespace Steamworks.Data { internal Result Result; // m_eResult EResult internal AppId VideoAppID; // m_unVideoAppID AppId_t - internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + internal string URLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL internal byte[] URL; // m_rgchURL char [256] @@ -2835,7 +2835,7 @@ namespace Steamworks.Data [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct SteamRemotePlayTogetherGuestInvite_t : ICallbackData { - internal string ConnectURLUTF8() => System.Text.Encoding.UTF8.GetString( ConnectURL, 0, System.Array.IndexOf( ConnectURL, 0 ) ); + internal string ConnectURLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( ConnectURL, 0, System.Array.IndexOf( ConnectURL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] // byte[] m_szConnectURL internal byte[] ConnectURL; // m_szConnectURL char [1024] @@ -2888,7 +2888,7 @@ namespace Steamworks.Data internal struct SteamNetAuthenticationStatus_t : ICallbackData { internal SteamNetworkingAvailability Avail; // m_eAvail ESteamNetworkingAvailability - internal string DebugMsgUTF8() => System.Text.Encoding.UTF8.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); + internal string DebugMsgUTF8() => Steamworks.Utility.Utf8NoBom.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_debugMsg internal byte[] DebugMsg; // m_debugMsg char [256] @@ -2906,7 +2906,7 @@ namespace Steamworks.Data internal int PingMeasurementInProgress; // m_bPingMeasurementInProgress int internal SteamNetworkingAvailability AvailNetworkConfig; // m_eAvailNetworkConfig ESteamNetworkingAvailability internal SteamNetworkingAvailability AvailAnyRelay; // m_eAvailAnyRelay ESteamNetworkingAvailability - internal string DebugMsgUTF8() => System.Text.Encoding.UTF8.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); + internal string DebugMsgUTF8() => Steamworks.Utility.Utf8NoBom.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_debugMsg internal byte[] DebugMsg; // m_debugMsg char [256] @@ -2935,7 +2935,7 @@ namespace Steamworks.Data { internal ulong SteamID; // m_SteamID CSteamID internal DenyReason DenyReason; // m_eDenyReason EDenyReason - internal string OptionalTextUTF8() => System.Text.Encoding.UTF8.GetString( OptionalText, 0, System.Array.IndexOf( OptionalText, 0 ) ); + internal string OptionalTextUTF8() => Steamworks.Utility.Utf8NoBom.GetString( OptionalText, 0, System.Array.IndexOf( OptionalText, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchOptionalText internal byte[] OptionalText; // m_rgchOptionalText char [128] @@ -2963,7 +2963,7 @@ namespace Steamworks.Data internal struct GSClientAchievementStatus_t : ICallbackData { internal ulong SteamID; // m_SteamID uint64 - internal string PchAchievementUTF8() => System.Text.Encoding.UTF8.GetString( PchAchievement, 0, System.Array.IndexOf( PchAchievement, 0 ) ); + internal string PchAchievementUTF8() => Steamworks.Utility.Utf8NoBom.GetString( PchAchievement, 0, System.Array.IndexOf( PchAchievement, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_pchAchievement internal byte[] PchAchievement; // m_pchAchievement char [128] [MarshalAs(UnmanagedType.I1)] diff --git a/Facepunch.Steamworks/Generated/SteamStructFunctions.cs b/Facepunch.Steamworks/Generated/SteamStructFunctions.cs index c675b22..f407ff9 100644 --- a/Facepunch.Steamworks/Generated/SteamStructFunctions.cs +++ b/Facepunch.Steamworks/Generated/SteamStructFunctions.cs @@ -15,7 +15,7 @@ namespace Steamworks.Data internal static extern Utf8StringPointer InternalGetName( ref gameserveritem_t self ); [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_gameserveritem_t_SetName", CallingConvention = Platform.CC)] - internal static extern void InternalSetName( ref gameserveritem_t self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pName ); + internal static extern void InternalSetName( ref gameserveritem_t self, IntPtr pName ); } @@ -103,7 +103,7 @@ namespace Steamworks.Data internal static extern void InternalSetPtr( ref NetKeyValue self, NetConfig eVal, IntPtr data ); [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingConfigValue_t_SetString", CallingConvention = Platform.CC)] - internal static extern void InternalSetString( ref NetKeyValue self, NetConfig eVal, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string data ); + internal static extern void InternalSetString( ref NetKeyValue self, NetConfig eVal, IntPtr data ); } @@ -130,7 +130,7 @@ namespace Steamworks.Data [return: MarshalAs( UnmanagedType.I1 )] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID", CallingConvention = Platform.CC)] - internal static extern bool InternalSetXboxPairwiseID( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString ); + internal static extern bool InternalSetXboxPairwiseID( ref NetIdentity self, IntPtr pszString ); [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID", CallingConvention = Platform.CC)] internal static extern Utf8StringPointer InternalGetXboxPairwiseID( ref NetIdentity self ); @@ -169,7 +169,7 @@ namespace Steamworks.Data [return: MarshalAs( UnmanagedType.I1 )] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetGenericString", CallingConvention = Platform.CC)] - internal static extern bool InternalSetGenericString( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString ); + internal static extern bool InternalSetGenericString( ref NetIdentity self, IntPtr pszString ); [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetGenericString", CallingConvention = Platform.CC)] internal static extern Utf8StringPointer InternalGetGenericString( ref NetIdentity self ); @@ -190,7 +190,7 @@ namespace Steamworks.Data [return: MarshalAs( UnmanagedType.I1 )] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_ParseString", CallingConvention = Platform.CC)] - internal static extern bool InternalParseString( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + internal static extern bool InternalParseString( ref NetIdentity self, IntPtr pszStr ); } @@ -228,7 +228,7 @@ namespace Steamworks.Data [return: MarshalAs( UnmanagedType.I1 )] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_ParseString", CallingConvention = Platform.CC)] - internal static extern bool InternalParseString( ref NetAddress self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + internal static extern bool InternalParseString( ref NetAddress self, IntPtr pszStr ); [return: MarshalAs( UnmanagedType.I1 )] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_IsEqualTo", CallingConvention = Platform.CC)] diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs index 9aeefde..f431402 100644 --- a/Facepunch.Steamworks/Generated/SteamStructs.cs +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -35,13 +35,13 @@ namespace Steamworks.Data internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse bool [MarshalAs(UnmanagedType.I1)] internal bool DoNotRefresh; // m_bDoNotRefresh bool - internal string GameDirUTF8() => System.Text.Encoding.UTF8.GetString( GameDir, 0, System.Array.IndexOf( GameDir, 0 ) ); + internal string GameDirUTF8() => Steamworks.Utility.Utf8NoBom.GetString( GameDir, 0, System.Array.IndexOf( GameDir, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szGameDir internal byte[] GameDir; // m_szGameDir char [32] - internal string MapUTF8() => System.Text.Encoding.UTF8.GetString( Map, 0, System.Array.IndexOf( Map, 0 ) ); + internal string MapUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Map, 0, System.Array.IndexOf( Map, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szMap internal byte[] Map; // m_szMap char [32] - internal string GameDescriptionUTF8() => System.Text.Encoding.UTF8.GetString( GameDescription, 0, System.Array.IndexOf( GameDescription, 0 ) ); + internal string GameDescriptionUTF8() => Steamworks.Utility.Utf8NoBom.GetString( GameDescription, 0, System.Array.IndexOf( GameDescription, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szGameDescription internal byte[] GameDescription; // m_szGameDescription char [64] internal uint AppID; // m_nAppID uint32 @@ -54,10 +54,10 @@ namespace Steamworks.Data internal bool Secure; // m_bSecure bool internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 internal int ServerVersion; // m_nServerVersion int - internal string ServerNameUTF8() => System.Text.Encoding.UTF8.GetString( ServerName, 0, System.Array.IndexOf( ServerName, 0 ) ); + internal string ServerNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( ServerName, 0, System.Array.IndexOf( ServerName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szServerName internal byte[] ServerName; // m_szServerName char [64] - internal string GameTagsUTF8() => System.Text.Encoding.UTF8.GetString( GameTags, 0, System.Array.IndexOf( GameTags, 0 ) ); + internal string GameTagsUTF8() => Steamworks.Utility.Utf8NoBom.GetString( GameTags, 0, System.Array.IndexOf( GameTags, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_szGameTags internal byte[] GameTags; // m_szGameTags char [128] internal ulong SteamID; // m_steamID CSteamID @@ -122,10 +122,10 @@ namespace Steamworks.Data internal WorkshopFileType FileType; // m_eFileType EWorkshopFileType internal AppId CreatorAppID; // m_nCreatorAppID AppId_t internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t - internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + internal string TitleUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle internal byte[] Title; // m_rgchTitle char [129] - internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + internal string DescriptionUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription internal byte[] Description; // m_rgchDescription char [8000] internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 @@ -139,17 +139,17 @@ namespace Steamworks.Data internal bool AcceptedForUse; // m_bAcceptedForUse bool [MarshalAs(UnmanagedType.I1)] internal bool TagsTruncated; // m_bTagsTruncated bool - internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + internal string TagsUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags internal byte[] Tags; // m_rgchTags char [1025] internal ulong File; // m_hFile UGCHandle_t internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t - internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + internal string PchFileNameUTF8() => Steamworks.Utility.Utf8NoBom.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName internal byte[] PchFileName; // m_pchFileName char [260] internal int FileSize; // m_nFileSize int32 internal int PreviewFileSize; // m_nPreviewFileSize int32 - internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + internal string URLUTF8() => Steamworks.Utility.Utf8NoBom.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL internal byte[] URL; // m_rgchURL char [256] internal uint VotesUp; // m_unVotesUp uint32 @@ -174,7 +174,7 @@ namespace Steamworks.Data internal partial struct SteamDatagramHostedAddress { internal int CbSize; // m_cbSize int - internal string DataUTF8() => System.Text.Encoding.UTF8.GetString( Data, 0, System.Array.IndexOf( Data, 0 ) ); + internal string DataUTF8() => Steamworks.Utility.Utf8NoBom.GetString( Data, 0, System.Array.IndexOf( Data, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_data internal byte[] Data; // m_data char [128] @@ -188,7 +188,7 @@ namespace Steamworks.Data internal AppId AppID; // m_nAppID AppId_t internal uint Time; // m_rtime RTime32 internal int CbAppData; // m_cbAppData int - internal string AppDataUTF8() => System.Text.Encoding.UTF8.GetString( AppData, 0, System.Array.IndexOf( AppData, 0 ) ); + internal string AppDataUTF8() => Steamworks.Utility.Utf8NoBom.GetString( AppData, 0, System.Array.IndexOf( AppData, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2048)] // byte[] m_appData internal byte[] AppData; // m_appData char [2048] diff --git a/Facepunch.Steamworks/Networking/Connection.cs b/Facepunch.Steamworks/Networking/Connection.cs index 9596421..451087f 100644 --- a/Facepunch.Steamworks/Networking/Connection.cs +++ b/Facepunch.Steamworks/Networking/Connection.cs @@ -124,7 +124,7 @@ namespace Steamworks.Data /// public unsafe Result SendMessage( string str, SendType sendType = SendType.Reliable, ushort laneIndex = 0 ) { - var bytes = System.Text.Encoding.UTF8.GetBytes( str ); + var bytes = Utility.Utf8NoBom.GetBytes( str ); return SendMessage( bytes, sendType, laneIndex ); } diff --git a/Facepunch.Steamworks/Networking/ConnectionManager.cs b/Facepunch.Steamworks/Networking/ConnectionManager.cs index 396c8d9..d7e4616 100644 --- a/Facepunch.Steamworks/Networking/ConnectionManager.cs +++ b/Facepunch.Steamworks/Networking/ConnectionManager.cs @@ -245,7 +245,7 @@ namespace Steamworks /// public void SendMessages( Connection[] connections, int connectionCount, string str, SendType sendType = SendType.Reliable, Result[] results = null ) { - var bytes = System.Text.Encoding.UTF8.GetBytes( str ); + var bytes = Utility.Utf8NoBom.GetBytes( str ); SendMessages( connections, connectionCount, bytes, sendType, results ); } @@ -270,4 +270,4 @@ namespace Steamworks Interface?.OnMessage( data, size, messageNum, recvTime, channel ); } } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index c34fcb9..719b176 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -440,7 +440,7 @@ namespace Steamworks internal unsafe static bool SetConfigString( NetConfig type, string value ) { - var bytes = Encoding.UTF8.GetBytes( value ); + var bytes = Utility.Utf8NoBom.GetBytes( value ); fixed ( byte* ptr = bytes ) { @@ -483,7 +483,7 @@ namespace Steamworks internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, string value ) { - var bytes = Encoding.UTF8.GetBytes( value ); + var bytes = Utility.Utf8NoBom.GetBytes( value ); fixed ( byte* ptr = bytes ) { diff --git a/Facepunch.Steamworks/Structs/Lobby.cs b/Facepunch.Steamworks/Structs/Lobby.cs index 0427c23..ad5fb44 100644 --- a/Facepunch.Steamworks/Structs/Lobby.cs +++ b/Facepunch.Steamworks/Structs/Lobby.cs @@ -137,7 +137,7 @@ namespace Steamworks.Data public bool SendChatString( string message ) { //adding null terminator as it's used in Helpers.MemoryToString - var data = System.Text.Encoding.UTF8.GetBytes( message + '\0' ); + var data = Utility.Utf8NoBom.GetBytes( message + '\0' ); return SendChatBytes( data ); } diff --git a/Facepunch.Steamworks/Utility/Helpers.cs b/Facepunch.Steamworks/Utility/Helpers.cs index 1e56c85..0b10cdd 100644 --- a/Facepunch.Steamworks/Utility/Helpers.cs +++ b/Facepunch.Steamworks/Utility/Helpers.cs @@ -97,7 +97,7 @@ namespace Steamworks if ( len == 0 ) return string.Empty; - return UTF8Encoding.UTF8.GetString( (byte*)ptr, len ); + return Utility.Utf8NoBom.GetString( (byte*)ptr, len ); } internal static string BuildVersionString( params string[] interfaceVersions ) diff --git a/Facepunch.Steamworks/Utility/Utf8String.cs b/Facepunch.Steamworks/Utility/Utf8String.cs index 74b101e..01e2dc3 100644 --- a/Facepunch.Steamworks/Utility/Utf8String.cs +++ b/Facepunch.Steamworks/Utility/Utf8String.cs @@ -4,40 +4,39 @@ using System.Text; namespace Steamworks { - internal unsafe class Utf8StringToNative : ICustomMarshaler + internal struct Utf8StringToNative : IDisposable { - internal static readonly Encoding Utf8NoBom = new UTF8Encoding( false, false ); + public IntPtr Pointer { get; private set; } - public IntPtr MarshalManagedToNative(object managedObj) + public unsafe Utf8StringToNative( string value ) { - if ( managedObj == null ) - return IntPtr.Zero; - - if ( managedObj is string str ) + if ( value == null ) { - fixed ( char* strPtr = str ) - { - int len = Utf8NoBom.GetByteCount( str ); - var mem = Marshal.AllocHGlobal( len + 1 ); - - var wlen = Utf8NoBom.GetBytes( strPtr, str.Length, (byte*)mem, len + 1 ); - - ( (byte*)mem )[wlen] = 0; - - return mem; - } + Pointer = IntPtr.Zero; + return; } - return IntPtr.Zero; + fixed ( char* strPtr = value ) + { + var len = Utility.Utf8NoBom.GetByteCount( value ); + var mem = Marshal.AllocHGlobal( len + 1 ); + + var wlen = Utility.Utf8NoBom.GetBytes( strPtr, value.Length, (byte*)mem, len + 1 ); + + ( (byte*)mem )[wlen] = 0; + + Pointer = mem; + } } - public object MarshalNativeToManaged(IntPtr pNativeData) => throw new System.NotImplementedException(); - public void CleanUpNativeData(IntPtr pNativeData) => Marshal.FreeHGlobal( pNativeData ); - public void CleanUpManagedData(object managedObj) => throw new System.NotImplementedException(); - public int GetNativeDataSize() => -1; - - [Preserve] - public static ICustomMarshaler GetInstance(string cookie) => new Utf8StringToNative(); + public void Dispose() + { + if ( Pointer != IntPtr.Zero ) + { + Marshal.FreeHGlobal( Pointer ); + Pointer = IntPtr.Zero; + } + } } internal struct Utf8StringPointer @@ -62,7 +61,7 @@ namespace Steamworks dataLen++; } - return Utf8StringToNative.Utf8NoBom.GetString( bytes, dataLen ); + return Utility.Utf8NoBom.GetString( bytes, dataLen ); } } } diff --git a/Facepunch.Steamworks/Utility/Utility.cs b/Facepunch.Steamworks/Utility/Utility.cs index 3365d2f..e1e8ee8 100644 --- a/Facepunch.Steamworks/Utility/Utility.cs +++ b/Facepunch.Steamworks/Utility/Utility.cs @@ -10,6 +10,8 @@ namespace Steamworks { public static partial class Utility { + public static readonly Encoding Utf8NoBom = new UTF8Encoding( false, false ); + static internal T ToType( this IntPtr ptr ) { if ( ptr == IntPtr.Zero ) @@ -111,7 +113,7 @@ namespace Steamworks i++; } - return Encoding.UTF8.GetString( readBuffer, 0, i ); + return Utf8NoBom.GetString( readBuffer, 0, i ); } } } diff --git a/Generator/CodeWriter/Interface.cs b/Generator/CodeWriter/Interface.cs index 2ed3e5c..e60b540 100644 --- a/Generator/CodeWriter/Interface.cs +++ b/Generator/CodeWriter/Interface.cs @@ -131,9 +131,13 @@ namespace Generator // foreach ( var arg in args ) { - if ( arg is FetchStringType sb ) + if ( arg is ConstCharType str ) { - WriteLine( $"using var mem{sb.VarName} = Helpers.TakeMemory();" ); + WriteLine( $"using var str__{str.VarName} = new Utf8StringToNative( {str.VarName} );" ); + } + else if ( arg is FetchStringType sb ) + { + WriteLine( $"using var mem__{sb.VarName} = Helpers.TakeMemory();" ); } else if ( arg is LiteralType literal && literal.IsOutValue ) { @@ -157,7 +161,7 @@ namespace Generator { if ( arg is FetchStringType sb ) { - WriteLine( $"{sb.VarName} = Helpers.MemoryToString( mem{sb.VarName} );" ); + WriteLine( $"{sb.VarName} = Helpers.MemoryToString( mem__{sb.VarName} );" ); } } diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index a879948..91edcf6 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -78,7 +78,7 @@ namespace Generator if ( t.StartsWith( "char " ) && t.Contains( "[" ) ) { - WriteLine( $"internal string {CleanMemberName( m.Name )}UTF8() => System.Text.Encoding.UTF8.GetString( {CleanMemberName( m.Name )}, 0, System.Array.IndexOf( {CleanMemberName( m.Name )}, 0 ) );" ); + WriteLine( $"internal string {CleanMemberName( m.Name )}UTF8() => Steamworks.Utility.Utf8NoBom.GetString( {CleanMemberName( m.Name )}, 0, System.Array.IndexOf( {CleanMemberName( m.Name )}, 0 ) );" ); var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' ); t = "byte[]"; diff --git a/Generator/Generator.csproj b/Generator/Generator.csproj index e1199b0..b1ea044 100644 --- a/Generator/Generator.csproj +++ b/Generator/Generator.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Exe false 10 diff --git a/Generator/Types/ConstCharType.cs b/Generator/Types/ConstCharType.cs index 493d8cf..600e7e8 100644 --- a/Generator/Types/ConstCharType.cs +++ b/Generator/Types/ConstCharType.cs @@ -16,6 +16,9 @@ internal class ConstCharType : BaseType { public override string TypeName => $"string"; public override string TypeNameFrom => $"Utf8StringPointer"; - public override string AsArgument() => $"[MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] {Ref}{TypeName} {VarName}"; + public override string AsArgument() => $"{Ref}string {VarName}"; + public override string AsNativeArgument() => $"{Ref}IntPtr {VarName}"; + public override string AsCallArgument() => $"str__{VarName}.Pointer"; + public override string Ref => ""; -} \ No newline at end of file +} diff --git a/Generator/Types/FetchStringType.cs b/Generator/Types/FetchStringType.cs index ad3b9be..ee17e50 100644 --- a/Generator/Types/FetchStringType.cs +++ b/Generator/Types/FetchStringType.cs @@ -22,6 +22,6 @@ internal class FetchStringType : BaseType public override string AsNativeArgument() => $"IntPtr {VarName}"; - public override string AsCallArgument() => $"mem{VarName}"; + public override string AsCallArgument() => $"mem__{VarName}"; public override string Ref => ""; }