ReactOS 0.4.16-dev-320-g3bd9ddc
mmsys.c File Reference
#include "mmsys.h"
#include <winsvc.h>
#include <shlwapi.h>
#include <debug.h>
#include <swenum.h>
#include <newdev.h>
#include <initguid.h>
#include <devguid.h>
Include dependency graph for mmsys.c:

Go to the source code of this file.

Classes

struct  EVENT_LABEL_ITEM
 
struct  SYSTEM_SCHEME_ITEM
 

Macros

#define UPDATEDRIVERFORPLUGANDPLAYDEVICES   "UpdateDriverForPlugAndPlayDevicesW"
 
#define NUM_APPLETS   (1)
 

Typedefs

typedef enum HWPAGE_DISPLAYMODEPHWPAGE_DISPLAYMODE
 
typedef BOOL(WINAPIUpdateDriverForPlugAndPlayDevicesProto) (_In_opt_ HWND hwndParent, _In_ LPCWSTR HardwareId, _In_ LPCWSTR FullInfPath, _In_ DWORD InstallFlags, _Out_opt_ PBOOL bRebootRequired)
 

Enumerations

enum  HWPAGE_DISPLAYMODE {
  HWPD_STANDARDLIST = 0 , HWPD_LARGELIST , HWPD_MAX = HWPD_LARGELIST , HWPD_STANDARDLIST = 0 ,
  HWPD_LARGELIST , HWPD_MAX = HWPD_LARGELIST , HWPD_STANDARDLIST = 0 , HWPD_LARGELIST ,
  HWPD_MAX = HWPD_LARGELIST , HWPD_STANDARDLIST = 0 , HWPD_LARGELIST , HWPD_MAX = HWPD_LARGELIST
}
 

Functions

HWND WINAPI DeviceCreateHardwarePageEx (HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
 
HRESULT WINAPI DllCanUnloadNow (VOID)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
VOID WINAPI ShowDriverSettingsAfterForkW (HWND hwnd, HINSTANCE hInstance, LPWSTR lpszCmd, int nCmdShow)
 
VOID WINAPI ShowDriverSettingsAfterForkA (HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
 
VOID WINAPI ShowDriverSettingsAfterFork (HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
 
BOOL WINAPI ShowMMCPLPropertySheet (HWND hwnd, LPCSTR pszPropSheet, LPSTR pszName, LPSTR pszCaption)
 
VOID WINAPI mmseRunOnceW (HWND hwnd, HINSTANCE hInstance, LPWSTR lpszCmd, int nCmdShow)
 
VOID WINAPI mmseRunOnceA (HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
 
VOID WINAPI mmseRunOnce (HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
 
BOOL WINAPI MediaPropPageProvider (LPVOID Info, LPFNADDPROPSHEETPAGE PropSheetPage, LPARAM lParam)
 
VOID InstallSystemSoundLabels (HKEY hKey)
 
VOID InstallSystemSoundSchemeNames (HKEY hKey)
 
VOID InstallDefaultSystemSoundScheme (HKEY hRootKey)
 
VOID InstallSystemSoundScheme (VOID)
 
BOOL IsSoftwareBusPnpEnumeratorInstalled ()
 
DWORD InstallSoftwareBusPnpEnumerator (LPCWSTR InfPath, LPCWSTR HardwareIdList)
 
DWORD MMSYS_InstallDevice (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD MMSYS_RemoveDevice (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD MMSYS_AllowInstallDevice (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD MMSYS_SelectDevice (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD MMSYS_DetectDevice (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD MMSYS_SelectBestCompatDRV (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
 
DWORD WINAPI MediaClassInstaller (IN DI_FUNCTION diFunction, IN HDEVINFO hDevInfo, IN PSP_DEVINFO_DATA pspDevInfoData OPTIONAL)
 
static INT_PTR CALLBACK HardwareDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG APIENTRY MmSysApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
VOID InitPropSheetPage (PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
 
LONG CALLBACK CPlApplet (HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
VOID WINAPI ShowAudioPropertySheet (HWND hwnd, HINSTANCE hInstance, LPWSTR lpszCmd, int nCmdShow)
 
VOID WINAPI ShowFullControlPanel (HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmd, int nCmdShow)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
 

Variables

static EVENT_LABEL_ITEM EventLabels []
 
static SYSTEM_SCHEME_ITEM SystemSchemes []
 
HINSTANCE hApplet = 0
 
const APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   (1)

Definition at line 100 of file mmsys.c.

◆ UPDATEDRIVERFORPLUGANDPLAYDEVICES

#define UPDATEDRIVERFORPLUGANDPLAYDEVICES   "UpdateDriverForPlugAndPlayDevicesW"

Definition at line 99 of file mmsys.c.

Typedef Documentation

◆ PHWPAGE_DISPLAYMODE

◆ UpdateDriverForPlugAndPlayDevicesProto

typedef BOOL(WINAPI * UpdateDriverForPlugAndPlayDevicesProto) (_In_opt_ HWND hwndParent, _In_ LPCWSTR HardwareId, _In_ LPCWSTR FullInfPath, _In_ DWORD InstallFlags, _Out_opt_ PBOOL bRebootRequired)

Definition at line 92 of file mmsys.c.

Enumeration Type Documentation

◆ HWPAGE_DISPLAYMODE

Enumerator
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 

Definition at line 23 of file mmsys.c.

24{
HWPAGE_DISPLAYMODE
Definition: mmsys.c:24
@ HWPD_STANDARDLIST
Definition: mmsys.c:25
@ HWPD_LARGELIST
Definition: mmsys.c:26
@ HWPD_MAX
Definition: mmsys.c:27
enum HWPAGE_DISPLAYMODE * PHWPAGE_DISPLAYMODE

Function Documentation

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCpl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 743 of file mmsys.c.

747{
748 UINT i = (UINT)lParam1;
749
750 switch (uMsg)
751 {
752 case CPL_INIT:
753 return TRUE;
754
755 case CPL_GETCOUNT:
756 return NUM_APPLETS;
757
758 case CPL_INQUIRE:
759 if (i < NUM_APPLETS)
760 {
761 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
762 CPlInfo->lData = 0;
763 CPlInfo->idIcon = Applets[i].idIcon;
764 CPlInfo->idName = Applets[i].idName;
765 CPlInfo->idInfo = Applets[i].idDescription;
766 }
767 else
768 {
769 return TRUE;
770 }
771 break;
772
773 case CPL_DBLCLK:
774 if (i < NUM_APPLETS)
775 Applets[i].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
776 else
777 return TRUE;
778 break;
779
780 case CPL_STARTWPARMSW:
781 if (i < NUM_APPLETS)
782 return Applets[i].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
783 break;
784 }
785
786 return FALSE;
787}
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
#define NUM_APPLETS
Definition: mmsys.c:100
const APPLET Applets[NUM_APPLETS]
Definition: mmsys.c:106
unsigned int UINT
Definition: ndis.h:50
int idDescription
Definition: hotplug.h:37
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
APPLET_PROC AppletProc
Definition: hotplug.h:38
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25

◆ DeviceCreateHardwarePageEx()

HWND WINAPI DeviceCreateHardwarePageEx ( HWND  hWndParent,
LPGUID  lpGuids,
UINT  uNumberOfGuids,
HWPAGE_DISPLAYMODE  DisplayMode 
)

Referenced by HardwareDlgProc().

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( VOID  )

Definition at line 113 of file mmsys.c.

114{
115 DPRINT1("DllCanUnloadNow() stubs\n");
116 return S_OK;
117}
#define DPRINT1
Definition: precomp.h:8
#define S_OK
Definition: intsafe.h:52

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 120 of file mmsys.c.

123{
124 DPRINT1("DllGetClassObject() stubs\n");
125 return S_OK;
126}

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 848 of file mmsys.c.

851{
852 UNREFERENCED_PARAMETER(lpReserved);
853 switch (dwReason)
854 {
856 hApplet = hinstDLL;
858 break;
859 }
860
861 return TRUE;
862}
DWORD dwReason
Definition: misc.cpp:141
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HINSTANCE hApplet
Definition: mmsys.c:103
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325

◆ HardwareDlgProc()

static INT_PTR CALLBACK HardwareDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 645 of file mmsys.c.

649{
652 switch (uMsg)
653 {
654 case WM_INITDIALOG:
655 {
656 GUID Guids[2];
657 Guids[0] = GUID_DEVCLASS_CDROM;
658 Guids[1] = GUID_DEVCLASS_MEDIA;
659
660 /* Create the hardware page */
662 Guids,
663 _countof(Guids),
665 break;
666 }
667 }
668
669 return FALSE;
670}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
#define _countof(array)
Definition: sndvol32.h:70
#define WM_INITDIALOG
Definition: winuser.h:1742

Referenced by MmSysApplet(), and ShowFullControlPanel().

◆ InitPropSheetPage()

VOID InitPropSheetPage ( PROPSHEETPAGEW psp,
WORD  idDlg,
DLGPROC  DlgProc 
)

Definition at line 728 of file mmsys.c.

731{
732 ZeroMemory(psp, sizeof(PROPSHEETPAGEW));
733 psp->dwSize = sizeof(PROPSHEETPAGEW);
734 psp->dwFlags = PSP_DEFAULT;
735 psp->hInstance = hApplet;
737 psp->pfnDlgProc = DlgProc;
738}
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
struct _PROPSHEETPAGEW PROPSHEETPAGEW
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216
#define ZeroMemory
Definition: winbase.h:1737
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by MmSysApplet(), ShowAudioPropertySheet(), and ShowFullControlPanel().

◆ InstallDefaultSystemSoundScheme()

VOID InstallDefaultSystemSoundScheme ( HKEY  hRootKey)

Definition at line 241 of file mmsys.c.

242{
243 HKEY hKey, hSubKey;
245 UINT i = 0;
246
248 return;
249
250 RegSetValueExW(hKey, NULL, 0, REG_SZ, (LPBYTE)SystemSchemes[0].DefaultName, (wcslen(SystemSchemes[0].DefaultName) + 1) * sizeof(WCHAR));
251 StringCchPrintfW(Path, _countof(Path), L"@mmsys.cpl,-%u", SystemSchemes[0].IconId);
252 RegSetValueExW(hKey, L"DispFileName", 0, REG_SZ, (LPBYTE)Path, (wcslen(Path) + 1) * sizeof(WCHAR));
253
254 do
255 {
257 {
258 HKEY hScheme;
259
260 StringCchPrintfW(Path, _countof(Path), L"%%SystemRoot%%\\media\\%s", EventLabels[i].FileName);
261 if (RegCreateKeyExW(hSubKey, L".Current", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hScheme, NULL) == ERROR_SUCCESS)
262 {
263 RegSetValueExW(hScheme, NULL, 0, REG_EXPAND_SZ, (LPBYTE)Path, (wcslen(Path) + 1) * sizeof(WCHAR));
264 RegCloseKey(hScheme);
265 }
266
267 if (RegCreateKeyExW(hSubKey, L".Default", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hScheme, NULL) == ERROR_SUCCESS)
268 {
269 RegSetValueExW(hScheme, NULL, 0, REG_EXPAND_SZ, (LPBYTE)Path, (wcslen(Path) + 1) * sizeof(WCHAR));
270 RegCloseKey(hScheme);
271 }
272 RegCloseKey(hSubKey);
273 }
274 i++;
275 } while (EventLabels[i].LabelName);
276
278}
PRTL_UNICODE_STRING_BUFFER Path
@ LabelName
Definition: asmpp.cpp:94
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
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:1096
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:4882
#define MAX_PATH
Definition: compat.h:34
FxAutoRegKey hKey
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22
static EVENT_LABEL_ITEM EventLabels[]
Definition: mmsys.c:45
static SYSTEM_SCHEME_ITEM SystemSchemes[]
Definition: mmsys.c:67
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define L(x)
Definition: ntvdm.h:50
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned char * LPBYTE
Definition: typedefs.h:53
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InstallSystemSoundScheme().

◆ InstallSoftwareBusPnpEnumerator()

DWORD InstallSoftwareBusPnpEnumerator ( LPCWSTR  InfPath,
LPCWSTR  HardwareIdList 
)

Definition at line 368 of file mmsys.c.

369{
373 WCHAR ClassName[50];
374 int Result = 0;
377 BOOL reboot = FALSE;
378 DWORD flags = 0;
379
380 if (!SetupDiGetINFClassW(InfPath, &ClassGUID, ClassName, _countof(ClassName), NULL))
381 {
382 return -1;
383 }
384
387 {
388 return -1;
389 }
390
393 {
395 return -1;
396 }
397
398 if (!SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet, &DeviceInfoData, SPDRP_HARDWAREID, (LPBYTE)HardwareIdList, (wcslen(HardwareIdList) + 1 + 1) * sizeof(WCHAR)))
399 {
401 return -1;
402 }
403
405 {
407 return -1;
408 }
409
411 {
413 return -1;
414 }
415
417 hModule = LoadLibraryW(L"newdev.dll");
418 if (!hModule)
419 {
421 return -1;
422 }
423
425 if (!UpdateProc)
426 {
429 return -1;
430 }
431
432 if (!UpdateProc(NULL, HardwareIdList, InfPath, flags, &reboot))
433 {
436 return -1;
437 }
438
441 return Result;
442}
HMODULE hModule
Definition: animate.c:44
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
static const WCHAR ClassGUID[]
Definition: devclass.c:30
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO DeviceInfoSet, PCWSTR DeviceName, CONST GUID *ClassGuid, PCWSTR DeviceDescription, HWND hwndParent, DWORD CreationFlags, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:1570
BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, const BYTE *PropertyBuffer, DWORD PropertyBufferSize)
Definition: devinst.c:3452
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
HDEVINFO WINAPI SetupDiCreateDeviceInfoList(const GUID *ClassGuid, HWND hwndParent)
Definition: devinst.c:1205
BOOL WINAPI SetupDiGetINFClassW(IN PCWSTR InfName, OUT LPGUID ClassGuid, OUT PWSTR ClassName, IN DWORD ClassNameSize, OUT PDWORD RequiredSize OPTIONAL)
Definition: parser.c:2316
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
BOOL(WINAPI * UpdateDriverForPlugAndPlayDevicesProto)(_In_opt_ HWND hwndParent, _In_ LPCWSTR HardwareId, _In_ LPCWSTR FullInfPath, _In_ DWORD InstallFlags, _Out_opt_ PBOOL bRebootRequired)
Definition: mmsys.c:92
#define UPDATEDRIVERFORPLUGANDPLAYDEVICES
Definition: mmsys.c:99
#define INSTALLFLAG_FORCE
Definition: newdev.h:34
#define DIF_REGISTERDEVICE
Definition: setupapi.h:144
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
Definition: setupapi.h:1528
#define DICD_GENERATE_ID
Definition: setupapi.h:110
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define SPDRP_HARDWAREID
Definition: setupapi.h:508
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_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

Referenced by MMSYS_InstallDevice().

◆ InstallSystemSoundLabels()

VOID InstallSystemSoundLabels ( HKEY  hKey)

Definition at line 203 of file mmsys.c.

204{
205 UINT i = 0;
206 HKEY hSubKey;
207 WCHAR Buffer[40];
208
209 do
210 {
212 {
213 RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)EventLabels[i].DefaultName, (wcslen(EventLabels[i].DefaultName) + 1) * sizeof(WCHAR));
214 StringCchPrintfW(Buffer, _countof(Buffer), L"@mmsys.cpl,-%u", EventLabels[i].LocalizedResId);
215 RegSetValueExW(hSubKey, L"DispFileName", 0, REG_SZ, (LPBYTE)Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR));
216
217 RegCloseKey(hSubKey);
218 }
219 i++;
220 } while (EventLabels[i].LabelName);
221}
Definition: bufpool.h:45

Referenced by InstallSystemSoundScheme().

◆ InstallSystemSoundScheme()

VOID InstallSystemSoundScheme ( VOID  )

Definition at line 282 of file mmsys.c.

283{
284 HKEY hKey, hSubKey;
285 DWORD dwDisposition;
286
288 return;
289
291 {
293 RegCloseKey(hSubKey);
294 }
295
296 if (RegCreateKeyExW(hKey, L"Schemes", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisposition) == ERROR_SUCCESS)
297 {
298 HKEY hNames;
299
300 if (RegCreateKeyExW(hSubKey, L"Names", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hNames, NULL) == ERROR_SUCCESS)
301 {
303 RegCloseKey(hNames);
304 }
305
306 if (RegCreateKeyExW(hSubKey, L"Apps", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hNames, NULL) == ERROR_SUCCESS)
307 {
309 RegCloseKey(hNames);
310 if (dwDisposition & REG_CREATED_NEW_KEY)
311 {
312 // FIXME
313 RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)L".Default", sizeof(L".Default"));
314 }
315 }
316
317 RegCloseKey(hSubKey);
318 }
319
321}
VOID InstallSystemSoundLabels(HKEY hKey)
Definition: mmsys.c:203
VOID InstallDefaultSystemSoundScheme(HKEY hRootKey)
Definition: mmsys.c:241
VOID InstallSystemSoundSchemeNames(HKEY hKey)
Definition: mmsys.c:224
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by MMSYS_InstallDevice().

◆ InstallSystemSoundSchemeNames()

VOID InstallSystemSoundSchemeNames ( HKEY  hKey)

Definition at line 224 of file mmsys.c.

225{
226 UINT i = 0;
227 HKEY hSubKey;
228
229 do
230 {
232 {
233 RegSetValueExW(hSubKey, NULL, 0, REG_SZ, (LPBYTE)SystemSchemes[i].DefaultName, (wcslen(SystemSchemes[i].DefaultName) + 1) * sizeof(WCHAR));
234 RegCloseKey(hSubKey);
235 }
236 i++;
237 } while (SystemSchemes[i].LabelName);
238}

Referenced by InstallSystemSoundScheme().

◆ IsSoftwareBusPnpEnumeratorInstalled()

BOOL IsSoftwareBusPnpEnumeratorInstalled ( )

Definition at line 324 of file mmsys.c.

325{
326 HDEVINFO hDevInfo;
327 SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
329 PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData;
330
332 if (!hDevInfo)
333 {
334 // failed
335 return FALSE;
336 }
337
338 DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
339 if (!SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &SWBusGuid, 0, &DeviceInterfaceData))
340 {
341 // failed
343 return FALSE;
344 }
345
346 DeviceInterfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA_W)HeapAlloc(GetProcessHeap(), 0, (MAX_PATH * sizeof(WCHAR)) + sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W));
347 if (!DeviceInterfaceDetailData)
348 {
349 // failed
351 return FALSE;
352 }
353
354 DeviceInterfaceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W);
355 if (!SetupDiGetDeviceInterfaceDetailW(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData, (MAX_PATH * sizeof(WCHAR)) + sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W), NULL, NULL))
356 {
357 // failed
358 HeapFree(GetProcessHeap(), 0, DeviceInterfaceDetailData);
360 return FALSE;
361 }
362 HeapFree(GetProcessHeap(), 0, DeviceInterfaceDetailData);
364 return TRUE;
365}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:2780
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
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:3011
#define DIGCF_DEVICEINTERFACE
Definition: setupapi.h:174
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA_W
#define DIGCF_PRESENT
Definition: setupapi.h:171
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W * PSP_DEVICE_INTERFACE_DETAIL_DATA_W
struct _SP_DEVICE_INTERFACE_DATA SP_DEVICE_INTERFACE_DATA
#define STATIC_BUSID_SoftwareDeviceEnumerator
Definition: swenum.h:25

Referenced by MMSYS_InstallDevice().

◆ MediaClassInstaller()

DWORD WINAPI MediaClassInstaller ( IN DI_FUNCTION  diFunction,
IN HDEVINFO  hDevInfo,
IN PSP_DEVINFO_DATA pspDevInfoData  OPTIONAL 
)

Definition at line 619 of file mmsys.c.

622{
623 switch (diFunction)
624 {
626 return MMSYS_InstallDevice(hDevInfo, pspDevInfoData);
627 case DIF_REMOVE:
628 return MMSYS_RemoveDevice(hDevInfo, pspDevInfoData);
630 return MMSYS_AllowInstallDevice(hDevInfo, pspDevInfoData);
631 case DIF_SELECTDEVICE:
632 return MMSYS_SelectDevice(hDevInfo, pspDevInfoData);
633 case DIF_DETECT:
634 return MMSYS_DetectDevice(hDevInfo, pspDevInfoData);
636 return MMSYS_SelectBestCompatDRV(hDevInfo, pspDevInfoData);
637 default:
638 return ERROR_DI_DO_DEFAULT;
639 }
640}
DWORD MMSYS_RemoveDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:589
DWORD MMSYS_SelectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:601
DWORD MMSYS_SelectBestCompatDRV(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:613
DWORD MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:445
DWORD MMSYS_AllowInstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:595
DWORD MMSYS_DetectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
Definition: mmsys.c:607
#define DIF_SELECTDEVICE
Definition: setupapi.h:120
#define DIF_REMOVE
Definition: setupapi.h:124
#define DIF_DETECT
Definition: setupapi.h:134
#define ERROR_DI_DO_DEFAULT
Definition: setupapi.h:310
#define DIF_INSTALLDEVICE
Definition: setupapi.h:121
#define DIF_ALLOW_INSTALL
Definition: setupapi.h:143
#define DIF_SELECTBESTCOMPATDRV
Definition: setupapi.h:142

◆ MediaPropPageProvider()

BOOL WINAPI MediaPropPageProvider ( LPVOID  Info,
LPFNADDPROPSHEETPAGE  PropSheetPage,
LPARAM  lParam 
)

Definition at line 194 of file mmsys.c.

197{
198 DPRINT1("MediaPropPageProvider() stubs\n");
199 return TRUE;
200}

◆ mmseRunOnce()

VOID WINAPI mmseRunOnce ( HWND  hwnd,
HINSTANCE  hInstance,
LPSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 185 of file mmsys.c.

189{
190 DPRINT1("mmseRunOnce() stubs\n");
191}

◆ mmseRunOnceA()

VOID WINAPI mmseRunOnceA ( HWND  hwnd,
HINSTANCE  hInstance,
LPSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 176 of file mmsys.c.

180{
181 DPRINT1("mmseRunOnceA() stubs\n");
182}

◆ mmseRunOnceW()

VOID WINAPI mmseRunOnceW ( HWND  hwnd,
HINSTANCE  hInstance,
LPWSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 167 of file mmsys.c.

171{
172 DPRINT1("mmseRunOnceW() stubs\n");
173}

◆ MMSYS_AllowInstallDevice()

DWORD MMSYS_AllowInstallDevice ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 595 of file mmsys.c.

596{
597 return ERROR_DI_DO_DEFAULT;
598}

Referenced by MediaClassInstaller().

◆ MMSYS_DetectDevice()

DWORD MMSYS_DetectDevice ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 607 of file mmsys.c.

608{
609 return ERROR_DI_DO_DEFAULT;
610}

Referenced by MediaClassInstaller().

◆ MMSYS_InstallDevice()

DWORD MMSYS_InstallDevice ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 445 of file mmsys.c.

446{
447 UINT Length;
448 WCHAR szBuffer[MAX_PATH];
449 HINF hInf;
451 BOOL Result;
452 SC_HANDLE hSCManager, hService;
453 WCHAR WaveName[20];
454 HKEY hKey;
456 ULONG Index;
457
458 if (!IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_SOUND) &&
459 !IsEqualIID(&pspDevInfoData->ClassGuid, &GUID_DEVCLASS_MEDIA))
460 return ERROR_DI_DO_DEFAULT;
461
462 Length = GetWindowsDirectoryW(szBuffer, _countof(szBuffer));
463 if (!Length || Length >= _countof(szBuffer) - CONST_STR_LEN(L"\\inf\\audio.inf"))
464 {
465 return ERROR_GEN_FAILURE;
466 }
467
468 //PathCchAppend(szBuffer, _countof(szBuffer), L"inf\\audio.inf");
469 StringCchCatW(szBuffer, _countof(szBuffer), L"\\inf\\audio.inf");
470
471 hInf = SetupOpenInfFileW(szBuffer,
472 NULL,
474 NULL);
475
476 if (hInf == INVALID_HANDLE_VALUE)
477 {
478 return ERROR_GEN_FAILURE;
479 }
480
482 if (Context == NULL)
483 {
484 SetupCloseInfFile(hInf);
485 return ERROR_GEN_FAILURE;
486 }
487
489 hInf,
490 L"AUDIO_Inst.NT",
492 NULL,
493 NULL,
496 Context,
497 NULL,
498 NULL);
499
500 if (Result)
501 {
503 L"Audio_Inst.NT.Services",
504 0);
505 }
506
508 SetupCloseInfFile(hInf);
509
511 {
512 Length = GetWindowsDirectoryW(szBuffer, _countof(szBuffer));
513 if (!Length || Length >= _countof(szBuffer) - CONST_STR_LEN(L"\\inf\\machine.inf"))
514 {
515 return ERROR_GEN_FAILURE;
516 }
517
518 //PathCchAppend(szBuffer, _countof(szBuffer), L"inf\\machine.inf");
519 StringCchCatW(szBuffer, _countof(szBuffer), L"\\inf\\machine.inf");
520
521 InstallSoftwareBusPnpEnumerator(szBuffer, L"ROOT\\SWENUM\0");
522 }
523
525 if (!hSCManager)
526 {
527 return ERROR_DI_DO_DEFAULT;
528 }
529
530 hService = OpenServiceW(hSCManager, L"AudioSrv", SERVICE_ALL_ACCESS);
531 if (hService)
532 {
533 /* Make AudioSrv start automatically */
535
536 StartServiceW(hService, 0, NULL);
537 CloseServiceHandle(hService);
538 }
540
541 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32", 0, KEY_READ | KEY_WRITE, &hKey) == ERROR_SUCCESS)
542 {
543 Length = GetSystemDirectoryW(szBuffer, _countof(szBuffer));
544 if (!Length || Length >= _countof(szBuffer) - CONST_STR_LEN(L"\\wdmaud.drv"))
545 {
547 return ERROR_DI_DO_DEFAULT;
548 }
549
550 //PathCchAppend(szBuffer, _countof(szBuffer), L"wdmaud.drv");
551 StringCchCatW(szBuffer, _countof(szBuffer), L"\\wdmaud.drv");
552
553 for (Index = 1; Index <= 4; Index++)
554 {
555 StringCchPrintfW(WaveName, _countof(WaveName), L"wave%u", Index);
556 if (RegQueryValueExW(hKey, WaveName, 0, NULL, NULL, &BufferSize) != ERROR_MORE_DATA)
557 {
558 /* Store new audio driver entry */
559 RegSetValueExW(hKey, WaveName, 0, REG_SZ, (LPBYTE)szBuffer, (wcslen(szBuffer) + 1) * sizeof(WCHAR));
560 break;
561 }
562 else
563 {
565 BufferSize = sizeof(Buffer);
566
568 {
569 /* Make sure the buffer is zero terminated */
571
572 if (!_wcsicmp(Buffer, szBuffer))
573 {
574 /* An entry already exists */
575 break;
576 }
577 }
578 }
579 }
581 }
583
584 return ERROR_DI_DO_DEFAULT;
585
586}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define BufferSize
Definition: mmc.h:75
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
BOOL WINAPI SetupInstallServicesFromInfSectionW(HINF Inf, PCWSTR SectionName, DWORD Flags)
Definition: install.c:1615
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:1330
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1729
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1629
#define INF_STYLE_WIN4
Definition: infsupp.h:43
VOID InstallSystemSoundScheme(VOID)
Definition: mmsys.c:282
DWORD InstallSoftwareBusPnpEnumerator(LPCWSTR InfPath, LPCWSTR HardwareIdList)
Definition: mmsys.c:368
BOOL IsSoftwareBusPnpEnumeratorInstalled()
Definition: mmsys.c:324
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_WRITE
Definition: nt_native.h:1031
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define CONST_STR_LEN(str)
Definition: procpage.c:19
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
SC_HANDLE hSCManager
Definition: sc.c:12
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2068
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2160
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword, LPCWSTR lpDisplayName)
Definition: scm.c:482
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
Definition: scm.c:2980
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define SPINST_ALL
Definition: setupapi.h:601
#define SP_COPY_NEWER
Definition: setupapi.h:478
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
uint32_t ULONG
Definition: typedefs.h:59
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define ERROR_GEN_FAILURE
Definition: winerror.h:134
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SERVICE_ALL_ACCESS
Definition: winsvc.h:62
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define SERVICE_NO_CHANGE
Definition: winsvc.h:20
#define SERVICE_AUTO_START
Definition: cmtypes.h:977

Referenced by MediaClassInstaller().

◆ MMSYS_RemoveDevice()

DWORD MMSYS_RemoveDevice ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 589 of file mmsys.c.

590{
591 return ERROR_DI_DO_DEFAULT;
592}

Referenced by MediaClassInstaller().

◆ MMSYS_SelectBestCompatDRV()

DWORD MMSYS_SelectBestCompatDRV ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 613 of file mmsys.c.

614{
615 return ERROR_DI_DO_DEFAULT;
616}

Referenced by MediaClassInstaller().

◆ MMSYS_SelectDevice()

DWORD MMSYS_SelectDevice ( HDEVINFO  hDevInfo,
PSP_DEVINFO_DATA  pspDevInfoData 
)

Definition at line 601 of file mmsys.c.

602{
603 return ERROR_DI_DO_DEFAULT;
604}

Referenced by MediaClassInstaller().

◆ MmSysApplet()

LONG APIENTRY MmSysApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)

Definition at line 690 of file mmsys.c.

694{
695 PROPSHEETPAGEW psp[5];
696 PROPSHEETHEADERW psh; // = { 0 };
697 INT nPage = 0;
698
700
701 if (uMsg == CPL_STARTWPARMSW && lParam != 0)
702 nPage = _wtoi((PWSTR)lParam);
703
704 psh.dwSize = sizeof(PROPSHEETHEADERW);
706 psh.hwndParent = hwnd;
707 psh.hInstance = hApplet;
710 psh.nPages = _countof(psp);
711 psh.nStartPage = 0;
712 psh.ppsp = psp;
714
720
721 if (nPage != 0 && nPage <= psh.nPages)
722 psh.nStartPage = nPage;
723
724 return (LONG)(PropertySheetW(&psh) != -1);
725}
#define IDS_CPLNAME
Definition: resource.h:8
#define IDI_CPLICON
Definition: resource.h:4
#define IDD_HARDWARE
Definition: resource.h:30
INT_PTR CALLBACK AudioDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: audio.c:241
#define IDD_VOLUME
Definition: resource.h:19
#define IDD_VOICE
Definition: resource.h:22
#define IDD_AUDIO
Definition: resource.h:21
#define IDD_SOUNDS
Definition: resource.h:20
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2916
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
static INT_PTR CALLBACK HardwareDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mmsys.c:645
VOID InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
Definition: mmsys.c:728
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mmsys.c:673
INT_PTR CALLBACK SoundsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: sounds.c:1243
INT_PTR CALLBACK VolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: volume.c:388
INT_PTR CALLBACK VoiceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: voice.c:15
long LONG
Definition: pedump.c:60
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 673 of file mmsys.c.

674{
675 // NOTE: This callback is needed to set large icon correctly.
676 HICON hIcon;
677 switch (uMsg)
678 {
679 case PSCB_INITIALIZED:
680 {
682 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
683 break;
684 }
685 }
686 return 0;
687}
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LPARAM
Definition: windef.h:208
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by MmSysApplet(), ShowAudioPropertySheet(), and ShowFullControlPanel().

◆ ShowAudioPropertySheet()

VOID WINAPI ShowAudioPropertySheet ( HWND  hwnd,
HINSTANCE  hInstance,
LPWSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 790 of file mmsys.c.

794{
795 PROPSHEETPAGEW psp[1];
797
798 DPRINT("ShowAudioPropertySheet()\n");
799
800 psh.dwSize = sizeof(PROPSHEETHEADERW);
802 psh.hwndParent = hwnd;
803 psh.hInstance = hInstance;
806 psh.nPages = _countof(psp);
807 psh.nStartPage = 0;
808 psh.ppsp = psp;
810
812
813 PropertySheetW(&psh);
814}
HINSTANCE hInstance
Definition: charmap.c:19
#define DPRINT
Definition: sndvol32.h:73

◆ ShowDriverSettingsAfterFork()

VOID WINAPI ShowDriverSettingsAfterFork ( HWND  hwnd,
HINSTANCE  hInstance,
LPSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 148 of file mmsys.c.

152{
153 DPRINT1("ShowDriverSettingsAfterFork() stubs\n");
154}

◆ ShowDriverSettingsAfterForkA()

VOID WINAPI ShowDriverSettingsAfterForkA ( HWND  hwnd,
HINSTANCE  hInstance,
LPSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 139 of file mmsys.c.

143{
144 DPRINT1("ShowDriverSettingsAfterForkA() stubs\n");
145}

◆ ShowDriverSettingsAfterForkW()

VOID WINAPI ShowDriverSettingsAfterForkW ( HWND  hwnd,
HINSTANCE  hInstance,
LPWSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 130 of file mmsys.c.

134{
135 DPRINT1("ShowDriverSettingsAfterForkW() stubs\n");
136}

◆ ShowFullControlPanel()

VOID WINAPI ShowFullControlPanel ( HWND  hwnd,
HINSTANCE  hInstance,
LPSTR  lpszCmd,
int  nCmdShow 
)

Definition at line 817 of file mmsys.c.

821{
822 PROPSHEETPAGEW psp[5];
824
825 DPRINT("ShowFullControlPanel()\n");
826
827 psh.dwSize = sizeof(PROPSHEETHEADERW);
829 psh.hwndParent = hwnd;
830 psh.hInstance = hInstance;
833 psh.nPages = _countof(psp);
834 psh.nStartPage = 0;
835 psh.ppsp = psp;
837
843
844 PropertySheetW(&psh);
845}

◆ ShowMMCPLPropertySheet()

BOOL WINAPI ShowMMCPLPropertySheet ( HWND  hwnd,
LPCSTR  pszPropSheet,
LPSTR  pszName,
LPSTR  pszCaption 
)

Definition at line 157 of file mmsys.c.

161{
162 DPRINT1("ShowMMCPLPropertySheet() stubs\n");
163 return TRUE;
164}

Variable Documentation

◆ Applets

Initial value:
=
{
}
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
LONG APIENTRY MmSysApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: mmsys.c:690

Definition at line 106 of file mmsys.c.

Referenced by CPlApplet().

◆ EventLabels

EVENT_LABEL_ITEM EventLabels[]
static
Initial value:
=
{
{
L"WindowsLogon",
L"ReactOS Logon",
L"ReactOS_Logon.wav"
},
{
L"WindowsLogoff",
L"ReactOS Logoff",
L"ReactOS_Logoff.wav"
},
{
0,
}
}
#define IDS_REACTOS_LOGOFF
Definition: resource.h:81
#define IDS_REACTOS_LOGON
Definition: resource.h:82

Definition at line 45 of file mmsys.c.

Referenced by InstallDefaultSystemSoundScheme(), and InstallSystemSoundLabels().

◆ hApplet

HINSTANCE hApplet = 0

Definition at line 103 of file mmsys.c.

Referenced by DllMain(), InitPropSheetPage(), MmSysApplet(), and PropSheetProc().

◆ SystemSchemes

SYSTEM_SCHEME_ITEM SystemSchemes[]
static
Initial value:
=
{
{
L".Default",
L"ReactOS Standard",
},
{
L".None",
L"No Sounds",
-1
},
{
}
}
#define IDS_REACTOS_DEFAULT_SCHEME
Definition: resource.h:83

Definition at line 67 of file mmsys.c.

Referenced by InstallDefaultSystemSoundScheme(), and InstallSystemSoundSchemeNames().