blob: 4bd1176e33727805d83debf2697632cc7ed6acad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet (CharSet.Unicode)]
struct foo1 {
}
enum E {
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct foo2 {
}
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate void D ();
class C {
public class CC {
}
}
class Program {
[DllImport("bah")]
public static extern void test ();
static int Main ()
{
DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute;
if (dia == null)
return 1;
if (dia.CharSet != CharSet.Unicode)
return 2;
if (!typeof (C).IsUnicodeClass )
return 3;
if (!typeof (C.CC).IsUnicodeClass )
return 4;
if (!typeof (D).IsUnicodeClass )
return 5;
if (!typeof (E).IsUnicodeClass )
return 6;
if (!typeof (foo1).IsUnicodeClass )
return 7;
if (!typeof (foo2).IsAutoClass )
return 8;
return 0;
}
}
|