Share via


Overriding an API in the Microsoft Layer for Unicode

With Microsoft Layer for Unicode (MSLU), there is also a way to override any API that is in UnicoWS.dll. To override an API, simply add the following to your source code:

#ifdef _cplusplus
extern "C" {
#endif
extern FARPROC Unicows_<apiname> = (FARPROC) <API you want the Microsoft Layer for Unicode to call>
#ifdef _cplusplus
}
#endif

You must do this at the module level. Note that the API name is case sensitive and includes the "W" suffix for all decorated APIs. If this variable is set, then MSLU uses your API instead of the one in UnicoWS.dll.

For an example of this procedure, see Sample Code to Override an API in the Microsoft Layer for Unicode.