/* These characters are illegal in Windows filenames */
static char *illegalChars = "\\/:*?\"<>|";
-BOOL isWindows2000 = FALSE;
int smbShutdownFlag = 0;
int coreProtoIndex;
int v3ProtoIndex;
int NTProtoIndex;
+ int VistaProtoIndex;
int protoIndex; /* index we're using */
int namex;
int dbytes;
coreProtoIndex = -1; /* not found */
v3ProtoIndex = -1;
NTProtoIndex = -1;
+ VistaProtoIndex = -1;
while(namex < dbytes) {
osi_Log1(smb_logp, "Protocol %s",
osi_LogSaveString(smb_logp, namep+1));
else if (smb_useV3 && strcmp("NT LM 0.12", namep+1) == 0) {
NTProtoIndex = tcounter;
}
+ else if (smb_useV3 && strcmp("SMB 2.001", namep+1) == 0) {
+ VistaProtoIndex = tcounter;
+ }
/* compute size of protocol entry */
entryLength = (int)strlen(namep+1);
}
lock_ObtainMutex(&vcp->mx);
+ if (VistaProtoIndex != -1) {
+ protoIndex = VistaProtoIndex;
+ vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3);
+ }
if (NTProtoIndex != -1) {
protoIndex = NTProtoIndex;
vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3);
*tp++ = 'A';
*tp++ = ':';
*tp++ = 0;
- *tp++ = 'N';
- *tp++ = 'T';
+ *tp++ = 'A';
*tp++ = 'F';
*tp++ = 'S';
*tp++ = 0;
- smb_SetSMBDataLength(outp, 8);
+ smb_SetSMBDataLength(outp, 7);
} else {
strcpy(tp, "IPC");
smb_SetSMBDataLength(outp, 4);
nbytesRequired = 22;
else if (infoLevel == SMB_INFO_QUERY_EA_SIZE)
nbytesRequired = 26;
- else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO)
+ else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
+#ifdef COMMENT
nbytesRequired = 40;
- else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO)
- nbytesRequired = 24;
+#else
+ nbytesRequired = 34;
+#endif
+ }
+ else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
+#ifdef COMMENT
+ nbytesRequired = 24;
+#else
+ nbytesRequired = 22;
+#endif
+ }
else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
nbytesRequired = 4;
+#if 0
+ else if (infoLevel == SMB_QUERY_FILE_NAME_INFO)
+ nbytesRequired = ???;
+ else if (infoLevel == SMB_QUERY_FILE_ALL_INFO)
+ nbytesRequired = ???;
+#endif
else if (infoLevel == SMB_QUERY_FILE_ALT_NAME_INFO)
nbytesRequired = 30;
else {
osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
p->opcode, infoLevel);
+#ifdef COMMENT
smb_SendTran2Error(vcp, p, opx, CM_ERROR_INVAL);
+#else
+ smb_SendTran2Error(vcp, p, opx, CM_ERROR_BADOP);
+#endif
return 0;
}
*((u_long *)op) = scp->length.LowPart; op += 4; /* alloc size */
attributes = smb_Attributes(scp);
*((u_short *)op) = attributes; op += 2; /* attributes */
+
+ /* now, if we are being asked about extended attrs, return a 0 size */
+ if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
+ *((u_long *)op) = 0; op += 4;
+ }
}
else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
*((FILETIME *)op) = ft; op += 8; /* last write time */
*((FILETIME *)op) = ft; op += 8; /* last change time */
extAttributes = smb_ExtAttributes(scp);
+#ifdef COMMENT
*((u_long *)op) = extAttributes; op += 4; /* extended attribs */
*((u_long *)op) = 0; op += 4; /* don't know what this is */
+#else
+ /* The CIFS Specs say */
+ *((u_short *)op) = extAttributes; op += 2; /* extended attributes */
+#endif
}
else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
*((LARGE_INTEGER *)op) = scp->length; op += 8; /* alloc size */
*op++ = ((scp->fileType == CM_SCACHETYPE_DIRECTORY ||
scp->fileType == CM_SCACHETYPE_MOUNTPOINT ||
scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0);
+#ifdef COMMENT
*op++ = 0;
*op++ = 0;
+#endif
}
else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
memset(op, 0, 4); op += 4; /* EA size */
}
- /* now, if we are being asked about extended attrs, return a 0 size */
- if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
- *((u_long *)op) = 0; op += 4;
- }
/* send and free the packets */