Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for new ProjFS API #885

Merged
merged 11 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion GVFS/GVFS.Build/ProjFS.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjFSPackage>GVFS.ProjFS.2018.823.1</ProjFSPackage>
<ProjFSNativePackage>GVFS.ProjFS.2018.823.2</ProjFSNativePackage>
<ProjFSManagedPackage>Microsoft.Windows.ProjFS.1.0.19079.1</ProjFSManagedPackage>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion GVFS/GVFS.FunctionalTests/FileSystemRunners/BashRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ public override void DeleteFile_FileShouldNotBeFound(string path)

public override void DeleteFile_AccessShouldBeDenied(string path)
{
this.DeleteFile(path).ShouldContain(this.GetPermissionDeniedError());
// bash does not report any error messages when access is denied, so just confirm the file still exists
jeschu1 marked this conversation as resolved.
Show resolved Hide resolved
this.DeleteFile(path);
this.FileExists(path).ShouldBeTrue($"{path} does not exist when it should");
}

Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Installer.Windows/GVFS.Installer.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CreateInstaller" BeforeTargets="Build;SignFiles">
<Exec Command="$(PackagesDir)\Tools.InnoSetup.5.5.9\tools\ISCC.exe /DPlatformAndConfiguration=$(Platform)\$(Configuration) /DProjFSPackage=$(ProjFSPackage) /DBuildOutputDir=$(BuildOutputDir) /DPackagesDir=$(PackagesDir) /DGVFSVersion=$(GVFSVersion) Setup.iss /O$(OutputPath)" />
<Exec Command="$(PackagesDir)\Tools.InnoSetup.5.5.9\tools\ISCC.exe /DPlatformAndConfiguration=$(Platform)\$(Configuration) /DProjFSNativePackage=$(ProjFSNativePackage) /DBuildOutputDir=$(BuildOutputDir) /DPackagesDir=$(PackagesDir) /DGVFSVersion=$(GVFSVersion) Setup.iss /O$(OutputPath)" />
<Copy SourceFiles="$(OutputPath)SetupGVFS.$(GVFSVersion).exe" DestinationFiles="$(BuildOutputDir)\GVFS.Build\SetupGVFS.$(GVFSVersion).exe" />
</Target>
<Target Name="Clean">
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Installer.Windows/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

; General documentation on how to use InnoSetup scripts: http://www.jrsoftware.org/ishelp/index.php

#define PrjFltDir PackagesDir + "\" + ProjFSPackage + "\filter"
#define PrjFltDir PackagesDir + "\" + ProjFSNativePackage + "\filter"
#define VCRuntimeDir PackagesDir + "\GVFS.VCRuntime.0.2.0-build\lib\x64"
#define GVFSDir BuildOutputDir + "\GVFS.Windows\bin\" + PlatformAndConfiguration
#define GVFSCommonDir BuildOutputDir + "\GVFS.Common\bin\" + PlatformAndConfiguration + "\netstandard2.0"
Expand Down
1 change: 1 addition & 0 deletions GVFS/GVFS.Installer.Windows/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GVFS.ProjFS" version="2018.823.2" targetFramework="net461" />
<package id="MicroBuild.Core" version="0.2.0" developmentDependency="true" />
<package id="Tools.InnoSetup" version="5.5.9" targetFramework="net461" />
</packages>
4 changes: 2 additions & 2 deletions GVFS/GVFS.NativeTests/GVFS.NativeTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ProjectedFSLib.lib;fltlib.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;$(PackagesDir)\$(ProjFSPackage)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;$(PackagesDir)\$(ProjFSNativePackage)\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -85,7 +85,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ProjectedFSLib.lib;fltlib.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;$(PackagesDir)\$(ProjFSPackage)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;$(PackagesDir)\$(ProjFSNativePackage)\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Platform.Mac/MacFileSystemVirtualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public override FileSystemResult WritePlaceholderDirectory(string relativePath)
DateTime lastAccessTime,
DateTime lastWriteTime,
DateTime changeTime,
uint fileAttributes,
FileAttributes fileAttributes,
long endOfFile,
string shaContentId,
UpdatePlaceholderType updateFlags,
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Platform.Windows/ActiveEnumeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void SaveFilter(string filter)
{
this.filterString = filter;

if (ProjFS.Utils.DoesNameContainWildCards(this.filterString))
if (Microsoft.Windows.ProjFS.Utils.DoesNameContainWildCards(this.filterString))
jeschu1 marked this conversation as resolved.
Show resolved Hide resolved
{
this.doesPatternMatch = doesWildcardPatternMatch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GVFS.Common.FileSystem;
using GVFS.Common.Tracing;
using GVFS.DiskLayoutUpgrades;
using ProjFS;
using Microsoft.Windows.ProjFS;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -81,30 +81,32 @@ private static IEnumerable<string> GetFolderPlaceholdersFromDisk(ITracer tracer,
{
if (!directory.EndsWith(Path.DirectorySeparatorChar + GVFSConstants.DotGit.Root))
{
OnDiskFileState fileState = OnDiskFileState.Full;
HResult result = Utils.GetOnDiskFileState(directory, out fileState);
if (result == HResult.Ok)
if (Directory.Exists(directory))
wilbaker marked this conversation as resolved.
Show resolved Hide resolved
{
if (IsPlaceholder(fileState))
OnDiskFileState fileState = OnDiskFileState.Full;
bool result = Utils.TryGetOnDiskFileState(directory, out fileState);
if (result == true)
jeschu1 marked this conversation as resolved.
Show resolved Hide resolved
{
yield return directory;
}
if (IsPlaceholder(fileState))
{
yield return directory;
}

// Recurse into placeholders and full folders skipping the tombstones
if (!IsTombstone(fileState))
{
foreach (string placeholderPath in GetFolderPlaceholdersFromDisk(tracer, fileSystem, directory))
// Recurse into placeholders and full folders skipping the tombstones
if (!IsTombstone(fileState))
{
yield return placeholderPath;
foreach (string placeholderPath in GetFolderPlaceholdersFromDisk(tracer, fileSystem, directory))
{
yield return placeholderPath;
}
}
}
}
else if (result != HResult.FileNotFound)
{
// FileNotFound is returned for tombstones when the filter is attached to the volume so we want to
// just skip those folders. Any other HResults may cause valid folder placeholders not to be written
// to the placeholder database so we want to error out on those.
throw new InvalidDataException($"Error getting on disk file state. HResult = {result} for {directory}");
else
{
// May cause valid folder placeholders not to be written
jeschu1 marked this conversation as resolved.
Show resolved Hide resolved
// to the placeholder database so we want to error out.
throw new InvalidDataException($"Error getting on disk file state. HResult = {result} for {directory}");
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions GVFS/GVFS.Platform.Windows/GVFS.Platform.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<HintPath>..\..\..\packages\Microsoft.Database.Isam.1.9.4\lib\net40\Esent.Isam.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ProjectedFSLib.Managed, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64">
<HintPath>$(PackagesDir)\$(ProjFSPackage)\lib\x64\ProjectedFSLib.Managed.dll</HintPath>
<Reference Include="ProjectedFSLib.Managed, Version=1.0.19079.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64">
<HintPath>..\..\..\packages\Microsoft.Windows.ProjFS.1.0.19079.1\lib\net461\ProjectedFSLib.Managed.dll</HintPath>
jeschu1 marked this conversation as resolved.
Show resolved Hide resolved
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -91,6 +91,7 @@
<Compile Include="WindowsPlatform.cs" />
<Compile Include="WindowsPlatform.Shared.cs" />
<Compile Include="WindowsFileSystem.cs" />
<Compile Include="WindowsRequiredCallbacks.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config">
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Platform.Windows/HResultExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ProjFS;
using Microsoft.Windows.ProjFS;

namespace GVFS.Platform.Windows
{
Expand Down
4 changes: 2 additions & 2 deletions GVFS/GVFS.Platform.Windows/ProjFSFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GVFS.Common.FileSystem;
using GVFS.Common.Tracing;
using Microsoft.Win32;
using ProjFS;
using Microsoft.Windows.ProjFS;
using System;
using System.ComponentModel;
using System.IO;
Expand Down Expand Up @@ -617,7 +617,7 @@ private bool TryPrepareFolderForCallbacksImpl(string folderPath, out string erro
{
error = string.Empty;
Guid virtualizationInstanceGuid = Guid.NewGuid();
HResult result = VirtualizationInstance.ConvertDirectoryToVirtualizationRoot(virtualizationInstanceGuid, folderPath);
HResult result = VirtualizationInstance.MarkDirectoryAsVirtualizationRoot(folderPath, virtualizationInstanceGuid);
if (result != HResult.Ok)
{
error = "Failed to prepare \"" + folderPath + "\" for callbacks, error: " + result.ToString("F");
Expand Down