make GedMurphy happy
[reactos.git] / reactos / subsys / system / servman / query.c
index 2052cbe..af643ab 100644 (file)
@@ -32,6 +32,9 @@ RefreshServiceList(VOID)
     TCHAR szStatus[128];\r
     DWORD NumServices = 0;\r
     DWORD Index;\r
     TCHAR szStatus[128];\r
     DWORD NumServices = 0;\r
     DWORD Index;\r
+    LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s");\r
+\r
+    ListView_DeleteAllItems(hListView);\r
 \r
     NumServices = GetServiceList();\r
 \r
 \r
     NumServices = GetServiceList();\r
 \r
@@ -39,11 +42,11 @@ RefreshServiceList(VOID)
     {\r
         HICON hiconItem;     /* icon for list-view items */\r
         HIMAGELIST hSmall;   /* image list for other views */\r
     {\r
         HICON hiconItem;     /* icon for list-view items */\r
         HIMAGELIST hSmall;   /* image list for other views */\r
-        TCHAR buf[256];\r
+        TCHAR buf[300];\r
 \r
         /* Create the icon image lists */\r
         hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),\r
 \r
         /* Create the icon image lists */\r
         hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),\r
-            GetSystemMetrics(SM_CYSMICON), ILC_MASK, 1, 1);\r
+            GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR16, 1, 1);\r
 \r
         /* Add an icon to each image list */\r
         hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
 \r
         /* Add an icon to each image list */\r
         hiconItem = LoadImage(hInstance, MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
@@ -53,7 +56,7 @@ RefreshServiceList(VOID)
 \r
         /* set the number of services in the status bar */\r
         LoadString(hInstance, IDS_SERVICES_NUM_SERVICES, szNumServices, 32);\r
 \r
         /* set the number of services in the status bar */\r
         LoadString(hInstance, IDS_SERVICES_NUM_SERVICES, szNumServices, 32);\r
-        _stprintf(buf, szNumServices, NumServices);\r
+        _sntprintf(buf, 300, szNumServices, NumServices);\r
         SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf);\r
 \r
 \r
         SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)buf);\r
 \r
 \r
@@ -67,7 +70,7 @@ RefreshServiceList(VOID)
             DWORD dwValueSize;\r
 \r
              /* open the registry key for the service */\r
             DWORD dwValueSize;\r
 \r
              /* open the registry key for the service */\r
-            _stprintf(buf, _T("System\\CurrentControlSet\\Services\\%s"),\r
+            _sntprintf(buf, 300, Path,\r
                       pServiceStatus[Index].lpServiceName);\r
 \r
             if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r
                       pServiceStatus[Index].lpServiceName);\r
 \r
             if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,\r