Clearing screen saver from kernel mode

Hi All,

I?m working with a function/filter driver for a proprietary image scanning
device. When the user performs some ?activity? with the device I would like
to have the screen saver cleared (as is done with mouse/keyboard). The setup
class for the device is non-standard. The driver is WDM and target platforms
are 2K forwards.

Are there any techniques for doing this without resorting to
SystemParametersInfo from user-mode?

Thanks,

Stan


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.23/513 - Release Date: 11/2/2006
7:40 AM

You could ?try PoSetSystemState() with either ES_DISPLAY_REQUIRED or ES_USER_PRESENT (the keyboard/mouse stacks use the latter value)

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Stan Mitchell
Sent: Friday, November 03, 2006 7:22 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Clearing screen saver from kernel mode

Hi All,

I’m working with a function/filter driver for a proprietary image scanning device. When the user performs some “activity” with the device I would like to have the screen saver cleared (as is done with mouse/keyboard). The setup class for the device is non-standard. The driver is WDM and target platforms are 2K forwards.

Are there any techniques for doing this without resorting to SystemParametersInfo from user-mode?

Thanks,
Stan


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.23/513 - Release Date: 11/2/2006 7:40 AM

I see that kbdclass and mouclass call PoSetSystemState(ES_USER_PRESENT) at
their service callbacks, where input is funneled from all keyboard types and
all mouse types. I suspected it would be done there or above in win32k.sys.

I’ll give PoSetSystemState I a try.
Thanks.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, November 03, 2006 7:42 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

You could ?try PoSetSystemState() with either ES_DISPLAY_REQUIRED or
ES_USER_PRESENT (the keyboard/mouse stacks use the latter value)

d


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.26/516 - Release Date: 11/3/2006
2:20 PM

Unfortunately, PoSetSystemState does not work with ES_DISPLAY_REQUIRED,
ES_USER_PRESENT or in combination (also tried adding in ES_SYSTEM_REQUIRED).

Does this have to be called in the context of the system input thread?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, November 03, 2006 7:42 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

You could ?try PoSetSystemState() with either ES_DISPLAY_REQUIRED or
ES_USER_PRESENT (the keyboard/mouse stacks use the latter value)

d


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.26/516 - Release Date: 11/3/2006
2:20 PM

No, the input stacks call them in an arbitrary thread context when the input is reported.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Stan Mitchell
Sent: Friday, November 03, 2006 10:35 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

Unfortunately, PoSetSystemState does not work with ES_DISPLAY_REQUIRED,
ES_USER_PRESENT or in combination (also tried adding in ES_SYSTEM_REQUIRED).

Does this have to be called in the context of the system input thread?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, November 03, 2006 7:42 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

You could ?try PoSetSystemState() with either ES_DISPLAY_REQUIRED or
ES_USER_PRESENT (the keyboard/mouse stacks use the latter value)

d


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.26/516 - Release Date: 11/3/2006
2:20 PM


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I hate to say it, but this sounds really scary to me. Let’s make a thought experiment!

What if there are multiple users logged on through remote desktop and none to the console?

  • Which screen saver are you going to clear?

What about fast user switching?

  • Is the user who requested the action the user who is currently using the machine?

What if there is no console?

  • Oops!

What if there is a password?

  • Doesn’t really help to clear the screen saver!

Why clear the screen saver?

  • The user isn’t there (or else it wouldn’t have gone on), so it doesn’t matter that
    the job is done yet. When the user gets back, they are going to dismiss the screen
    saver themselves anyway! Let the screen saver save that screen!

I think you might want to re-think your design. At least have a look at blogs.msdn.com/oldnewthing
before start doing freaky stuff like that. Search for something like “notify user from a service”
on that blog for a really good discussion as to the issues with what you are doing.

And besides, screen savers are neat!

-Jeff

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, November 03, 2006 1:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

No, the input stacks call them in an arbitrary thread context when the input is reported.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Stan Mitchell
Sent: Friday, November 03, 2006 10:35 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

Unfortunately, PoSetSystemState does not work with ES_DISPLAY_REQUIRED,
ES_USER_PRESENT or in combination (also tried adding in ES_SYSTEM_REQUIRED).

Does this have to be called in the context of the system input thread?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Friday, November 03, 2006 7:42 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Clearing screen saver from kernel mode

You could ?try PoSetSystemState() with either ES_DISPLAY_REQUIRED or
ES_USER_PRESENT (the keyboard/mouse stacks use the latter value)

d


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.26/516 - Release Date: 11/3/2006
2:20 PM


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer