Exemplo n.º 1
0
        public static SNRESULT GetPPUThreadInfo(int target, uint processID, ulong threadID, out PPUThreadInfo threadInfo)
        {
            byte[]   buffer = new byte[1024];
            uint[]   bSize  = new uint[] { 1024 };
            SNRESULT ret;

            if (!Is32Bit())
            {
                ret = PPUThreadInfoX64(target, processID, threadID, bSize, buffer);
            }
            else
            {
                ret = PPUThreadInfoX86(target, processID, threadID, bSize, buffer);
            }

            threadInfo = new PPUThreadInfo()
            {
                ThreadID     = BitConverter.ToUInt64(buffer, 0),
                Priority     = BitConverter.ToUInt32(buffer, 8),
                State        = (PPUThreadState)BitConverter.ToUInt32(buffer, 0x10),
                StackAddress = BitConverter.ToUInt64(buffer, 0x14),
                StackSize    = BitConverter.ToUInt64(buffer, 0x1C),
                ThreadName   = TMAPI.ByteArrayToString(buffer, 0x28, 0)
            };
            return(ret);
        }
        public void Dispose(IPluginHost host)
        {
            form_init_id = null;
            _manager     = null;
            _version     = null;

            if (_getStatusThread != null)
            {
                _getStatusThread.Abort();
                _getStatusThread = null;
            }
        }
        public void Initialize(IPluginHost host)
        {
            _host = host;

            // Setup unique names for each form
            form_init_id = Name + " " + Version + " " + form_init_id;

            // Create MemMan instance
            _manager = new TMAPI();

            // Create label for invoking in main thread
            _label = new Label();
            _label.CreateControl();
            _label.Visible = false;

            _getStatusThread = new Thread(new ParameterizedThreadStart(CheckStatus));
            _getStatusThread.Start(this);


            // Register forms with UI
            host.RegisterWindow(this, "Connect to PS3", form_init_id, "Displays options to connect and attach to the PS3.", AddInitForm);
        }