5 // Duco Fijma (duco@lorentz.xs4all.nl)
7 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System.Security;
30 using System.Security.Permissions;
31 using System.Security.Policy;
32 using System.Security.Principal;
33 using System.Reflection;
35 using System.Reflection.Emit;
37 using System.Globalization;
38 using System.Runtime.Remoting;
39 using System.Runtime.InteropServices;
44 [CLSCompliant (false)]
45 [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
46 [Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
47 public interface _AppDomain
49 string BaseDirectory {get; }
50 string DynamicDirectory {get; }
51 Evidence Evidence {get; }
52 string FriendlyName {get; }
53 string RelativeSearchPath {get; }
54 bool ShadowCopyFiles {get; }
56 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
57 void AppendPrivatePath (string path);
59 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
60 void ClearPrivatePath ();
62 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
63 void ClearShadowCopyPath ();
65 ObjectHandle CreateInstance (string assemblyName, string typeName);
66 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
67 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
68 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
69 object[] activationAttributes, Evidence securityAttributes);
71 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
72 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
73 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
74 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
75 object[] activationAttributes, Evidence securityAttributes);
78 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
79 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
80 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
81 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
82 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
83 PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
84 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
85 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
86 PermissionSet refusedPermissions);
87 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
88 string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
89 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
90 string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
91 PermissionSet refusedPermissions);
92 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
93 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
94 PermissionSet refusedPermissions, bool isSynchronized);
97 void DoCallBack (CrossAppDomainDelegate theDelegate);
98 bool Equals (object other);
100 int ExecuteAssembly (string assemblyFile);
101 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
102 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
104 Assembly[] GetAssemblies ();
105 object GetData (string name);
109 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
111 object GetLifetimeService ();
115 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
116 object InitializeLifetimeService ();
118 Assembly Load (AssemblyName assemblyRef);
119 Assembly Load (byte[] rawAssembly);
120 Assembly Load (string assemblyString);
121 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
122 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
123 Assembly Load (string assemblyString, Evidence assemblySecurity);
124 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
126 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
127 void SetAppDomainPolicy (PolicyLevel domainPolicy);
129 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
130 void SetCachePath (string s);
132 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
133 void SetData (string name, object data);
135 void SetPrincipalPolicy (PrincipalPolicy policy);
137 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
138 void SetShadowCopyPath (string s);
140 void SetThreadPrincipal (IPrincipal principal);
144 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
145 event AssemblyLoadEventHandler AssemblyLoad;
147 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
148 event ResolveEventHandler AssemblyResolve;
150 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
151 event EventHandler DomainUnload;
153 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
154 event EventHandler ProcessExit;
156 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
157 event ResolveEventHandler ResourceResolve;
159 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
160 event ResolveEventHandler TypeResolve;
162 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
163 event UnhandledExceptionEventHandler UnhandledException;
166 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
168 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
170 void GetTypeInfoCount (out uint pcTInfo);
172 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
173 IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);