Author: hbelusca
Date: Sun Mar 5 01:20:40 2017
New Revision: 74071
URL:
http://svn.reactos.org/svn/reactos?rev=74071&view=rev
Log:
[USER32]: Use RtlInitEmptyUnicodeString where needed. Fix CID 1401230 and CID 701428 in
the process.
Modified:
trunk/reactos/win32ss/user/user32/windows/class.c
Modified: trunk/reactos/win32ss/user/user32/windows/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] Sun Mar 5 01:20:40
2017
@@ -215,8 +215,7 @@
{
if (IS_ATOM(pszClass))
{
- ClassName.Buffer = ClassNameBuf;
- ClassName.MaximumLength = sizeof(ClassNameBuf);
+ RtlInitEmptyUnicodeString(&ClassName, ClassNameBuf,
sizeof(ClassNameBuf));
if (!NtUserGetAtomName(LOWORD((DWORD_PTR)pszClass), &ClassName))
{
ERR("Error while verifying ATOM\n");
@@ -1027,8 +1026,9 @@
UNICODE_STRING ClassName;
int Result;
- ClassName.MaximumLength = nMaxCount * sizeof(WCHAR);
- ClassName.Buffer = lpClassName;
+ RtlInitEmptyUnicodeString(&ClassName,
+ lpClassName,
+ nMaxCount * sizeof(WCHAR));
Result = NtUserGetClassName(hWnd,
FALSE,
@@ -1214,8 +1214,10 @@
UINT cchType)
{
UNICODE_STRING ClassName;
- ClassName.MaximumLength = cchType * sizeof(WCHAR);
- ClassName.Buffer = (PWSTR)pszType;
+
+ RtlInitEmptyUnicodeString(&ClassName,
+ pszType,
+ cchType * sizeof(WCHAR));
return NtUserGetClassName(hwnd,TRUE,&ClassName);
}