question

William-3015 avatar image
0 Votes"
William-3015 asked William-3015 answered

Explorer does NOT copy Alternative Data Streams for folders

While copying a file with ADS to another drive(NTFS to NTFS) works as expected (ADS are copied too)
copying a folder with ADS does not work. ADStreams are NOT copied.

It used to work on Win7. Is it a bug?
Is it related to previous bug, about attributes not being copied?
details here:
https://social.technet.microsoft.com/Forums/en-US/8ab1a753-9a63-4273-8ba4-0d0748cc9ac0/folder-attributescustomization-lost-on-copy-or-move-in-windows-10-1607-anniversary-update?forum=win10itprogeneral

Is it by design?
This brakes compatibility in a big way.
ADS are extremely useful NTFS feature, and many programs depend on it.

Please do not provide workarounds, I know there are workarounds(xcopy /k) etc
If someone informed could tell me
I need to know if this is a bug or by design.





windows-10-generalwindows-sysinternals-procexp
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Does anyone have any idea about this ????

Community member.
Microsoft employ.
Literally ANYONE...


0 Votes 0 ·

Hello @William-3015,

Thank you for posting here.

To better understand your question and help you, would you please tell us:

How you check "While copying a file with ADS to another drive(NTFS to NTFS) works as expected (ADS are copied too)" and "copying a folder with ADS does not work. ADStreams are NOT copied.", then I will check in my lab on my windows server or client.


Best Regards,
Daisy Zhou

0 Votes 0 ·

@DaisyZhou-MSFT I don't mean any disrespect, but I can not understand your question. I can not understand what you can not understand, if that makes any sense.
If you don't know what ADS is here is some info:

Ads description



To create an ADS for a folder you can use the CreateFileW function with the path to the folder + a colon +stream name.
For example: C:\somefolder:myADS

Then you can use the WriteFile function to write data to the ADS

you can do the same to read the data. CreateFileW -> ReadFile function

For command line there are a ton of examples in Google eg
https://www.irongeek.com/i.php?page=security/altds

How you check

Well... Copy a folder with ADS to another NTFS drive using Explorer. Read the folder's ADS anyway you can (ReadFile function or dir /r or any other way). You will find that ADS did not get copied




DOES ANYONE FROM MICROSOFT EVER READS THESE FORUMS?????

0 Votes 0 ·

The IFileOperation interface
https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ifileoperation

Behaves the same way with Explorer in Windows 10, 2004 with any kind of flags in IFileOperation::SetOperationFlags
if this is any kind useful information.

It shouldn't. it should copy ADS for folder too

Please if you have the ability forward this question to the Shell team or Explorer team or whatever internal team is responsible for this.

0 Votes 0 ·

Hello @William-3015,

It seems that it is by design, but I can not find microsoft document to explain it.

You can feedback it here.

https://windowsserver.uservoice.com/forums/295047-general-feedback

Thank you for your understanding and time.


Best Regards,
Daisy Zhou

0 Votes 0 ·

It seems

To whom?????
To you ??????
Is this your personal assessment
or official answer from Microsoft ???

Should I forward this answer to my boss as an official answer from Microsoft?

Our internal software makes heavy use of ADS.
The promise from Microsoft was that if the copy is NTFS to NTFS, ADS will get copied too .
Is Microsoft dropping ADS support for folders only or files are coming next?
Is there an announcement somewhere ?

Most important:
DID YOU TALK TO ANYONE ABOVE YOU ABOUT THIS ???
Does the appropriate inner team KNOWS ABOUT THIS ??

They did not know about attributes not get copied too. When they heard about it they fix it. It is the link in my first post.

The link about Windows Server is useless.
The problem is about Windows 10 Pro v2004.

Please confirm. A simple yes and I will consider this matter closed.

If you haven't forward this question to someone responsible, please, please, please, please, please do.






0 Votes 0 ·

Hello @William-3015,

I have helped you feedback this problem, but i am sorry, we are not sure when we can get the news and results of the feedback.

Meanwhile, you can enter feedback hub in the Windows 10 machine (type feedback hub in the search bar, click the enter key to fill in your feedback information
45614-feedback11.png

At the same time, if your question is urgent and you need to get a definite reply as soon as possible, you can open a case in the following link.

https://support.microsoft.com/en-in/gp/contactus81?forceorigin=esmc&Audience=Commercial
https://support.microsoft.com/en-us/help/4051701/global-customer-service-phone-numbers


Thank you for your understanding and support.



Best Regards,
Daisy Zhou


0 Votes 0 ·
feedback11.png (40.3 KiB)
Show more comments
William-3015 avatar image
0 Votes"
William-3015 answered

It really doesn't mater, maybe I will revisit this in a year or two

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GaryNebbett avatar image
0 Votes"
GaryNebbett answered

Hello @William-3015,

When I first read your message, I missed one important point: "It used to work on Win7".

I tested this on Windows 8.0, and it doesn't work there and probably doesn't work on any version of Windows after Windows 7.

The IFileOperation interface (which is indeed used by explorer) makes no mention of alternate data streams (and therefore makes no guarantees about them).

When copying plain files, IFileOperation ultimately calls CopyFile2 - which is documented as preserving alternate data streams.

 KERNELBASE!CopyFile2+0x101
 windows_storage!CFSTransfer::_PerformCopyFileWithRetry+0xc4
 windows_storage!CFSTransfer::CopyItem+0x105
 windows_storage!CCopyOperation::_CreateDestinationOrCopyItemWithRetry+0xc3
 [...]
 windows_storage!CFileOperation::PerformOperations+0x104

When copying directories, the code in Windows.Storage.dll just calls CreateDirectory and NtSetInformationFile to implement the copy:

 KERNELBASE!CreateDirectoryW+0xe2
 windows_storage!CFSTransfer::DestinationCreateRetryLoop+0x83
 windows_storage!CFSTransfer::DestinationCreate+0x1b1
 windows_storage!CFSTransfer::_CreateFileWithRetry+0x52
 windows_storage!CFSTransfer::CopyItem+0x1edd25
 windows_storage!CCopyOperation::_CreateDestinationOrCopyItemWithRetry+0xc3
 [...]
 windows_storage!CFileOperation::PerformOperations+0x104
    
 ntdll!NtSetInformationFile+0x14
 windows_storage!CFSTransfer::DestinationCreateRetryLoop+0x50b
 windows_storage!CFSTransfer::DestinationCreate+0x1b1
 windows_storage!CFSTransfer::_CreateFileWithRetry+0x52
 windows_storage!CFSTransfer::CopyItem+0x1edd25
 windows_storage!CCopyOperation::_CreateDestinationOrCopyItemWithRetry+0xc3
 [...]
 windows_storage!CFileOperation::PerformOperations+0x104


I can't verify the Windows 7 behaviour, but the majority of Windows users are running versions of Windows that do not preserve directory alternate data streams when copying them with the IFileOperation interface.

Regardless of whether this was a "by design" choice or just an oversight during the re-factoring of the implementation of IFileOperation after Windows 7, you have no choice but to accept this state of affairs.

Gary

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

William-3015 avatar image
0 Votes"
William-3015 answered William-3015 published

Regardless of whether this was a "by design" choice or just an oversight during the re-factoring of the implementation of IFileOperation after Windows 7, you have no choice but to accept this state of affairs.

This is EXACTLY the point (but for explorer not IFileOperation, I only mentioned IFileOperation in case it was helpful)

The question is about Explorer
It copies ADS for files, but not for folders

This is weird behavior.

"Regardless of whether this was a "by design" It is either by design, or by mistake.
If it is by mistake, someone should fix it.
If it is by design, that's fine we will use something else.

WHICH IS IT?
.
I need an answer from someone responsible.
You did not provided an answer.
"Regardless of whether this was a "by design" is not an answer.

The matter is that someone responsible should make that call.
Attributes not copied for folders, turned out to be a bug.
If this is by design SOMEONE should step up and give an official answer.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

William-3015 avatar image
0 Votes"
William-3015 answered

it seems that the inner call
CFSTransfer::CopyItem
that is called in all copies for both files and folders is ignoring the ADS just for folders

Maybe?

or is it _CreateFileWithRetry jobs to get ADS ?

I don't know...
Does anyone?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.