mirror of
https://github.com/reactos/reactos.git
synced 2025-05-18 00:31:27 +00:00
Fix formatting which was screwed in 19254.
Code changes will follow later svn path=/trunk/; revision=21467
This commit is contained in:
parent
74c858ab1b
commit
1239653f28
1 changed files with 938 additions and 922 deletions
|
@ -34,7 +34,8 @@ HINSTANCE hDllInstance;
|
|||
HANDLE hThread;
|
||||
|
||||
static BOOL
|
||||
CanDisableDevice(IN DEVINST DevInst,
|
||||
CanDisableDevice(
|
||||
IN DEVINST DevInst,
|
||||
IN HMACHINE hMachine,
|
||||
OUT BOOL *CanDisable)
|
||||
{
|
||||
|
@ -46,7 +47,8 @@ CanDisableDevice(IN DEVINST DevInst,
|
|||
ULONG Status, ProblemNumber;
|
||||
BOOL Ret = FALSE;
|
||||
|
||||
cr = CM_Get_DevNode_Status_Ex(&Status,
|
||||
cr = CM_Get_DevNode_Status_Ex(
|
||||
&Status,
|
||||
&ProblemNumber,
|
||||
DevInst,
|
||||
0,
|
||||
|
@ -66,7 +68,8 @@ CanDisableDevice(IN DEVINST DevInst,
|
|||
|
||||
|
||||
static BOOL
|
||||
IsDeviceStarted(IN DEVINST DevInst,
|
||||
IsDeviceStarted(
|
||||
IN DEVINST DevInst,
|
||||
IN HMACHINE hMachine,
|
||||
OUT BOOL *IsEnabled)
|
||||
{
|
||||
|
@ -74,7 +77,8 @@ IsDeviceStarted(IN DEVINST DevInst,
|
|||
ULONG Status, ProblemNumber;
|
||||
BOOL Ret = FALSE;
|
||||
|
||||
cr = CM_Get_DevNode_Status_Ex(&Status,
|
||||
cr = CM_Get_DevNode_Status_Ex(
|
||||
&Status,
|
||||
&ProblemNumber,
|
||||
DevInst,
|
||||
0,
|
||||
|
@ -90,7 +94,8 @@ IsDeviceStarted(IN DEVINST DevInst,
|
|||
|
||||
|
||||
static BOOL
|
||||
StartDevice(IN HDEVINFO DeviceInfoSet,
|
||||
StartDevice(
|
||||
IN HDEVINFO DeviceInfoSet,
|
||||
IN PSP_DEVINFO_DATA DevInfoData OPTIONAL,
|
||||
IN BOOL bEnable,
|
||||
IN DWORD HardwareProfile OPTIONAL,
|
||||
|
@ -113,12 +118,14 @@ StartDevice(IN HDEVINFO DeviceInfoSet,
|
|||
|
||||
/* ignore errors */
|
||||
LastErr = GetLastError();
|
||||
if (SetupDiSetClassInstallParams(DeviceInfoSet,
|
||||
if (SetupDiSetClassInstallParams(
|
||||
DeviceInfoSet,
|
||||
DevInfoData,
|
||||
&pcp.ClassInstallHeader,
|
||||
sizeof(SP_PROPCHANGE_PARAMS)))
|
||||
{
|
||||
SetupDiCallClassInstaller(DIF_PROPERTYCHANGE,
|
||||
SetupDiCallClassInstaller(
|
||||
DIF_PROPERTYCHANGE,
|
||||
DeviceInfoSet,
|
||||
DevInfoData);
|
||||
}
|
||||
|
@ -129,7 +136,8 @@ StartDevice(IN HDEVINFO DeviceInfoSet,
|
|||
pcp.StateChange = (bEnable ? DICS_ENABLE : DICS_DISABLE);
|
||||
pcp.Scope = DICS_FLAG_CONFIGSPECIFIC;
|
||||
|
||||
if (SetupDiSetClassInstallParams(DeviceInfoSet,
|
||||
if (SetupDiSetClassInstallParams(
|
||||
DeviceInfoSet,
|
||||
DevInfoData,
|
||||
&pcp.ClassInstallHeader,
|
||||
sizeof(SP_PROPCHANGE_PARAMS)) &&
|
||||
|
@ -138,7 +146,8 @@ StartDevice(IN HDEVINFO DeviceInfoSet,
|
|||
DevInfoData))
|
||||
{
|
||||
dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
|
||||
if (SetupDiGetDeviceInstallParams(DeviceInfoSet,
|
||||
if (SetupDiGetDeviceInstallParams(
|
||||
DeviceInfoSet,
|
||||
DevInfoData,
|
||||
&dp))
|
||||
{
|
||||
|
@ -188,7 +197,7 @@ UpdateDriverForPlugAndPlayDevicesA(
|
|||
HardwareIdW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||
if (!HardwareIdW)
|
||||
{
|
||||
SetLastError(ERROR_GEN_FAILURE);
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, HardwareIdW, len);
|
||||
|
@ -198,12 +207,13 @@ UpdateDriverForPlugAndPlayDevicesA(
|
|||
if (!FullInfPathW)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, HardwareIdW);
|
||||
SetLastError(ERROR_GEN_FAILURE);
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, FullInfPathW, len);
|
||||
|
||||
Result = UpdateDriverForPlugAndPlayDevicesW(hwndParent,
|
||||
Result = UpdateDriverForPlugAndPlayDevicesW(
|
||||
hwndParent,
|
||||
HardwareIdW,
|
||||
FullInfPathW,
|
||||
InstallFlags,
|
||||
|
@ -242,7 +252,8 @@ CreateTitleFont(VOID)
|
|||
}
|
||||
|
||||
static VOID
|
||||
CenterWindow(HWND hWnd)
|
||||
CenterWindow(
|
||||
IN HWND hWnd)
|
||||
{
|
||||
HWND hWndParent;
|
||||
RECT rcParent;
|
||||
|
@ -255,7 +266,8 @@ CenterWindow(HWND hWnd)
|
|||
GetWindowRect(hWndParent, &rcParent);
|
||||
GetWindowRect(hWnd, &rcWindow);
|
||||
|
||||
SetWindowPos(hWnd,
|
||||
SetWindowPos(
|
||||
hWnd,
|
||||
HWND_TOP,
|
||||
((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
|
||||
((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
|
||||
|
@ -298,28 +310,28 @@ WelcomeDlgProc(
|
|||
SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
|
||||
|
||||
/* Set title font */
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_WELCOMETITLE,
|
||||
WM_SETFONT,
|
||||
(WPARAM)DevInstData->hTitleFont,
|
||||
(LPARAM)TRUE);
|
||||
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_DEVICE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM) DevInstData->buffer);
|
||||
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_RADIO_AUTO,
|
||||
BM_SETCHECK,
|
||||
(WPARAM) TRUE,
|
||||
(LPARAM) 0);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
|
@ -334,17 +346,15 @@ WelcomeDlgProc(
|
|||
|
||||
case PSN_WIZNEXT:
|
||||
/* Handle a Next button click, if necessary */
|
||||
|
||||
if (SendDlgItemMessage(hwndDlg, IDC_RADIO_AUTO, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED)
|
||||
PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_SEARCHDRV);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -360,7 +370,6 @@ CHSourceDlgProc(
|
|||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
PDEVINSTDATA DevInstData;
|
||||
|
||||
/* Retrieve pointer to the global setup data */
|
||||
|
@ -386,15 +395,15 @@ CHSourceDlgProc(
|
|||
dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
|
||||
SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
|
||||
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_RADIO_SEARCHHERE,
|
||||
BM_SETCHECK,
|
||||
(WPARAM) TRUE,
|
||||
(LPARAM) 0);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
|
@ -415,8 +424,8 @@ CHSourceDlgProc(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -432,7 +441,6 @@ SearchDrvDlgProc(
|
|||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
|
||||
PDEVINSTDATA DevInstData;
|
||||
DWORD dwThreadId;
|
||||
|
||||
|
@ -456,7 +464,8 @@ SearchDrvDlgProc(
|
|||
/* Center the wizard window */
|
||||
CenterWindow (hwndControl);
|
||||
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_DEVICE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
|
@ -465,8 +474,8 @@ SearchDrvDlgProc(
|
|||
/* Hide the system menu */
|
||||
dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
|
||||
SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_SEARCH_FINISHED:
|
||||
{
|
||||
|
@ -478,6 +487,7 @@ SearchDrvDlgProc(
|
|||
PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_FINISHPAGE);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR lpnm = (LPNMHDR)lParam;
|
||||
|
@ -496,6 +506,7 @@ SearchDrvDlgProc(
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PSN_WIZNEXT:
|
||||
/* Handle a Next button click, if necessary */
|
||||
break;
|
||||
|
@ -503,8 +514,8 @@ SearchDrvDlgProc(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -532,8 +543,7 @@ FindDriverProc(
|
|||
if (dwDrives & i)
|
||||
{
|
||||
nType = GetDriveType( drive );
|
||||
if ((nType == DRIVE_CDROM))
|
||||
//if ((nType == DRIVE_CDROM) || (nType == DRIVE_FIXED))
|
||||
if (nType == DRIVE_CDROM)
|
||||
{
|
||||
/* search for inf file */
|
||||
if (SearchDriver ( DevInstData, drive ))
|
||||
|
@ -552,7 +562,8 @@ FindDriverProc(
|
|||
}
|
||||
|
||||
/* update device configuration */
|
||||
if(SetupDiGetDeviceRegistryProperty(DevInstData->hDevInfo,
|
||||
if (SetupDiGetDeviceRegistryProperty(
|
||||
DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
NULL,
|
||||
|
@ -599,20 +610,22 @@ FinishDlgProc(
|
|||
ShowWindow (hwndControl, SW_HIDE);
|
||||
EnableWindow (hwndControl, FALSE);
|
||||
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_DEVICE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM) DevInstData->drvInfoData.Description);
|
||||
|
||||
/* Set title font */
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_FINISHTITLE,
|
||||
WM_SETFONT,
|
||||
(WPARAM)DevInstData->hTitleFont,
|
||||
(LPARAM)TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
|
@ -636,8 +649,8 @@ FinishDlgProc(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -674,7 +687,8 @@ InstFailDlgProc(
|
|||
EnableWindow (hwndControl, FALSE);
|
||||
|
||||
/* Set title font */
|
||||
SendDlgItemMessage(hwndDlg,
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_FINISHTITLE,
|
||||
WM_SETFONT,
|
||||
(WPARAM)DevInstData->hTitleFont,
|
||||
|
@ -682,14 +696,15 @@ InstFailDlgProc(
|
|||
|
||||
/* disable the "do not show this dialog anymore" checkbox
|
||||
if the device cannot be disabled */
|
||||
CanDisableDevice(DevInstData->devInfoData.DevInst,
|
||||
CanDisableDevice(
|
||||
DevInstData->devInfoData.DevInst,
|
||||
NULL,
|
||||
&DisableableDevice);
|
||||
EnableWindow(GetDlgItem(hwndDlg,
|
||||
IDC_DONOTSHOWDLG),
|
||||
EnableWindow(
|
||||
GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG),
|
||||
DisableableDevice);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
|
@ -716,14 +731,20 @@ InstFailDlgProc(
|
|||
NULL,
|
||||
&DisableableDevice) &&
|
||||
DisableableDevice &&
|
||||
IsDeviceStarted(DevInstData->devInfoData.DevInst,
|
||||
IsDeviceStarted(
|
||||
DevInstData->devInfoData.DevInst,
|
||||
NULL,
|
||||
&IsStarted) &&
|
||||
!IsStarted &&
|
||||
SendDlgItemMessage(hwndDlg, IDC_DONOTSHOWDLG, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED)
|
||||
SendDlgItemMessage(
|
||||
hwndDlg,
|
||||
IDC_DONOTSHOWDLG,
|
||||
BM_GETCHECK,
|
||||
(WPARAM) 0, (LPARAM) 0) == BST_CHECKED)
|
||||
{
|
||||
/* disable the device */
|
||||
StartDevice(DevInstData->hDevInfo,
|
||||
StartDevice(
|
||||
DevInstData->hDevInfo,
|
||||
&DevInstData->devInfoData,
|
||||
FALSE,
|
||||
0,
|
||||
|
@ -735,8 +756,8 @@ InstFailDlgProc(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -846,7 +867,8 @@ SearchDriver(
|
|||
{
|
||||
|
||||
_tcscpy(FileName, wfd.cFileName);
|
||||
if (IsDots(FileName)) continue;
|
||||
if (IsDots(FileName))
|
||||
continue;
|
||||
|
||||
if((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
|
@ -1005,7 +1027,6 @@ InstallDriver(
|
|||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
static VOID
|
||||
|
@ -1056,7 +1077,6 @@ DevInstallW(
|
|||
ZeroMemory(&DevInstData, sizeof(DEVINSTDATA));
|
||||
DevInstData.devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */
|
||||
|
||||
|
||||
DevInstData.hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL);
|
||||
if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
@ -1115,7 +1135,8 @@ DevInstallW(
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if(SetupDiGetDeviceRegistryProperty(DevInstData.hDevInfo,
|
||||
if (SetupDiGetDeviceRegistryProperty(
|
||||
DevInstData.hDevInfo,
|
||||
&DevInstData.devInfoData,
|
||||
SPDRP_CONFIGFLAGS,
|
||||
NULL,
|
||||
|
@ -1129,13 +1150,6 @@ DevInstallW(
|
|||
return TRUE;
|
||||
}
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
swprintf(buf, _T("%ld"), GetLastError());
|
||||
MessageBox(0,buf,buf,0);
|
||||
}
|
||||
*/
|
||||
|
||||
TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId);
|
||||
|
||||
|
@ -1209,13 +1223,15 @@ DevInstallW(
|
|||
* @unimplemented
|
||||
*/
|
||||
BOOL WINAPI
|
||||
ClientSideInstallW(IN HWND hWndOwner,
|
||||
ClientSideInstallW(
|
||||
IN HWND hWndOwner,
|
||||
IN DWORD dwUnknownFlags,
|
||||
IN LPWSTR lpNamedPipeName)
|
||||
{
|
||||
/* NOTE: pNamedPipeName is in the format:
|
||||
* "\\.\pipe\PNP_Device_Install_Pipe_0.{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
|
||||
*/
|
||||
FIXME("Stub\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue