@@ -11,41 +11,37 @@ namespace PingCastle.RPC
11
11
{
12
12
public class RpcFirewallChecker : rpcapi
13
13
{
14
- private static byte [ ] MIDL_ProcFormatStringx86 ;
15
-
16
- private static byte [ ] MIDL_ProcFormatStringx64 ;
17
-
18
- private static byte [ ] MIDL_TypeFormatStringx64 ;
19
-
20
- private static byte [ ] MIDL_TypeFormatStringx86 ;
21
-
14
+
22
15
int maxOpNum ;
23
16
24
17
[ SecurityPermission ( SecurityAction . LinkDemand , Flags = SecurityPermissionFlag . UnmanagedCode ) ]
25
18
private RpcFirewallChecker ( Guid interfaceId , string pipe , ushort majorVersion , ushort minorVersion , int maxOpNum )
26
19
{
20
+ byte [ ] MIDL_ProcFormatString ;
21
+ byte [ ] MIDL_TypeFormatString ;
22
+
27
23
this . maxOpNum = maxOpNum ;
28
24
if ( IntPtr . Size == 8 )
29
25
{
30
- MIDL_ProcFormatStringx64 = new byte [ 30 * maxOpNum + 1 ] ;
26
+ MIDL_ProcFormatString = new byte [ 30 * maxOpNum + 1 ] ;
31
27
for ( byte i = 0 ; i < maxOpNum ; i ++ )
32
28
{
33
29
var v = new byte [ ] { 0x00 , 0x48 , 0x00 , 0x00 , 0x00 , 0x00 , i , 0x00 , 0x08 , 0x00 , 0x32 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x40 , 0x00 , 0x0a , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 } ;
34
- Array . Copy ( v , 0 , MIDL_ProcFormatStringx64 , 30 * i , v . Length ) ;
30
+ Array . Copy ( v , 0 , MIDL_ProcFormatString , 30 * i , v . Length ) ;
35
31
}
36
- MIDL_TypeFormatStringx64 = new byte [ 3 ] ;
37
- InitializeStub ( interfaceId , MIDL_ProcFormatStringx64 , MIDL_TypeFormatStringx64 , "\\ pipe\\ " + pipe , majorVersion , minorVersion ) ;
32
+ MIDL_TypeFormatString = new byte [ 3 ] ;
33
+ InitializeStub ( interfaceId , MIDL_ProcFormatString , MIDL_TypeFormatString , "\\ pipe\\ " + pipe , majorVersion , minorVersion ) ;
38
34
}
39
35
else
40
36
{
41
- MIDL_ProcFormatStringx86 = new byte [ 28 * maxOpNum + 1 ] ;
37
+ MIDL_ProcFormatString = new byte [ 28 * maxOpNum + 1 ] ;
42
38
for ( byte i = 0 ; i < maxOpNum ; i ++ )
43
39
{
44
40
var v = new byte [ ] { 0x00 , 0x48 , 0x00 , 0x00 , 0x00 , 0x00 , i , 0x00 , 0x04 , 0x00 , 0x32 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x40 , 0x00 , 0x08 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 } ;
45
- Array . Copy ( v , 0 , MIDL_ProcFormatStringx86 , 28 * i , v . Length ) ;
41
+ Array . Copy ( v , 0 , MIDL_ProcFormatString , 28 * i , v . Length ) ;
46
42
}
47
- MIDL_TypeFormatStringx86 = new byte [ 3 ] ;
48
- InitializeStub ( interfaceId , MIDL_ProcFormatStringx86 , MIDL_TypeFormatStringx86 , "\\ pipe\\ " + pipe , majorVersion , minorVersion ) ;
43
+ MIDL_TypeFormatString = new byte [ 3 ] ;
44
+ InitializeStub ( interfaceId , MIDL_ProcFormatString , MIDL_TypeFormatString , "\\ pipe\\ " + pipe , majorVersion , minorVersion ) ;
49
45
}
50
46
}
51
47
0 commit comments