[haiku-gsoc] Re: input_server replicant cookies

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Sat, 04 Aug 2012 16:06:04 +0200

Alex Smith wrote:
> I'm trying to compile input_server for x86_64, getting build errors because
> it's passing pointers between itself and the method replicant as a cookie,
> using an int32 BMessage field. I've changed it to use a pointer field
> instead and it's working fine, but would this cause any compatibility
> problems at all?

I'm not particularly familiar with the input server and even less with input 
methods, so others may be able to give better advice. Generally, if it is a 
private protocol between Haiku components, it can be changed, if it is public, 
it can't. If I understand you correctly, the replicant lives in another 
application. Passing pointers is dangerous, at least if the pointers are passed 
to the input server and used by it without validity check. Which I assume is 
the case, since otherwise those cookies could as well be abstract IDs 
explicitly mapped to related data.

So to sum that up: If the protocol is public, actual cookies must be used. If 
it is private, they *should* be used, but you can get away with your change for 
the time being (please file a ticket in that case).

CU, Ingo

Other related posts: