-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unblock Internet files on startup (#15)
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace CnCNet.LauncherStub; | ||
|
||
internal static class NativeConstants | ||
{ | ||
/// ERROR_FILE_NOT_FOUND -> 2L | ||
public const int ERROR_FILE_NOT_FOUND = 2; | ||
|
||
/// ERROR_ACCESS_DENIED -> 5L | ||
public const int ERROR_ACCESS_DENIED = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace CnCNet.LauncherStub; | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
internal static class NativeMethods | ||
{ | ||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | ||
#if NET45_OR_GREATER || NETSTANDARD || NET | ||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)] | ||
#endif | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool DeleteFile(string name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters