1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.uruma.util.win32;
17
18 import java.nio.Buffer;
19
20 import nlink.Holder;
21 import nlink.MarshalAs;
22 import nlink.NativeType;
23 import nlink.win32.CheckLastError;
24 import nlink.win32.DllClass;
25 import nlink.win32.DllMethod;
26
27
28
29
30
31
32 @DllClass
33 public interface Kernel32 {
34
35
36
37
38 static final int SEM_FAILCRITICALERRORS = 0x0001;
39
40
41
42
43 static final int SEM_NOALIGNMENTFAULTEXCEPT = 0x0002;
44
45
46
47
48 static final int SEM_NOGPFAULTERRORBOX = 0x0004;
49
50
51
52
53 static final int SEM_NOOPENFILEERRORBOX = 0x8000;
54
55
56
57
58
59 static final int DRIVE_UNKNOWN = 0;
60
61
62
63
64
65
66 static final int DRIVE_NO_ROOT_DIR = 1;
67
68
69
70
71 static final int DRIVE_REMOVABLE = 2;
72
73
74
75
76 static final int DRIVE_FIXED = 3;
77
78
79
80
81 static final int DRIVE_REMOTE = 4;
82
83
84
85
86 static final int DRIVE_CDROM = 5;
87
88
89
90
91 static final int DRIVE_RAMDISK = 6;
92
93
94
95
96
97 @DllMethod
98 @CheckLastError
99 int GetComputerName(@MarshalAs(NativeType.PVOID)
100 Buffer buffer, @MarshalAs(NativeType.Int32_ByRef)
101 Holder<Integer> size);
102
103
104
105
106
107 @DllMethod
108 @CheckLastError
109 int GetLogicalDrives();
110
111
112
113
114
115 @DllMethod
116 int GetVolumeInformation(String rootPathName, @MarshalAs(NativeType.PVOID)
117 Buffer volumeNameBuffer, int volumeNameSize,
118 @MarshalAs(NativeType.Int32_ByRef)
119 Holder<Integer> volumeSerialNumber,
120 @MarshalAs(NativeType.Int32_ByRef)
121 Holder<Integer> maximumComponentLength,
122 @MarshalAs(NativeType.Int32_ByRef)
123 Holder<Integer> fileSystemFlags, @MarshalAs(NativeType.PVOID)
124 Buffer fileSystemNameBuffer, int fileSystemNameSize);
125
126
127
128
129
130 @DllMethod
131 int GetDriveType(String rootPathName);
132
133
134
135
136
137 @DllMethod
138 @CheckLastError
139 int SetErrorMode(int mode);
140
141
142
143
144
145 @DllMethod
146 @CheckLastError
147 int GetLastError();
148 }