KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcifs > smb > NtTransQuerySecurityDesc


1 /* jcifs smb client library in Java
2  * Copyright (C) 2005 "Michael B. Allen" <jcifs at samba dot org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package jcifs.smb;
20
21 import jcifs.util.Hexdump;
22
23 class NtTransQuerySecurityDesc extends SmbComNtTransaction {
24
25     int fid;
26     int securityInformation;
27
28     NtTransQuerySecurityDesc( int fid, int securityInformation ) {
29         this.fid = fid;
30         this.securityInformation = securityInformation;
31         command = SMB_COM_NT_TRANSACT;
32         function = NT_TRANSACT_QUERY_SECURITY_DESC;
33         setupCount = 0;
34         totalDataCount = 0;
35         maxParameterCount = 4;
36         maxDataCount = 32768;
37         maxSetupCount = (byte)0x00;
38     }
39
40     int writeSetupWireFormat( byte[] dst, int dstIndex ) {
41         return 0;
42     }
43     int writeParametersWireFormat( byte[] dst, int dstIndex ) {
44         int start = dstIndex;
45
46         writeInt2( fid, dst, dstIndex );
47         dstIndex += 2;
48         dst[dstIndex++] = (byte)0x00; // Reserved
49
dst[dstIndex++] = (byte)0x00; // Reserved
50
writeInt4( securityInformation, dst, dstIndex );
51         dstIndex += 4;
52
53         return dstIndex - start;
54     }
55     int writeDataWireFormat( byte[] dst, int dstIndex ) {
56         return 0;
57     }
58     int readSetupWireFormat( byte[] buffer, int bufferIndex, int len ) {
59         return 0;
60     }
61     int readParametersWireFormat( byte[] buffer, int bufferIndex, int len ) {
62         return 0;
63     }
64     int readDataWireFormat( byte[] buffer, int bufferIndex, int len ) {
65         return 0;
66     }
67     public String JavaDoc toString() {
68         return new String JavaDoc( "NtTransGetSecurityDesc[" + super.toString() +
69             ",fid=0x" + Hexdump.toHexString( fid, 4 ) +
70             ",securityInformation=0x" + Hexdump.toHexString( securityInformation, 8 ) + "]" );
71     }
72 }
73
Popular Tags