Author: ekohl
Date: Tue Dec 25 16:59:57 2007
New Revision: 31433
URL:
http://svn.reactos.org/svn/reactos?rev=31433&view=rev
Log:
Query and set the display string using data length counted in bytes.
Modified:
trunk/reactos/base/applications/screensavers/3dtext/settings.c
Modified: trunk/reactos/base/applications/screensavers/3dtext/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensa…
==============================================================================
--- trunk/reactos/base/applications/screensavers/3dtext/settings.c (original)
+++ trunk/reactos/base/applications/screensavers/3dtext/settings.c Tue Dec 25 16:59:57
2007
@@ -29,14 +29,14 @@
void LoadSettings()
{
HKEY hkey;
- DWORD len = MAX_PATH;
+ DWORD len = MAX_PATH * sizeof(WCHAR);
RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
_T(""), 0, KEY_READ, NULL, &hkey, NULL);
- if(RegQueryValueEx(hkey, _T("DisplayString"), 0, 0, (LPBYTE)m_Text, &len)
!= ERROR_SUCCESS)
+ if (RegQueryValueEx(hkey, _T("DisplayString"), NULL, NULL, (LPBYTE)m_Text,
&len) != ERROR_SUCCESS)
{
- _tcscpy(m_Text , _TEXT("ReactOS Rocks!"));
+ _tcscpy(m_Text, _TEXT("ReactOS Rocks!"));
}
RegCloseKey(hkey);
@@ -49,7 +49,7 @@
RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
_T(""), 0, KEY_WRITE, NULL, &hkey, NULL);
- RegSetValueEx(hkey, _T("DisplayString"), 0, REG_SZ, (BYTE *)&m_Text,
sizeof (m_Text));
+ RegSetValueEx(hkey, _T("DisplayString"), 0, REG_SZ, (LPBYTE)m_Text,
(_tcslen(m_Text) + 1) * sizeof(WCHAR));
RegCloseKey(hkey);
}