question

Elliot-7999 avatar image
0 Votes"
Elliot-7999 asked ·

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&#34;.jpg&#34;);
         _fileTypeFilter.push_back(L&#34;.png&#34;);
         _fileTypeFilter.push_back(L&#34;.bmp&#34;);
         _fileTypeFilter.push_back(L&#34;.gif&#34;);
    
         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.

windows-uwpwindows-uwp-runtime
· 6
10 |1000 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.

Can you please tell us where is your app running and what is the os of the Raspberry Pi?

0 Votes 0 · ·

The Windows version is 10.0.18363 Build 18363. The App has target platform version 10.0.18362.0 and minimum version 10.0.17134.0 .

The raspberry pi with the samba share is running this:

PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian

0 Votes 0 · ·

If you test the above code just on the PC instead of on a samba share of a Raspberry Pi, will the same issue occur?

0 Votes 0 · ·
Show more comments

0 Answers