forked from wakatime/ssms-wakatime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeMethods.cs
More file actions
28 lines (25 loc) · 1.21 KB
/
Copy pathNativeMethods.cs
File metadata and controls
28 lines (25 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace WakaTime
{
internal static class NativeMethods
{
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern bool WritePrivateProfileString(
[MarshalAs(UnmanagedType.LPWStr)] string section,
[MarshalAs(UnmanagedType.LPWStr)] string key,
[MarshalAs(UnmanagedType.LPWStr)] string val,
[MarshalAs(UnmanagedType.LPWStr)] string filePath);
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern UInt32 GetPrivateProfileString(
[MarshalAs(UnmanagedType.LPWStr)] string section,
[MarshalAs(UnmanagedType.LPWStr)] string key,
[MarshalAs(UnmanagedType.LPWStr)] string def,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder retVal, int size,
[MarshalAs(UnmanagedType.LPWStr)] string filePath);
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool wow64Process);
}
}