Index: /trunk/Include/api_system.sbp
===================================================================
--- /trunk/Include/api_system.sbp	(revision 327)
+++ /trunk/Include/api_system.sbp	(revision 328)
@@ -218,4 +218,38 @@
 '----------------------
 ' Kernel Operation API
+#ifdef _WIN64
+Function InterlockedIncrement(ByRef lpAddend As Long) As Long
+	lpAddend++
+	Return lpAddend
+End Function
+Function InterlockedDecrement(ByRef lpAddend As Long) As Long
+	lpAddend--
+	Return lpAddend
+End Function
+Function InterlockedExchange(ByRef Target As Long, Value As Long) As Long
+	Target = Value
+	Return Target
+End Function
+Function InterlockedCompareExchange(ByRef Destination As Long, Exchange As Long, Comperand As Long) As Long
+	InterlockedCompareExchange = Destination
+	If Destination = Comperand Then
+		Destination = Exchange
+	End If
+End Function
+Function InterlockedExchangeAdd(ByRef Addend As Long, Value As Long) As Long
+	InterlockedExchangeAdd = Addend
+	Addend += Value
+End Function
+Function InterlockedExchangePointer(ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
+	Target = Value
+	Return Target
+End Function
+Function InterlockedCompareExchangePointer(ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
+	InterlockedCompareExchangePointer = Destination
+	If Destination = Comperand Then
+		Destination = Exchange
+	End If
+End Function
+#else
 Declare Function InterlockedIncrement Lib "kernel32" (ByRef lpAddend As Long) As Long
 Declare Function InterlockedDecrement Lib "kernel32" (ByRef lpAddend As Long) As Long
@@ -223,8 +257,4 @@
 Declare Function InterlockedCompareExchange Lib "kernel32" (ByRef Destination As Long, Exchange As Long, Comperand As Long) As Long
 Declare Function InterlockedExchangeAdd Lib "kernel32" (ByRef Addend As Long, Value As Long) As Long
-#ifdef _WIN64
-Declare Function InterlockedCompareExchangePointer Lib "kernel32" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
-Declare Function InterlockedExchangePointer Lib "kernel32" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
-#else
 Declare Function InterlockedCompareExchangePointer Lib "kernel32" Alias "InterlockedCompareExchange" (ByRef Destination As VoidPtr, Exchange As VoidPtr, Comperand As VoidPtr) As VoidPtr
 Declare Function InterlockedExchangePointer Lib "kernel32" Alias "InterlockedExchange" (ByRef Target As VoidPtr, Value As VoidPtr) As VoidPtr
