mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-gtk
synced 2026-02-05 23:00:47 +00:00
gtk/controller: build win32 controller pipe name
This commit is contained in:
parent
d9e75a6c95
commit
62abefbb4a
@ -15,6 +15,7 @@
|
||||
|
||||
using GLib;
|
||||
using Custom;
|
||||
using Win32;
|
||||
using Spice;
|
||||
using SpiceProtocol;
|
||||
|
||||
@ -217,7 +218,11 @@ public class SpiceController: Object {
|
||||
public async void listen (string? addr = null) throws GLib.Error, ControllerError
|
||||
{
|
||||
if (addr == null)
|
||||
#if WIN32
|
||||
addr = (string*)"\\\\.\\pipe\\SpiceController-%lu".printf (GetCurrentProcessId ());
|
||||
#else
|
||||
addr = (string*)"%s".printf (Environment.get_variable ("SPICE_XPI_SOCKET")); // FIXME vala...
|
||||
#endif
|
||||
if (addr == null)
|
||||
throw new ControllerError.VALUE ("Missing SPICE_XPI_SOCKET");
|
||||
FileUtils.unlink (addr);
|
||||
|
||||
@ -24,3 +24,8 @@ namespace Spice {
|
||||
public void add_named_pipe (NamedPipe namedpipe);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Win32 {
|
||||
[CCode (cheader_filename = "windows.h", cname = "GetCurrentProcessId")]
|
||||
public uint32 GetCurrentProcessId ();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user