I need to handle some strings at DISPATCH_LEVEL (string conversion, etc…).
Any idea about restrictions of use for string functions?
Thanks! =)
I need to handle some strings at DISPATCH_LEVEL (string conversion, etc…).
Any idea about restrictions of use for string functions?
Thanks! =)
Yes. The Unicode collation tables are in paged memory, so, this is not
possible, unless you will write your own routines and not use RtlXxx.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> I need to handle some strings at DISPATCH_LEVEL (string conversion, etc…).
> Any idea about restrictions of use for string functions?
>
> Thanks! =)
>
My driver uses a trace driver to print debug information. I need to allocate strings and then send those to the trace driver. If I can’t use unicode strings at DPC level, how can print Debug information at that level?
Having just gone through this, assuming you are using a language for
which it is possible to ‘convert’ by just skipping every second
character, just write your own routines.
mm
>> xxxxx@storagecraft.com 2007-06-14 17:07 >>>
Yes. The Unicode collation tables are in paged memory, so, this is not
possible, unless you will write your own routines and not use RtlXxx.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> I need to handle some strings at DISPATCH_LEVEL (string conversion,
etc…).
> Any idea about restrictions of use for string functions?
>
> Thanks! =)
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Print Message IDs and the parameters, and the user mode consumer (if not
even the viewer app) will do the Message ID -> string mapping.
This is how Windows event log works. This also allows localized strings.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> My driver uses a trace driver to print debug information. I need to allocate
strings and then send those to the trace driver. If I can’t use unicode
strings at DPC level, how can print Debug information at that level?
>
> -----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-290281-
xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, June 14, 2007 4:54 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] String handle at High IRQLI need to handle some strings at DISPATCH_LEVEL (string conversion,
etc…).
Any idea about restrictions of use for string functions?
[PCAUSA] See the DDK docs. Each string-related method specifies the IRQL in the comments section.
You will have to use a work item and some queuing if the method you want use can’t be used at IRQL==DISPATCH_LEVEL (and most can’t…).
Thomas F. Divine
Thanks! =)
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
xxxxx@gmail.com wrote:
I need to handle some strings at DISPATCH_LEVEL (string conversion, etc…).
Any idea about restrictions of use for string functions?
Just that you can’t do any ASCII/Unicode conversions there. The Unicode
translation tables are all paged.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> Just that you can’t do any ASCII/Unicode conversions there. The Unicode
translation tables are all paged.
Comparing Unicode strings is also a no-no.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
That depends, if you only want to know if two strings are the same or not
you can call RtlCompareMemory/RtlEqualMemory on the buffers at any IRQL. If
instead you need to do real compares like for instance sorting, you will
need to create your own routines, but not likely to be an very big task
depending on what the requirements exactly are.
/Daniel
“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>> Just that you can’t do any ASCII/Unicode conversions there. The Unicode
>> translation tables are all paged.
>
> Comparing Unicode strings is also a no-no.
>
> –
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
Thanks for your answers…
I have a last question, I know now that I can’t use Unicode Strings at Dispatch level but … can I use sprintf with ansi strings or there is also a restriction for that?
You should probably use the safe string library in <ntstrsafe.h>.
-Steve
On Jun 20, 2007, at 4:25 PM, xxxxx@gmail.com wrote:
> Thanks for your answers?
>
> I have a last question, I know now that I can’t use Unicode Strings
> at Dispatch level but … can I use sprintf with ansi strings or
> there is also a restriction for that?
>
> —
> Questions? First check the Kernel Driver FAQ at http://
> www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</ntstrsafe.h>
xxxxx@gmail.com wrote:
I have a last question, I know now that I can’t use Unicode Strings at Dispatch level but … can I use sprintf with ansi strings or there is also a restriction for that?
That works fine, but remember that you should keep your time at
DISPATCH_LEVEL to a minimum. If you’re doing string processing, you
should think about whether it would be appropriate to do it in another
place.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
How about locking the section(collation table) for your language? Only if there is no localized messages)
xxxxx@mail.ru wrote:
How about locking the section(collation table) for your language? Only if there is no localized messages)
And how would you know where to find the system’s collation tables? The
reason they are in paged memory is that they are enormous.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
xxxxx@mail.ru wrote:
> How about locking the section(collation table) for your language? Only if there is no localized
> messages)
>
And how would you know where to find the system’s collation tables? The
reason they are in paged memory is that they are enormous.
Here they are…
/NLS/NlsSectionNNNN
Then use ((PSECTION_OBJECT)p)->StartingVa
Uhhhh, that’s a disaster in the making. You’re making a ton of assumptions about implementation, all so you can violate the DDK contract.
I seriously doubt you can get it to work *reliably* on any version of Windows. And there is no way you can guarantee that it will work on future versions of Windows (including service packs & other updates), which may change the implementation in some way you didn’t anticipate.
Also, consider the meaning of “locking the section”. You STILL can’t do it at DISPATCH_LEVEL, because the tables may be paged out when your code begins running. If they are paged out, then in order to lock them, they have to be loaded. They can’t be loaded because you’re ALREADY AT DISPATCH_LEVEL. You haven’t fixed the problem, you’ve just moved it from “use tables” to “lock tables”. Any attempt to load paged code/data at DISPATCH_LEVEL leads to BSOD. It’s just that simple.
Don’t do this. There are easy, safe, documented ways to run code at PASSIVE_LEVEL. And no whining.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@mail.ru
Sent: Thursday, June 21, 2007 1:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] String handle at High IRQL
xxxxx@mail.rumailto:xxxxx wrote:
>> How about locking the section(collation table) for your language?
>> Only if there is no localized
>> messages)
>>
>And how would you know where to find the system’s collation tables?
>The reason they are in paged memory is that they are enormous.
Here they are…
/NLS/NlsSectionNNNN
Then use ((PSECTION_OBJECT)p)->StartingVa
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx>