KProcess: Difference between revisions
No edit summary |
No edit summary |
||
Line 299: | Line 299: | ||
|- | |- | ||
| 0xEC | | 0xEC | ||
| | | HandleDescriptor[0x28] | ||
| These internal | | These internal HandleDescriptor entries are only used if the exheader's handle table size is 0 | ||
|- | |- | ||
| 0x22C | | 0x22C | ||
Line 555: | Line 555: | ||
|- | |- | ||
| 0xF4 | | 0xF4 | ||
| | | HandleDescriptor[0x28] | ||
| These internal | | These internal HandleDescriptor entries are only used if the exheader's handle table size is 0 | ||
|- | |- | ||
| 0x234 | | 0x234 | ||
Line 601: | Line 601: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | HandleDescriptor* | ||
| Pointer to the process's handle table. | | Pointer to the process's handle table. | ||
|- | |- | ||
Line 613: | Line 613: | ||
|- | |- | ||
| 0x8 | | 0x8 | ||
| | | HandleDescriptor* | ||
| Pointer to the next open | | Pointer to the next open HandleDescriptor entry in the handle table. | ||
|- | |- | ||
| 0xC | | 0xC | ||
Line 637: | Line 637: | ||
|- | |- | ||
| 0x18 | | 0x18 | ||
| | | HandleDescriptor[0x28] | ||
| This small handle data table, internal to the KProcess, is only used in certain processes that don't have an external handle | | This small handle data table, internal to the KProcess, is only used in certain processes that don't have an external handle descriptor table in FCRAM. It is all zeros in most processes. | ||
|} | |} | ||
= | = HandleDescriptor = | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 664: | Line 664: | ||
On table creation, each entry in the handle data table is populated with a pointer to the next entry in the table. When a new handle is created, that pointer is moved into offset 0x8 of the KProcessHandleTable info struct to use for generation of the next handle. | On table creation, each entry in the handle data table is populated with a pointer to the next entry in the table. When a new handle is created, that pointer is moved into offset 0x8 of the KProcessHandleTable info struct to use for generation of the next handle. | ||
The final handle that gets returned when a handle is created is (handle_index | (handle_total << 15)), basically they take the index into the handle data table and OR that with the total handle count << 15. This returned value is the one that gets passed back to the running application and is used to look up the | The final handle that gets returned when a handle is created is (handle_index | (handle_total << 15)), basically they take the index into the handle data table and OR that with the total handle count << 15. This returned value is the one that gets passed back to the running application and is used to look up the HandleDescriptor entry in the table. |