Re: [spice-xpi 4/5] Add SpiceControllerWin class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- 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.

> g_return pre-condition? Do you mean this:
> 
> hClientPipe =
> g_win32_output_stream_get_handle(G_WIN32_OUTPUT_STREAM(m_pipe));
> g_return_if_fail(hClientPipe != INVALID_HANDLE_VALUE);

Yes
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]