[ros-dev] Re:[ros-svn] [ion] 12748: Fix incorrect LPC Object export...we export pointers not the object itself! Also remove more TIME stuf

Emanuele Aliberti ea at iol.it
Mon Jan 3 21:22:22 CET 2005


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



More information about the Ros-dev mailing list