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
50 string BaseDirectory {get; }
51 string DynamicDirectory {get; }
52 Evidence Evidence {get; }
54 string FriendlyName {get; }
56 string RelativeSearchPath {get; }
57 bool ShadowCopyFiles {get; }
59 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
60 void AppendPrivatePath (string path);
62 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
63 void ClearPrivatePath ();
65 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
66 void ClearShadowCopyPath ();
70 ObjectHandle CreateInstance (string assemblyName, string typeName);
71 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
72 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
73 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
74 object[] activationAttributes, Evidence securityAttributes);
76 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
77 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
78 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
79 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
80 object[] activationAttributes, Evidence securityAttributes);
84 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
85 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
86 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
87 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
88 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
89 PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
90 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
91 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
92 PermissionSet refusedPermissions);
93 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
94 string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
95 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
96 string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
97 PermissionSet refusedPermissions);
98 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
99 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
100 PermissionSet refusedPermissions, bool isSynchronized);
103 void DoCallBack (CrossAppDomainDelegate theDelegate);
104 bool Equals (object other);
106 int ExecuteAssembly (string assemblyFile);
107 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
108 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
110 Assembly[] GetAssemblies ();
111 object GetData (string name);
115 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
118 object GetLifetimeService ();
124 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
125 object InitializeLifetimeService ();
128 Assembly Load (AssemblyName assemblyRef);
129 Assembly Load (byte[] rawAssembly);
130 Assembly Load (string assemblyString);
131 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
132 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
133 Assembly Load (string assemblyString, Evidence assemblySecurity);
134 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
137 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
138 void SetAppDomainPolicy (PolicyLevel domainPolicy);
140 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
141 void SetCachePath (string s);
144 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
145 void SetData (string name, object data);
148 void SetPrincipalPolicy (PrincipalPolicy policy);
150 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
151 void SetShadowCopyPath (string s);
153 void SetThreadPrincipal (IPrincipal principal);
158 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
159 event AssemblyLoadEventHandler AssemblyLoad;
161 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
162 event ResolveEventHandler AssemblyResolve;
164 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
165 event EventHandler DomainUnload;
167 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
168 event EventHandler ProcessExit;
170 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
171 event ResolveEventHandler ResourceResolve;
173 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
174 event ResolveEventHandler TypeResolve;
176 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
177 event UnhandledExceptionEventHandler UnhandledException;
180 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
182 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
184 void GetTypeInfoCount (out uint pcTInfo);
186 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
187 IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);