/// <summary> /// Macro for initializing the message header /// </summary> /// <param name="ph"></param> /// <param name="l"></param> /// <param name="t"></param> public static void InitializeMessageHeader(ref PORT_MESSAGE ph, ushort l, PORT_MESSAGE_TYPES t) { (ph).u1.s1.TotalLength = (ushort)(l); unsafe { (ph).u1.s1.DataLength = (ushort)(l - sizeof(PORT_MESSAGE)); } (ph).u2.s2.Type = (ushort)t; (ph).u2.s2.DataInfoOffset = 0; }
public static extern int ZwReplyWaitReceivePort(System.IntPtr PortHandle, ref System.IntPtr PortContext, ref PORT_MESSAGE ReplyMessage, ref PORT_MESSAGE ReceiveMessage);
public static extern int ZwReplyWaitReplyPort(System.IntPtr PortHandle, ref PORT_MESSAGE ReplyMessage);
public static extern int ZwRequestPort(System.IntPtr PortHandle, ref PORT_MESSAGE RequestMessage);
public static extern int ZwAcceptConnectPort(ref System.IntPtr PortHandle, System.IntPtr PortContext, ref PORT_MESSAGE ConnectionRequest, byte AcceptConnection, ref PORT_VIEW ServerView, ref REMOTE_PORT_VIEW ClientView);
public static extern int NtAcceptConnectPort_Ptr(out IntPtr PortHandle, System.IntPtr PortContext, ref PORT_MESSAGE ConnectionRequest, byte AcceptConnection, IntPtr ServerView, IntPtr ClientView);