Hi, On Mon, Mar 25, 2013 at 08:06:27AM -0400, Marc-André Lureau wrote: > ----- Mensaje original ----- > > > In general, returning true on success is easier to read. > > > > This mimics the return value of connect(2), I'd prefer to keep that > > (at > > least in that patch, can be improved as a separate cleanup as this > > needs > > changes in SpiceController and SpiceControllerUnix as well). > > > > > > +//checks whether the handle owner is the current user. > > > > +static bool is_same_user(HANDLE handle) > > > > +{ > > > > + PSECURITY_DESCRIPTOR psec_desc_handle = NULL; > > > > + PSECURITY_DESCRIPTOR psec_desc_user = NULL; > > > > + PSID psid_handle; > > > > + PSID psid_user; > > > > + bool ret; > > > > + > > > > + ret = !get_sid(handle, &psid_handle, &psec_desc_handle) && > > > > + !get_sid(GetCurrentProcess(), &psid_user, > > > > &psec_desc_user) && > > > > + EqualSid(psid_handle, psid_user); > > > > > > That would make this easier to read. > > > > 'That' ? Sorry didn't get what you mean here. > > the line above would be easier to read without the mix usage of ! and not-!, ymmv. As this is some c&p code, I didn't change it. Christophe
Attachment:
pgp1Pmf3ZaKAq.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel