2008-06-22

24 new messages in 8 topics - digest

microsoft.public.development.device.drivers
http://groups.google.com/group/microsoft.public.development.device.drivers?hl=en

microsoft.public.development.device.drivers@googlegroups.com

Today's topics:

* Help!!! Memory allocation!!! - 3 messages, 3 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/6317eecb4f8e7439?hl=en
* Avoiding PCI Resource allocation and PCI Bus filter driver - 4 messages, 3
authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e347a80240f61968?hl=en
* how a device is found? - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/4838faf9cf29bdb9?hl=en
* GDI Failure,... - 8 messages, 4 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/b421e329831eaf89?hl=en
* Bluetooth Visa64 Drivers - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/c5da7a8c2da05eb3?hl=en
* get from KernelMode to UserMode very quickly? - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/a863d900d11376d5?hl=en
* How to disallow sleep/hibernation in Windows Vista ? - 3 messages, 3 authors
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/410e16ad5534dc24?hl=en
* printing HardwareIDs - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/95fa3d09c626a39f?hl=en

==============================================================================
TOPIC: Help!!! Memory allocation!!!
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/6317eecb4f8e7439?hl=en
==============================================================================

== 1 of 3 ==
Date: Sat, Jun 21 2008 10:19 pm
From: "Pavel Lebedinsky [MSFT]"


> So, if I do the following things,
> pSystem = MmAllocateContiguousMemory (...); //1. the memory must be
> Nonpaged?
> pMdl = IoAllocateMdl(pSystem...);
> MmBuildMdlForNonPagedPool(pMdl); or MmProbeAndLockPages(pMdl)???
> pUser = MmMapLockedPages(pMdl, UserMode...);// Map to user space address
>
> are they correct? (Some params are omitted.)


Yes this should work. You don't need MmProbeAndLockPages here,
MmBuildMdlForNonPagedPool should be enough.

Note that MmAllocateContiguousMemory call can be very expensive,
and may not work at all for larger sizes (more than a few pages) once
physical memory gets fragmented. Do you really need this memory
to be physically contiguous?

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


== 2 of 3 ==
Date: Sun, Jun 22 2008 1:03 am
From: Danial.F


Yes, I do really need this memory to be physically contiguous. I may allocate
a large contiguous physical memory, if it fails, I try to allocate a smaller
one. Finally, I can always get the contiguous physical memory, though it may
be very small.

"Pavel Lebedinsky [MSFT]" wrote:

> > So, if I do the following things,
> > pSystem = MmAllocateContiguousMemory (...); //1. the memory must be
> > Nonpaged?
> > pMdl = IoAllocateMdl(pSystem...);
> > MmBuildMdlForNonPagedPool(pMdl); or MmProbeAndLockPages(pMdl)???
> > pUser = MmMapLockedPages(pMdl, UserMode...);// Map to user space address
> >
> > are they correct? (Some params are omitted.)
>
>
> Yes this should work. You don't need MmProbeAndLockPages here,
> MmBuildMdlForNonPagedPool should be enough.
>
> Note that MmAllocateContiguousMemory call can be very expensive,
> and may not work at all for larger sizes (more than a few pages) once
> physical memory gets fragmented. Do you really need this memory
> to be physically contiguous?
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>

== 3 of 3 ==
Date: Sun, Jun 22 2008 6:13 am
From: "Alexander Grigoriev"


What's the reason you need it to be contiguous?

"Danial.F" <DanialF@discussions.microsoft.com> wrote in message
news:9D9C6B13-EDAC-4863-946C-2A11D09E7899@microsoft.com...
> Yes, I do really need this memory to be physically contiguous. I may
> allocate
> a large contiguous physical memory, if it fails, I try to allocate a
> smaller
> one. Finally, I can always get the contiguous physical memory, though it
> may
> be very small.
>
> "Pavel Lebedinsky [MSFT]" wrote:
>
>> > So, if I do the following things,
>> > pSystem = MmAllocateContiguousMemory (...); //1. the memory must be
>> > Nonpaged?
>> > pMdl = IoAllocateMdl(pSystem...);
>> > MmBuildMdlForNonPagedPool(pMdl); or MmProbeAndLockPages(pMdl)???
>> > pUser = MmMapLockedPages(pMdl, UserMode...);// Map to user space
>> > address
>> >
>> > are they correct? (Some params are omitted.)
>>
>>
>> Yes this should work. You don't need MmProbeAndLockPages here,
>> MmBuildMdlForNonPagedPool should be enough.
>>
>> Note that MmAllocateContiguousMemory call can be very expensive,
>> and may not work at all for larger sizes (more than a few pages) once
>> physical memory gets fragmented. Do you really need this memory
>> to be physically contiguous?
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>>



==============================================================================
TOPIC: Avoiding PCI Resource allocation and PCI Bus filter driver
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/e347a80240f61968?hl=en
==============================================================================

== 1 of 4 ==
Date: Sun, Jun 22 2008 12:27 am
From: Vasudevan Srinivasan


I'm trying to avoid the pnp manager from allocating an MMIO resource for a
pci device even though the device has that resource available (There is no
IOBAR equivalent to this MMIO bar, but, I do not want this MMIO bar for the
device to be functional and this MMIO is not functioning as expected and
hence this requirement).

I tried handling the EvtDeviceFilterRemoveResourceRequirements in the
function driver and tried to remove the memory resource, but, the device
yellow banged in device manager.

I also read from the forums and WDK documentation that a bus filter driver
could handle the IRP_MN_QUERY_RESOURCE_REQUIREMENTS (
EvtDeviceResourceRequirementsQuery in WDF?) and alter the resource
requirements.

Question 1: Since my device is a PCI device (Bus X, Dev Y, Fn Z) that has
pci.sys as the bus driver, how do I install a bus filter driver for this
device? I need my function driver to install as well so would greatly
appreciate any pointers on how to setup the inf file for this filter driver
(I would prefer a separate inf file for this filter driver if possible, so I
can choose to install this filter or not). I'm assuming writing this filter
driver itself shouldn't be a big deal as it could be a regular WDF driver
that adds the specific PNP event handler that I need.

Question 2: Can I add this PDO event handler in my function driver itself?
If so, will it automatically get tied to the PDO that my function driver is
connecting to?

Appreciate any help/pointers that would allow me to remove the Memory BAR
allocation by the PNP Manager and still allow my function driver to load
fine.

Thanks,
Vasu.

== 2 of 4 ==
Date: Sun, Jun 22 2008 3:15 am
From: "Pavel A."


Have you tried to specify a resources override in your INF?

--PA


"Vasudevan Srinivasan" <vasuweb@gmail.com> wrote in message
news:C4834CE0.2A19%vasuweb@gmail.com...
> I'm trying to avoid the pnp manager from allocating an MMIO resource for a
> pci device even though the device has that resource available (There is no
> IOBAR equivalent to this MMIO bar, but, I do not want this MMIO bar for
> the
> device to be functional and this MMIO is not functioning as expected and
> hence this requirement).
>
> I tried handling the EvtDeviceFilterRemoveResourceRequirements in the
> function driver and tried to remove the memory resource, but, the device
> yellow banged in device manager.
>
> I also read from the forums and WDK documentation that a bus filter driver
> could handle the IRP_MN_QUERY_RESOURCE_REQUIREMENTS (
> EvtDeviceResourceRequirementsQuery in WDF?) and alter the resource
> requirements.
>
> Question 1: Since my device is a PCI device (Bus X, Dev Y, Fn Z) that has
> pci.sys as the bus driver, how do I install a bus filter driver for this
> device? I need my function driver to install as well so would greatly
> appreciate any pointers on how to setup the inf file for this filter
> driver
> (I would prefer a separate inf file for this filter driver if possible, so
> I
> can choose to install this filter or not). I'm assuming writing this
> filter
> driver itself shouldn't be a big deal as it could be a regular WDF driver
> that adds the specific PNP event handler that I need.
>
> Question 2: Can I add this PDO event handler in my function driver itself?
> If so, will it automatically get tied to the PDO that my function driver
> is
> connecting to?
>
> Appreciate any help/pointers that would allow me to remove the Memory BAR
> allocation by the PNP Manager and still allow my function driver to load
> fine.
>
> Thanks,
> Vasu.
>

== 3 of 4 ==
Date: Sun, Jun 22 2008 6:12 am
From: "Alexander Grigoriev"


Then PCI.SYS seems to check that it's getting correct number of BARs in
START_DEVICE.

"Vasudevan Srinivasan" <vasuweb@gmail.com> wrote in message
news:C4834CE0.2A19%vasuweb@gmail.com...
> I'm trying to avoid the pnp manager from allocating an MMIO resource for a
> pci device even though the device has that resource available (There is no
> IOBAR equivalent to this MMIO bar, but, I do not want this MMIO bar for
> the
> device to be functional and this MMIO is not functioning as expected and
> hence this requirement).
>
> I tried handling the EvtDeviceFilterRemoveResourceRequirements in the
> function driver and tried to remove the memory resource, but, the device
> yellow banged in device manager.
>
> I also read from the forums and WDK documentation that a bus filter driver
> could handle the IRP_MN_QUERY_RESOURCE_REQUIREMENTS (
> EvtDeviceResourceRequirementsQuery in WDF?) and alter the resource
> requirements.
>
> Question 1: Since my device is a PCI device (Bus X, Dev Y, Fn Z) that has
> pci.sys as the bus driver, how do I install a bus filter driver for this
> device? I need my function driver to install as well so would greatly
> appreciate any pointers on how to setup the inf file for this filter
> driver
> (I would prefer a separate inf file for this filter driver if possible, so
> I
> can choose to install this filter or not). I'm assuming writing this
> filter
> driver itself shouldn't be a big deal as it could be a regular WDF driver
> that adds the specific PNP event handler that I need.
>
> Question 2: Can I add this PDO event handler in my function driver itself?
> If so, will it automatically get tied to the PDO that my function driver
> is
> connecting to?
>
> Appreciate any help/pointers that would allow me to remove the Memory BAR
> allocation by the PNP Manager and still allow my function driver to load
> fine.
>
> Thanks,
> Vasu.
>


== 4 of 4 ==
Date: Sun, Jun 22 2008 1:31 pm
From: Vasudevan Srinivasan


How can I specify a resource override to avoid allocating a resource? I
thought you can specify a resource override to shrink or specify legacy
addresses and such only...

Thanks,
Vasu.


