summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.BuildTasks/NativeMethods.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-01-15 08:06:52 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-01-15 08:06:52 -0800
commitc1ea54f5fb761f388593a484510fc29118a844b5 (patch)
tree6c4399698c525f7860e3750acba7a2a4aa977bc8 /src/DotNetOpenAuth.BuildTasks/NativeMethods.cs
parent098e34ea4f12a3c22d3647e611a13d74e8ce754e (diff)
downloadDotNetOpenAuth-c1ea54f5fb761f388593a484510fc29118a844b5.zip
DotNetOpenAuth-c1ea54f5fb761f388593a484510fc29118a844b5.tar.gz
DotNetOpenAuth-c1ea54f5fb761f388593a484510fc29118a844b5.tar.bz2
Both .vsi and .vsix files are built now!
Diffstat (limited to 'src/DotNetOpenAuth.BuildTasks/NativeMethods.cs')
-rw-r--r--src/DotNetOpenAuth.BuildTasks/NativeMethods.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/NativeMethods.cs b/src/DotNetOpenAuth.BuildTasks/NativeMethods.cs
new file mode 100644
index 0000000..26de3a4
--- /dev/null
+++ b/src/DotNetOpenAuth.BuildTasks/NativeMethods.cs
@@ -0,0 +1,18 @@
+namespace DotNetOpenAuth.BuildTasks {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using System.Runtime.InteropServices;
+
+ internal static class NativeMethods {
+ [DllImport("kernel32", SetLastError = true)]
+ private static extern bool CreateHardLink(string newFileName, string existingFileName, IntPtr securityAttributes);
+
+ internal static void CreateHardLink(string existingFileName, string newFileName) {
+ if (!CreateHardLink(newFileName, existingFileName, IntPtr.Zero)) {
+ Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
+ }
+ }
+ }
+}