Sync to Wine-0_9_5:
Vitaliy Margolen <wine-patch@kievinfo.com>
- comctl32: Listview - allow selection toggle with ctrl+space.
Robert Reif <reif@earthlink.net>
- comctl32: Create ipaddress in enabled state.
Thomas Weidenmueller <wine-patches@reactsoft.com>
- comctrl32: ReAlloc should be able to move memory blocks if necessary.
- comctl32: Fix error handling in PSM_ADDPAGE in case of memory
  allocation failure.
Modified: trunk/reactos/lib/comctl32/ipaddress.c
Modified: trunk/reactos/lib/comctl32/listview.c
Modified: trunk/reactos/lib/comctl32/propsheet.c

Modified: trunk/reactos/lib/comctl32/ipaddress.c
--- trunk/reactos/lib/comctl32/ipaddress.c	2006-01-06 19:56:51 UTC (rev 20618)
+++ trunk/reactos/lib/comctl32/ipaddress.c	2006-01-06 19:59:46 UTC (rev 20619)
@@ -189,7 +189,7 @@
     edit.bottom = rcClient.bottom - 2;
 
     infoPtr->Self = hwnd;
-    infoPtr->Enabled = FALSE;
+    infoPtr->Enabled = TRUE;
     infoPtr->Notify = lpCreate->hwndParent;
 
     for (i = 0; i < 4; i++) {
@@ -208,6 +208,7 @@
         part->OrigProc = (WNDPROC)
 		SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC,
 				(DWORD_PTR)IPADDRESS_SubclassProc);
+        EnableWindow(part->EditHwnd, infoPtr->Enabled);
     }
 
     return 0;

Modified: trunk/reactos/lib/comctl32/listview.c
--- trunk/reactos/lib/comctl32/listview.c	2006-01-06 19:56:51 UTC (rev 20618)
+++ trunk/reactos/lib/comctl32/listview.c	2006-01-06 19:59:46 UTC (rev 20619)
@@ -3175,6 +3175,7 @@
   WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL));
   BOOL bResult = FALSE;
 
+  TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
   if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
   {
     if (infoPtr->dwStyle & LVS_SINGLESEL)
@@ -3191,6 +3192,14 @@
       }
       else if (wCtrl)
       {
+        LVITEMW lvItem;
+        lvItem.state = ~LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);
+        lvItem.stateMask = LVIS_SELECTED;
+        LISTVIEW_SetItemState(infoPtr, nItem, &lvItem);
+
+        if (lvItem.state & LVIS_SELECTED)
+            infoPtr->nSelectionMark = nItem;
+
         bResult = LISTVIEW_SetItemFocus(infoPtr, nItem);
       }
       else
@@ -8020,6 +8029,10 @@
 
   switch (nVirtualKey)
   {
+  case VK_SPACE:
+    nItem = infoPtr->nFocusedItem;
+    break;
+
   case VK_RETURN:
     if ((infoPtr->nItemCount > 0) && (infoPtr->nFocusedItem != -1))
     {
@@ -8086,7 +8099,7 @@
     break;
   }
 
-  if ((nItem != -1) && (nItem != infoPtr->nFocusedItem))
+  if ((nItem != -1) && (nItem != infoPtr->nFocusedItem || nVirtualKey == VK_SPACE))
       LISTVIEW_KeySelection(infoPtr, nItem);
 
   return 0;

Modified: trunk/reactos/lib/comctl32/propsheet.c
--- trunk/reactos/lib/comctl32/propsheet.c	2006-01-06 19:56:51 UTC (rev 20618)
+++ trunk/reactos/lib/comctl32/propsheet.c	2006-01-06 19:59:46 UTC (rev 20619)
@@ -2288,6 +2288,7 @@
 static BOOL PROPSHEET_AddPage(HWND hwndDlg,
                               HPROPSHEETPAGE hpage)
 {
+  PropPageInfo * ppi;
   PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
                                                      PropSheetInfoStr);
   HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@@ -2298,9 +2299,13 @@
   /*
    * Allocate and fill in a new PropPageInfo entry.
    */
-  psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage,
-                                                      sizeof(PropPageInfo) *
-                                                      (psInfo->nPages + 1));
+  ppi = (PropPageInfo*) ReAlloc(psInfo->proppage,
+                                sizeof(PropPageInfo) *
+                                (psInfo->nPages + 1));
+  if (!ppi)
+      return FALSE;
+
+  psInfo->proppage = ppi;
   if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
       return FALSE;