Export (0) Print
Expand All

AppDomainSetup.SetNativeFunction Method

.NET Framework 4.5

Provides the common language runtime with an alternate implementation of a string comparison function.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public void SetNativeFunction(
	string functionName,
	int functionVersion,
	IntPtr functionPointer


Type: System.String

The name of the string comparison function to override.

Type: System.Int32

The function version. For .NET Framework 4.5, its value must be 1 or greater.

Type: System.IntPtr

A pointer to the function that overrides functionName.


functionName is null.


functionVersion is not 1 or greater.


functionPointer is IntPtr.Zero.

The following string comparison and sorting methods can be overridden by the SetNativeFunction method:

  • IsNLSDefinedString

  • CompareStringEx

  • LCMapStringEx

  • FindNLSStringEx

  • CompareStringOrdinal

  • GetNLSVersion

For information about these functions, see National Language Support Functions.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft