intptr_t => IntPtr

This commit is contained in:
Garry Newman 2020-02-20 12:41:17 +00:00
parent f562e65149
commit a05760c76a
3 changed files with 12 additions and 12 deletions

View File

@ -261,10 +261,10 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValue", CallingConvention = Platform.CC)] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValue", CallingConvention = Platform.CC)]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]
private static extern bool _SetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ); private static extern bool _SetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg );
#endregion #endregion
internal bool SetConfigValue( NetConfig eValue, NetConfigScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ) internal bool SetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg )
{ {
var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg ); var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg );
return returnValue; return returnValue;
@ -273,10 +273,10 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct", CallingConvention = Platform.CC)] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct", CallingConvention = Platform.CC)]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]
private static extern bool _SetConfigValueStruct( IntPtr self, ref NetKeyValue opt, NetConfigScope eScopeType, long scopeObj ); private static extern bool _SetConfigValueStruct( IntPtr self, ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj );
#endregion #endregion
internal bool SetConfigValueStruct( ref NetKeyValue opt, NetConfigScope eScopeType, long scopeObj ) internal bool SetConfigValueStruct( ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj )
{ {
var returnValue = _SetConfigValueStruct( Self, ref opt, eScopeType, scopeObj ); var returnValue = _SetConfigValueStruct( Self, ref opt, eScopeType, scopeObj );
return returnValue; return returnValue;
@ -284,10 +284,10 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue", CallingConvention = Platform.CC)] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue", CallingConvention = Platform.CC)]
private static extern NetConfigResult _GetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ); private static extern NetConfigResult _GetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult );
#endregion #endregion
internal NetConfigResult GetConfigValue( NetConfig eValue, NetConfigScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ) internal NetConfigResult GetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult )
{ {
var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult );
return returnValue; return returnValue;

View File

@ -150,7 +150,7 @@ namespace Steamworks
internal unsafe static bool GetConfigInt( NetConfig type, int value ) internal unsafe static bool GetConfigInt( NetConfig type, int value )
{ {
int* ptr = &value; int* ptr = &value;
return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.Int32, (IntPtr)ptr ); return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Int32, (IntPtr)ptr );
} }
internal unsafe static int GetConfigInt( NetConfig type ) internal unsafe static int GetConfigInt( NetConfig type )
@ -159,7 +159,7 @@ namespace Steamworks
NetConfigType dtype = NetConfigType.Int32; NetConfigType dtype = NetConfigType.Int32;
int* ptr = &value; int* ptr = &value;
UIntPtr size = new UIntPtr( sizeof( int ) ); UIntPtr size = new UIntPtr( sizeof( int ) );
var result = Internal.GetConfigValue( type, NetConfigScope.Global, 0, ref dtype, (IntPtr) ptr, ref size ); var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr) ptr, ref size );
if ( result != NetConfigResult.OK ) if ( result != NetConfigResult.OK )
return 0; return 0;
@ -169,7 +169,7 @@ namespace Steamworks
internal unsafe static bool SetConfigFloat( NetConfig type, float value ) internal unsafe static bool SetConfigFloat( NetConfig type, float value )
{ {
float* ptr = &value; float* ptr = &value;
return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.Float, (IntPtr)ptr ); return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Float, (IntPtr)ptr );
} }
internal unsafe static float GetConfigFloat( NetConfig type ) internal unsafe static float GetConfigFloat( NetConfig type )
@ -178,7 +178,7 @@ namespace Steamworks
NetConfigType dtype = NetConfigType.Float; NetConfigType dtype = NetConfigType.Float;
float* ptr = &value; float* ptr = &value;
UIntPtr size = new UIntPtr( sizeof( float ) ); UIntPtr size = new UIntPtr( sizeof( float ) );
var result = Internal.GetConfigValue( type, NetConfigScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr)ptr, ref size );
if ( result != NetConfigResult.OK ) if ( result != NetConfigResult.OK )
return 0; return 0;
@ -191,7 +191,7 @@ namespace Steamworks
fixed ( byte* ptr = bytes ) fixed ( byte* ptr = bytes )
{ {
return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.String, (IntPtr)ptr ); return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.String, (IntPtr)ptr );
} }
} }

View File

@ -38,7 +38,7 @@ internal class BaseType
if ( basicType == "unsigned short" ) return new UInt16Type { NativeType = type, VarName = varname }; if ( basicType == "unsigned short" ) return new UInt16Type { NativeType = type, VarName = varname };
// DANGER DANGER Danger // DANGER DANGER Danger
if ( basicType == "intptr_t" ) return new LongType { NativeType = type, VarName = varname }; if ( basicType == "intptr_t" ) return new PointerType { NativeType = type, VarName = varname };
if ( basicType == "size_t" ) return new UIntPtrType { NativeType = type, VarName = varname }; if ( basicType == "size_t" ) return new UIntPtrType { NativeType = type, VarName = varname };
if ( basicType == "uint64" ) return new ULongType { NativeType = type, VarName = varname }; if ( basicType == "uint64" ) return new ULongType { NativeType = type, VarName = varname };