Hi Hartmut:
I've add some code to my test driver:
Status = ZwCreateEvent(&hEvent, EVENT_ALL_ACCESS, NULL,
NotificationEvent, FALSE);
DPRINT1("%x\n", Status);
if (NT_SUCCESS(Status))
{
Status = ObReferenceObjectByHandle(hEvent, EVENT_ALL_ACCESS,
(POBJECT_TYPE)ExEventObjectType, KernelMode, (PVOID*)&Event, NULL);
DPRINT1("%x\n", Status);
if (NT_SUCCESS(Status))
{
ObDereferenceObject((PVOID)Event);
}
Status = ObReferenceObjectByHandle(hEvent, EVENT_ALL_ACCESS,
(POBJECT_TYPE)&ExEventObjectType, KernelMode, (PVOID*)&Event, NULL);
DPRINT1("%x\n", Status);
if (NT_SUCCESS(Status))
{
ObDereferenceObject((PVOID)Event);
}
ZwClose(hEvent);
}
The result on W2K is:
(memtest.c:185) 0
(memtest.c:189) 0
(memtest.c: 195) c0000024 -> STATUS_OBJECT_TYPE_MISMATCH
This means Alex's changes and the other object type initialisations
are correct.
Compiled with DDK headers or w32api's ones?
Before making LpcPortObjectType static, which you and Filip show is
actually wrong with respect to DDK headers, my first try was allocating
the *OBJECT_TYPE calling
ExAllocatePoolWithTag(NonPagedPool,sizeof(OBJECT_TYPE),TAG_OBJECT_TYPE);
which should be fine.
Emanuele