ntdll patch

Ove Kaaven ovehk at ping.uio.no
Sun Apr 15 10:34:26 CDT 2001


One game imported wtoi from msvcrt, which forwarded it to ntdll, which
didn't implement it.

Log:
Ove Kaaven <ovek at transgaming.com>
Implemented _wtoi and _wtol.

Index: wine/dlls/ntdll/ntdll.spec
diff -u wine/dlls/ntdll/ntdll.spec:1.1.1.13 wine/dlls/ntdll/ntdll.spec:1.11
--- wine/dlls/ntdll/ntdll.spec:1.1.1.13	Sat Apr 14 18:49:52 2001
+++ wine/dlls/ntdll/ntdll.spec	Sat Apr 14 19:20:30 2001
@@ -1004,8 +1004,8 @@
 @ stub RtlGuidToPropertySetName
 @ stub RtlClosePropertySet
 @ stub RtlCreatePropertySet
-@ stub _wtoi
-@ stub _wtol
+@ cdecl -noimport _wtoi(wstr) NTDLL__wtoi
+@ cdecl -noimport _wtol(wstr) NTDLL__wtol
 @ stub RtlSetPropertySetClassId
 @ stdcall NtPowerInformation(long long long long long) NtPowerInformation
 
Index: wine/dlls/ntdll/wcstring.c
diff -u wine/dlls/ntdll/wcstring.c:1.1.1.6 wine/dlls/ntdll/wcstring.c:1.2
--- wine/dlls/ntdll/wcstring.c:1.1.1.6	Fri Jan 26 11:14:29 2001
+++ wine/dlls/ntdll/wcstring.c	Sat Apr  7 06:39:28 2001
@@ -338,6 +338,27 @@
     return string;
 }
 
+/*********************************************************************
+ *           _wtol    (NTDLL)
+ * Like atol, but for wide character strings.
+ */
+LONG __cdecl NTDLL__wtol(LPWSTR string)
+{
+    LONG v = 0;
+    LPWSTR sp = string;
+    /* skip whitespace */
+    while (isspace(*sp)) sp++;
+    /* convert */
+    while (isdigit(*sp)) {
+	v = v*10 + ((*sp++) - '0');
+    }
+    return v;
+}
+
+INT __cdecl NTDLL__wtoi(LPWSTR string)
+{
+    return NTDLL__wtol(string);
+}
 
 /* INTERNAL: Wide char snprintf
  * If you fix a bug in this function, fix it in msvcrt/wcs.c also!





More information about the wine-patches mailing list