AppDomainSetup.SetNativeFunction(String, Int32, IntPtr) Method

Definition

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

C#
[System.Security.SecurityCritical]
public void SetNativeFunction(string functionName, int functionVersion, IntPtr functionPointer);

Parameters

functionName
String

The name of the string comparison function to override.

functionVersion
Int32

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

functionPointer
IntPtr

A pointer to the function that overrides functionName.

Attributes

Exceptions

functionName is null.

functionVersion is not 1 or greater.

-or-

functionPointer is Zero.

Remarks

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.

Applies to

Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1