-/* $Id: class.c,v 1.34 2003/08/19 02:55:53 royce Exp $
+/* $Id: class.c,v 1.35 2003/08/19 23:41:20 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
LPWNDCLASSEXA lpwcx)
{
LPWSTR str;
- UNICODE_STRING str2;
+ UNICODE_STRING str2, str3;
WNDCLASSEXW w;
BOOL retval;
NTSTATUS Status;
}
}
- str2.Length = 0;
- str2.MaximumLength = 255;
+ str2.Length = str3.Length = 0;
+ str2.MaximumLength = str3.MaximumLength = 255;
str2.Buffer = (PWSTR)HEAP_alloc ( str2.MaximumLength * sizeof(WCHAR) );
if ( !str2.Buffer )
{
HEAP_free ( str );
return FALSE;
}
+
+ str3.Buffer = (PWSTR)HEAP_alloc ( str3.MaximumLength * sizeof(WCHAR) );
+ if ( !str3.Buffer )
+ {
+ SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
+ if ( !IS_ATOM(str) )
+ HEAP_free ( str );
+ HEAP_free ( str2.Buffer );
+ return FALSE;
+ }
w.lpszMenuName = (LPCWSTR)&str2;
+ w.lpszClassName = (LPCWSTR)&str3;
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
if(!IS_ATOM(str))
HEAP_free(str);
{
lpwcx->lpszMenuName = heap_string_poolA ( str2.Buffer, str2.Length );
}
+ if ( !IS_INTRESOURCE(w.lpszClassName) && w.lpszClassName )
+ {
+ lpwcx->lpszClassName = heap_string_poolA ( str3.Buffer, str3.Length );
+ }
HEAP_free ( str2.Buffer );
+ HEAP_free ( str3.Buffer );
return retval;
}
LPWNDCLASSEXW lpwcx)
{
LPWSTR str;
- UNICODE_STRING str2;
+ UNICODE_STRING str2, str3;
WNDCLASSEXW w;
WINBOOL retval;
}
}
- str2.Length = 0;
- str2.MaximumLength = 255;
+ str2.Length = str3.Length = 0;
+ str2.MaximumLength = str3.MaximumLength = 255;
str2.Buffer = (PWSTR)HEAP_alloc ( str2.MaximumLength * sizeof(WCHAR) );
if ( !str2.Buffer )
{
HEAP_free ( str );
return FALSE;
}
+
+ str3.Buffer = (PWSTR)HEAP_alloc ( str3.MaximumLength * sizeof(WCHAR) );
+ if ( !str3.Buffer )
+ {
+ SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
+ if ( !IS_ATOM(str) )
+ HEAP_free ( str );
+ HEAP_free ( str2.Buffer );
+ return FALSE;
+ }
w.lpszMenuName = (LPCWSTR)&str2;
+ w.lpszClassName = (LPCWSTR)&str3;
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
if ( !IS_ATOM(str) )
HEAP_free(str);
{
lpwcx->lpszMenuName = heap_string_poolW ( str2.Buffer, str2.Length );
}
+ if ( !IS_INTRESOURCE(w.lpszClassName) && w.lpszClassName )
+ {
+ lpwcx->lpszClassName = heap_string_poolW ( str3.Buffer, str3.Length );
+ }
HEAP_free ( str2.Buffer );
+ HEAP_free ( str3.Buffer );
return retval;
}
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: class.c,v 1.34 2003/08/19 11:48:49 weiden Exp $
+/* $Id: class.c,v 1.35 2003/08/19 23:41:20 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
wcex->hCursor = Class->hCursor;
wcex->hbrBackground = Class->hbrBackground;
if(Class->lpszMenuName)
- RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszMenuName, Class->lpszMenuName);
+ {
+ if(!IS_INTRESOURCE((LPCWSTR)Class->lpszMenuName))
+ RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszMenuName, Class->lpszMenuName);
+ else
+ wcex->lpszMenuName = (LPCWSTR)Class->lpszMenuName;
+ }
else
wcex->lpszMenuName = (LPCWSTR)NULL;
- wcex->lpszClassName = (LPCWSTR)Class->lpszClassName;
+ if(Class->lpszClassName)
+ {
+ if(!IS_ATOM((LPCWSTR)Class->lpszClassName))
+ RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszClassName, Class->lpszClassName);
+ else
+ wcex->lpszClassName = (LPCWSTR)Class->lpszClassName;
+ }
+ else
+ wcex->lpszClassName = (LPCWSTR)NULL;
wcex->hIconSm = Class->hIconSm;
return 1;
}