[Ndiswrapper-general] Rtl ANSI<->Unicode routines (was: Rtl8180)
Status: Beta
Brought to you by:
pgiri
From: Michael L. <mi...@sl...> - 2003-12-18 09:50:35
|
Spake Pontus Fuchs: > I have implemented RtlUnicodeStringToAnsiString and > RtlAnsiStringToUnicodeString for you. I have no way of testing it and > I'm not the kind of person that gets such a function correct at the > first attempt so expect to fix some bugs. The code is now in CVS but it > takes some time before it hits the anon CVS so I have also attached a > patch. I tested this and read the code, and it made no sense to me. In RtlAnsiStringToUnicodeString, you were copying from a buffer onto itself, overwriting portions which had not yet been read! Here is a rewritten patch which has, to me, more sensible semantics. It has one problem, IMO, which is that if the two functions (RtlAnsiStringToUnicodeString and RtlUnicodeStringToAnsiString) are called repeatedly, they will result in the buffer doubling in size each time. The solution is to allocate only half the space in RtlUnicodeStringToAnsiString, but I don't have the mental energy to check it right now, especially considering that it almost certainly doesn't matter. I think the current problem with the AR5004 driver is with the .inf parser, so I'm going to poke at that bit of flex and hopefully get a better parser. Attached is a patch to fix the Unicode<->ANSI conversion routines. They have better debug output, too. Also attached is a seperate patch to fix up debug output a little bit, fixing some weird grammar, correcting a spelling error, and making it a little bit more useful for tracking memory addresses being passed back out from inside the driver. -- michael |