1 |
william |
722 |
using System; |
2 |
|
|
using System.Collections.Generic; |
3 |
|
|
using System.Linq; |
4 |
|
|
using System.Text; |
5 |
|
|
using System.Security; |
6 |
|
|
using System.Security.Permissions; |
7 |
|
|
using System.Runtime.InteropServices; |
8 |
|
|
|
9 |
|
|
namespace RomCheater.UserSettingsSupport |
10 |
|
|
{ |
11 |
|
|
[SuppressUnmanagedCodeSecurity, HostProtection(SecurityAction.LinkDemand, MayLeakOnAbort = true)] |
12 |
|
|
internal static class UnsafeNativeMethods |
13 |
|
|
{ |
14 |
|
|
[StructLayout(LayoutKind.Sequential)] |
15 |
|
|
public struct WIN32_FILE_ATTRIBUTE_DATA |
16 |
|
|
{ |
17 |
|
|
internal int fileAttributes; |
18 |
|
|
internal uint ftCreationTimeLow; |
19 |
|
|
internal uint ftCreationTimeHigh; |
20 |
|
|
internal uint ftLastAccessTimeLow; |
21 |
|
|
internal uint ftLastAccessTimeHigh; |
22 |
|
|
internal uint ftLastWriteTimeLow; |
23 |
|
|
internal uint ftLastWriteTimeHigh; |
24 |
|
|
internal uint fileSizeHigh; |
25 |
|
|
internal uint fileSizeLow; |
26 |
|
|
} |
27 |
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto)] |
28 |
|
|
public static extern int GetModuleFileName(HandleRef hModule, StringBuilder buffer, int length); |
29 |
|
|
|
30 |
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] |
31 |
|
|
internal static extern bool GetFileAttributesEx(string name, int fileInfoLevel, out WIN32_FILE_ATTRIBUTE_DATA data); |
32 |
|
|
|
33 |
|
|
} |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
|