runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Fix the way code is handling passing in the extended attribute information

Open keeratsingh opened this issue 8 years ago • 1 comments

Currently the way the code handles passing in the extended attribute information is way too complicated / inefficient. The data being passed can be created on the stack- context can't be over 255 bytes so it should all easily fit. Fixing the inefficiencies will also make the code much easier to follow.

Setting EA attributes not efficient

SqlFileStream::FileFullEaInformation does more work than it needs to.

  • Can stackalloc a buffer to contain the data- no native (or managed) heap allocations needed
  • Will avoid needing to wrap with SafeHandle, use any marshalling methods.
  • Can use FILE_FULL_EA_INFORMATION* to easily set offset, flags, lengths
  • Should store EaName constant as a byte array of ASCII bytes rather than converting every time

Related Discussion: https://github.com/dotnet/corefx/pull/29879#issuecomment-399551771 Related Issue: https://github.com/dotnet/corefx/issues/15652 Support Contact: @JeremyKuhne

keeratsingh avatar Jun 22 '18 21:06 keeratsingh

Closing Issue, fixed as part of PR dotnet/corefx#29879 ,Commit https://github.com/dotnet/corefx/pull/29879/commits/08b595d71796c567467fd04fd09007d896a43b17 in file SqlFileStream.Windows.cs

keeratsingh avatar Jul 06 '18 18:07 keeratsingh