// get properties of existent phone-book entry and fill _ent structure of this class private void GetEntry() { int entrySize = 0; IntPtr buff = IntPtr.Zero; Ras.RasGetEntryProperties(null, this._params.szEntryName, buff, ref entrySize, 0, 0); buff = Marshal.AllocHGlobal(entrySize); Marshal.WriteInt32(buff, this._ent.dwSize); Ras.RasCheck(Ras.RasGetEntryProperties(null, this._params.szEntryName, buff, ref entrySize, 0, 0)); this._ent = (Ras.RASENTRY)Marshal.PtrToStructure(buff, typeof(Ras.RASENTRY)); Marshal.FreeHGlobal(buff); }