[Spice-devel] [spice-xpi 4/5] Add SpiceControllerWin class

Christophe Fergeau cfergeau at redhat.com
Wed Mar 27 06:09:58 PDT 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130327/cb09751d/attachment.pgp>


More information about the Spice-devel mailing list