849
862
http://www.osronline.com/article.cfm?article=245. */
851
in_uint32_le(in, delete_on_close);
853
if (delete_on_close ||
855
accessmask & (FILE_DELETE_ON_CLOSE | FILE_COMPLETE_IF_OPLOCKED)))
864
/* FileDispositionInformation always sets delete_on_close to true.
865
"STREAM in" includes Length(4bytes) , Padding(24bytes) and SetBuffer(zero byte).
866
Length is always set to zero.
867
[MS-RDPEFS] http://msdn.microsoft.com/en-us/library/cc241305%28PROT.10%29.aspx
868
- 2.2.3.3.9 Server Drive Set Information Request
870
in_uint8s(in, 4); /* length of SetBuffer */
871
in_uint8s(in, 24); /* padding */
874
if ((pfinfo->accessmask &
875
(FILE_DELETE_ON_CLOSE | FILE_COMPLETE_IF_OPLOCKED)))
877
/* if file exists in directory , necessary to return RD_STATUS_DIRECTORY_NOT_EMPTY with win2008
878
[MS-RDPEFS] http://msdn.microsoft.com/en-us/library/cc241305%28PROT.10%29.aspx
879
- 2.2.3.3.9 Server Drive Set Information Request
880
- 2.2.3.4.9 Client Drive Set Information Response
881
[MS-FSCC] http://msdn.microsoft.com/en-us/library/cc231987%28PROT.10%29.aspx
882
- 2.4.11 FileDispositionInformation
883
[FSBO] http://msdn.microsoft.com/en-us/library/cc246487%28PROT.13%29.aspx
884
- 4.3.2 Set Delete-on-close using FileDispositionInformation Information Class (IRP_MJ_SET_INFORMATION)
888
DIR *dp = opendir(pfinfo->path);
891
while ((dir = readdir(dp)) != NULL)
893
if (strcmp(dir->d_name, ".") != 0
894
&& strcmp(dir->d_name, "..") != 0)
897
return RD_STATUS_DIRECTORY_NOT_EMPTY;
857
903
pfinfo->delete_on_close = True;
1199
1260
file_attributes |= FILE_ATTRIBUTE_READONLY;
1201
1262
/* Return requested information */
1202
out_uint8s(out, 8); /* unknown zero */
1204
seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
1206
out_uint32_le(out, ft_low); /* create time */
1207
out_uint32_le(out, ft_high);
1209
seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
1210
out_uint32_le(out, ft_low); /* last_access_time */
1211
out_uint32_le(out, ft_high);
1213
seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
1214
out_uint32_le(out, ft_low); /* last_write_time */
1215
out_uint32_le(out, ft_high);
1217
seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
1218
out_uint32_le(out, ft_low); /* change_write_time */
1219
out_uint32_le(out, ft_high);
1221
out_uint32_le(out, filestat.st_size); /* filesize low */
1222
out_uint32_le(out, 0); /* filesize high */
1223
out_uint32_le(out, filestat.st_size); /* filesize low */
1224
out_uint32_le(out, 0); /* filesize high */
1225
out_uint32_le(out, file_attributes);
1226
out_uint8(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
1227
out_uint8s(out, 7); /* pad? */
1228
out_uint8(out, 0); /* 8.3 file length */
1229
out_uint8s(out, 2 * 12); /* 8.3 unicode length */
1230
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
1234
/* FIXME: Support FileDirectoryInformation,
1235
FileFullDirectoryInformation, and
1236
FileNamesInformation */
1263
out_uint32_le(out, 0); /* NextEntryOffset */
1264
out_uint32_le(out, 0); /* FileIndex zero */
1268
unimpl("IRP Query Directory sub: 0x%x\n", info_class);
1269
return RD_STATUS_INVALID_PARAMETER;
1274
case FileBothDirectoryInformation:
1276
seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
1278
out_uint32_le(out, ft_low); /* create time */
1279
out_uint32_le(out, ft_high);
1281
seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
1282
out_uint32_le(out, ft_low); /* last_access_time */
1283
out_uint32_le(out, ft_high);
1285
seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
1286
out_uint32_le(out, ft_low); /* last_write_time */
1287
out_uint32_le(out, ft_high);
1289
seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
1290
out_uint32_le(out, ft_low); /* change_write_time */
1291
out_uint32_le(out, ft_high);
1293
out_uint32_le(out, filestat.st_size); /* filesize low */
1294
out_uint32_le(out, 0); /* filesize high */
1295
out_uint32_le(out, filestat.st_size); /* filesize low */
1296
out_uint32_le(out, 0); /* filesize high */
1297
out_uint32_le(out, file_attributes); /* FileAttributes */
1298
out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
1299
out_uint32_le(out, 0); /* EaSize */
1300
out_uint8(out, 0); /* ShortNameLength */
1301
/* this should be correct according to MS-FSCC specification
1302
but it only works when commented out... */
1303
/* out_uint8(out, 0); *//* Reserved/Padding */
1304
out_uint8s(out, 2 * 12); /* ShortName (8.3 name) */
1305
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
1309
case FileDirectoryInformation:
1311
seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
1313
out_uint32_le(out, ft_low); /* create time */
1314
out_uint32_le(out, ft_high);
1316
seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
1317
out_uint32_le(out, ft_low); /* last_access_time */
1318
out_uint32_le(out, ft_high);
1320
seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
1321
out_uint32_le(out, ft_low); /* last_write_time */
1322
out_uint32_le(out, ft_high);
1324
seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
1325
out_uint32_le(out, ft_low); /* change_write_time */
1326
out_uint32_le(out, ft_high);
1328
out_uint32_le(out, filestat.st_size); /* filesize low */
1329
out_uint32_le(out, 0); /* filesize high */
1330
out_uint32_le(out, filestat.st_size); /* filesize low */
1331
out_uint32_le(out, 0); /* filesize high */
1332
out_uint32_le(out, file_attributes);
1333
out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
1334
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
1338
case FileFullDirectoryInformation:
1340
seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
1342
out_uint32_le(out, ft_low); /* create time */
1343
out_uint32_le(out, ft_high);
1345
seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
1346
out_uint32_le(out, ft_low); /* last_access_time */
1347
out_uint32_le(out, ft_high);
1349
seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
1350
out_uint32_le(out, ft_low); /* last_write_time */
1351
out_uint32_le(out, ft_high);
1353
seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
1354
out_uint32_le(out, ft_low); /* change_write_time */
1355
out_uint32_le(out, ft_high);
1357
out_uint32_le(out, filestat.st_size); /* filesize low */
1358
out_uint32_le(out, 0); /* filesize high */
1359
out_uint32_le(out, filestat.st_size); /* filesize low */
1360
out_uint32_le(out, 0); /* filesize high */
1361
out_uint32_le(out, file_attributes);
1362
out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
1363
out_uint32_le(out, 0); /* EaSize */
1364
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
1368
case FileNamesInformation:
1370
out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
1371
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
1238
1377
unimpl("IRP Query Directory sub: 0x%x\n", info_class);
1239
1378
return RD_STATUS_INVALID_PARAMETER;