Hi,

On Wed, Jun 22, 2016 at 10:42:42PM -0400, Selva Nair wrote:
> - The process id is returned as a message formatted in the same manner
>   as error messages from the service to the client: i.e., a three-line
>   message with pid formatted as 0x%08x on line 1, "Process Id" on
>   line 2 and a blank line 3.
> 
> This provides a way for service clients to check the status of openvpn
> and terminate it without needing management interface or exit event.
> Useful when the interactive service is used from a launch script, or
> to force-terminate openvpn from the GUI if/when needed.

How does the GUI currently handle return messages?  As in, does this
need GUI changes, or is the GUI prepared to handle anything that comes
along?

>  
> +static VOID
> +ReturnProcessId (HANDLE pipe, DWORD pid, DWORD count, LPHANDLE events)
> +{
> +  const WCHAR msg[] = L"\nProcess ID\n";
> +  WCHAR buf[10 + _countof(msg)]; /* 10 characters for the pid in 0x%08x 
> format */
> +
> +  /* A 3-line string like an error message but with pid in place of error 
> number */
> +  _snwprintf (buf, _countof(buf), L"0x%08x%s", pid, msg);
> +  buf[_countof(buf) - 1] = '\0';
> +
> +  WritePipeAsync (pipe, buf, wcslen (buf) * 2, count, events);
> +}

Where does the extra blank line come from?  If I'm not all confused
(this is before my first cup of tea) this will write

%08x\nProcess ID\n

into the buffer, and not \n\n...

gert
-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: signature.asc
Description: PGP signature

Reply via email to