[fpc-devel] Changing Windows API A routines in SysUtils to W in Windows NT

Craig Peterson craig at scootersoftware.com
Wed Feb 8 17:28:01 CET 2012

On 2/8/2012 9:21 AM, Felipe Monteiro de Carvalho wrote:
> Windows9x has all W functions,

No it does not.  The Microsoft layer for Unicode is a redistributable
DLL that provides W versions of functions and calls the A versions
internally.  Win9x does export a bunch of W functions so you can link to
both versions and conditionally call the correct one, but if you
actually try calling the W versions the vast majority will immediately

The platform SDK used to say which platforms supported the W versions,
but that information hasn't been included in quite a while.

For simplicity's sake, assuming continued Win9x support is even
desirable, the RTL should call the generic versions, and Windows.pas
should have {$IFDEF UNICODE} blocks to decide between the A and W
versions.  The TNT Unicode controls did it the way you're suggesting, by
deciding at runtime, so it is possible, but it would overly complicate
the RTL code for an increasingly irrelevant platform.

Craig Peterson
Scooter Software

More information about the fpc-devel mailing list