Post-review fixes #2 (#4)
authorAdam Michalski/System (PLT) /SRPOL/Engineer/Samsung Electronics <131246635+a-michalski2@users.noreply.github.com>
Wed, 10 May 2023 06:52:22 +0000 (08:52 +0200)
committerChanwoo Choi <chanwoo@kernel.org>
Mon, 15 May 2023 02:58:09 +0000 (11:58 +0900)
src/Tizen.System.Session/Session/Session.cs
src/Tizen.System.Session/Session/SessionStructs.cs

index 26d086a..4cfad7d 100644 (file)
@@ -215,7 +215,6 @@ namespace Tizen.System
 
             _replyMap[taskID] = (int result, IntPtr data) =>
             {
-
                 try
                 {
                     CheckError((SessionError)result, "Interop failed to remove a subsession user");
index f68d06a..1dd5444 100644 (file)
@@ -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;
     }
 }