Ejemplo n.º 1
0
        public override unsafe int EnumPersistedPorts(BSTR_ARRAY portNames, out IEnumDebugPorts2 portEnum)
        {
            IDebugPort2[] ports = new IDebugPort2[portNames.dwCount];
            for (int c = 0; c < portNames.dwCount; c++)
            {
                char * bstrPortName = ((char **)portNames.Members)[c];
                string name         = new string(bstrPortName);

                ports[c] = new DockerPort(this, name, isInAddPort: false);
            }

            portEnum = new AD7PortEnum(ports);
            return(HR.S_OK);
        }
Ejemplo n.º 2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int EnumPersistedPorts(BSTR_ARRAY PortNames, out IEnumDebugPorts2 ppEnum)
        {
            //
            // This method retrieves an object that allows enumeration of the list of persisted ports.
            //

            LoggingUtils.PrintFunction();

            try
            {
#if false
                AndroidAdb.Refresh();

                if (PortNames.dwCount > 0)
                {
                    // TODO: This conversion process is tricky, and still broken.
                    _BSTR_ARRAY portNames = (_BSTR_ARRAY)Marshal.PtrToStructure(PortNames.Members, typeof(_BSTR_ARRAY));

                    for (int i = 0; i < PortNames.dwCount; ++i)
                    {
                        IDebugPort2 ppPort;

                        AndroidDevice device = AndroidAdb.GetConnectedDeviceById(portNames.Members [i]);

                        LoggingUtils.RequireOk(AddPort(new DevicePortRequest(device), out ppPort));
                    }
                }
#endif

                LoggingUtils.RequireOk(EnumPorts(out ppEnum));

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                ppEnum = null;

                return(Constants.E_FAIL);
            }
        }
Ejemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int EnumPersistedPorts(BSTR_ARRAY PortNames, out IEnumDebugPorts2 ppEnum)
        {
            //
            // This method retrieves an object that allows enumeration of the list of persisted ports.
            //

            LoggingUtils.PrintFunction();

            ppEnum = null;

            try
            {
                throw new NotImplementedException();
            }
            catch (NotImplementedException e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_NOTIMPL);
            }
        }
Ejemplo n.º 4
0
 public int EnumPersistedPorts(BSTR_ARRAY PortNames, out IEnumDebugPorts2 ppEnum)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public override int EnumPersistedPorts(BSTR_ARRAY portNames, out IEnumDebugPorts2 portEnum)
 {
     // This should never be called since CanPersistPorts returns S_OK
     Debug.Fail("Why is EnumPersistedPorts called?");
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// If CanPersistPorts() returns false, the SDM will cache the ports and EnumPersistedPorts() needs to be implemented
 /// </summary>
 /// <param name="portNames"></param>
 /// <param name="portEnum"></param>
 /// <returns></returns>
 public abstract int EnumPersistedPorts(BSTR_ARRAY portNames, out IEnumDebugPorts2 portEnum);
Ejemplo n.º 7
0
        public unsafe int EnumPersistedPorts(BSTR_ARRAY portNames, out IEnumDebugPorts2 portEnum)
        {
            IDebugPort2[] ports = new IDebugPort2[portNames.dwCount];
            for (int c = 0; c < portNames.dwCount; c++)
            {
                char* bstrPortName = ((char**)portNames.Members)[c];
                string name = new string(bstrPortName);

                ports[c] = new AD7Port(this, name, isInAddPort: false);
            }

            portEnum = new AD7PortEnum(ports);
            return HR.S_OK;
        }