Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WaitForSingleObject never returns

249 views
Skip to first unread message

Scott Kooy

unread,
Jun 27, 2003, 11:19:23 AM6/27/03
to
I have a thread which is blocked on the call:

bob = WaitForSingleObject(hRXEvent, 5000);

This function works for a long time, and then after a
while, the function never returns (even though the timeout
value is 5000 ms).

the hRXEvent object is created in the beginning with

CreateEvent(NULL, 0, 0, "VWCommEvent");

Then in response to an IRP in a driver, the object is
passed to the driver memory by

ObReferenceObjectByHandle(Mozart, SYNCHRONIZE, NULL,
KernelMode, &deviceExtension->hEvent, NULL);

Also in the driver in an ISR, the object is set by the
following code:

KeSetEvent(deviceExtension->hEvent, 0, 0);

In response, the WaitForSingleObject returns.

And as I said, this works many many times, and then it
just decides never to return from the WaitForSingleObject
even though there is a timeout. Also I know that
KeSetEvent continues to be called.

Gary G. Little

unread,
Jun 27, 2003, 11:35:10 AM6/27/03
to
First of all ... KeSetEvent cannot be called in an ISR. It can only be
called at DISPATCH_LEVEL if _wait_ is set to FALSE, otherwise it must be
called at PASSIVE_LEVEL ISRs run at DIRQL and in arbitrary thread context.
Move your call to KeSetEvent into a DPC and set _wait_ to false. You
describe a classic synchronization situation.

--
Gary G. Little
Seagate Technologies, LLC
gary.g...@seagate.com

"Scott Kooy" <the_ho...@yahoo.com> wrote in message
news:62f401c33cbf$7d0f2330$3101...@phx.gbl...

Doron Holan [MS]

unread,
Jun 27, 2003, 1:31:43 PM6/27/03
to
not related, but in your call to ObReferenceObjectByHandle, the 3rd
parameter (you have NULL), should be *ExEventObjectType, otherwise any
random handle passed will be valid and if incorrect, crash the system.

d

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Scott Kooy" <the_ho...@yahoo.com> wrote in message
news:62f401c33cbf$7d0f2330$3101...@phx.gbl...

Alexander Grigoriev

unread,
Jun 27, 2003, 11:29:04 PM6/27/03
to
Also using a named event is not necessary (unless the event is shared
between different processes),
UserMode should be used in OROBH call, and access mask should be then
EVENT_MODIFY_STATE.

"Doron Holan [MS]" <dor...@online.microsoft.com> wrote in message
news:uusXuHNP...@tk2msftngp13.phx.gbl...

Bikramjeet Singh Assal

unread,
Jun 30, 2003, 3:36:01 PM6/30/03
to
Hello,

I have a question.

I am using Win32 CryptHashData(...) and CryptDecrypt() functions to
encrypt and decrypt the string respectively.

When I run a sample program using these functions, it successfully
encrypts and decrypts the alphanumeric string.

But when I incorporate that same set of functions in customized Gina DLL
which uses a mix of UNICODE and ANSI character sets, decrypt doesn't
work properly.

Encrypting and writing to the registry part works fine.

But when I read the registry from within one of Gina's exported
functions which uses a mix of UNICODE and ANSI character sets, it
decrypts the string but adds some junk characters at the end of the
decrypted string.

It is actually very wierd. I am actually calling the function twice to
decrypt 2 passwords stored in registry.

At the time of first call, decrypt works fine but not on second call.

I am not sure whats causing it.

I hope I am not doing any silly mistake :).

But if somebody has encountered similar kind of problem or knows what is
going wrong in my case, it will be of great help if u wud share it with
me.

Thanks,

- Bikram.


0 new messages