wine/ include/winternl.h dlls/ntdll/rtlstr.c d ...

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 7 05:14:45 CST 2005


ChangeSet ID:	21135
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/07 05:14:45

Modified files:
	include        : winternl.h 
	dlls/ntdll     : rtlstr.c ntdll.spec 

Log message:
	Ivan Leo Puoti <ivanleo at gmail.com>
	Implement RtlInitAnsiStringEx.

Patch: http://cvs.winehq.org/patch.py?id=21135

Old revision  New revision  Changes     Path
 1.167         1.168         +1 -0       wine/include/winternl.h
 1.55          1.56          +33 -0      wine/dlls/ntdll/rtlstr.c
 1.200         1.201         +1 -0       wine/dlls/ntdll/ntdll.spec

Index: wine/include/winternl.h
diff -u -p wine/include/winternl.h:1.167 wine/include/winternl.h:1.168
--- wine/include/winternl.h:1.167	7 Nov 2005 11:14:45 -0000
+++ wine/include/winternl.h	7 Nov 2005 11:14:45 -0000
@@ -2070,6 +2070,7 @@ PVOID     WINAPI RtlImageRvaToVa(const I
 NTSTATUS  WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
 void      WINAPI RtlInitString(PSTRING,PCSZ);
 void      WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
+NTSTATUS  WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
 void      WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
 NTSTATUS  WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
 NTSTATUS  WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
Index: wine/dlls/ntdll/rtlstr.c
diff -u -p wine/dlls/ntdll/rtlstr.c:1.55 wine/dlls/ntdll/rtlstr.c:1.56
--- wine/dlls/ntdll/rtlstr.c:1.55	7 Nov 2005 11:14:45 -0000
+++ wine/dlls/ntdll/rtlstr.c	7 Nov 2005 11:14:45 -0000
@@ -102,6 +102,39 @@ void WINAPI RtlInitAnsiString(
     else target->Length = target->MaximumLength = 0;
 }
 
+/**************************************************************************
+ *      RtlInitAnsiStringEx   (NTDLL.@)
+ *
+ * Initializes a buffered ansi string.
+ *
+ * RETURNS
+ *  An appropriate NTSTATUS value.
+ *
+ * NOTES
+ *  Assigns source to target->Buffer. The length of source is assigned to
+ *  target->Length and target->MaximumLength. If source is NULL the length
+ *  of source is assumed to be 0.
+ */
+NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING target, PCSZ source)
+{
+    if (source)
+    {
+        unsigned int len = strlen(source);
+        if (len+1 > 0xffff)
+            return STATUS_NAME_TOO_LONG;
+
+        target->Buffer = (PCHAR) source;
+        target->Length = len;
+        target->MaximumLength = len + 1;
+    }
+    else
+    {
+        target->Buffer = NULL;
+        target->Length = 0;
+        target->MaximumLength = 0;
+    }
+    return STATUS_SUCCESS;
+}
 
 /**************************************************************************
  *      RtlInitString   (NTDLL.@)
Index: wine/dlls/ntdll/ntdll.spec
diff -u -p wine/dlls/ntdll/ntdll.spec:1.200 wine/dlls/ntdll/ntdll.spec:1.201
--- wine/dlls/ntdll/ntdll.spec:1.200	7 Nov 2005 11:14:45 -0000
+++ wine/dlls/ntdll/ntdll.spec	7 Nov 2005 11:14:45 -0000
@@ -650,6 +650,7 @@
 @ stdcall RtlImageRvaToVa(ptr long long ptr)
 @ stdcall RtlImpersonateSelf(long)
 @ stdcall RtlInitAnsiString(ptr str)
+@ stdcall RtlInitAnsiStringEx(ptr str)
 @ stub RtlInitCodePageTable
 # @ stub RtlInitMemoryStream
 @ stub RtlInitNlsTables



More information about the wine-cvs mailing list