Re: length checking...
- From: "Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx>
- Date: Sun, 28 May 2006 22:06:17 +0400
I didnt understand 'type'? It is not null terminated - I get it from a user
mode app thru a oid call. ANSI string.
Change your OID interface to always:
a) use Unicode strings only, the legacy apps can do their own ANSI conversion
if they need so
b) always provide the length together with the string, never relying on zero
termination. Nearly no code in Windows kernel relies on zero termination of the
string, the strings are always counted UNICODE_STRING there.
Note: Win9x is dead, so all apps are becoming NT-only, which means - no reasons
at all in ever building any code with ANSI build options.
We are Unicode-only and UTF-8 (for IETF protocols like HTTP) now.
Unicode is much simpler then ANSI, and I would recommend Unicode for beginners
:) just consider the Japanese market, for Japanese, Unicode is same simple, and
ANSI turns to a misdesigned nightmare of DBCS.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
.
- References:
- Re: length checking...
- From: Doron Holan [MS]
- Re: length checking...
- Prev by Date: Re: How many APC's/Completion routines will be executed when my thread enters an alertable wait state ?
- Next by Date: Re: DevCon
- Previous by thread: Re: length checking...
- Next by thread: SDIOclientdriver: Where to read the byte data in CMD53 command ?
- Index(es):
Relevant Pages
|