From 87026354cb4e7fd637e29486e87e80f36c3800af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 29 May 2014 23:20:31 +0000 Subject: [PATCH] [USERINIT] - Remove two unuseful imports. - Rewrite StrToColorref to not use shell functions, and increase a bit the size of the szColor buffer in SetUserSysColors to match the capabilities of windows. svn path=/trunk/; revision=63498 --- reactos/base/system/userinit/CMakeLists.txt | 2 +- reactos/base/system/userinit/userinit.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/reactos/base/system/userinit/CMakeLists.txt b/reactos/base/system/userinit/CMakeLists.txt index e66a520136c..52354f37f79 100644 --- a/reactos/base/system/userinit/CMakeLists.txt +++ b/reactos/base/system/userinit/CMakeLists.txt @@ -2,5 +2,5 @@ add_executable(userinit userinit.c userinit.rc) target_link_libraries(userinit wine) set_module_type(userinit win32gui UNICODE) -add_importlibs(userinit user32 gdi32 advapi32 shell32 shlwapi msvcrt kernel32 ntdll) +add_importlibs(userinit user32 advapi32 shell32 msvcrt kernel32 ntdll) add_cd_file(TARGET userinit DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/system/userinit/userinit.c b/reactos/base/system/userinit/userinit.c index 7362a10733c..717b81843e6 100644 --- a/reactos/base/system/userinit/userinit.c +++ b/reactos/base/system/userinit/userinit.c @@ -227,7 +227,7 @@ StartAutoApplications( { if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (findData.nFileSizeHigh || findData.nFileSizeLow)) { - memset(&ExecInfo, 0x0, sizeof(SHELLEXECUTEINFOW)); + ZeroMemory(&ExecInfo, sizeof(SHELLEXECUTEINFOW)); ExecInfo.cbSize = sizeof(ExecInfo); wcscpy(&szPath[len+1], findData.cFileName); ExecInfo.lpVerb = L"open"; @@ -430,11 +430,9 @@ COLORREF StrToColorref( TRACE("(%s)\n", debugstr_w(lpszCol)); - rgb[0] = StrToIntW(lpszCol); - lpszCol = StrChrW(lpszCol, L' ') + 1; - rgb[1] = StrToIntW(lpszCol); - lpszCol = StrChrW(lpszCol, L' ') + 1; - rgb[2] = StrToIntW(lpszCol); + rgb[0] = (BYTE)wcstoul(lpszCol, &lpszCol, 10); + rgb[1] = (BYTE)wcstoul(lpszCol, &lpszCol, 10); + rgb[2] = (BYTE)wcstoul(lpszCol, &lpszCol, 10); return RGB(rgb[0], rgb[1], rgb[2]); } @@ -443,7 +441,7 @@ VOID SetUserSysColors(VOID) { HKEY hKey; INT i; - WCHAR szColor[20]; + WCHAR szColor[25]; DWORD Type, Size; COLORREF crColor; LONG rc;