mirror of https://github.com/OpenVPN/openvpn-gui
Correct parsing of the process ID returned by interatcive service
Signed-off-by: Selva Nair <selva.nair@gmail.com>pull/194/head
parent
82812df1a8
commit
8eb06fa697
|
@ -1173,7 +1173,8 @@ OnService(connection_t *c, UNUSED char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
p = buf + 11;
|
p = buf + 11;
|
||||||
if (!err && swscanf (p, L"0x%08x\nProcess ID", &pid) == 1 && pid != 0)
|
/* next line is the pid if followed by "\nProcess ID" */
|
||||||
|
if (!err && wcsstr(p, L"\nProcess ID") && swscanf (p, L"0x%08x", &pid) == 1 && pid != 0)
|
||||||
{
|
{
|
||||||
PrintDebug (L"Process ID of openvpn started by IService: %d", pid);
|
PrintDebug (L"Process ID of openvpn started by IService: %d", pid);
|
||||||
c->hProcess = OpenProcess (PROCESS_TERMINATE|PROCESS_QUERY_INFORMATION, FALSE, pid);
|
c->hProcess = OpenProcess (PROCESS_TERMINATE|PROCESS_QUERY_INFORMATION, FALSE, pid);
|
||||||
|
|
Loading…
Reference in New Issue