- register the checklist window class when attached to a process
authorThomas Bluemel <thomas@reactsoft.com>
Fri, 4 Nov 2005 18:58:38 +0000 (18:58 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Fri, 4 Nov 2005 18:58:38 +0000 (18:58 +0000)
- fixed usage of image list

svn path=/trunk/; revision=19001

reactos/lib/aclui/aclui.c

index 3a4223f..38fe9e2 100644 (file)
@@ -636,7 +636,6 @@ SecurityPageCallback(IN HWND hwnd,
         case PSPCB_RELEASE:
         {
             DestroySecurityPage(sp);
-            UnregisterCheckListControl();
             return FALSE;
         }
     }
@@ -1214,15 +1213,20 @@ SecurityPageProc(IN HWND hwndDlg,
                                                         MAKEINTRESOURCE(IDB_USRGRPIMAGES),
                                                         16,
                                                         3,
-                                                        0);
+                                                        RGB(255,
+                                                            0,
+                                                            255));
 
                 /* setup the listview control */
-                ListView_SetExtendedListViewStyleEx(sp->hWndPrincipalsList,
-                                                    LVS_EX_FULLROWSELECT,
-                                                    LVS_EX_FULLROWSELECT);
-                ListView_SetImageList(sp->hWndPrincipalsList,
-                                      sp->hiPrincipals,
-                                      LVSIL_SMALL);
+                if (sp->hiPrincipals != NULL)
+                {
+                    ListView_SetExtendedListViewStyleEx(sp->hWndPrincipalsList,
+                                                        LVS_EX_FULLROWSELECT,
+                                                        LVS_EX_FULLROWSELECT);
+                    ListView_SetImageList(sp->hWndPrincipalsList,
+                                          sp->hiPrincipals,
+                                          LVSIL_SMALL);
+                }
 
                 GetClientRect(sp->hWndPrincipalsList,
                               &rcLvClient);
@@ -1329,12 +1333,6 @@ CreateSecurityPage(IN LPSECURITYINFO psi)
         return NULL;
     }
     
-    if (!RegisterCheckListControl(hDllInstance))
-    {
-        DPRINT("Registering the CHECKLIST_ACLUI class failed!\n");
-        return NULL;
-    }
-    
     sPage = HeapAlloc(GetProcessHeap(),
                       HEAP_ZERO_MEMORY,
                       sizeof(SECURITY_PAGE));
@@ -1468,12 +1466,21 @@ DllMain(IN HINSTANCE hinstDLL,
     {
         case DLL_PROCESS_ATTACH:
             hDllInstance = hinstDLL;
+
+            DisableThreadLibraryCalls(hinstDLL);
+
+            if (!RegisterCheckListControl(hinstDLL))
+            {
+                DPRINT("Registering the CHECKLIST_ACLUI class failed!\n");
+                return FALSE;
+            }
             break;
-        case DLL_THREAD_ATTACH:
-        case DLL_THREAD_DETACH:
+
         case DLL_PROCESS_DETACH:
+            UnregisterCheckListControl();
             break;
     }
+
     return TRUE;
 }