@@ -462,16 +462,16 @@ private async Task<BaseBasicProperties> GetBasicProperties()
462
462
: new ZipFileBasicProperties ( entry ) ;
463
463
}
464
464
465
- private IAsyncOperation < SevenZipExtractor > OpenZipFileAsync ( bool openProtected = false )
465
+ private IAsyncOperation < SevenZipExtractor > OpenZipFileAsync ( )
466
466
{
467
467
return AsyncInfo . Run < SevenZipExtractor > ( async ( cancellationToken ) =>
468
468
{
469
- var zipFile = await OpenZipFileAsync ( FileAccessMode . Read , openProtected ) ;
469
+ var zipFile = await OpenZipFileAsync ( FileAccessMode . Read ) ;
470
470
return zipFile is not null ? new SevenZipExtractor ( zipFile ) : null ;
471
471
} ) ;
472
472
}
473
473
474
- private IAsyncOperation < Stream > OpenZipFileAsync ( FileAccessMode accessMode , bool openProtected = false )
474
+ private IAsyncOperation < Stream > OpenZipFileAsync ( FileAccessMode accessMode )
475
475
{
476
476
return AsyncInfo . Run < Stream > ( async ( cancellationToken ) =>
477
477
{
@@ -482,9 +482,7 @@ private IAsyncOperation<Stream> OpenZipFileAsync(FileAccessMode accessMode, bool
482
482
}
483
483
else
484
484
{
485
- var hFile = openProtected ?
486
- NativeFileOperationsHelper . OpenProtectedFileForRead ( containerPath ) :
487
- NativeFileOperationsHelper . OpenFileForRead ( containerPath , readWrite ) ;
485
+ var hFile = NativeFileOperationsHelper . OpenFileForRead ( containerPath , readWrite ) ;
488
486
if ( hFile . IsInvalid )
489
487
{
490
488
return null ;
@@ -500,9 +498,7 @@ private StreamedFileDataRequestedHandler ZipDataStreamingHandler(string name)
500
498
{
501
499
try
502
500
{
503
- // If called from here it fails with Access Denied?!
504
- //var hFile = NativeFileOperationsHelper.OpenFileForRead(ContainerPath);
505
- using SevenZipExtractor zipFile = await OpenZipFileAsync ( openProtected : true ) ;
501
+ using SevenZipExtractor zipFile = await OpenZipFileAsync ( ) ;
506
502
if ( zipFile == null || zipFile . ArchiveFileData == null )
507
503
{
508
504
request . FailAndClose ( StreamedFileFailureMode . CurrentlyUnavailable ) ;
0 commit comments