KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > coi > tools > os > win > MSWinConstants


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2006 Klaus Bartz
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.coi.tools.os.win;
23
24
25 /**
26  * Constants related to MS Windows DACLs.
27  * @author Klaus Bartz
28  *
29  */

30 public interface MSWinConstants
31 {
32     /*
33      * Registry root values, extracted from winreg.h
34      */

35     /** HKCR registry root */
36     static final int HKEY_CLASSES_ROOT = 0x80000000;
37
38     /** HKCU registry root */
39     static final int HKEY_CURRENT_USER = 0x80000001;
40
41     /** HKLM registry root */
42     static final int HKEY_LOCAL_MACHINE = 0x80000002;
43
44     /** HKU registry root */
45     static final int HKEY_USERS = 0x80000003;
46
47     /** HKPD registry root */
48     static final int HKEY_PERFORMANCE_DATA = 0x80000004;
49
50     /** HKCC registry root */
51     static final int HKEY_CURRENT_CONFIG = 0x80000005;
52
53     /** HKDD registry root */
54     static final int HKEY_DYN_DATA = 0x80000006;
55
56     /*
57      * Registry value types, extracted from winnt.h
58      */

59     /** No value type */
60     static final int REG_NONE = 0;
61
62     /** Unicode nul terminated string */
63     static final int REG_SZ = 1;
64
65     /** Unicode nul terminated string */
66     static final int REG_EXPAND_SZ = 2;
67
68     /** Free form binary */
69     static final int REG_BINARY = 3;
70
71     /** 32-bit number */
72     static final int REG_DWORD = 4;
73
74     /** Symbolic Link (unicode) */
75     static final int REG_LINK = 6;
76
77     /** Multiple Unicode strings */
78     static final int REG_MULTI_SZ = 7;
79
80    //
81
// Define access rights to files and directories
82
// Copied from winnt.h BUILD Version: 0095
83

84     /** Flag for permission read file or pipe date. */
85     static final int FILE_READ_DATA = 0x0001; // file & pipe
86

87     /** Flag for permission list contents of a directory. */
88     static final int FILE_LIST_DIRECTORY = 0x0001; // directory
89

90     /** Flag for permission write file or pipe data. */
91     static final int FILE_WRITE_DATA = 0x0002; // file & pipe
92

93     /** Flag for permission add a file to a directory. */
94     static final int FILE_ADD_FILE = 0x0002; // directory
95

96     /** Flag for permission add data to a file (append). */
97     static final int FILE_APPEND_DATA = 0x0004; // file
98

99     /** Flag for permission add a subdirectory to a directory. */
100     static final int FILE_ADD_SUBDIRECTORY = 0x0004; // directory
101

102     /** Flag for permission create a named pipe. */
103     static final int FILE_CREATE_PIPE_INSTANCE = 0x0004; // named pipe
104

105     /** Flag for permission read. */
106     static final int FILE_READ_EA = 0x0008; // file & directory
107

108     /** Flag for permission write. */
109     static final int FILE_WRITE_EA = 0x0010; // file & directory
110

111     /** Flag for permission execute a file. */
112     static final int FILE_EXECUTE = 0x0020; // file
113

114     /** Flag for permission traverse through a directory. */
115     static final int FILE_TRAVERSE = 0x0020; // directory
116

117     /** Flag for permission delete a file or subdirectory in a directory. */
118     static final int FILE_DELETE_CHILD = 0x0040; // directory
119

120     /** Flag for permission all read attributes. */
121     static final int FILE_READ_ATTRIBUTES = 0x0080; // all
122

123     /** Flag for permission all write attributes. */
124     static final int FILE_WRITE_ATTRIBUTES = 0x0100; // all
125

126     /** Flag for permission delete. */
127     static final int DELETE = 0x00010000;
128
129     /** Flag for permission read. */
130     static final int READ_CONTROL = 0x00020000;
131
132     /** Flag for permission write a DAC. */
133     static final int WRITE_DAC = 0x00040000;
134
135     /** Flag for permission set owner. */
136     static final int WRITE_OWNER = 0x00080000;
137
138     /** Flag for permission use synchronize. */
139     static final int SYNCHRONIZE = 0x00100000;
140
141     /** Flag for permission standard rights for required. */
142     static final int STANDARD_RIGHTS_REQUIRED = 0x000F0000;
143
144     /** Flag for permission standard rights for read. */
145     static final int STANDARD_RIGHTS_READ = 0x00020000; // original READ_CONTROL
146

147     /** Flag for permission standard rights for write. */
148     static final int STANDARD_RIGHTS_WRITE = 0x00020000; // original READ_CONTROL
149

150     /** Flag for permission standard rights for execute. */
151     static final int STANDARD_RIGHTS_EXECUTE = 0x00020000; // original READ_CONTROL
152

153     /** Flag for permission all standard rights. */
154     static final int STANDARD_RIGHTS_ALL = 0x001F0000;
155
156     /** Flag for permission all specific rights. */
157     static final int SPECIFIC_RIGHTS_ALL = 0x0000FFFF;
158
159     /** Flag for permission STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF. */
160     static final int FILE_ALL_ACCESS = 0x001F03FF;
161
162     /** Flag for permission generic read. */
163     static final int FILE_GENERIC_READ = 0x00120089;
164
165     // #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\
166
// FILE_WRITE_DATA |\
167
// FILE_WRITE_ATTRIBUTES |\
168
// FILE_WRITE_EA |\
169
// FILE_APPEND_DATA |\
170
// SYNCHRONIZE)
171

172     /** Flag for permission generic write. */
173     static final int FILE_GENERIC_WRITE = 0x00120116;
174
175     // #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
176
// FILE_READ_ATTRIBUTES |\
177
// FILE_EXECUTE |\
178
// SYNCHRONIZE)
179
/** Flag for permission generic execute. */
180     static final int FILE_GENERIC_EXECUTE = 0x001200A0;
181
182     //
183
// AccessSystemAcl access type
184
//
185

186     /** Flag for permission all specific rights. */
187     static final int ACCESS_SYSTEM_SECURITY = 0x01000000;
188
189     //
190
// MaximumAllowed access type
191
//
192

193     /**
194      * Flag for NT permissions: For more information see the Windows NT description for permisson
195      * flags.
196      */

197     static final int MAXIMUM_ALLOWED = 0x02000000;
198
199     //
200
// These are the generic rights.
201
//
202

203     /**
204      * Flag for NT permissions: For more information see the Windows NT description for permisson
205      * flags.
206      */

207     static final int GENERIC_READ = 0x80000000; // may be a problem with int ...
208

209     /**
210      * Flag for NT permissions: For more information see the Windows NT description for permisson
211      * flags.
212      */

213     static final int GENERIC_WRITE = 0x40000000;
214
215     /**
216      * Flag for NT permissions: For more information see the Windows NT description for permisson
217      * flags.
218      */

219     static final int GENERIC_EXECUTE = 0x20000000;
220
221     /**
222      * Flag for NT permissions: For more information see the Windows NT description for permisson
223      * flags.
224      */

225     static final int GENERIC_ALL = 0x10000000;
226
227     /**
228      * Flag for NT permissions: For more information see the Windows NT description for permisson
229      * flags.
230      */

231     static final int FILE_CASE_SENSITIVE_SEARCH = 0x00000001;
232
233     /**
234      * Flag for NT permissions: For more information see the Windows NT description for permisson
235      * flags.
236      */

237     static final int FILE_CASE_PRESERVED_NAMES = 0x00000002;
238
239     /**
240      * Flag for NT permissions: For more information see the Windows NT description for permisson
241      * flags.
242      */

243     static final int FILE_UNICODE_ON_DISK = 0x00000004;
244
245     /**
246      * Flag for NT permissions: For more information see the Windows NT description for permisson
247      * flags.
248      */

249     static final int FILE_PERSISTENT_ACLS = 0x00000008;
250
251     /**
252      * Flag for NT permissions: For more information see the Windows NT description for permisson
253      * flags.
254      */

255     static final int FILE_FILE_COMPRESSION = 0x00000010;
256
257     /**
258      * Flag for NT permissions: For more information see the Windows NT description for permisson
259      * flags.
260      */

261     static final int FILE_VOLUME_QUOTAS = 0x00000020;
262
263     /**
264      * Flag for NT permissions: For more information see the Windows NT description for permisson
265      * flags.
266      */

267     static final int FILE_SUPPORTS_SPARSE_FILES = 0x00000040;
268
269     /**
270      * Flag for NT permissions: For more information see the Windows NT description for permisson
271      * flags.
272      */

273     static final int FILE_SUPPORTS_REPARSE_POINTS = 0x00000080;
274
275     /**
276      * Flag for NT permissions: For more information see the Windows NT description for permisson
277      * flags.
278      */

279     static final int FILE_SUPPORTS_REMOTE_STORAGE = 0x00000100;
280
281     /**
282      * Flag for NT permissions: For more information see the Windows NT description for permisson
283      * flags.
284      */

285     static final int FILE_VOLUME_IS_COMPRESSED = 0x00008000;
286
287     /**
288      * Flag for NT permissions: For more information see the Windows NT description for permisson
289      * flags.
290      */

291     static final int FILE_SUPPORTS_OBJECT_IDS = 0x00010000;
292
293     /**
294      * Flag for NT permissions: For more information see the Windows NT description for permisson
295      * flags.
296      */

297     static final int FILE_SUPPORTS_ENCRYPTION = 0x00020000;
298
299
300 }
301
Popular Tags