On 6/22/08 3:15 AM, in article #5OriEF1IHA.5944@TK2MSFTNGP04.phx.gbl, "Pavel
A." <pavel_a@NOwritemeNO.com> wrote:

> Have you tried to specify a resources override in your INF?
>
> --PA
>
>
> "Vasudevan Srinivasan" <vasuweb@gmail.com> wrote in message
> news:C4834CE0.2A19%vasuweb@gmail.com...
>> I'm trying to avoid the pnp manager from allocating an MMIO resource for a
>> pci device even though the device has that resource available (There is no
>> IOBAR equivalent to this MMIO bar, but, I do not want this MMIO bar for
>> the
>> device to be functional and this MMIO is not functioning as expected and
>> hence this requirement).
>>
>> I tried handling the EvtDeviceFilterRemoveResourceRequirements in the
>> function driver and tried to remove the memory resource, but, the device
>> yellow banged in device manager.
>>
>> I also read from the forums and WDK documentation that a bus filter driver
>> could handle the IRP_MN_QUERY_RESOURCE_REQUIREMENTS (
>> EvtDeviceResourceRequirementsQuery in WDF?) and alter the resource
>> requirements.
>>
>> Question 1: Since my device is a PCI device (Bus X, Dev Y, Fn Z) that has
>> pci.sys as the bus driver, how do I install a bus filter driver for this
>> device? I need my function driver to install as well so would greatly
>> appreciate any pointers on how to setup the inf file for this filter
>> driver
>> (I would prefer a separate inf file for this filter driver if possible, so
>> I
>> can choose to install this filter or not). I'm assuming writing this
>> filter
>> driver itself shouldn't be a big deal as it could be a regular WDF driver
>> that adds the specific PNP event handler that I need.
>>
>> Question 2: Can I add this PDO event handler in my function driver itself?
>> If so, will it automatically get tied to the PDO that my function driver
>> is
>> connecting to?
>>
>> Appreciate any help/pointers that would allow me to remove the Memory BAR
>> allocation by the PNP Manager and still allow my function driver to load
>> fine.
>>
>> Thanks,
>> Vasu.
>>


==============================================================================
TOPIC: how a device is found?
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/4838faf9cf29bdb9?hl=en
==============================================================================

== 1 of 2 ==
Date: Sun, Jun 22 2008 12:57 am
From: Danial.F


Thanks!
Yes, I can name my device ID whatever I want, e.g. mybus\mydevice, in inf,
and in device manager, I can see that the hardware ID is mybus\mydevice. But,
the device instance id is root\unknown\0000. Can I specify this device
instance id when I install the driver? e.g. root\mydevice\1234 or other? How
to do it? in inf also?

"Tim Roberts" wrote:

> Danial.F <DanialF@discussions.microsoft.com> wrote:
> >
> >so, you mean that root bus driver cheats pnp? root bus driver creates a fake
> >device then tells pnp the device is present? then pnp loads my driver?
>
> It's not "cheating". It's the same way ALL device stacks are created. When
> the PCI bus driver notices a new device, it creates a PDO and gives it a
> name like "PCI\VEN_xxxx&DEV_xxxx". When the USB bus driver notices a new
> device, it creates a PDO and gives it a name like "USB\VID_xxxx&PID_xxxx".
> In both cases, it's PnP's job to find a driver for it.
>
> Your case is exactly the same. The only difference is that you are TELLING
> the root bus driver how to name the device.
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>

== 2 of 2 ==
Date: Sun, Jun 22 2008 6:48 pm
From: "Doron Holan [MSFT]"


no, you cannot specify the instance ID

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Danial.F" <DanialF@discussions.microsoft.com> wrote in message
news:29D92438-60DB-4A3F-A416-45594F29AA17@microsoft.com...
> Thanks!
> Yes, I can name my device ID whatever I want, e.g. mybus\mydevice, in inf,
> and in device manager, I can see that the hardware ID is mybus\mydevice.
> But,
> the device instance id is root\unknown\0000. Can I specify this device
> instance id when I install the driver? e.g. root\mydevice\1234 or other?
> How
> to do it? in inf also?
>
> "Tim Roberts" wrote:
>
>> Danial.F <DanialF@discussions.microsoft.com> wrote:
>> >
>> >so, you mean that root bus driver cheats pnp? root bus driver creates a
>> >fake
>> >device then tells pnp the device is present? then pnp loads my driver?
>>
>> It's not "cheating". It's the same way ALL device stacks are created.
>> When
>> the PCI bus driver notices a new device, it creates a PDO and gives it a
>> name like "PCI\VEN_xxxx&DEV_xxxx". When the USB bus driver notices a new
>> device, it creates a PDO and gives it a name like
>> "USB\VID_xxxx&PID_xxxx".
>> In both cases, it's PnP's job to find a driver for it.
>>
>> Your case is exactly the same. The only difference is that you are
>> TELLING
>> the root bus driver how to name the device.
>> --
>> Tim Roberts, timr@probo.com
>> Providenza & Boekelheide, Inc.
>>


==============================================================================
TOPIC: GDI Failure,...
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/b421e329831eaf89?hl=en
==============================================================================

== 1 of 8 ==
Date: Sun, Jun 22 2008 12:40 pm
From: Kerem Gümrükcü


Hi,

this speaks for itself:

http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg

How this happened: I wanted to send System to Hbernation Mode,
but it was not able to enter this state: No Error Log Entries, no
Messages, it just turned from "Preparing for Hibernation,..." to
this Window. Interessting is that you can see in a Screenshot that
everything is rendered false except the disabled MenuItems on
Menus. Why only disabled items are drawn correctly. An why
can the content from Internet Explorer be drawn correctly?
Every Application started after this fault has totally destroyed
Character repesentation and Consoles write their buffers also
false and randomly as you can see. I had to restart the complete
System to get a usefull state. If i wouldn't be that familliar with
the OS and MS Paint i couldnt make these screeenshots and
save them, since you can read nothing on any window or menu
items,...

Oh yes, why will the content from FreeMath rendered successfully
and other apps not?

Its OT but maybe someone is interessted in it and also can expplain
me what and why this happens,...OS is SP3 WinXPPro, you propably
already figured this out from the Screenshots,..

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

== 2 of 8 ==
Date: Sun, Jun 22 2008 1:21 pm
From: "Alexander Grigoriev"


1. Check your system memory for stability (good memory test, not just POST)
2. That could be your video driver misbehaving. Or some crapware hooked to
your video drover (remote access?)

"Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> this speaks for itself:
>
> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>
> How this happened: I wanted to send System to Hbernation Mode,
> but it was not able to enter this state: No Error Log Entries, no
> Messages, it just turned from "Preparing for Hibernation,..." to
> this Window. Interessting is that you can see in a Screenshot that
> everything is rendered false except the disabled MenuItems on
> Menus. Why only disabled items are drawn correctly. An why
> can the content from Internet Explorer be drawn correctly?
> Every Application started after this fault has totally destroyed
> Character repesentation and Consoles write their buffers also
> false and randomly as you can see. I had to restart the complete
> System to get a usefull state. If i wouldn't be that familliar with
> the OS and MS Paint i couldnt make these screeenshots and
> save them, since you can read nothing on any window or menu
> items,...
>
> Oh yes, why will the content from FreeMath rendered successfully
> and other apps not?
>
> Its OT but maybe someone is interessted in it and also can expplain
> me what and why this happens,...OS is SP3 WinXPPro, you propably
> already figured this out from the Screenshots,..
>
> Regards
>
> Kerem
>
> --
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."


== 3 of 8 ==
Date: Sun, Jun 22 2008 2:57 pm
From: Kerem Gümrükcü


Hi Alexander,

>1. Check your system memory for stability (good memory test, not just POST)

My recommendation for everybody:
http://www.memtest.org/

I checked memory even yesterday,..really! No Problems,...

>2. That could be your video driver misbehaving. Or some crapware hooked to
>your video drover (remote access?)

The only video driver attached to the system except
the primary video driver is UltraVNC Video Driver
and there was never ever a problem with it at least
on my system. Here is some Version info:

C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys

File Version Info for:
"C:\WINDOWS\system32\drivers\vncdrv.sys"

[FileName]
-- C:\WINDOWS\system32\drivers\vncdrv.sys --
[Language]
-- Sprachneutral --
[Comments]
-- "No Information Available" --
[CompanyName]
-- RDV Soft --
[FileDescription]
-- Ultravnc Mirror Driver --
[FileVersion]
-- 1.00.17 --
[InternalName]
-- vncdrv.sys --
[LegalCopyright]
-- RDV Soft --
[LegalTrademarks]
-- "No Information Available" --
[OriginalFilename]
-- vncdrv.sys --
[ProductName]
-- UltraVnc Mirror Driver --
[ProductVersion]
-- 1.00.17 --
[PrivateBuild]
-- "No Information Available" --
[SpecialBuild]
-- "No Information Available" --
[Checksums]
-- Header Sum: 65670 --
-- Computed Sum: 65670 --
[ImageExtraInfo]
-- Image Characteristics: 270 --
-- Machine: 332 --
-- Subsystem: 1 --
-- Major Linker Version: 7 --
-- Minor Linker Version: 10 --
-- Minor Image Version: 5 --
-- Minor Image Version: 0 --
-- Major Operating System Version: 5 --
-- Minor Operating System Version: 0 --
-- Major Subsystem Version: 5 --
-- Minor Subsystem Version: 0 --
-- Image Magic: 267 --
-- Image Checksum: 65670 --
-- Image Dll Characteristics: 1024 --


Even it was not loaded and/or activated while this happened,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
> 1. Check your system memory for stability (good memory test, not just
> POST)
> 2. That could be your video driver misbehaving. Or some crapware hooked to
> your video drover (remote access?)
>
> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> this speaks for itself:
>>
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>>
>> How this happened: I wanted to send System to Hbernation Mode,
>> but it was not able to enter this state: No Error Log Entries, no
>> Messages, it just turned from "Preparing for Hibernation,..." to
>> this Window. Interessting is that you can see in a Screenshot that
>> everything is rendered false except the disabled MenuItems on
>> Menus. Why only disabled items are drawn correctly. An why
>> can the content from Internet Explorer be drawn correctly?
>> Every Application started after this fault has totally destroyed
>> Character repesentation and Consoles write their buffers also
>> false and randomly as you can see. I had to restart the complete
>> System to get a usefull state. If i wouldn't be that familliar with
>> the OS and MS Paint i couldnt make these screeenshots and
>> save them, since you can read nothing on any window or menu
>> items,...
>>
>> Oh yes, why will the content from FreeMath rendered successfully
>> and other apps not?
>>
>> Its OT but maybe someone is interessted in it and also can expplain
>> me what and why this happens,...OS is SP3 WinXPPro, you propably
>> already figured this out from the Screenshots,..
>>
>> Regards
>>
>> Kerem
>>
>> --
>> -----------------------
>> Beste Grüsse / Best regards / Votre bien devoue
>> Kerem Gümrükcü
>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>> Latest Open-Source Projects: http://entwicklung.junetz.de
>> -----------------------
>> "This reply is provided as is, without warranty express or implied."
>
>

