mirror of https://github.com/winsw/winsw
Reorganize projects
parent
35af3bf78d
commit
bbb3cd578c
|
@ -1,3 +0,0 @@
|
|||
# Release notes
|
||||
|
||||
This content has been moved to the [Releases](https://github.com/winsw/winsw/releases).
|
|
@ -64,8 +64,6 @@ User documentation:
|
|||
* Use-cases:
|
||||
* [Self-restarting services](docs/self-restarting-service.md)
|
||||
* [Deferred file operations](docs/deferred-file-operations.md)
|
||||
* Configuration Management:
|
||||
* [Puppet Forge Module](docs/puppetWinSW.md)
|
||||
|
||||
Developer documentation:
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ jobs:
|
|||
BuildConfiguration: Release
|
||||
steps:
|
||||
- script: |
|
||||
dotnet build -c $(BuildConfiguration) src\winsw.sln -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 src\Core\ServiceWrapper\winsw.csproj -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x64 src\Core\ServiceWrapper\winsw.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x86 src\Core\ServiceWrapper\winsw.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion)
|
||||
dotnet build -c $(BuildConfiguration) src\WinSW.sln -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 src\WinSW\WinSW.csproj -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x64 src\WinSW\WinSW.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion)
|
||||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x86 src\WinSW\WinSW.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion)
|
||||
displayName: Build
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Install Nuget
|
||||
|
@ -44,7 +44,7 @@ jobs:
|
|||
packagesToPack: WinSW.nuspec
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: BuildVersion
|
||||
- script: dotnet test -c $(BuildConfiguration) --no-build src\Test\winswTests\winswTests.csproj
|
||||
- script: dotnet test -c $(BuildConfiguration) --no-build src\WinSW.Tests\WinSW.Tests.csproj
|
||||
displayName: Test
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish .NET 4.6.1
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("winswTests")]
|
|
@ -1,3 +0,0 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("WindowsService")]
|
|
@ -1,180 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WinSW.Plugins.RunawayProcessKiller
|
||||
{
|
||||
public partial class RunawayProcessKillerExtension
|
||||
{
|
||||
internal static class NativeMethods
|
||||
{
|
||||
private const string Kernel32 = "kernel32.dll";
|
||||
private const string NTDll = "ntdll.dll";
|
||||
|
||||
[DllImport(Kernel32)]
|
||||
internal static extern int IsWow64Process(IntPtr hProcess, out int Wow64Process);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtQueryInformationProcess(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION32 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtQueryInformationProcess(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION64 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern unsafe int NtReadVirtualMemory(
|
||||
IntPtr ProcessHandle,
|
||||
IntPtr BaseAddress,
|
||||
void* Buffer,
|
||||
IntPtr BufferSize,
|
||||
IntPtr NumberOfBytesRead = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtWow64QueryInformationProcess64(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION64 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern unsafe int NtWow64ReadVirtualMemory64(
|
||||
IntPtr ProcessHandle,
|
||||
long BaseAddress,
|
||||
void* Buffer,
|
||||
long BufferSize,
|
||||
long NumberOfBytesRead = default);
|
||||
|
||||
internal enum PROCESSINFOCLASS
|
||||
{
|
||||
ProcessBasicInformation = 0,
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct MEMORY_BASIC_INFORMATION
|
||||
{
|
||||
public readonly IntPtr BaseAddress;
|
||||
private readonly IntPtr AllocationBase;
|
||||
private readonly uint AllocationProtect;
|
||||
public readonly IntPtr RegionSize;
|
||||
private readonly uint State;
|
||||
private readonly uint Protect;
|
||||
private readonly uint Type;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PROCESS_BASIC_INFORMATION32
|
||||
{
|
||||
private readonly int Reserved1;
|
||||
public readonly int PebBaseAddress;
|
||||
private fixed int Reserved2[2];
|
||||
private readonly uint UniqueProcessId;
|
||||
private readonly int Reserved3;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PROCESS_BASIC_INFORMATION64
|
||||
{
|
||||
private readonly long Reserved1;
|
||||
public readonly long PebBaseAddress;
|
||||
private fixed long Reserved2[2];
|
||||
private readonly ulong UniqueProcessId;
|
||||
private readonly long Reserved3;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PEB32
|
||||
{
|
||||
private fixed byte Reserved1[2];
|
||||
private readonly byte BeingDebugged;
|
||||
private fixed byte Reserved2[1];
|
||||
private fixed int Reserved3[2];
|
||||
private readonly int Ldr;
|
||||
public readonly int ProcessParameters;
|
||||
private fixed int Reserved4[3];
|
||||
private readonly int AtlThunkSListPtr;
|
||||
private readonly int Reserved5;
|
||||
private readonly uint Reserved6;
|
||||
private readonly int Reserved7;
|
||||
private readonly uint Reserved8;
|
||||
private readonly uint AtlThunkSListPtr32;
|
||||
private fixed int Reserved9[45];
|
||||
private fixed byte Reserved10[96];
|
||||
private readonly int PostProcessInitRoutine;
|
||||
private fixed byte Reserved11[128];
|
||||
private fixed int Reserved12[1];
|
||||
private readonly uint SessionId;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PEB64
|
||||
{
|
||||
private fixed byte Reserved1[2];
|
||||
private readonly byte BeingDebugged;
|
||||
private fixed byte Reserved2[1];
|
||||
private fixed long Reserved3[2];
|
||||
private readonly long Ldr;
|
||||
public readonly long ProcessParameters;
|
||||
private fixed long Reserved4[3];
|
||||
private readonly long AtlThunkSListPtr;
|
||||
private readonly long Reserved5;
|
||||
private readonly uint Reserved6;
|
||||
private readonly long Reserved7;
|
||||
private readonly uint Reserved8;
|
||||
private readonly uint AtlThunkSListPtr32;
|
||||
private fixed long Reserved9[45];
|
||||
private fixed byte Reserved10[96];
|
||||
private readonly long PostProcessInitRoutine;
|
||||
private fixed byte Reserved11[128];
|
||||
private fixed long Reserved12[1];
|
||||
private readonly uint SessionId;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct RTL_USER_PROCESS_PARAMETERS32
|
||||
{
|
||||
private fixed byte Reserved1[16];
|
||||
private fixed int Reserved2[10];
|
||||
private readonly UNICODE_STRING32 ImagePathName;
|
||||
private readonly UNICODE_STRING32 CommandLine;
|
||||
|
||||
internal readonly int Environment;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct RTL_USER_PROCESS_PARAMETERS64
|
||||
{
|
||||
private fixed byte Reserved1[16];
|
||||
private fixed long Reserved2[10];
|
||||
private readonly UNICODE_STRING64 ImagePathName;
|
||||
private readonly UNICODE_STRING64 CommandLine;
|
||||
|
||||
internal readonly long Environment;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct UNICODE_STRING32
|
||||
{
|
||||
private readonly ushort Length;
|
||||
private readonly ushort MaximumLength;
|
||||
private readonly int Buffer;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct UNICODE_STRING64
|
||||
{
|
||||
private readonly ushort Length;
|
||||
private readonly ushort MaximumLength;
|
||||
private readonly long Buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WinSW.Plugins.SharedDirectoryMapper
|
||||
{
|
||||
internal static class NativeMethods
|
||||
{
|
||||
internal const uint RESOURCETYPE_DISK = 0x00000001;
|
||||
|
||||
private const string MprLibraryName = "mpr.dll";
|
||||
|
||||
[DllImport(MprLibraryName, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "WNetAddConnection2W")]
|
||||
internal static extern int WNetAddConnection2(in NETRESOURCE netResource, string? password = null, string? userName = null, uint flags = 0);
|
||||
|
||||
[DllImport(MprLibraryName, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "WNetCancelConnection2W")]
|
||||
internal static extern int WNetCancelConnection2(string name, uint flags = 0, bool force = false);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
internal struct NETRESOURCE
|
||||
{
|
||||
public uint Scope;
|
||||
public uint Type;
|
||||
public uint DisplayType;
|
||||
public uint Usage;
|
||||
public string LocalName;
|
||||
public string RemoteName;
|
||||
public string Comment;
|
||||
public string Provider;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<RootNamespace>winsw.Plugins.SharedDirectoryMapper</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\WinSWCore\WinSWCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("WinSW")]
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace WinSW
|
||||
{
|
0
src/Core/WinSWCore/ServiceDescriptor.cs → src/WinSW.Core/ServiceDescriptor.cs
Executable file → Normal file
0
src/Core/WinSWCore/ServiceDescriptor.cs → src/WinSW.Core/ServiceDescriptor.cs
Executable file → Normal file
|
@ -5,8 +5,6 @@
|
|||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
<RootNamespace>winsw</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
|
@ -1,12 +1,13 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using WinSW.Extensions;
|
||||
using WinSW.Util;
|
||||
using static WinSW.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension.NativeMethods;
|
||||
using static WinSW.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension.Native;
|
||||
|
||||
namespace WinSW.Plugins.RunawayProcessKiller
|
||||
{
|
||||
|
@ -287,5 +288,177 @@ namespace WinSW.Plugins.RunawayProcessKiller
|
|||
Logger.Error("Cannot update the PID file " + this.Pidfile, ex);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Native
|
||||
{
|
||||
private const string Kernel32 = "kernel32.dll";
|
||||
private const string NTDll = "ntdll.dll";
|
||||
|
||||
[DllImport(Kernel32)]
|
||||
internal static extern int IsWow64Process(IntPtr hProcess, out int Wow64Process);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtQueryInformationProcess(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION32 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtQueryInformationProcess(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION64 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern unsafe int NtReadVirtualMemory(
|
||||
IntPtr ProcessHandle,
|
||||
IntPtr BaseAddress,
|
||||
void* Buffer,
|
||||
IntPtr BufferSize,
|
||||
IntPtr NumberOfBytesRead = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern int NtWow64QueryInformationProcess64(
|
||||
IntPtr ProcessHandle,
|
||||
PROCESSINFOCLASS ProcessInformationClass,
|
||||
out PROCESS_BASIC_INFORMATION64 ProcessInformation,
|
||||
int ProcessInformationLength,
|
||||
IntPtr ReturnLength = default);
|
||||
|
||||
[DllImport(NTDll)]
|
||||
internal static extern unsafe int NtWow64ReadVirtualMemory64(
|
||||
IntPtr ProcessHandle,
|
||||
long BaseAddress,
|
||||
void* Buffer,
|
||||
long BufferSize,
|
||||
long NumberOfBytesRead = default);
|
||||
|
||||
internal enum PROCESSINFOCLASS
|
||||
{
|
||||
ProcessBasicInformation = 0,
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct MEMORY_BASIC_INFORMATION
|
||||
{
|
||||
public readonly IntPtr BaseAddress;
|
||||
private readonly IntPtr AllocationBase;
|
||||
private readonly uint AllocationProtect;
|
||||
public readonly IntPtr RegionSize;
|
||||
private readonly uint State;
|
||||
private readonly uint Protect;
|
||||
private readonly uint Type;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PROCESS_BASIC_INFORMATION32
|
||||
{
|
||||
private readonly int Reserved1;
|
||||
public readonly int PebBaseAddress;
|
||||
private fixed int Reserved2[2];
|
||||
private readonly uint UniqueProcessId;
|
||||
private readonly int Reserved3;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PROCESS_BASIC_INFORMATION64
|
||||
{
|
||||
private readonly long Reserved1;
|
||||
public readonly long PebBaseAddress;
|
||||
private fixed long Reserved2[2];
|
||||
private readonly ulong UniqueProcessId;
|
||||
private readonly long Reserved3;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PEB32
|
||||
{
|
||||
private fixed byte Reserved1[2];
|
||||
private readonly byte BeingDebugged;
|
||||
private fixed byte Reserved2[1];
|
||||
private fixed int Reserved3[2];
|
||||
private readonly int Ldr;
|
||||
public readonly int ProcessParameters;
|
||||
private fixed int Reserved4[3];
|
||||
private readonly int AtlThunkSListPtr;
|
||||
private readonly int Reserved5;
|
||||
private readonly uint Reserved6;
|
||||
private readonly int Reserved7;
|
||||
private readonly uint Reserved8;
|
||||
private readonly uint AtlThunkSListPtr32;
|
||||
private fixed int Reserved9[45];
|
||||
private fixed byte Reserved10[96];
|
||||
private readonly int PostProcessInitRoutine;
|
||||
private fixed byte Reserved11[128];
|
||||
private fixed int Reserved12[1];
|
||||
private readonly uint SessionId;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct PEB64
|
||||
{
|
||||
private fixed byte Reserved1[2];
|
||||
private readonly byte BeingDebugged;
|
||||
private fixed byte Reserved2[1];
|
||||
private fixed long Reserved3[2];
|
||||
private readonly long Ldr;
|
||||
public readonly long ProcessParameters;
|
||||
private fixed long Reserved4[3];
|
||||
private readonly long AtlThunkSListPtr;
|
||||
private readonly long Reserved5;
|
||||
private readonly uint Reserved6;
|
||||
private readonly long Reserved7;
|
||||
private readonly uint Reserved8;
|
||||
private readonly uint AtlThunkSListPtr32;
|
||||
private fixed long Reserved9[45];
|
||||
private fixed byte Reserved10[96];
|
||||
private readonly long PostProcessInitRoutine;
|
||||
private fixed byte Reserved11[128];
|
||||
private fixed long Reserved12[1];
|
||||
private readonly uint SessionId;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct RTL_USER_PROCESS_PARAMETERS32
|
||||
{
|
||||
private fixed byte Reserved1[16];
|
||||
private fixed int Reserved2[10];
|
||||
private readonly UNICODE_STRING32 ImagePathName;
|
||||
private readonly UNICODE_STRING32 CommandLine;
|
||||
|
||||
internal readonly int Environment;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct RTL_USER_PROCESS_PARAMETERS64
|
||||
{
|
||||
private fixed byte Reserved1[16];
|
||||
private fixed long Reserved2[10];
|
||||
private readonly UNICODE_STRING64 ImagePathName;
|
||||
private readonly UNICODE_STRING64 CommandLine;
|
||||
|
||||
internal readonly long Environment;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct UNICODE_STRING32
|
||||
{
|
||||
private readonly ushort Length;
|
||||
private readonly ushort MaximumLength;
|
||||
private readonly int Buffer;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal readonly struct UNICODE_STRING64
|
||||
{
|
||||
private readonly ushort Length;
|
||||
private readonly ushort MaximumLength;
|
||||
private readonly long Buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using WinSW.Extensions;
|
||||
using WinSW.Util;
|
||||
using static WinSW.Plugins.SharedDirectoryMapper.NativeMethods;
|
||||
using static WinSW.Plugins.SharedDirectoryMapper.SharedDirectoryMapper.Native;
|
||||
|
||||
namespace WinSW.Plugins.SharedDirectoryMapper
|
||||
{
|
||||
|
@ -91,5 +92,31 @@ namespace WinSW.Plugins.SharedDirectoryMapper
|
|||
Win32Exception inner = new Win32Exception(error);
|
||||
throw new ExtensionException(this.Descriptor.Id, $"{this.DisplayName}: {message} {inner.Message}", inner);
|
||||
}
|
||||
|
||||
internal static class Native
|
||||
{
|
||||
internal const uint RESOURCETYPE_DISK = 0x00000001;
|
||||
|
||||
private const string MprLibraryName = "mpr.dll";
|
||||
|
||||
[DllImport(MprLibraryName, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "WNetAddConnection2W")]
|
||||
internal static extern int WNetAddConnection2(in NETRESOURCE netResource, string? password = null, string? userName = null, uint flags = 0);
|
||||
|
||||
[DllImport(MprLibraryName, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "WNetCancelConnection2W")]
|
||||
internal static extern int WNetCancelConnection2(string name, uint flags = 0, bool force = false);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
internal struct NETRESOURCE
|
||||
{
|
||||
public uint Scope;
|
||||
public uint Type;
|
||||
public uint DisplayType;
|
||||
public uint Usage;
|
||||
public string LocalName;
|
||||
public string RemoteName;
|
||||
public string Comment;
|
||||
public string Provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
<RootNamespace>winsw.Plugins.RunawayProcessKiller</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
|
||||
|
@ -14,7 +12,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\WinSWCore\WinSWCore.csproj" />
|
||||
<ProjectReference Include="..\WinSW.Core\WinSW.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,10 +1,8 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
|
||||
<RootNamespace>winswTests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -26,10 +24,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\ServiceWrapper\winsw.csproj" />
|
||||
<ProjectReference Include="..\..\Core\WinSWCore\WinSWCore.csproj" />
|
||||
<ProjectReference Include="..\..\Plugins\RunawayProcessKiller\RunawayProcessKiller.csproj" />
|
||||
<ProjectReference Include="..\..\Plugins\SharedDirectoryMapper\SharedDirectoryMapper.csproj" />
|
||||
<ProjectReference Include="..\WinSW\WinSW.csproj" />
|
||||
<ProjectReference Include="..\WinSW.Core\WinSW.Core.csproj" />
|
||||
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30128.74
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinSW", "WinSW\WinSW.csproj", "{87BD4253-6957-4D83-B75D-5C4C2F114694}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinSW.Core", "WinSW.Core\WinSW.Core.csproj", "{560E6F6A-18DD-4245-AD1A-D02A9AB9CDD7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinSW.Plugins", "WinSW.Plugins\WinSW.Plugins.csproj", "{B50AD8AA-54BD-4FD9-95A9-8AADC84DD46E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinSW.Tests", "WinSW.Tests\WinSW.Tests.csproj", "{691DE22D-4565-4E3C-9CC7-918A0098219E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4975DCF4-C32C-43ED-A731-8FCC1F7E6746}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{87BD4253-6957-4D83-B75D-5C4C2F114694}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{87BD4253-6957-4D83-B75D-5C4C2F114694}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{87BD4253-6957-4D83-B75D-5C4C2F114694}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{87BD4253-6957-4D83-B75D-5C4C2F114694}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{560E6F6A-18DD-4245-AD1A-D02A9AB9CDD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{560E6F6A-18DD-4245-AD1A-D02A9AB9CDD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{560E6F6A-18DD-4245-AD1A-D02A9AB9CDD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{560E6F6A-18DD-4245-AD1A-D02A9AB9CDD7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B50AD8AA-54BD-4FD9-95A9-8AADC84DD46E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B50AD8AA-54BD-4FD9-95A9-8AADC84DD46E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B50AD8AA-54BD-4FD9-95A9-8AADC84DD46E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B50AD8AA-54BD-4FD9-95A9-8AADC84DD46E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{691DE22D-4565-4E3C-9CC7-918A0098219E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{691DE22D-4565-4E3C-9CC7-918A0098219E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{691DE22D-4565-4E3C-9CC7-918A0098219E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{691DE22D-4565-4E3C-9CC7-918A0098219E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A508CEB3-957E-4B4D-9365-60E5A35EA009}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,3 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("WinSW.Tests")]
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -12,8 +12,6 @@
|
|||
<Company>CloudBees, Inc.</Company>
|
||||
<Product>Windows Service Wrapper</Product>
|
||||
<Copyright>Copyright 2008-2016 Oleg Nenashev, CloudBees, Inc. and other contributors</Copyright>
|
||||
<RootNamespace>winsw</RootNamespace>
|
||||
<AssemblyName>WindowsService</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
|
||||
|
@ -31,9 +29,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WinSWCore\WinSWCore.csproj" />
|
||||
<ProjectReference Include="..\..\Plugins\RunawayProcessKiller\RunawayProcessKiller.csproj" />
|
||||
<ProjectReference Include="..\..\Plugins\SharedDirectoryMapper\SharedDirectoryMapper.csproj" />
|
||||
<ProjectReference Include="..\WinSW.Core\WinSW.Core.csproj" />
|
||||
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PublishCoreZip" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'netcoreapp3.1' and '$(RuntimeIdentifier)' == ''">
|
||||
|
@ -67,9 +64,8 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<InputAssemblies>"$(OutDir)$(TargetFileName)"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)WinSWCore.dll"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)SharedDirectoryMapper.dll"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)RunawayProcessKiller.dll"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)WinSW.Core.dll"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)WinSW.Plugins.dll"</InputAssemblies>
|
||||
<InputAssemblies>$(InputAssemblies) "$(OutDir)log4net.dll"</InputAssemblies>
|
||||
<OutputAssembly>"$(ArtifactsDir)WinSW.$(IdentifierSuffix).exe"</OutputAssembly>
|
||||
</PropertyGroup>
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
|
@ -1,91 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30128.74
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "winsw", "Core\ServiceWrapper\winsw.csproj", "{0DE77F55-ADE5-43C1-999A-0BC81153B039}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "winswTests", "Test\winswTests\winswTests.csproj", "{93843402-842B-44B4-B303-AEE829BE0B43}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedDirectoryMapper", "Plugins\SharedDirectoryMapper\SharedDirectoryMapper.csproj", "{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{077C2CEC-B687-4B53-86E9-C1A1BF5554E5}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{BC4AD891-E87E-4F30-867C-FD8084A29E5D}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{5297623A-1A95-4F89-9AAE-DA634081EC86}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinSWCore", "Core\WinSWCore\WinSWCore.csproj", "{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RunawayProcessKiller", "Plugins\RunawayProcessKiller\RunawayProcessKiller.csproj", "{57284B7A-82A4-407A-B706-EBEA6BF8EA13}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AA414F46-B863-473A-A0E0-C2971B3396AE}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
..\samples\sample-complete.xml = ..\samples\sample-complete.xml
|
||||
..\samples\sample-minimal.xml = ..\samples\sample-minimal.xml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13}.Release|Win32.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{0DE77F55-ADE5-43C1-999A-0BC81153B039} = {5297623A-1A95-4F89-9AAE-DA634081EC86}
|
||||
{93843402-842B-44B4-B303-AEE829BE0B43} = {077C2CEC-B687-4B53-86E9-C1A1BF5554E5}
|
||||
{CA5C71DB-C5A8-4C27-BF83-8E6DAED9D6B5} = {BC4AD891-E87E-4F30-867C-FD8084A29E5D}
|
||||
{9D0C63E2-B6FF-4A85-BD36-B3E5D7F27D06} = {5297623A-1A95-4F89-9AAE-DA634081EC86}
|
||||
{57284B7A-82A4-407A-B706-EBEA6BF8EA13} = {BC4AD891-E87E-4F30-867C-FD8084A29E5D}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F9F8AFEA-196D-4041-8441-FABC3B730F9E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Loading…
Reference in New Issue