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;
34 using System.Reflection.Emit;
35 using System.Globalization;
36 using System.Runtime.Remoting;
37 using System.Runtime.InteropServices;
42 [CLSCompliant (false)]
43 [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
44 [Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
45 public interface _AppDomain
48 string BaseDirectory {get; }
49 string DynamicDirectory {get; }
50 Evidence Evidence {get; }
52 string FriendlyName {get; }
54 string RelativeSearchPath {get; }
55 bool ShadowCopyFiles {get; }
57 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
58 void AppendPrivatePath (string path);
60 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
61 void ClearPrivatePath ();
63 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
64 void ClearShadowCopyPath ();
68 ObjectHandle CreateInstance (string assemblyName, string typeName);
69 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
70 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
71 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
72 object[] activationAttributes, Evidence securityAttributes);
74 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
75 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
76 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
77 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
78 object[] activationAttributes, Evidence securityAttributes);
80 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
81 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
82 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
83 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
84 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
85 PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
86 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
87 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
88 PermissionSet refusedPermissions);
89 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
90 string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
91 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
92 string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
93 PermissionSet refusedPermissions);
94 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
95 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
96 PermissionSet refusedPermissions, bool isSynchronized);
98 void DoCallBack (CrossAppDomainDelegate theDelegate);
99 bool Equals (object other);
101 int ExecuteAssembly (string assemblyFile);
102 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
103 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
105 Assembly[] GetAssemblies ();
106 object GetData (string name);
110 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
113 object GetLifetimeService ();
119 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
120 object InitializeLifetimeService ();
123 Assembly Load (AssemblyName assemblyRef);
124 Assembly Load (byte[] rawAssembly);
125 Assembly Load (string assemblyString);
126 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
127 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
128 Assembly Load (string assemblyString, Evidence assemblySecurity);
129 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
132 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
133 void SetAppDomainPolicy (PolicyLevel domainPolicy);
135 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
136 void SetCachePath (string s);
139 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
140 void SetData (string name, object data);
143 void SetPrincipalPolicy (PrincipalPolicy policy);
145 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
146 void SetShadowCopyPath (string s);
148 void SetThreadPrincipal (IPrincipal principal);
153 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
154 event AssemblyLoadEventHandler AssemblyLoad;
156 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
157 event ResolveEventHandler AssemblyResolve;
159 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
160 event EventHandler DomainUnload;
162 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
163 event EventHandler ProcessExit;
165 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
166 event ResolveEventHandler ResourceResolve;
168 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
169 event ResolveEventHandler TypeResolve;
171 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
172 event UnhandledExceptionEventHandler UnhandledException;
175 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
177 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
179 void GetTypeInfoCount (out uint pcTInfo);
181 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
182 IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);