How does kernel determine IRQL's for routines??

Hi,
How does the kernel know at what level or IRQL should either be a dispatch
routine or driver
entry or driver unload routine must be called or executed?
Bye.
–Mayur.

The kernel makes the rules for DriverEntry and DriverUnload.
Additionally it defines the IRQL rules IRP_MJ_PNP, IRP_MJ_POWER,
IRP_MJ_CREATE, and IRP_MJ_CLEANUP (among many irp major codes). By
defining the IRQL rules, the kernel makes sure that it calls DriverEntry
and DriverUnload in a known system context in a known IRQL. The same
for pnp. The kernel sends the pnp irps in a known system context.

By default, most entry points in the driver are called at PASSIVE_LEVEL
by default. Dispatch routines will be called at DISPATCH_LEVEL if there
is a kernel mode driver which is sending you I/O…at that point, the
kernel i/o manager is not involved. If you are creating a driver which
is in your own class and does not interact with other predefined kernel
components, you can assume PASSIVE_LEVEL for your dispatch routines and
dictate PASSIVE_LEVEL. If you are creating a driver which is
interacting with other kernel mode, you cannot dictate IRQL level.

BTW, IRP_MJ_POWER can be sent at DISPATCH_LEVEL if you do not set
DO_POWER_PAGEABLE in DeviceObject->Flags.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mayur Kankanwadi
Sent: Monday, May 02, 2005 10:37 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How does kernel determine IRQL’s for routines??

Hi,
How does the kernel know at what level or IRQL should either be a
dispatch
routine or driver
entry or driver unload routine must be called or executed?
Bye.
–Mayur.


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

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

DriverEntry and Unload are always called from a system thread at
PASSIVE_LEVEL.

As about the dispatch routines - PnP is also called from a system thread at
PASSIVE_LEVEL, Power is called from Power Manager and its IRQL is determined by
DO_POWER_PAGABLE flag, and all of the rest are called by IoCallDriver from
other driver or the syscall path in the kernel itself.

Syscall paths always run on PASSIVE_LEVEL, and as about the other drivers -
this depends on particular stack. For instance, serial, USB, disk and TDI
stacks (I means TDI send/receive only) can be called at DISPATCH_LEVEL.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mayur Kankanwadi”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, May 03, 2005 9:37 AM
Subject: [ntdev] How does kernel determine IRQL’s for routines??

> Hi,
> How does the kernel know at what level or IRQL should either be a dispatch
> routine or driver
> entry or driver unload routine must be called or executed?
> Bye.
> --Mayur.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Man pls reply to the specific topic and not to the digest.
This helps in logging all the answers to a particular topic and makes them
searchable
at a later man.
Bye.
–Mayur.

“gowtamk” wrote in message news:xxxxx@ntdev…
Thanks, this is a good piece of info.

I did not get what this means,
“If you are creating a driver which is in your own class and does not
interact with other predefined kernel components, you can assume
PASSIVE_LEVEL for your dispatch routines and dictate PASSIVE_LEVEL. If you
are creating a driver which is interacting with other kernel mode, you
cannot dictate IRQL level.”

What does interacting/non-interacting with kernel mode mean in this context.

Regards,
Karanth

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Windows System
Software Devs Interest List digest
Sent: Wednesday, May 04, 2005 10:30 AM
To: ntdev digest recipients
Subject: ntdev digest: May 03, 2005

NTDEV Digest for Tuesday, May 03, 2005.

1. How does kernel determine IRQL’s for routines??
2. RE: How does kernel determine IRQL’s for routines??
3. Re: How does kernel determine IRQL’s for routines??
4. Re: Stack-based memory corruption
5. Check inf error about unrecognized GUID
6. Anyone working with WDF?
7. RE: Anyone working with WDF?
8. RE: Anyone working with WDF?
9. RE: Anyone working with WDF?
10. Re: Anyone working with WDF?
11. OT: DevCon Feedback
12. Re: Driver Unload Problem
13. RE: Anyone working with WDF?
14. RE: Stack-based memory corruption
15. Request NDIS to call MiniportREset

----------------------------------------------------------------------

Subject: How does kernel determine IRQL’s for routines??
From: “Mayur Kankanwadi”
Date: Tue, 3 May 2005 11:07:23 +0530
X-Message-Number: 1

Hi,
How does the kernel know at what level or IRQL should either be a dispatch
routine or driver entry or driver unload routine must be called or executed?
Bye. --Mayur.

----------------------------------------------------------------------

Subject: RE: How does kernel determine IRQL’s for routines??
From: “Doron Holan”
Date: Mon, 2 May 2005 23:05:07 -0700
X-Message-Number: 2

The kernel makes the rules for DriverEntry and DriverUnload. Additionally it
defines the IRQL rules IRP_MJ_PNP, IRP_MJ_POWER, IRP_MJ_CREATE, and
IRP_MJ_CLEANUP (among many irp major codes). By defining the IRQL rules,
the kernel makes sure that it calls DriverEntry
and DriverUnload in a known system context in a known IRQL. The same
for pnp. The kernel sends the pnp irps in a known system context. =20

By default, most entry points in the driver are called at PASSIVE_LEVEL by
default. Dispatch routines will be called at DISPATCH_LEVEL if there is a
kernel mode driver which is sending you I/O…at that point, the kernel i/o
manager is not involved. If you are creating a driver which is in your own
class and does not interact with other predefined kernel components, you can
assume PASSIVE_LEVEL for your dispatch routines and dictate PASSIVE_LEVEL.
If you are creating a driver which is interacting with other kernel mode,
you cannot dictate IRQL level.

BTW, IRP_MJ_POWER can be sent at DISPATCH_LEVEL if you do not set
DO_POWER_PAGEABLE in DeviceObject->Flags. =20

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mayur Kankanwadi
Sent: Monday, May 02, 2005 10:37 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How does kernel determine IRQL’s for routines??

Hi,
How does the kernel know at what level or IRQL should either be a dispatch
routine or driver entry or driver unload routine must be called or executed?
Bye. --Mayur.


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

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

----------------------------------------------------------------------

Subject: Re: How does kernel determine IRQL’s for routines??
From: “Maxim S. Shatskih”
Date: Tue, 3 May 2005 12:20:21 +0400
X-Message-Number: 3

DriverEntry and Unload are always called from a system thread at
PASSIVE_LEVEL.

As about the dispatch routines - PnP is also called from a system thread
at PASSIVE_LEVEL, Power is called from Power Manager and its IRQL is
determined by DO_POWER_PAGABLE flag, and all of the rest are called by
IoCallDriver from other driver or the syscall path in the kernel itself.

Syscall paths always run on PASSIVE_LEVEL, and as about the other
drivers - this depends on particular stack. For instance, serial, USB, disk
and TDI stacks (I means TDI send/receive only) can be called at
DISPATCH_LEVEL.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mayur Kankanwadi”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Tuesday, May 03, 2005 9:37 AM
Subject: [ntdev] How does kernel determine IRQL’s for routines??

> Hi,
> How does the kernel know at what level or IRQL should either be a
> dispatch routine or driver entry or driver unload routine must be
> called or executed? Bye.
> --Mayur.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com

----------------------------------------------------------------------

Subject: Re: Stack-based memory corruption
From: Andrei Zlate-Podani
Date: Tue, 03 May 2005 01:24:46 -0700
X-Message-Number: 4

Asa Yeamans wrote:

>I realize what InterlockedCompareExchange does, thats why i used it
>here. My eventual goal is to create a platform independent
>InterlockedPopSList as i need the program to run on Windows 2000, and
>that function is available only on XP+.
>
>Ive stepped through it with WinDBG and the failure looks like it is
>occuring between pTop=pList->pFirst and pNext=pTop->next; I have windbg
>open with locals showing and everything, i click the + next to pList
>and click the + next to pFirst and i see the value of pFirst. however
>the statement it access violations at, pNext=pTop->next pTop now has
>some bizarre value. whereas before it went through the if statement,
>it had the correct value.
>
>im rather sure the issue doesnt involve any sort of side effect of
>InterlockedComp.Exg. If anyone can come up with a better implementation
>of InterlockedPopSList, id be glad to take it though :smiley:
>
>asa
>
>
>
As Loren and Alberto pointed out, your while condition is flawed. The
loop will end only when pTop is 0.

