Re: network related question
Re: network related question
- Subject: Re: network related question
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Wed, 05 Feb 2014 10:01:59 +0000
On 4 Feb 2014, at 19:37, Jeremy Thompson <email@hidden> wrote:
> I just need the handle variable to have all the buffer data.
Sounds like you need PtrToHand. For example:
static Handle NewHandleForCFData(CFDataRef d)
{
OSStatus err;
Handle h;
err = PtrToHand(
CFDataGetBytes(d),
&h,
CFDataGetLength(d)
);
assert(err == noErr);
return h;
}
This is going to need some type casts to deal with things like the fact that CFDataGetLength returns a CFIndex which isn't always the same as long, which is what PtrToHand takes as its the size parameter. I'd know what those edge cases were if I'd actually compiled and run this code, which I didn't (-:
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden