[Spice-devel] [vdagent-win PATCH v4 09/19] Use proper invalid value for _vio_serial
Frediano Ziglio
fziglio at redhat.com
Mon Jul 2 15:39:00 UTC 2018
>
> > On 2 Jul 2018, at 09:43, Frediano Ziglio <fziglio at redhat.com> wrote:
> >
> > For some reason kernel handles in Windows have 2 invalid values
> > depending on the type. For files/devices are INVALID_HANDLE_VALUE
>
> suggestion: “File / devices use INVALID_HANDLE_VALUE, while…"
>
> > (-1) while others use NULL (0). As _vio_serial is a file, created
> > with CreateFile use INVALID_HANDLE_VALUE for coherence.
>
> add comma: "with CreateFile, use INVALID_HANDLE_VALUE"
>
> suggestion: " for consistency” instead of “for coherence"
> (https://www.differencebetween.com/difference-between-coherence-and-vs-consistency/)
>
>
> >
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> > vdagent/vdagent.cpp | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> > index 574ff45..73fd2e3 100644
> > --- a/vdagent/vdagent.cpp
> > +++ b/vdagent/vdagent.cpp
> > @@ -198,7 +198,7 @@ VDAgent::VDAgent()
> > , _desktop_switch (false)
> > , _desktop_layout (NULL)
> > , _display_setting (VD_AGENT_REGISTRY_KEY)
> > - , _vio_serial (NULL)
> > + , _vio_serial (INVALID_HANDLE_VALUE)
>
> During debugging, old code could tell if something was not initialized (NULL)
> or falied (INVALID_HANDLE_VALUE). Is it useful to be able to tell?
>
You would have a log or not on opening failure.
>
> > , _read_pos (0)
> > , _write_pos (0)
> > , _logon_desktop (false)
Frediano
More information about the Spice-devel
mailing list