protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice) { IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain); IntPtr name = InteropUtils.StringToHGlobalUtf8(aName); iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle()); Marshal.FreeHGlobal(domain); Marshal.FreeHGlobal(name); IntPtr serviceHandle = CpProxyService(iHandle); iService = new CpService(serviceHandle); iGchProxy = GCHandle.Alloc(this); iSubscriptionStatusLock = new Mutex(); }
protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice) { char* domain = (char*)Marshal.StringToHGlobalAnsi(aDomain); char* name = (char*)Marshal.StringToHGlobalAnsi(aName); iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle()); Marshal.FreeHGlobal((IntPtr)domain); Marshal.FreeHGlobal((IntPtr)name); IntPtr serviceHandle = CpProxyService(iHandle); iService = new CpService(serviceHandle); iGchProxy = GCHandle.Alloc(this); iSubscriptionStatusLock = new Mutex(); }
protected CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice) { IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain); IntPtr name = InteropUtils.StringToHGlobalUtf8(aName); iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle()); Marshal.FreeHGlobal(domain); Marshal.FreeHGlobal(name); IntPtr serviceHandle = CpProxyService(iHandle); iService = new CpService(serviceHandle); iGchProxy = GCHandle.Alloc(this); iSubscriptionStatusLock = new Mutex(); }