RtlInitUnicodeString is only legal with nullterminated strings and also the string in initialized manually below...

svn path=/trunk/; revision=18488
This commit is contained in:
Gunnar Dalsnes 2005-10-16 01:22:18 +00:00
parent a17ada0615
commit 819d130a5a

View file

@ -105,10 +105,11 @@ GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount)
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
RtlInitUnicodeString(&FormatName, lpBuffer);
FormatName.Length = 0;
FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR);
FormatName.Buffer = lpBuffer;
Length = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount);
DPRINT("GetClipboardFormatNameA(%x): %S\n", format, lpBuffer);
HEAP_strcpyWtoA(lpszFormatName, lpBuffer, Length);