Fix incorrect LPC Object export...we export pointers not the object itself! Also remove more TIME stuff to be properly compatible with real structures.

svn path=/trunk/; revision=12748
This commit is contained in:
Alex Ionescu 2005-01-03 05:17:16 +00:00
parent b429ae3287
commit 91fc5d1804
14 changed files with 58 additions and 60 deletions

View file

@ -62,7 +62,7 @@ typedef struct _LPC_DBG_MESSAGE
typedef struct _LPC_TERMINATION_MESSAGE
{
LPC_MESSAGE Header;
TIME CreationTime;
LARGE_INTEGER CreationTime;
} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE;
#endif /* __INCLUDE_NAPI_DBG_H */

View file

@ -729,10 +729,10 @@ typedef struct _VM_COUNTERS_
// Information class 4
typedef struct _KERNEL_USER_TIMES
{
TIME CreateTime;
TIME ExitTime;
TIME KernelTime;
TIME UserTime;
LARGE_INTEGER CreateTime;
LARGE_INTEGER ExitTime;
LARGE_INTEGER KernelTime;
LARGE_INTEGER UserTime;
} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
// Information class 9
@ -1324,9 +1324,9 @@ typedef struct _SYSTEM_PROCESSES_NT4
SIZE_T NextEntryDelta;
ULONG ThreadCount;
ULONG Reserved1[6];
TIME CreateTime;
TIME UserTime;
TIME KernelTime;
LARGE_INTEGER CreateTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER KernelTime;
UNICODE_STRING ProcessName;
KPRIORITY BasePriority;
ULONG ProcessId;
@ -1342,9 +1342,9 @@ typedef struct _SYSTEM_PROCESSES_NT5
SIZE_T NextEntryDelta;
ULONG ThreadCount;
ULONG Reserved1[6];
TIME CreateTime;
TIME UserTime;
TIME KernelTime;
LARGE_INTEGER CreateTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER KernelTime;
UNICODE_STRING ProcessName;
KPRIORITY BasePriority;
ULONG ProcessId;

View file