Instead of Interlock…() != pTop use Interlock…() != pNext
You should know that InterlockedXXX routines are atomic only with
respect to other InterlockedXXX calls.
So, accessing your pointers like that may get you into trouble.

Andrei.

PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
{
PGENERIC_ITEM pTop, pNext;

do
{
pTop=pList->pFirst;
if(pTop==NULL) return NULL;

—>>>> pNext=pTop->next;
} while( InterlockedCompareExchangePointer( (PVOID *)
&(pList->pFirst), pNext, pTop) != pTop);
InterlockedDecrement(&pList->dwNumItems);

return pTop;
}


This message was scanned for spam and viruses by BitDefender. For more
information please visit http://linux.bitdefender.com/

----------------------------------------------------------------------

Subject: Check inf error about unrecognized GUID
From: S
Date: Tue, 3 May 2005 17:00:07 +0530
X-Message-Number: 5

Hi all,

I am testing my driver with HCT kit.
When I do checkINF test, its giving the following error.

My device can not come under any pre defined class, because of its
functionality; I am trying to create a new class of device. I generated a
new Class GUID and used this in my inf file.

Is it compulsory to give the pre defined Class GUID to pass HCT? Or can we
give any class GUID?

ERROR: (E22.1.1310) Class MyClass (ClassGUID {DAA41EEA-E0DA-4de7-
91FB-E0F16D988434}) is unrecognized.=20

Regards,
S.

----------------------------------------------------------------------

Subject: Anyone working with WDF?
From: “David Bradsher”
Date: Tue, 3 May 2005 10:27:04 -0500
X-Message-Number: 6

Hi everyone -

Has anyone been doing any experimenting with WDF? I’m working with a build
from last year’s WinHEC - have had no success getting in the Beta program so
don’t know what the current stage of WDF development is.

I’d really like to consider this for some forthcoming driver development -
it took about a week to get a skeleton driver going for one of out existing
products just to see if I could get the PnP and power functions for the
board installed and running.

David Bradsher
xxxxx@comtrol.com

----------------------------------------------------------------------

Subject: RE: Anyone working with WDF?
From: “Peter Wieland”
Date: Tue, 3 May 2005 08:30:16 -0700
X-Message-Number: 7

what problems have you had joining the WDF beta? It’s open enrollment, so
you shouldn’t have trouble getting in.

http://www.microsoft.com/whdc/driver/wdf/beta.mspx

-p

> -----Original Message-----
> From: xxxxx@lists.osr.com=20
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
> Sent: Tuesday, May 03, 2005 8:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Anyone working with WDF?
>=20
> Hi everyone -
>=20
> Has anyone been doing any experimenting with WDF? I’m=20 working
>with a build from last year’s WinHEC - have had no=20 success getting
>in the Beta program so don’t know what the=20 current stage of WDF
>development is. =20
> I’d really like to consider this for some forthcoming driver=20
> development - it took about a week to get a skeleton driver=20
> going for one of out existing products just to see if I could=20
> get the PnP and power functions for the board installed and running.
>=20
> David Bradsher
> xxxxx@comtrol.com
>=20
>=20
>=20
>=20
> —
> Questions? First check the Kernel Driver FAQ at=20
> http://www.osronline.com/article.cfm?id=3D256
>=20
> You are currently subscribed to ntdev as:=20
> xxxxx@windows.microsoft.com To unsubscribe send a blank=20
> email to xxxxx@lists.osr.com
>=20

----------------------------------------------------------------------

Subject: RE: Anyone working with WDF?
From: “Roddy, Mark”
Date: Tue, 3 May 2005 11:30:16 -0400
X-Message-Number: 8

You need to join the WDF beta and get refreshed. The 2004 winhec drop is not
very useful, the current beta is quite useful. There should be no problem
getting into the beta. Go here:
http://www.microsoft.com/whdc/driver/wdf/beta.mspx

=====================
Mark Roddy

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
Sent: Tuesday, May 03, 2005 11:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Anyone working with WDF?

Hi everyone -

Has anyone been doing any experimenting with WDF? I’m working with a build
from last year’s WinHEC - have had no success getting in the Beta program so
don’t know what the current stage of WDF development is.

I’d really like to consider this for some forthcoming driver development -
it took about a week to get a skeleton driver going for one of out existing
products just to see if I could get the PnP and power functions for the
board installed and running.

David Bradsher
xxxxx@comtrol.com


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

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

----------------------------------------------------------------------

Subject: RE: Anyone working with WDF?
From: “Sivakumar Jayapal - CTD, Chennai.”
Date: Tue, 3 May 2005 21:03:36 +0530
X-Message-Number: 9

Hello,
I am using user mode driver api’s in my user mode application. I faced a
problem, When i press F5 in the Visual C++ IDE, my program works fine. But
when i click execute from the toolbar “!”, my program wont work. The user
mode = api is free build version.=20 My program uses the exported api
functions.=20

Any clues?
Kindly ignore the disclaimer.

Regards,
Siva
DISCLAIMER=20
This message and any attachment(s) contained here are information that = is
confidential, proprietary to HCL Technologies=20 and its customers. Contents
may be privileged or otherwise protected by = law. The information is solely
intended for the=20 individual or the entity it is addressed to. If you are
not the intended = recipient of this message, you are not authorized to=20
read, forward, print, retain, copy or disseminate this message or any = part
of it. If you have received this e-mail in error,=20 please notify the
sender immediately by return e-mail and delete it from = your computer

----------------------------------------------------------------------

Subject: Re: Anyone working with WDF?
From: “David Bradsher”
Date: Tue, 3 May 2005 10:45:51 -0500
X-Message-Number: 10

I went thru the signup page submission twice with not so much as an
acknowledgement either time. E-mailed the beta contact address & just got a
form letter with the same signup instructions.

David

“Peter Wieland” wrote in message
news:xxxxx@ntdev… what problems have you had joining the WDF beta? It’s
open enrollment, so you shouldn’t have trouble getting in.

http://www.microsoft.com/whdc/driver/wdf/beta.mspx

-p

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
> Sent: Tuesday, May 03, 2005 8:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Anyone working with WDF?
>
> Hi everyone -
>
> Has anyone been doing any experimenting with WDF? I’m working with a
> build from last year’s WinHEC - have had no success getting in the
> Beta program so don’t know what the current stage of WDF development
> is.
>
> I’d really like to consider this for some forthcoming driver
> development - it took about a week to get a skeleton driver going for
> one of out existing products just to see if I could get the PnP and
> power functions for the board installed and running.
>
> David Bradsher
> xxxxx@comtrol.com
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

----------------------------------------------------------------------

Subject: OT: DevCon Feedback
From: “Peter Viscarola (OSR)”
Date: Tue, 03 May 2005 12:09:14 -0400
X-Message-Number: 11

If you did not attend Driver Dev Con last week, hit delete now.

If you DID attend Driver Dev Con last week, we at OSR would appreciate
it if would take a few minutes to provide feedback to the community on
how you liked the conference:

http://www.osronline.com/article.cfm?article=399

Note that, while you WILL have to login to your OSR Online account to
enter your feedback, all postings appear anonymously.

Your comments will help other folks in the driver development community
determine if attending the next DDC will benefit them. In addition,
your feedback will directly help at OSR (as one of two major sponsors of
the DDC) work with Microsoft to ensure future conferences are maximally
beneficial.

What did you like best, least? What would you like to see more/less of?
Let’s hear it!

Thanks,

Peter
OSR

----------------------------------------------------------------------

Subject: Re: Driver Unload Problem
From: “Brian Wilson”
Date: Tue, 3 May 2005 12:29:15 -0400
X-Message-Number: 12

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Brian Wilson wrote:
>
>> I have been using Walter Oney’s sample drivers to build a USB WDM
>> driver.
>> I am using a renamed version of the “Generic.sys” (different GUID too)
>> driver to handle power management for the main driver. However, I have
>> run into a WHQL problem that I am looking for a solution. The driver
>> unloads properly when the device is unplugged but seems to have a problem

>> unloading during the WHQL tests. Can anyone tell me what might be missing

>> and how to correct the problem using the “Generic.sys” driver?
>>
>> Also, I would have expected that Windows XP would issue a RESUME
>> after
>> SUSPEND but, more often than not, the OS issues a RESET after SUSPEND.
>> Can anyone shed light on why the OS is issuing a RESET instead of a
>> RESUME?
>>
>>
>> I’m sorry, the RESET is a USB Reset, not an IRP.
>
>
> The operating system doesn’t issue any USB requests on its own. If
> your
> device is getting a pipe reset, then your driver must be sending it.

