Opening files on samba shares causing internal exceptions in c++/winrt UWP app
Sorry if this problem is really at a lower level, but I am getting this via a c++/winrt single page app. Is there anywhere better for me to report this? The following program has the user picking a directory, and then tries to load all the images in this directory. I think it works, at least most of the time, but when I try it on a samba share of a Raspberry Pi there are lots of internal exceptions, which I think may be degrading the performance.
Windows::Foundation::IAsyncAction MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
using namespace winrt::Windows::Storage;
using namespace winrt::Windows::Storage::Pickers;
Windows::Storage::Pickers::FolderPicker _folderPicker;
_folderPicker.FileTypeFilter().Append(winrt::hstring(L"*"));
_folderPicker.SuggestedStartLocation(PickerLocationId::PicturesLibrary);
winrt::Windows::Storage::StorageFolder _folder = NULL;
_folder = co_await _folderPicker.PickSingleFolderAsync();
std::vector<winrt::hstring> _fileTypeFilter;
_fileTypeFilter.push_back(L".jpg");
_fileTypeFilter.push_back(L".png");
_fileTypeFilter.push_back(L".bmp");
_fileTypeFilter.push_back(L".gif");
Windows::Storage::Search::QueryOptions _queryOptions(Windows::Storage::Search::CommonFileQuery::DefaultQuery, _fileTypeFilter);
_queryOptions.IndexerOption(Windows::Storage::Search::IndexerOption::DoNotUseIndexer);
Windows::Storage::Search::StorageFileQueryResult _StorageFileQueryResult = _folder.CreateFileQueryWithOptions(_queryOptions);
auto _storageFiles = co_await _StorageFileQueryResult.GetFilesAsync();
for (auto _storageFile : _storageFiles)
{
using namespace Windows::Storage::Streams;
using namespace Windows::Graphics::Imaging;
IRandomAccessStreamWithContentType _stream = co_await _storageFile.OpenReadAsync();
BitmapDecoder _bitmapDecoder = co_await Windows::Graphics::Imaging::BitmapDecoder::CreateAsync(_stream);
BitmapTransform _transform = BitmapTransform();
_transform.ScaledHeight(240);
_transform.ScaledWidth(360);
Windows::Graphics::Imaging::PixelDataProvider _pixelProvider = co_await _bitmapDecoder.GetPixelDataAsync(BitmapPixelFormat::Bgra8, BitmapAlphaMode::Ignore, _transform, ExifOrientationMode::IgnoreExifOrientation, ColorManagementMode::DoNotColorManage);
com_array<uint8_t> _com_array = _pixelProvider.DetachPixelData();
}
}
The last time I ran this, I got lots of these in the output window:
onecore\shell\shcore\libs\stream\managedcreatefile.cpp(1339)\shcore.dll!00007FFC498F6A42: (caller: 00007FFC498C7ACF) ReturnHr(185) tid(40f4) 80070057 The parameter is incorrect.
onecore\shell\shcore\libs\stream\managedcreatefile.cpp(1339)\shcore.dll!00007FFC498F6A42: (caller: 00007FFC498C7ACF) ReturnHr(186) tid(40f4) 80070057 The parameter is incorrect.
onecore\shell\shcore\libs\stream\managedcreatefile.cpp(1339)\shcore.dll!00007FFC498F6A42: (caller: 00007FFC498C7ACF) ReturnHr(187) tid(40f4) 80070057 The parameter is incorrect.
onecore\shell\shcore\libs\stream\managedcreatefile.cpp(1339)\shcore.dll!00007FFC498F6A42: (caller: 00007FFC498C7ACF) ReturnHr(188) tid(40f4) 80070057 The parameter is incorrect.