== 4 of 8 ==
Date: Sun, Jun 22 2008 6:09 pm
From: "Ivan Brugiolo [MSFT]"


The images shown would make me think of GDI handle exhaustion,
USER handle exhaustion, Desktop-Heap exhaustion, or, Session-Space
exhausion.
The fact that you have a mirror driver would make me think of the 4th one.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
news:OwNNLML1IHA.4572@TK2MSFTNGP03.phx.gbl...
> Hi Alexander,
>
>>1. Check your system memory for stability (good memory test, not just
>>POST)
>
> My recommendation for everybody:
> http://www.memtest.org/
>
> I checked memory even yesterday,..really! No Problems,...
>
>>2. That could be your video driver misbehaving. Or some crapware hooked to
>>your video drover (remote access?)
>
> The only video driver attached to the system except
> the primary video driver is UltraVNC Video Driver
> and there was never ever a problem with it at least
> on my system. Here is some Version info:
>
> C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys
>
> File Version Info for:
> "C:\WINDOWS\system32\drivers\vncdrv.sys"
>
> [FileName]
> -- C:\WINDOWS\system32\drivers\vncdrv.sys --
> [Language]
> -- Sprachneutral --
> [Comments]
> -- "No Information Available" --
> [CompanyName]
> -- RDV Soft --
> [FileDescription]
> -- Ultravnc Mirror Driver --
> [FileVersion]
> -- 1.00.17 --
> [InternalName]
> -- vncdrv.sys --
> [LegalCopyright]
> -- RDV Soft --
> [LegalTrademarks]
> -- "No Information Available" --
> [OriginalFilename]
> -- vncdrv.sys --
> [ProductName]
> -- UltraVnc Mirror Driver --
> [ProductVersion]
> -- 1.00.17 --
> [PrivateBuild]
> -- "No Information Available" --
> [SpecialBuild]
> -- "No Information Available" --
> [Checksums]
> -- Header Sum: 65670 --
> -- Computed Sum: 65670 --
> [ImageExtraInfo]
> -- Image Characteristics: 270 --
> -- Machine: 332 --
> -- Subsystem: 1 --
> -- Major Linker Version: 7 --
> -- Minor Linker Version: 10 --
> -- Minor Image Version: 5 --
> -- Minor Image Version: 0 --
> -- Major Operating System Version: 5 --
> -- Minor Operating System Version: 0 --
> -- Major Subsystem Version: 5 --
> -- Minor Subsystem Version: 0 --
> -- Image Magic: 267 --
> -- Image Checksum: 65670 --
> -- Image Dll Characteristics: 1024 --
>
>
> Even it was not loaded and/or activated while this happened,...
>
> Regards
>
> Kerem
>
> --
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."
> "Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
> news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
>> 1. Check your system memory for stability (good memory test, not just
>> POST)
>> 2. That could be your video driver misbehaving. Or some crapware hooked
>> to your video drover (remote access?)
>>
>> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
>>> Hi,
>>>
>>> this speaks for itself:
>>>
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
>>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>>>
>>> How this happened: I wanted to send System to Hbernation Mode,
>>> but it was not able to enter this state: No Error Log Entries, no
>>> Messages, it just turned from "Preparing for Hibernation,..." to
>>> this Window. Interessting is that you can see in a Screenshot that
>>> everything is rendered false except the disabled MenuItems on
>>> Menus. Why only disabled items are drawn correctly. An why
>>> can the content from Internet Explorer be drawn correctly?
>>> Every Application started after this fault has totally destroyed
>>> Character repesentation and Consoles write their buffers also
>>> false and randomly as you can see. I had to restart the complete
>>> System to get a usefull state. If i wouldn't be that familliar with
>>> the OS and MS Paint i couldnt make these screeenshots and
>>> save them, since you can read nothing on any window or menu
>>> items,...
>>>
>>> Oh yes, why will the content from FreeMath rendered successfully
>>> and other apps not?
>>>
>>> Its OT but maybe someone is interessted in it and also can expplain
>>> me what and why this happens,...OS is SP3 WinXPPro, you propably
>>> already figured this out from the Screenshots,..
>>>
>>> Regards
>>>
>>> Kerem
>>>
>>> --
>>> -----------------------
>>> Beste Grüsse / Best regards / Votre bien devoue
>>> Kerem Gümrükcü
>>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>>> Latest Open-Source Projects: http://entwicklung.junetz.de
>>> -----------------------
>>> "This reply is provided as is, without warranty express or implied."
>>
>>
>

== 5 of 8 ==
Date: Sun, Jun 22 2008 7:30 pm
From: "Ken Snyder"


Hi Ivan,

>The fact that you have a mirror driver would make me think of the 4th one.

at the Time this happened, the driver neither was started nor loaded
in any way in the systems user/kernelspace, in fact it was just a binary
located somewhere on the hard disk. The point is, that i did a call to
SetSystemPowerState (hibernate,force), the system started to prepare
for this and suddenly returned to that surface what you saw. No MessageBox,
schowing any "Driver did not allow to set state xyz" or something like that.
But why and what has happened that made any characters and any sort of
drawing text gone, especially the console subsystem. What happened
internally there? What is the Limit of USER/GDI/DESKTOP/SESSION
Objects/Handles? I do have lots of physical memory (i mean if not there is
virtual space, no matter how much physical you have!) But i do not have
lots of paging access while working, anyway, whats the Limit of these
objects
and on what does this depend,...and what do i have to take care/measure
to avoid such situations,...i guess there is no indicator for this,..am i
right?


Regards

Kerem

--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
Newsbeitrag news:545DB2A6-61E4-484D-BCB0-93980F1F4822@microsoft.com...
> The images shown would make me think of GDI handle exhaustion,
> USER handle exhaustion, Desktop-Heap exhaustion, or, Session-Space
> exhausion.
> The fact that you have a mirror driver would make me think of the 4th one.
>
> --
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
> news:OwNNLML1IHA.4572@TK2MSFTNGP03.phx.gbl...
> > Hi Alexander,
> >
> >>1. Check your system memory for stability (good memory test, not just
> >>POST)
> >
> > My recommendation for everybody:
> > http://www.memtest.org/
> >
> > I checked memory even yesterday,..really! No Problems,...
> >
> >>2. That could be your video driver misbehaving. Or some crapware hooked
to
> >>your video drover (remote access?)
> >
> > The only video driver attached to the system except
> > the primary video driver is UltraVNC Video Driver
> > and there was never ever a problem with it at least
> > on my system. Here is some Version info:
> >
> > C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys
> >
> > File Version Info for:
> > "C:\WINDOWS\system32\drivers\vncdrv.sys"
> >
> > [FileName]
> > -- C:\WINDOWS\system32\drivers\vncdrv.sys --
> > [Language]
> > -- Sprachneutral --
> > [Comments]
> > -- "No Information Available" --
> > [CompanyName]
> > -- RDV Soft --
> > [FileDescription]
> > -- Ultravnc Mirror Driver --
> > [FileVersion]
> > -- 1.00.17 --
> > [InternalName]
> > -- vncdrv.sys --
> > [LegalCopyright]
> > -- RDV Soft --
> > [LegalTrademarks]
> > -- "No Information Available" --
> > [OriginalFilename]
> > -- vncdrv.sys --
> > [ProductName]
> > -- UltraVnc Mirror Driver --
> > [ProductVersion]
> > -- 1.00.17 --
> > [PrivateBuild]
> > -- "No Information Available" --
> > [SpecialBuild]
> > -- "No Information Available" --
> > [Checksums]
> > -- Header Sum: 65670 --
> > -- Computed Sum: 65670 --
> > [ImageExtraInfo]
> > -- Image Characteristics: 270 --
> > -- Machine: 332 --
> > -- Subsystem: 1 --
> > -- Major Linker Version: 7 --
> > -- Minor Linker Version: 10 --
> > -- Minor Image Version: 5 --
> > -- Minor Image Version: 0 --
> > -- Major Operating System Version: 5 --
> > -- Minor Operating System Version: 0 --
> > -- Major Subsystem Version: 5 --
> > -- Minor Subsystem Version: 0 --
> > -- Image Magic: 267 --
> > -- Image Checksum: 65670 --
> > -- Image Dll Characteristics: 1024 --
> >
> >
> > Even it was not loaded and/or activated while this happened,...
> >
> > Regards
> >
> > Kerem
> >
> > --
> > -----------------------
> > Beste Grüsse / Best regards / Votre bien devoue
> > Kerem Gümrükcü
> > Microsoft Live Space: http://kerem-g.spaces.live.com/
> > Latest Open-Source Projects: http://entwicklung.junetz.de
> > -----------------------
> > "This reply is provided as is, without warranty express or implied."
> > "Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
> > news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
> >> 1. Check your system memory for stability (good memory test, not just
> >> POST)
> >> 2. That could be your video driver misbehaving. Or some crapware hooked
> >> to your video drover (remote access?)
> >>
> >> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
> >> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
> >>> Hi,
> >>>
> >>> this speaks for itself:
> >>>
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
> >>>
> >>> How this happened: I wanted to send System to Hbernation Mode,
> >>> but it was not able to enter this state: No Error Log Entries, no
> >>> Messages, it just turned from "Preparing for Hibernation,..." to
> >>> this Window. Interessting is that you can see in a Screenshot that
> >>> everything is rendered false except the disabled MenuItems on
> >>> Menus. Why only disabled items are drawn correctly. An why
> >>> can the content from Internet Explorer be drawn correctly?
> >>> Every Application started after this fault has totally destroyed
> >>> Character repesentation and Consoles write their buffers also
> >>> false and randomly as you can see. I had to restart the complete
> >>> System to get a usefull state. If i wouldn't be that familliar with
> >>> the OS and MS Paint i couldnt make these screeenshots and
> >>> save them, since you can read nothing on any window or menu
> >>> items,...
> >>>
> >>> Oh yes, why will the content from FreeMath rendered successfully
> >>> and other apps not?
> >>>
> >>> Its OT but maybe someone is interessted in it and also can expplain
> >>> me what and why this happens,...OS is SP3 WinXPPro, you propably
> >>> already figured this out from the Screenshots,..
> >>>
> >>> Regards
> >>>
> >>> Kerem
> >>>
> >>> --
> >>> -----------------------
> >>> Beste Grüsse / Best regards / Votre bien devoue
> >>> Kerem Gümrükcü
> >>> Microsoft Live Space: http://kerem-g.spaces.live.com/
> >>> Latest Open-Source Projects: http://entwicklung.junetz.de
> >>> -----------------------
> >>> "This reply is provided as is, without warranty express or implied."
> >>
> >>
> >
>


== 6 of 8 ==
Date: Sun, Jun 22 2008 10:10 pm
From: "Ivan Brugiolo [MSFT]"


Gdi and User handle should be monitorable via perf-mon.
Their limit is around 10000 per process and 64000 per session.

Desktop-Heap should be monitorable with a tool called dheapmon.
http://support.microsoft.com/kb/184802 should be a good reading.
For the general issue, this should also be a recomended reading.
http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx

For the session space exhaustion, if you are on WinXp/Win2003-32-bit,
there are no magic tools that I'm aware of, short of debugging
the Mm structures in KD.
While I do not have a good idea why hibernation is triggering the issue,
I have debugged quite a few session space exhaustion, where either
the creation of a large bitmap was failing, or, the mere existence of
very large display driver was killing the contiguous space of session space,
and, session space fragmentation was preventing all but small operations
from completing.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Ken Snyder" <mp5fmj@hotmail.com> wrote in message
news:%23jP0NoN1IHA.4004@TK2MSFTNGP03.phx.gbl...
> Hi Ivan,
>
>>The fact that you have a mirror driver would make me think of the 4th one.
>
> at the Time this happened, the driver neither was started nor loaded
> in any way in the systems user/kernelspace, in fact it was just a binary
> located somewhere on the hard disk. The point is, that i did a call to
> SetSystemPowerState (hibernate,force), the system started to prepare
> for this and suddenly returned to that surface what you saw. No
> MessageBox,
> schowing any "Driver did not allow to set state xyz" or something like
> that.
> But why and what has happened that made any characters and any sort of
> drawing text gone, especially the console subsystem. What happened
> internally there? What is the Limit of USER/GDI/DESKTOP/SESSION
> Objects/Handles? I do have lots of physical memory (i mean if not there is
> virtual space, no matter how much physical you have!) But i do not have
> lots of paging access while working, anyway, whats the Limit of these
> objects
> and on what does this depend,...and what do i have to take care/measure
> to avoid such situations,...i guess there is no indicator for this,..am i
> right?
>
>
> Regards
>
> Kerem
>
> --
> --
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."
>
> "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
> Newsbeitrag news:545DB2A6-61E4-484D-BCB0-93980F1F4822@microsoft.com...
>> The images shown would make me think of GDI handle exhaustion,
>> USER handle exhaustion, Desktop-Heap exhaustion, or, Session-Space
>> exhausion.
>> The fact that you have a mirror driver would make me think of the 4th
>> one.
>>
>> --
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> Use of any included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>>
>>
>> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>> news:OwNNLML1IHA.4572@TK2MSFTNGP03.phx.gbl...
>> > Hi Alexander,
>> >
>> >>1. Check your system memory for stability (good memory test, not just
>> >>POST)
>> >
>> > My recommendation for everybody:
>> > http://www.memtest.org/
>> >
>> > I checked memory even yesterday,..really! No Problems,...
>> >
>> >>2. That could be your video driver misbehaving. Or some crapware hooked
> to
>> >>your video drover (remote access?)
>> >
>> > The only video driver attached to the system except
>> > the primary video driver is UltraVNC Video Driver
>> > and there was never ever a problem with it at least
>> > on my system. Here is some Version info:
>> >
>> > C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys
>> >
>> > File Version Info for:
>> > "C:\WINDOWS\system32\drivers\vncdrv.sys"
>> >
>> > [FileName]
>> > -- C:\WINDOWS\system32\drivers\vncdrv.sys --
>> > [Language]
>> > -- Sprachneutral --
>> > [Comments]
>> > -- "No Information Available" --
>> > [CompanyName]
>> > -- RDV Soft --
>> > [FileDescription]
>> > -- Ultravnc Mirror Driver --
>> > [FileVersion]
>> > -- 1.00.17 --
>> > [InternalName]
>> > -- vncdrv.sys --
>> > [LegalCopyright]
>> > -- RDV Soft --
>> > [LegalTrademarks]
>> > -- "No Information Available" --
>> > [OriginalFilename]
>> > -- vncdrv.sys --
>> > [ProductName]
>> > -- UltraVnc Mirror Driver --
>> > [ProductVersion]
>> > -- 1.00.17 --
>> > [PrivateBuild]
>> > -- "No Information Available" --
>> > [SpecialBuild]
>> > -- "No Information Available" --
>> > [Checksums]
>> > -- Header Sum: 65670 --
>> > -- Computed Sum: 65670 --
>> > [ImageExtraInfo]
>> > -- Image Characteristics: 270 --
>> > -- Machine: 332 --
>> > -- Subsystem: 1 --
>> > -- Major Linker Version: 7 --
>> > -- Minor Linker Version: 10 --
>> > -- Minor Image Version: 5 --
>> > -- Minor Image Version: 0 --
>> > -- Major Operating System Version: 5 --
>> > -- Minor Operating System Version: 0 --
>> > -- Major Subsystem Version: 5 --
>> > -- Minor Subsystem Version: 0 --
>> > -- Image Magic: 267 --
>> > -- Image Checksum: 65670 --
>> > -- Image Dll Characteristics: 1024 --
>> >
>> >
>> > Even it was not loaded and/or activated while this happened,...
>> >
>> > Regards
>> >
>> > Kerem
>> >
>> > --
>> > -----------------------
>> > Beste Grüsse / Best regards / Votre bien devoue
>> > Kerem Gümrükcü
>> > Microsoft Live Space: http://kerem-g.spaces.live.com/
>> > Latest Open-Source Projects: http://entwicklung.junetz.de
>> > -----------------------
>> > "This reply is provided as is, without warranty express or implied."
>> > "Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
>> > news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
>> >> 1. Check your system memory for stability (good memory test, not just
>> >> POST)
>> >> 2. That could be your video driver misbehaving. Or some crapware
>> >> hooked
>> >> to your video drover (remote access?)
>> >>
>> >> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>> >> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
>> >>> Hi,
>> >>>
>> >>> this speaks for itself:
>> >>>
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>> >>>
>> >>> How this happened: I wanted to send System to Hbernation Mode,
>> >>> but it was not able to enter this state: No Error Log Entries, no
>> >>> Messages, it just turned from "Preparing for Hibernation,..." to
>> >>> this Window. Interessting is that you can see in a Screenshot that
>> >>> everything is rendered false except the disabled MenuItems on
>> >>> Menus. Why only disabled items are drawn correctly. An why
>> >>> can the content from Internet Explorer be drawn correctly?
>> >>> Every Application started after this fault has totally destroyed
>> >>> Character repesentation and Consoles write their buffers also
>> >>> false and randomly as you can see. I had to restart the complete
>> >>> System to get a usefull state. If i wouldn't be that familliar with
>> >>> the OS and MS Paint i couldnt make these screeenshots and
>> >>> save them, since you can read nothing on any window or menu
>> >>> items,...
>> >>>
>> >>> Oh yes, why will the content from FreeMath rendered successfully
>> >>> and other apps not?
>> >>>
>> >>> Its OT but maybe someone is interessted in it and also can expplain
>> >>> me what and why this happens,...OS is SP3 WinXPPro, you propably
>> >>> already figured this out from the Screenshots,..
>> >>>
>> >>> Regards
>> >>>
>> >>> Kerem
>> >>>
>> >>> --
>> >>> -----------------------
>> >>> Beste Grüsse / Best regards / Votre bien devoue
>> >>> Kerem Gümrükcü
>> >>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>> >>> Latest Open-Source Projects: http://entwicklung.junetz.de
>> >>> -----------------------
>> >>> "This reply is provided as is, without warranty express or implied."
>> >>
>> >>
>> >
>>
>
>

== 7 of 8 ==
Date: Sun, Jun 22 2008 10:41 pm
From: Kerem Gümrükcü


Hi Ivan,

yes, it really was the call to SetSystemPowerState, i mean we are
sure that this was not the reason, the function i mean, but some other
lower level code that lead to this. I could not reproduce this on my
Windows XP System. The Application that send Windows to Hibernate
was a self made .NET based UserMode-Only application that just drops
a SetSystemPowerState(false,true); to the Windows API, thats all,...

Maybe the Force-Flag lead to this. But i dont know how?

Thanks for the Links,...

Regards

Kerem


--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
Newsbeitrag news:6F36F36A-22BE-4F9E-99A8-D8B99AE99B0B@microsoft.com...
> Gdi and User handle should be monitorable via perf-mon.
> Their limit is around 10000 per process and 64000 per session.
>
> Desktop-Heap should be monitorable with a tool called dheapmon.
> http://support.microsoft.com/kb/184802 should be a good reading.
> For the general issue, this should also be a recomended reading.
> http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx
>
> For the session space exhaustion, if you are on WinXp/Win2003-32-bit,
> there are no magic tools that I'm aware of, short of debugging
> the Mm structures in KD.
> While I do not have a good idea why hibernation is triggering the issue,
> I have debugged quite a few session space exhaustion, where either
> the creation of a large bitmap was failing, or, the mere existence of
> very large display driver was killing the contiguous space of session
> space,
> and, session space fragmentation was preventing all but small operations
> from completing.
>
> --
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Ken Snyder" <mp5fmj@hotmail.com> wrote in message
> news:%23jP0NoN1IHA.4004@TK2MSFTNGP03.phx.gbl...
>> Hi Ivan,
>>
>>>The fact that you have a mirror driver would make me think of the 4th
>>>one.
>>
>> at the Time this happened, the driver neither was started nor loaded
>> in any way in the systems user/kernelspace, in fact it was just a binary
>> located somewhere on the hard disk. The point is, that i did a call to
>> SetSystemPowerState (hibernate,force), the system started to prepare
>> for this and suddenly returned to that surface what you saw. No
>> MessageBox,
>> schowing any "Driver did not allow to set state xyz" or something like
>> that.
>> But why and what has happened that made any characters and any sort of
>> drawing text gone, especially the console subsystem. What happened
>> internally there? What is the Limit of USER/GDI/DESKTOP/SESSION
>> Objects/Handles? I do have lots of physical memory (i mean if not there
>> is
>> virtual space, no matter how much physical you have!) But i do not have
>> lots of paging access while working, anyway, whats the Limit of these
>> objects
>> and on what does this depend,...and what do i have to take care/measure
>> to avoid such situations,...i guess there is no indicator for this,..am i
>> right?
>>
>>
>> Regards
>>
>> Kerem
>>
>> --
>> --
>> -----------------------
>> Beste Grüsse / Best regards / Votre bien devoue
>> Kerem Gümrükcü
>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>> Latest Open-Source Projects: http://entwicklung.junetz.de
>> -----------------------
>> "This reply is provided as is, without warranty express or implied."
>>
>> "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
>> Newsbeitrag news:545DB2A6-61E4-484D-BCB0-93980F1F4822@microsoft.com...
>>> The images shown would make me think of GDI handle exhaustion,
>>> USER handle exhaustion, Desktop-Heap exhaustion, or, Session-Space
>>> exhausion.
>>> The fact that you have a mirror driver would make me think of the 4th
>>> one.
>>>
>>> --
>>> --
>>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>> Use of any included script samples are subject to the terms specified at
>>> http://www.microsoft.com/info/cpyright.htm
>>>
>>>
>>> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>>> news:OwNNLML1IHA.4572@TK2MSFTNGP03.phx.gbl...
>>> > Hi Alexander,
>>> >
>>> >>1. Check your system memory for stability (good memory test, not just
>>> >>POST)
>>> >
>>> > My recommendation for everybody:
>>> > http://www.memtest.org/
>>> >
>>> > I checked memory even yesterday,..really! No Problems,...
>>> >
>>> >>2. That could be your video driver misbehaving. Or some crapware
>>> >>hooked
>> to
>>> >>your video drover (remote access?)
>>> >
>>> > The only video driver attached to the system except
>>> > the primary video driver is UltraVNC Video Driver
>>> > and there was never ever a problem with it at least
>>> > on my system. Here is some Version info:
>>> >
>>> > C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys
>>> >
>>> > File Version Info for:
>>> > "C:\WINDOWS\system32\drivers\vncdrv.sys"
>>> >
>>> > [FileName]
>>> > -- C:\WINDOWS\system32\drivers\vncdrv.sys --
>>> > [Language]
>>> > -- Sprachneutral --
>>> > [Comments]
>>> > -- "No Information Available" --
>>> > [CompanyName]
>>> > -- RDV Soft --
>>> > [FileDescription]
>>> > -- Ultravnc Mirror Driver --
>>> > [FileVersion]
>>> > -- 1.00.17 --
>>> > [InternalName]
>>> > -- vncdrv.sys --
>>> > [LegalCopyright]
>>> > -- RDV Soft --
>>> > [LegalTrademarks]
>>> > -- "No Information Available" --
>>> > [OriginalFilename]
>>> > -- vncdrv.sys --
>>> > [ProductName]
>>> > -- UltraVnc Mirror Driver --
>>> > [ProductVersion]
>>> > -- 1.00.17 --
>>> > [PrivateBuild]
>>> > -- "No Information Available" --
>>> > [SpecialBuild]
>>> > -- "No Information Available" --
>>> > [Checksums]
>>> > -- Header Sum: 65670 --
>>> > -- Computed Sum: 65670 --
>>> > [ImageExtraInfo]
>>> > -- Image Characteristics: 270 --
>>> > -- Machine: 332 --
>>> > -- Subsystem: 1 --
>>> > -- Major Linker Version: 7 --
>>> > -- Minor Linker Version: 10 --
>>> > -- Minor Image Version: 5 --
>>> > -- Minor Image Version: 0 --
>>> > -- Major Operating System Version: 5 --
>>> > -- Minor Operating System Version: 0 --
>>> > -- Major Subsystem Version: 5 --
>>> > -- Minor Subsystem Version: 0 --
>>> > -- Image Magic: 267 --
>>> > -- Image Checksum: 65670 --
>>> > -- Image Dll Characteristics: 1024 --
>>> >
>>> >
>>> > Even it was not loaded and/or activated while this happened,...
>>> >
>>> > Regards
>>> >
>>> > Kerem
>>> >
>>> > --
>>> > -----------------------
>>> > Beste Grüsse / Best regards / Votre bien devoue
>>> > Kerem Gümrükcü
>>> > Microsoft Live Space: http://kerem-g.spaces.live.com/
>>> > Latest Open-Source Projects: http://entwicklung.junetz.de
>>> > -----------------------
>>> > "This reply is provided as is, without warranty express or implied."
>>> > "Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
>>> > news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
>>> >> 1. Check your system memory for stability (good memory test, not just
>>> >> POST)
>>> >> 2. That could be your video driver misbehaving. Or some crapware
>>> >> hooked
>>> >> to your video drover (remote access?)
>>> >>
>>> >> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>>> >> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
>>> >>> Hi,
>>> >>>
>>> >>> this speaks for itself:
>>> >>>
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>>> >>>
>>> >>> How this happened: I wanted to send System to Hbernation Mode,
>>> >>> but it was not able to enter this state: No Error Log Entries, no
>>> >>> Messages, it just turned from "Preparing for Hibernation,..." to
>>> >>> this Window. Interessting is that you can see in a Screenshot that
>>> >>> everything is rendered false except the disabled MenuItems on
>>> >>> Menus. Why only disabled items are drawn correctly. An why
>>> >>> can the content from Internet Explorer be drawn correctly?
>>> >>> Every Application started after this fault has totally destroyed
>>> >>> Character repesentation and Consoles write their buffers also
>>> >>> false and randomly as you can see. I had to restart the complete
>>> >>> System to get a usefull state. If i wouldn't be that familliar with
>>> >>> the OS and MS Paint i couldnt make these screeenshots and
>>> >>> save them, since you can read nothing on any window or menu
>>> >>> items,...
>>> >>>
>>> >>> Oh yes, why will the content from FreeMath rendered successfully
>>> >>> and other apps not?
>>> >>>
>>> >>> Its OT but maybe someone is interessted in it and also can expplain
>>> >>> me what and why this happens,...OS is SP3 WinXPPro, you propably
>>> >>> already figured this out from the Screenshots,..
>>> >>>
>>> >>> Regards
>>> >>>
>>> >>> Kerem
>>> >>>
>>> >>> --
>>> >>> -----------------------
>>> >>> Beste Grüsse / Best regards / Votre bien devoue
>>> >>> Kerem Gümrükcü
>>> >>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>>> >>> Latest Open-Source Projects: http://entwicklung.junetz.de
>>> >>> -----------------------
>>> >>> "This reply is provided as is, without warranty express or implied."
>>> >>
>>> >>
>>> >
>>>
>>
>>
>

== 8 of 8 ==
Date: Sun, Jun 22 2008 10:57 pm
From: Kerem Gümrükcü


Hi Ivan,

reading you post again lead me to this question: If
the limit is arround 10000 objects/handles, so why
the os fails that way and just simply does not allow
the creation of new object instances or notifies the
user about something like "Out of GDI Objects".
I mean this would be much better that rendering the
complete UI useless,...or it should only fail the applications
that requested the GDI Objects..

>Gdi and User handle should be monitorable via perf-mon.
>Their limit is around 10000 per process and 64000 per session

Why is this limited? Wouldnt be a "Allocate until there is no more
capacity" Strategy much better than limiting this.Trying to exceed
that limit should just fail for the callers of the code that requested
handles to objects,...


Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
Newsbeitrag news:6F36F36A-22BE-4F9E-99A8-D8B99AE99B0B@microsoft.com...
> Gdi and User handle should be monitorable via perf-mon.
> Their limit is around 10000 per process and 64000 per session.
>
> Desktop-Heap should be monitorable with a tool called dheapmon.
> http://support.microsoft.com/kb/184802 should be a good reading.
> For the general issue, this should also be a recomended reading.
> http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx
>
> For the session space exhaustion, if you are on WinXp/Win2003-32-bit,
> there are no magic tools that I'm aware of, short of debugging
> the Mm structures in KD.
> While I do not have a good idea why hibernation is triggering the issue,
> I have debugged quite a few session space exhaustion, where either
> the creation of a large bitmap was failing, or, the mere existence of
> very large display driver was killing the contiguous space of session
> space,
> and, session space fragmentation was preventing all but small operations
> from completing.
>
> --
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Ken Snyder" <mp5fmj@hotmail.com> wrote in message
> news:%23jP0NoN1IHA.4004@TK2MSFTNGP03.phx.gbl...
>> Hi Ivan,
>>
>>>The fact that you have a mirror driver would make me think of the 4th
>>>one.
>>
>> at the Time this happened, the driver neither was started nor loaded
>> in any way in the systems user/kernelspace, in fact it was just a binary
>> located somewhere on the hard disk. The point is, that i did a call to
>> SetSystemPowerState (hibernate,force), the system started to prepare
>> for this and suddenly returned to that surface what you saw. No
>> MessageBox,
>> schowing any "Driver did not allow to set state xyz" or something like
>> that.
>> But why and what has happened that made any characters and any sort of
>> drawing text gone, especially the console subsystem. What happened
>> internally there? What is the Limit of USER/GDI/DESKTOP/SESSION
>> Objects/Handles? I do have lots of physical memory (i mean if not there
>> is
>> virtual space, no matter how much physical you have!) But i do not have
>> lots of paging access while working, anyway, whats the Limit of these
>> objects
>> and on what does this depend,...and what do i have to take care/measure
>> to avoid such situations,...i guess there is no indicator for this,..am i
>> right?
>>
>>
>> Regards
>>
>> Kerem
>>
>> --
>> --
>> -----------------------
>> Beste Grüsse / Best regards / Votre bien devoue
>> Kerem Gümrükcü
>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>> Latest Open-Source Projects: http://entwicklung.junetz.de
>> -----------------------
>> "This reply is provided as is, without warranty express or implied."
>>
>> "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> schrieb im
>> Newsbeitrag news:545DB2A6-61E4-484D-BCB0-93980F1F4822@microsoft.com...
>>> The images shown would make me think of GDI handle exhaustion,
>>> USER handle exhaustion, Desktop-Heap exhaustion, or, Session-Space
>>> exhausion.
>>> The fact that you have a mirror driver would make me think of the 4th
>>> one.
>>>
>>> --
>>> --
>>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>> Use of any included script samples are subject to the terms specified at
>>> http://www.microsoft.com/info/cpyright.htm
>>>
>>>
>>> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>>> news:OwNNLML1IHA.4572@TK2MSFTNGP03.phx.gbl...
>>> > Hi Alexander,
>>> >
>>> >>1. Check your system memory for stability (good memory test, not just
>>> >>POST)
>>> >
>>> > My recommendation for everybody:
>>> > http://www.memtest.org/
>>> >
>>> > I checked memory even yesterday,..really! No Problems,...
>>> >
>>> >>2. That could be your video driver misbehaving. Or some crapware
>>> >>hooked
>> to
>>> >>your video drover (remote access?)
>>> >
>>> > The only video driver attached to the system except
>>> > the primary video driver is UltraVNC Video Driver
>>> > and there was never ever a problem with it at least
>>> > on my system. Here is some Version info:
>>> >
>>> > C:\Programme\verinfo>verinfo C:\WINDOWS\system32\drivers\vncdrv.sys
>>> >
>>> > File Version Info for:
>>> > "C:\WINDOWS\system32\drivers\vncdrv.sys"
>>> >
>>> > [FileName]
>>> > -- C:\WINDOWS\system32\drivers\vncdrv.sys --
>>> > [Language]
>>> > -- Sprachneutral --
>>> > [Comments]
>>> > -- "No Information Available" --
>>> > [CompanyName]
>>> > -- RDV Soft --
>>> > [FileDescription]
>>> > -- Ultravnc Mirror Driver --
>>> > [FileVersion]
>>> > -- 1.00.17 --
>>> > [InternalName]
>>> > -- vncdrv.sys --
>>> > [LegalCopyright]
>>> > -- RDV Soft --
>>> > [LegalTrademarks]
>>> > -- "No Information Available" --
>>> > [OriginalFilename]
>>> > -- vncdrv.sys --
>>> > [ProductName]
>>> > -- UltraVnc Mirror Driver --
>>> > [ProductVersion]
>>> > -- 1.00.17 --
>>> > [PrivateBuild]
>>> > -- "No Information Available" --
>>> > [SpecialBuild]
>>> > -- "No Information Available" --
>>> > [Checksums]
>>> > -- Header Sum: 65670 --
>>> > -- Computed Sum: 65670 --
>>> > [ImageExtraInfo]
>>> > -- Image Characteristics: 270 --
>>> > -- Machine: 332 --
>>> > -- Subsystem: 1 --
>>> > -- Major Linker Version: 7 --
>>> > -- Minor Linker Version: 10 --
>>> > -- Minor Image Version: 5 --
>>> > -- Minor Image Version: 0 --
>>> > -- Major Operating System Version: 5 --
>>> > -- Minor Operating System Version: 0 --
>>> > -- Major Subsystem Version: 5 --
>>> > -- Minor Subsystem Version: 0 --
>>> > -- Image Magic: 267 --
>>> > -- Image Checksum: 65670 --
>>> > -- Image Dll Characteristics: 1024 --
>>> >
>>> >
>>> > Even it was not loaded and/or activated while this happened,...
>>> >
>>> > Regards
>>> >
>>> > Kerem
>>> >
>>> > --
>>> > -----------------------
>>> > Beste Grüsse / Best regards / Votre bien devoue
>>> > Kerem Gümrükcü
>>> > Microsoft Live Space: http://kerem-g.spaces.live.com/
>>> > Latest Open-Source Projects: http://entwicklung.junetz.de
>>> > -----------------------
>>> > "This reply is provided as is, without warranty express or implied."
>>> > "Alexander Grigoriev" <alegr@earthlink.net> schrieb im Newsbeitrag
>>> > news:uAFzeFL1IHA.1628@TK2MSFTNGP03.phx.gbl...
>>> >> 1. Check your system memory for stability (good memory test, not just
>>> >> POST)
>>> >> 2. That could be your video driver misbehaving. Or some crapware
>>> >> hooked
>>> >> to your video drover (remote access?)
>>> >>
>>> >> "Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
>>> >> news:%23A%23wT$J1IHA.4164@TK2MSFTNGP03.phx.gbl...
>>> >>> Hi,
>>> >>>
>>> >>> this speaks for itself:
>>> >>>
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr1.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr2.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr3.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr4.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr5.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr6.jpg
>>> >>> http://www.pro-it-education.de/staff/keremg/misc/gdierr7.jpg
>>> >>>
>>> >>> How this happened: I wanted to send System to Hbernation Mode,
>>> >>> but it was not able to enter this state: No Error Log Entries, no
>>> >>> Messages, it just turned from "Preparing for Hibernation,..." to
>>> >>> this Window. Interessting is that you can see in a Screenshot that
>>> >>> everything is rendered false except the disabled MenuItems on
>>> >>> Menus. Why only disabled items are drawn correctly. An why
>>> >>> can the content from Internet Explorer be drawn correctly?
>>> >>> Every Application started after this fault has totally destroyed
>>> >>> Character repesentation and Consoles write their buffers also
>>> >>> false and randomly as you can see. I had to restart the complete
>>> >>> System to get a usefull state. If i wouldn't be that familliar with
>>> >>> the OS and MS Paint i couldnt make these screeenshots and
>>> >>> save them, since you can read nothing on any window or menu
>>> >>> items,...
>>> >>>
>>> >>> Oh yes, why will the content from FreeMath rendered successfully
>>> >>> and other apps not?
>>> >>>
>>> >>> Its OT but maybe someone is interessted in it and also can expplain
>>> >>> me what and why this happens,...OS is SP3 WinXPPro, you propably
>>> >>> already figured this out from the Screenshots,..
>>> >>>
>>> >>> Regards
>>> >>>
>>> >>> Kerem
>>> >>>
>>> >>> --
>>> >>> -----------------------
>>> >>> Beste Grüsse / Best regards / Votre bien devoue
>>> >>> Kerem Gümrükcü
>>> >>> Microsoft Live Space: http://kerem-g.spaces.live.com/
>>> >>> Latest Open-Source Projects: http://entwicklung.junetz.de
>>> >>> -----------------------
>>> >>> "This reply is provided as is, without warranty express or implied."
>>> >>
>>> >>
>>> >
>>>
>>
>>
>


==============================================================================
TOPIC: Bluetooth Visa64 Drivers
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/c5da7a8c2da05eb3?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Jun 22 2008 2:09 pm
From: "Clayton"


I have added my Sony Ericsson W910i phone to the Windows Bluetooth software,
I am having a few problems with drivers for 2 entries which I can not find
on the CD provided with the phone, these 2 drivers mention SEMC HLA and SEMC
Watch Phone.

My Bluetooth dongle came with my Dell Keyboard and Mouse and does not offer
many options using their software, I did have a problem with another 2 more
drivers which were not on the Sony Ericsson CD but found a bunch of
Bluetooth drivers from Broadcom, these were for OBEX SyncML Client and
Remote Control


==============================================================================
TOPIC: get from KernelMode to UserMode very quickly?
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/a863d900d11376d5?hl=en
==============================================================================

== 1 of 2 ==
Date: Sun, Jun 22 2008 3:43 pm
From: "name"


has anyone here every explored the following topic (with code sample) to
verify it works?

is this still possible to do in Windows XP?

is there any similar, newer, or even better "dirty tricks" to get from
KernelMode to UserMode very quickly?


found at: http://www.cmkrnl.com/arc-userapc.html

Usenet Archives
User mode APCs
Author: Anatoly Vorobey
Date: 1997/05/08
Forum: comp.os.ms-windows.programmer.nt.kernel-mode
Posted on: 1997/05/08
Message-ID:
Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
Organization: Erol's Internet Services
Reply-To: mellon+usenet@pobox.com
X-Received-On: 8 May 1997 11:43:05 GMT


Hi there,

The issue of notifying user-mode thread from a kernel-mode driver, or
calling a user-mode routine from same, is very often discussed here. The
usual solutions offered are: 1) a dedicated thread sending an IRP to the
driver which the driver leaves uncompleted and completes when it needs to
communicate information to the thread; and 2) signaling an event which can
be accessed in both user and kernel mode, with user-mode thread waiting on
it. Both these approaches have their drawbacks; in particular, they need a
dedicated thread waiting, and they're relatively slow - sometimes you _know_
you're in the right context, and you just need to tell something to the
user-mode thread or pass some information to it as soon as possible.

I've tried to find other ways of doing the same, being driven mostly by
curiosity, spirit of exploration and stubborness. I've found two other
mechanisms by which it is possible to make a thread call some specific
user-mode function:

1. User-mode APC (Asynchronous Procedure Call). The whole issue of APCs is
quite undocumented in the DDK. Actually, more informatiion about APCs can be
found in Win32 SDK help than in NT DDK help! That's because the whole
mechanism of completion routine-based I/O routines (like ReadFileEx(), etc.)
is quite transparently based on APC, and the SDK help says a few basic
things about APCs. They're also discussed briefly in the classic Helen
Custer's "Inside Windows NT".

The main problem with this approach is that according to the NT design
principles, a thread can receive a user-mode APC _only_ if it declares
itself alertable: either by waiting on a synchronization object with
alertable flag set on, or explicitly calling a certain function in ntdll.dll
to check whether it should be alerted. Since we _don't_ want our thread to
wait on anything (we may just as well use named event then) we're stuck. In
the code I give below, I overcome this problem in an undocumented and
somewhat dirty way; I'm still searching for more "clean" ways to do it.

When a user-mode APC is passed to a thread in this way, its routine be
called next time the thread runs in user-mode. If the thread already runs in
user-mode, the routine won't be invoked immediately, however; it'll be
called next time the thread _returns_ to user-mode from some kernel-mode
service. Usually that happens almost immediately since an active thread is
calling kernel-mode services all the time; in the worst case it'll happen
after the next clock tick, when clock tick procedure returns to user-mode.
The user-mode APC will not, however, interrupt any kernel-mode activity;
i.e. if the thread is waiting on an object, it won't be woken up; when it
wakes up by itself, however, it will receive the pending APC immediately.

