@@ -12,14 +12,16 @@ type RpcCallbackFunction = fn (intf_handle voidptr, context voidptr) RPC_STATUS
1212
1313// ListEntry represents one node in a list with a forward and a backward pointer.
1414// It is used within RtlCriticalSectionDebug and the RpcServer struct.
15- pub struct ListEntry {
15+ pub struct ListEntry
16+ {
1617 f_link & ListEntry = unsafe { nil }
1718 b_link & ListEntry = unsafe { nil }
1819}
1920
2021// RtlCriticalSectionDebug is a mutex related structure. It is not really used by rpv
2122// but needs to be defined as it is part of other RpcStructures.
22- pub struct RtlCriticalSectionDebug {
23+ pub struct RtlCriticalSectionDebug
24+ {
2325 section_type u16
2426 creator_back_trace_index u16
2527 critical_section & RtlCriticalSection = unsafe { nil }
@@ -33,7 +35,8 @@ pub struct RtlCriticalSectionDebug {
3335
3436// RtlCriticalSection is a mutex related structure. It is not really used by rpv
3537// but needs to be defined as it is part of other RpcStructures.
36- pub struct RtlCriticalSection {
38+ pub struct RtlCriticalSection
39+ {
3740 debug_info & RtlCriticalSectionDebug = unsafe { nil }
3841 lock_count u32
3942 recursion_count u32
@@ -45,15 +48,17 @@ pub struct RtlCriticalSection {
4548// Mutex is a synchronization struct to signal ownership of a thread on a
4649// critical section. It is not really used by rpv but needs to be defined
4750// as it is part of other RpcStructures.
48- pub struct Mutex {
51+ pub struct Mutex
52+ {
4953 critical_section RtlCriticalSection
5054}
5155
5256// SimpleDict represents a simple dictionary struct. Actually, it feels more
5357// like an array than a dictionary, as contained elements are simply references
5458// by the p_array (pointer array) member. Internal RPC structs use this struct
5559// to reference to different elements like e.g. their interfaces.
56- pub struct SimpleDict {
60+ pub struct SimpleDict
61+ {
5762pub :
5863 p_array & voidptr = unsafe { nil }
5964 array_size u32
6368
6469// RpcProtSeqEndpoint is an internal RPC structure. It is not really used
6570// by rpv but needs to be defined as it is part of other RpcStructures.
66- pub struct RpcProtSeqEndpoint {
71+ pub struct RpcProtSeqEndpoint
72+ {
6773 rpc_protocol_sequence & char = unsafe { nil }
6874 endpoint & char = unsafe { nil }
6975}
7076
7177// RpcServerInterface is an internal RPC structure that stores interface related
7278// information. It is contained within the RpcInterface struct and provides
7379// information such as the interface id, it's transfer syntax and RPC flags.
74- pub struct RpcServerInterface {
80+ pub struct RpcServerInterface
81+ {
7582pub :
7683 length u32
7784 interface_id C.RPC_IF_ID
8794// C.RPC_IF_ID represents an ID of an RPC interface. This is basically an GUID
8895// but also contains a major and minor version.
8996@[typedef]
90- pub struct C.RPC_IF_ID {
97+ pub struct C.RPC_IF_ID
98+ {
9199 Uuid C.GUID
92100 VersMajor u16
93101 VersMinor u16
@@ -104,7 +112,8 @@ pub fn (this C.RPC_IF_ID) equals(other C.RPC_IF_ID) bool
104112// RPC interface. rpv uses it to determine the method count, that can be obtained
105113// from the DispatchTableCount property.
106114@[typedef]
107- pub struct C.RPC_DISPATCH_TABLE {
115+ pub struct C.RPC_DISPATCH_TABLE
116+ {
108117 DispatchTableCount u32
109118 DispatchTable voidptr
110119 Reserved isize
@@ -117,15 +126,16 @@ pub struct C.RPC_DISPATCH_TABLE {
117126// property, which contains the offset of the different methods within the ProcString,
118127// to decompile RPC methods.
119128@[typedef]
120- pub struct C.MIDL_SERVER_INFO {
129+ pub struct C.MIDL_SERVER_INFO
130+ {
121131 pStubDesc & C.MIDL_STUB_DESC = unsafe { nil }
122- DispatchTable & voidptr = unsafe { nil }
123- ProcString & char = unsafe { nil }
124- FmtStringOffset & u16 = unsafe { nil }
125- ThunkTable & voidptr = unsafe { nil }
126- pTransferSyntax & C.RPC_IF_ID = unsafe { nil }
127- nCount & u32 = unsafe { nil }
128- pSyntaxInfo voidptr = unsafe { nil }
132+ DispatchTable & voidptr = unsafe { nil }
133+ ProcString & char = unsafe { nil }
134+ FmtStringOffset & u16 = unsafe { nil }
135+ ThunkTable & voidptr = unsafe { nil }
136+ pTransferSyntax & C.RPC_IF_ID = unsafe { nil }
137+ nCount & u32 = unsafe { nil }
138+ pSyntaxInfo voidptr = unsafe { nil }
129139}
130140
131141// C.MIDL_STUB_DESC contains information about an RPC stub. For rpv, mainly the pFormatTypes
@@ -134,7 +144,8 @@ pub struct C.MIDL_SERVER_INFO {
134144// RPC methods. Moreover, Reserved5 is required for parsing NDR expressions. Actually the
135145// member is named pExprInfo by Microsoft, but within the mingw libraries it is Reserved5.
136146@[typedef]
137- pub struct C.MIDL_STUB_DESC {
147+ pub struct C.MIDL_STUB_DESC
148+ {
138149 RpcInterfaceInformation voidptr = unsafe { nil }
139150 pfnAllocate voidptr = unsafe { nil }
140151 pfnFree voidptr = unsafe { nil }
@@ -146,35 +157,36 @@ pub struct C.MIDL_STUB_DESC {
146157 pFormatTypes & char = unsafe { nil } // mIDA: type_raw
147158 fCheckBounds int
148159 // Ndr library version.
149- Version u32
150- pMallocFreeStruct voidptr = unsafe { nil }
151- MIDLVersion u32
152- CommFaultOffsets & C.COMM_FAULT_OFFSETS = unsafe { nil }
160+ Version u32
161+ pMallocFreeStruct voidptr = unsafe { nil }
162+ MIDLVersion u32
163+ CommFaultOffsets & C.COMM_FAULT_OFFSETS = unsafe { nil }
153164 // New fields for version 3.0+
154- aUserMarshalQuadruple voidptr = unsafe { nil }
165+ aUserMarshalQuadruple voidptr = unsafe { nil }
155166 // Notify routines - added for NT5, MIDL 5.0
156- NotifyRoutineTable voidptr = unsafe { nil }
167+ NotifyRoutineTable voidptr = unsafe { nil }
157168 // Reserved for future use.
158- mFlags & u32 = unsafe { nil }
169+ mFlags & u32 = unsafe { nil }
159170 // International support routines - added for 64bit post NT5
160- CsRoutineTables voidptr = unsafe { nil }
161- Reserved4 voidptr = unsafe { nil }
162- Reserved5 voidptr = unsafe { nil } // mIDA: expr_table - RpcView: pExprInfo
163- // Fields up to now present in win2000 release.
171+ CsRoutineTables voidptr = unsafe { nil }
172+ Reserved4 voidptr = unsafe { nil }
173+ Reserved5 voidptr = unsafe { nil } // mIDA: expr_table - RpcView: pExprInfo
164174}
165175
166176// NDR_EXPR_DESC is the struct that is pointed to by C.MIDL_STUB_DESC.Reserved5, alias
167177// pExprInfo. It is used by rpv to parse NDR expressions.
168- pub struct NDR_EXPR_DESC {
169- pub :
170- p_offset voidptr
178+ pub struct NDR_EXPR_DESC
179+ {
180+ pub :
181+ p_offset voidptr
171182 p_format_expr voidptr
172183}
173184
174185// C.MIDL_SYNTAX_INFO is a struct that is used within internal RPC struct definitions.
175186// It is currently not used by rpv.
176187@[typedef]
177- pub struct C.MIDL_SYNTAX_INFO {
188+ pub struct C.MIDL_SYNTAX_INFO
189+ {
178190 TransferSyntax C.RPC_SYNTAX_IDENTIFIER
179191 DispatchTable & C.RPC_DISPATCH_TABLE
180192 ProcString & char
@@ -187,47 +199,53 @@ pub struct C.MIDL_SYNTAX_INFO {
187199// C.MIDL_INTERFACE_METHOD_PROPERTIES is a struct that is used within internal RPC struct definitions.
188200// It is currently not used by rpv.
189201@[typedef]
190- pub struct C.MIDL_INTERFACE_METHOD_PROPERTIES {
202+ pub struct C.MIDL_INTERFACE_METHOD_PROPERTIES
203+ {
191204 MethodCount u16
192205 MethodProperties & C.MIDL_METHOD_PROPERTY_MAP
193206}
194207
195208// C.MIDL_METHOD_PROPERTY_MAP is a struct that is used within internal RPC struct definitions.
196209// It is currently not used by rpv.
197210@[typedef]
198- pub struct C.MIDL_METHOD_PROPERTY_MAP {
211+ pub struct C.MIDL_METHOD_PROPERTY_MAP
212+ {
199213 count u32
200214 Properties & C.MIDL_METHOD_PROPERTY
201215}
202216
203217// C.MIDL_METHOD_PROPERTY is a struct that is used within internal RPC struct definitions.
204218// It is currently not used by rpv.
205219@[typedef]
206- pub struct C.MIDL_METHOD_PROPERTY {
220+ pub struct C.MIDL_METHOD_PROPERTY
221+ {
207222 Id u32
208223 value usize
209224}
210225
211226// C.UUID_VECTOR is a struct that is used within internal RPC struct definitions.
212227// It is currently not used by rpv.
213228@[typedef]
214- pub struct C.UUID_VECTOR {
229+ pub struct C.UUID_VECTOR
230+ {
215231 Count u32
216232 Uuid [1 ]& C.GUID
217233}
218234
219235// C.RPC_SYNTAX_IDENTIFIER is a struct that is used within internal RPC struct definitions.
220236// It is currently not used by rpv.
221237@[typedef]
222- pub struct C.RPC_SYNTAX_IDENTIFIER {
238+ pub struct C.RPC_SYNTAX_IDENTIFIER
239+ {
223240 SyntaxGUID C.GUID
224241 SyntaxVersion C.RPC_VERSION
225242}
226243
227244// C.RPC_VERSION is a struct that is used within internal RPC struct definitions.
228245// It is currently not used by rpv.
229246@[typedef]
230- pub struct C.RPC_VERSION {
247+ pub struct C.RPC_VERSION
248+ {
231249 MajorVersion u16
232250 MinorVersion u16
233251}
@@ -236,7 +254,8 @@ pub struct C.RPC_VERSION {
236254// This includes for example the utilized security packages and the associated
237255// principal. rpv uses this struct only to parse the information and makes it
238256// accessible within the RpcAuthInfo struct.
239- pub struct RPC_AUTH_INFO {
257+ pub struct RPC_AUTH_INFO
258+ {
240259pub :
241260 principal & u16 = unsafe { nil }
242261 auth_svc u32
@@ -246,17 +265,20 @@ pub:
246265
247266pub const max_simple_dict_entries = 0x200
248267pub const iid_iunknown = win.new_guid ('00000000-0000-0000-C000-000000000046' ) or { panic (err) }
249- pub const dce_transfer_syntax = C.RPC_IF_ID{
268+ pub const dce_transfer_syntax = C.RPC_IF_ID
269+ {
250270 Uuid: win.new_guid ('8A885D04-1CEB-11C9-9FE8-08002B104860' ) or { panic (err) }
251271 VersMajor: 2
252272 VersMinor: 0
253273}
254- pub const ndr64_transfer_syntax = C.RPC_IF_ID{
274+ pub const ndr64_transfer_syntax = C.RPC_IF_ID
275+ {
255276 Uuid: win.new_guid ('71710533-BEBA-4937-8319-B5DBEF9CCC36' ) or { panic (err) }
256277 VersMajor: 2
257278 VersMinor: 0
258279}
259- pub const ior_callback = C.RPC_IF_ID{
280+ pub const ior_callback = C.RPC_IF_ID
281+ {
260282 Uuid: win.new_guid ('18f70770-8e64-11cf-9af1-0020AF6E72F4' ) or { panic (err) }
261283 VersMajor: 0
262284 VersMinor: 0
0 commit comments