00036 :
00037
00038
A server thread can listen
for connection requests from client threads
00039
using the NtReplyWaitReceivePort service and looking
for an
00040 LPC_CONNECTION_REQUEST message
type.
00041
00042 This call will loop, calling
the NtReplyWaitReceivePort service, and
00043
return when
it sees a message of
type LPC_CONNECTION_REQUEST
00044
00045 Arguments:
00046
00047
PortHandle - Specifies
the connection port to listen
for connection
00048 requests to.
00049
00050 ConnectionRequest - Pointer to a structure that describes
the
00051 connection request
the client
is making:
00052
00053 Return Value:
00054
00055
NTSTATUS - An appropriate status value
00056
00057 --*/
00058
00059 {
00060
NTSTATUS Status;
00061
00062
PAGED_CODE();
00063
00064
00065
00066
00067
00068
while (
TRUE) {
00069
00070
Status =
NtReplyWaitReceivePort( PortHandle,
00071 NULL,
00072 NULL,
00073 ConnectionRequest );
00074
00075
00076
00077
00078
00079
00080
00081
00082
try {
00083
00084
if ((
Status != STATUS_SUCCESS) ||
00085 ((ConnectionRequest->u2.s2.Type & ~LPC_KERNELMODE_MESSAGE) == LPC_CONNECTION_REQUEST)) {
00086
00087
break;
00088 }
00089
00090 } except( EXCEPTION_EXECUTE_HANDLER ) {
00091
00092
Status = GetExceptionCode();
00093
00094
break;
00095 }
00096 }
00097
00098
00099
00100
00101
00102
return Status;
00103 }
}