Is there alternative for RtUnicodeStringToAnsiString?

Hi Everybody,
I want to convert unicodestring to Ansistring in Dispatch Routine. I know
RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?
Thanx in Advance,
T.Umapathy

T.Umapathy,

Hi Everybody,
I want to convert unicodestring to Ansistring in Dispatch Routine. I know
RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?
Thanx in Advance,
T.Umapathy

You can write your own routine to realize RtUnicodeStringToAnsiString,like this: *pSnsi = (UCHAR) *(pUnicode).

But you must be sure that the buffer of the two strings are in NOPAGED pool if current IRQL > PASSIVE level.

Best wishes,

Matt
http://sys.xiloo.com

You are kidding, right? UnicodeToAnsi has to do an accurate transcoding
according to the current ACP, which for which truncating the 16 bit
value to 8 bits is never, ever, correct, since the upper half of even
CP1252 does not match up.

-----Original Message-----
From: Matt Wu [mailto:mattwu@163.com]
Sent: Monday, May 20, 2002 6:16 AM
To: File Systems Developers
Subject: [ntfsd] Re: Is there alternative for
RtUnicodeStringToAnsiString?

T.Umapathy,

Hi Everybody,
I want to convert unicodestring to Ansistring in Dispatch Routine. I
know
RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?
Thanx in Advance,
T.Umapathy

You can write your own routine to realize
RtUnicodeStringToAnsiString,like this: *pSnsi = (UCHAR) *(pUnicode).

But you must be sure that the buffer of the two strings are in NOPAGED
pool if current IRQL > PASSIVE level.

Best wishes,

Matt
http://sys.xiloo.com


You are currently subscribed to ntfsd as: xxxxx@basistech.com
To unsubscribe send a blank email to %%email.unsub%%

> I want to convert unicodestring to Ansistring in Dispatch Routine. I know

RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?

No. Not only the ANSI->Unicode tables are paged, but the kernel routines working with them too.
(just hit this bug in my code - swprintf() called from under a spinlock. Verifier catches this immediately).

Max

I think you misunderstand something here: a dispatch entry point is called
at PASSIVE_LEVEL, not Dispatch level. The term “dispatch” is used in a
number of different places within the operating system and DISPATCH_LEVEL
comes from its use in thread scheduling/dispatching (context switching).
Driver operation dispatching is a different use of dispatching and is not
called at DISPATCH_LEVEL.

So, while the other responses are correct (there is no equivalent) I believe
that you should be able to use the standard routine - unless YOU are doing
something to raise the IRQL of the system (e.g., acquiring a spin lock).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Hope to see you at the next OSR file systems class October 7, 2002!

-----Original Message-----
From: T.Umapathy [mailto:xxxxx@yahoo.com]
Sent: Monday, May 20, 2002 12:33 AM
To: File Systems Developers
Subject: [ntfsd] Is there alternative for RtUnicodeStringToAnsiString?

Hi Everybody,
I want to convert unicodestring to Ansistring in Dispatch Routine. I know
RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?
Thanx in Advance,
T.Umapathy


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to %%email.unsub%%

If you turn out to really need a transcoding module that you can wire
down, let me know, we sell one. You could try it with ICU, but it isn’t
much optimized for size.

-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Monday, May 20, 2002 9:38 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there alternative for
RtUnicodeStringToAnsiString?

I think you misunderstand something here: a dispatch entry point is
called
at PASSIVE_LEVEL, not Dispatch level. The term “dispatch” is used in a
number of different places within the operating system and
DISPATCH_LEVEL
comes from its use in thread scheduling/dispatching (context switching).
Driver operation dispatching is a different use of dispatching and is
not
called at DISPATCH_LEVEL.

So, while the other responses are correct (there is no equivalent) I
believe
that you should be able to use the standard routine - unless YOU are
doing
something to raise the IRQL of the system (e.g., acquiring a spin lock).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Hope to see you at the next OSR file systems class October 7, 2002!

-----Original Message-----
From: T.Umapathy [mailto:xxxxx@yahoo.com]
Sent: Monday, May 20, 2002 12:33 AM
To: File Systems Developers
Subject: [ntfsd] Is there alternative for RtUnicodeStringToAnsiString?

Hi Everybody,
I want to convert unicodestring to Ansistring in Dispatch Routine. I
know
RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
alternative function to work with IRQL Dispatch?
Thanx in Advance,
T.Umapathy


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@basistech.com
To unsubscribe send a blank email to %%email.unsub%%

Why do you need ANSI string. NT is designed for using Unicode. You may have
a lot of troubles when using ANSI strings (as we still do).

----- Original Message -----
From: “T.Umapathy”
To: “File Systems Developers”
Sent: Monday, May 20, 2002 7:32 AM
Subject: [ntfsd] Is there alternative for RtUnicodeStringToAnsiString?

> Hi Everybody,
> I want to convert unicodestring to Ansistring in Dispatch Routine. I know
> RtUnicodeStringToAnsiString can be used in IRQL Passive. Is there any
> alternative function to work with IRQL Dispatch?
> Thanx in Advance,
> T.Umapathy
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to %%email.unsub%%
>

Hi Tony,
You are right. I am working with filter driver. When ever i am receiving
IRPs from dispatch routine, I am marking as pending and inserting in to
queue. Then I am sending some info to usermode service for
validation(using Inverted call model as you posted in this list). After
receiving response from usermode service, I am acquiring spin lock to
remove the IRP from queue, and calling another function for further
processing. There, I used RtUnicodeStringToAnsiString with in function.
Now it is clear, I have to release the lock before calling the funtion.
Thanks a Lot,
Regards,
T.Umapathy