619 TInt length=aMessage.Int1(); // Get length from message param 1 |
619 TInt length=aMessage.Int1(); // Get length from message param 1 |
620 TPtr8 buffer=MyNewBufferL(length); // Make a new buffer for the data |
620 TPtr8 buffer=MyNewBufferL(length); // Make a new buffer for the data |
621 aMessage.ReadL(0,buffer); // Read data from client descriptor (param 0) |
621 aMessage.ReadL(0,buffer); // Read data from client descriptor (param 0) |
622 ...</codeblock> <p>Because <codeph>TIpcArgs</codeph> also stores type |
622 ...</codeblock> <p>Because <codeph>TIpcArgs</codeph> also stores type |
623 information about arguments, the kernel knows that argument 0 in the above |
623 information about arguments, the kernel knows that argument 0 in the above |
624 message is an 8-bit constant descriptor. On Symbian OS platforms using the |
624 message is an 8-bit constant descriptor. On Symbian platforms |
625 EKA2 kernel, this information is used to enforce correct usage of descriptor |
625 using the EKA2 kernel, this information is used to enforce correct usage of |
626 access methods; in this case, trying to write to <codeph>aDes</codeph>, or |
626 descriptor access methods; in this case, trying to write to <codeph>aDes</codeph>, |
627 treating it as a 16-bit descriptor would fail with <codeph>KErrBadDescriptor</codeph>. |
627 or treating it as a 16-bit descriptor would fail with <codeph>KErrBadDescriptor</codeph>. |
628 (The latter case would have allowed access to data beyond the length of the |
628 (The latter case would have allowed access to data beyond the length of the |
629 8- bit descriptor. </p> <p>Note, both leaving and non-leaving versions of |
629 8- bit descriptor. </p> <p>Note, both leaving and non-leaving versions of |
630 the <codeph>Read()</codeph> and <codeph>Write()</codeph> functions are provided. |
630 the <codeph>Read()</codeph> and <codeph>Write()</codeph> functions are provided. |
631 This allows the removal of some TRAP statements in code after migration to |
631 This allows the removal of some TRAP statements in code after migration to |
632 the Version 2 APIs. </p> <p id="GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1"><b>RMessagePtr2::Complete()</b> </p> <codeblock id="GUID-D0231B69-B33C-5EF5-89D3-0D332C840518" xml:space="preserve">void RMessagePtr2::Complete(TInt aReason) const;</codeblock> <p>This |
632 the Version 2 APIs. </p> <p id="GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1"><b>RMessagePtr2::Complete()</b> </p> <codeblock id="GUID-D0231B69-B33C-5EF5-89D3-0D332C840518" xml:space="preserve">void RMessagePtr2::Complete(TInt aReason) const;</codeblock> <p>This |