Re: [2/3 solved] CFMessage woe
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=zthW9JATYQam4Z29Z2A62+lQyMcN9bZcJM86wwqcfxo=; b=M6khaheu59ngBVLlrQ859zoufmuSP4b+8tUEzcopZCAcG1CFHWY0u7fr2dVthtMiPk dEHIH0BESmA6Ts46vNgKgWmJO6KS3Ys5Jb/4dy+eJG4g33xLSM775NJBoE4q6hMoDckp s5nX3nXz0iEi+UEN4FuJ7uNYFlxuIxuZdJOEg= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=WUk5BGTDP+VCDZIY4wUyf1YOn++LcT1oBVUWBOzxUpCsWnmVgpalgqa8eYwY+okL2i Q4ltnkmRCHaaDOLVgSI8jWxxaRIvgWS53CHVfjBkfi+96v5UpJQzVTxgtPCyPysJggyI +40TSbXvLzWpXz3fHthFlMQLy8b9x3fnA/LK8=
Yes, but as far as I can't use the CFRef I got, I'd consider it a bug.
Not quite. CFMessagePortSendRequest()'s data argument isn't interested in the pointer itself, it's interested in the data that lies at that pointer. This is so because Mach ports' primary use is IPC between different processes, not between threads. You could of course wrap a pointer in a data object: void *myPointer = 0xFEEDFACE; CFDataRef data = CFDataCreate(NULL, &myPointer, sizeof(myPointer)); CFMessagePortSendRequest(...); Meanwhile, on the receiving end: void *receivedPointer = NULL; CFDataGetBytes(receivedData, CFRangeMake(0, sizeof(receivedPointer)), &receivedPointer); And after receiving the message, receivedPointer == the original myPointer. Some other thoughts: 1. I'm having a hard time understanding exactly what you want to do; it'd help if you could explain from a high-level what your goal is. 2. Is there a reason you can't link Foundation? It will make your life much easier; you could send your pointer to another thread in a single line and avoid the CFMessage APIs altogether. 3. You would get a lot more useful feedback if this were on Cocoa dev. :) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dave Keck