Skip to content

Commit

Permalink
Merge pull request #443 from rlabrecque/fix-get-config-value
Browse files Browse the repository at this point in the history
Fix ISteamNetworkingUtils_GetConfigValue parameter from out -> ref (#441)
  • Loading branch information
rlabrecque committed Sep 12, 2021
2 parents 248c663 + 9ab9230 commit e8db6e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CodeGen/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@
"cbBuf": "uint",
},

"ISteamNetworkingUtils_GetConfigValue": {
"cbResult": "ref ulong",
},
"ISteamGameServerNetworkingUtils_GetConfigValue": {
"cbResult": "ref ulong",
},

"ISteamNetworkingSockets_SendMessages": {
"pMessages": "SteamNetworkingMessage_t[]",
"pOutMessageNumberOrResult": "long[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ internal static class NativeMethods {
public static extern bool ISteamNetworkingUtils_SetConfigValue(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue", CallingConvention = CallingConvention.Cdecl)]
public static extern ESteamNetworkingGetConfigValueResult ISteamNetworkingUtils_GetConfigValue(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult);
public static extern ESteamNetworkingGetConfigValueResult ISteamNetworkingUtils_GetConfigValue(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, ref ulong cbResult);

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetw
/// <para>/ - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.)</para>
/// <para>/ - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required.</para>
/// </summary>
public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult) {
public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, ref ulong cbResult) {
InteropHelp.TestIfAvailableGameServer();
return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, out cbResult);
return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetw
/// <para>/ - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.)</para>
/// <para>/ - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required.</para>
/// </summary>
public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult) {
public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, ref ulong cbResult) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, out cbResult);
return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult);
}

/// <summary>
Expand Down

0 comments on commit e8db6e2

Please sign in to comment.