Difference between revisions of "KSession"

From 3dbrew
Jump to navigation Jump to search
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Kernel objects]]
+
[[Category:Kernel auto objects]]
 
class [[KSession]] extends [[KAutoObject]];
 
class [[KSession]] extends [[KAutoObject]];
  
 +
Size : 0x4C bytes
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 18: Line 19:
 
|-
 
|-
 
| 0x20
 
| 0x20
| KThread*
+
| [[KThread]]*
 
| X ?
 
| X ?
 
|-
 
|-
 
| 0x24
 
| 0x24
| KThread*
+
| [[KThread]]*
 
| Y ?
 
| Y ?
 
|-
 
|-
 
| 0x2C
 
| 0x2C
| KThread*
+
| [[KThread]]*
 
| Z ?
 
| Z ?
 
|}
 
|}
Line 32: Line 33:
  
  
Structure for [[7.0.0-13]] NATIVE_FIRM upward:
+
Structure for at least [[5.0.0-11]] NATIVE_FIRM upward:
 +
 
 +
Size : 0x4C bytes ([[KAutoObject]], [[KServerSession]], [[KClientSession]], sequentially):
  
Size : 0x4C bytes
 
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
!  Offset
 
!  Offset
! Type
+
!colspan="2"|Type
 
!  Description
 
!  Description
 
|-
 
|-
 
| 0x0
 
| 0x0
 +
|rowspan="2"|[[KAutoObject]]
 
| u32
 
| u32
 
| Pointer to vtable
 
| Pointer to vtable
Line 51: Line 54:
 
|-
 
|-
 
| 0x8
 
| 0x8
| KServerSession  
+
|rowspan="9"|[[KServerSession]]
| Server side object for the session
+
| u32
 +
| Pointer to vtable
 +
|-
 +
| 0xC
 +
| u32
 +
| Reference count
 +
|-
 +
| 0x10
 +
| u32
 +
| KLinkedListNode count for sync threads
 +
|-
 +
| 0x14
 +
| [[KLinkedListNode]]*
 +
| Pointer to first KLinkedListNode in the list of threads that sync with this object
 +
|-
 +
| 0x18
 +
| [[KLinkedListNode]]*
 +
| Pointer to last KLinkedListNode in the list of threads that sync with this object
 +
|-
 +
| 0x1C
 +
| KSession*
 +
| Pointer to parent session
 +
|-
 +
| 0x20
 +
| [[KThread]]*
 +
| Last stolen KThread during sync request- current thread when KServerSession code is running during svc - noted in KThread+0xA8 as well
 +
|-
 +
| 0x24
 +
| [[KThread]]*
 +
| First stolen KThread during sync request
 +
|-
 +
| 0x28
 +
| [[KThread]]*
 +
| KThread that originated the session
 
|-
 
|-
 
| 0x2C
 
| 0x2C
| KClientSession  
+
|rowspan="8"|[[KClientSession]]
| Client side object for the session
+
| u32
 +
| Pointer to vtable
 
|-
 
|-
 +
| 0x30
 +
| u32
 +
| Reference count
 +
|-
 +
| 0x34
 +
| u32
 +
| KLinkedListNode count for sync threads
 +
|-
 +
| 0x38
 +
| [[KLinkedListNode]]*
 +
| Pointer to first KLinkedListNode in the list of threads that sync with this object
 +
|-
 +
| 0x3C
 +
| [[KLinkedListNode]]*
 +
| Pointer to last KLinkedListNode in the list of threads that sync with this object
 +
|-
 +
| 0x40
 +
| KSession*
 +
| Pointer to parent session
 +
|-
 +
| 0x44
 +
| u32
 +
| Session status
 +
|-
 +
| 0x48
 +
| [[KClientPort]]*
 +
| Pointer to associated client port inside parent KPort
 +
|-
 +
|}
 +
 +
 +
Session status:
 +
 +
1: open<br>
 +
2: closed by client<br>
 +
3: closed by server?

Latest revision as of 23:18, 17 April 2017

class KSession extends KAutoObject;

Size : 0x4C bytes

Offset Type Description
0x0 u32 Pointer to vtable
0x4 u32 Reference count
0x20 KThread* X ?
0x24 KThread* Y ?
0x2C KThread* Z ?

It seems X=Y=Z. X, Y and Z can be NULL.


Structure for at least 5.0.0-11 NATIVE_FIRM upward:

Size : 0x4C bytes (KAutoObject, KServerSession, KClientSession, sequentially):


Offset Type Description
0x0 KAutoObject u32 Pointer to vtable
0x4 u32 Reference count
0x8 KServerSession u32 Pointer to vtable
0xC u32 Reference count
0x10 u32 KLinkedListNode count for sync threads
0x14 KLinkedListNode* Pointer to first KLinkedListNode in the list of threads that sync with this object
0x18 KLinkedListNode* Pointer to last KLinkedListNode in the list of threads that sync with this object
0x1C KSession* Pointer to parent session
0x20 KThread* Last stolen KThread during sync request- current thread when KServerSession code is running during svc - noted in KThread+0xA8 as well
0x24 KThread* First stolen KThread during sync request
0x28 KThread* KThread that originated the session
0x2C KClientSession u32 Pointer to vtable
0x30 u32 Reference count
0x34 u32 KLinkedListNode count for sync threads
0x38 KLinkedListNode* Pointer to first KLinkedListNode in the list of threads that sync with this object
0x3C KLinkedListNode* Pointer to last KLinkedListNode in the list of threads that sync with this object
0x40 KSession* Pointer to parent session
0x44 u32 Session status
0x48 KClientPort* Pointer to associated client port inside parent KPort


Session status:

1: open
2: closed by client
3: closed by server?