Process Hacker
ntlpcapi.h
Go to the documentation of this file.
1 #ifndef _NTLPCAPI_H
2 #define _NTLPCAPI_H
3 
4 // Local Inter-process Communication
5 
6 #define PORT_CONNECT 0x0001
7 #define PORT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1)
8 
9 typedef struct _PORT_MESSAGE
10 {
11  union
12  {
13  struct
14  {
17  } s1;
18  ULONG Length;
19  } u1;
20  union
21  {
22  struct
23  {
26  } s2;
27  ULONG ZeroInit;
28  } u2;
29  union
30  {
33  };
34  ULONG MessageId;
35  union
36  {
37  SIZE_T ClientViewSize; // only valid for LPC_CONNECTION_REQUEST messages
38  ULONG CallbackId; // only valid for LPC_REQUEST messages
39  };
41 
42 typedef struct _PORT_DATA_ENTRY
43 {
44  PVOID Base;
45  ULONG Size;
47 
48 typedef struct _PORT_DATA_INFORMATION
49 {
53 
54 #define LPC_REQUEST 1
55 #define LPC_REPLY 2
56 #define LPC_DATAGRAM 3
57 #define LPC_LOST_REPLY 4
58 #define LPC_PORT_CLOSED 5
59 #define LPC_CLIENT_DIED 6
60 #define LPC_EXCEPTION 7
61 #define LPC_DEBUG_EVENT 8
62 #define LPC_ERROR_EVENT 9
63 #define LPC_CONNECTION_REQUEST 10
64 
65 #define LPC_KERNELMODE_MESSAGE (CSHORT)0x8000
66 #define LPC_NO_IMPERSONATE (CSHORT)0x4000
67 
68 #define PORT_VALID_OBJECT_ATTRIBUTES OBJ_CASE_INSENSITIVE
69 
70 #ifdef _WIN64
71 #define PORT_MAXIMUM_MESSAGE_LENGTH 512
72 #else
73 #define PORT_MAXIMUM_MESSAGE_LENGTH 256
74 #endif
75 
76 #define LPC_MAX_CONNECTION_INFO_SIZE (16 * sizeof(ULONG_PTR))
77 
78 #define PORT_TOTAL_MAXIMUM_MESSAGE_LENGTH \
79  ((PORT_MAXIMUM_MESSAGE_LENGTH + sizeof(PORT_MESSAGE) + LPC_MAX_CONNECTION_INFO_SIZE + 0xf) & ~0xf)
80 
81 typedef struct _LPC_CLIENT_DIED_MSG
82 {
84  LARGE_INTEGER CreateTime;
86 
87 typedef struct _PORT_VIEW
88 {
89  ULONG Length;
90  HANDLE SectionHandle;
92  SIZE_T ViewSize;
93  PVOID ViewBase;
96 
97 typedef struct _REMOTE_PORT_VIEW
98 {
99  ULONG Length;
100  SIZE_T ViewSize;
101  PVOID ViewBase;
103 
104 // WOW64 definitions
105 
106 // Except in a small number of special cases, WOW64 programs using the LPC APIs must use the 64-bit versions of the
107 // PORT_MESSAGE, PORT_VIEW and REMOTE_PORT_VIEW data structures. Note that we take a different approach than the
108 // official NT headers, which produce 64-bit versions in a 32-bit environment when USE_LPC6432 is defined.
109 
110 typedef struct _PORT_MESSAGE64
111 {
112  union
113  {
114  struct
115  {
118  } s1;
119  ULONG Length;
120  } u1;
121  union
122  {
123  struct
124  {
127  } s2;
128  ULONG ZeroInit;
129  } u2;
130  union
131  {
134  };
135  ULONG MessageId;
136  union
137  {
138  ULONGLONG ClientViewSize; // only valid for LPC_CONNECTION_REQUEST messages
139  ULONG CallbackId; // only valid for LPC_REQUEST messages
140  };
142 
144 {
146  LARGE_INTEGER CreateTime;
148 
149 typedef struct _PORT_VIEW64
150 {
151  ULONG Length;
152  ULONGLONG SectionHandle;
154  ULONGLONG ViewSize;
155  ULONGLONG ViewBase;
156  ULONGLONG ViewRemoteBase;
158 
159 typedef struct _REMOTE_PORT_VIEW64
160 {
161  ULONG Length;
162  ULONGLONG ViewSize;
163  ULONGLONG ViewBase;
165 
166 // Port creation
167 
168 NTSYSCALLAPI
169 NTSTATUS
170 NTAPI
172  _Out_ PHANDLE PortHandle,
173  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
174  _In_ ULONG MaxConnectionInfoLength,
175  _In_ ULONG MaxMessageLength,
176  _In_opt_ ULONG MaxPoolUsage
177  );
178 
179 NTSYSCALLAPI
180 NTSTATUS
181 NTAPI
183  _Out_ PHANDLE PortHandle,
184  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
185  _In_ ULONG MaxConnectionInfoLength,
186  _In_ ULONG MaxMessageLength,
187  _In_opt_ ULONG MaxPoolUsage
188  );
189 
190 // Port connection (client)
191 
192 NTSYSCALLAPI
193 NTSTATUS
194 NTAPI
196  _Out_ PHANDLE PortHandle,
197  _In_ PUNICODE_STRING PortName,
198  _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
199  _Inout_opt_ PPORT_VIEW ClientView,
200  _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
201  _Out_opt_ PULONG MaxMessageLength,
202  _Inout_updates_bytes_to_opt_(*ConnectionInformationLength, *ConnectionInformationLength) PVOID ConnectionInformation,
203  _Inout_opt_ PULONG ConnectionInformationLength
204  );
205 
206 NTSYSCALLAPI
207 NTSTATUS
208 NTAPI
210  _Out_ PHANDLE PortHandle,
211  _In_ PUNICODE_STRING PortName,
212  _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
213  _Inout_opt_ PPORT_VIEW ClientView,
214  _In_opt_ PSID RequiredServerSid,
215  _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
216  _Out_opt_ PULONG MaxMessageLength,
217  _Inout_updates_bytes_to_opt_(*ConnectionInformationLength, *ConnectionInformationLength) PVOID ConnectionInformation,
218  _Inout_opt_ PULONG ConnectionInformationLength
219  );
220 
221 // Port connection (server)
222 
223 NTSYSCALLAPI
224 NTSTATUS
225 NTAPI
227  _In_ HANDLE PortHandle,
228  _Out_ PPORT_MESSAGE ConnectionRequest
229  );
230 
231 NTSYSCALLAPI
232 NTSTATUS
233 NTAPI
235  _Out_ PHANDLE PortHandle,
236  _In_opt_ PVOID PortContext,
237  _In_ PPORT_MESSAGE ConnectionRequest,
238  _In_ BOOLEAN AcceptConnection,
239  _Inout_opt_ PPORT_VIEW ServerView,
240  _Out_opt_ PREMOTE_PORT_VIEW ClientView
241  );
242 
243 NTSYSCALLAPI
244 NTSTATUS
245 NTAPI
247  _In_ HANDLE PortHandle
248  );
249 
250 // General
251 
252 NTSYSCALLAPI
253 NTSTATUS
254 NTAPI
256  _In_ HANDLE PortHandle,
257  _In_reads_bytes_(RequestMessage->u1.s1.TotalLength) PPORT_MESSAGE RequestMessage
258  );
259 
260 NTSYSCALLAPI
261 NTSTATUS
262 NTAPI
264  _In_ HANDLE PortHandle,
265  _In_reads_bytes_(RequestMessage->u1.s1.TotalLength) PPORT_MESSAGE RequestMessage,
266  _Out_ PPORT_MESSAGE ReplyMessage
267  );
268 
269 NTSYSCALLAPI
270 NTSTATUS
271 NTAPI
273  _In_ HANDLE PortHandle,
274  _In_reads_bytes_(ReplyMessage->u1.s1.TotalLength) PPORT_MESSAGE ReplyMessage
275  );
276 
277 NTSYSCALLAPI
278 NTSTATUS
279 NTAPI
281  _In_ HANDLE PortHandle,
282  _Inout_ PPORT_MESSAGE ReplyMessage
283  );
284 
285 NTSYSCALLAPI
286 NTSTATUS
287 NTAPI
289  _In_ HANDLE PortHandle,
290  _Out_opt_ PVOID *PortContext,
291  _In_reads_bytes_opt_(ReplyMessage->u1.s1.TotalLength) PPORT_MESSAGE ReplyMessage,
292  _Out_ PPORT_MESSAGE ReceiveMessage
293  );
294 
295 NTSYSCALLAPI
296 NTSTATUS
297 NTAPI
299  _In_ HANDLE PortHandle,
300  _Out_opt_ PVOID *PortContext,
301  _In_reads_bytes_opt_(ReplyMessage->u1.s1.TotalLength) PPORT_MESSAGE ReplyMessage,
302  _Out_ PPORT_MESSAGE ReceiveMessage,
303  _In_opt_ PLARGE_INTEGER Timeout
304  );
305 
306 NTSYSCALLAPI
307 NTSTATUS
308 NTAPI
310  _In_ HANDLE PortHandle,
311  _In_ PPORT_MESSAGE Message
312  );
313 
314 NTSYSCALLAPI
315 NTSTATUS
316 NTAPI
318  _In_ HANDLE PortHandle,
319  _In_ PPORT_MESSAGE Message,
320  _In_ ULONG DataEntryIndex,
321  _Out_writes_bytes_to_(BufferSize, *NumberOfBytesRead) PVOID Buffer,
322  _In_ SIZE_T BufferSize,
323  _Out_opt_ PSIZE_T NumberOfBytesRead
324  );
325 
326 NTSYSCALLAPI
327 NTSTATUS
328 NTAPI
330  _In_ HANDLE PortHandle,
331  _In_ PPORT_MESSAGE Message,
332  _In_ ULONG DataEntryIndex,
333  _In_reads_bytes_(BufferSize) PVOID Buffer,
334  _In_ SIZE_T BufferSize,
335  _Out_opt_ PSIZE_T NumberOfBytesWritten
336  );
337 
339 {
343 
344 NTSYSCALLAPI
345 NTSTATUS
346 NTAPI
348  _In_ HANDLE PortHandle,
349  _In_ PORT_INFORMATION_CLASS PortInformationClass,
350  _Out_writes_bytes_to_(Length, *ReturnLength) PVOID PortInformation,
351  _In_ ULONG Length,
352  _Out_opt_ PULONG ReturnLength
353  );
354 
355 // Asynchronous Local Inter-process Communication
356 
357 // rev
358 typedef HANDLE ALPC_HANDLE, *PALPC_HANDLE;
359 
360 #define ALPC_PORFLG_ALLOW_LPC_REQUESTS 0x20000 // rev
361 #define ALPC_PORFLG_WAITABLE_PORT 0x40000 // dbg
362 #define ALPC_PORFLG_SYSTEM_PROCESS 0x100000 // dbg
363 
364 // symbols
365 typedef struct _ALPC_PORT_ATTRIBUTES
366 {
367  ULONG Flags;
368  SECURITY_QUALITY_OF_SERVICE SecurityQos;
371  SIZE_T MaxPoolUsage;
373  SIZE_T MaxViewSize;
376 #ifdef _WIN64
377  ULONG Reserved;
378 #endif
380 
381 // begin_rev
382 #define ALPC_MESSAGE_SECURITY_ATTRIBUTE 0x80000000
383 #define ALPC_MESSAGE_VIEW_ATTRIBUTE 0x40000000
384 #define ALPC_MESSAGE_CONTEXT_ATTRIBUTE 0x20000000
385 #define ALPC_MESSAGE_HANDLE_ATTRIBUTE 0x10000000
386 // end_rev
387 
388 // symbols
390 {
394 
395 // symbols
397 {
398  union
399  {
400  struct
401  {
402  ULONG64 Head : 24;
403  ULONG64 Tail : 24;
404  ULONG64 ActiveThreadCount : 16;
405  } s1;
406  ULONG64 Value;
407  } u1;
409 
410 #define ALPC_COMPLETION_LIST_BUFFER_GRANULARITY_MASK 0x3f // dbg
411 
412 // symbols
413 typedef struct DECLSPEC_ALIGN(128) _ALPC_COMPLETION_LIST_HEADER
414 {
415  ULONG64 StartMagic;
416 
417  ULONG TotalSize;
418  ULONG ListOffset;
419  ULONG ListSize;
420  ULONG BitmapOffset;
421  ULONG BitmapSize;
422  ULONG DataOffset;
423  ULONG DataSize;
424  ULONG AttributeFlags;
425  ULONG AttributeSize;
426 
428  ULONG LastMessageId;
429  ULONG LastCallbackId;
430  DECLSPEC_ALIGN(128) ULONG PostCount;
431  DECLSPEC_ALIGN(128) ULONG ReturnCount;
432  DECLSPEC_ALIGN(128) ULONG LogSequenceNumber;
433  DECLSPEC_ALIGN(128) RTL_SRWLOCK UserLock;
434 
435  ULONG64 EndMagic;
437 
438 // private
439 typedef struct _ALPC_CONTEXT_ATTR
440 {
441  PVOID PortContext;
443  ULONG Sequence;
444  ULONG MessageId;
445  ULONG CallbackId;
447 
448 // begin_rev
449 #define ALPC_HANDLEFLG_DUPLICATE_SAME_ACCESS 0x10000
450 #define ALPC_HANDLEFLG_DUPLICATE_SAME_ATTRIBUTES 0x20000
451 #define ALPC_HANDLEFLG_DUPLICATE_INHERIT 0x80000
452 // end_rev
453 
454 // private
455 typedef struct _ALPC_HANDLE_ATTR
456 {
457  ULONG Flags;
458  HANDLE Handle;
459  ULONG ObjectType; // ObjectTypeCode, not ObjectTypeIndex
460  ACCESS_MASK DesiredAccess;
462 
463 #define ALPC_SECFLG_CREATE_HANDLE 0x20000 // dbg
464 
465 // private
466 typedef struct _ALPC_SECURITY_ATTR
467 {
468  ULONG Flags;
469  PSECURITY_QUALITY_OF_SERVICE QoS;
470  ALPC_HANDLE ContextHandle; // dbg
472 
473 // begin_rev
474 #define ALPC_VIEWFLG_NOT_SECURE 0x40000
475 // end_rev
476 
477 // private
478 typedef struct _ALPC_DATA_VIEW_ATTR
479 {
480  ULONG Flags;
481  ALPC_HANDLE SectionHandle;
482  PVOID ViewBase; // must be zero on input
483  SIZE_T ViewSize;
485 
486 // private
488 {
489  AlpcBasicInformation, // q: out ALPC_BASIC_INFORMATION
490  AlpcPortInformation, // s: in ALPC_PORT_ATTRIBUTES
491  AlpcAssociateCompletionPortInformation, // s: in ALPC_PORT_ASSOCIATE_COMPLETION_PORT
493  AlpcServerInformation, // q: inout ALPC_SERVER_INFORMATION
494  AlpcMessageZoneInformation, // s: in ALPC_PORT_MESSAGE_ZONE_INFORMATION
495  AlpcRegisterCompletionListInformation, // s: in ALPC_PORT_COMPLETION_LIST_INFORMATION
498  AlpcRegisterCallbackInformation, // kernel-mode only
503 
504 // private
506 {
507  ULONG Flags;
508  ULONG SequenceNo;
509  PVOID PortContext;
511 
512 // private
514 {
518 
519 // private
521 {
522  union
523  {
524  struct
525  {
526  HANDLE ThreadHandle;
527  } In;
528  struct
529  {
530  BOOLEAN ThreadBlocked;
533  } Out;
534  };
536 
537 // private
539 {
540  PVOID Buffer;
541  ULONG Size;
543 
544 // private
546 {
547  PVOID Buffer; // PALPC_COMPLETION_LIST_HEADER
548  ULONG Size;
552 
553 // private
555 {
560 
561 // begin_private
562 
563 #if (PHNT_VERSION >= PHNT_VISTA)
564 
565 // System calls
566 
567 NTSYSCALLAPI
568 NTSTATUS
569 NTAPI
571  _Out_ PHANDLE PortHandle,
572  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
573  _In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes
574  );
575 
576 NTSYSCALLAPI
577 NTSTATUS
578 NTAPI
580  _In_ HANDLE PortHandle,
581  _In_ ULONG Flags
582  );
583 
584 NTSYSCALLAPI
585 NTSTATUS
586 NTAPI
588  _In_opt_ HANDLE PortHandle,
589  _In_ ALPC_PORT_INFORMATION_CLASS PortInformationClass,
590  _Inout_updates_bytes_to_(Length, *ReturnLength) PVOID PortInformation,
591  _In_ ULONG Length,
592  _Out_opt_ PULONG ReturnLength
593  );
594 
595 NTSYSCALLAPI
596 NTSTATUS
597 NTAPI
599  _In_ HANDLE PortHandle,
600  _In_ ALPC_PORT_INFORMATION_CLASS PortInformationClass,
601  _In_reads_bytes_opt_(Length) PVOID PortInformation,
602  _In_ ULONG Length
603  );
604 
605 NTSYSCALLAPI
606 NTSTATUS
607 NTAPI
609  _In_ HANDLE PortHandle,
610  _In_ ULONG Flags,
611  _In_opt_ HANDLE SectionHandle,
612  _In_ SIZE_T SectionSize,
613  _Out_ PALPC_HANDLE AlpcSectionHandle,
614  _Out_ PSIZE_T ActualSectionSize
615  );
616 
617 NTSYSCALLAPI
618 NTSTATUS
619 NTAPI
621  _In_ HANDLE PortHandle,
622  _Reserved_ ULONG Flags,
623  _In_ ALPC_HANDLE SectionHandle
624  );
625 
626 NTSYSCALLAPI
627 NTSTATUS
628 NTAPI
630  _In_ HANDLE PortHandle,
631  _Reserved_ ULONG Flags,
632  _In_ SIZE_T MessageSize,
633  _Out_ PALPC_HANDLE ResourceId
634  );
635 
636 NTSYSCALLAPI
637 NTSTATUS
638 NTAPI
640  _In_ HANDLE PortHandle,
641  _Reserved_ ULONG Flags,
642  _In_ ALPC_HANDLE ResourceId
643  );
644 
645 NTSYSCALLAPI
646 NTSTATUS
647 NTAPI
649  _In_ HANDLE PortHandle,
650  _Reserved_ ULONG Flags,
651  _Inout_ PALPC_DATA_VIEW_ATTR ViewAttributes
652  );
653 
654 NTSYSCALLAPI
655 NTSTATUS
656 NTAPI
658  _In_ HANDLE PortHandle,
659  _Reserved_ ULONG Flags,
660  _In_ PVOID ViewBase
661  );
662 
663 NTSYSCALLAPI
664 NTSTATUS
665 NTAPI
667  _In_ HANDLE PortHandle,
668  _Reserved_ ULONG Flags,
669  _Inout_ PALPC_SECURITY_ATTR SecurityAttribute
670  );
671 
672 NTSYSCALLAPI
673 NTSTATUS
674 NTAPI
676  _In_ HANDLE PortHandle,
677  _Reserved_ ULONG Flags,
678  _In_ ALPC_HANDLE ContextHandle
679  );
680 
681 NTSYSCALLAPI
682 NTSTATUS
683 NTAPI
685  _In_ HANDLE PortHandle,
686  _Reserved_ ULONG Flags,
687  _In_ ALPC_HANDLE ContextHandle
688  );
689 
690 NTSYSCALLAPI
691 NTSTATUS
692 NTAPI
694  _In_ HANDLE PortHandle,
695  _In_ PPORT_MESSAGE PortMessage,
696  _In_ ALPC_MESSAGE_INFORMATION_CLASS MessageInformationClass,
697  _Out_writes_bytes_to_opt_(Length, *ReturnLength) PVOID MessageInformation,
698  _In_ ULONG Length,
699  _Out_opt_ PULONG ReturnLength
700  );
701 
702 #define ALPC_MSGFLG_REPLY_MESSAGE 0x1
703 #define ALPC_MSGFLG_LPC_MODE 0x2 // ?
704 #define ALPC_MSGFLG_RELEASE_MESSAGE 0x10000 // dbg
705 #define ALPC_MSGFLG_SYNC_REQUEST 0x20000 // dbg
706 #define ALPC_MSGFLG_WAIT_USER_MODE 0x100000
707 #define ALPC_MSGFLG_WAIT_ALERTABLE 0x200000
708 #define ALPC_MSGFLG_WOW64_CALL 0x80000000 // dbg
709 
710 NTSYSCALLAPI
711 NTSTATUS
712 NTAPI
714  _Out_ PHANDLE PortHandle,
715  _In_ PUNICODE_STRING PortName,
716  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
717  _In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes,
718  _In_ ULONG Flags,
719  _In_opt_ PSID RequiredServerSid,
720  _Inout_updates_bytes_to_opt_(*BufferLength, *BufferLength) PPORT_MESSAGE ConnectionMessage,
721  _Inout_opt_ PULONG BufferLength,
722  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES OutMessageAttributes,
723  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES InMessageAttributes,
724  _In_opt_ PLARGE_INTEGER Timeout
725  );
726 
727 #if (PHNT_VERSION >= PHNT_WIN8)
728 NTSYSCALLAPI
729 NTSTATUS
730 NTAPI
732  _Out_ PHANDLE PortHandle,
733  _In_ POBJECT_ATTRIBUTES ConnectionPortObjectAttributes,
734  _In_opt_ POBJECT_ATTRIBUTES ClientPortObjectAttributes,
735  _In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes,
736  _In_ ULONG Flags,
737  _In_opt_ PSECURITY_DESCRIPTOR ServerSecurityRequirements,
738  _Inout_updates_bytes_to_opt_(*BufferLength, *BufferLength) PPORT_MESSAGE ConnectionMessage,
739  _Inout_opt_ PSIZE_T BufferLength,
740  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES OutMessageAttributes,
741  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES InMessageAttributes,
742  _In_opt_ PLARGE_INTEGER Timeout
743  );
744 #endif
745 
746 NTSYSCALLAPI
747 NTSTATUS
748 NTAPI
750  _Out_ PHANDLE PortHandle,
751  _In_ HANDLE ConnectionPortHandle,
752  _In_ ULONG Flags,
753  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
754  _In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes,
755  _In_opt_ PVOID PortContext,
756  _In_reads_bytes_(ConnectionRequest->u1.s1.TotalLength) PPORT_MESSAGE ConnectionRequest,
757  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES ConnectionMessageAttributes,
758  _In_ BOOLEAN AcceptConnection
759  );
760 
761 NTSYSCALLAPI
762 NTSTATUS
763 NTAPI
765  _In_ HANDLE PortHandle,
766  _In_ ULONG Flags,
767  _In_reads_bytes_opt_(SendMessage->u1.s1.TotalLength) PPORT_MESSAGE SendMessage,
768  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES SendMessageAttributes,
769  _Out_writes_bytes_to_opt_(*BufferLength, *BufferLength) PPORT_MESSAGE ReceiveMessage,
770  _Inout_opt_ PSIZE_T BufferLength,
771  _Inout_opt_ PALPC_MESSAGE_ATTRIBUTES ReceiveMessageAttributes,
772  _In_opt_ PLARGE_INTEGER Timeout
773  );
774 
775 #define ALPC_CANCELFLG_TRY_CANCEL 0x1 // dbg
776 #define ALPC_CANCELFLG_NO_CONTEXT_CHECK 0x8
777 #define ALPC_CANCELFLGP_FLUSH 0x10000 // dbg
778 
779 NTSYSCALLAPI
780 NTSTATUS
781 NTAPI
783  _In_ HANDLE PortHandle,
784  _In_ ULONG Flags,
785  _In_ PALPC_CONTEXT_ATTR MessageContext
786  );
787 
788 NTSYSCALLAPI
789 NTSTATUS
790 NTAPI
792  _In_ HANDLE PortHandle,
793  _In_ PPORT_MESSAGE Message,
794  _In_ PVOID Flags
795  );
796 
797 #if (PHNT_VERSION >= PHNT_THRESHOLD)
798 NTSYSCALLAPI
799 NTSTATUS
800 NTAPI
802  _In_ HANDLE PortHandle,
803  _In_ PPORT_MESSAGE Message,
804  _In_ ULONG Flags
805  );
806 #endif
807 
808 NTSYSCALLAPI
809 NTSTATUS
810 NTAPI
812  _Out_ PHANDLE ProcessHandle,
813  _In_ HANDLE PortHandle,
814  _In_ PPORT_MESSAGE PortMessage,
815  _In_ ULONG Flags,
816  _In_ ACCESS_MASK DesiredAccess,
817  _In_ POBJECT_ATTRIBUTES ObjectAttributes
818  );
819 
820 NTSYSCALLAPI
821 NTSTATUS
822 NTAPI
824  _Out_ PHANDLE ThreadHandle,
825  _In_ HANDLE PortHandle,
826  _In_ PPORT_MESSAGE PortMessage,
827  _In_ ULONG Flags,
828  _In_ ACCESS_MASK DesiredAccess,
829  _In_ POBJECT_ATTRIBUTES ObjectAttributes
830  );
831 
832 // Support functions
833 
834 NTSYSAPI
835 ULONG
836 NTAPI
838  VOID
839  );
840 
841 NTSYSAPI
842 ULONG
843 NTAPI
845  _In_ ULONG Flags
846  );
847 
848 NTSYSAPI
849 NTSTATUS
850 NTAPI
852  _In_ ULONG AttributeFlags,
853  _Out_opt_ PALPC_MESSAGE_ATTRIBUTES Buffer,
854  _In_ ULONG BufferSize,
855  _Out_ PULONG RequiredBufferSize
856  );
857 
858 NTSYSAPI
859 PVOID
860 NTAPI
862  _In_ PALPC_MESSAGE_ATTRIBUTES Buffer,
863  _In_ ULONG AttributeFlag
864  );
865 
866 NTSYSAPI
867 NTSTATUS
868 NTAPI
870  _In_ HANDLE PortHandle,
871  _Out_ PALPC_COMPLETION_LIST_HEADER Buffer,
872  _In_ ULONG Size,
873  _In_ ULONG ConcurrencyCount,
874  _In_ ULONG AttributeFlags
875  );
876 
877 NTSYSAPI
878 NTSTATUS
879 NTAPI
881  _In_ HANDLE PortHandle
882  );
883 
884 #if (PHNT_VERSION >= PHNT_WIN7)
885 // rev
886 NTSYSAPI
887 NTSTATUS
888 NTAPI
890  _In_ HANDLE PortHandle
891  );
892 #endif
893 
894 NTSYSAPI
895 NTSTATUS
896 NTAPI
898  _In_ HANDLE PortHandle,
899  _In_ ULONG ConcurrencyCount
900  );
901 
902 NTSYSAPI
903 BOOLEAN
904 NTAPI
906  _Inout_ PVOID CompletionList
907  );
908 
909 NTSYSAPI
910 BOOLEAN
911 NTAPI
913  _Inout_ PVOID CompletionList
914  );
915 
916 NTSYSAPI
917 VOID
918 NTAPI
920  _In_ PVOID CompletionList,
921  _Out_ PULONG LastMessageId,
922  _Out_ PULONG LastCallbackId
923  );
924 
925 NTSYSAPI
926 ULONG
927 NTAPI
929  _In_ PVOID CompletionList
930  );
931 
932 NTSYSAPI
933 PPORT_MESSAGE
934 NTAPI
936  _In_ PVOID CompletionList,
937  _Out_opt_ PALPC_MESSAGE_ATTRIBUTES *MessageAttributes
938  );
939 
940 NTSYSAPI
941 VOID
942 NTAPI
944  _Inout_ PVOID CompletionList,
945  _In_ PPORT_MESSAGE Message
946  );
947 
948 NTSYSAPI
949 PALPC_MESSAGE_ATTRIBUTES
950 NTAPI
952  _In_ PVOID CompletionList,
953  _In_ PPORT_MESSAGE Message
954  );
955 
956 #endif
957 
958 // end_private
959 
960 #endif