private static eLeapRS SaveConfigWithRefType(IntPtr hConnection, string key, LEAP_VARIANT_REF_TYPE valueStruct, out UInt32 requestId) { IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct)); eLeapRS callResult = eLeapRS.eLeapRS_UnknownError; try { Marshal.StructureToPtr(valueStruct, configValue, false); callResult = SaveConfigValue(hConnection, key, configValue, out requestId); } finally { Marshal.FreeHGlobal(configValue); } return(callResult); }
private static eLeapRS SaveConfigWithRefType(IntPtr hConnection, string key, LEAP_VARIANT_REF_TYPE valueStruct, out UInt32 requestId) { IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct)); eLeapRS callResult = eLeapRS.eLeapRS_UnknownError; try { Marshal.StructureToPtr(valueStruct, configValue, false); callResult = SaveConfigValue(hConnection, key, configValue, out requestId); } finally { Marshal.FreeHGlobal(configValue); } return callResult; }