fix compile with msvc
[reactos.git] / reactos / subsys / system / devmgr / devmgr.c
index a30a71d..0b2bf6e 100644 (file)
@@ -12,7 +12,9 @@
 #include <commctrl.h>
 #include <windows.h>
 #include <commctrl.h>
-
+#if defined (__GNUC__)
+#include <winioctl.h>
+#endif
 
 /* FIXME: should be in cfgmgr32.h */
 typedef DWORD               CONFIGRET;
@@ -93,6 +95,8 @@ void ListByClass()
        long Size;
        long rc;
 
+       SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);
+
        ListView_DeleteAllItems(hwndListView);
        while (1)
        {
@@ -187,6 +191,7 @@ void ListByClass()
                }
                SetupDiDestroyDeviceInfoList(hDevInfo);
        }
+       SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);
 }
 
 CONFIGRET GetDeviceName(DEVINST DevInst, LPTSTR Buffer, DWORD BufferLength)
@@ -271,8 +276,9 @@ int ListByConnection()
                _tprintf(_T("CM_Locate_DevNode() failed, cr= 0x%lx\n"), cr);
                return 1;
        }
-
+       SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);
        cr = ListSubNodes(root, 0);
+       SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);
        if (cr != CR_SUCCESS)
                return 2;
        return 0;
@@ -304,6 +310,7 @@ int ListByInterface(const GUID* guid)
 
        i = 0;
        DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
+       SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);
        while (TRUE)
        {
                if (!SetupDiEnumDeviceInterfaces(
@@ -332,13 +339,11 @@ int ListByInterface(const GUID* guid)
                }
 
        }
+       SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);
        SetupDiDestroyDeviceInfoList(hDevInfo);
        return 0;
 }
 
-DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR,
-  0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
-
 /*int main(void)
 {
        ListByClass();
@@ -484,6 +489,7 @@ switch (uMessage)
       ResizeListView(hWnd);
       break;
    case WM_DESTROY:
+      ReleaseDC(hWnd, hDC);
       PostQuitMessage(0);
       break;
    case WM_COMMAND: