Line 40: |
Line 40: |
| Translate parameters are modified/translated transparently by the kernel. They are used to transfer handles/buffers between the different processes. | | Translate parameters are modified/translated transparently by the kernel. They are used to transfer handles/buffers between the different processes. |
| | | |
− | The type of parameter is described by the bits 1-3 in the translation descriptor. Parameter types accepted by the kernel are: 0, 1, (2?), 5, 6, 7. | + | The type of parameter is described by the bits 1-3 in the translation descriptor. Parameter types accepted for sending by the kernel are: 0, 1, 2, 5, 6, 7. |
− | | + | Type 0 is used to send handles across processes: |
− | The number of parameters covered by a descriptor is type-dependent:
| |
− | Type 0:
| |
− | length = (desc >> 26) + 1
| |
− | Type 1, (2?), 5, 6, 7:
| |
− | length = 1
| |
− | | |
− | Type 0 does the following:
| |
| if desc & 0x30 == 0x20: | | if desc & 0x30 == 0x20: |
| write process id to value | | write process id to value |
Line 56: |
Line 49: |
| close handle for caller | | close handle for caller |
| | | |
− | -- | + | For replies, only 0, 1, 5, 6, 7 are allowed. In other words any type 2 fields must be zeroed before calling svcReplyAndReceive on the server-side. For replies type 0, 1, 2 are ignored. Types 5, 6, 7 do something with the mem pointer upon reply. The type 0 descriptor can be used to ignore parameters. The number of parameters covered by a type-0 descriptor is (desc >> 26) + 1. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 64: |
Line 57: |
| |- | | |- |
| | 0x00000000 | | | 0x00000000 |
− | | The corresponding value is a KHandle | + | | The corresponding value is a KHandle, that should be closed in calling process. |
| |- | | |- |
| | 0x00000010 | | | 0x00000010 |
− | | The corresponding value is a KHandle, that should not be closed locally? | + | | The corresponding value is a KHandle, that will be shared/duplicated? |
| |- | | |- |
| | 0x00000020 | | | 0x00000020 |
− | | Let kernel set value to local ProcessID | + | | Let kernel set value to calling process ProcessID |
| |- | | |- |
| | 0x0000???2 <nowiki>|</nowiki> (size<<14) | | | 0x0000???2 <nowiki>|</nowiki> (size<<14) |