@@ -388,6 +388,42 @@ public static async Task<bool> TEST_ConfigValidation()
388388 return fSuccess ;
389389 }
390390
391+ public static async Task < bool > TEST_CanGetProcessInfo2WhileSuspended ( )
392+ {
393+ bool fSuccess = true ;
394+ Task < bool > subprocessTask = Utils . RunSubprocess (
395+ currentAssembly : Assembly . GetExecutingAssembly ( ) ,
396+ environment : new Dictionary < string , string >
397+ {
398+ { Utils . DiagnosticPortSuspend , "1" }
399+ } ,
400+ duringExecution : ( int pid ) =>
401+ {
402+ Stream stream = ConnectionHelper . GetStandardTransport ( pid ) ;
403+
404+ // 0x04 = ProcessCommandSet, 0x04 = ProcessInfo2
405+ var processInfoMessage = new IpcMessage ( 0x04 , 0x04 ) ;
406+ Logger . logger . Log ( $ "Wrote: { processInfoMessage } ") ;
407+ IpcMessage response = IpcClient . SendMessage ( stream , processInfoMessage ) ;
408+ Logger . logger . Log ( $ "Received: [{ response . Payload . Select ( b => b . ToString ( "X2" ) + " " ) . Aggregate ( string . Concat ) } ]") ;
409+ ProcessInfo2 processInfo2 = ProcessInfo2 . TryParse ( response . Payload ) ;
410+ Utils . Assert ( String . IsNullOrEmpty ( processInfo2 . ManagedEntrypointAssemblyName ) ) ;
411+
412+ // send resume command on this connection
413+ var message = new IpcMessage ( 0x04 , 0x01 ) ;
414+ Logger . logger . Log ( $ "Sent: { message . ToString ( ) } ") ;
415+ response = IpcClient . SendMessage ( ConnectionHelper . GetStandardTransport ( pid ) , message ) ;
416+ Logger . logger . Log ( $ "Received: { response . ToString ( ) } ") ;
417+
418+ return Task . FromResult ( true ) ;
419+ }
420+ ) ;
421+
422+ fSuccess &= await subprocessTask ;
423+
424+ return fSuccess ;
425+ }
426+
391427 public static async Task < int > Main ( string [ ] args )
392428 {
393429 if ( args . Length >= 1 )
0 commit comments