@ -65,7 +65,7 @@ LpcRequestPort (PEPORT Port,
NTSTATUS
STDCALL
LpcSendTerminationPort (PEPORT Port,
TIME CreationTime);
LARGE_INTEGER CreationTime);
/* EPORT.Type */
@ -140,7 +140,7 @@ NiInitializePort (IN OUT PEPORT Port,
NTSTATUS
NiInitPort (VOID);
extern OBJECT_TYPE LpcPortObjectType;
extern POBJECT_TYPE LpcPortObjectType;
extern ULONG LpcpNextMessageId;
extern FAST_MUTEX LpcpLock;

View file

@ -160,11 +160,11 @@ typedef struct _ETHREAD
{
KTHREAD Tcb;
union {
TIME CreateTime;
LARGE_INTEGER CreateTime;
UCHAR NestedFaultCount:2;
UCHAR ApcNeeded:1;
};
TIME ExitTime;
LARGE_INTEGER ExitTime;
LIST_ENTRY LpcReplyChain;
NTSTATUS ExitStatus;
PVOID OfsChain;
@ -316,14 +316,10 @@ struct _EPROCESS
ULONG LockCount; /* 07C */
/* Time of process creation. */
#ifdef __USE_W32API
LARGE_INTEGER CreateTime; /* 080 */
#else
TIME CreateTime; /* 080 */
#endif
LARGE_INTEGER CreateTime; /* 080 */
/* Time of process exit. */
TIME ExitTime; /* 088 */
LARGE_INTEGER ExitTime; /* 088 */
/* Unknown. */
PKTHREAD LockOwner; /* 090 */
/* Process id. */

View file

@ -46,7 +46,7 @@ NtCompleteConnectPort (HANDLE hServerSideCommPort)
*/
Status = ObReferenceObjectByHandle (hServerSideCommPort,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&ReplyPort,
NULL);

View file

@ -66,7 +66,7 @@ EiConnectPort(IN PEPORT* ConnectedPort,
* Create a port to represent our side of the connection
*/
Status = ObCreateObject (KernelMode,
& LpcPortObjectType,
LpcPortObjectType,
NULL,
KernelMode,
NULL,
@ -333,7 +333,7 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
0,
NULL,
PORT_ALL_ACCESS, /* DesiredAccess */
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
NULL,
(PVOID*)&NamedPort);
@ -547,7 +547,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
Status = ObReferenceObjectByHandle(NamedPortHandle,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&NamedPort,
NULL);
@ -563,7 +563,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
if (AcceptIt)
{
Status = ObCreateObject(ExGetPreviousMode(),
& LpcPortObjectType,
LpcPortObjectType,
NULL,
ExGetPreviousMode(),
NULL,

View file

@ -134,7 +134,7 @@ NtCreatePort (PHANDLE PortHandle,
/* Ask Ob to create the object */
Status = ObCreateObject (ExGetPreviousMode(),
& LpcPortObjectType,
LpcPortObjectType,
ObjectAttributes,
ExGetPreviousMode(),
NULL,

View file

@ -21,7 +21,7 @@
/* GLOBALS *******************************************************************/
OBJECT_TYPE LpcPortObjectType = {0, };
POBJECT_TYPE LpcPortObjectType = 0;
ULONG LpcpNextMessageId = 0; /* 0 is not a valid ID */
FAST_MUTEX LpcpLock; /* global internal sync in LPC facility */
@ -37,30 +37,32 @@ static GENERIC_MAPPING ExpPortMapping = {
NTSTATUS INIT_FUNCTION
NiInitPort (VOID)
{
RtlZeroMemory (& LpcPortObjectType, sizeof (OBJECT_TYPE));
/* Allocate Memory for the LPC Object */
LpcPortObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
RtlZeroMemory (LpcPortObjectType, sizeof (OBJECT_TYPE));
RtlRosInitUnicodeStringFromLiteral(&LpcPortObjectType.TypeName,L"Port");
RtlRosInitUnicodeStringFromLiteral(&LpcPortObjectType->TypeName,L"Port");
LpcPortObjectType.Tag = TAG('L', 'P', 'R', 'T');
LpcPortObjectType.MaxObjects = ULONG_MAX;
LpcPortObjectType.MaxHandles = ULONG_MAX;
LpcPortObjectType.TotalObjects = 0;
LpcPortObjectType.TotalHandles = 0;
LpcPortObjectType.PagedPoolCharge = 0;
LpcPortObjectType.NonpagedPoolCharge = sizeof(EPORT);
LpcPortObjectType.Mapping = &ExpPortMapping;
LpcPortObjectType.Dump = NULL;
LpcPortObjectType.Open = NULL;
LpcPortObjectType.Close = NiClosePort;
LpcPortObjectType.Delete = NiDeletePort;
LpcPortObjectType.Parse = NULL;
LpcPortObjectType.Security = NULL;
LpcPortObjectType.QueryName = NULL;
LpcPortObjectType.OkayToClose = NULL;
LpcPortObjectType.Create = NiCreatePort;
LpcPortObjectType.DuplicationNotify = NULL;
LpcPortObjectType->Tag = TAG('L', 'P', 'R', 'T');
LpcPortObjectType->MaxObjects = ULONG_MAX;
LpcPortObjectType->MaxHandles = ULONG_MAX;
LpcPortObjectType->TotalObjects = 0;
LpcPortObjectType->TotalHandles = 0;
LpcPortObjectType->PagedPoolCharge = 0;
LpcPortObjectType->NonpagedPoolCharge = sizeof(EPORT);
LpcPortObjectType->Mapping = &ExpPortMapping;
LpcPortObjectType->Dump = NULL;
LpcPortObjectType->Open = NULL;
LpcPortObjectType->Close = NiClosePort;
LpcPortObjectType->Delete = NiDeletePort;
LpcPortObjectType->Parse = NULL;
LpcPortObjectType->Security = NULL;
LpcPortObjectType->QueryName = NULL;
LpcPortObjectType->OkayToClose = NULL;
LpcPortObjectType->Create = NiCreatePort;
LpcPortObjectType->DuplicationNotify = NULL;
ObpCreateTypeObject(& LpcPortObjectType);
ObpCreateTypeObject(LpcPortObjectType);
LpcpNextMessageId = 0;

View file

@ -50,7 +50,7 @@ NtQueryInformationPort (IN HANDLE PortHandle,
Status = ObReferenceObjectByHandle (PortHandle,
PORT_ALL_ACCESS, /* AccessRequired */
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID *) & Port,
NULL);

View file

@ -88,7 +88,7 @@ NtReplyPort (IN HANDLE PortHandle,
Status = ObReferenceObjectByHandle(PortHandle,
PORT_ALL_ACCESS, /* AccessRequired */
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&Port,
NULL);
@ -154,7 +154,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
Status = ObReferenceObjectByHandle(PortHandle,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&Port,
NULL);

View file

@ -30,7 +30,7 @@
*/
NTSTATUS STDCALL
LpcSendTerminationPort (IN PEPORT Port,
IN TIME CreationTime)
IN LARGE_INTEGER CreationTime)
{
NTSTATUS Status;
LPC_TERMINATION_MESSAGE Msg;
@ -180,7 +180,7 @@ NTSTATUS STDCALL NtRequestPort (IN HANDLE PortHandle,
Status = ObReferenceObjectByHandle(PortHandle,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&Port,
NULL);
@ -231,7 +231,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
Status = ObReferenceObjectByHandle(PortHandle,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&Port,
NULL);

View file

@ -448,7 +448,7 @@ NtRegisterThreadTerminatePort(HANDLE PortHandle)
Status = ObReferenceObjectByHandle(PortHandle,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
KeGetCurrentThread()->PreviousMode,
(PVOID*)&TerminationPort,
NULL);

View file

@ -745,7 +745,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
{
Status = ObReferenceObjectByHandle(DebugPort,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&pDebugPort,
NULL);
@ -767,7 +767,7 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
{
Status = ObReferenceObjectByHandle(ExceptionPort,
PORT_ALL_ACCESS,
& LpcPortObjectType,
LpcPortObjectType,
UserMode,
(PVOID*)&pExceptionPort,
NULL);

View file

@ -253,9 +253,9 @@ NtQueryInformationThread (IN HANDLE ThreadHandle,
case ThreadTimes:
u.TTI.KernelTime.QuadPart = Thread->Tcb.KernelTime * 100000LL;
u.TTI.UserTime.QuadPart = Thread->Tcb.UserTime * 100000LL;
u.TTI.CreateTime = (TIME) Thread->CreateTime;
u.TTI.CreateTime = Thread->CreateTime;
/*This works*/
u.TTI.ExitTime = (TIME) Thread->ExitTime;
u.TTI.ExitTime = Thread->ExitTime;
break;
case ThreadQuerySetWin32StartAddress: