Janitorial dlls/advapi32/registry.c W->A cleanup
dmitry at baikal.ru
Thu Mar 6 18:36:36 CST 2003
"Alexandre Julliard" <julliard at winehq.com> wrote:
> > Thus, there is no need to waste CPU cycles by allocating/deallocating
> > memory, but instead having an automatic buffer on the stack will be
> > quite enough. See files/drive.c,GetCurrentDirectoryA for a sample.
> > All other APIs which get a file name as a parameter should be rewritten
> > that way too. Probably that's the task for yet another janitorial project...
> I don't think I agree with that. Our file I/O functions already use
> way too much stack precisely because we use MAX_PATH stack buffers all
> over the place, and we should be getting rid of them, not adding even
> Note that in advapi32, you can use the static Unicode buffer in the
> TEB to avoid memory allocations. We could probably use it in at least
> some of the kernel ANSI functions too.
I was going to object, but decided to look at the real thing first.
You are right Alexandre, kernel32.dll from win2k uses unicode buffer in
the TEB for all the ANSI APIs I looked at. So yes, that's the way to go.
More information about the wine-devel