00040                    :
00041 
00042     This routine should be used to query an lpc port, but 
is pretty much a
00043     noop.  Currently 
it can 
only indicate 
if the input handle 
is for a port
00044     object.
00045 
00046 Arguments:
00047 
00048     
PortHandle - Supplies 
the handle 
for the port being queried
00049 
00050     PortInformationClass - Specifies 
the type information 
class being asked
00051         for.  Currently ignored.
00052 
00053     PortInformation - Supplies a pointer to 
the buffer to receive 
the
00054         information.  Currently just probed and then ignored.
00055 
00056     Length - Specifies, in bytes, 
the size of 
the port information buffer.
00057 
00058     ReturnLength  - Optionally receives 
the size, in bytes, of 
the information
00059         being returned.  Currently just probed and then ignored.
00060 
00061 Return Value:
00062 
00063     
NTSTATUS - An appropriate status value.
00064 
00065 --*/
00066 
00067 {
00068     
KPROCESSOR_MODE PreviousMode;
00069     
NTSTATUS Status;
00070     
PLPCP_PORT_OBJECT PortObject;
00071 
00072     
PAGED_CODE();
00073 
00074     
00075     
00076     
00077 
00078     PreviousMode = KeGetPreviousMode();
00079 
00080     
if (PreviousMode != 
KernelMode) {
00081 
00082         
try {
00083 
00084             
ProbeForWrite( PortInformation,
00085                            Length,
00086                            
sizeof( ULONG ));
00087 
00088             
if (ARGUMENT_PRESENT( ReturnLength )) {
00089 
00090                 
ProbeForWriteUlong( ReturnLength );
00091             }
00092 
00093         } except( EXCEPTION_EXECUTE_HANDLER ) {
00094 
00095             
return( GetExceptionCode() );
00096         }
00097     }
00098 
00099     
00100     
00101     
00102     
00103 
00104     
if (ARGUMENT_PRESENT( PortHandle )) {
00105 
00106         
Status = 
ObReferenceObjectByHandle( PortHandle,
00107                                             GENERIC_READ,
00108                                             LpcPortObjectType,
00109                                             PreviousMode,
00110                                             &PortObject,
00111                                             NULL );
00112 
00113         
if (!
NT_SUCCESS( Status )) {
00114 
00115             
return( 
Status );
00116         }
00117 
00118         
ObDereferenceObject( PortObject );
00119 
00120         
return STATUS_SUCCESS;
00121 
00122     } 
else {
00123 
00124         
return STATUS_INVALID_INFO_CLASS;
00125     }
00126 }
}