ReactOS 0.4.16-dev-2104-gb84fa49
newdev.c
Go to the documentation of this file.
1/*
2 * New device installer (newdev.dll)
3 *
4 * Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
5 * 2005 Christoph von Wittich (Christoph@ActiveVB.de)
6 * 2009 Colin Finck (colin@reactos.org)
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include "newdev_private.h"
24
25#include <stdio.h>
26#include <winnls.h>
27
28/* Global variables */
30
31static BOOL
33 IN PDEVINSTDATA DevInstData,
35 IN LPCWSTR InfFile OPTIONAL);
36
37/*
38* @implemented
39*/
43 IN LPCWSTR HardwareId,
44 IN LPCWSTR FullInfPath,
45 IN DWORD InstallFlags,
46 OUT PBOOL bRebootRequired OPTIONAL)
47{
48 DEVINSTDATA DevInstData;
49 DWORD i;
52 LPCWSTR CurrentHardwareId; /* Pointer into Buffer */
54 BOOL FoundHardwareId, FoundAtLeastOneDevice = FALSE;
55 BOOL ret = FALSE;
56
57 DevInstData.hDevInfo = INVALID_HANDLE_VALUE;
58
59 TRACE("UpdateDriverForPlugAndPlayDevicesW(%p %s %s 0x%x %p)\n",
60 hwndParent, debugstr_w(HardwareId), debugstr_w(FullInfPath), InstallFlags, bRebootRequired);
61
62 /* FIXME: InstallFlags bRebootRequired ignored! */
63
64 /* Check flags */
66 {
67 TRACE("Unknown flags: 0x%08lx\n", InstallFlags & ~(INSTALLFLAG_FORCE | INSTALLFLAG_READONLY | INSTALLFLAG_NONINTERACTIVE));
69 goto cleanup;
70 }
71
72 /* Enumerate all devices of the system */
74 if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE)
75 goto cleanup;
76 DevInstData.devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
77 for (i = 0; ; i++)
78 {
79 if (!SetupDiEnumDeviceInfo(DevInstData.hDevInfo, i, &DevInstData.devInfoData))
80 {
82 {
83 TRACE("SetupDiEnumDeviceInfo() failed with error 0x%x\n", GetLastError());
84 goto cleanup;
85 }
86 /* This error was expected */
87 break;
88 }
89
90 /* Match Hardware ID */
91 FoundHardwareId = FALSE;
93 while (TRUE)
94 {
95 /* Get IDs data */
96 Buffer = NULL;
97 BufferSize = 0;
99 &DevInstData.devInfoData,
100 Property,
101 NULL,
102 (PBYTE)Buffer,
104 &BufferSize))
105 {
107 {
108 break;
109 }
111 {
112 TRACE("SetupDiGetDeviceRegistryPropertyW() failed with error 0x%x\n", GetLastError());
113 goto cleanup;
114 }
115 /* This error was expected */
118 if (!Buffer)
119 {
120 TRACE("HeapAlloc() failed\n", GetLastError());
122 goto cleanup;
123 }
124 }
125 if (Buffer)
126 {
127 /* Check if we match the given hardware ID */
128 for (CurrentHardwareId = Buffer; *CurrentHardwareId != UNICODE_NULL; CurrentHardwareId += wcslen(CurrentHardwareId) + 1)
129 {
130 if (_wcsicmp(CurrentHardwareId, HardwareId) == 0)
131 {
132 FoundHardwareId = TRUE;
133 break;
134 }
135 }
136 }
137 if (FoundHardwareId || Property == SPDRP_COMPATIBLEIDS)
138 {
139 break;
140 }
142 }
143 if (!FoundHardwareId)
144 continue;
145
146 /* We need to try to update the driver of this device */
147
148 /* Get Instance ID */
150 Buffer = NULL;
151 if (SetupDiGetDeviceInstanceIdW(DevInstData.hDevInfo, &DevInstData.devInfoData, NULL, 0, &BufferSize))
152 {
153 /* Error, as the output buffer should be too small */
155 goto cleanup;
156 }
158 {
159 TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError());
160 goto cleanup;
161 }
162 else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize * sizeof(WCHAR))) == NULL)
163 {
164 TRACE("HeapAlloc() failed\n", GetLastError());
166 goto cleanup;
167 }
168 else if (!SetupDiGetDeviceInstanceIdW(DevInstData.hDevInfo, &DevInstData.devInfoData, Buffer, BufferSize, NULL))
169 {
170 TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError());
171 goto cleanup;
172 }
173 TRACE("Trying to update the driver of %s\n", debugstr_w(Buffer));
174
175 /* Search driver in the specified .inf file */
176 if (!SearchDriver(&DevInstData, NULL, FullInfPath))
177 {
178 TRACE("SearchDriver() failed with error 0x%x\n", GetLastError());
179 continue;
180 }
181
182 /* FIXME: HACK! We shouldn't check of ERROR_PRIVILEGE_NOT_HELD */
183 //if (!InstallCurrentDriver(&DevInstData))
185 {
186 TRACE("InstallCurrentDriver() failed with error 0x%x\n", GetLastError());
187 continue;
188 }
189
190 FoundAtLeastOneDevice = TRUE;
191 }
192
193 if (FoundAtLeastOneDevice)
194 {
196 ret = TRUE;
197 }
198 else
199 {
200 TRACE("No device found with HardwareID %s\n", debugstr_w(HardwareId));
202 }
203
204cleanup:
205 if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE)
208 return ret;
209}
210
211/*
212* @implemented
213*/
217 IN LPCSTR HardwareId,
218 IN LPCSTR FullInfPath,
219 IN DWORD InstallFlags,
220 OUT PBOOL bRebootRequired OPTIONAL)
221{
222 BOOL Result;
223 LPWSTR HardwareIdW = NULL;
224 LPWSTR FullInfPathW = NULL;
225
226 int len = MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, NULL, 0);
227 HardwareIdW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
228 if (!HardwareIdW)
229 {
231 return FALSE;
232 }
233 MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, HardwareIdW, len);
234
235 len = MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, NULL, 0);
236 FullInfPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
237 if (!FullInfPathW)
238 {
239 HeapFree(GetProcessHeap(), 0, HardwareIdW);
241 return FALSE;
242 }
243 MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, FullInfPathW, len);
244
247 HardwareIdW,
248 FullInfPathW,
249 InstallFlags,
250 bRebootRequired);
251
252 HeapFree(GetProcessHeap(), 0, HardwareIdW);
253 HeapFree(GetProcessHeap(), 0, FullInfPathW);
254
255 return Result;
256}
257
258/* Directory and InfFile MUST NOT be specified simultaneously */
259static BOOL
261 IN PDEVINSTDATA DevInstData,
263 IN LPCWSTR InfFile OPTIONAL)
264{
265 SP_DEVINSTALL_PARAMS_W DevInstallParams = {0,};
266 BOOL ret;
267
268 DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
269 if (!SetupDiGetDeviceInstallParamsW(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams))
270 {
271 TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%x\n", GetLastError());
272 return FALSE;
273 }
274 DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS;
275
276 if (InfFile)
277 {
278 DevInstallParams.Flags |= DI_ENUMSINGLEINF;
279 wcsncpy(DevInstallParams.DriverPath, InfFile, MAX_PATH);
280 }
281 else if (Directory)
282 {
283 DevInstallParams.Flags &= ~DI_ENUMSINGLEINF;
284 wcsncpy(DevInstallParams.DriverPath, Directory, MAX_PATH);
285 }
286 else
287 {
288 DevInstallParams.Flags &= ~DI_ENUMSINGLEINF;
289 *DevInstallParams.DriverPath = '\0';
290 }
291
293 DevInstData->hDevInfo,
294 &DevInstData->devInfoData,
295 &DevInstallParams);
296 if (!ret)
297 {
298 TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%x\n", GetLastError());
299 return FALSE;
300 }
301
303 DevInstData->hDevInfo,
304 &DevInstData->devInfoData,
306 if (!ret)
307 {
308 TRACE("SetupDiBuildDriverInfoList() failed with error 0x%x\n", GetLastError());
309 return FALSE;
310 }
311
312 DevInstData->drvInfoData.cbSize = sizeof(SP_DRVINFO_DATA);
314 DevInstData->hDevInfo,
315 &DevInstData->devInfoData,
317 0,
318 &DevInstData->drvInfoData);
319 if (!ret)
320 {
322 return FALSE;
323 TRACE("SetupDiEnumDriverInfo() failed with error 0x%x\n", GetLastError());
324 return FALSE;
325 }
326
327 return TRUE;
328}
329
330static BOOL
332{
333 if(wcscmp(str, L".") && wcscmp(str, L"..")) return FALSE;
334 return TRUE;
335}
336
337static LPCWSTR
339{
340 LPCWSTR Dot;
341
342 Dot = wcsrchr(FileName, '.');
343 if (!Dot)
344 return L"";
345
346 return Dot;
347}
348
349static BOOL
351 IN PDEVINSTDATA DevInstData,
353{
355 WCHAR DirPath[MAX_PATH];
357 WCHAR FullPath[MAX_PATH];
358 WCHAR LastDirPath[MAX_PATH] = L"";
359 WCHAR PathWithPattern[MAX_PATH];
360 BOOL ok = TRUE;
361 BOOL retval = FALSE;
362 HANDLE hFindFile = INVALID_HANDLE_VALUE;
363
364 wcscpy(DirPath, Path);
365
366 if (DirPath[wcslen(DirPath) - 1] != '\\')
367 wcscat(DirPath, L"\\");
368
369 wcscpy(PathWithPattern, DirPath);
370 wcscat(PathWithPattern, L"*");
371
372 for (hFindFile = FindFirstFileW(PathWithPattern, &wfd);
373 ok && hFindFile != INVALID_HANDLE_VALUE;
374 ok = FindNextFileW(hFindFile, &wfd))
375 {
376
378 if (IsDots(FileName))
379 continue;
380
382 {
383 /* Recursive search */
384 wcscpy(FullPath, DirPath);
385 wcscat(FullPath, FileName);
386 if (SearchDriverRecursive(DevInstData, FullPath))
387 {
388 retval = TRUE;
389 /* We continue the search for a better driver */
390 }
391 }
392 else
393 {
394 LPCWSTR pszExtension = GetFileExt(FileName);
395
396 if ((_wcsicmp(pszExtension, L".inf") == 0) && (wcscmp(LastDirPath, DirPath) != 0))
397 {
398 wcscpy(LastDirPath, DirPath);
399
400 if (wcslen(DirPath) > MAX_PATH)
401 /* Path is too long to be searched */
402 continue;
403
404 if (SearchDriver(DevInstData, DirPath, NULL))
405 {
406 retval = TRUE;
407 /* We continue the search for a better driver */
408 }
409
410 }
411 }
412 }
413
414 if (hFindFile != INVALID_HANDLE_VALUE)
415 FindClose(hFindFile);
416 return retval;
417}
418
419BOOL
421 _In_ PDEVINSTDATA DevInstData,
423{
424 return SearchDriverRecursive(DevInstData, pszDir);
425}
426
427BOOL
429 IN PDEVINSTDATA DevInstData)
430{
431 BOOL result;
432
433 /* Search in default location */
434 result = SearchDriver(DevInstData, NULL, NULL);
435
436 if (DevInstData->CustomSearchPath)
437 {
438 /* Search only in specified paths */
439 /* We need to check all specified directories to be
440 * sure to find the best driver for the device.
441 */
443 for (Path = DevInstData->CustomSearchPath; *Path != '\0'; Path += wcslen(Path) + 1)
444 {
445 TRACE("Search driver in %s\n", debugstr_w(Path));
446 if (wcslen(Path) == 2 && Path[1] == ':')
447 {
448 if (SearchDriverRecursive(DevInstData, Path))
449 result = TRUE;
450 }
451 else
452 {
453 if (SearchDriver(DevInstData, Path, NULL))
454 result = TRUE;
455 }
456 }
457 }
458
459 return result;
460}
461
462BOOL
464 IN PDEVINSTDATA DevInstData,
465 IN BOOL IncludeRemovableDevices,
466 IN BOOL IncludeCustomPath,
467 IN HWND hwndCombo OPTIONAL)
468{
469 WCHAR drive[] = {'?',':',0};
470 DWORD dwDrives = 0;
471 DWORD i;
472 UINT nType;
473 DWORD CustomTextLength = 0;
476 INT idx = (INT)SendMessageW(hwndCombo, CB_GETCURSEL, 0, 0);
477
478 /* Calculate length needed to store the search paths */
479 if (IncludeRemovableDevices)
480 {
481 dwDrives = GetLogicalDrives();
482 for (drive[0] = 'A', i = 1; drive[0] <= 'Z'; drive[0]++, i <<= 1)
483 {
484 if (dwDrives & i)
485 {
486 nType = GetDriveTypeW(drive);
487 if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM)
488 {
489 LengthNeeded += 3;
490 }
491 }
492 }
493 }
494 if (IncludeCustomPath)
495 {
496 CustomTextLength = 1 + ((idx != CB_ERR) ?
497 (INT)SendMessageW(hwndCombo, CB_GETLBTEXTLEN, idx, 0) : ComboBox_GetTextLength(hwndCombo));
498 LengthNeeded += CustomTextLength;
499 }
500
501 /* Allocate space for search paths */
502 HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath);
503 DevInstData->CustomSearchPath = Buffer = HeapAlloc(
505 0,
506 (LengthNeeded + 1) * sizeof(WCHAR));
507 if (!Buffer)
508 {
509 TRACE("HeapAlloc() failed\n");
511 return FALSE;
512 }
513
514 /* Fill search paths */
515 if (IncludeRemovableDevices)
516 {
517 for (drive[0] = 'A', i = 1; drive[0] <= 'Z'; drive[0]++, i <<= 1)
518 {
519 if (dwDrives & i)
520 {
521 nType = GetDriveTypeW(drive);
522 if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM)
523 {
524 Buffer += 1 + swprintf(Buffer, drive);
525 }
526 }
527 }
528 }
529 if (IncludeCustomPath)
530 {
531 Buffer += 1 + ((idx != CB_ERR) ?
532 SendMessageW(hwndCombo, CB_GETLBTEXT, idx, (LPARAM)Buffer) :
533 GetWindowTextW(hwndCombo, Buffer, CustomTextLength));
534 }
535 *Buffer = '\0';
536
537 return TRUE;
538}
539
540BOOL
542 IN PDEVINSTDATA DevInstData)
543{
544 BOOL ret;
545
546 TRACE("Installing driver %s: %s\n",
547 debugstr_w(DevInstData->drvInfoData.MfgName),
548 debugstr_w(DevInstData->drvInfoData.Description));
549
552 DevInstData->hDevInfo,
553 &DevInstData->devInfoData);
554 if (!ret)
555 {
556 TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%x\n", GetLastError());
557 return FALSE;
558 }
559
562 DevInstData->hDevInfo,
563 &DevInstData->devInfoData);
564 if (!ret)
565 {
566 TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%x\n", GetLastError());
567 return FALSE;
568 }
569
572 DevInstData->hDevInfo,
573 &DevInstData->devInfoData);
574 if (!ret)
575 {
576 TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%x\n", GetLastError());
577 return FALSE;
578 }
579
582 DevInstData->hDevInfo,
583 &DevInstData->devInfoData);
584 if (!ret)
585 {
586 TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%x\n", GetLastError());
587 return FALSE;
588 }
589
592 DevInstData->hDevInfo,
593 &DevInstData->devInfoData);
594 if (!ret)
595 {
596 TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%x\n", GetLastError());
597 return FALSE;
598 }
599
602 DevInstData->hDevInfo,
603 &DevInstData->devInfoData);
604 if (!ret)
605 {
606 TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%x\n", GetLastError());
607 return FALSE;
608 }
609
612 DevInstData->hDevInfo,
613 &DevInstData->devInfoData);
614 if (!ret)
615 {
616 TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%x\n", GetLastError());
617 return FALSE;
618 }
619
622 DevInstData->hDevInfo,
623 &DevInstData->devInfoData);
624 if (!ret)
625 {
626 TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%x\n", GetLastError());
627 return FALSE;
628 }
629
632 DevInstData->hDevInfo,
633 &DevInstData->devInfoData);
634 if (!ret)
635 {
636 TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%x\n", GetLastError());
637 return FALSE;
638 }
639
642 DevInstData->hDevInfo,
643 &DevInstData->devInfoData);
644 if (!ret)
645 {
646 TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%x\n", GetLastError());
647 return FALSE;
648 }
649
650 return TRUE;
651}
652
653/*
654* @implemented
655*/
661 IN INT Show)
662{
663 PDEVINSTDATA DevInstData = NULL;
664 BOOL ret;
665 DWORD config_flags;
666 BOOL retval = FALSE;
667
668 TRACE("(%p, %p, %s, %d)\n", hWndParent, hInstance, debugstr_w(InstanceId), Show);
669
670 if (!IsUserAdmin())
671 {
672 /* XP kills the process... */
674 }
675
676 DevInstData = HeapAlloc(GetProcessHeap(), 0, sizeof(DEVINSTDATA));
677 if (!DevInstData)
678 {
679 TRACE("HeapAlloc() failed\n");
681 goto cleanup;
682 }
683
684 /* Clear devinst data */
685 ZeroMemory(DevInstData, sizeof(DEVINSTDATA));
686 DevInstData->devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */
687
688 /* Fill devinst data */
690 if (DevInstData->hDevInfo == INVALID_HANDLE_VALUE)
691 {
692 TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n", GetLastError());
693 goto cleanup;
694 }
695
696 DevInstData->devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
698 DevInstData->hDevInfo,
700 NULL,
701 0, /* Open flags */
702 &DevInstData->devInfoData);
703 if (!ret)
704 {
705 TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n",
707 DevInstData->devInfoData.cbSize = 0;
708 goto cleanup;
709 }
710
713 DevInstData->hDevInfo,
714 &DevInstData->devInfoData,
716 &DevInstData->regDataType,
717 NULL, 0,
718 &DevInstData->requiredSize);
719
720 if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData->regDataType == REG_SZ)
721 {
722 DevInstData->buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData->requiredSize);
723 if (!DevInstData->buffer)
724 {
725 TRACE("HeapAlloc() failed\n");
727 }
728 else
729 {
731 DevInstData->hDevInfo,
732 &DevInstData->devInfoData,
734 &DevInstData->regDataType,
735 DevInstData->buffer, DevInstData->requiredSize,
736 &DevInstData->requiredSize);
737 }
738 }
739 if (!ret)
740 {
741 TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n",
743 goto cleanup;
744 }
745
747 DevInstData->hDevInfo,
748 &DevInstData->devInfoData,
750 NULL,
751 (BYTE *)&config_flags,
752 sizeof(config_flags),
753 NULL))
754 {
755 if (config_flags & CONFIGFLAG_FAILEDINSTALL)
756 {
757 /* The device is disabled */
758 TRACE("Device is disabled\n");
759 retval = TRUE;
760 goto cleanup;
761 }
762 }
763
764 TRACE("Installing %s (%s)\n", debugstr_w((PCWSTR)DevInstData->buffer), debugstr_w(InstanceId));
765
766 /* Search driver in default location and removable devices */
767 if (!PrepareFoldersToScan(DevInstData, FALSE, FALSE, NULL))
768 {
769 TRACE("PrepareFoldersToScan() failed with error 0x%lx\n", GetLastError());
770 goto cleanup;
771 }
772 if (ScanFoldersForDriver(DevInstData))
773 {
774 /* Driver found ; install it */
775 retval = InstallCurrentDriver(DevInstData);
776 TRACE("InstallCurrentDriver() returned %d\n", retval);
777 if (retval && Show != SW_HIDE)
778 {
779 /* Should we display the 'Need to reboot' page? */
780 SP_DEVINSTALL_PARAMS installParams;
781 installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
783 DevInstData->hDevInfo,
784 &DevInstData->devInfoData,
785 &installParams))
786 {
787 if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
788 {
789 TRACE("Displaying 'Reboot' wizard page\n");
791 }
792 }
793 }
794 goto cleanup;
795 }
796 else if (Show == SW_HIDE)
797 {
798 /* We can't show the wizard. Fail the install */
799 TRACE("No wizard\n");
800 goto cleanup;
801 }
802
803 /* Prepare the wizard, and display it */
804 TRACE("Need to show install wizard\n");
806
807cleanup:
808 if (DevInstData)
809 {
810 if (DevInstData->devInfoData.cbSize != 0)
811 {
812 if (!SetupDiDestroyDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER))
813 TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError());
814 }
815 if (DevInstData->hDevInfo != INVALID_HANDLE_VALUE)
816 {
817 if (!SetupDiDestroyDeviceInfoList(DevInstData->hDevInfo))
818 TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError());
819 }
820 HeapFree(GetProcessHeap(), 0, DevInstData->buffer);
821 HeapFree(GetProcessHeap(), 0, DevInstData);
822 }
823
824 return retval;
825}
826
827
828BOOL
829WINAPI
833 IN BOOL bUpdate,
834 OUT LPDWORD lpReboot,
836{
837 PDEVINSTDATA DevInstData = NULL;
838 BOOL ret;
839 BOOL retval = FALSE;
840
841 TRACE("InstllDevInstEx(%p, %s, %d, %p, %lx)\n",
842 hWndParent, debugstr_w(InstanceId), bUpdate, lpReboot, Unknown);
843
844 DevInstData = HeapAlloc(GetProcessHeap(), 0, sizeof(DEVINSTDATA));
845 if (!DevInstData)
846 {
847 TRACE("HeapAlloc() failed\n");
849 goto cleanup;
850 }
851
852 /* Clear devinst data */
853 ZeroMemory(DevInstData, sizeof(DEVINSTDATA));
854 DevInstData->devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */
855 DevInstData->bUpdate = bUpdate;
856
857 /* Fill devinst data */
859 if (DevInstData->hDevInfo == INVALID_HANDLE_VALUE)
860 {
861 TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n", GetLastError());
862 goto cleanup;
863 }
864
865 DevInstData->devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
867 DevInstData->hDevInfo,
869 NULL,
870 0, /* Open flags */
871 &DevInstData->devInfoData);
872 if (!ret)
873 {
874 TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n",
876 DevInstData->devInfoData.cbSize = 0;
877 goto cleanup;
878 }
879
882 DevInstData->hDevInfo,
883 &DevInstData->devInfoData,
885 &DevInstData->regDataType,
886 NULL, 0,
887 &DevInstData->requiredSize);
888
889 if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData->regDataType == REG_SZ)
890 {
891 DevInstData->buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData->requiredSize);
892 if (!DevInstData->buffer)
893 {
894 TRACE("HeapAlloc() failed\n");
896 }
897 else
898 {
900 DevInstData->hDevInfo,
901 &DevInstData->devInfoData,
903 &DevInstData->regDataType,
904 DevInstData->buffer, DevInstData->requiredSize,
905 &DevInstData->requiredSize);
906 }
907 }
908
909 if (!ret)
910 {
911 TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n",
913 goto cleanup;
914 }
915
916 /* Prepare the wizard, and display it */
917 TRACE("Need to show install wizard\n");
919
920cleanup:
921 if (DevInstData)
922 {
923 if (DevInstData->devInfoData.cbSize != 0)
924 {
925 if (!SetupDiDestroyDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER))
926 TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError());
927 }
928 if (DevInstData->hDevInfo != INVALID_HANDLE_VALUE)
929 {
930 if (!SetupDiDestroyDeviceInfoList(DevInstData->hDevInfo))
931 TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError());
932 }
933 HeapFree(GetProcessHeap(), 0, DevInstData->buffer);
934 HeapFree(GetProcessHeap(), 0, DevInstData);
935 }
936
937 return retval;
938}
939
940
941/*
942 * @implemented
943 */
944BOOL
945WINAPI
949 IN BOOL bUpdate,
950 OUT LPDWORD lpReboot)
951{
952 return InstallDevInstEx(hWndParent, InstanceId, bUpdate, lpReboot, 0);
953}
954
955
956/*
957* @implemented
958*/
961 IN HWND hWndOwner,
963 IN LPWSTR lpNamedPipeName,
964 IN INT Show)
965{
967 BOOL ShowWizard;
969 DWORD Value;
972 PWSTR InstallEventName = NULL;
974
975 /* Open the pipe */
976 hPipe = CreateFileW(lpNamedPipeName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
977
978 if(hPipe == INVALID_HANDLE_VALUE)
979 {
980 ERR("CreateFileW failed with error %u\n", GetLastError());
981 goto cleanup;
982 }
983
984 /* Read the data. Some is just included for compatibility with Windows right now and not yet used by ReactOS.
985 See umpnpmgr for more details. */
986 if(!ReadFile(hPipe, &Value, sizeof(Value), &BytesRead, NULL))
987 {
988 ERR("ReadFile failed with error %u\n", GetLastError());
989 goto cleanup;
990 }
991
992 InstallEventName = (PWSTR)HeapAlloc(GetProcessHeap(), 0, Value);
993
994 if(!ReadFile(hPipe, InstallEventName, Value, &BytesRead, NULL))
995 {
996 ERR("ReadFile failed with error %u\n", GetLastError());
997 goto cleanup;
998 }
999
1000 /* I couldn't figure out what the following value means under Windows XP.
1001 Therefore I used it in umpnpmgr to pass the ShowWizard variable. */
1002 if(!ReadFile(hPipe, &ShowWizard, sizeof(ShowWizard), &BytesRead, NULL))
1003 {
1004 ERR("ReadFile failed with error %u\n", GetLastError());
1005 goto cleanup;
1006 }
1007
1008 /* Next one is again size in bytes of the following string */
1009 if(!ReadFile(hPipe, &Value, sizeof(Value), &BytesRead, NULL))
1010 {
1011 ERR("ReadFile failed with error %u\n", GetLastError());
1012 goto cleanup;
1013 }
1014
1016
1017 if(!ReadFile(hPipe, DeviceInstance, Value, &BytesRead, NULL))
1018 {
1019 ERR("ReadFile failed with error %u\n", GetLastError());
1020 goto cleanup;
1021 }
1022
1024 if(!ReturnValue)
1025 {
1026 ERR("DevInstallW failed with error %lu\n", GetLastError());
1027 goto cleanup;
1028 }
1029
1030 hInstallEvent = CreateEventW(NULL, TRUE, FALSE, InstallEventName);
1031 if(!hInstallEvent)
1032 {
1033 TRACE("CreateEventW('%ls') failed with error %lu\n", InstallEventName, GetLastError());
1034 goto cleanup;
1035 }
1036
1039
1040cleanup:
1041 if(hPipe != INVALID_HANDLE_VALUE)
1042 CloseHandle(hPipe);
1043
1044 if(InstallEventName)
1045 HeapFree(GetProcessHeap(), 0, InstallEventName);
1046
1047 if(DeviceInstance)
1049
1050 return ReturnValue;
1051}
1052
1058{
1060 {
1062
1064
1065 InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
1069 }
1070
1071 return TRUE;
1072}
PRTL_UNICODE_STRING_BUFFER Path
UINT32 void void ** ReturnValue
Definition: acevents.h:216
#define ok(value,...)
Definition: atltest.h:57
HANDLE hInstallEvent
Definition: install.c:40
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD dwReason
Definition: misc.cpp:135
HINSTANCE hInstance
Definition: charmap.c:19
Definition: bufpool.h:45
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:904
static HWND hwndParent
Definition: cryptui.c:300
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define wcsrchr
Definition: compat.h:16
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define MultiByteToWideChar
Definition: compat.h:110
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
static void cleanup(void)
Definition: main.c:1335
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1489
DWORD WINAPI DECLSPEC_HOTPATCH GetLogicalDrives(void)
Definition: volume.c:513
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define IDD_NEEDREBOOT
Definition: resource.h:27
HDEVINFO WINAPI SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, HWND hwndParent, PCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:1259
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4558
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1787
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4451
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)
Definition: devinst.c:3224
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
BOOL WINAPI SetupDiOpenDeviceInfoW(IN HDEVINFO DeviceInfoSet, IN PCWSTR DeviceInstanceId, IN HWND hwndParent OPTIONAL, IN DWORD OpenFlags, OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
Definition: devinst.c:4774
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
Definition: devinst.c:1907
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
BOOL WINAPI SetupDiBuildDriverInfoList(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
Definition: driver.c:718
BOOL WINAPI SetupDiEnumDriverInfoW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType, IN DWORD MemberIndex, OUT PSP_DRVINFO_DATA_W DriverInfoData)
Definition: driver.c:1355
BOOL WINAPI SetupDiDestroyDriverInfoList(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
Definition: driver.c:1208
static const WCHAR DeviceInstance[]
Definition: interface.c:28
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION _In_ ULONG _Out_opt_ PULONG LengthNeeded
Definition: fltkernel.h:1343
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
Definition: fsrtlfuncs.h:908
GLuint64EXT * result
Definition: glext.h:11304
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ Unknown
Definition: i8042prt.h:114
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
#define DRIVE_CDROM
Definition: machpc98.h:119
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
BOOL * PBOOL
Definition: minwindef.h:137
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
unsigned int UINT
Definition: ndis.h:50
static BOOL IsUserAdmin(VOID)
Definition: netid.c:163
BOOL WINAPI DevInstallW(IN HWND hWndParent, IN HINSTANCE hInstance, IN LPCWSTR InstanceId, IN INT Show)
Definition: newdev.c:657
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:428
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
Definition: newdev.c:463
BOOL WINAPI ClientSideInstallW(IN HWND hWndOwner, IN HINSTANCE hInstance, IN LPWSTR lpNamedPipeName, IN INT Show)
Definition: newdev.c:960
BOOL WINAPI InstallDevInstEx(IN HWND hWndParent, IN LPCWSTR InstanceId, IN BOOL bUpdate, OUT LPDWORD lpReboot, IN DWORD Unknown)
Definition: newdev.c:830
BOOL WINAPI UpdateDriverForPlugAndPlayDevicesA(IN HWND hwndParent, IN LPCSTR HardwareId, IN LPCSTR FullInfPath, IN DWORD InstallFlags, OUT PBOOL bRebootRequired OPTIONAL)
Definition: newdev.c:215
static BOOL IsDots(IN LPCWSTR str)
Definition: newdev.c:331
static BOOL SearchDriver(IN PDEVINSTDATA DevInstData, IN LPCWSTR Directory OPTIONAL, IN LPCWSTR InfFile OPTIONAL)
Definition: newdev.c:260
static BOOL SearchDriverRecursive(IN PDEVINSTDATA DevInstData, IN LPCWSTR Path)
Definition: newdev.c:350
BOOL WINAPI DllMain(IN HINSTANCE hInstance, IN DWORD dwReason, IN LPVOID lpReserved)
Definition: newdev.c:1054
BOOL InstallCurrentDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:541
static LPCWSTR GetFileExt(IN LPWSTR FileName)
Definition: newdev.c:338
BOOL WINAPI InstallDevInst(IN HWND hWndParent, IN LPCWSTR InstanceId, IN BOOL bUpdate, OUT LPDWORD lpReboot)
Definition: newdev.c:946
BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW(IN HWND hwndParent, IN LPCWSTR HardwareId, IN LPCWSTR FullInfPath, IN DWORD InstallFlags, OUT PBOOL bRebootRequired OPTIONAL)
Definition: newdev.c:41
HINSTANCE hDllInstance
Definition: newdev.c:29
BOOL CheckBestDriver(_In_ PDEVINSTDATA DevInstData, _In_ PCWSTR pszDir)
Definition: newdev.c:420
#define INSTALLFLAG_NONINTERACTIVE
Definition: newdev.h:36
#define INSTALLFLAG_FORCE
Definition: newdev.h:34
#define INSTALLFLAG_READONLY
Definition: newdev.h:35
BOOL DisplayWizard(IN PDEVINSTDATA DevInstData, IN HWND hwndParent, IN UINT startPage)
Definition: wizard.c:1372
#define _In_
Definition: no_sal2.h:158
#define Dot(u, v)
Definition: normal.c:49
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define UNICODE_NULL
BYTE * PBYTE
Definition: pedump.c:66
#define INT
Definition: polytest.cpp:20
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396
const WCHAR * str
wcsncpy
wcscat
wcscpy
#define DI_NEEDRESTART
Definition: setupapi.h:53
#define SPDRP_DEVICEDESC
Definition: setupapi.h:508
#define DIF_INSTALLDEVICEFILES
Definition: setupapi.h:141
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2600
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1156
#define ERROR_NO_SUCH_DEVINST
Definition: setupapi.h:308
#define SPDRP_COMPATIBLEIDS
Definition: setupapi.h:510
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2604
#define DI_ENUMSINGLEINF
Definition: setupapi.h:62
SP_DRVINFO_DATA_V2 SP_DRVINFO_DATA
Definition: setupapi.h:1055
#define DIF_REGISTER_COINSTALLERS
Definition: setupapi.h:154
#define DIF_INSTALLINTERFACES
Definition: setupapi.h:152
#define DIGCF_ALLCLASSES
Definition: setupapi.h:173
struct _SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS_W
#define DIF_NEWDEVICEWIZARD_PREANALYZE
Definition: setupapi.h:148
#define DIGCF_PRESENT
Definition: setupapi.h:172
#define DI_NEEDREBOOT
Definition: setupapi.h:54
#define DIF_INSTALLDEVICE
Definition: setupapi.h:122
#define DIF_ALLOW_INSTALL
Definition: setupapi.h:144
#define DIF_DESTROYPRIVATEDATA
Definition: setupapi.h:132
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define DI_FLAGSEX_ALLOWEXCLUDEDDRVS
Definition: setupapi.h:87
#define DIF_SELECTBESTCOMPATDRV
Definition: setupapi.h:143
#define SPDRP_CONFIGFLAGS
Definition: setupapi.h:518
#define SPDRP_HARDWAREID
Definition: setupapi.h:509
#define DIF_NEWDEVICEWIZARD_POSTANALYZE
Definition: setupapi.h:149
#define SPDIT_COMPATDRIVER
Definition: setupapi.h:507
#define DIF_NEWDEVICEWIZARD_FINISHINSTALL
Definition: setupapi.h:150
_In_ LPCSTR pszDir
Definition: shellapi.h:601
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
base for all directory entries
Definition: entries.h:138
SP_DEVINFO_DATA devInfoData
HDEVINFO hDevInfo
DWORD requiredSize
WCHAR DriverPath[MAX_PATH]
Definition: setupapi.h:901
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD dwFileAttributes
Definition: minwinbase.h:283
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
int retval
Definition: wcstombs.cpp:91
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define DRIVE_REMOVABLE
Definition: winbase.h:275
#define WINAPI
Definition: msvc.h:6
#define ComboBox_GetTextLength(hwndCtl)
Definition: windowsx.h:59
#define ERROR_GEN_FAILURE
Definition: winerror.h:256
#define ERROR_INVALID_FLAGS
Definition: winerror.h:907
#define ERROR_PRIVILEGE_NOT_HELD
Definition: winerror.h:1141
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1268
#define SW_HIDE
Definition: winuser.h:779
#define CB_GETLBTEXTLEN
Definition: winuser.h:1982
#define CB_GETLBTEXT
Definition: winuser.h:1981
#define CB_ERR
Definition: winuser.h:2471
#define SW_SHOWNOACTIVATE
Definition: winuser.h:785
#define CB_GETCURSEL
Definition: winuser.h:1972
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193