@@ -66,54 +66,55 @@ private async void ProcessInfoForm_Load(object sender, EventArgs e)
6666 return ;
6767 }
6868
69- var sections = new DataTable ( ) ;
70- sections . Columns . Add ( "address" , typeof ( string ) ) ;
71- sections . Columns . Add ( "size" , typeof ( string ) ) ;
72- sections . Columns . Add ( "name" , typeof ( string ) ) ;
73- sections . Columns . Add ( "protection" , typeof ( string ) ) ;
74- sections . Columns . Add ( "type" , typeof ( string ) ) ;
75- sections . Columns . Add ( "module" , typeof ( string ) ) ;
76- sections . Columns . Add ( "section" , typeof ( Section ) ) ;
77-
78- var modules = new DataTable ( ) ;
79- modules . Columns . Add ( "icon" , typeof ( Icon ) ) ;
80- modules . Columns . Add ( "name" , typeof ( string ) ) ;
81- modules . Columns . Add ( "address" , typeof ( string ) ) ;
82- modules . Columns . Add ( "size" , typeof ( string ) ) ;
83- modules . Columns . Add ( "path" , typeof ( string ) ) ;
84- modules . Columns . Add ( "module" , typeof ( Module ) ) ;
69+ var sectionsTable = new DataTable ( ) ;
70+ sectionsTable . Columns . Add ( "address" , typeof ( string ) ) ;
71+ sectionsTable . Columns . Add ( "size" , typeof ( string ) ) ;
72+ sectionsTable . Columns . Add ( "name" , typeof ( string ) ) ;
73+ sectionsTable . Columns . Add ( "protection" , typeof ( string ) ) ;
74+ sectionsTable . Columns . Add ( "type" , typeof ( string ) ) ;
75+ sectionsTable . Columns . Add ( "module" , typeof ( string ) ) ;
76+ sectionsTable . Columns . Add ( "section" , typeof ( Section ) ) ;
77+
78+ var modulesTable = new DataTable ( ) ;
79+ modulesTable . Columns . Add ( "icon" , typeof ( Icon ) ) ;
80+ modulesTable . Columns . Add ( "name" , typeof ( string ) ) ;
81+ modulesTable . Columns . Add ( "address" , typeof ( string ) ) ;
82+ modulesTable . Columns . Add ( "size" , typeof ( string ) ) ;
83+ modulesTable . Columns . Add ( "path" , typeof ( string ) ) ;
84+ modulesTable . Columns . Add ( "module" , typeof ( Module ) ) ;
8585
8686 await Task . Run ( ( ) =>
8787 {
88- process . EnumerateRemoteSectionsAndModules (
89- delegate ( Section section )
88+ if ( process . EnumerateRemoteSectionsAndModules ( out var sections , out var modules ) )
89+ {
90+ foreach ( var section in sections )
9091 {
91- var row = sections . NewRow ( ) ;
92+ var row = sectionsTable . NewRow ( ) ;
9293 row [ "address" ] = section . Start . ToString ( Constants . AddressHexFormat ) ;
9394 row [ "size" ] = section . Size . ToString ( Constants . AddressHexFormat ) ;
9495 row [ "name" ] = section . Name ;
9596 row [ "protection" ] = section . Protection . ToString ( ) ;
9697 row [ "type" ] = section . Type . ToString ( ) ;
9798 row [ "module" ] = section . ModuleName ;
9899 row [ "section" ] = section ;
99- sections . Rows . Add ( row ) ;
100- } ,
101- delegate ( Module module )
100+ sectionsTable . Rows . Add ( row ) ;
101+ }
102+ foreach ( var module in modules )
102103 {
103- var row = modules . NewRow ( ) ;
104+ var row = modulesTable . NewRow ( ) ;
104105 row [ "icon" ] = NativeMethods . GetIconForFile ( module . Path ) ;
105106 row [ "name" ] = module . Name ;
106107 row [ "address" ] = module . Start . ToString ( Constants . AddressHexFormat ) ;
107108 row [ "size" ] = module . Size . ToString ( Constants . AddressHexFormat ) ;
108109 row [ "path" ] = module . Path ;
109110 row [ "module" ] = module ;
110- modules . Rows . Add ( row ) ;
111+ modulesTable . Rows . Add ( row ) ;
111112 }
112- ) ;
113+ }
113114 } ) ;
114115
115- sectionsDataGridView . DataSource = sections ;
116- modulesDataGridView . DataSource = modules ;
116+ sectionsDataGridView . DataSource = sectionsTable ;
117+ modulesDataGridView . DataSource = modulesTable ;
117118 }
118119
119120 private void SelectRow_CellMouseDown ( object sender , DataGridViewCellMouseEventArgs e )
0 commit comments