24{
28
29 DWORD value_name_length = 256;
30 char value_name[256];
31
32 DWORD value_data_length = 256;
33 char value_data[256];
34
35 char wavemapper[256] = { 0 };
36 char midimapper[256] = { 0 };
37
39
41 {
42 TRACE(
"ERROR: Could not open: HKEY_LOCAL_MACHINE\\%s\n",
key);
43 return 0;
44 }
45
47 driver_index,
48 value_name,
49 &value_name_length,
51 &value_type,
54 {
57
58 if ( value_type ==
REG_SZ )
59 {
60
61
62
63 if ( !
_stricmp(
"wavemapper", value_name) )
64 {
65 TRACE(
"Found a Wave-mapper: %s\n", value_data);
66
67 strcpy(wavemapper, value_data);
70 }
71 else if ( !
_stricmp(
"midimapper", value_name) )
72 {
73 TRACE(
"Found a MIDI-mapper: %s\n", value_data);
74
75 strcpy(midimapper, value_data);
78 }
79 else if ( !
_strnicmp(
"wave", value_name, 4) )
80 {
81 TRACE(
"Found a Wave driver: %s\n", value_data);
84 }
85 else if ( !
_strnicmp(
"midi", value_name, 4) )
86 {
87 TRACE(
"Found a MIDI driver: %s\n", value_data);
90 }
91 else if ( !
_strnicmp(
"mixer", value_name, 5) )
92 {
93 TRACE(
"Found a mixer driver: %s\n", value_data);
96 }
97 else if ( !
_strnicmp(
"aux", value_name, 4) )
98 {
99 TRACE(
"Found an aux driver: %s\n", value_data);
102 }
103 else
104 {
105 TRACE(
"Not supported: %s\n", value_data);
106 }
107
108
109
110
111 if ( valid_driver )
112 {
114 {
115 TRACE(
"FAILED when initializing %s\n", value_data);
116 }
117 }
118 }
119 else
120 {
121 TRACE(
"Invalid data format\n");
122 }
123
124
125 value_name_length = 256;
126 value_data_length = 256;
127 memset(value_name, 0, value_name_length);
128 memset(value_data, 0, value_data_length);
129
130 driver_index ++;
131 }
132
133
134 if (*wavemapper)
135 {
137 {
138 TRACE(
"FAILED when initializing %s\n", wavemapper);
139 }
140 }
141
142 if (*midimapper)
143 {
145 {
146 TRACE(
"FAILED when initializing %s\n", midimapper);
147 }
148 }
149
151
153}
char * strcpy(char *DstString, const char *SrcString)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
#define _strnicmp(_String1, _String2, _MaxCount)
static unsigned driver_count
BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper)
static const WCHAR drivers_key[]
#define HKEY_LOCAL_MACHINE