36#define ATOMIC_CREATE_ECP_IN_FLAG_REPARSE_POINT_SPECIFIED 0x0002
37#define ATOMIC_CREATE_ECP_IN_FLAG_OP_FLAGS_SPECIFIED 0x0080
38#define ATOMIC_CREATE_ECP_IN_FLAG_BEST_EFFORT 0x0100
40#define ATOMIC_CREATE_ECP_OUT_FLAG_REPARSE_POINT_SET 0x0002
41#define ATOMIC_CREATE_ECP_OUT_FLAG_OP_FLAGS_HONORED 0x0080
43#define ATOMIC_CREATE_ECP_IN_OP_FLAG_CASE_SENSITIVE_FLAGS_SPECIFIED 1
44#define ATOMIC_CREATE_ECP_OUT_OP_FLAG_CASE_SENSITIVE_FLAGS_SET 1
46#ifndef SL_IGNORE_READONLY_ATTRIBUTE
47#define SL_IGNORE_READONLY_ATTRIBUTE 0x40
79static const GUID GUID_ECP_ATOMIC_CREATE = { 0x4720bd83, 0x52ac, 0x4104, { 0xa1, 0x30, 0xd1, 0xec, 0x6a, 0x8c, 0xc8, 0xe5 } };
80static const GUID GUID_ECP_QUERY_ON_CREATE = { 0x1aca62e9, 0xabb4, 0x4ff2, { 0xbb, 0x5c, 0x1c, 0x79, 0x02, 0x5e, 0x41, 0x7f } };
81static const GUID GUID_ECP_CREATE_REDIRECTION = { 0x188d6bd6, 0xa126, 0x4fa8, { 0xbd, 0xf2, 0x1c, 0xcd, 0xf8, 0x96, 0xf3, 0xe0 } };
97 ERR(
"out of memory\n");
101 fcb = ExAllocateFromPagedLookasideList(&
Vcb->fcb_lookaside);
103 ERR(
"out of memory\n");
108#ifdef DEBUG_FCB_REFCOUNTS
109 WARN(
"allocating fcb %p\n",
fcb);
117 fcb->
nonpaged = ExAllocateFromNPagedLookasideList(&
Vcb->fcb_np_lookaside);
119 ERR(
"out of memory\n");
124 ExFreeToPagedLookasideList(&
Vcb->fcb_lookaside,
fcb);
137#ifdef DEBUG_FCB_REFCOUNTS
163 fr = ExAllocateFromPagedLookasideList(&
Vcb->fileref_lookaside);
165 ERR(
"out of memory\n");
173#ifdef DEBUG_FCB_REFCOUNTS
174 WARN(
"fileref %p: refcount now 1\n", fr);
194 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
230 le2 =
fcb->
Vcb->roots.Flink;
231 while (le2 != &
fcb->
Vcb->roots) {
234 if (
r2->id ==
dc->key.obj_id) {
253 }
else if (
dc->hash >
hash) {
270 if (
dc->hash_uc ==
hash) {
277 le2 =
fcb->
Vcb->roots.Flink;
278 while (le2 != &
fcb->
Vcb->roots) {
281 if (
r2->id ==
dc->key.obj_id) {
300 }
else if (
dc->hash_uc >
hash) {
332 if (
len == 0 || (
path->Buffer[
len - 1] ==
'/' ||
path->Buffer[
len - 1] ==
'\\')) {
333 WARN(
"zero-length filename part\n");
338 for (
i = 0;
i <
len;
i++) {
339 if (
path->Buffer[
i] ==
'/' ||
path->Buffer[
i] ==
'\\') {
341 }
else if (
path->Buffer[
i] ==
':') {
348 for (
i = 0;
i <
len;
i++) {
349 if (
path->Buffer[
i] ==
'/' ||
path->Buffer[
i] ==
'\\') {
350 if (
buf[0] ==
'/' ||
buf[0] ==
'\\') {
351 WARN(
"zero-length filename part\n");
356 nb = ExAllocateFromPagedLookasideList(&
Vcb->name_bit_lookaside);
358 ERR(
"out of memory\n");
371 nb = ExAllocateFromPagedLookasideList(&
Vcb->name_bit_lookaside);
373 ERR(
"out of memory\n");
383 static const WCHAR datasuf[] = {
':',
'$',
'D',
'A',
'T',
'A',0};
394 WARN(
"zero-length stream name\n");
399 nb2 = ExAllocateFromPagedLookasideList(&
Vcb->name_bit_lookaside);
401 ERR(
"out of memory\n");
426 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb);
433 if (has_stream &&
path->Length >=
sizeof(
WCHAR) &&
path->Buffer[0] ==
':') {
436 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb1);
447 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb);
467 ERR(
"error - find_item returned %08lx\n",
Status);
476 if (start < tp.item->
key.offset)
482 ERR(
"checksum not found for %I64x\n",
start + (
i <<
Vcb->sector_shift));
503 ERR(
"could not read checksums: offset %I64x, length %I64x sectors\n",
start,
length);
514 ULONG num_children = 0;
519 ERR(
"out of memory\n");
527 ERR(
"out of memory\n");
542 ERR(
"find_item returned %08lx\n",
Status);
570 ERR(
"utf8_to_utf16 1 returned %08lx\n",
Status);
576 ERR(
"out of memory\n");
584 dc->root_dir =
false;
586 max_index =
dc->index;
588 dc->utf8.MaximumLength =
dc->utf8.Length = di->
n;
590 if (!
dc->utf8.Buffer) {
591 ERR(
"out of memory\n");
598 dc->name.MaximumLength =
dc->name.Length = (
uint16_t)utf16len;
600 if (!
dc->name.Buffer) {
601 ERR(
"out of memory\n");
609 ERR(
"utf8_to_utf16 2 returned %08lx\n",
Status);
618 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
644 if (
Vcb->root_fileref &&
Vcb->root_fileref->fcb)
645 top_subvol =
Vcb->root_fileref->fcb->subvol;
652 ERR(
"out of memory\n");
659 dc->index = max_index + 1;
664 dc->utf8.MaximumLength =
dc->utf8.Length =
sizeof(
root_dir) -
sizeof(
char);
666 if (!
dc->utf8.Buffer) {
667 ERR(
"out of memory\n");
676 if (!
dc->name.Buffer) {
677 ERR(
"out of memory\n");
687 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
712 bool atts_set =
false, sd_set =
false, no_data;
720 acquire_fcb_lock_shared(
Vcb);
725 while (le != &
subvol->fcbs) {
733#ifdef DEBUG_FCB_REFCOUNTS
742 release_fcb_lock(
Vcb);
750 release_fcb_lock(
Vcb);
764 release_fcb_lock(
Vcb);
774 ERR(
"out of memory\n");
787 searchkey.
offset = 0xffffffffffffffff;
791 ERR(
"error - find_item returned %08lx\n",
Status);
797 WARN(
"couldn't find INODE_ITEM for inode %I64x in subvol %I64x\n",
inode,
subvol->id);
846 ERR(
"out of memory\n");
863 ERR(
"utf8_to_utf16 1 returned %08lx\n",
Status);
877 ERR(
"out of memory\n");
885 ERR(
"utf8_to_utf16 2 returned %08lx\n",
Status);
911 ERR(
"out of memory\n");
928 ERR(
"utf8_to_utf16 1 returned %08lx\n",
Status);
942 ERR(
"out of memory\n");
950 ERR(
"utf8_to_utf16 2 returned %08lx\n",
Status);
967 static const char xapref[] =
"user.";
985 ERR(
"out of memory\n");
1002 WARN(
"IoCheckEaBufferValidity returned %08lx (error at offset %lu)\n",
Status,
offset);
1008 ERR(
"out of memory\n");
1033 if (get_file_attributes_from_xattr(&di->name[di->n], di->m, &
fcb->
atts)) {
1042 fcb->
atts &= ~FILE_ATTRIBUTE_DIRECTORY;
1048 fcb->
atts &= ~FILE_ATTRIBUTE_READONLY;
1056 ERR(
"out of memory\n");
1072 static const char lzo[] =
"lzo";
1073 static const char zlib[] =
"zlib";
1074 static const char zstd[] =
"zstd";
1076 if (di->m ==
sizeof(lzo) - 1 &&
RtlCompareMemory(&di->name[di->n], lzo, di->m) == di->m)
1078 else if (di->m ==
sizeof(zlib) - 1 &&
RtlCompareMemory(&di->name[di->n], zlib, di->m) == di->m)
1080 else if (di->m ==
sizeof(zstd) - 1 &&
RtlCompareMemory(&di->name[di->n], zstd, di->m) == di->m)
1090 }
else if (di->n >
sizeof(xapref) - 1 &&
RtlCompareMemory(xapref, di->name,
sizeof(xapref) - 1) ==
sizeof(xapref) - 1) {
1096 ERR(
"utf8_to_utf16 1 returned %08lx\n",
Status);
1103 ERR(
"out of memory\n");
1110 dc->utf8.MaximumLength =
dc->utf8.Length = di->n + 1 -
sizeof(xapref);
1112 if (!
dc->utf8.Buffer) {
1113 ERR(
"out of memory\n");
1121 dc->name.MaximumLength =
dc->name.Length = (
uint16_t)utf16len;
1123 if (!
dc->name.Buffer) {
1124 ERR(
"out of memory\n");
1133 ERR(
"utf8_to_utf16 2 returned %08lx\n",
Status);
1143 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
1159 ERR(
"out of memory\n");
1213 ERR(
"out of memory\n");
1222 ext->ignore =
false;
1223 ext->inserted =
false;
1233 ERR(
"load_dir_children returned %08lx\n",
Status);
1240 fcb->
Header.AllocationSize.QuadPart = 0;
1242 fcb->
Header.ValidDataLength.QuadPart = 0;
1259 acquire_fcb_lock_exclusive(
Vcb);
1272 while (le != &
subvol->fcbs) {
1280#ifdef DEBUG_FCB_REFCOUNTS
1283 WARN(
"fcb %p: refcount now %i (subvol %I64x, inode %I64x)\n", fcb2, rc, fcb2->
subvol->id, fcb2->
inode);
1290 release_fcb_lock(
Vcb);
1297 *pfcb = deleted_fcb;
1299 release_fcb_lock(
Vcb);
1312 fcb->
atts &= ~FILE_ATTRIBUTE_REPARSE_POINT;
1328 lastle =
subvol->fcbs_ptrs[
d]->Blink;
1357 release_fcb_lock(
Vcb);
1374 static const char xapref[] =
"user.";
1378 xattr.Length =
sizeof(xapref) - 1 +
dc->utf8.Length;
1381 if (!
xattr.Buffer) {
1382 ERR(
"out of memory\n");
1392 ERR(
"out of memory\n");
1402 ERR(
"get_xattr failed\n");
1423 ERR(
"find_item returned %08lx\n",
Status);
1429 ERR(
"error - could not find key for xattr\n");
1448 fcb->
Header.AllocationSize.QuadPart = xattrlen;
1449 fcb->
Header.FileSize.QuadPart = xattrlen;
1450 fcb->
Header.ValidDataLength.QuadPart = xattrlen;
1452 TRACE(
"stream found: size = %x, hash = %08x\n", xattrlen,
fcb->
adshash);
1465 if (sf->fcb ==
Vcb->dummy_fcb)
1469 bool locked =
false;
1480 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
1490 le = sf->fcb->dir_children_index.
Flink;
1491 while (le != &sf->fcb->dir_children_index) {
1494 if (dc2->
index == 0) {
1525 *psf2 =
dc->fileref;
1537 ERR(
"open_fcb_stream returned %08lx\n",
Status);
1543 acquire_fcb_lock_exclusive(
Vcb);
1545 if (sf->fcb->subvol->fcbs_ptrs[
fcb->
hash >> 24]) {
1546 le = sf->fcb->subvol->fcbs_ptrs[
fcb->
hash >> 24];
1548 while (le != &sf->fcb->subvol->fcbs) {
1570 release_fcb_lock(
Vcb);
1579 ERR(
"out of memory\n");
1602 ExFreeToPagedLookasideList(&
Vcb->fileref_lookaside, duff_fr);
1614 TRACE(
"invalid filename: %.*S\n", (
int)(
name->Length /
sizeof(
WCHAR)),
name->Buffer);
1617 ERR(
"find_file_in_dir returned %08lx\n",
Status);
1625 TRACE(
"passed path including file as subdirectory\n");
1630 *psf2 =
dc->fileref;
1641 ERR(
"open_fcb returned %08lx\n",
Status);
1647 TRACE(
"passed path including file as subdirectory\n");
1654 ERR(
"out of memory\n");
1696 bool has_stream =
false;
1700 TRACE(
"(%p, %p, %p, %u, %p)\n",
Vcb, pfr, related,
parent, parsed);
1702 if (
Vcb->removing ||
Vcb->locked)
1708 ERR(
"error - fnus was too short\n");
1712 if (related && fnus->Length == 0) {
1722 if (fnus2.
Buffer[0] !=
'\\') {
1723 ERR(
"error - filename %.*S did not begin with \\\n", (
int)(fnus2.
Length /
sizeof(
WCHAR)), fnus2.
Buffer);
1739 *pfr =
Vcb->root_fileref;
1756 WARN(
"passed related fileref which isn't a directory (fnus = %.*S)\n",
1757 (
int)(fnus->Length /
sizeof(
WCHAR)), fnus->Buffer);
1763 if (fnus->Length != 0 &&
1767 ERR(
"split_path returned %08lx\n",
Status);
1779 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb);
1783 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb);
1803 bool streampart = has_stream && le->
Flink == &
parts;
1804 bool cs = case_sensitive;
1807 if (streampart && sf->
parent)
1808 cs = sf->
parent->fcb->case_sensitive;
1817 TRACE(
"open_fileref_child returned %08lx\n",
Status);
1819 ERR(
"open_fileref_child returned %08lx\n",
Status);
1851 }
while (le != &
parts);
1862 ExFreeToPagedLookasideList(&
Vcb->name_bit_lookaside, nb);
1878 ERR(
"out of memory\n");
1885 if (!
dc->utf8.Buffer) {
1886 ERR(
"out of memory\n");
1892 if (!
dc->name.Buffer) {
1893 ERR(
"out of memory\n");
1901 dc->key.offset = subvol ? 0xffffffffffffffff : 0;
1905 dc->utf8.Length =
dc->utf8.MaximumLength = utf8->
Length;
1908 dc->name.Length =
dc->name.MaximumLength =
name->Length;
1913 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
1982 while (le != &ealist) {
1999 ERR(
"out of memory\n");
2023 while (le != &ealist) {
2029 ERR(
"uid value was shorter than expected\n");
2042 ERR(
"gid value was shorter than expected\n");
2056 ERR(
"mode value was shorter than expected\n");
2092 ERR(
"dev value was shorter than expected\n");
2116 while (le != &ealist) {
2129 ERR(
"out of memory\n");
2141 while (le != &ealist) {
2201#ifdef DEBUG_FCB_REFCOUNTS
2205 if (parfileref->fcb ==
Vcb->dummy_fcb)
2213 ERR(
"utf16_to_utf8 returned %08lx\n",
Status);
2219 ERR(
"out of memory\n");
2225 ERR(
"utf16_to_utf8 returned %08lx\n",
Status);
2235 TRACE(
"create file %.*S\n", (
int)(fpus->Length /
sizeof(
WCHAR)), fpus->Buffer);
2237 TRACE(
"parfileref->fcb->inode_item.st_size (inode %I64x) was %I64x\n", parfileref->fcb->inode, parfileref->fcb->inode_item.st_size);
2238 parfileref->fcb->inode_item.st_size += utf8len * 2;
2239 TRACE(
"parfileref->fcb->inode_item.st_size (inode %I64x) now %I64x\n", parfileref->fcb->inode, parfileref->fcb->inode_item.st_size);
2240 parfileref->fcb->inode_item.transid =
Vcb->superblock.generation;
2241 parfileref->fcb->inode_item.sequence++;
2242 parfileref->fcb->inode_item.st_ctime =
now;
2243 parfileref->fcb->inode_item.st_mtime =
now;
2246 parfileref->fcb->inode_item_changed =
true;
2273 TRACE(
"defda = %x\n", defda);
2280 ERR(
"out of memory\n");
2284 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2344 fcb->
Header.AllocationSize.QuadPart = 0;
2346 fcb->
Header.ValidDataLength.QuadPart = 0;
2351#ifdef DEBUG_FCB_REFCOUNTS
2353 WARN(
"fcb %p: refcount now %i\n", parfileref->fcb, rc);
2365 acquire_fcb_lock_exclusive(
Vcb);
2415 release_fcb_lock(
Vcb);
2422 ERR(
"fcb_get_new_sd returned %08lx\n",
Status);
2426 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2436 if (ea &&
ealen > 0) {
2439 ERR(
"file_create_parse_ea returned %08lx\n",
Status);
2443 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2454 ERR(
"out of memory\n");
2458 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2472 ERR(
"extend_file returned %08lx\n",
Status);
2476 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2488 ERR(
"out of memory\n");
2492 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2504 ERR(
"out of memory\n");
2508 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2523 fcb->
subvol->root_item.ctransid =
Vcb->superblock.generation;
2535 if (parfileref->fcb->hash_ptrs[dc_hash >> 24]) {
2536 LIST_ENTRY* le = parfileref->fcb->hash_ptrs[dc_hash >> 24];
2537 while (le != &parfileref->fcb->dir_children_hash) {
2540 if (
dc->hash == dc_hash &&
dc->name.Length == fpus->Length &&
RtlCompareMemory(
dc->name.Buffer, fpus->Buffer, fpus->Length) == fpus->Length) {
2541 existing_fileref =
dc->fileref;
2543 }
else if (
dc->hash > dc_hash)
2555 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
2559 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2569 if (parfileref->fcb->hash_ptrs_uc[dc_hash >> 24]) {
2570 LIST_ENTRY* le = parfileref->fcb->hash_ptrs_uc[dc_hash >> 24];
2571 while (le != &parfileref->fcb->dir_children_hash_uc) {
2575 existing_fileref =
dc->fileref;
2577 }
else if (
dc->hash_uc > dc_hash)
2587 if (existing_fileref) {
2592 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2598 *pfr = existing_fileref;
2606 ERR(
"add_dir_child returned %08lx\n",
Status);
2610 parfileref->fcb->inode_item.st_size -= utf8len * 2;
2646 static const char xapref[] =
"user.";
2647 static const WCHAR DOSATTRIB[] =
L"DOSATTRIB";
2648 static const WCHAR EA[] =
L"EA";
2649 static const WCHAR reparse[] =
L"reparse";
2650 static const WCHAR casesensitive_str[] =
L"casesensitive";
2653 ULONG utf8len, overhead;
2660#ifdef DEBUG_FCB_REFCOUNTS
2667 parfileref = *pparfileref;
2669 if (parfileref->
fcb ==
Vcb->dummy_fcb)
2689 ERR(
"out of memory\n");
2700 &granted_access, &
Status)) {
2710 ERR(
"file_create2 returned %08lx\n",
Status);
2720 ERR(
"open_fileref returned %08lx\n",
Status);
2724 parfileref = newpar;
2725 *pparfileref = parfileref;
2728 WARN(
"parent not file, directory, or symlink\n");
2734 WARN(
"tried to create directory as stream\n");
2748 &granted_access, &
Status)) {
2766 ERR(
"out of memory\n");
2774 fcb->
Header.AllocationSize.QuadPart = 0;
2776 fcb->
Header.ValidDataLength.QuadPart = 0;
2778#ifdef DEBUG_FCB_REFCOUNTS
2780 WARN(
"fcb %p: refcount now %i\n", parfileref->
fcb, rc);
2793 ERR(
"utf16_to_utf8 1 returned %08lx\n",
Status);
2803 ERR(
"out of memory\n");
2813 ERR(
"utf16_to_utf8 2 returned %08lx\n",
Status);
2832 ERR(
"find_item returned %08lx\n",
Status);
2845 if (utf8len +
sizeof(xapref) - 1 + overhead >
fcb->
adsmaxlen) {
2846 WARN(
"not enough room for new DIR_ITEM (%Iu + %lu > %lu)\n", utf8len +
sizeof(xapref) - 1, overhead,
fcb->
adsmaxlen);
2851 fcb->
adsmaxlen -= overhead + utf8len +
sizeof(xapref) - 1;
2856 acquire_fcb_lock_exclusive(
Vcb);
2859 parfileref->
fcb->
subvol->fcbs_version++;
2860 release_fcb_lock(
Vcb);
2866 ERR(
"out of memory\n");
2876 ERR(
"out of memory\n");
2886 if (!
dc->utf8.Buffer) {
2887 ERR(
"out of memory\n");
2896 dc->name.MaximumLength =
dc->name.Length =
stream->Length;
2898 if (!
dc->name.Buffer) {
2899 ERR(
"out of memory\n");
2911 ERR(
"RtlUpcaseUnicodeString returned %08lx\n",
Status);
2929 if (dc2->
index == 0) {
2950 *pfileref = existing_dc->
fileref;
2975 parfileref->
fcb->
subvol->root_item.ctransid =
Vcb->superblock.generation;
2980 *pfileref = fileref;
2997 ERR(
"ZwQueryInformationProcess returned %08lx\n",
Status);
3001 return !
pbi.PebBaseAddress;
3004#define called_from_lxss() false
3014 static const WCHAR datasuf[] = {
':',
'$',
'D',
'A',
'T',
'A',0};
3020#ifdef DEBUG_FCB_REFCOUNTS
3024 TRACE(
"(%p, %p, %p, %.*S, %lx, %lx)\n",
Irp,
Vcb,
FileObject, (
int)(fnus->
Length /
sizeof(
WCHAR)), fnus->
Buffer, disposition,
options);
3048 ERR(
"GUID_ECP_ATOMIC_CREATE context was too short: %lu bytes, expected %Iu\n", ctxsize,
3052 WARN(
"unhandled ECP GUID_ECP_QUERY_ON_CREATE\n");
3054 WARN(
"unhandled ECP GUID_ECP_CREATE_REDIRECTION\n");
3056 WARN(
"unhandled ECP {%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
type.Data1,
type.Data2,
3069 if (!loaded_related) {
3075 parfileref = related;
3088 while ((fnus->
Buffer[
i] ==
'\\' || fnus->
Buffer[
i] ==
'/') &&
i > 0) {
i--; }
3092 while (
i > 0 && fnus->
Buffer[
i-1] !=
'\\' && fnus->
Buffer[
i-1] !=
'/') {
i--; }
3097 ERR(
"out of memory\n");
3116 TRACE(
"ignoring :$DATA suffix\n");
3142 ERR(
"create_stream returned %08lx\n",
Status);
3160 &granted_access, &
Status)) {
3172 ERR(
"IoCheckEaBufferValidity returned %08lx (error at offset %lu)\n",
Status,
offset);
3181 *existing_fileref = fileref;
3184 ERR(
"file_create2 returned %08lx\n",
Status);
3198 ERR(
"out of memory\n");
3203 if (
stream.Length == 0) {
3230#ifdef DEBUG_FCB_REFCOUNTS
3232 ERR(
"fileref %p: open_count now %i\n", fileref, oc);
3247 fileref->
fcb->
atts &= ~FILE_ATTRIBUTE_DIRECTORY;
3256 ERR(
"set_reparse_point2 returned %08lx\n",
Status);
3260 if (
stream.Length == 0) {
3294 if (parfileref && !loaded_related)
3301 if (RequestedOptions != 0) {
3304 TRACE(
"requested options:\n");
3307 TRACE(
" FILE_DIRECTORY_FILE\n");
3308 options &= ~FILE_DIRECTORY_FILE;
3312 TRACE(
" FILE_WRITE_THROUGH\n");
3313 options &= ~FILE_WRITE_THROUGH;
3317 TRACE(
" FILE_SEQUENTIAL_ONLY\n");
3318 options &= ~FILE_SEQUENTIAL_ONLY;
3322 TRACE(
" FILE_NO_INTERMEDIATE_BUFFERING\n");
3323 options &= ~FILE_NO_INTERMEDIATE_BUFFERING;
3327 TRACE(
" FILE_SYNCHRONOUS_IO_ALERT\n");
3328 options &= ~FILE_SYNCHRONOUS_IO_ALERT;
3332 TRACE(
" FILE_SYNCHRONOUS_IO_NONALERT\n");
3333 options &= ~FILE_SYNCHRONOUS_IO_NONALERT;
3337 TRACE(
" FILE_NON_DIRECTORY_FILE\n");
3338 options &= ~FILE_NON_DIRECTORY_FILE;
3342 TRACE(
" FILE_CREATE_TREE_CONNECTION\n");
3343 options &= ~FILE_CREATE_TREE_CONNECTION;
3347 TRACE(
" FILE_COMPLETE_IF_OPLOCKED\n");
3348 options &= ~FILE_COMPLETE_IF_OPLOCKED;
3352 TRACE(
" FILE_NO_EA_KNOWLEDGE\n");
3353 options &= ~FILE_NO_EA_KNOWLEDGE;
3357 TRACE(
" FILE_OPEN_REMOTE_INSTANCE\n");
3358 options &= ~FILE_OPEN_REMOTE_INSTANCE;
3362 TRACE(
" FILE_RANDOM_ACCESS\n");
3363 options &= ~FILE_RANDOM_ACCESS;
3367 TRACE(
" FILE_DELETE_ON_CLOSE\n");
3368 options &= ~FILE_DELETE_ON_CLOSE;
3372 TRACE(
" FILE_OPEN_BY_FILE_ID\n");
3373 options &= ~FILE_OPEN_BY_FILE_ID;
3377 TRACE(
" FILE_OPEN_FOR_BACKUP_INTENT\n");
3378 options &= ~FILE_OPEN_FOR_BACKUP_INTENT;
3382 TRACE(
" FILE_NO_COMPRESSION\n");
3383 options &= ~FILE_NO_COMPRESSION;
3386#if NTDDI_VERSION >= NTDDI_WIN7
3388 TRACE(
" FILE_OPEN_REQUIRING_OPLOCK\n");
3389 options &= ~FILE_OPEN_REQUIRING_OPLOCK;
3393 TRACE(
" FILE_DISALLOW_EXCLUSIVE\n");
3394 options &= ~FILE_DISALLOW_EXCLUSIVE;