Tech Support > Microsoft Windows > Drivers > IRQL_NOT_LESS_OR_EQUAL and RtlStringCbPrintfW
IRQL_NOT_LESS_OR_EQUAL and RtlStringCbPrintfW
Posted by J on June 12th, 2008


Hello all,

I'm getting an IRQL_NOT_LESS_OR_EQUAL on a call to RtlStringCbPrintfW.
I'm used to RtlStringCbPrintfW and I have debugged the BSOD dump file
and I have checked that each of the arguments are OK. I expected to
find a wrong buffer as in other times but they are ok !

RtlStringCbPrintfW calls to RtlStringVPrintfWorkerW that calls to
mbtowc that crash with an illegal access.

I guess this question needs more information to be answered properly,
sorry.

Any ideas?

Thanks in advance


Julian

Posted by Don Burn on June 12th, 2008


As previously answered at osronline.com WINDBG list, the most likely cause
is:

You are using Unicode at DISPATCH_LEVEL or higher, that will cause this
fault. The wide routines have to be used at <= DISPATCH_LEVEL


--
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




"J" <julian.navascues@gmail.com> wrote in message
news:a5c2d830-9f3a-468b-ae04-c0debd716bed@k30g2000hse.googlegroups.com...


Posted by Volodymyr M. Shcherbyna on June 12th, 2008


Just my 5 cents to OP: use PAGED_CODE macro in each routine. This will
eliminate problems like this.

--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:efnNEQLzIHA.2220@TK2MSFTNGP06.phx.gbl...


Posted by Pavel A. on June 12th, 2008


Is there a simple way to lock all the data used by that unicode stuff
( all these NlsSectionCPxxx , NlsSectionLocale, etc. ? )
so we could safely debug print at any irql?

Regards,
--PA



"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:efnNEQLzIHA.2220@TK2MSFTNGP06.phx.gbl...

Posted by J on June 13th, 2008


Thank you a lot, once more time.

I have been reading about this and if I have understood right these
wide routines are only callable at PASSIVE_LEVEL or APC_LEVEL because
they internally use paged memory (NLS tables) to do ASCII<->UNICODE
conversions. And then if you call them at higher level could, but not
necessarily, crash with a BSOD.

I'm wrong? What happens if I want manipulate wide char strings at
higher levels?

Julian




On Jun 12, 7:44 pm, "Don Burn" <b...@stopspam.windrvr.com> wrote:

Posted by Volodymyr M. Shcherbyna on June 13th, 2008


"J" <julian.navascues@gmail.com> wrote in message
news:d985e02f-7baf-4c33-bf4d-7abfec3791d2@l42g2000hsc.googlegroups.com...

[...]

If memory was paged out you will get BSOD at DISPATCH_LEVEL.

It depends on operations you want to do at higher level. Some of string
routines can be re-implemented by you if you really need to use them at
DISPATCH.

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



Posted by J on June 13th, 2008


Ok, but the point I dont understand is why this function (that
provides sprintf safe functionality) produces a BSOD because my
buffers are from NonPaged pool. Do you know if they internally use
buffers from PagedPool that can be paged out?



Posted by Volodymyr M. Shcherbyna on June 13th, 2008


They are prohibited to be used at DISPATCH because they operated internally
with paged memory.

--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"J" <julian.navascues@gmail.com> wrote in message
news:324320e3-8ba1-416d-8d40-3860fad105d8@e53g2000hsa.googlegroups.com...



Similar Posts