The only thing “faster” than a spin lock is an in stack queued spin
lock. All dispatcher objects in the system (including KEVENT objects)
are covered with the system global dispatcher database lock.
Of course, none of this matters when running on a UP system, since none
of the interlocked memory nonsense is used at all. But unless you are
talking about something you expect to be doing thousands (or tens of
thousands) of times per second the performance of the KEVENT is not
likely to make any appreciable difference.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei Ciubotaru
[Hardwired]
Sent: Sunday, August 28, 2005 10:19 PM
To: ntdev redirect
Subject: Re: [ntdev] ObReferenceObjectByName
I got used with __try… i put it everywhere i have the ocasion:) - bad
habbit.
I’ll try with the event. Is it faster that the spin lock? What if
somewhere I am not allowed to wait?.. i got about 80 BSODs today…
Thank you,
Andrei Ciubotaru
Mark Roddy wrote:
If you are at passive level and need to serialize against other passive
level threads, consider using a resource lock or an event lock instead.
By
the way, the exception handling should not be neccesary.
=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei
>Ciubotaru [Hardwired]
>Sent: Sunday, August 28, 2005 8:06 PM
>To: Windows System Software Devs Interest List
>Subject: Re: [ntdev] ObReferenceObjectByName
>
>Thank you! I solved the problem with ZwOpenEvent. Works just
>fine. But my real problem was something else. I made the same
>mistake with ZwOpenEvent too. Soemthing like this:
>
>KeAcquireSpinLock( &SomeSpin, &irql );
>__try
>{
> ZwOpen…
> ZwClose…
>}
>__finally
>{
> KeReleaseSpinLock( &SomeSpin, irql ); }
>
>It seems that it’s not a good thing to acquire a spin lock
>and try open/access/close some named object :). This made me
>realize that I don’t know s#$@ and put my hands on THE BOOK again!
>
>Again, thank you for your help. Anyway I managed to get
>“Windows Native API” book. Till MS releases the next
>ddk(let’s all pray that “the one to rules them all” thinks to
>properly document this) this one rules.
>
>
>Thank you,
>
>Andrei Ciubotaru
>
>
>
>
>
>Mark Roddy wrote:
>
>
>
>>ZwOpenEvent remains undocumented. However I think you should
>>
>>
>be able to
>
>
>>set the parameters to ZwCreateEvent such that it will not succeed if
>>the event does not exist. The entire IFS kit is in the WDK - so you
>>should really just go download it. No ZwCreateMutex.
>>
>>=====================
>>Mark Roddy DDK MVP
>>Windows 2003/XP/2000 Consulting
>>Hollis Technology Solutions 603-321-1032 www.hollistech.com
>>
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: xxxxx@lists.osr.com
>>>[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei
>>>Ciubotaru [Hardwired]
>>>Sent: Sunday, August 28, 2005 1:28 PM
>>>To: Windows System Software Devs Interest List
>>>Subject: Re: [ntdev] ObReferenceObjectByName
>>>
>>>Mark, please can you give more info about ZwOpenEvent?
>>>Momentarly I cannot download the beta. Or point me where to
>>>
>>>
>look for.
>
>
>>>Here on OSR I haven’t found any relevant info
>>>about: ZwCreate/OpenXXXX(event or mutexes). Is this ZwOpenEvent
>>>working on <= DISPATCH_LEVEL? Is it faster or slower than
>>>ObReferenceObjectByName?
>>>
>>>
>>>Thank you,
>>>
>>>Andrei Ciubotaru
>>>
>>>
>>>
>>>
>>>
>>>Mark Roddy wrote:
>>>
>>>
>>>
>>>
>>>
>>>>It would help if you provided the windbg ‘analyze -v’ output
>>>>
>>>>
>>>>
>>>>
>>>from the
>>
>>
>>>
>>>
>>>
>>>
>>>>bugcheck. The only obvious error in your code is the following:
>>>>
>>>>if( STATUS_SUCCESS != status )
>>>> {
>>>> goto clean_up;
>>>> }
>>>>
>>>>Which should of course be written instead as:
>>>>
>>>>if (!NT_SUCCESS(status))
>>>>{
>>>> goto clean_up;
>>>>}
>>>>
>>>>Also see ZwCreateEvent which is now documented outside of
>>>>
>>>>
>>>>
>>>>
>>>the ifs kit
>>>
>>>
>>>
>>>
>>>>in the beta WDK.
>>>>
>>>>=====================
>>>>Mark Roddy DDK MVP
>>>>Windows 2003/XP/2000 Consulting
>>>>Hollis Technology Solutions 603-321-1032 www.hollistech.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: xxxxx@lists.osr.com
>>>>>[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei
>>>>>Ciubotaru [Hardwired]
>>>>>Sent: Sunday, August 28, 2005 7:40 AM
>>>>>To: Windows System Software Devs Interest List
>>>>>Subject: [ntdev] ObReferenceObjectByName
>>>>>
>>>>>Hello,
>>>>>
>>>>>Can anyone tell me if it’s something wrong here? I get a BSOD…
>>>>>
>>>>>
>>>>>…
>>>>> UNICODE_STRING uszCore;
>>>>> KEVENT *pObCore;
>>>>> NTSTATUS status;
>>>>>
>>>>>…
>>>>>
>>>>> RtlInitUnicodeString( &uszCore,
>>>>>L"\BaseNamedObjects\MyStopEvent" );
>>>>> status = ObReferenceObjectByName(
>>>>> &uszCore,
>>>>> OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT,
>>>>> NULL,
>>>>> 0,
>>>>> (POBJECT_TYPE)ExEventObjectType,
>>>>> KernelMode,
>>>>> NULL,
>>>>> &pObCore );
>>>>> if( STATUS_SUCCESS != status )
>>>>> {
>>>>> goto clean_up;
>>>>> }
>>>>> ObDereferenceObject( pObCore );
>>>>>…
>>>>>
>>>>>
>>>>>MyStopEvent it’s an event created by an windows application.
>>>>>I want to see if this event exists. If exists I just
>>>>>
>>>>>
>dereference it
>
>
>>>>>because i don’t need the object anymore.
>>>>>
>>>>>–
>>>>>Thank you,
>>>>>
>>>>>Andrei Ciubotaru
>>>>>
>>>>>
>>>>>—
>>>>>Questions? First check the Kernel Driver FAQ at
>>>>>http://www.osronline.com/article.cfm?id=256
>>>>>
>>>>>You are currently subscribed to ntdev as:
>>>>>xxxxx@hollistech.com To unsubscribe send a blank email to
>>>>>xxxxx@lists.osr.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>—
>>>>Questions? First check the Kernel Driver FAQ at
>>>>http://www.osronline.com/article.cfm?id=256
>>>>
>>>>You are currently subscribed to ntdev as: xxxxx@icode.ro To
>>>>unsubscribe send a blank email to xxxxx@lists.osr.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>—
>>>Questions? First check the Kernel Driver FAQ at
>>>http://www.osronline.com/article.cfm?id=256
>>>
>>>You are currently subscribed to ntdev as:
>>>xxxxx@hollistech.com To unsubscribe send a blank email to
>>>xxxxx@lists.osr.com
>>>
>>>
>>>
>>>
>>>
>>
>>—
>>Questions? First check the Kernel Driver FAQ at
>>http://www.osronline.com/article.cfm?id=256
>>
>>You are currently subscribed to ntdev as: xxxxx@icode.ro To
>>unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>>
>>
>>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as:
>xxxxx@hollistech.com To unsubscribe send a blank email to
>xxxxx@lists.osr.com
>
>
>
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@icode.ro
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com