Add a hack to enable "Do not show this dialog anymore" (still doesn't work)
authorHervé Poussineau <hpoussin@reactos.org>
Thu, 15 Dec 2005 17:40:50 +0000 (17:40 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Thu, 15 Dec 2005 17:40:50 +0000 (17:40 +0000)
Rename IsDeviceEnabled to IsDeviceStarted and EnableDevice to StartDevice

svn path=/trunk/; revision=20191

reactos/lib/newdev/newdev.c

index 688e2b5..edb74b5 100644 (file)
@@ -27,6 +27,10 @@ CanDisableDevice(IN DEVINST DevInst,
                  IN HMACHINE hMachine,
                  OUT BOOL *CanDisable)
 {
                  IN HMACHINE hMachine,
                  OUT BOOL *CanDisable)
 {
+#if 0
+    /* hpoussin, Dec 2005. I've disabled this code because
+     * ntoskrnl never sets the DN_DISABLEABLE flag.
+     */
     CONFIGRET cr;
     ULONG Status, ProblemNumber;
     BOOL Ret = FALSE;
     CONFIGRET cr;
     ULONG Status, ProblemNumber;
     BOOL Ret = FALSE;
@@ -43,11 +47,15 @@ CanDisableDevice(IN DEVINST DevInst,
     }
 
     return Ret;
     }
 
     return Ret;
+#else
+    *CanDisable = TRUE;
+    return TRUE;
+#endif
 }
 
 
 BOOL
 }
 
 
 BOOL
-IsDeviceEnabled(IN DEVINST DevInst,
+IsDeviceStarted(IN DEVINST DevInst,
                 IN HMACHINE hMachine,
                 OUT BOOL *IsEnabled)
 {
                 IN HMACHINE hMachine,
                 OUT BOOL *IsEnabled)
 {
@@ -71,11 +79,11 @@ IsDeviceEnabled(IN DEVINST DevInst,
 
 
 BOOL
 
 
 BOOL
-EnableDevice(IN HDEVINFO DeviceInfoSet,
-             IN PSP_DEVINFO_DATA DevInfoData  OPTIONAL,
-             IN BOOL bEnable,
-             IN DWORD HardwareProfile  OPTIONAL,
-             OUT BOOL *bNeedReboot  OPTIONAL)
+StartDevice(IN HDEVINFO DeviceInfoSet,
+            IN PSP_DEVINFO_DATA DevInfoData  OPTIONAL,
+            IN BOOL bEnable,
+            IN DWORD HardwareProfile  OPTIONAL,
+            OUT BOOL *bNeedReboot  OPTIONAL)
 {
     SP_PROPCHANGE_PARAMS pcp;
     SP_DEVINSTALL_PARAMS dp;
 {
     SP_PROPCHANGE_PARAMS pcp;
     SP_DEVINSTALL_PARAMS dp;
@@ -546,7 +554,7 @@ FindDriverProc(
             DevInstData->hDevInfo,
             &DevInstData->devInfoData,
             SPDRP_CONFIGFLAGS,
             DevInstData->hDevInfo,
             &DevInstData->devInfoData,
             SPDRP_CONFIGFLAGS,
-            NULL, 0 );
+            (BYTE *)&config_flags, sizeof(config_flags) );
     }
 
     PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
     }
 
     PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
@@ -691,24 +699,24 @@ InstFailDlgProc(
             case PSN_WIZFINISH:
             {
                 BOOL DisableableDevice = FALSE;
             case PSN_WIZFINISH:
             {
                 BOOL DisableableDevice = FALSE;
-                BOOL IsEnabled = FALSE;
+                BOOL IsStarted = FALSE;
 
                 if (CanDisableDevice(DevInstData->devInfoData.DevInst,
                                      NULL,
                                      &DisableableDevice) &&
                     DisableableDevice &&
 
                 if (CanDisableDevice(DevInstData->devInfoData.DevInst,
                                      NULL,
                                      &DisableableDevice) &&
                     DisableableDevice &&
-                    IsDeviceEnabled(DevInstData->devInfoData.DevInst,
+                    IsDeviceStarted(DevInstData->devInfoData.DevInst,
                                     NULL,
                                     NULL,
-                                    &IsEnabled) &&
-                    IsEnabled &&
+                                    &IsStarted) &&
+                    !IsStarted &&
                     SendDlgItemMessage(hwndDlg, IDC_DONOTSHOWDLG, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED)
                 {
                     /* disable the device */
                     SendDlgItemMessage(hwndDlg, IDC_DONOTSHOWDLG, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED)
                 {
                     /* disable the device */
-                    EnableDevice(DevInstData->hDevInfo,
-                                 &DevInstData->devInfoData,
-                                 FALSE,
-                                 0,
-                                 NULL);
+                    StartDevice(DevInstData->hDevInfo,
+                                &DevInstData->devInfoData,
+                                FALSE,
+                                0,
+                                NULL);
                 }
                 break;
             }
                 }
                 break;
             }