site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VpOwKTqYh/wWtQa/NkVNCAGx3TDmq9c5cR1OTzpngu0cAyjOU+euimcues8YgrwHEGiR5cWrKO/RmZneQmOhGm1z6qKqSSiNnsnHWTbUCGZz7EagYoHPZorxz2U63VBdkW32YsdikcViWM4pPtnkuQhlJQdP9HLBzQ5u0u3Jt/U= Just a quick guess. Have you tried kIODirectionInOut? IOMemoryDescriptor::writeBytes(...) has the following code: if ( (kIOMemoryPreparedReadOnly & _flags) || offset >= _length) { IOLog("IOGMD(%p): wB = o%lx, l%lx\n", this, offset, length); // @@@ gvdl return 0; } [I found it by doing a grep -rsI "IOGMD" in the xnu directory of the source] Cheers, H. On 8/11/05, santosh katvate <santosh.nk@gmail.com> wrote:
Hello everybody
I am not able to write in IOMemoryDescriptor buffer using the writeBytes function. But i am able to read from it using readBytes function.
The return value is coming out to be 0 and it is giving error in log file as IOGMD(0xaddr):wB=o0,l4
What is the cause of the problem.
The code is given below
IOMemoryDescriptor *buffer = IOBufferMemoryDescriptor::withCapacity (LengthToWrite, kIODirectionOut); buffer->prepare (kIODirectionOut);
UInt32* testtemp=(UInt32*)IOMalloc(4);
ByteCount1=buffer->readBytes(0,testtemp,4); IOLog("ByteCount1=%d\n",ByteCount1 );
ByteCount2 = buffer->writeBytes (0, pMyBuffer, 4); IOLog("ByteCount2=%d\n",ByteCount2 );
Output in system.log is
ByteCount1=4 ByteCount2=0
Thanking in Advance santosh k
-- Life is Small and Lots of Things to Learn Lets Share the Knowledge _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/bogvardi%40gmail.com
This email sent to bogvardi@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com