File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,20 @@ public string FormatAsText()
5656 /// <returns>The formatted RPC server.</returns>
5757 public string FormatAsText ( bool remove_comments )
5858 {
59- INdrFormatter formatter = DefaultNdrFormatter . Create ( remove_comments
60- ? DefaultNdrFormatterFlags . RemoveComments : DefaultNdrFormatterFlags . None ) ;
59+ return FormatAsText ( remove_comments , false ) ;
60+ }
61+
62+ /// <summary>
63+ /// Format the RPC server as text.
64+ /// </summary>
65+ /// <param name="remove_comments">True to remove comments from the output.</param>
66+ /// <param name="cpp_format">Formating using C++ pseduo syntax.</param>
67+ /// <returns>The formatted RPC server.</returns>
68+ public string FormatAsText ( bool remove_comments , bool cpp_format )
69+ {
70+ DefaultNdrFormatterFlags flags = remove_comments
71+ ? DefaultNdrFormatterFlags . RemoveComments : DefaultNdrFormatterFlags . None ;
72+ INdrFormatter formatter = cpp_format ? CppNdrFormatter . Create ( flags ) : DefaultNdrFormatter . Create ( flags ) ;
6173 StringBuilder builder = new StringBuilder ( ) ;
6274 if ( ! remove_comments )
6375 {
Original file line number Diff line number Diff line change @@ -3581,6 +3581,8 @@ This cmdlet formats a list of RPC servers as text.
35813581The RPC servers to format.
35823582. PARAMETER RemoveComments
35833583When outputing as text remove comments from the output.
3584+ . PARAMETER CppFormat
3585+ Format output in C++ pseudo syntax rather than C++.
35843586. INPUTS
35853587RpcServer[] The RPC servers to format.
35863588. OUTPUTS
@@ -3600,12 +3602,13 @@ function Format-RpcServer {
36003602 Param (
36013603 [parameter (Mandatory = $true , Position = 0 , ValueFromPipeline )]
36023604 [NtApiDotNet.Win32.RpcServer []]$RpcServer ,
3603- [switch ]$RemoveComments
3605+ [switch ]$RemoveComments ,
3606+ [switch ]$CppFormat
36043607 )
36053608
36063609 PROCESS {
36073610 foreach ($server in $RpcServer ) {
3608- $server.FormatAsText ($RemoveComments ) | Write-Output
3611+ $server.FormatAsText ($RemoveComments , $CppFormat ) | Write-Output
36093612 }
36103613 }
36113614}
You can’t perform that action at this time.
0 commit comments