[Corrected^2] NTDLL/loader.c: Remove spaces at end of name in
import_dll
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Mon Feb 20 07:08:26 CST 2006
Changelog:
ntdll/loader.c import_dll()
Remove spaces at end of name retrieved with get_rva( module,
descr->Name )
>>>>> "Robert" == Robert Shearman <rob at codeweavers.com> writes:
Robert> This patch still needs work. I don't think you mean to pass in
Robert> buffer to skip_spaces.
Damned cut'and paste.
This time with doing the right thing in the second code path too.
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/ntdll/loader.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/loader.c,v
retrieving revision 1.119
diff -u -r1.119 loader.c
--- wine/dlls/ntdll/loader.c 9 Feb 2006 11:52:50 -0000 1.119
+++ wine/dlls/ntdll/loader.c 18 Feb 2006 18:12:14 -0000
@@ -126,6 +126,15 @@
while (len--) *dst++ = (unsigned char)*src++;
}
+/* Overwrite spaces at end of buffer with NULL */
+inline static void skip_spaces(WCHAR *buffer, size_t len)
+{
+ while (buffer[len -2] == (WCHAR)' ')
+ {
+ buffer[len -2] = 0;
+ len --;
+ }
+}
/*************************************************************************
* call_dll_entry_point
@@ -463,6 +472,7 @@
if (len * sizeof(WCHAR) <= sizeof(buffer))
{
ascii_to_unicode( buffer, name, len );
+ skip_spaces(buffer, len);
status = load_dll( load_path, buffer, 0, &wmImp );
}
else /* need to allocate a larger buffer */
@@ -470,6 +480,7 @@
WCHAR *ptr = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if (!ptr) return NULL;
ascii_to_unicode( ptr, name, len );
+ skip_spaces(ptr, len);
status = load_dll( load_path, ptr, 0, &wmImp );
RtlFreeHeap( GetProcessHeap(), 0, ptr );
}
More information about the wine-patches
mailing list