AppDomainSetup.SetNativeFunction(String, Int32, IntPtr) AppDomainSetup.SetNativeFunction(String, Int32, IntPtr) AppDomainSetup.SetNativeFunction(String, Int32, IntPtr) AppDomainSetup.SetNativeFunction(String, Int32, IntPtr) Method

Definition

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

public:
 void SetNativeFunction(System::String ^ functionName, int functionVersion, IntPtr functionPointer);
[System.Security.SecurityCritical]
public void SetNativeFunction (string functionName, int functionVersion, IntPtr functionPointer);
member this.SetNativeFunction : string * int * nativeint -> unit
Public Sub SetNativeFunction (functionName As String, functionVersion As Integer, functionPointer As IntPtr)

Parameters

functionName
String String String String

The name of the string comparison function to override.

functionVersion
Int32 Int32 Int32 Int32

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

functionPointer
IntPtr IntPtr IntPtr IntPtr

A pointer to the function that overrides functionName.

Exceptions

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.

Security

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

Applies to