Driver Verifier, low resources testing

Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

When testing low resources response, does verifier at any point "free"
resources to permit the driver to function or does it just hog them? Or ...
what needs to be done to "free" Verifier garnished resources. Case in point:
I set a 5 retry loop to map a user buffer for kernel mode using
MmProbeandLock pages. With LR enabled in Verifier the loop would iterate 5
times and the driver return an error status. Is 5 retries sufficient? 100?
200? When/or how does Verifier "free" the resources it stole?

How do I know it was Verifier? Users without Verifier enabled for LR were
not seeing the same status returned.
5 answers Last reply
More about driver verifier resources testing
  1. Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

    > When testing low resources response, does verifier at any point "free"
    > resources to permit the driver to function or does it just hog them?

    It just fails some ExAllocatePoolWithTag and other allocation calls at random.

    --
    Maxim Shatskih, Windows DDK MVP
    StorageCraft Corporation
    maxim@storagecraft.com
    http://www.storagecraft.com
  2. Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

    But how does it unfail them? Can you repeatedly request the resource until
    Verifier releases the resource, or it will it always fail that request until
    some kind of "reset". If so then how do you do that "reset"? Change IRQL?
    Return from the driver and let the application retry?

    --
    Gary G. Little
    Seagate Technologies, LLC

    "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
    news:cacam6$p4b$1@gavrilo.mtu.ru...
    > > When testing low resources response, does verifier at any point "free"
    > > resources to permit the driver to function or does it just hog them?
    >
    > It just fails some ExAllocatePoolWithTag and other allocation calls at
    random.
    >
    > --
    > Maxim Shatskih, Windows DDK MVP
    > StorageCraft Corporation
    > maxim@storagecraft.com
    > http://www.storagecraft.com
    >
    >
  3. Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

    you gracefully fail. what graceful means to your driver is up to you. in
    all the drivers i have written, i just return STATUS_INSUFFICIENT_RESOURCES.
    if you require the resources for forward progress, you need to create a
    lmiited cache of what you need and fall back onto that cache when you can't
    dynamically allocate the required structures.

    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.


    "Gary G. Little" <gary.g.little.nospam@seagate.com> wrote in message
    news:2Yiyc.5752$FN4.596@newssvr22.news.prodigy.com...
    > But how does it unfail them? Can you repeatedly request the resource until
    > Verifier releases the resource, or it will it always fail that request
    until
    > some kind of "reset". If so then how do you do that "reset"? Change IRQL?
    > Return from the driver and let the application retry?
    >
    > --
    > Gary G. Little
    > Seagate Technologies, LLC
    >
    > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
    > news:cacam6$p4b$1@gavrilo.mtu.ru...
    > > > When testing low resources response, does verifier at any point "free"
    > > > resources to permit the driver to function or does it just hog them?
    > >
    > > It just fails some ExAllocatePoolWithTag and other allocation calls at
    > random.
    > >
    > > --
    > > Maxim Shatskih, Windows DDK MVP
    > > StorageCraft Corporation
    > > maxim@storagecraft.com
    > > http://www.storagecraft.com
    > >
    > >
    >
    >
  4. Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

    "Gary G. Little" <gary.g.little.nospam@seagate.com> wrote:
    >
    >But how does it unfail them? Can you repeatedly request the resource until
    >Verifier releases the resource, or it will it always fail that request until
    >some kind of "reset".

    You aren't supposed to recover/retry. That defeats the whole purpose. The
    point of the "low resource simulation" is to see whether your driver
    gracefully fails when memory really IS low, as opposed to just exploding.

    >If so then how do you do that "reset"? Change IRQL?
    >Return from the driver and let the application retry?

    As Don suggested, you return a reasonable error. The application will
    presumably die, the instance will be closed, and your driver will have the
    chance to clean itself up.

    I hope it is obvious that the "low resource simulation" is not intended to
    be enabled on a production machine.
    --
    - Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
  5. Archived from groups: comp.os.ms-windows.programmer.nt.kernel-mode,microsoft.public.development.device.drivers,microsoft.public.windowsxp.device_driver.dev (More info?)

    Well, I am failing it gracefully, though I am doing a retry to see if
    resources are released before failing the IRP. I had actually forgotten I
    had LR testing turned on, so I originally was addressing why the driver was
    failing a transfer. Once I realized it was Verifier "doin' it's thang" I
    realized the driver was functioning properly, but wanted it to recover in
    the retry loop. If that is going to happen it will have to be on a request
    to retry from the application with a new IRP.

    Thanks for the assist gentlemen ...

    --
    Gary G. Little
    Seagate Technologies, LLC

    "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
    news:uNH29L8TEHA.2704@TK2MSFTNGP10.phx.gbl...
    > you gracefully fail. what graceful means to your driver is up to you. in
    > all the drivers i have written, i just return
    STATUS_INSUFFICIENT_RESOURCES.
    > if you require the resources for forward progress, you need to create a
    > lmiited cache of what you need and fall back onto that cache when you
    can't
    > dynamically allocate the required structures.
    >
    > 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.
    >
    >
    > "Gary G. Little" <gary.g.little.nospam@seagate.com> wrote in message
    > news:2Yiyc.5752$FN4.596@newssvr22.news.prodigy.com...
    > > But how does it unfail them? Can you repeatedly request the resource
    until
    > > Verifier releases the resource, or it will it always fail that request
    > until
    > > some kind of "reset". If so then how do you do that "reset"? Change
    IRQL?
    > > Return from the driver and let the application retry?
    > >
    > > --
    > > Gary G. Little
    > > Seagate Technologies, LLC
    > >
    > > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
    > > news:cacam6$p4b$1@gavrilo.mtu.ru...
    > > > > When testing low resources response, does verifier at any point
    "free"
    > > > > resources to permit the driver to function or does it just hog them?
    > > >
    > > > It just fails some ExAllocatePoolWithTag and other allocation calls at
    > > random.
    > > >
    > > > --
    > > > Maxim Shatskih, Windows DDK MVP
    > > > StorageCraft Corporation
    > > > maxim@storagecraft.com
    > > > http://www.storagecraft.com
    > > >
    > > >
    > >
    > >
    >
    >
Ask a new question

Read More

Drivers Microsoft Windows XP