> has anyone ever used an event wait with an absolute timeout in their
driver? Just curious.
Yes. But, I have some bizarre synchronization issues.
Robert Newton
> has anyone ever used an event wait with an absolute timeout in their
driver? Just curious.
Yes. But, I have some bizarre synchronization issues.
Robert Newton
> ----------
From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, September 15, 2004 5:31 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…has anyone ever used an event wait with an absolute timeout in their driver? Just curious.
Yes, by mistake. I fallen to C language trap. The original code was:
DueTime.QuadPart = -10000 * IDLE_INTERVAL; // ms -> 100 ns unit
and later I decided to use variable instead of #define:
DueTime.QuadPart = -10000 * DeviceExtension->IdleTimeout; // ms -> 100 ns unit
Seems innocent but the result of computation is truncated to 32 bits and 64 bit value on the left side becomes positive. The fix was easy:
DueTime.QuadPart = DeviceExtension->IdleTimeout;
DueTime.QuadPart *= -10000; // ms -> 100 ns unit
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
This also works
DueTime.QuadPart = ((LONGLONG) -10000) * DeviceExtension->IdleTimeout;
// ms -> 100 ns
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Wednesday, September 15, 2004 12:38 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, September 15, 2004 5:31 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and
timeout value…has anyone ever used an event wait with an absolute timeout in their
driver? Just curious.
Yes, by mistake. I fallen to C language trap. The original code was:
DueTime.QuadPart = -10000 * IDLE_INTERVAL; // ms -> 100 ns unit
and later I decided to use variable instead of #define:
DueTime.QuadPart = -10000 * DeviceExtension->IdleTimeout; // ms -> 100
ns unit
Seems innocent but the result of computation is truncated to 32 bits and
64 bit value on the left side becomes positive. The fix was easy:
DueTime.QuadPart = DeviceExtension->IdleTimeout;
DueTime.QuadPart *= -10000; // ms -> 100 ns unit
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Or suffix the numeric literal with i64 to make it a 64-bit signed
constant. (ui64 for a 64-bit unsigned constant.)
/George V. Reilly xxxxx@microsoft.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, September 15, 2004 1:39 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value...
This also works
DueTime.QuadPart = ((LONGLONG) -10000) * DeviceExtension->IdleTimeout;
// ms -> 100 ns
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Wednesday, September 15, 2004 12:38 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value...
From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, September 15, 2004 5:31 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and
timeout value...has anyone ever used an event wait with an absolute timeout in their
driver? Just curious.
Yes, by mistake. I fallen to C language trap. The original code was:
DueTime.QuadPart = -10000 * IDLE_INTERVAL; // ms -> 100 ns unit
and later I decided to use variable instead of #define:
DueTime.QuadPart = -10000 * DeviceExtension->IdleTimeout; // ms -> 100
ns unit
Seems innocent but the result of computation is truncated to 32 bits and
64 bit value on the left side becomes positive. The fix was easy:
DueTime.QuadPart = DeviceExtension->IdleTimeout;
DueTime.QuadPart *= -10000; // ms -> 100 ns unit
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
''
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: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com
Elegant solution, I wasn’t aware about i64 suffix. I’d prefer this or mine code against typecast where I’m never 100% sure if it works as expected and need to check compiler output ![]()
Anyway, shouldn’t optimizing compiler generate the same code in all three cases?
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of George Reilly (Volt)[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, September 15, 2004 11:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…Or suffix the numeric literal with i64 to make it a 64-bit signed
constant. (ui64 for a 64-bit unsigned constant.)DueTime.QuadPart = -10000i64 * DeviceExtension->IdleTimeout; // ms ->
100 ns/George V. Reilly xxxxx@microsoft.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, September 15, 2004 1:39 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…This also works
DueTime.QuadPart = ((LONGLONG) -10000) * DeviceExtension->IdleTimeout;
// ms -> 100 nsd
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Wednesday, September 15, 2004 12:38 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…> ----------
> From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Wednesday, September 15, 2004 5:31 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and
timeout value…
>
> has anyone ever used an event wait with an absolute timeout in their
driver? Just curious.
>
Yes, by mistake. I fallen to C language trap. The original code was:DueTime.QuadPart = -10000 * IDLE_INTERVAL; // ms -> 100 ns unit
and later I decided to use variable instead of #define:
DueTime.QuadPart = -10000 * DeviceExtension->IdleTimeout; // ms -> 100
ns unitSeems innocent but the result of computation is truncated to 32 bits and
64 bit value on the left side becomes positive. The fix was easy:DueTime.QuadPart = DeviceExtension->IdleTimeout;
DueTime.QuadPart *= -10000; // ms -> 100 ns unitBest regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
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=256You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
If I wanted to make sure I covered all the bases I would use:
DueTime.QuadPart = ( __int64 ) -10000 * ( __int64 )
DeviceExtension->IdleTimeout;
Using the i64 suffix would be a choice for the constant in that statement.
Look at K&R for ‘C’ promotion rules in Para 6.6 Arithmetic conversions in
Appendix A.
“Michal Vodicka” wrote in message
news:xxxxx@ntdev…
Elegant solution, I wasn’t aware about i64 suffix. I’d prefer this or mine
code against typecast where I’m never 100% sure if it works as expected and
need to check compiler output ![]()
Anyway, shouldn’t optimizing compiler generate the same code in all three
cases?
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
> ----------
> From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> on behalf of George Reilly (Volt)[SMTP:xxxxx@microsoft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Wednesday, September 15, 2004 11:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
> Or suffix the numeric literal with i64 to make it a 64-bit signed
> constant. (ui64 for a 64-bit unsigned constant.)
>
> DueTime.QuadPart = -10000i64 * DeviceExtension->IdleTimeout; // ms ->
> 100 ns
> –
> /George V. Reilly xxxxx@microsoft.com
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Wednesday, September 15, 2004 1:39 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
> This also works
>
> DueTime.QuadPart = ((LONGLONG) -10000) * DeviceExtension->IdleTimeout;
> // ms -> 100 ns
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
> Sent: Wednesday, September 15, 2004 12:38 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
> > ----------
> > From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
>] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Wednesday, September 15, 2004 5:31 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] question on KeWaitForMultipleObjects and
> timeout value…
> >
> > has anyone ever used an event wait with an absolute timeout in their
> driver? Just curious.
> >
> Yes, by mistake. I fallen to C language trap. The original code was:
>
> DueTime.QuadPart = -10000 * IDLE_INTERVAL; // ms -> 100 ns unit
>
> and later I decided to use variable instead of #define:
>
> DueTime.QuadPart = -10000 * DeviceExtension->IdleTimeout; // ms -> 100
> ns unit
>
> Seems innocent but the result of computation is truncated to 32 bits and
> 64 bit value on the left side becomes positive. The fix was easy:
>
> DueTime.QuadPart = DeviceExtension->IdleTimeout;
> DueTime.QuadPart *= -10000; // ms -> 100 ns unit
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
>
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> 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: unknown lmsubst tag argument:
> ‘’
> 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: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
what mechanism does the expiration feature use to determine when to display the ’ your system is shutting down in an hour box’. i’d think it uses absolute
because when i would roll the system time back a year, it wouldnt come up until ANOTHER year passed…
btw, when installing NT 4 always make disks from the CD, otherwise you might get stuck with evaluation disks and a normal CD, yet
for some bizarre reason… it thinks all an eval…
asa
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
Sent: Wednesday, September 15, 2004 10:32 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…
you want a relative timeout (4 seconds from now) so you want to specify a negative timeout value.
has anyone ever used an event wait with an absolute timeout in their driver? Just curious.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Wednesday, September 15, 2004 7:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on KeWaitForMultipleObjects and timeout value…
Hi,
I have a question relating to getting the timeout parameter for KeWaitForMultipleObjects working reasonably for me. The DDK help says this is a PLARGE_INTEGER value and it is specified in 100 nanosecond units. It also talks about relative vs. absolute values. So, I just want it to wait for a few seconds and wake up. This code is executing on a system thread that I have created in my driver, but the timeout seems to me much shorter than I want it to be. Here’s my code block. Maybe I’m just being stupid, but I’ve been staring at it too long to see what if anything I’m doing wrong. Thanks for any help.
LARGE_INTEGER liTimeout;
KIRQL irqlCurrent;
DBGPRINT((“==>WorkThread: entry\n”));
// loop until we are signaled to terminate
while (!bKill)
{
liTimeout.LowPart = 400000;
liTimeout.HighPart = 0;
// wait to be signaled with timeout
status = KeWaitForMultipleObjects(iEventCount,
evList,
WaitAny,
Executive,
KernelMode,
FALSE,
&liTimeout,
NULL);
}
----------------------------
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-585-582-3296
CELL: 1-585-739-0441
www.koolspan.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Well since the shutdown is a user space application, and this was a question
on drivers…
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“Asa Yeamans” wrote in message news:xxxxx@ntdev…
what mechanism does the expiration feature use to determine when to display
the ’ your system is shutting down in an hour box’. i’d think it uses
absolute
because when i would roll the system time back a year, it wouldnt come up
until ANOTHER year passed…
btw, when installing NT 4 always make disks from the CD, otherwise you might
get stuck with evaluation disks and a normal CD, yet
for some bizarre reason… it thinks all an eval…
asa
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
Sent: Wednesday, September 15, 2004 10:32 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
you want a relative timeout (4 seconds from now) so you want to specify a
negative timeout value.
has anyone ever used an event wait with an absolute timeout in their driver?
Just curious.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Wednesday, September 15, 2004 7:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on KeWaitForMultipleObjects and timeout value…
Hi,
I have a question relating to getting the timeout parameter for
KeWaitForMultipleObjects working reasonably for me. The DDK help says this
is a PLARGE_INTEGER value and it is specified in 100 nanosecond units. It
also talks about relative vs. absolute values. So, I just want it to wait
for a few seconds and wake up. This code is executing on a system thread
that I have created in my driver, but the timeout seems to me much shorter
than I want it to be. Here’s my code block. Maybe I’m just being stupid,
but I’ve been staring at it too long to see what if anything I’m doing
wrong. Thanks for any help.
LARGE_INTEGER liTimeout;
KIRQL irqlCurrent;
DBGPRINT((“==>WorkThread: entry\n”));
// loop until we are signaled to terminate
while (!bKill)
{
liTimeout.LowPart = 400000;
liTimeout.HighPart = 0;
// wait to be signaled with timeout
status = KeWaitForMultipleObjects(iEventCount,
evList,
WaitAny,
Executive,
KernelMode,
FALSE,
&liTimeout,
NULL);
}
----------------------------
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-585-582-3296
CELL: 1-585-739-0441
www.koolspan.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
i wasn’t trying to imply that absolute timers aren’t useful. However i
think absolute timeouts on other dispatcher objects (events, mutexes,
etc…) are of limited use to device drivers. Particularly considering
how often someone accidentally passes a positive value to them.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, September 15, 2004 9:42 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
what mechanism does the expiration feature use to determine when to
display the ’ your system is shutting down in an hour box’. i’d think it
uses absolute
because when i would roll the system time back a year, it wouldnt come
up until ANOTHER year passed…
btw, when installing NT 4 always make disks from the CD, otherwise you
might get stuck with evaluation disks and a normal CD, yet
for some bizarre reason… it thinks all an eval…
asa
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
Sent: Wednesday, September 15, 2004 10:32 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and
timeout value…
you want a relative timeout (4 seconds from now) so you want to
specify a negative timeout value.
has anyone ever used an event wait with an absolute timeout in
their driver? Just curious.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Wednesday, September 15, 2004 7:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on KeWaitForMultipleObjects
and timeout value…
Hi,
I have a question relating to getting the timeout
parameter for KeWaitForMultipleObjects working reasonably for me. The
DDK help says this is a PLARGE_INTEGER value and it is specified in 100
nanosecond units. It also talks about relative vs. absolute values.
So, I just want it to wait for a few seconds and wake up. This code is
executing on a system thread that I have created in my driver, but the
timeout seems to me much shorter than I want it to be. Here’s my code
block. Maybe I’m just being stupid, but I’ve been staring at it too
long to see what if anything I’m doing wrong. Thanks for any help.
LARGE_INTEGER liTimeout;
KIRQL irqlCurrent;
DBGPRINT((“==>WorkThread: entry\n”));
// loop until we are signaled to terminate
while (!bKill)
{
liTimeout.LowPart = 400000;
liTimeout.HighPart = 0;
// wait to be signaled with
timeout
status =
KeWaitForMultipleObjects(iEventCount,
evList,
WaitAny,
Executive,
KernelMode,
FALSE,
&liTimeout,
NULL);
}
----------------------------
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-585-582-3296
CELL: 1-585-739-0441
www.koolspan.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown
lmsubst tag argument: ‘’
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: unknown lmsubst tag
argument: ‘’
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: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
mmm … I was already thinking about using absolute timers within a “trial version” driver that expires on a particular date/time. It just fails me how to interpret the value to convert it into a UDT date/time and vice versa …
C.
----- Original Message -----
From: Peter Wieland
To: Windows System Software Devs Interest List
Sent: Thursday, September 16, 2004 3:31 PM
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…
i wasn’t trying to imply that absolute timers aren’t useful. However i think absolute timeouts on other dispatcher objects (events, mutexes, etc…) are of limited use to device drivers. Particularly considering how often someone accidentally passes a positive value to them.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, September 15, 2004 9:42 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…
what mechanism does the expiration feature use to determine when to display the ’ your system is shutting down in an hour box’. i’d think it uses absolute
because when i would roll the system time back a year, it wouldnt come up until ANOTHER year passed…
btw, when installing NT 4 always make disks from the CD, otherwise you might get stuck with evaluation disks and a normal CD, yet
for some bizarre reason… it thinks all an eval…
asa
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
Sent: Wednesday, September 15, 2004 10:32 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout value…
you want a relative timeout (4 seconds from now) so you want to specify a negative timeout value.
has anyone ever used an event wait with an absolute timeout in their driver? Just curious.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Wednesday, September 15, 2004 7:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on KeWaitForMultipleObjects and timeout value…
Hi,
I have a question relating to getting the timeout parameter for KeWaitForMultipleObjects working reasonably for me. The DDK help says this is a PLARGE_INTEGER value and it is specified in 100 nanosecond units. It also talks about relative vs. absolute values. So, I just want it to wait for a few seconds and wake up. This code is executing on a system thread that I have created in my driver, but the timeout seems to me much shorter than I want it to be. Here’s my code block. Maybe I’m just being stupid, but I’ve been staring at it too long to see what if anything I’m doing wrong. Thanks for any help.
LARGE_INTEGER liTimeout;
KIRQL irqlCurrent;
DBGPRINT((“==>WorkThread: entry\n”));
// loop until we are signaled to terminate
while (!bKill)
{
liTimeout.LowPart = 400000;
liTimeout.HighPart = 0;
// wait to be signaled with timeout
status = KeWaitForMultipleObjects(iEventCount,
evList,
WaitAny,
Executive,
KernelMode,
FALSE,
&liTimeout,
NULL);
}
----------------------------
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-585-582-3296
CELL: 1-585-739-0441
www.koolspan.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
How about RtlTimeFieldsToTime, followed by ExLocalTimeToSystemTime? Of
course the other way that would be ExSystemTimeToLocalTime folled by
RtlTimeToTimeFields.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
“Christiaan Ghijselinck” wrote in
message news:xxxxx@ntdev…
mmm … I was already thinking about using absolute timers within a “trial
version” driver that expires on a particular date/time. It just fails me how
to interpret the value to convert it into a UDT date/time and vice versa …
C.
----- Original Message -----
From: Peter Wieland
To: Windows System Software Devs Interest List
Sent: Thursday, September 16, 2004 3:31 PM
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
i wasn’t trying to imply that absolute timers aren’t useful. However i
think absolute timeouts on other dispatcher objects (events, mutexes,
etc…) are of limited use to device drivers. Particularly considering how
often someone accidentally passes a positive value to them.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, September 15, 2004 9:42 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
what mechanism does the expiration feature use to determine when to display
the ’ your system is shutting down in an hour box’. i’d think it uses
absolute
because when i would roll the system time back a year, it wouldnt come up
until ANOTHER year passed…
btw, when installing NT 4 always make disks from the CD, otherwise you might
get stuck with evaluation disks and a normal CD, yet
for some bizarre reason… it thinks all an eval…
asa
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
Sent: Wednesday, September 15, 2004 10:32 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
value…
you want a relative timeout (4 seconds from now) so you want to specify a
negative timeout value.
has anyone ever used an event wait with an absolute timeout in their driver?
Just curious.
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Wednesday, September 15, 2004 7:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on KeWaitForMultipleObjects and timeout value…
Hi,
I have a question relating to getting the timeout parameter for
KeWaitForMultipleObjects working reasonably for me. The DDK help says this
is a PLARGE_INTEGER value and it is specified in 100 nanosecond units. It
also talks about relative vs. absolute values. So, I just want it to wait
for a few seconds and wake up. This code is executing on a system thread
that I have created in my driver, but the timeout seems to me much shorter
than I want it to be. Here’s my code block. Maybe I’m just being stupid,
but I’ve been staring at it too long to see what if anything I’m doing
wrong. Thanks for any help.
LARGE_INTEGER liTimeout;
KIRQL irqlCurrent;
DBGPRINT((“==>WorkThread: entry\n”));
// loop until we are signaled to terminate
while (!bKill)
{
liTimeout.LowPart = 400000;
liTimeout.HighPart = 0;
// wait to be signaled with timeout
status = KeWaitForMultipleObjects(iEventCount,
evList,
WaitAny,
Executive,
KernelMode,
FALSE,
&liTimeout,
NULL);
}
----------------------------
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-585-582-3296
CELL: 1-585-739-0441
www.koolspan.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Thanks ! My bad experience has learned never to *assume* about
something unless there is at least a reference to “System time is a
count of 100-nanosecond intervals since January 1, 1601” or a reference
to those time functions. None of this all is mentioned within the KeWaitFor…
functions…
C.
----- Original Message -----
From: “Don Burn”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Thursday, September 16, 2004 5:35 PM
Subject: Re:[ntdev] question on KeWaitForMultipleObjects and timeout value…
> How about RtlTimeFieldsToTime, followed by ExLocalTimeToSystemTime? Of
> course the other way that would be ExSystemTimeToLocalTime folled by
> RtlTimeToTimeFields.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
> “Christiaan Ghijselinck” wrote in
> message news:xxxxx@ntdev…
>
> mmm … I was already thinking about using absolute timers within a “trial
> version” driver that expires on a particular date/time. It just fails me how
> to interpret the value to convert it into a UDT date/time and vice versa …
>
> C.
>
> ----- Original Message -----
> From: Peter Wieland
> To: Windows System Software Devs Interest List
> Sent: Thursday, September 16, 2004 3:31 PM
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
>
> i wasn’t trying to imply that absolute timers aren’t useful. However i
> think absolute timeouts on other dispatcher objects (events, mutexes,
> etc…) are of limited use to device drivers. Particularly considering how
> often someone accidentally passes a positive value to them.
>
> -p
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
> Sent: Wednesday, September 15, 2004 9:42 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
>
> what mechanism does the expiration feature use to determine when to display
> the ’ your system is shutting down in an hour box’. i’d think it uses
> absolute
> because when i would roll the system time back a year, it wouldnt come up
> until ANOTHER year passed…
> btw, when installing NT 4 always make disks from the CD, otherwise you might
> get stuck with evaluation disks and a normal CD, yet
> for some bizarre reason… it thinks all an eval…
>
> asa
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Peter Wieland
> Sent: Wednesday, September 15, 2004 10:32 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] question on KeWaitForMultipleObjects and timeout
> value…
>
>
> you want a relative timeout (4 seconds from now) so you want to specify a
> negative timeout value.
>
> has anyone ever used an event wait with an absolute timeout in their driver?
> Just curious.
>
> -p
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
> Sent: Wednesday, September 15, 2004 7:42 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] question on KeWaitForMultipleObjects and timeout value…
>
>
> Hi,
>
> I have a question relating to getting the timeout parameter for
> KeWaitForMultipleObjects working reasonably for me. The DDK help says this
> is a PLARGE_INTEGER value and it is specified in 100 nanosecond units. It
> also talks about relative vs. absolute values. So, I just want it to wait
> for a few seconds and wake up. This code is executing on a system thread
> that I have created in my driver, but the timeout seems to me much shorter
> than I want it to be. Here’s my code block. Maybe I’m just being stupid,
> but I’ve been staring at it too long to see what if anything I’m doing
> wrong. Thanks for any help.
>
> LARGE_INTEGER liTimeout;
> KIRQL irqlCurrent;
>
> DBGPRINT((“==>WorkThread: entry\n”));
>
> // loop until we are signaled to terminate
> while (!bKill)
> {
> liTimeout.LowPart = 400000;
> liTimeout.HighPart = 0;
>
> // wait to be signaled with timeout
> status = KeWaitForMultipleObjects(iEventCount,
>
> evList,
>
> WaitAny,
>
> Executive,
>
> KernelMode,
>
> FALSE,
>
> &liTimeout,
>
> NULL);
>
>
> }
> ----------------------------
> Paul Benware
> Director of Client Development
>
> KoolSpan Inc.
> 11134 Stephalee Lane
> North Bethesda, MD 20852
> TELE: 1-301-468-9434
> DIRECT: 1-585-582-3296
> CELL: 1-585-739-0441
> www.koolspan.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> 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: unknown lmsubst tag argument: ‘’
> 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: unknown lmsubst tag argument: ‘’
> 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: unknown lmsubst tag argument: ‘’
> 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@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>