2. KeUserModeCallback(). This is an undocumented function used by Win32
subsystem running in the kernel in NT 4.0 (win32k.sys). It's used when the
subsystem either needs to know some information stored in user-mode (for
example, in user32.dll's data), or needs to call a thread's window procedure
(for example, when you move your mouse, the subsystem eventually receives
notification of it in kernel mode, and it calls your window procedure with
WM_MOUSEMOVE message using this function). A catch here is that this
mechanism is predefined to call only some specified functions: one of
parameters to KeUserModeCallback() is an index to a special table from which
later in user mode an address to call is fetched. Still it's possible to
exploit this mechanism to call, _very_ quickly (much quicker than the APC,
named event or pending IRP mechanisms allow) an arbitrary routine of your
code. The catch here is that you _must_ be in your thread's context for this
to work; in this respect user-mode APC is better since you can freely send
it to any thread in the system.

Below is sample code that will send user-mode APC to the current thread,
calling an arbitrary user-mode routine and passing it three arbitrary
parameters. If you want to send an APC to your thread from arbitrary
context, you should capture its KTHREAD pointer by calling
KeGetCurrentThread() in _its_ context (say, when receiving a custom control
request from it and being top-level), and use it in a call to
KeInitializeApc later at any time.

Unfortunately, it will only work on x86 architecture due to one
machine-dependent line which modifies directly the KTHREAD structure. It
should, however, work on free/checked builds and SMP/uniprocessor machines
alike. It's taken right out of an article I'm completing which discusses in
detail both kernel-mode and user-mode APCs; I'm still uncertain whether I
should simply put it on the web or try to offer it to some paper magazines.

If you're interested, please try out this code and report to me whether it
works/ doesn't work for you and what happens if it doesn't. Note that I of
course disclaim any responsibility; your system might very well
crash/bugcheck, though I've tested this code for some time now and it's
always been working fine for me.


/* The APC structure is defined in ntddk.h */

/* this is KERNEL_ROUTINE for our APC; in particular, it gets
called when the APC is being delivered. Usually one of predefined
useful routines in the kernel are used for this purpose, but we
can't use any of them as none of them are exported. */

void MyRoutine(struct _KAPC *Apc,
PKNORMAL_ROUTINE norm_routine,
void *context,
void *SysArg1,
void *SysArg2)
{
ExFreePool(Apc);
return;
}

/* pointer to the APC we will create */

static struct _KAPC *apc;

/* KeInitializeApc() and KeInsertQueueApc() are the two functions
needed to send an APC; they're both exported but not prototyped
in the DDK, so we prototype them here. */

void KeInitializeApc(struct _KAPC *Apc, PKTHREAD thread,
unsigned char state_index,
PKKERNEL_ROUTINE ker_routine,
PKRUNDOWN_ROUTINE rd_routine,
PKNORMAL_ROUTINE nor_routine,
unsigned char mode,
void *context);


void KeInsertQueueApc(struct _KAPC *APC,
void *SysArg1,
void *SysArg2,
unsigned char arg4);

/* call this function when you need to send a user-mode APC to
the current thread. addr must be linear address of your user-mode
function to call:

void MyApcRoutine(ULONG arg1, ULONG arg2, ULONG arg3);
...
SendAddrToTheDriverUsingIoctl((ULONG)MyApcRoutine);

you should send it to the driver using your custom IOCTL.
arg1, arg2, arg3 are arbitrary ulong's which are passed to the
function residing at addr; this function should be prototyped as
receiving three parameters and returning void. */

void SendAPC(ULONG addr, ULONG arg1, ULONG arg2, ULONG arg3) {

PKTHREAD thread=KeGetCurrentThread();

/* this is self-explanatory */

apc=ExAllocatePool(NonPagedPool, sizeof(struct _KAPC));

/* Initialize the user-mode APC */

KeInitializeApc(apc, thread, 0,
(PKKERNEL_ROUTINE)&MyRoutine, 0,
(PKNORMAL_ROUTINE)addr, 1, (PVOID)arg1);

/* Insert it to the queue of the target thread */

KeInsertQueueApc(apc, (PVOID)arg2, (PVOID)arg3, 0);

/* Mark the current thread as alertable to force it to deliver
the APC on the next return to the user-mode.
NOTE: severely undocumented code here! */

*((unsigned char *)thread+0x4a)=1;
}


That's about it. I'll be very grateful to hear comments, corrections,
additions or flames from you. Questions are always welcome.

Yours,
Anatoly.

--
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton

== 2 of 2 ==
Date: Sun, Jun 22 2008 4:22 pm
From: "Don Burn"


Why do you think you need this? I've encountered more crap code using
various hacks to notify user space than I want to remember and in every case
I have had a chence to test things, I found that dumping the "super fast"
model for the normal inverted call has never impacted the overall
performance of the app/driver combination. I'm sure there are cases where
it is justified, but they are rare, especially as processors continue
getting faster.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


"name" <me@myplace.com> wrote in message
news:fAA7k.25297$Jx.19057@pd7urf1no...
> has anyone here every explored the following topic (with code sample) to
> verify it works?
>
> is this still possible to do in Windows XP?
>
> is there any similar, newer, or even better "dirty tricks" to get from
> KernelMode to UserMode very quickly?
>
>
> found at: http://www.cmkrnl.com/arc-userapc.html
>
> Usenet Archives
> User mode APCs
> Author: Anatoly Vorobey
> Date: 1997/05/08
> Forum: comp.os.ms-windows.programmer.nt.kernel-mode
> Posted on: 1997/05/08
> Message-ID:
> Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
> Organization: Erol's Internet Services
> Reply-To: mellon+usenet@pobox.com
> X-Received-On: 8 May 1997 11:43:05 GMT
>
>
> Hi there,
>
> The issue of notifying user-mode thread from a kernel-mode driver, or
> calling a user-mode routine from same, is very often discussed here. The
> usual solutions offered are: 1) a dedicated thread sending an IRP to the
> driver which the driver leaves uncompleted and completes when it needs to
> communicate information to the thread; and 2) signaling an event which can
> be accessed in both user and kernel mode, with user-mode thread waiting on
> it. Both these approaches have their drawbacks; in particular, they need a
> dedicated thread waiting, and they're relatively slow - sometimes you
> _know_ you're in the right context, and you just need to tell something to
> the user-mode thread or pass some information to it as soon as possible.
>
> I've tried to find other ways of doing the same, being driven mostly by
> curiosity, spirit of exploration and stubborness. I've found two other
> mechanisms by which it is possible to make a thread call some specific
> user-mode function:
>
> 1. User-mode APC (Asynchronous Procedure Call). The whole issue of APCs is
> quite undocumented in the DDK. Actually, more informatiion about APCs can
> be found in Win32 SDK help than in NT DDK help! That's because the whole
> mechanism of completion routine-based I/O routines (like ReadFileEx(),
> etc.) is quite transparently based on APC, and the SDK help says a few
> basic things about APCs. They're also discussed briefly in the classic
> Helen Custer's "Inside Windows NT".
>
> The main problem with this approach is that according to the NT design
> principles, a thread can receive a user-mode APC _only_ if it declares
> itself alertable: either by waiting on a synchronization object with
> alertable flag set on, or explicitly calling a certain function in
> ntdll.dll to check whether it should be alerted. Since we _don't_ want our
> thread to wait on anything (we may just as well use named event then)
> we're stuck. In the code I give below, I overcome this problem in an
> undocumented and somewhat dirty way; I'm still searching for more "clean"
> ways to do it.
>
> When a user-mode APC is passed to a thread in this way, its routine be
> called next time the thread runs in user-mode. If the thread already runs
> in user-mode, the routine won't be invoked immediately, however; it'll be
> called next time the thread _returns_ to user-mode from some kernel-mode
> service. Usually that happens almost immediately since an active thread is
> calling kernel-mode services all the time; in the worst case it'll happen
> after the next clock tick, when clock tick procedure returns to user-mode.
> The user-mode APC will not, however, interrupt any kernel-mode activity;
> i.e. if the thread is waiting on an object, it won't be woken up; when it
> wakes up by itself, however, it will receive the pending APC immediately.
>
> 2. KeUserModeCallback(). This is an undocumented function used by Win32
> subsystem running in the kernel in NT 4.0 (win32k.sys). It's used when the
> subsystem either needs to know some information stored in user-mode (for
> example, in user32.dll's data), or needs to call a thread's window
> procedure (for example, when you move your mouse, the subsystem eventually
> receives notification of it in kernel mode, and it calls your window
> procedure with WM_MOUSEMOVE message using this function). A catch here is
> that this mechanism is predefined to call only some specified functions:
> one of parameters to KeUserModeCallback() is an index to a special table
> from which later in user mode an address to call is fetched. Still it's
> possible to exploit this mechanism to call, _very_ quickly (much quicker
> than the APC, named event or pending IRP mechanisms allow) an arbitrary
> routine of your code. The catch here is that you _must_ be in your
> thread's context for this to work; in this respect user-mode APC is better
> since you can freely send it to any thread in the system.
>
> Below is sample code that will send user-mode APC to the current thread,
> calling an arbitrary user-mode routine and passing it three arbitrary
> parameters. If you want to send an APC to your thread from arbitrary
> context, you should capture its KTHREAD pointer by calling
> KeGetCurrentThread() in _its_ context (say, when receiving a custom
> control request from it and being top-level), and use it in a call to
> KeInitializeApc later at any time.
>
> Unfortunately, it will only work on x86 architecture due to one
> machine-dependent line which modifies directly the KTHREAD structure. It
> should, however, work on free/checked builds and SMP/uniprocessor machines
> alike. It's taken right out of an article I'm completing which discusses
> in detail both kernel-mode and user-mode APCs; I'm still uncertain whether
> I should simply put it on the web or try to offer it to some paper
> magazines.
>
> If you're interested, please try out this code and report to me whether it
> works/ doesn't work for you and what happens if it doesn't. Note that I of
> course disclaim any responsibility; your system might very well
> crash/bugcheck, though I've tested this code for some time now and it's
> always been working fine for me.
>
>
> /* The APC structure is defined in ntddk.h */
>
> /* this is KERNEL_ROUTINE for our APC; in particular, it gets
> called when the APC is being delivered. Usually one of predefined
> useful routines in the kernel are used for this purpose, but we
> can't use any of them as none of them are exported. */
>
> void MyRoutine(struct _KAPC *Apc,
> PKNORMAL_ROUTINE norm_routine,
> void *context,
> void *SysArg1,
> void *SysArg2)
> {
> ExFreePool(Apc);
> return;
> }
>
> /* pointer to the APC we will create */
>
> static struct _KAPC *apc;
>
> /* KeInitializeApc() and KeInsertQueueApc() are the two functions
> needed to send an APC; they're both exported but not prototyped
> in the DDK, so we prototype them here. */
>
> void KeInitializeApc(struct _KAPC *Apc, PKTHREAD thread,
> unsigned char state_index,
> PKKERNEL_ROUTINE ker_routine,
> PKRUNDOWN_ROUTINE rd_routine,
> PKNORMAL_ROUTINE nor_routine,
> unsigned char mode,
> void *context);
>
>
> void KeInsertQueueApc(struct _KAPC *APC,
> void *SysArg1,
> void *SysArg2,
> unsigned char arg4);
>
> /* call this function when you need to send a user-mode APC to
> the current thread. addr must be linear address of your user-mode
> function to call:
>
> void MyApcRoutine(ULONG arg1, ULONG arg2, ULONG arg3);
> ...
> SendAddrToTheDriverUsingIoctl((ULONG)MyApcRoutine);
>
> you should send it to the driver using your custom IOCTL.
> arg1, arg2, arg3 are arbitrary ulong's which are passed to the
> function residing at addr; this function should be prototyped as
> receiving three parameters and returning void. */
>
> void SendAPC(ULONG addr, ULONG arg1, ULONG arg2, ULONG arg3) {
>
> PKTHREAD thread=KeGetCurrentThread();
>
> /* this is self-explanatory */
>
> apc=ExAllocatePool(NonPagedPool, sizeof(struct _KAPC));
>
> /* Initialize the user-mode APC */
>
> KeInitializeApc(apc, thread, 0,
> (PKKERNEL_ROUTINE)&MyRoutine, 0,
> (PKNORMAL_ROUTINE)addr, 1, (PVOID)arg1);
>
> /* Insert it to the queue of the target thread */
>
> KeInsertQueueApc(apc, (PVOID)arg2, (PVOID)arg3, 0);
>
> /* Mark the current thread as alertable to force it to deliver
> the APC on the next return to the user-mode.
> NOTE: severely undocumented code here! */
>
> *((unsigned char *)thread+0x4a)=1;
> }
>
>
> That's about it. I'll be very grateful to hear comments, corrections,
> additions or flames from you. Questions are always welcome.
>
> Yours,
> Anatoly.
>
> --
> Anatoly Vorobey,
> mellon@pobox.com http://pobox.com/~mellon/
> "Angels can fly because they take themselves lightly" - G.K.Chesterton
>
>



==============================================================================
TOPIC: How to disallow sleep/hibernation in Windows Vista ?
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/410e16ad5534dc24?hl=en
==============================================================================

== 1 of 3 ==
Date: Sun, Jun 22 2008 7:40 pm
From: "bhlx88@gmail.com"


Hi , I want to disallow hibernation in Windows Vista .
So I programed a filter driver to catch IRP_MN_QUERY_POWER ,then fails
it .
case IRP_MN_QUERY_POWER:
if(PowerType==SystemPowerState)
{
if(State.SystemState==PowerSystemHibernate)
{

PoStartNextPowerIrp (Irp);
ntStatus = STATUS_NOT_SUPPORTED;

Irp->IoStatus.Status = ntStatus;
if(!NT_SUCCESS(ntStatus))
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return ntStatus;
}
}
break;
It work fine in Windows XP , but it doesn't work in Windows Vista as
MSDN said,

"Beginning with Windows Vista, transition to a system sleep state is
considered a critical operation. Although a driver might fail a system
query-power IRP, the power manager might still change the system power
state to a sleep state. After a driver receives a system query-power
IRP, the driver should always be prepared for a subsequent change in
the system power state."

Does there anyway to disallow hibernation in Windows Vista ?
Any suggstion will be helpful !

== 2 of 3 ==
Date: Sun, Jun 22 2008 8:11 pm
From: "David Craig"


I have heard and read that Microsoft was getting far too much hassle about
companies releasing drivers that would not permit hibernation. They 'fixed'
it the only way it can be done. Don't allow any driver to block suspend and
hibernate. Remember that notebooks are becoming the replacement for
desktops and it is not good when they won't hibernate or suspend when
necessary. Even desktops should be able to suspend because in places like
Florida the power will go out and UPSes can only maintain a system for a
limited time without AC power returning.

Your device is not that important and neither is anyone else's. You can
rewrite Linux or FreeBSD, etc. to do whatever you want. Maybe that is why
so many embedded devices such as HDTVs use them. Remember the computer
belongs to someone else and it should do what they want and help them as
much as is condusive to assisting the user make use of the computer. That
previous statement is a reflection upon security software that asks the user
to decide what to do when it is most likely that they don't have the
knowledge to make a good decision.

<bhlx88@gmail.com> wrote in message
news:656b0cdd-527d-48f6-99c8-a641be976cf9@w8g2000prd.googlegroups.com...
> Hi , I want to disallow hibernation in Windows Vista .
> So I programed a filter driver to catch IRP_MN_QUERY_POWER ,then fails
> it .
> case IRP_MN_QUERY_POWER:
> if(PowerType==SystemPowerState)
> {
> if(State.SystemState==PowerSystemHibernate)
> {
>
> PoStartNextPowerIrp (Irp);
> ntStatus = STATUS_NOT_SUPPORTED;
>
> Irp->IoStatus.Status = ntStatus;
> if(!NT_SUCCESS(ntStatus))
> Irp->IoStatus.Information = 0;
> IoCompleteRequest( Irp, IO_NO_INCREMENT );
> return ntStatus;
> }
> }
> break;
> It work fine in Windows XP , but it doesn't work in Windows Vista as
> MSDN said,
>
> "Beginning with Windows Vista, transition to a system sleep state is
> considered a critical operation. Although a driver might fail a system
> query-power IRP, the power manager might still change the system power
> state to a sleep state. After a driver receives a system query-power
> IRP, the driver should always be prepared for a subsequent change in
> the system power state."
>
> Does there anyway to disallow hibernation in Windows Vista ?
> Any suggstion will be helpful !
>


== 3 of 3 ==
Date: Sun, Jun 22 2008 8:13 pm
From: "Ken Snyder"


Hi Stranger,

maybe sometimes you dont need a driver to
handle this. A extremely simple usermode
application (or service if you like!) can handle
this for you by starting this:

http://support.microsoft.com/kb/920730/en-us


See here too:
http://technet2.microsoft.com/WindowsVista/en/library/1d58b934-f56a-4796-b2df-7be2eb9c03bc1033.mspx?mfr=true

Thats what you are looking for:
-hibernate [on|off]

Check Target Windows with GetCersionEx(..) and then decide
what to do, e.g the method you want to use. You can backtrack
the Registry Key Operations of the powercfg and then, if
you really want to do this from driver, access the registry and
set these options from your driver if you like,...

I think its registry where this stuff is stored,...where else,...

Regards

Kerem


--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

<bhlx88@gmail.com> schrieb im Newsbeitrag
news:656b0cdd-527d-48f6-99c8-a641be976cf9@w8g2000prd.googlegroups.com...
> Hi , I want to disallow hibernation in Windows Vista .
> So I programed a filter driver to catch IRP_MN_QUERY_POWER ,then fails
> it .
> case IRP_MN_QUERY_POWER:
> if(PowerType==SystemPowerState)
> {
> if(State.SystemState==PowerSystemHibernate)
> {
>
> PoStartNextPowerIrp (Irp);
> ntStatus = STATUS_NOT_SUPPORTED;
>
> Irp->IoStatus.Status = ntStatus;
> if(!NT_SUCCESS(ntStatus))
> Irp->IoStatus.Information = 0;
> IoCompleteRequest( Irp, IO_NO_INCREMENT );
> return ntStatus;
> }
> }
> break;
> It work fine in Windows XP , but it doesn't work in Windows Vista as
> MSDN said,
>
> "Beginning with Windows Vista, transition to a system sleep state is
> considered a critical operation. Although a driver might fail a system
> query-power IRP, the power manager might still change the system power
> state to a sleep state. After a driver receives a system query-power
> IRP, the driver should always be prepared for a subsequent change in
> the system power state."
>
> Does there anyway to disallow hibernation in Windows Vista ?
> Any suggstion will be helpful !
>



==============================================================================
TOPIC: printing HardwareIDs
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/95fa3d09c626a39f?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Jun 22 2008 11:42 pm
From: krish


How can I print HardwareIDs? I understand they are MULTI_REG_SZ -
multiple strings each terminating with \0. Is there some function for
that.

Currently I wrote my own function as follows:

VOID DebugPrintStr (ULONG DebugPrintLevel,
PCWCHAR Buffer,
ULONG Length)
{
NTSTATUS status;
ULONG i; // index into the Buffer pointing to the begining of the
next string
ULONG j; // length of the current string

for (i = 0, j = 0; i < Length; i += (j + 1)) {
DbgPrintEx (DPFLTR_IHVDRIVER_ID, DebugPrintLevel, "%ws\n",
&Buffer[i]);
/* get the end of this string
*/
status = RtlStringCchLengthW (&Buffer[i],
Length +
1 - i, /* remaining MAX including the next '\0' */
&j); /*
length of upto (but not including) next '\0' */
}

}

And this is what I get? I'm not sure why I'm getting so many '?'.
Help. Thanks.

Intel-2920
???DisIntel-2920
Internal_IDE_Channel

??????? ??

??DisIntel-2920
J?????????????????????????????????????? ??????l-29???†??
?DisIntel-2920
?????????????????????????????????????? ??????l-29???†??
DisIntel-2920
????????????????????????????????????? ??????l-29???†??
isIntel-2920
???????????????????????????????????? ??????l-29???†??
sIntel-2920
??????????????????????????????????? ??????l-29???†??
Intel-2920
?????????????????????????????????? ??????l-29???†??
ntel-2920
????????????????????????????????? ??????l-29???†??
tel-2920
???????????????????????????????? ??????l-29???†??
el-2920
??????????????????????????????? ??????l-29???†??
?????????????????????????????? ??????l-29???†??
????????????????????????????? ??????l-29???†??
???????????????????????????? ??????l-29???†??
??????????????????????????? ??????l-29???†??
?????????????????????????? ??????l-29???†??
????????????????????????? ??????l-29???†??
????????????????????????
??????l-29???†??
???????????????????????
??????l-29???†??
??????????????????????
??????l-29???†??
?????????????????????
??????l-29???†??
????????????????????
??????l-29???†??

==============================================================================

You received this message because you are subscribed to the Google Groups "microsoft.public.development.device.drivers"
group.

To post to this group, visit http://groups.google.com/group/microsoft.public.development.device.drivers?hl=en

To unsubscribe from this group, send email to microsoft.public.development.device.drivers-unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/microsoft.public.development.device.drivers/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com?hl=en

No comments: