SetNativeFunction Method

AppDomainSetup.SetNativeFunction Method (String, Int32, IntPtr)

.NET Framework (current version)
 

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

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

[SecurityCriticalAttribute]
public void SetNativeFunction(
	string functionName,
	int functionVersion,
	IntPtr functionPointer
)

Parameters

functionName
Type: System.String

The name of the string comparison function to override.

functionVersion
Type: System.Int32

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

functionPointer
Type: System.IntPtr

A pointer to the function that overrides functionName.

Exception Condition
ArgumentException

functionName is null.

ArgumentNullException

functionVersion is not 1 or greater.

-or-

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.

SecurityCriticalAttribute

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

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft