1 18 19 package jcifs.smb; 20 21 abstract class SmbComNtTransaction extends SmbComTransaction { 22 23 private static final int NTT_PRIMARY_SETUP_OFFSET = 69; 25 private static final int NTT_SECONDARY_PARAMETER_OFFSET = 51; 26 27 static final int NT_TRANSACT_QUERY_SECURITY_DESC = 6; 28 29 int function; 30 31 SmbComNtTransaction() { 32 super(); 33 primarySetupOffset = NTT_PRIMARY_SETUP_OFFSET; 34 secondaryParameterOffset = NTT_SECONDARY_PARAMETER_OFFSET; 35 } 36 37 int writeParameterWordsWireFormat( byte[] dst, int dstIndex ) { 38 int start = dstIndex; 39 40 if (command != SMB_COM_NT_TRANSACT_SECONDARY) { 41 dst[dstIndex++] = maxSetupCount; 42 } else { 43 dst[dstIndex++] = (byte)0x00; } 45 dst[dstIndex++] = (byte)0x00; dst[dstIndex++] = (byte)0x00; writeInt4( totalParameterCount, dst, dstIndex ); 48 dstIndex += 4; 49 writeInt4( totalDataCount, dst, dstIndex ); 50 dstIndex += 4; 51 if (command != SMB_COM_NT_TRANSACT_SECONDARY) { 52 writeInt4( maxParameterCount, dst, dstIndex ); 53 dstIndex += 4; 54 writeInt4( maxDataCount, dst, dstIndex ); 55 dstIndex += 4; 56 } 57 writeInt4( parameterCount, dst, dstIndex ); 58 dstIndex += 4; 59 writeInt4(( parameterCount == 0 ? 0 : parameterOffset ), dst, dstIndex ); 60 dstIndex += 4; 61 if (command == SMB_COM_NT_TRANSACT_SECONDARY) { 62 writeInt4( parameterDisplacement, dst, dstIndex ); 63 dstIndex += 4; 64 } 65 writeInt4( dataCount, dst, dstIndex ); 66 dstIndex += 4; 67 writeInt4(( dataCount == 0 ? 0 : dataOffset ), dst, dstIndex ); 68 dstIndex += 4; 69 if (command == SMB_COM_NT_TRANSACT_SECONDARY) { 70 writeInt4( dataDisplacement, dst, dstIndex ); 71 dstIndex += 4; 72 dst[dstIndex++] = (byte)0x00; } else { 74 dst[dstIndex++] = (byte)setupCount; 75 writeInt2( function, dst, dstIndex ); 76 dstIndex += 2; 77 dstIndex += writeSetupWireFormat( dst, dstIndex ); 78 } 79 80 return dstIndex - start; 81 } 82 } 83 | Popular Tags |