msvcrt: Implemented _ltoa_s.
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 08942ae..4d26904 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -862,9 +862,9 @@
 @ cdecl _lseek(long long long) msvcrt._lseek
 @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64
 @ cdecl _ltoa(long ptr long) msvcrt._ltoa
-@ stub _ltoa_s
+@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s
 @ cdecl _ltow(long ptr long) msvcrt._ltow
-@ stub _ltow_s
+@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s
 @ cdecl _makepath(ptr str str str str) msvcrt._makepath
 @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s
 @ cdecl _malloc_crt(long) msvcrt.malloc
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 2052fde..a65a89d 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -708,9 +708,9 @@
 @ cdecl _lseek(long long long) msvcrt._lseek
 @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64
 @ cdecl _ltoa(long ptr long) msvcrt._ltoa
-@ stub _ltoa_s
+@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s
 @ cdecl _ltow(long ptr long) msvcrt._ltow
-@ stub _ltow_s
+@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s
 @ cdecl _makepath(ptr str str str str) msvcrt._makepath
 @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s
 @ cdecl _malloc_crt(long) msvcrt.malloc
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 2fde5eb..64332f5 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -696,9 +696,9 @@
 @ cdecl _lseek(long long long) msvcrt._lseek
 @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64
 @ cdecl _ltoa(long ptr long) msvcrt._ltoa
-@ stub _ltoa_s
+@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s
 @ cdecl _ltow(long ptr long) msvcrt._ltow
-@ stub _ltow_s
+@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s
 @ cdecl _makepath(ptr str str str str) msvcrt._makepath
 @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s
 @ cdecl _malloc_crt(long) msvcrt.malloc
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 9602f3d..00ba5ea 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -639,9 +639,9 @@
 @ cdecl _lseek(long long long) MSVCRT__lseek
 @ cdecl -ret64 _lseeki64(long int64 long) MSVCRT__lseeki64
 @ cdecl _ltoa(long ptr long) ntdll._ltoa
-# stub _ltoa_s
+@ cdecl _ltoa_s(long ptr long long) ntdll._ltoa_s
 @ cdecl _ltow(long ptr long) ntdll._ltow
-# stub _ltow_s
+@ cdecl _ltow_s(long ptr long long) ntdll._ltow_s
 @ cdecl _makepath(ptr str str str str)
 @ cdecl _makepath_s(ptr long str str str str)
 # stub _malloc_dbg
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index d657fc3..d807c14 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -709,11 +709,12 @@
 }
 
 /*********************************************************************
- *  _itoa_s (MSVCRT.@)
+ *  _ltoa_s (MSVCRT.@)
  */
-int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix)
+int CDECL _ltoa_s(MSVCRT_long value, char *str, MSVCRT_size_t size, int radix)
 {
-    unsigned int val, digit;
+    MSVCRT_ulong val;
+    unsigned int digit;
     int is_negative;
     char buffer[33], *pos;
     size_t len;
@@ -786,11 +787,12 @@
 }
 
 /*********************************************************************
- *  _itow_s (MSVCRT.@)
+ *  _ltow_s (MSVCRT.@)
  */
-int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
+int CDECL _ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
 {
-    unsigned int val, digit;
+    MSVCRT_ulong val;
+    unsigned int digit;
     int is_negative;
     MSVCRT_wchar_t buffer[33], *pos;
     size_t len;
@@ -863,6 +865,22 @@
 }
 
 /*********************************************************************
+ *  _itoa_s (MSVCRT.@)
+ */
+int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix)
+{
+    return _ltoa_s(value, str, size, radix);
+}
+
+/*********************************************************************
+ *  _itow_s (MSVCRT.@)
+ */
+int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
+{
+    return _ltow_s(value, str, size, radix);
+}
+
+/*********************************************************************
  *  _ui64toa_s (MSVCRT.@)
  */
 int CDECL MSVCRT__ui64toa_s(unsigned __int64 value, char *str,