Re[2]: IoCreateSynchronizationEvent

Hello Maxim,

No my DriverEntry runs on demand, i.e. I load the driver using SCM
manually.
I tried to do it in dispatch routine as well and it doesn’t work.
I even tried to create an event not in BasedNamedObjects and it
doesn’t work too.
It seems that IoCreateSynchronizationEvent doesn’t work at all.

If I pass a handle and will get KEVENT object for the handle will I
be able to use this object in context of other processes?


Roman Kudinov

mailto:xxxxx@rbcmail.ru

Monday, August 30, 2004, 1:45:03 PM, you wrote:

MSS> Surely.
MSS> Your DriverEntry runs too early, when BaseNamedObjects is not created yet.

MSS> Do not use named events. Instead, register the event by passing its handle
MSS> via IOCTL parameter.

MSS> Maxim Shatskih, Windows DDK MVP
MSS> StorageCraft Corporation
MSS> xxxxx@storagecraft.com
MSS> http://www.storagecraft.com

MSS> ----- Original Message -----
MSS> From: “Roman Kudinov”
MSS> To: “Windows File Systems Devs Interest List”
MSS> Sent: Monday, August 30, 2004 1:36 PM
MSS> Subject: [ntfsd] IoCreateSynchronizationEvent

>> Hi,
>>
>> I can’t create a named event in my DriverEntry routine. Here is the
>> snippet of code:
>> --------------------------------------------
>> RtlInitUnicodeString(&strEventName,
MSS> L"\\BasedNamedObjects\DITEvent");
>>
>> pEvent = IoCreateSynchronizationEvent(&strEventName, &hEvent);
>> if(!pEvent) //I can’t create a named event, so for the
>> //testing purposes I create a regular event
>> {
>> KeInitializeEvent(&kEvent, SynchronizationEvent, FALSE);
>> pEvent = &kEvent;
>> }
>> --------------------------------------------
>>
>> I tried both
>> - to create the named event in user mode first
>> - to create the named event in kernel mode first
>>
>> pEvent and hEvent are NULL after call to IoCreateSynchronizationEvent.
>>
>>
>>
>> I define variables on the global scope:
>> PKEVENT pEvent;
>> HANDLE hEvent;
>>
>>
>>
>> –
>> Roman Kudinov
>>
>>
>> mailto:xxxxx@rbcmail.ru
>>
>>
>> —
>> Questions? First check the IFS FAQ at
MSS> https://www.osronline.com/article.cfm?id=17
>>
>> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
>> To unsubscribe send a blank email to
>> xxxxx@lists.osr.com

MSS> —
MSS> Questions? First check the IFS FAQ at
MSS> https://www.osronline.com/article.cfm?id=17

MSS> You are currently subscribed to ntfsd as: xxxxx@rbcmail.ru
MSS> To unsubscribe send a blank email to
MSS> xxxxx@lists.osr.com

Try using ZwCreateEvent instead - while it won't DO anything extra for
you, it will give you back better error values that should assist you in
debugging this. Once you have figured out the specific problem, you
should be able to switch back to IoCreateSynchronizationEvent.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roman Kudinov
Sent: Monday, August 30, 2004 5:36 AM
To: ntfsd redirect
Subject: [ntfsd] IoCreateSynchronizationEvent

Hi,

I can't create a named event in my DriverEntry routine. Here is the
snippet of code:

RtlInitUnicodeString(&strEventName,
L"\\BasedNamedObjects\DITEvent");

pEvent = IoCreateSynchronizationEvent(&strEventName, &hEvent);
if(!pEvent) //I can't create a named event, so for the
//testing purposes I create a regular event
{
KeInitializeEvent(&kEvent, SynchronizationEvent, FALSE);
pEvent = &kEvent;
}

I tried both

  • to create the named event in user mode first
  • to create the named event in kernel mode first

pEvent and hEvent are NULL after call to IoCreateSynchronizationEvent.

I define variables on the global scope:
PKEVENT pEvent;
HANDLE hEvent;

--
Roman Kudinov

mailto:xxxxx@rbcmail.ru


Questions? First check the IFS FAQ at

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Roman..

Try this...this should work fine....


RtlInitUnicodeString(&strEventName,
L"\BasedNamedObjects\DITEvent");

pEvent = IoCreateSynchronizationEvent(&strEventName, &hEvent);

Good luck ...

Cheers
K.Raju

-----Original Message-----
From: Roman Kudinov [mailto:xxxxx@rbcmail.ru]
Sent: Monday, August 30, 2004 4:42 PM
To: Windows File Systems Devs Interest List
Subject: Re[2]: [ntfsd] IoCreateSynchronizationEvent

Hello Maxim,

No my DriverEntry runs on demand, i.e. I load the driver using SCM
manually.
I tried to do it in dispatch routine as well and it doesn't work.
I even tried to create an event not in BasedNamedObjects and it doesn't
work too.
It seems that IoCreateSynchronizationEvent doesn't work at all.

If I pass a handle and will get KEVENT object for the handle will I be
able to use this object in context of other processes?

--
Roman Kudinov

mailto:xxxxx@rbcmail.ru

Monday, August 30, 2004, 1:45:03 PM, you wrote:

MSS> Surely.
MSS> Your DriverEntry runs too early, when BaseNamedObjects is not
created yet.

MSS> Do not use named events. Instead, register the event by passing
its handle
MSS> via IOCTL parameter.

MSS> Maxim Shatskih, Windows DDK MVP
MSS> StorageCraft Corporation
MSS> xxxxx@storagecraft.com
MSS> http://www.storagecraft.com

MSS> ----- Original Message -----
MSS> From: "Roman Kudinov"
MSS> To: "Windows File Systems Devs Interest List"
MSS> Sent: Monday, August 30, 2004 1:36 PM
MSS> Subject: [ntfsd] IoCreateSynchronizationEvent

>> Hi,
>>
>> I can't create a named event in my DriverEntry routine. Here is the
>> snippet of code:
>> --------------------------------------------
>> RtlInitUnicodeString(&strEventName,
MSS> L"\\BasedNamedObjects\DITEvent");
>>
>> pEvent = IoCreateSynchronizationEvent(&strEventName,
&hEvent);
>> if(!pEvent) //I can't create a named event, so for the
>> //testing purposes I create a regular event
>> {
>> KeInitializeEvent(&kEvent, SynchronizationEvent,
FALSE);
>> pEvent = &kEvent;
>> }
>> --------------------------------------------
>>
>> I tried both
>> - to create the named event in user mode first
>> - to create the named event in kernel mode first
>>
>> pEvent and hEvent are NULL after call to
IoCreateSynchronizationEvent.
>>
>>
>>
>> I define variables on the global scope:
>> PKEVENT pEvent;
>> HANDLE hEvent;
>>
>>
>>
>> --
>> Roman Kudinov
>>
>>
>> mailto:xxxxx@rbcmail.ru
>>
>>
>> ---
>> Questions? First check the IFS FAQ at
MSS> The NT Insider:Windows NT Virtual Memory (Part I)
>>
>> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
>> To unsubscribe send a blank email to
>> xxxxx@lists.osr.com

MSS> ---
MSS> Questions? First check the IFS FAQ at
MSS> The NT Insider:Windows NT Virtual Memory (Part I)

MSS> You are currently subscribed to ntfsd as: xxxxx@rbcmail.ru
MSS> To unsubscribe send a blank email to
MSS> xxxxx@lists.osr.com

---
Questions? First check the IFS FAQ at
The NT Insider:Windows NT Virtual Memory (Part I)

You are currently subscribed to ntfsd as: xxxxx@inquesttechnologies.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi roman...

Bit typo mistake...try this out plz...this should work fine...


RtlInitUnicodeString(&strEventName,L"\BaseNamedObjects\DITEvent");

pEvent = IoCreateSynchronizationEvent(&strEventName, &hEvent);


Chrs
K.Raju

-----Original Message-----
From: Krishnama Raju
Sent: Monday, August 30, 2004 6:11 PM
To: Windows File Systems Devs Interest List
Subject: RE: Re[2]: [ntfsd] IoCreateSynchronizationEvent

Hi Roman..

Try this...this should work fine....


RtlInitUnicodeString(&strEventName,
L"\BasedNamedObjects\DITEvent");

pEvent = IoCreateSynchronizationEvent(&strEventName, &hEvent);

Good luck ...

Cheers
K.Raju

-----Original Message-----
From: Roman Kudinov [mailto:xxxxx@rbcmail.ru]
Sent: Monday, August 30, 2004 4:42 PM
To: Windows File Systems Devs Interest List
Subject: Re[2]: [ntfsd] IoCreateSynchronizationEvent

Hello Maxim,

No my DriverEntry runs on demand, i.e. I load the driver using SCM
manually.
I tried to do it in dispatch routine as well and it doesn't work.
I even tried to create an event not in BasedNamedObjects and it doesn't
work too.
It seems that IoCreateSynchronizationEvent doesn't work at all.

If I pass a handle and will get KEVENT object for the handle will I be
able to use this object in context of other processes?

--
Roman Kudinov

mailto:xxxxx@rbcmail.ru

Monday, August 30, 2004, 1:45:03 PM, you wrote:

MSS> Surely.
MSS> Your DriverEntry runs too early, when BaseNamedObjects is not
created yet.

MSS> Do not use named events. Instead, register the event by passing
its handle
MSS> via IOCTL parameter.

MSS> Maxim Shatskih, Windows DDK MVP
MSS> StorageCraft Corporation
MSS> xxxxx@storagecraft.com
MSS> http://www.storagecraft.com

MSS> ----- Original Message -----
MSS> From: "Roman Kudinov"
MSS> To: "Windows File Systems Devs Interest List"
MSS> Sent: Monday, August 30, 2004 1:36 PM
MSS> Subject: [ntfsd] IoCreateSynchronizationEvent

>> Hi,
>>
>> I can't create a named event in my DriverEntry routine. Here is the
>> snippet of code:
>> --------------------------------------------
>> RtlInitUnicodeString(&strEventName,
MSS> L"\\BasedNamedObjects\DITEvent");
>>
>> pEvent = IoCreateSynchronizationEvent(&strEventName,
&hEvent);
>> if(!pEvent) //I can't create a named event, so for the
>> //testing purposes I create a regular event
>> {
>> KeInitializeEvent(&kEvent, SynchronizationEvent,
FALSE);
>> pEvent = &kEvent;
>> }
>> --------------------------------------------
>>
>> I tried both
>> - to create the named event in user mode first
>> - to create the named event in kernel mode first
>>
>> pEvent and hEvent are NULL after call to
IoCreateSynchronizationEvent.
>>
>>
>>
>> I define variables on the global scope:
>> PKEVENT pEvent;
>> HANDLE hEvent;
>>
>>
>>
>> --
>> Roman Kudinov
>>
>>
>> mailto:xxxxx@rbcmail.ru
>>
>>
>> ---
>> Questions? First check the IFS FAQ at
MSS> The NT Insider:Windows NT Virtual Memory (Part I)
>>
>> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
>> To unsubscribe send a blank email to
>> xxxxx@lists.osr.com

MSS> ---
MSS> Questions? First check the IFS FAQ at
MSS> The NT Insider:Windows NT Virtual Memory (Part I)

MSS> You are currently subscribed to ntfsd as: xxxxx@rbcmail.ru
MSS> To unsubscribe send a blank email to
MSS> xxxxx@lists.osr.com

---
Questions? First check the IFS FAQ at
The NT Insider:Windows NT Virtual Memory (Part I)

You are currently subscribed to ntfsd as: xxxxx@inquesttechnologies.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

---
Questions? First check the IFS FAQ at
The NT Insider:Windows NT Virtual Memory (Part I)

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com

> If I pass a handle and will get KEVENT object for the handle will I

be able to use this object in context of other processes?

Yes. PKEVENT is not context-dependent.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com