[appletls]: Make CFObject.dlsym() private and fix CFBoolean. (#4640)
authorMartin Baulig <mabaul@microsoft.com>
Tue, 4 Apr 2017 18:28:17 +0000 (14:28 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2017 18:28:17 +0000 (14:28 -0400)
This fixes a native crash when attempting to use appletls.

mcs/class/System/System.Net/MacProxy.cs

index 69b4133226bb0834e49955797829d1a81deb5d43..bd2cdc10b9876881f10ee913c5dac33e576bc6de 100644 (file)
@@ -47,7 +47,7 @@ namespace Mono.Net
                public static extern IntPtr dlopen (string path, int mode);
 
                [DllImport (SystemLibrary)]
-               public static extern IntPtr dlsym (IntPtr handle, string symbol);
+               static extern IntPtr dlsym (IntPtr handle, string symbol);
 
                [DllImport (SystemLibrary)]
                public static extern void dlclose (IntPtr handle);
@@ -1249,8 +1249,8 @@ namespace Mono.Net
                        if (handle == IntPtr.Zero)
                                return;
                        try {
-                               True  = new CFBoolean (CFObject.dlsym (handle, "kCFBooleanTrue"), false);
-                               False = new CFBoolean (CFObject.dlsym (handle, "kCFBooleanFalse"), false);
+                               True  = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanTrue"), false);
+                               False = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanFalse"), false);
                        }
                        finally {
                                CFObject.dlclose (handle);