Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

lpcquery.c

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1989 Microsoft Corporation 00004 00005 Module Name: 00006 00007 lpcquery.c 00008 00009 Abstract: 00010 00011 Local Inter-Process Communication (LPC) query services 00012 00013 Author: 00014 00015 Steve Wood (stevewo) 15-May-1989 00016 00017 Revision History: 00018 00019 --*/ 00020 00021 #include "lpcp.h" 00022 00023 #ifdef ALLOC_PRAGMA 00024 #pragma alloc_text(PAGE,NtQueryInformationPort) 00025 #endif 00026 00027 00028 NTSTATUS 00029 NTAPI 00030 NtQueryInformationPort ( 00031 IN HANDLE PortHandle OPTIONAL, 00032 IN PORT_INFORMATION_CLASS PortInformationClass, 00033 OUT PVOID PortInformation, 00034 IN ULONG Length, 00035 OUT PULONG ReturnLength OPTIONAL 00036 ) 00037 00038 /*++ 00039 00040 Routine Description: 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 // Get previous processor mode and probe output argument if necessary. 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 // If the user gave us a handle then reference the object. And return 00101 // success if we got a good reference and an error otherwise. 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 }

Generated on Sat May 15 19:40:39 2004 for test by doxygen 1.3.7