-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Currently, ForceOps is using LockCheck, which is similar but it isn't the same code that is used in production by other programs.
ForceOps uses:
- RestartManager for files
- NtDll for directories, specifically NtQueryInformationFile
Restart manager does not support directories according to 1, 2.
There are two similar implementations I could find in open source that are being used by many people.
MSBuild
It uses an adapted version of LockCheck, here. MSBuildSdks also uses it here.
It uses RestartManager, so it only supports files, and not directories.
Example output:
❯ dotnet build
MSBuild version 17.6.1+8ffc3fe3d for .NET
Determining projects to restore...
All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\7.0.302\Microsoft.Common.CurrentVersion.targets(5150,5): warning MSB3026: Coul
d not copy "C:\Users\user\myprogram\obj\Debug\net6\apphost.exe" to "bin\Debug\net6\myprogram.exe".
Beginning retry 1 in 1000ms. The process cannot access the file 'C:\Users\user\myprogram\bin\Debu
g\net6\myprogram.exe' because it is being used by another process. The file is locked by: "myprogram (1007
24)" [C:\Users\user\myprogram\myprogram.csproj]
C:\Program Files\dotnet\sdk\7.0.302\Microsoft.Common.CurrentVersion.targets(5150,5): warning MSB3026: Coul
d not copy "C:\Users\user\myprogram\obj\Debug\net6\apphost.exe" to "bin\Debug\net6\myprogram.exe".
Beginning retry 2 in 1000ms. The process cannot access the file 'C:\Users\user\myprogram\bin\Debu
g\net6\myprogram.exe' because it is being used by another process. The file is locked by: "myprogram (1007
24)" [C:\Users\user\myprogram\myprogram.csproj]
...File Locksmith in PowerToys
File Locksmith uses NtDll, and notably uses NtQueryObject instead of NtQueryInformationFile, which LockCheck uses.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation