From 031c927f2222f996ff4eaee1359639f5ec2029d1 Mon Sep 17 00:00:00 2001 From: "Adam Michalski/System (PLT) /SRPOL/Engineer/Samsung Electronics" <131246635+a-michalski2@users.noreply.github.com> Date: Wed, 10 May 2023 08:52:22 +0200 Subject: [PATCH] Post-review fixes #2 (#4) --- src/Tizen.System.Session/Session/Session.cs | 1 - src/Tizen.System.Session/Session/SessionStructs.cs | 18 +++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Tizen.System.Session/Session/Session.cs b/src/Tizen.System.Session/Session/Session.cs index 26d086a..4cfad7d 100644 --- a/src/Tizen.System.Session/Session/Session.cs +++ b/src/Tizen.System.Session/Session/Session.cs @@ -215,7 +215,6 @@ namespace Tizen.System _replyMap[taskID] = (int result, IntPtr data) => { - try { CheckError((SessionError)result, "Interop failed to remove a subsession user"); diff --git a/src/Tizen.System.Session/Session/SessionStructs.cs b/src/Tizen.System.Session/Session/SessionStructs.cs index f68d06a..1dd5444 100644 --- a/src/Tizen.System.Session/Session/SessionStructs.cs +++ b/src/Tizen.System.Session/Session/SessionStructs.cs @@ -32,17 +32,21 @@ namespace Tizen.System public int sessionUID; [FieldOffset(8)] - public IntPtr AddUserPtr; + public Int64 switchID; + /// The following 4 fields are here just for the record and for the NativeStruct validation + /// which is performed as one of the steps during build with GBS. + /// However, we've verified that representing the whole structure as IntPtr and accessing + /// individual string fields with PtrToStructure with and PtrToStringAnsi + IntPtr.Add is + /// the only way to make it work. That's why we do not use these fields and they shouldn't + /// be accessed directly. [FieldOffset(8)] - public IntPtr RemoveUserPtr; - + private IntPtr AddUserPtr; [FieldOffset(8)] - public Int64 switchID; + private IntPtr RemoveUserPtr; [FieldOffset(16)] - public IntPtr PrevUserPtr; - + private IntPtr PrevUserPtr; [FieldOffset(36)] - public IntPtr NextUserPtr; + private IntPtr NextUserPtr; } } -- 2.7.4