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
47 string BaseDirectory {get; }
48 string DynamicDirectory {get; }
49 Evidence Evidence {get; }
50 string FriendlyName {get; }
51 string RelativeSearchPath {get; }
52 bool ShadowCopyFiles {get; }
54 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
55 void AppendPrivatePath (string path);
57 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
58 void ClearPrivatePath ();
60 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
61 void ClearShadowCopyPath ();
63 ObjectHandle CreateInstance (string assemblyName, string typeName);
64 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
65 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
66 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
67 object[] activationAttributes, Evidence securityAttributes);
69 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
70 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
71 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
72 BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
73 object[] activationAttributes, Evidence securityAttributes);
75 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
76 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
77 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
78 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
79 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
80 PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
81 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
82 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
83 PermissionSet refusedPermissions);
84 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
85 string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
86 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
87 string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
88 PermissionSet refusedPermissions);
89 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
90 Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
91 PermissionSet refusedPermissions, bool isSynchronized);
93 void DoCallBack (CrossAppDomainDelegate theDelegate);
94 bool Equals (object other);
96 int ExecuteAssembly (string assemblyFile);
97 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
98 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
100 Assembly[] GetAssemblies ();
101 object GetData (string name);
105 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
107 object GetLifetimeService ();
111 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
112 object InitializeLifetimeService ();
114 Assembly Load (AssemblyName assemblyRef);
115 Assembly Load (byte[] rawAssembly);
116 Assembly Load (string assemblyString);
117 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
118 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
119 Assembly Load (string assemblyString, Evidence assemblySecurity);
120 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
122 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
123 void SetAppDomainPolicy (PolicyLevel domainPolicy);
125 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
126 void SetCachePath (string s);
128 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
129 void SetData (string name, object data);
131 void SetPrincipalPolicy (PrincipalPolicy policy);
133 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
134 void SetShadowCopyPath (string s);
136 void SetThreadPrincipal (IPrincipal principal);
139 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
140 event AssemblyLoadEventHandler AssemblyLoad;
142 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
143 event ResolveEventHandler AssemblyResolve;
145 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
146 event EventHandler DomainUnload;
148 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
149 event EventHandler ProcessExit;
151 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
152 event ResolveEventHandler ResourceResolve;
154 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
155 event ResolveEventHandler TypeResolve;
157 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
158 event UnhandledExceptionEventHandler UnhandledException;
160 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
162 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
164 void GetTypeInfoCount (out uint pcTInfo);
166 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
167 IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);