public static unsafe void InitializeObjectAttributes(ref OBJECT_ATTRIBUTES p, ref UNICODE_STRING n, uint a, IntPtr r, ref SECURITY_DESCRIPTOR s)
        {
            p.Length        = sizeof(OBJECT_ATTRIBUTES);
            p.RootDirectory = r;
            p.Attributes    = a;
            var pn = IntPtr.Zero;

            Marshal.StructureToPtr(n, pn, false);
            p.ObjectName = pn;
            var ps = IntPtr.Zero;

            Marshal.StructureToPtr(s, ps, false);
            p.SecurityDescriptor       = ps;
            p.SecurityQualityOfService = IntPtr.Zero;
        }
Exemple #2
0
 public static extern int ZwConnectPort(ref System.IntPtr PortHandle, ref NAlpc.UNICODE_STRING PortName, ref SECURITY_QUALITY_OF_SERVICE SecurityQos, ref PORT_VIEW ClientView, ref REMOTE_PORT_VIEW ServerView, ref uint MaxMessageLength, System.IntPtr ConnectionInformation, ref uint ConnectionInformationLength);
        public static unsafe void InitializeObjectAttributes_Ptr(ref OBJECT_ATTRIBUTES p, ref UNICODE_STRING n, uint a, IntPtr r, IntPtr s)
        {
            p.Length        = sizeof(OBJECT_ATTRIBUTES);
            p.RootDirectory = r;
            p.Attributes    = a;

            p.ObjectName = Marshal.AllocHGlobal(Marshal.SizeOf(n));
            Marshal.StructureToPtr(n, p.ObjectName, false);

            p.SecurityDescriptor       = s;
            p.SecurityQualityOfService = IntPtr.Zero;
        }
Exemple #4
0
 public static extern int NtConnectPort_NoMarshal(ref System.IntPtr PortHandle, ref NAlpc.UNICODE_STRING PortName, ref SECURITY_QUALITY_OF_SERVICE SecurityQos, IntPtr ClientView, IntPtr ServerView, ref uint MaxMessageLength, System.IntPtr ConnectionInformation, ref uint ConnectionInformationLength);