I don’t agree. Certainly the device receives a bus reset at least twice
before the device is enumerated and the driver loaded.

>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>

----------------------------------------------------------------------

Subject: RE: Anyone working with WDF?
From: “Peter Wieland”
Date: Tue, 3 May 2005 12:46:36 -0700
X-Message-Number: 13

to ask the stupid question - did you check to make sure that the replies
didn’t get filtered out as junk mail?

-p=20

> -----Original Message-----
> From: xxxxx@lists.osr.com=20
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
> Sent: Tuesday, May 03, 2005 8:46 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Anyone working with WDF?
>=20
> I went thru the signup page submission twice with not so much=20 as
>an acknowledgement either time. E-mailed the beta contact=20 address
>& just got a form letter with the same signup instructions. =20
> David
>=20
>=20
> “Peter Wieland” wrote in=20
> message news:xxxxx@ntdev…
> what problems have you had joining the WDF beta? It’s open=20
> enrollment, so you shouldn’t have trouble getting in.
>=20
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>=20
> -p
>=20
> > -----Original Message-----
> > From: xxxxx@lists.osr.com=20
> > [mailto:xxxxx@lists.osr.com] On Behalf Of=20
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Anyone working with WDF?
> >
> > Hi everyone -
> >
> > Has anyone been doing any experimenting with WDF? I’m=20
> working with a=20
> > build from last year’s WinHEC - have had no success getting in
> > the=20 Beta program so don’t know what the current stage of WDF=20
> development=20
> > is.
> >
> > I’d really like to consider this for some forthcoming driver=20
> > development - it took about a week to get a skeleton driver=20
> going for=20
> > one of out existing products just to see if I could get the PnP
> > and=20 power functions for the board installed and running.
> >
> > David Bradsher
> > xxxxx@comtrol.com
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=3D256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@windows.microsoft.com To unsubscribe send a blank email
> > to=20 xxxxx@lists.osr.com
> >
>=20
>=20
>=20
> —
> Questions? First check the Kernel Driver FAQ at=20
>http://www.osronline.com/article.cfm?id=3D256
>=20
> You are currently subscribed to ntdev as:=20
>xxxxx@windows.microsoft.com To unsubscribe send a blank=20 email to
>xxxxx@lists.osr.com =20

----------------------------------------------------------------------

Subject: RE: Stack-based memory corruption
From: “Asa Yeamans”
Date: Tue, 3 May 2005 19:40:37 -0500
X-Message-Number: 14

D’oh i knew they were saying something…=20

(never read emails late at night…)

Thanks, Asa

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Andrei Zlate-Podani
Sent: Tuesday, May 03, 2005 3:25 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Stack-based memory corruption

Asa Yeamans wrote:

>I realize what InterlockedCompareExchange does, thats why i used it =
here. My eventual
>goal is to create a platform independent InterlockedPopSList as i need
>=
the program to
>run on Windows 2000, and that function is available only on XP+.
>
>Ive stepped through it with WinDBG and the failure looks like it is =
occuring between
>pTop=3DpList->pFirst and pNext=3DpTop->next;
>I have windbg open with locals showing and everything, i click the + =
next to pList
>and click the + next to pFirst and i see the value of pFirst. however
>=
the statement
>it access violations at, pNext=3DpTop->next pTop now has some bizarre
>=
value. whereas before
>it went through the if statement, it had the correct value.
>
>im rather sure the issue doesnt involve any sort of side effect of =
InterlockedComp.Exg.
>If anyone can come up with a better implementation of =
InterlockedPopSList, id be glad to take
>it though :smiley:
>
>asa
>
> =20
>
As Loren and Alberto pointed out, your while condition is flawed. The=20
loop will end only when pTop is 0.

Instead of Interlock…() !=3D pTop use Interlock…() !=3D pNext
You should know that InterlockedXXX routines are atomic only with=20 respect
to other InterlockedXXX calls. So, accessing your pointers like that may get
you into trouble.

Andrei.

PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
{
PGENERIC_ITEM pTop, pNext;

do
{
pTop=3DpList->pFirst;
if(pTop=3D=3DNULL) return NULL;

—>>>> pNext=3DpTop->next;
} while( InterlockedCompareExchangePointer( (PVOID *)
&(pList->pFirst), = pNext, pTop) !=3D pTop);
InterlockedDecrement(&pList->dwNumItems);

return pTop;
}

–=20
This message was scanned for spam and viruses by BitDefender. For more
information please visit http://linux.bitdefender.com/


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

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

----------------------------------------------------------------------

Subject: Request NDIS to call MiniportREset
From: “Yagmur Konuslu”
Date: Wed, 4 May 2005 07:02:57 +0300
X-Message-Number: 15

Hi,
how is NDIS forced to call MiniportReset. The DDK says calling
NdisMIndicateStatus with some NDIS_STATUS_xxx will make this possible. Will
NDIS_STATUS_DEVICE_FAILED do this?

Best Regards
Yagmur Konuslu



END OF DIGEST


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

You are currently subscribed to ntdev as: xxxxx@india.hp.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Indeed.

Now to the question: “in its own class and does not interact” is a bit of a
peculiar way to phrase it, but I think I understand what the poster meant.

Limit the discussion to the Big Three: Read/Write/Ioctl.

Top level drivers can make assumptions about IRP dispatch routine IRQL
levels, that is that the routines will be invoked at PASSIVE_LEVEL. Other
non top level drivers might be able to make the same assumption, or not,
depending on the behavior of the drivers layered above them. The standard
example is the disk class driver, which gets invoked at DISPATCH_LEVEL for
various read/write IRPs, much to the dismay of the na?ve flter driver
writer.

Any read/write/ioctl dispatch routine using method neither had better be
invoked at PASSIVE_LEVEL and in the calling process context.

Filter drivers above top level drivers cannot violate the assumptions of the
driver they are filtering.

=====================
Mark Roddy
Windows .NET/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mayur
Kankanwadi
Sent: Wednesday, May 04, 2005 4:45 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How does kernel determine IRQL’s for routines??

Man pls reply to the specific topic and not to the digest.
This helps in logging all the answers to a particular topic
and makes them searchable at a later man.
Bye.
–Mayur.

“gowtamk” wrote in message news:xxxxx@ntdev…
> Thanks, this is a good piece of info.
>
> I did not get what this means,
> “If you are creating a driver which is in your own class and
> does not interact with other predefined kernel components,
> you can assume PASSIVE_LEVEL for your dispatch routines and
> dictate PASSIVE_LEVEL. If you are creating a driver which is
> interacting with other kernel mode, you cannot dictate IRQL level.”
>
> What does interacting/non-interacting with kernel mode mean
> in this context.
>
> Regards,
> Karanth
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> Windows System Software Devs Interest List digest
> Sent: Wednesday, May 04, 2005 10:30 AM
> To: ntdev digest recipients
> Subject: ntdev digest: May 03, 2005
>
>
> NTDEV Digest for Tuesday, May 03, 2005.
>
> 1. How does kernel determine IRQL’s for routines??
> 2. RE: How does kernel determine IRQL’s for routines??
> 3. Re: How does kernel determine IRQL’s for routines??
> 4. Re: Stack-based memory corruption
> 5. Check inf error about unrecognized GUID 6. Anyone working with WDF?
> 7. RE: Anyone working with WDF?
> 8. RE: Anyone working with WDF?
> 9. RE: Anyone working with WDF?
> 10. Re: Anyone working with WDF?
> 11. OT: DevCon Feedback
> 12. Re: Driver Unload Problem
> 13. RE: Anyone working with WDF?
> 14. RE: Stack-based memory corruption
> 15. Request NDIS to call MiniportREset
>
> ----------------------------------------------------------------------
>
> Subject: How does kernel determine IRQL’s for routines??
> From: “Mayur Kankanwadi”
> Date: Tue, 3 May 2005 11:07:23 +0530
> X-Message-Number: 1
>
> Hi,
> How does the kernel know at what level or IRQL should either
> be a dispatch routine or driver entry or driver unload
> routine must be called or executed?
> Bye. --Mayur.
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: How does kernel determine IRQL’s for routines??
> From: “Doron Holan”
> Date: Mon, 2 May 2005 23:05:07 -0700
> X-Message-Number: 2
>
> The kernel makes the rules for DriverEntry and DriverUnload.
> Additionally it defines the IRQL rules IRP_MJ_PNP,
> IRP_MJ_POWER, IRP_MJ_CREATE, and IRP_MJ_CLEANUP (among many
> irp major codes). By defining the IRQL rules, the kernel
> makes sure that it calls DriverEntry
> and DriverUnload in a known system context in a known IRQL. The same
> for pnp. The kernel sends the pnp irps in a known system context. =20
>
> By default, most entry points in the driver are called at
> PASSIVE_LEVEL by default. Dispatch routines will be called
> at DISPATCH_LEVEL if there is a kernel mode driver which is
> sending you I/O…at that point, the kernel i/o manager is
> not involved. If you are creating a driver which is in your
> own class and does not interact with other predefined kernel
> components, you can assume PASSIVE_LEVEL for your dispatch
> routines and dictate PASSIVE_LEVEL.
> If you are creating a driver which is interacting with other
> kernel mode, you cannot dictate IRQL level.
>
> BTW, IRP_MJ_POWER can be sent at DISPATCH_LEVEL if you do not
> set DO_POWER_PAGEABLE in DeviceObject->Flags. =20
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mayur
> Kankanwadi
> Sent: Monday, May 02, 2005 10:37 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How does kernel determine IRQL’s for routines??
>
> Hi,
> How does the kernel know at what level or IRQL should either
> be a dispatch routine or driver entry or driver unload
> routine must be called or executed?
> Bye. --Mayur.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=3D256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: Re: How does kernel determine IRQL’s for routines??
> From: “Maxim S. Shatskih”
> Date: Tue, 3 May 2005 12:20:21 +0400
> X-Message-Number: 3
>
> DriverEntry and Unload are always called from a system
> thread at PASSIVE_LEVEL.
>
> As about the dispatch routines - PnP is also called from
> a system thread at PASSIVE_LEVEL, Power is called from Power
> Manager and its IRQL is determined by DO_POWER_PAGABLE flag,
> and all of the rest are called by IoCallDriver from other
> driver or the syscall path in the kernel itself.
>
> Syscall paths always run on PASSIVE_LEVEL, and as about
> the other drivers - this depends on particular stack. For
> instance, serial, USB, disk and TDI stacks (I means TDI
> send/receive only) can be called at DISPATCH_LEVEL.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Mayur Kankanwadi”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Tuesday, May 03, 2005 9:37 AM
> Subject: [ntdev] How does kernel determine IRQL’s for routines??
>
>
> > Hi,
> > How does the kernel know at what level or IRQL should either be a
> > dispatch routine or driver entry or driver unload routine must be
> > called or executed? Bye.
> > --Mayur.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> ----------------------------------------------------------------------
>
> Subject: Re: Stack-based memory corruption
> From: Andrei Zlate-Podani
> Date: Tue, 03 May 2005 01:24:46 -0700
> X-Message-Number: 4
>
> Asa Yeamans wrote:
>
> >I realize what InterlockedCompareExchange does, thats why i used it
> >here. My eventual goal is to create a platform independent
> >InterlockedPopSList as i need the program to run on Windows 2000, and
> >that function is available only on XP+.
> >
> >Ive stepped through it with WinDBG and the failure looks like it is
> >occuring between pTop=pList->pFirst and pNext=pTop->next; I
> have windbg
> >open with locals showing and everything, i click the + next to pList
> >and click the + next to pFirst and i see the value of
> pFirst. however
> >the statement it access violations at, pNext=pTop->next pTop now has
> >some bizarre value. whereas before it went through the if
> statement,
> >it had the correct value.
> >
> >im rather sure the issue doesnt involve any sort of side effect of
> >InterlockedComp.Exg. If anyone can come up with a better
> implementation
> >of InterlockedPopSList, id be glad to take it though :smiley:
> >
> >asa
> >
> >
> >
> As Loren and Alberto pointed out, your while condition is flawed. The
> loop will end only when pTop is 0.
>
> Instead of Interlock…() != pTop use Interlock…() != pNext
> You should know that InterlockedXXX routines are atomic only with
> respect to other InterlockedXXX calls.
> So, accessing your pointers like that may get you into trouble.
>
> Andrei.
>
> PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
> {
> PGENERIC_ITEM pTop, pNext;
>
> do
> {
> pTop=pList->pFirst;
> if(pTop==NULL) return NULL;
>
> —>>>> pNext=pTop->next;
> } while( InterlockedCompareExchangePointer( (PVOID *)
> &(pList->pFirst), pNext, pTop) != pTop);
> InterlockedDecrement(&pList->dwNumItems);
>
> return pTop;
> }
>
>
>
> –
> This message was scanned for spam and viruses by BitDefender. For more
> information please visit http://linux.bitdefender.com/
>
>
> ----------------------------------------------------------------------
>
> Subject: Check inf error about unrecognized GUID
> From: S
> Date: Tue, 3 May 2005 17:00:07 +0530
> X-Message-Number: 5
>
> Hi all,
>
> I am testing my driver with HCT kit.
> When I do checkINF test, its giving the following error.
>
> My device can not come under any pre defined class, because of its
> functionality; I am trying to create a new class of device. I
> generated a
> new Class GUID and used this in my inf file.
>
> Is it compulsory to give the pre defined Class GUID to pass
> HCT? Or can we
> give any class GUID?
>
> ERROR: (E22.1.1310) Class MyClass (ClassGUID {DAA41EEA-E0DA-4de7-
> 91FB-E0F16D988434}) is unrecognized.=20
>
>
> Regards,
> S.
>
> ----------------------------------------------------------------------
>
> Subject: Anyone working with WDF?
> From: “David Bradsher”
> Date: Tue, 3 May 2005 10:27:04 -0500
> X-Message-Number: 6
>
> Hi everyone -
>
> Has anyone been doing any experimenting with WDF? I’m
> working with a build
> from last year’s WinHEC - have had no success getting in the
> Beta program so
> don’t know what the current stage of WDF development is.
>
> I’d really like to consider this for some forthcoming driver
> development -
> it took about a week to get a skeleton driver going for one
> of out existing
> products just to see if I could get the PnP and power
> functions for the
> board installed and running.
>
> David Bradsher
> xxxxx@comtrol.com
>
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Peter Wieland”
> Date: Tue, 3 May 2005 08:30:16 -0700
> X-Message-Number: 7
>
> what problems have you had joining the WDF beta? It’s open
> enrollment, so
> you shouldn’t have trouble getting in.
>
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
> -p
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com=20
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Anyone working with WDF?
> >=20
> > Hi everyone -
> >=20
> > Has anyone been doing any experimenting with WDF? I’m=20 working
> >with a build from last year’s WinHEC - have had no=20
> success getting
> >in the Beta program so don’t know what the=20 current stage of WDF
> >development is. =20
> > I’d really like to consider this for some forthcoming driver=20
> > development - it took about a week to get a skeleton driver=20
> > going for one of out existing products just to see if I could=20
> > get the PnP and power functions for the board installed and running.
> >=20
> > David Bradsher
> > xxxxx@comtrol.com
> >=20
> >=20
> >=20
> >=20
> > —
> > Questions? First check the Kernel Driver FAQ at=20
> > http://www.osronline.com/article.cfm?id=3D256
> >=20
> > You are currently subscribed to ntdev as:=20
> > xxxxx@windows.microsoft.com To unsubscribe send a blank=20
> > email to xxxxx@lists.osr.com
> >=20
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Roddy, Mark”
> Date: Tue, 3 May 2005 11:30:16 -0400
> X-Message-Number: 8
>
> You need to join the WDF beta and get refreshed. The 2004
> winhec drop is not
> very useful, the current beta is quite useful. There should
> be no problem
> getting into the beta. Go here:
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
>
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
> Sent: Tuesday, May 03, 2005 11:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Anyone working with WDF?
>
> Hi everyone -
>
> Has anyone been doing any experimenting with WDF? I’m
> working with a build
> from last year’s WinHEC - have had no success getting in the
> Beta program so
> don’t know what the current stage of WDF development is.
>
> I’d really like to consider this for some forthcoming driver
> development -
> it took about a week to get a skeleton driver going for one
> of out existing
> products just to see if I could get the PnP and power
> functions for the
> board installed and running.
>
> David Bradsher
> xxxxx@comtrol.com
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Sivakumar Jayapal - CTD, Chennai.”
> Date: Tue, 3 May 2005 21:03:36 +0530
> X-Message-Number: 9
>
> Hello,
> I am using user mode driver api’s in my user mode
> application. I faced a
> problem, When i press F5 in the Visual C++ IDE, my program
> works fine. But
> when i click execute from the toolbar “!”, my program wont
> work. The user
> mode = api is free build version.=20 My program uses the exported api
> functions.=20
>
> Any clues?
> Kindly ignore the disclaimer.
>
> Regards,
> Siva
> DISCLAIMER=20
> This message and any attachment(s) contained here are
> information that = is
> confidential, proprietary to HCL Technologies=20 and its
> customers. Contents
> may be privileged or otherwise protected by = law. The
> information is solely
> intended for the=20 individual or the entity it is addressed
> to. If you are
> not the intended = recipient of this message, you are not
> authorized to=20
> read, forward, print, retain, copy or disseminate this
> message or any = part
> of it. If you have received this e-mail in error,=20 please notify the
> sender immediately by return e-mail and delete it from = your computer
>
>
> ----------------------------------------------------------------------
>
> Subject: Re: Anyone working with WDF?
> From: “David Bradsher”
> Date: Tue, 3 May 2005 10:45:51 -0500
> X-Message-Number: 10
>
> I went thru the signup page submission twice with not so much as an
> acknowledgement either time. E-mailed the beta contact
> address & just got a
> form letter with the same signup instructions.
>
> David
>
>
> “Peter Wieland” wrote in message
> news:xxxxx@ntdev… what problems have you had joining the
> WDF beta? It’s
> open enrollment, so you shouldn’t have trouble getting in.
>
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
> -p
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Anyone working with WDF?
> >
> > Hi everyone -
> >
> > Has anyone been doing any experimenting with WDF? I’m
> working with a
> > build from last year’s WinHEC - have had no success getting in the
> > Beta program so don’t know what the current stage of WDF development
> > is.
> >
> > I’d really like to consider this for some forthcoming driver
> > development - it took about a week to get a skeleton driver
> going for
> > one of out existing products just to see if I could get the PnP and
> > power functions for the board installed and running.
> >
> > David Bradsher
> > xxxxx@comtrol.com
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
> ----------------------------------------------------------------------
>
> Subject: OT: DevCon Feedback
> From: “Peter Viscarola (OSR)”
> Date: Tue, 03 May 2005 12:09:14 -0400
> X-Message-Number: 11
>
> If you did not attend Driver Dev Con last week, hit delete now.
>
> If you DID attend Driver Dev Con last week, we at OSR would appreciate
> it if would take a few minutes to provide feedback to the community on
> how you liked the conference:
>
> http://www.osronline.com/article.cfm?article=399
>
> Note that, while you WILL have to login to your OSR Online account to
> enter your feedback, all postings appear anonymously.
>
> Your comments will help other folks in the driver development
> community
> determine if attending the next DDC will benefit them. In addition,
> your feedback will directly help at OSR (as one of two major
> sponsors of
> the DDC) work with Microsoft to ensure future conferences are
> maximally
> beneficial.
>
> What did you like best, least? What would you like to see
> more/less of?
> Let’s hear it!
>
> Thanks,
>
> Peter
> OSR
>
> ----------------------------------------------------------------------
>
> Subject: Re: Driver Unload Problem
> From: “Brian Wilson”
> Date: Tue, 3 May 2005 12:29:15 -0400
> X-Message-Number: 12
>
>
> “Tim Roberts” wrote in message news:xxxxx@ntdev…
> > Brian Wilson wrote:
> >
> >> I have been using Walter Oney’s sample drivers to build a USB WDM
> >> driver.
> >> I am using a renamed version of the “Generic.sys”
> (different GUID too)
> >> driver to handle power management for the main driver.
> However, I have
> >> run into a WHQL problem that I am looking for a solution.
> The driver
> >> unloads properly when the device is unplugged but seems to
> have a problem
>
> >> unloading during the WHQL tests. Can anyone tell me what
> might be missing
>
> >> and how to correct the problem using the “Generic.sys” driver?
> >>
> >> Also, I would have expected that Windows XP would issue a RESUME
> >> after
> >> SUSPEND but, more often than not, the OS issues a RESET
> after SUSPEND.
> >> Can anyone shed light on why the OS is issuing a RESET instead of a
> >> RESUME?
> >>
> >>
> >> I’m sorry, the RESET is a USB Reset, not an IRP.
> >
> >
> > The operating system doesn’t issue any USB requests on its own. If
> > your
> > device is getting a pipe reset, then your driver must be sending it.
>
> I don’t agree. Certainly the device receives a bus reset at
> least twice
> before the device is enumerated and the driver loaded.
>
> >
> > –
> > Tim Roberts, xxxxx@probo.com
> > Providenza & Boekelheide, Inc.
> >
> >
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Peter Wieland”
> Date: Tue, 3 May 2005 12:46:36 -0700
> X-Message-Number: 13
>
> to ask the stupid question - did you check to make sure that
> the replies
> didn’t get filtered out as junk mail?
>
> -p=20
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com=20
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:46 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Anyone working with WDF?
> >=20
> > I went thru the signup page submission twice with not so much=20 as
> >an acknowledgement either time. E-mailed the beta
> contact=20 address
> >& just got a form letter with the same signup instructions. =20
> > David
> >=20
> >=20
> > “Peter Wieland” wrote in=20
> > message news:xxxxx@ntdev…
> > what problems have you had joining the WDF beta? It’s open=20
> > enrollment, so you shouldn’t have trouble getting in.
> >=20
> > http://www.microsoft.com/whdc/driver/wdf/beta.mspx
> >=20
> > -p
> >=20
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com=20
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of=20
> > David Bradsher
> > > Sent: Tuesday, May 03, 2005 8:27 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] Anyone working with WDF?
> > >
> > > Hi everyone -
> > >
> > > Has anyone been doing any experimenting with WDF? I’m=20
> > working with a=20
> > > build from last year’s WinHEC - have had no success getting in
> > > the=20 Beta program so don’t know what the current stage of WDF=20
> > development=20
> > > is.
> > >
> > > I’d really like to consider this for some forthcoming driver=20
> > > development - it took about a week to get a skeleton driver=20
> > going for=20
> > > one of out existing products just to see if I could get the PnP
> > > and=20 power functions for the board installed and running.
> > >
> > > David Bradsher
> > > xxxxx@comtrol.com
> > >
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=3D256
> > >
> > > You are currently subscribed to ntdev as:
> > > xxxxx@windows.microsoft.com To unsubscribe send a blank email
> > > to=20 xxxxx@lists.osr.com
> > >
> >=20
> >=20
> >=20
> > —
> > Questions? First check the Kernel Driver FAQ at=20
> >http://www.osronline.com/article.cfm?id=3D256
> >=20
> > You are currently subscribed to ntdev as:=20
> >xxxxx@windows.microsoft.com To unsubscribe send a
> blank=20 email to
> >xxxxx@lists.osr.com =20
>
> ----------------------------------------------------------------------
>
> Subject: RE: Stack-based memory corruption
> From: “Asa Yeamans”
> Date: Tue, 3 May 2005 19:40:37 -0500
> X-Message-Number: 14
>
> D’oh i knew they were saying something…=20
>
> (never read emails late at night…)
>
> Thanks, Asa
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Andrei
> Zlate-Podani
> Sent: Tuesday, May 03, 2005 3:25 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Stack-based memory corruption
>
>
> Asa Yeamans wrote:
>
> >I realize what InterlockedCompareExchange does, thats why i used it =
> here. My eventual
> >goal is to create a platform independent InterlockedPopSList
> as i need
> >=
> the program to
> >run on Windows 2000, and that function is available only on XP+.
> >
> >Ive stepped through it with WinDBG and the failure looks
> like it is =
> occuring between
> >pTop=3DpList->pFirst and pNext=3DpTop->next;
> >I have windbg open with locals showing and everything, i
> click the + =
> next to pList
> >and click the + next to pFirst and i see the value of
> pFirst. however
> >=
> the statement
> >it access violations at, pNext=3DpTop->next pTop now has
> some bizarre
> >=
> value. whereas before
> >it went through the if statement, it had the correct value.
> >
> >im rather sure the issue doesnt involve any sort of side effect of =
> InterlockedComp.Exg.
> >If anyone can come up with a better implementation of =
> InterlockedPopSList, id be glad to take
> >it though :smiley:
> >
> >asa
> >
> > =20
> >
> As Loren and Alberto pointed out, your while condition is
> flawed. The=20
> loop will end only when pTop is 0.
>
> Instead of Interlock…() !=3D pTop use Interlock…()
> !=3D pNext
> You should know that InterlockedXXX routines are atomic only
> with=20 respect
> to other InterlockedXXX calls. So, accessing your pointers
> like that may get
> you into trouble.
>
> Andrei.
>
> PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
> {
> PGENERIC_ITEM pTop, pNext;
>
> do
> {
> pTop=3DpList->pFirst;
> if(pTop=3D=3DNULL) return NULL;
>
> —>>>> pNext=3DpTop->next;
> } while( InterlockedCompareExchangePointer( (PVOID *)
> &(pList->pFirst), = pNext, pTop) !=3D pTop);
> InterlockedDecrement(&pList->dwNumItems);
>
> return pTop;
> }
>
>
>
> --=20
> This message was scanned for spam and viruses by BitDefender. For more
> information please visit http://linux.bitdefender.com/
>
>
> —
> Questions? First check the Kernel Driver FAQ at =
> http://www.osronline.com/article.cfm?id=3D256
>
> You are currently subscribed to ntdev as: xxxxx@rivin.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: Request NDIS to call MiniportREset
> From: “Yagmur Konuslu”
> Date: Wed, 4 May 2005 07:02:57 +0300
> X-Message-Number: 15
>
> Hi,
> how is NDIS forced to call MiniportReset. The DDK says calling
> NdisMIndicateStatus with some NDIS_STATUS_xxx will make this
> possible. Will
> NDIS_STATUS_DEVICE_FAILED do this?
>
> Best Regards
> Yagmur Konuslu
>
>
>
>
>
> —
>
> END OF DIGEST
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@india.hp.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

A device driver has the ability to issue I/O at DISPATCH_LEVEL. Typically, another driver opens your device b/c you are participating in a well known interface (ie a defined class). When this happens, you must be able to handle i/o (as mark said, read/write/ioctl/internal ioctl) sent to you at DISPATCH_LEVEL.

On the other hand, if you are creating a device which has its own custom interface (let’s say an osciliscope) where the only thing that understands the interface is your application (ie no other driver will open your device), all i/o will arrive at PASSIVE_LEVEL.

What this boils down to is the role your driver plays within the system. That role will determine the IRQL that i/o shows up at.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Wednesday, May 04, 2005 4:14 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How does kernel determine IRQL’s for routines??

Indeed.

Now to the question: “in its own class and does not interact” is a bit of a
peculiar way to phrase it, but I think I understand what the poster meant.

Limit the discussion to the Big Three: Read/Write/Ioctl.

Top level drivers can make assumptions about IRP dispatch routine IRQL
levels, that is that the routines will be invoked at PASSIVE_LEVEL. Other
non top level drivers might be able to make the same assumption, or not,
depending on the behavior of the drivers layered above them. The standard
example is the disk class driver, which gets invoked at DISPATCH_LEVEL for
various read/write IRPs, much to the dismay of the na?ve flter driver
writer.

Any read/write/ioctl dispatch routine using method neither had better be
invoked at PASSIVE_LEVEL and in the calling process context.

Filter drivers above top level drivers cannot violate the assumptions of the
driver they are filtering.

=====================
Mark Roddy
Windows .NET/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mayur
Kankanwadi
Sent: Wednesday, May 04, 2005 4:45 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How does kernel determine IRQL’s for routines??

Man pls reply to the specific topic and not to the digest.
This helps in logging all the answers to a particular topic
and makes them searchable at a later man.
Bye.
–Mayur.

“gowtamk” wrote in message news:xxxxx@ntdev…
> Thanks, this is a good piece of info.
>
> I did not get what this means,
> “If you are creating a driver which is in your own class and
> does not interact with other predefined kernel components,
> you can assume PASSIVE_LEVEL for your dispatch routines and
> dictate PASSIVE_LEVEL. If you are creating a driver which is
> interacting with other kernel mode, you cannot dictate IRQL level.”
>
> What does interacting/non-interacting with kernel mode mean
> in this context.
>
> Regards,
> Karanth
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> Windows System Software Devs Interest List digest
> Sent: Wednesday, May 04, 2005 10:30 AM
> To: ntdev digest recipients
> Subject: ntdev digest: May 03, 2005
>
>
> NTDEV Digest for Tuesday, May 03, 2005.
>
> 1. How does kernel determine IRQL’s for routines??
> 2. RE: How does kernel determine IRQL’s for routines??
> 3. Re: How does kernel determine IRQL’s for routines??
> 4. Re: Stack-based memory corruption
> 5. Check inf error about unrecognized GUID 6. Anyone working with WDF?
> 7. RE: Anyone working with WDF?
> 8. RE: Anyone working with WDF?
> 9. RE: Anyone working with WDF?
> 10. Re: Anyone working with WDF?
> 11. OT: DevCon Feedback
> 12. Re: Driver Unload Problem
> 13. RE: Anyone working with WDF?
> 14. RE: Stack-based memory corruption
> 15. Request NDIS to call MiniportREset
>
> ----------------------------------------------------------------------
>
> Subject: How does kernel determine IRQL’s for routines??
> From: “Mayur Kankanwadi”
> Date: Tue, 3 May 2005 11:07:23 +0530
> X-Message-Number: 1
>
> Hi,
> How does the kernel know at what level or IRQL should either
> be a dispatch routine or driver entry or driver unload
> routine must be called or executed?
> Bye. --Mayur.
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: How does kernel determine IRQL’s for routines??
> From: “Doron Holan”
> Date: Mon, 2 May 2005 23:05:07 -0700
> X-Message-Number: 2
>
> The kernel makes the rules for DriverEntry and DriverUnload.
> Additionally it defines the IRQL rules IRP_MJ_PNP,
> IRP_MJ_POWER, IRP_MJ_CREATE, and IRP_MJ_CLEANUP (among many
> irp major codes). By defining the IRQL rules, the kernel
> makes sure that it calls DriverEntry
> and DriverUnload in a known system context in a known IRQL. The same
> for pnp. The kernel sends the pnp irps in a known system context. =20
>
> By default, most entry points in the driver are called at
> PASSIVE_LEVEL by default. Dispatch routines will be called
> at DISPATCH_LEVEL if there is a kernel mode driver which is
> sending you I/O…at that point, the kernel i/o manager is
> not involved. If you are creating a driver which is in your
> own class and does not interact with other predefined kernel
> components, you can assume PASSIVE_LEVEL for your dispatch
> routines and dictate PASSIVE_LEVEL.
> If you are creating a driver which is interacting with other
> kernel mode, you cannot dictate IRQL level.
>
> BTW, IRP_MJ_POWER can be sent at DISPATCH_LEVEL if you do not
> set DO_POWER_PAGEABLE in DeviceObject->Flags. =20
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mayur
> Kankanwadi
> Sent: Monday, May 02, 2005 10:37 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How does kernel determine IRQL’s for routines??
>
> Hi,
> How does the kernel know at what level or IRQL should either
> be a dispatch routine or driver entry or driver unload
> routine must be called or executed?
> Bye. --Mayur.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=3D256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: Re: How does kernel determine IRQL’s for routines??
> From: “Maxim S. Shatskih”
> Date: Tue, 3 May 2005 12:20:21 +0400
> X-Message-Number: 3
>
> DriverEntry and Unload are always called from a system
> thread at PASSIVE_LEVEL.
>
> As about the dispatch routines - PnP is also called from
> a system thread at PASSIVE_LEVEL, Power is called from Power
> Manager and its IRQL is determined by DO_POWER_PAGABLE flag,
> and all of the rest are called by IoCallDriver from other
> driver or the syscall path in the kernel itself.
>
> Syscall paths always run on PASSIVE_LEVEL, and as about
> the other drivers - this depends on particular stack. For
> instance, serial, USB, disk and TDI stacks (I means TDI
> send/receive only) can be called at DISPATCH_LEVEL.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Mayur Kankanwadi”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Tuesday, May 03, 2005 9:37 AM
> Subject: [ntdev] How does kernel determine IRQL’s for routines??
>
>
> > Hi,
> > How does the kernel know at what level or IRQL should either be a
> > dispatch routine or driver entry or driver unload routine must be
> > called or executed? Bye.
> > --Mayur.
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> ----------------------------------------------------------------------
>
> Subject: Re: Stack-based memory corruption
> From: Andrei Zlate-Podani
> Date: Tue, 03 May 2005 01:24:46 -0700
> X-Message-Number: 4
>
> Asa Yeamans wrote:
>
> >I realize what InterlockedCompareExchange does, thats why i used it
> >here. My eventual goal is to create a platform independent
> >InterlockedPopSList as i need the program to run on Windows 2000, and
> >that function is available only on XP+.
> >
> >Ive stepped through it with WinDBG and the failure looks like it is
> >occuring between pTop=pList->pFirst and pNext=pTop->next; I
> have windbg
> >open with locals showing and everything, i click the + next to pList
> >and click the + next to pFirst and i see the value of
> pFirst. however
> >the statement it access violations at, pNext=pTop->next pTop now has
> >some bizarre value. whereas before it went through the if
> statement,
> >it had the correct value.
> >
> >im rather sure the issue doesnt involve any sort of side effect of
> >InterlockedComp.Exg. If anyone can come up with a better
> implementation
> >of InterlockedPopSList, id be glad to take it though :smiley:
> >
> >asa
> >
> >
> >
> As Loren and Alberto pointed out, your while condition is flawed. The
> loop will end only when pTop is 0.
>
> Instead of Interlock…() != pTop use Interlock…() != pNext
> You should know that InterlockedXXX routines are atomic only with
> respect to other InterlockedXXX calls.
> So, accessing your pointers like that may get you into trouble.
>
> Andrei.
>
> PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
> {
> PGENERIC_ITEM pTop, pNext;
>
> do
> {
> pTop=pList->pFirst;
> if(pTop==NULL) return NULL;
>
> —>>>> pNext=pTop->next;
> } while( InterlockedCompareExchangePointer( (PVOID *)
> &(pList->pFirst), pNext, pTop) != pTop);
> InterlockedDecrement(&pList->dwNumItems);
>
> return pTop;
> }
>
>
>
> –
> This message was scanned for spam and viruses by BitDefender. For more
> information please visit http://linux.bitdefender.com/
>
>
> ----------------------------------------------------------------------
>
> Subject: Check inf error about unrecognized GUID
> From: S
> Date: Tue, 3 May 2005 17:00:07 +0530
> X-Message-Number: 5
>
> Hi all,
>
> I am testing my driver with HCT kit.
> When I do checkINF test, its giving the following error.
>
> My device can not come under any pre defined class, because of its
> functionality; I am trying to create a new class of device. I
> generated a
> new Class GUID and used this in my inf file.
>
> Is it compulsory to give the pre defined Class GUID to pass
> HCT? Or can we
> give any class GUID?
>
> ERROR: (E22.1.1310) Class MyClass (ClassGUID {DAA41EEA-E0DA-4de7-
> 91FB-E0F16D988434}) is unrecognized.=20
>
>
> Regards,
> S.
>
> ----------------------------------------------------------------------
>
> Subject: Anyone working with WDF?
> From: “David Bradsher”
> Date: Tue, 3 May 2005 10:27:04 -0500
> X-Message-Number: 6
>
> Hi everyone -
>
> Has anyone been doing any experimenting with WDF? I’m
> working with a build
> from last year’s WinHEC - have had no success getting in the
> Beta program so
> don’t know what the current stage of WDF development is.
>
> I’d really like to consider this for some forthcoming driver
> development -
> it took about a week to get a skeleton driver going for one
> of out existing
> products just to see if I could get the PnP and power
> functions for the
> board installed and running.
>
> David Bradsher
> xxxxx@comtrol.com
>
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Peter Wieland”
> Date: Tue, 3 May 2005 08:30:16 -0700
> X-Message-Number: 7
>
> what problems have you had joining the WDF beta? It’s open
> enrollment, so
> you shouldn’t have trouble getting in.
>
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
> -p
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com=20
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Anyone working with WDF?
> >=20
> > Hi everyone -
> >=20
> > Has anyone been doing any experimenting with WDF? I’m=20 working
> >with a build from last year’s WinHEC - have had no=20
> success getting
> >in the Beta program so don’t know what the=20 current stage of WDF
> >development is. =20
> > I’d really like to consider this for some forthcoming driver=20
> > development - it took about a week to get a skeleton driver=20
> > going for one of out existing products just to see if I could=20
> > get the PnP and power functions for the board installed and running.
> >=20
> > David Bradsher
> > xxxxx@comtrol.com
> >=20
> >=20
> >=20
> >=20
> > —
> > Questions? First check the Kernel Driver FAQ at=20
> > http://www.osronline.com/article.cfm?id=3D256
> >=20
> > You are currently subscribed to ntdev as:=20
> > xxxxx@windows.microsoft.com To unsubscribe send a blank=20
> > email to xxxxx@lists.osr.com
> >=20
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Roddy, Mark”
> Date: Tue, 3 May 2005 11:30:16 -0400
> X-Message-Number: 8
>
> You need to join the WDF beta and get refreshed. The 2004
> winhec drop is not
> very useful, the current beta is quite useful. There should
> be no problem
> getting into the beta. Go here:
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
>
>
>
>
> =====================
> Mark Roddy
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David Bradsher
> Sent: Tuesday, May 03, 2005 11:27 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Anyone working with WDF?
>
> Hi everyone -
>
> Has anyone been doing any experimenting with WDF? I’m
> working with a build
> from last year’s WinHEC - have had no success getting in the
> Beta program so
> don’t know what the current stage of WDF development is.
>
> I’d really like to consider this for some forthcoming driver
> development -
> it took about a week to get a skeleton driver going for one
> of out existing
> products just to see if I could get the PnP and power
> functions for the
> board installed and running.
>
> David Bradsher
> xxxxx@comtrol.com
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Sivakumar Jayapal - CTD, Chennai.”
> Date: Tue, 3 May 2005 21:03:36 +0530
> X-Message-Number: 9
>
> Hello,
> I am using user mode driver api’s in my user mode
> application. I faced a
> problem, When i press F5 in the Visual C++ IDE, my program
> works fine. But
> when i click execute from the toolbar “!”, my program wont
> work. The user
> mode = api is free build version.=20 My program uses the exported api
> functions.=20
>
> Any clues?
> Kindly ignore the disclaimer.
>
> Regards,
> Siva
> DISCLAIMER=20
> This message and any attachment(s) contained here are
> information that = is
> confidential, proprietary to HCL Technologies=20 and its
> customers. Contents
> may be privileged or otherwise protected by = law. The
> information is solely
> intended for the=20 individual or the entity it is addressed
> to. If you are
> not the intended = recipient of this message, you are not
> authorized to=20
> read, forward, print, retain, copy or disseminate this
> message or any = part
> of it. If you have received this e-mail in error,=20 please notify the
> sender immediately by return e-mail and delete it from = your computer
>
>
> ----------------------------------------------------------------------
>
> Subject: Re: Anyone working with WDF?
> From: “David Bradsher”
> Date: Tue, 3 May 2005 10:45:51 -0500
> X-Message-Number: 10
>
> I went thru the signup page submission twice with not so much as an
> acknowledgement either time. E-mailed the beta contact
> address & just got a
> form letter with the same signup instructions.
>
> David
>
>
> “Peter Wieland” wrote in message
> news:xxxxx@ntdev… what problems have you had joining the
> WDF beta? It’s
> open enrollment, so you shouldn’t have trouble getting in.
>
> http://www.microsoft.com/whdc/driver/wdf/beta.mspx
>
> -p
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:27 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Anyone working with WDF?
> >
> > Hi everyone -
> >
> > Has anyone been doing any experimenting with WDF? I’m
> working with a
> > build from last year’s WinHEC - have had no success getting in the
> > Beta program so don’t know what the current stage of WDF development
> > is.
> >
> > I’d really like to consider this for some forthcoming driver
> > development - it took about a week to get a skeleton driver
> going for
> > one of out existing products just to see if I could get the PnP and
> > power functions for the board installed and running.
> >
> > David Bradsher
> > xxxxx@comtrol.com
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
> ----------------------------------------------------------------------
>
> Subject: OT: DevCon Feedback
> From: “Peter Viscarola (OSR)”
> Date: Tue, 03 May 2005 12:09:14 -0400
> X-Message-Number: 11
>
> If you did not attend Driver Dev Con last week, hit delete now.
>
> If you DID attend Driver Dev Con last week, we at OSR would appreciate
> it if would take a few minutes to provide feedback to the community on
> how you liked the conference:
>
> http://www.osronline.com/article.cfm?article=399
>
> Note that, while you WILL have to login to your OSR Online account to
> enter your feedback, all postings appear anonymously.
>
> Your comments will help other folks in the driver development
> community
> determine if attending the next DDC will benefit them. In addition,
> your feedback will directly help at OSR (as one of two major
> sponsors of
> the DDC) work with Microsoft to ensure future conferences are
> maximally
> beneficial.
>
> What did you like best, least? What would you like to see
> more/less of?
> Let’s hear it!
>
> Thanks,
>
> Peter
> OSR
>
> ----------------------------------------------------------------------
>
> Subject: Re: Driver Unload Problem
> From: “Brian Wilson”
> Date: Tue, 3 May 2005 12:29:15 -0400
> X-Message-Number: 12
>
>
> “Tim Roberts” wrote in message news:xxxxx@ntdev…
> > Brian Wilson wrote:
> >
> >> I have been using Walter Oney’s sample drivers to build a USB WDM
> >> driver.
> >> I am using a renamed version of the “Generic.sys”
> (different GUID too)
> >> driver to handle power management for the main driver.
> However, I have
> >> run into a WHQL problem that I am looking for a solution.
> The driver
> >> unloads properly when the device is unplugged but seems to
> have a problem
>
> >> unloading during the WHQL tests. Can anyone tell me what
> might be missing
>
> >> and how to correct the problem using the “Generic.sys” driver?
> >>
> >> Also, I would have expected that Windows XP would issue a RESUME
> >> after
> >> SUSPEND but, more often than not, the OS issues a RESET
> after SUSPEND.
> >> Can anyone shed light on why the OS is issuing a RESET instead of a
> >> RESUME?
> >>
> >>
> >> I’m sorry, the RESET is a USB Reset, not an IRP.
> >
> >
> > The operating system doesn’t issue any USB requests on its own. If
> > your
> > device is getting a pipe reset, then your driver must be sending it.
>
> I don’t agree. Certainly the device receives a bus reset at
> least twice
> before the device is enumerated and the driver loaded.
>
> >
> > –
> > Tim Roberts, xxxxx@probo.com
> > Providenza & Boekelheide, Inc.
> >
> >
>
>
>
> ----------------------------------------------------------------------
>
> Subject: RE: Anyone working with WDF?
> From: “Peter Wieland”
> Date: Tue, 3 May 2005 12:46:36 -0700
> X-Message-Number: 13
>
> to ask the stupid question - did you check to make sure that
> the replies
> didn’t get filtered out as junk mail?
>
> -p=20
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com=20
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> David Bradsher
> > Sent: Tuesday, May 03, 2005 8:46 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Anyone working with WDF?
> >=20
> > I went thru the signup page submission twice with not so much=20 as
> >an acknowledgement either time. E-mailed the beta
> contact=20 address
> >& just got a form letter with the same signup instructions. =20
> > David
> >=20
> >=20
> > “Peter Wieland” wrote in=20
> > message news:xxxxx@ntdev…
> > what problems have you had joining the WDF beta? It’s open=20
> > enrollment, so you shouldn’t have trouble getting in.
> >=20
> > http://www.microsoft.com/whdc/driver/wdf/beta.mspx
> >=20
> > -p
> >=20
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com=20
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of=20
> > David Bradsher
> > > Sent: Tuesday, May 03, 2005 8:27 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] Anyone working with WDF?
> > >
> > > Hi everyone -
> > >
> > > Has anyone been doing any experimenting with WDF? I’m=20
> > working with a=20
> > > build from last year’s WinHEC - have had no success getting in
> > > the=20 Beta program so don’t know what the current stage of WDF=20
> > development=20
> > > is.
> > >
> > > I’d really like to consider this for some forthcoming driver=20
> > > development - it took about a week to get a skeleton driver=20
> > going for=20
> > > one of out existing products just to see if I could get the PnP
> > > and=20 power functions for the board installed and running.
> > >
> > > David Bradsher
> > > xxxxx@comtrol.com
> > >
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=3D256
> > >
> > > You are currently subscribed to ntdev as:
> > > xxxxx@windows.microsoft.com To unsubscribe send a blank email
> > > to=20 xxxxx@lists.osr.com
> > >
> >=20
> >=20
> >=20
> > —
> > Questions? First check the Kernel Driver FAQ at=20
> >http://www.osronline.com/article.cfm?id=3D256
> >=20
> > You are currently subscribed to ntdev as:=20
> >xxxxx@windows.microsoft.com To unsubscribe send a
> blank=20 email to
> >xxxxx@lists.osr.com =20
>
> ----------------------------------------------------------------------
>
> Subject: RE: Stack-based memory corruption
> From: “Asa Yeamans”
> Date: Tue, 3 May 2005 19:40:37 -0500
> X-Message-Number: 14
>
> D’oh i knew they were saying something…=20
>
> (never read emails late at night…)
>
> Thanks, Asa
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Andrei
> Zlate-Podani
> Sent: Tuesday, May 03, 2005 3:25 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Stack-based memory corruption
>
>
> Asa Yeamans wrote:
>
> >I realize what InterlockedCompareExchange does, thats why i used it =
> here. My eventual
> >goal is to create a platform independent InterlockedPopSList
> as i need
> >=
> the program to
> >run on Windows 2000, and that function is available only on XP+.
> >
> >Ive stepped through it with WinDBG and the failure looks
> like it is =
> occuring between
> >pTop=3DpList->pFirst and pNext=3DpTop->next;
> >I have windbg open with locals showing and everything, i
> click the + =
> next to pList
> >and click the + next to pFirst and i see the value of
> pFirst. however
> >=
> the statement
> >it access violations at, pNext=3DpTop->next pTop now has
> some bizarre
> >=
> value. whereas before
> >it went through the if statement, it had the correct value.
> >
> >im rather sure the issue doesnt involve any sort of side effect of =
> InterlockedComp.Exg.
> >If anyone can come up with a better implementation of =
> InterlockedPopSList, id be glad to take
> >it though :smiley:
> >
> >asa
> >
> > =20
> >
> As Loren and Alberto pointed out, your while condition is
> flawed. The=20
> loop will end only when pTop is 0.
>
> Instead of Interlock…() !=3D pTop use Interlock…()
> !=3D pNext
> You should know that InterlockedXXX routines are atomic only
> with=20 respect
> to other InterlockedXXX calls. So, accessing your pointers
> like that may get
> you into trouble.
>
> Andrei.
>
> PGENERIC_ITEM POP_SLIST(PGENERIC_LIST pList)
> {
> PGENERIC_ITEM pTop, pNext;
>
> do
> {
> pTop=3DpList->pFirst;
> if(pTop=3D=3DNULL) return NULL;
>
> —>>>> pNext=3DpTop->next;
> } while( InterlockedCompareExchangePointer( (PVOID *)
> &(pList->pFirst), = pNext, pTop) !=3D pTop);
> InterlockedDecrement(&pList->dwNumItems);
>
> return pTop;
> }
>
>
>
> --=20
> This message was scanned for spam and viruses by BitDefender. For more
> information please visit http://linux.bitdefender.com/
>
>
> —
> Questions? First check the Kernel Driver FAQ at =
> http://www.osronline.com/article.cfm?id=3D256
>
> You are currently subscribed to ntdev as: xxxxx@rivin.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> ----------------------------------------------------------------------
>
> Subject: Request NDIS to call MiniportREset
> From: “Yagmur Konuslu”
> Date: Wed, 4 May 2005 07:02:57 +0300
> X-Message-Number: 15
>
> Hi,
> how is NDIS forced to call MiniportReset. The DDK says calling
> NdisMIndicateStatus with some NDIS_STATUS_xxx will make this
> possible. Will
> NDIS_STATUS_DEVICE_FAILED do this?
>
> Best Regards
> Yagmur Konuslu
>
>
>
>
>
> —
>
> END OF DIGEST
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@india.hp.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com