ReactOS  0.4.13-dev-79-gcd489d8
mmsys.c
Go to the documentation of this file.
1 /*
2  *
3  * PROJECT: ReactOS Multimedia Control Panel
4  * FILE: dll/cpl/mmsys/mmsys.c
5  * PURPOSE: ReactOS Multimedia Control Panel
6  * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
7  * Dmitry Chapyshev <dmitry@reactos.org>
8  * UPDATE HISTORY:
9  * 2005/11/23 Created
10  */
11 
12 #include "mmsys.h"
13 
14 #include <winsvc.h>
15 #include <shlwapi.h>
16 #include <debug.h>
17 
18 #include <swenum.h>
19 #include <newdev.h>
20 #include <initguid.h>
21 #include <devguid.h>
22 
23 typedef enum
24 {
29 
30 typedef struct
31 {
37 
38 typedef struct
39 {
44 
46 {
47  {
48  L"WindowsLogon",
49  L"ReactOS Logon",
51  L"ReactOS_Logon.wav"
52  },
53  {
54  L"WindowsLogoff",
55  L"ReactOS Logoff",
57  L"ReactOS_Logoff.wav"
58  },
59  {
60  NULL,
61  NULL,
62  0,
63  NULL
64  }
65 };
66 
68 {
69  {
70  L".Default",
71  L"ReactOS Standard",
73  },
74  {
75  L".None",
76  L"No Sounds",
77  -1
78  },
79  {
80  NULL,
81  NULL
82  }
83 };
84 
85 
88  LPGUID lpGuids,
89  UINT uNumberOfGuids,
91 
93  IN LPCTSTR HardwareId,
94  IN LPCTSTR FullInfPath,
95  IN DWORD InstallFlags,
96  OUT OPTIONAL PBOOL bRebootRequired
97  );
98 
99 #define UPDATEDRIVERFORPLUGANDPLAYDEVICES "UpdateDriverForPlugAndPlayDevicesW"
100 #define NUM_APPLETS (1)
101 
102 
104 
105 /* Applets */
107 {
109 };
110 
111 
114 {
115  DPRINT1("DllCanUnloadNow() stubs\n");
116  return S_OK;
117 }
118 
121  REFIID riid,
122  LPVOID *ppv)
123 {
124  DPRINT1("DllGetClassObject() stubs\n");
125  return S_OK;
126 }
127 
128 
129 VOID WINAPI
132  LPWSTR lpszCmd,
133  int nCmdShow)
134 {
135  DPRINT1("ShowDriverSettingsAfterForkW() stubs\n");
136 }
137 
138 VOID WINAPI
141  LPSTR lpszCmd,
142  int nCmdShow)
143 {
144  DPRINT1("ShowDriverSettingsAfterForkA() stubs\n");
145 }
146 
147 VOID WINAPI
150  LPSTR lpszCmd,
151  int nCmdShow)
152 {
153  DPRINT1("ShowDriverSettingsAfterFork() stubs\n");
154 }
155 
156 BOOL WINAPI
158  LPCSTR pszPropSheet,
159  LPSTR pszName,
160  LPSTR pszCaption)
161 {
162  DPRINT1("ShowMMCPLPropertySheet() stubs\n");
163  return TRUE;
164 }
165 
166 VOID WINAPI
169  LPTSTR lpszCmd,
170  int nCmdShow)
171 {
172  DPRINT1("ShowAudioPropertySheet() stubs\n");
173 }
174 
175 VOID WINAPI
178  LPWSTR lpszCmd,
179  int nCmdShow)
180 {
181  DPRINT1("mmseRunOnceW() stubs\n");
182 }
183 
184 VOID WINAPI
187  LPSTR lpszCmd,
188  int nCmdShow)
189 {
190  DPRINT1("mmseRunOnceA() stubs\n");
191 }
192 
193 VOID WINAPI
196  LPSTR lpszCmd,
197  int nCmdShow)
198 {
199  DPRINT1("mmseRunOnce() stubs\n");
200 }
201 
202 BOOL WINAPI
205  LPARAM lParam)
206 {
207  DPRINT1("MediaPropPageProvider() stubs\n");
208  return TRUE;
209 }
210 
211 VOID WINAPI
214  LPSTR lpszCmd,
215  int nCmdShow)
216 {
217  DPRINT1("ShowFullControlPanel() stubs\n");
218 }
219 
220 VOID
222 {
223  UINT i = 0;
224  HKEY hSubKey;
225  WCHAR Buffer[40];
226 
227  do
228  {
230  {
231  RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)EventLabels[i].DefaultName, (wcslen(EventLabels[i].DefaultName)+1) * sizeof(WCHAR));
232  swprintf(Buffer, L"@mmsys.cpl,-%u", EventLabels[i].LocalizedResId);
233  RegSetValueExW(hSubKey, L"DispFileName", 0, REG_SZ, (LPBYTE)Buffer, (wcslen(Buffer)+1) * sizeof(WCHAR));
234 
235  RegCloseKey(hSubKey);
236  }
237  i++;
238  }while(EventLabels[i].LabelName);
239 }
240 
241 VOID
243 {
244  UINT i = 0;
245  HKEY hSubKey;
246 
247  do
248  {
250  {
251  RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)SystemSchemes[i].DefaultName, (wcslen(SystemSchemes[i].DefaultName)+1) * sizeof(WCHAR));
252  RegCloseKey(hSubKey);
253  }
254  i++;
255  }while(SystemSchemes[i].LabelName);
256 }
257 
258 VOID
260 {
261  HKEY hKey, hSubKey;
263  UINT i = 0;
264 
265  if (RegCreateKeyExW(hRootKey, L".Default", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL) != ERROR_SUCCESS)
266  return;
267 
268  RegSetValueExW(hKey, NULL, 0, REG_SZ, (LPBYTE)SystemSchemes[0].DefaultName, (wcslen(SystemSchemes[0].DefaultName)+1) * sizeof(WCHAR));
269  swprintf(Path, L"@mmsys.cpl,-%u", SystemSchemes[0].IconId);
270  RegSetValueExW(hKey, L"DispFileName", 0, REG_SZ, (LPBYTE)Path, (wcslen(Path)+1) * sizeof(WCHAR));
271 
272  do
273  {
275  {
276  HKEY hScheme;
277 
278  swprintf(Path, L"%%SystemRoot%%\\media\\%s", EventLabels[i].FileName);
279  if (RegCreateKeyExW(hSubKey, L".Current", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hScheme, NULL) == ERROR_SUCCESS)
280  {
281  RegSetValueExW(hScheme, NULL, 0, REG_EXPAND_SZ, (LPBYTE)Path, (wcslen(Path)+1) * sizeof(WCHAR));
282  RegCloseKey(hScheme);
283  }
284 
285  if (RegCreateKeyExW(hSubKey, L".Default", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hScheme, NULL) == ERROR_SUCCESS)
286  {
287  RegSetValueExW(hScheme, NULL, 0, REG_EXPAND_SZ, (LPBYTE)Path, (wcslen(Path)+1) * sizeof(WCHAR));
288  RegCloseKey(hScheme);
289  }
290  RegCloseKey(hSubKey);
291  }
292  i++;
293  }while(EventLabels[i].LabelName);
294 
295  RegCloseKey(hKey);
296 }
297 
298 
299 VOID
301 {
302  HKEY hKey, hSubKey;
303  DWORD dwDisposition;
304 
306  return;
307 
308  if (RegCreateKeyExW(hKey, L"EventLabels", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, NULL) == ERROR_SUCCESS)
309  {
310  InstallSystemSoundLabels(hSubKey);
311  RegCloseKey(hSubKey);
312  }
313 
314  if (RegCreateKeyExW(hKey, L"Schemes", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisposition) == ERROR_SUCCESS)
315  {
316  HKEY hNames;
317 
318  if (RegCreateKeyExW(hSubKey, L"Names", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hNames, NULL) == ERROR_SUCCESS)
319  {
321  RegCloseKey(hNames);
322  }
323 
324  if (RegCreateKeyExW(hSubKey, L"Apps", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hNames, NULL) == ERROR_SUCCESS)
325  {
327  RegCloseKey(hNames);
328  if (dwDisposition & REG_CREATED_NEW_KEY)
329  {
330  // FIXME
331  RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)L".Default", (wcslen(L".Default")+1) * sizeof(WCHAR));
332  }
333  }
334 
335  RegCloseKey(hSubKey);
336  }
337 
338  RegCloseKey(hKey);
339 }
340 
341 BOOL
343 {
344  HDEVINFO hDevInfo;
345  SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
347  PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData;
348 
350  if (!hDevInfo)
351  {
352  // failed
353  return FALSE;
354  }
355 
356  DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
357  if (!SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &SWBusGuid, 0, &DeviceInterfaceData))
358  {
359  // failed
361  return FALSE;
362  }
363 
364  DeviceInterfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA_W)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) + sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W));
365  if (!DeviceInterfaceDetailData)
366  {
367  // failed
369  return FALSE;
370  }
371 
372  DeviceInterfaceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W);
373  if (!SetupDiGetDeviceInterfaceDetailW(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData,MAX_PATH * sizeof(WCHAR) + sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W), NULL, NULL))
374  {
375  // failed
376  HeapFree(GetProcessHeap(), 0, DeviceInterfaceDetailData);
378  return FALSE;
379  }
380  HeapFree(GetProcessHeap(), 0, DeviceInterfaceDetailData);
382  return TRUE;
383 }
384 
385 DWORD
387 {
390  GUID ClassGUID;
391  TCHAR ClassName[50];
392  int Result = 0;
393  HMODULE hModule = NULL;
395  BOOL reboot = FALSE;
396  DWORD flags = 0;
397 
398  if (!SetupDiGetINFClass(InfPath,&ClassGUID,ClassName,sizeof(ClassName)/sizeof(ClassName[0]),0))
399  {
400  return -1;
401  }
402 
405  {
406  return -1;
407  }
408 
411  {
413  return -1;
414  }
415 
416  if(!SetupDiSetDeviceRegistryProperty(DeviceInfoSet, &DeviceInfoData, SPDRP_HARDWAREID, (LPBYTE)HardwareIdList, (lstrlen(HardwareIdList)+1+1)*sizeof(TCHAR)))
417  {
419  return -1;
420  }
421 
423  {
425  return -1;
426  }
427 
428  if(GetFileAttributes(InfPath)==(DWORD)(-1)) {
430  return -1;
431  }
432 
434  hModule = LoadLibraryW(L"newdev.dll");
435  if(!hModule) {
437  return -1;
438  }
439 
441  if(!UpdateProc)
442  {
445  return -1;
446  }
447 
448  if(!UpdateProc(NULL, HardwareIdList, InfPath, flags, &reboot))
449  {
452  return -1;
453  }
454 
457  return Result;
458 }
459 
460 DWORD
462 {
463  UINT Length;
464  LPWSTR pBuffer;
465  WCHAR szBuffer[MAX_PATH];
466  HINF hInf;
467  PVOID Context;
468  BOOL Result;
469  SC_HANDLE hSCManager, hService;
470  WCHAR WaveName[20];
471  HKEY hKey;
473  ULONG Index;
474 
475  if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND) &&
476  !IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_MEDIA))
477  return ERROR_DI_DO_DEFAULT;
478 
479  Length = GetWindowsDirectoryW(szBuffer, MAX_PATH);
480  if (!Length || Length >= MAX_PATH - 14)
481  {
482  return ERROR_GEN_FAILURE;
483  }
484 
485  pBuffer = PathAddBackslashW(szBuffer);
486  if (!pBuffer)
487  {
488  return ERROR_GEN_FAILURE;
489  }
490 
491  wcscpy(pBuffer, L"inf\\audio.inf");
492 
493  hInf = SetupOpenInfFileW(szBuffer,
494  NULL,
496  NULL);
497 
498  if (hInf == INVALID_HANDLE_VALUE)
499  {
500  return ERROR_GEN_FAILURE;
501  }
502 
504  if (Context == NULL)
505  {
506  SetupCloseInfFile(hInf);
507  return ERROR_GEN_FAILURE;
508  }
509 
511  hInf,
512  L"AUDIO_Inst.NT",
513  SPINST_ALL,
514  NULL,
515  NULL,
518  Context,
519  NULL,
520  NULL);
521 
522  if (Result)
523  {
525  L"Audio_Inst.NT.Services",
526  0);
527  }
528 
530  SetupCloseInfFile(hInf);
531 
533  {
534  Length = GetWindowsDirectoryW(szBuffer, MAX_PATH);
535  if (!Length || Length >= MAX_PATH - 14)
536  {
537  return ERROR_GEN_FAILURE;
538  }
539 
540  pBuffer = PathAddBackslashW(szBuffer);
541  if (!pBuffer)
542  {
543  return ERROR_GEN_FAILURE;
544  }
545 
546  wcscpy(pBuffer, L"inf\\machine.inf");
547  InstallSoftwareBusPnpEnumerator(szBuffer, L"ROOT\\SWENUM\0");
548  }
549 
551  if (!hSCManager)
552  {
553  return ERROR_DI_DO_DEFAULT;
554  }
555 
556  hService = OpenService(hSCManager, L"RosAudioSrv", SERVICE_ALL_ACCESS);
557  if (hService)
558  {
559  /* Make RosAudioSrv start automatically */
561 
562  StartService(hService, 0, NULL);
563  CloseServiceHandle(hService);
564  }
566 
567  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32", 0, GENERIC_READ | GENERIC_WRITE, &hKey) == ERROR_SUCCESS)
568  {
569  szBuffer[Length] = '\0';
570  pBuffer = PathAddBackslashW(szBuffer);
571  wcscpy(pBuffer, L"system32\\wdmaud.drv");
572 
573  for(Index = 1; Index <= 4; Index++)
574  {
575  swprintf(WaveName, L"wave%u", Index);
576  if (RegQueryValueExW(hKey, WaveName, 0, NULL, NULL, &BufferSize) != ERROR_MORE_DATA)
577  {
578  /* Store new audio driver entry */
579  RegSetValueExW(hKey, WaveName, 0, REG_SZ, (LPBYTE)szBuffer, (wcslen(szBuffer)+1) * sizeof(WCHAR));
580  break;
581  }
582  else
583  {
585  BufferSize = sizeof(Buffer);
586 
587  if (RegQueryValueExW(hKey, WaveName, 0, NULL, (LPBYTE)Buffer, &BufferSize) == ERROR_SUCCESS)
588  {
589  /* Make sure the buffer is zero terminated */
590  Buffer[MAX_PATH-1] = L'\0';
591 
592  if (!wcsicmp(Buffer, szBuffer))
593  {
594  /* An entry already exists */
595  break;
596  }
597  }
598  }
599  }
600  RegCloseKey(hKey);
601  }
603 
604  return ERROR_DI_DO_DEFAULT;
605 
606 }
607 
608 DWORD
610 {
611  return ERROR_DI_DO_DEFAULT;
612 }
613 
614 DWORD
616 {
617  return ERROR_DI_DO_DEFAULT;
618 }
619 
620 DWORD
622 {
623  return ERROR_DI_DO_DEFAULT;
624 }
625 
626 DWORD
628 {
629  return ERROR_DI_DO_DEFAULT;
630 }
631 
632 DWORD
634 {
635  return ERROR_DI_DO_DEFAULT;
636 }
637 
640  IN HDEVINFO hDevInfo,
641  IN PSP_DEVINFO_DATA pspDevInfoData OPTIONAL)
642 {
643  switch (diFunction)
644  {
645  case DIF_INSTALLDEVICE:
646  return MMSYS_InstallDevice(hDevInfo, pspDevInfoData);
647  case DIF_REMOVE:
648  return MMSYS_RemoveDevice(hDevInfo, pspDevInfoData);
649  case DIF_ALLOW_INSTALL:
650  return MMSYS_AllowInstallDevice(hDevInfo, pspDevInfoData);
651  case DIF_SELECTDEVICE:
652  return MMSYS_SelectDevice(hDevInfo, pspDevInfoData);
653  case DIF_DETECT:
654  return MMSYS_DetectDevice(hDevInfo, pspDevInfoData);
656  return MMSYS_SelectBestCompatDRV(hDevInfo, pspDevInfoData);
657  default:
658  return ERROR_DI_DO_DEFAULT;
659  }
660 }
661 
662 
663 /* Hardware property page dialog callback */
664 static INT_PTR CALLBACK
666  UINT uMsg,
667  WPARAM wParam,
668  LPARAM lParam)
669 {
672  switch(uMsg)
673  {
674  case WM_INITDIALOG:
675  {
676  GUID Guids[2];
677  Guids[0] = GUID_DEVCLASS_CDROM;
678  Guids[1] = GUID_DEVCLASS_MEDIA;
679 
680  /* Create the hardware page */
682  Guids,
683  sizeof(Guids) / sizeof(Guids[0]),
685  break;
686  }
687  }
688 
689  return FALSE;
690 }
691 
692 static int CALLBACK
694 {
695  // NOTE: This callback is needed to set large icon correctly.
696  HICON hIcon;
697  switch (uMsg)
698  {
699  case PSCB_INITIALIZED:
700  {
702  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
703  break;
704  }
705  }
706  return 0;
707 }
708 
711  UINT uMsg,
712  LPARAM wParam,
713  LPARAM lParam)
714 {
715  PROPSHEETPAGE psp[5];
716  PROPSHEETHEADER psh; // = { 0 };
717  TCHAR Caption[256];
718 
722 
723  LoadString(hApplet, IDS_CPLNAME, Caption, _countof(Caption));
724 
725  psh.dwSize = sizeof(PROPSHEETHEADER);
727  psh.hwndParent = hwnd;
728  psh.hInstance = hApplet;
729  psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
730  psh.pszCaption = Caption;
731  psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
732  psh.nStartPage = 0;
733  psh.ppsp = psp;
734  psh.pfnCallback = PropSheetProc;
735 
741 
742  return (LONG)(PropertySheet(&psh) != -1);
743 }
744 
745 VOID
747  WORD idDlg,
749 {
750  ZeroMemory(psp, sizeof(PROPSHEETPAGE));
751  psp->dwSize = sizeof(PROPSHEETPAGE);
752  psp->dwFlags = PSP_DEFAULT;
753  psp->hInstance = hApplet;
754  psp->pszTemplate = MAKEINTRESOURCE(idDlg);
755  psp->pfnDlgProc = DlgProc;
756 }
757 
758 
759 /* Control Panel Callback */
761 CPlApplet(HWND hwndCpl,
762  UINT uMsg,
763  LPARAM lParam1,
764  LPARAM lParam2)
765 {
766  switch(uMsg)
767  {
768  case CPL_INIT:
769  return TRUE;
770 
771  case CPL_GETCOUNT:
772  return NUM_APPLETS;
773 
774  case CPL_INQUIRE:
775  {
776  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
777  UINT uAppIndex = (UINT)lParam1;
778 
779  CPlInfo->lData = 0;
780  CPlInfo->idIcon = Applets[uAppIndex].idIcon;
781  CPlInfo->idName = Applets[uAppIndex].idName;
782  CPlInfo->idInfo = Applets[uAppIndex].idDescription;
783  break;
784  }
785 
786  case CPL_DBLCLK:
787  {
788  UINT uAppIndex = (UINT)lParam1;
789  Applets[uAppIndex].AppletProc(hwndCpl,
790  uMsg,
791  lParam1,
792  lParam2);
793  break;
794  }
795  }
796 
797  return FALSE;
798 }
799 
800 
801 BOOL WINAPI
803  DWORD dwReason,
804  LPVOID lpReserved)
805 {
806  UNREFERENCED_PARAMETER(lpReserved);
807  switch(dwReason)
808  {
809  case DLL_PROCESS_ATTACH:
810  hApplet = hinstDLL;
811  DisableThreadLibraryCalls(hinstDLL);
812  break;
813  }
814 
815  return TRUE;
816 }
#define StartService
Definition: winsvc.h:585
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
#define DIF_SELECTDEVICE
Definition: setupapi.h:120
Definition: mmsys.c:27
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD idDlg
Definition: desk.c:109
#define MAKEINTRESOURCE
Definition: winuser.h:591
HWPAGE_DISPLAYMODE
Definition: mmsys.c:23
#define IN
Definition: typedefs.h:38
VOID InstallSystemSoundSchemeNames(HKEY hKey)
Definition: mmsys.c:242
VOID InstallDefaultSystemSoundScheme(HKEY hRootKey)
Definition: mmsys.c:259
static HICON
Definition: imagelist.c:84
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
enum HWPAGE_DISPLAYMODE * PHWPAGE_DISPLAYMODE
#define UPDATEDRIVERFORPLUGANDPLAYDEVICES
Definition: mmsys.c:99
Definition: cpl.h:24
#define INF_STYLE_WIN4
Definition: infsupp.h:41
UINT LocalizedResId
Definition: mmsys.c:34
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
INT_PTR CALLBACK AudioDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: audio.c:241
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static EVENT_LABEL_ITEM EventLabels[]
Definition: mmsys.c:45
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2297
DWORD MMSYS_SelectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:621
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
REFIID riid
Definition: precomp.h:44
LPWSTR LabelName
Definition: mmsys.c:40
#define REFCLSID
Definition: guiddef.h:112
#define _countof(array)
Definition: fontsub.cpp:30
#define INSTALLFLAG_FORCE
Definition: newdev.h:34
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG APIENTRY MmSysApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: mmsys.c:710
BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:3016
int idName
Definition: hotplug.h:27
int idIcon
Definition: hotplug.h:26
#define CALLBACK
Definition: compat.h:27
REFIID LPVOID * ppv
Definition: atlbase.h:39
int idInfo
Definition: cpl.h:27
#define IDD_VOLUME
Definition: resource.h:19
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mmsys.c:693
VOID WINAPI mmseRunOnceW(HWND hwnd, HINSTANCE hInstance, LPWSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:176
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: mmsys.c:120
#define ZeroMemory
Definition: winbase.h:1635
VOID WINAPI mmseRunOnce(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:194
VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
Definition: mmsys.c:746
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:309
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4029
#define SERVICE_ALL_ACCESS
Definition: winsvc.h:62
int32_t INT_PTR
Definition: typedefs.h:62
#define PSH_USECALLBACK
Definition: prsht.h:48
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
char * LPSTR
Definition: xmlstorage.h:182
#define BOOL
Definition: nt_native.h:43
LPWSTR DefaultName
Definition: mmsys.c:33
#define OpenService
Definition: winsvc.h:576
WPARAM wParam
Definition: combotst.c:138
#define IDD_AUDIO
Definition: resource.h:21
CHAR * LPTSTR
Definition: xmlstorage.h:192
struct TraceInfo Info
BOOL(WINAPI * UpdateDriverForPlugAndPlayDevicesProto)(IN OPTIONAL HWND hwndParent, IN LPCTSTR HardwareId, IN LPCTSTR FullInfPath, IN DWORD InstallFlags, OUT OPTIONAL PBOOL bRebootRequired)
Definition: mmsys.c:92
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
int idIcon
Definition: cpl.h:25
#define SERVICE_NO_CHANGE
Definition: winsvc.h:20
int idDescription
Definition: hotplug.h:28
#define CPL_DBLCLK
Definition: cpl.h:16
HWPAGE_DISPLAYMODE
Definition: main.h:22
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA_W
DWORD dwReason
Definition: misc.cpp:154
#define ChangeServiceConfig
Definition: winsvc.h:567
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
HINSTANCE hInstance
Definition: charmap.c:20
#define IDS_CPLNAME
Definition: resource.h:8
VOID WINAPI mmseRunOnceA(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:185
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define PSH_USEICONID
Definition: prsht.h:42
HDEVINFO WINAPI SetupDiCreateDeviceInfoList(const GUID *ClassGuid, HWND hwndParent)
Definition: devinst.c:1214
#define SP_COPY_NEWER
Definition: setupapi.h:473
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL IsSoftwareBusPnpEnumeratorInstalled()
Definition: mmsys.c:342
long LONG
Definition: pedump.c:60
#define NUM_APPLETS
Definition: mmsys.c:100
#define DIF_REGISTERDEVICE
Definition: setupapi.h:144
#define GENERIC_WRITE
Definition: nt_native.h:90
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
#define PROPSHEETHEADER
Definition: prsht.h:374
static HWND hwndParent
Definition: cryptui.c:300
_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:426
#define IDS_REACTOS_LOGOFF
Definition: resource.h:81
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hApplet
Definition: mmsys.c:103
Definition: bufpool.h:45
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
const APPLET Applets[NUM_APPLETS]
Definition: mmsys.c:106
const char * LPCSTR
Definition: xmlstorage.h:183
BOOL * PBOOL
Definition: windef.h:161
static const WCHAR ClassGUID[]
Definition: devclass.c:30
DWORD MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:461
VOID WINAPI ShowAudioPropertySheet(HWND hwnd, HINSTANCE hInstance, LPTSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:167
INT_PTR CALLBACK SoundsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: sounds.c:1092
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define DIF_INSTALLDEVICE
Definition: setupapi.h:121
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
char TCHAR
Definition: xmlstorage.h:189
#define OpenSCManager
Definition: winsvc.h:575
#define PSP_DEFAULT
Definition: prsht.h:22
#define FreeLibrary(x)
Definition: compat.h:405
VOID WINAPI ShowDriverSettingsAfterForkW(HWND hwnd, HINSTANCE hInstance, LPWSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:130
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LPWSTR DefaultName
Definition: mmsys.c:41
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
DWORD MMSYS_DetectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:627
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SetupDiCreateDeviceInfo
Definition: setupapi.h:2573
#define PSH_PROPTITLE
Definition: prsht.h:40
LONG HRESULT
Definition: typedefs.h:77
APPLET_PROC AppletProc
Definition: hotplug.h:29
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
LONG CALLBACK CPlApplet(HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: mmsys.c:761
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:8
#define IDD_HARDWARE
Definition: resource.h:28
static const UCHAR Index[8]
Definition: usbohci.c:18
#define BufferSize
Definition: classpnp.h:419
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1523
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W * PSP_DEVICE_INTERFACE_DETAIL_DATA_W
#define IDI_CPLICON
Definition: resource.h:4
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
Definition: mmsys.c:802
DWORD MMSYS_RemoveDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:609
#define SetupDiSetDeviceRegistryProperty
Definition: setupapi.h:2614
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define SPDRP_HARDWAREID
Definition: setupapi.h:503
#define CPL_INIT
Definition: cpl.h:12
GLbitfield flags
Definition: glext.h:7161
#define IDS_REACTOS_DEFAULT_SCHEME
Definition: resource.h:83
VOID WINAPI ShowFullControlPanel(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:212
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:116
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1323
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CPL_INQUIRE
Definition: cpl.h:14
static const WCHAR L[]
Definition: oid.c:1250
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1777
#define IDD_SOUNDS
Definition: resource.h:20
#define IDD_VOICE
Definition: resource.h:22
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
#define SPINST_ALL
Definition: setupapi.h:596
#define GENERIC_READ
Definition: compat.h:124
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
VOID InstallSystemSoundScheme()
Definition: mmsys.c:300
SC_HANDLE hSCManager
Definition: sc.c:12
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define wcsicmp
Definition: string.h:1152
#define GetFileAttributes
Definition: winbase.h:3629
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2849
#define IDS_REACTOS_LOGON
Definition: resource.h:82
BOOL WINAPI ShowMMCPLPropertySheet(HWND hwnd, LPCSTR pszPropSheet, LPSTR pszName, LPSTR pszCaption)
Definition: mmsys.c:157
#define S_OK
Definition: intsafe.h:59
#define lstrlen
Definition: winbase.h:3690
#define STATIC_BUSID_SoftwareDeviceEnumerator
Definition: swenum.h:25
PRTL_UNICODE_STRING_BUFFER Path
#define PSCB_INITIALIZED
Definition: prsht.h:75
BOOL WINAPI SetupInstallServicesFromInfSectionW(HINF Inf, PCWSTR SectionName, DWORD Flags)
Definition: install.c:1608
LPWSTR FileName
Definition: mmsys.c:35
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1677
DWORD InstallSoftwareBusPnpEnumerator(LPWSTR InfPath, LPCWSTR HardwareIdList)
Definition: mmsys.c:386
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:2785
VOID WINAPI ShowDriverSettingsAfterFork(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:148
unsigned int UINT
Definition: ndis.h:50
#define DPRINT1
Definition: precomp.h:8
#define SERVICE_AUTO_START
Definition: cmtypes.h:975
LPWSTR LabelName
Definition: mmsys.c:32
INT_PTR CALLBACK VoiceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: voice.c:15
#define DIGCF_DEVICEINTERFACE
Definition: setupapi.h:174
#define ERROR_DI_DO_DEFAULT
Definition: setupapi.h:305
VOID InstallSystemSoundLabels(HKEY hKey)
Definition: mmsys.c:221
#define OUT
Definition: typedefs.h:39
#define DIF_ALLOW_INSTALL
Definition: setupapi.h:143
#define PropertySheet
Definition: prsht.h:382
#define DIF_REMOVE
Definition: setupapi.h:124
struct _SP_DEVICE_INTERFACE_DATA SP_DEVICE_INTERFACE_DATA
struct tagContext Context
Definition: acpixf.h:1012
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
static SYSTEM_SCHEME_ITEM SystemSchemes[]
Definition: mmsys.c:67
VOID WINAPI ShowDriverSettingsAfterForkA(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
Definition: mmsys.c:139
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define GetProcAddress(x, y)
Definition: compat.h:410
#define DIF_SELECTBESTCOMPATDRV
Definition: setupapi.h:142
DWORD MMSYS_SelectBestCompatDRV(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:633
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static INT_PTR CALLBACK HardwareDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mmsys.c:665
DWORD MMSYS_AllowInstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:615
#define ERROR_GEN_FAILURE
Definition: winerror.h:134
UINT DI_FUNCTION
Definition: setupapi.h:667
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define DIF_DETECT
Definition: setupapi.h:134
#define SetupDiGetINFClass
Definition: setupapi.h:2603
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
HRESULT WINAPI DllCanUnloadNow(VOID)
Definition: mmsys.c:113
BOOL WINAPI MediaPropPageProvider(LPVOID Info, LPFNADDPROPSHEETPAGE PropSheetPage, LPARAM lParam)
Definition: mmsys.c:203
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
DLGPROC DlgProc
Definition: desk.c:110
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define CPL_GETCOUNT
Definition: cpl.h:13
#define LoadString
Definition: winuser.h:5685
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
INT_PTR CALLBACK VolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: volume.c:382
#define PROPSHEETPAGE
Definition: prsht.h:371
DWORD WINAPI MediaClassInstaller(IN DI_FUNCTION diFunction, IN HDEVINFO hDevInfo, IN PSP_DEVINFO_DATA pspDevInfoData OPTIONAL)
Definition: mmsys.c:639
#define APIENTRY
Definition: api.h:79
#define ICON_BIG
Definition: tnclass.cpp:51
Definition: hotplug.h:24
HMODULE hModule
Definition: animate.c:44
#define DIGCF_PRESENT
Definition: setupapi.h:171
#define DICD_GENERATE_ID
Definition: setupapi.h:110
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68