fixed some bugs

use PCH when building with MSVC

svn path=/trunk/; revision=20719
This commit is contained in:
Christoph von Wittich
2006-01-08 19:07:16 +00:00
parent 3abd4e8621
commit adee19d592
4 changed files with 25 additions and 11 deletions
@@ -22,4 +22,5 @@
<file>msconfig.c</file>
</compilationunit>
<file>msconfig.rc</file>
<pch>precomp.h</pch>
</module>
+4 -2
View File
@@ -19,7 +19,7 @@ ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
hServicesListCtrl = GetDlgItem(hDlg, IDC_SERVICES_LIST);
hServicesDialog = hDlg;
dwStyle = SendMessage(hServicesListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = (DWORD) SendMessage(hServicesListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
SendMessage(hServicesListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
@@ -93,7 +93,7 @@ GetServices ( void )
{
/* reserve memory for service info array */
pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (pServiceStatus == NULL)
if (!pServiceStatus)
return;
/* fill array with service info */
@@ -111,6 +111,8 @@ GetServices ( void )
if (NumServices)
{
if (!pServiceStatus)
return;
for (Index = 0; Index < NumServices; Index++)
{
memset(&item, 0, sizeof(LV_ITEM));
+19 -8
View File
@@ -19,7 +19,7 @@ StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
hStartupListCtrl = GetDlgItem(hDlg, IDC_STARTUP_LIST);
hStartupDialog = hDlg;
dwStyle = SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = (DWORD) SendMessage(hStartupListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
SendMessage(hStartupListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
@@ -62,7 +62,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
HKEY hKey;
DWORD Index, dwValues, retVal, dwType;
DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME;
TCHAR Data[MAX_VALUE_NAME];
TCHAR* Data;
TCHAR lpValueName[MAX_KEY_LENGTH];
TCHAR Path[MAX_KEY_LENGTH + 5];
LV_ITEM item;
@@ -73,8 +73,11 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
{
for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++)
{
dwValueLength = MAX_VALUE_NAME;
dwValueLength = MAX_KEY_LENGTH;
dwDataLength = MAX_VALUE_NAME;
Data = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, MAX_VALUE_NAME);
if (Data == NULL)
break;
retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength);
if (retVal == ERROR_SUCCESS)
{
@@ -88,21 +91,29 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
if (dwType == REG_SZ)
{
GetLongPathName(Data, Data, sizeof(Data));
GetLongPathName(Data, Data, (DWORD) _tcsclen(Data));
item.pszText = Data;
item.iSubItem = 1;
SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
}
if (hRootKey == HKEY_LOCAL_MACHINE)
_tcscpy(Path, _T("HKLM\\"));
if (hRootKey == HKEY_CURRENT_USER)
_tcscpy(Path, _T("HKCU\\"));
switch (PtrToLong(hRootKey))
{
case HKEY_LOCAL_MACHINE:
_tcscpy(Path, _T("HKLM\\\0"));
break;
case HKEY_CURRENT_USER:
_tcscpy(Path, _T("HKCU\\\0"));
break;
default:
_tcscpy(Path, _T("\0"));
}
_tcscat(Path, KeyName);
item.pszText = Path;
item.iSubItem = 2;
SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
HeapFree(GetProcessHeap(), 0, Data);
}
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
hToolsListCtrl = GetDlgItem(hDlg, IDC_TOOLS_LIST);
hToolsDialog = hDlg;
dwStyle = SendMessage(hToolsListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = (DWORD) SendMessage(hToolsListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
SendMessage(hToolsListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);