fixed a function declaration

some minor formatting changes

svn path=/trunk/; revision=24801
This commit is contained in:
Christoph von Wittich 2006-11-22 20:19:12 +00:00
parent f0e69a1925
commit d26cca517a
2 changed files with 18 additions and 18 deletions

View file

@ -80,7 +80,7 @@ GetServices ( void )
SC_HANDLE hService; SC_HANDLE hService;
DWORD BytesNeeded = 0; DWORD BytesNeeded = 0;
DWORD ResumeHandle = 0; DWORD ResumeHandle = 0;
DWORD NumServices = 0; DWORD NumServices = 0;
DWORD dwHandle, dwLen; DWORD dwHandle, dwLen;
size_t Index; size_t Index;
UINT BufLen; UINT BufLen;
@ -105,7 +105,7 @@ GetServices ( void )
{ {
/* reserve memory for service info array */ /* reserve memory for service info array */
pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (!pServiceStatus) if (!pServiceStatus)
return; return;
/* fill array with service info */ /* fill array with service info */
@ -137,7 +137,7 @@ GetServices ( void )
BytesNeeded = 0; BytesNeeded = 0;
hService = OpenService(ScHandle, pServiceStatus[Index].lpServiceName, SC_MANAGER_CONNECT); hService = OpenService(ScHandle, pServiceStatus[Index].lpServiceName, SC_MANAGER_CONNECT);
if (hService != INVALID_HANDLE_VALUE) if (hService != INVALID_HANDLE_VALUE)
{ {
/* check if service is required by the system*/ /* check if service is required by the system*/
if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, 0, &BytesNeeded)) if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, 0, &BytesNeeded))
@ -145,7 +145,7 @@ GetServices ( void )
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{ {
pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (pServiceFailureActions == NULL) if (pServiceFailureActions == NULL)
return; return;
if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, BytesNeeded, &BytesNeeded)) if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, BytesNeeded, &BytesNeeded))
@ -183,7 +183,7 @@ GetServices ( void )
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{ {
pServiceConfig = (LPQUERY_SERVICE_CONFIG) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); pServiceConfig = (LPQUERY_SERVICE_CONFIG) HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
if (pServiceConfig == NULL) if (pServiceConfig == NULL)
return; return;
if (!QueryServiceConfig(hService, pServiceConfig, BytesNeeded, &BytesNeeded)) if (!QueryServiceConfig(hService, pServiceConfig, BytesNeeded, &BytesNeeded))
@ -215,7 +215,7 @@ GetServices ( void )
if (dwLen) if (dwLen)
{ {
lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);
if (lpData == NULL) if (lpData == NULL)
return; return;
if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData))
@ -231,12 +231,12 @@ GetServices ( void )
wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID); wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);
} }
if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) if (VerQueryValue (lpData, szStrFileInfo, (void**) &lpBuffer, (PUINT) &BufLen))
{ {
item.pszText = lpBuffer; item.pszText = lpBuffer;
item.iSubItem = 2; item.iSubItem = 2;
SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
} }
HeapFree(GetProcessHeap(), 0, lpData); HeapFree(GetProcessHeap(), 0, lpData);
} }
else else
@ -259,6 +259,6 @@ GetServices ( void )
HeapFree(GetProcessHeap(), 0, pServiceStatus); HeapFree(GetProcessHeap(), 0, pServiceStatus);
CloseServiceHandle(ScHandle); CloseServiceHandle(ScHandle);
} }
} }

View file

@ -14,7 +14,7 @@ HWND hStartupListCtrl;
HWND hStartupDialog; HWND hStartupDialog;
void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName );
void GetDisabledAutostartEntriesFromRegistry (); void GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath);
INT_PTR CALLBACK INT_PTR CALLBACK
StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
@ -78,7 +78,7 @@ GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath)
{ {
HKEY hKey, hSubKey; HKEY hKey, hSubKey;
DWORD Index, SubIndex, dwValues, dwSubValues, retVal; DWORD Index, SubIndex, dwValues, dwSubValues, retVal;
DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME;
LV_ITEM item; LV_ITEM item;
TCHAR* Data; TCHAR* Data;
TCHAR szValueName[MAX_KEY_LENGTH]; TCHAR szValueName[MAX_KEY_LENGTH];
@ -89,7 +89,7 @@ GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath)
{ {
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{ {
for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++)
{ {
dwValueLength = MAX_KEY_LENGTH; dwValueLength = MAX_KEY_LENGTH;
dwDataLength = MAX_VALUE_NAME; dwDataLength = MAX_VALUE_NAME;
@ -105,7 +105,7 @@ GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath)
item.pszText = szValueName; item.pszText = szValueName;
item.iItem = ListView_GetItemCount(hStartupListCtrl); item.iItem = ListView_GetItemCount(hStartupListCtrl);
item.lParam = 0; item.lParam = 0;
(void)ListView_InsertItem(hStartupListCtrl, &item); (void)ListView_InsertItem(hStartupListCtrl, &item);
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, szSubPath, 0, KEY_READ | KEY_ENUMERATE_SUB_KEYS, &hSubKey) == ERROR_SUCCESS) if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, szSubPath, 0, KEY_READ | KEY_ENUMERATE_SUB_KEYS, &hSubKey) == ERROR_SUCCESS)
{ {
if (RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwSubValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) if (RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwSubValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
@ -121,7 +121,7 @@ GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath)
GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); GetLongPathName(Data, Data, (DWORD) _tcsclen(Data));
item.pszText = Data; item.pszText = Data;
item.iSubItem = 1; item.iSubItem = 1;
SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
} }
else if (!_tcscmp(szSubValueName, _T("key")) || !_tcscmp(szSubValueName, _T("location"))) else if (!_tcscmp(szSubValueName, _T("key")) || !_tcscmp(szSubValueName, _T("location")))
{ {
@ -154,7 +154,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
{ {
HKEY hKey; HKEY hKey;
DWORD Index, dwValues, retVal, dwType; DWORD Index, dwValues, retVal, dwType;
DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME;
TCHAR* Data; TCHAR* Data;
TCHAR lpValueName[MAX_KEY_LENGTH]; TCHAR lpValueName[MAX_KEY_LENGTH];
TCHAR Path[MAX_KEY_LENGTH + 5]; TCHAR Path[MAX_KEY_LENGTH + 5];
@ -164,7 +164,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
{ {
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{ {
for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++)
{ {
dwValueLength = MAX_KEY_LENGTH; dwValueLength = MAX_KEY_LENGTH;
dwDataLength = MAX_VALUE_NAME; dwDataLength = MAX_VALUE_NAME;
@ -172,7 +172,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
if (Data == NULL) if (Data == NULL)
break; break;
retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength);
if (retVal == ERROR_SUCCESS) if (retVal == ERROR_SUCCESS)
{ {
memset(&item, 0, sizeof(LV_ITEM)); memset(&item, 0, sizeof(LV_ITEM));
item.mask = LVIF_TEXT; item.mask = LVIF_TEXT;
@ -190,7 +190,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName )
item.iSubItem = 1; item.iSubItem = 1;
SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
} }
switch (PtrToLong(hRootKey)) switch (PtrToLong(hRootKey))
{ {
case PtrToLong(HKEY_LOCAL_MACHINE): case PtrToLong(HKEY_LOCAL_MACHINE):