X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsecurity-manager.c;h=0dfb927bc29eeae095980873a14a68a4990dc9e3;hb=6d37ffdf534eae04a5d06b2e097762bd64fc0591;hp=967cf6fd32068ad7a4b1b90c645deb811cb8a049;hpb=468225a247b8897b2a4fa1e6bd7ffa32aa8c243b;p=mono.git diff --git a/mono/metadata/security-manager.c b/mono/metadata/security-manager.c index 967cf6fd320..0dfb927bc29 100644 --- a/mono/metadata/security-manager.c +++ b/mono/metadata/security-manager.c @@ -5,10 +5,15 @@ * Sebastien Pouliot * * Copyright 2005-2009 Novell, Inc (http://www.novell.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "security-manager.h" +/* Class lazy loading functions */ +static GENERATE_GET_CLASS_WITH_CACHE (security_manager, System.Security, SecurityManager) +static GENERATE_TRY_GET_CLASS_WITH_CACHE (execution_context, System.Threading, ExecutionContext) + static MonoSecurityMode mono_security_mode = MONO_SECURITY_MODE_NONE; void @@ -35,9 +40,7 @@ mono_security_manager_get_methods (void) return &secman; /* Initialize */ - secman.securitymanager = mono_class_from_name (mono_defaults.corlib, - "System.Security", "SecurityManager"); - g_assert (secman.securitymanager); + secman.securitymanager = mono_class_get_security_manager_class (); if (!secman.securitymanager->inited) mono_class_init (secman.securitymanager); @@ -95,9 +98,10 @@ mono_get_context_capture_method (void) return NULL; /* older corlib revisions won't have the class (nor the method) */ - if (mono_defaults.executioncontext_class && !method) { - mono_class_init (mono_defaults.executioncontext_class); - method = mono_class_get_method_from_name (mono_defaults.executioncontext_class, "Capture", 0); + MonoClass *execution_context = mono_class_try_get_execution_context_class (); + if (execution_context && !method) { + mono_class_init (execution_context); + method = mono_class_get_method_from_name (execution_context, "Capture", 0); } return method;