Janitorial dlls/advapi32/registry.c W->A cleanup

Alexandre Julliard julliard at winehq.com
Thu Mar 6 11:30:11 CST 2003

"Dmitry Timoshkov" <dmitry at baikal.ru> writes:

> 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.

Alexandre Julliard
julliard at winehq.com

More information about the wine-devel mailing list