ReactOS 0.4.15-dev-6047-gb29e82d
main.cpp
Go to the documentation of this file.
1/*
2Copyright (c) 2006-2008 dogbert <dogber1@gmail.com>
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions
7are met:
81. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
102. Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
133. The name of the author may not be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#include "main.h"
29
30
31void PrintLastError(LPCSTR function)
32{
33 LPVOID lpMsgBuf;
34 DWORD errorid = GetLastError();
35
37 MessageBox(NULL, (LPCSTR)lpMsgBuf, function, MB_ICONEXCLAMATION | MB_OK);
38 LocalFree(lpMsgBuf);
39}
40
41BOOL generateTestSignal(double amplitude, int Channels, int SamplesPerSec, SHORT** buffer)
42{
43 int i, o2, o3, o4, o5;
44 bool Left,Right,BackLeft,BackRight,Center,Sub, CenterLeft, CenterRight;
45 short value;
46 double x = SPEAKER_FREQUENCY*2*3.141592654/SamplesPerSec;
47 double y = BASS_FREQUENCY*2*3.141592654/SamplesPerSec;
48
57
58 if (!(Left || Right || BackLeft || BackRight || Center || Sub || CenterLeft || CenterRight)) {
59 return FALSE;
60 }
61
62 if (currentChannelCount > 4) {
63 o2 = 4; o3 = 5;
64 o4 = 2; o5 = 3;
65 } else {
66 o2 = 2; o3 = 3;
67 o4 = 4; o5 = 5;
68 }
69
70 (*buffer) = (SHORT*)LocalAlloc(LPTR, SamplesPerSec*sizeof(SHORT)*Channels);
71 ZeroMemory((*buffer), SamplesPerSec*sizeof(SHORT)*Channels);
72
73 for (i=0;i<SamplesPerSec;i++) {
74 value = (SHORT)(cos(i*x)*amplitude*32767.0);
75 if (Left) {
76 (*buffer)[(i*Channels)+0] = value;
77 }
78 if (Right) {
79 (*buffer)[(i*Channels)+1] = value;
80 }
81 if (BackLeft) {
82 (*buffer)[(i*Channels)+o2] = value;
83 }
84 if (BackRight) {
85 (*buffer)[(i*Channels)+o3] = value;
86 }
87 if (Center) {
88 (*buffer)[(i*Channels)+o4] = value;
89 }
90 if (Sub) {
91 (*buffer)[(i*Channels)+o5] = (SHORT)(cos(i*y)*amplitude*32767.0);
92 }
93 if (CenterLeft) {
94 (*buffer)[(i*Channels)+6] = value;
95 }
96 if (CenterRight) {
97 (*buffer)[(i*Channels)+7] = value;
98 }
99 }
100 return TRUE;
101}
102
104{
105 if (hWave == NULL) {
106 return FALSE;
107 }
108
110 PrintLastError("waveOutReset()");
111 return FALSE;
112 }
114 PrintLastError("waveOutClose()");
115 return FALSE;
116 }
117 hWave = NULL;
119 return TRUE;
120}
121
123{
124 WAVEOUTCAPS woc;
125 UINT i, numDev;
126
127 numDev = waveOutGetNumDevs();
128 for (i=0;i<numDev;i++) {
129 if (!waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS))) {
131 (CompareString(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), NORM_IGNORECASE, woc.szPname, -1, TEXT("Speakers (CMI8738/8768 Audio De"), -1) == CSTR_EQUAL)) {
132 return i;
133 }
134 }
135 }
136 return WAVE_MAPPER;
137}
138
140{
141 SHORT* buffer;
142 BOOL isChannelChecked;
143#if 1
145
146 ZeroMemory(&wfx, sizeof(WAVEFORMATEXTENSIBLE));
150 wfx.Format.wBitsPerSample = 16;
153 wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
156#else
157 WAVEFORMATEX wfx;
158 wfx.wFormatTag = WAVE_FORMAT_PCM;
159 wfx.wBitsPerSample = 16;
160 wfx.nChannels = (WORD)currentChannelCount;
161 wfx.nSamplesPerSec = SAMPLE_RATE;
162 wfx.nAvgBytesPerSec = SAMPLE_RATE * (wfx.wBitsPerSample >> 3) * wfx.nChannels;
163 wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
164 wfx.cbSize = 0;
165#endif
166
167 isChannelChecked = (SendMessage(GetDlgItem(hWndChild[0], IDC_LEFT), BM_GETCHECK, 0, 0) == BST_CHECKED);
168 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_RIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED);
169 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_BLEFT), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 2);
170 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_BRIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 2);
171 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_CENTER), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 4);
172 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_SUB), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 4);
173 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_CLEFT), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 6);
174 isChannelChecked |= (SendMessage(GetDlgItem(hWndChild[0], IDC_CRIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED) && (currentChannelCount > 6);
175
176 if (!isChannelChecked)
177 return FALSE;
178
180 PrintLastError("waveOutOpen()");
181 return FALSE;
182 }
183
185 return FALSE;
186 }
187
188 ZeroMemory(&pwh, sizeof(pwh));
192 pwh.dwLoops = 0xFFFFFFFF;
195 PrintLastError("waveOutPrepareHeader()");
196 return FALSE;
197 }
198
201 PrintLastError("waveOutReset()");
202 return FALSE;
203 }
204 if (waveOutWrite(hWave, &pwh, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) {
206 PrintLastError("waveOutWrite()");
207 return FALSE;
208 }
209
210 return TRUE;
211}
212
213
214BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext)
215{
216 LPGUID* pGUID = (LPGUID*)lpContext;
217
218 if (pGUID == NULL) {
219 return FALSE;
220 }
221 if ((*pGUID) != NULL) {
222 return TRUE;
223 }
224
225 if (lpGUID != NULL) {
226 // XP, 2k
229 (*pGUID) = (LPGUID)LocalAlloc(LPTR, sizeof(GUID));
230 memcpy((*pGUID), lpGUID, sizeof(GUID));
231 return TRUE;
232 }
233 // Vista
234 if (CompareString(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), NORM_IGNORECASE, lpszDesc, -1, TEXT("Speakers (CMI8738/8768 Audio Device)"), -1) == CSTR_EQUAL) {
235 (*pGUID) = (LPGUID)LocalAlloc(LPTR, sizeof(GUID));
236 memcpy((*pGUID), lpGUID, sizeof(GUID));
237 return TRUE;
238 }
239 }
240 return TRUE;
241}
242
244{
245 IDirectSound8* ds;
246 DWORD speakerConfig;
247 LPGUID guid = NULL;
248
249 DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, (VOID*)&guid);
250
251 if (DirectSoundCreate8(guid, &ds, NULL) != S_OK) {
252 return FALSE;
253 }
254
255 ds->Initialize(NULL);
256
257 if (ds->GetSpeakerConfig(&speakerConfig) != S_OK) {
258 PrintLastError("GetSpeakerConfig()");
259 return FALSE;
260 }
261
262 if (ds) {
263 ds->Release();
264 }
265 if (guid) {
267 }
268
269 switch (DSSPEAKER_CONFIG(speakerConfig)) {
270 case DSSPEAKER_STEREO: currentChannelCount = 2; return TRUE;
271 case DSSPEAKER_QUAD: currentChannelCount = 4; return TRUE;
274 }
275
276 return FALSE;
277}
278
280{
281 IDirectSound8* ds;
282 DWORD speakerConfig;
283 LPGUID guid = NULL;
284
285 DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc, (VOID*)&guid);
286
287 if (DirectSoundCreate8(guid, &ds, NULL) != S_OK) {
288 PrintLastError("DirectSoundCreate8()");
289 return FALSE;
290 }
291
292
293 ds->Initialize(NULL);
294
295 switch (currentChannelCount) {
296 case 2: speakerConfig = DSSPEAKER_STEREO; break;
297 case 4: speakerConfig = DSSPEAKER_QUAD; break;
298 case 6: speakerConfig = DSSPEAKER_5POINT1; break;
299 case 8: speakerConfig = DSSPEAKER_7POINT1; break;
300 default: speakerConfig = DSSPEAKER_STEREO; break;
301 }
302
303 if (ds->SetSpeakerConfig(speakerConfig) != S_OK) {
304 PrintLastError("SetSpeakerConfig()");
305 return FALSE;
306 }
307
308 if (ds) {
309 ds->Release();
310 }
311 if (guid) {
313 }
314
315
316 return FALSE;
317}
318
320{
321 TCHAR szServiceName[128];
322 int nIndex = 0;
323
325 if (pDev->Info == INVALID_HANDLE_VALUE) {
326 PrintLastError("SetupDiGetClassDevs()");
327 return FALSE;
328 }
329
330 pDev->InfoData.cbSize = sizeof(SP_DEVINFO_DATA);
331
332 while (SetupDiEnumDeviceInfo(pDev->Info, nIndex, &(pDev->InfoData))) {
333 if (!SetupDiGetDeviceRegistryProperty(pDev->Info, &(pDev->InfoData), SPDRP_SERVICE, NULL, (PBYTE)szServiceName, sizeof(szServiceName), NULL)) {
334 PrintLastError("SetupDiGetDeviceRegistryProperty()");
336 pDev->Info = NULL;
337 return FALSE;
338 }
339
341 return TRUE;
342 }
343 nIndex++;
344 }
345
347 pDev->Info = NULL;
348 return FALSE;
349}
350
352{
353 DWORD dataSize = 0;
354 BOOL result;
355 PTSTR pnpStr = NULL;
356 HDEVINFO hDevInfoWithInterface;
357 SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
358
359 // get the PnP string
362 PrintLastError("SetupDiGetDeviceInstanceId()");
363 return FALSE;
364 }
365 pnpStr = (PTSTR)LocalAlloc(LPTR, dataSize * sizeof(TCHAR));
366 if (!pnpStr) {
367 PrintLastError("LocalAlloc()");
368 return FALSE;
369 }
370 result = SetupDiGetDeviceInstanceId(pDev->Info, &(pDev->InfoData), pnpStr, dataSize, NULL);
371 if (!result) {
372 PrintLastError("SetupDiGetDeviceInstanceId()");
373 LocalFree(pnpStr);
374 return FALSE;
375 }
376 hDevInfoWithInterface = SetupDiGetClassDevs(&KSCATEGORY_TOPOLOGY, pnpStr, NULL, DIGCF_DEVICEINTERFACE);
377 LocalFree(pnpStr);
378 if (hDevInfoWithInterface == INVALID_HANDLE_VALUE) {
379 PrintLastError("SetupDiGetClassDevs()");
380 return FALSE;
381 }
382
383 // get the device interface data
384 DeviceInterfaceData.cbSize = sizeof(DeviceInterfaceData);
385 result = SetupDiEnumDeviceInterfaces(hDevInfoWithInterface, NULL, &KSCATEGORY_TOPOLOGY, 0, &DeviceInterfaceData);
386 if (!result) {
387 PrintLastError("SetupDiEnumDeviceInterfaces()");
388 SetupDiDestroyDeviceInfoList(hDevInfoWithInterface);
389 return FALSE;
390 }
391
392 // get the device interface detail data
393 dataSize = 0;
394 SetupDiGetDeviceInterfaceDetail(hDevInfoWithInterface, &DeviceInterfaceData, NULL, 0, &dataSize, NULL);
396 PrintLastError("SetupDiGetDeviceInterfaceDetail()");
397 SetupDiDestroyDeviceInfoList(hDevInfoWithInterface);
398 return FALSE;
399 }
401 if (!pDev->InterfaceDetailData) {
402 PrintLastError("LocalAlloc()");
403 SetupDiDestroyDeviceInfoList(hDevInfoWithInterface);
404 return FALSE;
405 }
407 result = SetupDiGetDeviceInterfaceDetail(hDevInfoWithInterface, &DeviceInterfaceData, pDev->InterfaceDetailData, dataSize, NULL, NULL);
408 SetupDiDestroyDeviceInfoList(hDevInfoWithInterface);
409 if (!result) {
410 PrintLastError("SetupDiGetDeviceInterfaceDetail()");
413 return FALSE;
414 }
415
416 return TRUE;
417
418}
419
421{
422 BOOL result;
423 HANDLE hDevice;
424 KSPROPERTY KSProp;
426
428 if (hDevice == INVALID_HANDLE_VALUE) {
429 PrintLastError("CreateFile()");
430 return FALSE;
431 }
432 KSProp.Set = KSPROPSETID_CMI;
433 KSProp.Flags = KSPROPERTY_TYPE_GET;
434 KSProp.Id = KSPROPERTY_CMI_GET;
435 result = DeviceIoControl(hDevice, IOCTL_KS_PROPERTY, &KSProp, sizeof(KSProp), &cmiData, sizeof(cmiData), &dataSize, NULL);
436 CloseHandle(hDevice);
437
438 if (!result) {
439 PrintLastError("DeviceIoControl()");
440 return FALSE;
441 }
442
443 return TRUE;
444}
445
447{
448 BOOL result;
449 HANDLE hDevice;
450 KSPROPERTY KSProp;
452
454 if (hDevice == INVALID_HANDLE_VALUE) {
455 PrintLastError("CreateFile()");
456 return FALSE;
457 }
458 KSProp.Set = KSPROPSETID_CMI;
459 KSProp.Flags = KSPROPERTY_TYPE_SET;
460 KSProp.Id = KSPROPERTY_CMI_SET;
461 result = DeviceIoControl(hDevice, IOCTL_KS_PROPERTY, &KSProp, sizeof(KSProp), &cmiData, sizeof(cmiData), &dataSize, NULL);
462 CloseHandle(hDevice);
463
464 if (!result) {
465 PrintLastError("DeviceIoControl()");
466 return FALSE;
467 }
468
469 return TRUE;
470}
471
473{
474 stopTestTone();
475 if (cmiTopologyDev.Info) {
478 }
482 }
483 if (hURLFont) {
484 DeleteObject(hURLFont); //hm?
485 hURLFont = NULL;
486 }
487}
488
489BOOL openDevice(bool handleError)
490{
492 if (handleError)
493 PrintLastError("getDeviceInfo()");
494 return FALSE;
495 }
496
498 if (handleError)
499 PrintLastError("getDeviceInterfaceDetail()");
500 return FALSE;
501 }
502
503 return TRUE;
504}
505
507{
509 case 0: // stereo
517 break;
518 case 1: // quad
526 break;
527 case 2: // 5.1
534 SetDlgItemText(hWnd, IDT_SWAPJACKS, "BL/BR and C/LFE jacks are swapped!");
535 break;
536 case 3: // 7.1
543 SetDlgItemText(hWnd, IDT_SWAPJACKS, "BL/BR and C/LFE jacks are swapped!");
544 break;
545 }
546}
547
548
550{
551 HWND hWndItem;
552 char buffer[127];
553
555 PrintLastError("getDriverData()");
556 return FALSE;
557 }
558
559 // 'About' tab
565 wsprintf(buffer, "%04X", cmiData.IOBase);
567 wsprintf(buffer, "%04X", cmiData.MPUBase);
569
570 // channel config combobox
572 SendMessage(hWndItem, CB_RESETCONTENT, 0, 0);
573 if (cmiData.maxChannels >= 2) {
574 SendMessage(hWndItem, CB_ADDSTRING, 0, (LPARAM)"Stereo (2.0)");
575 }
576 if (cmiData.maxChannels >= 4) {
577 SendMessage(hWndItem, CB_ADDSTRING, 0, (LPARAM)"Quadrophonic (4.0)");
578 }
579 if (cmiData.maxChannels >= 6) {
580 SendMessage(hWndItem, CB_ADDSTRING, 0, (LPARAM)"5.1 Surround");
581 }
582 if (cmiData.maxChannels >= 8) {
583 SendMessage(hWndItem, CB_ADDSTRING, 0, (LPARAM)"7.1 Surround");
584 }
588 SendMessage(hWndItem, CB_SETCURSEL, (currentChannelCount/2)-1, 0);
590 } else {
593 }
594
595 // checkboxes
598
607
620
621 // radioboxes
625
628
629
630 return TRUE;
631}
632
634{
641
650
664
666
668}
669
671{
672 HICON hIcon;
673 TC_ITEM tci;
674 int i;
675
677 SendMessage(hWnd, WM_SETICON, (LPARAM) ICON_BIG, (WPARAM) hIcon);
678 hURLFont = 0;
679
681
682 ZeroMemory(&tci, sizeof(TC_ITEM));
683 tci.mask = TCIF_TEXT;
684 for (i=0;i<NUM_TABS;i++) {
685 tci.pszText = tabsName[i];
686 if (TabCtrl_InsertItem(hWndTab, i, &tci) == -1) {
687 PrintLastError("TabCtrl_InsertItem()");
688 return FALSE;
689 }
691 }
692
693 hURLFont = CreateFont(20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH | FF_SWISS, "MS Shell Dlg");
695
696 currentTab = 0;
698
699 if (!openDevice(TRUE)) {
700 PrintLastError("openDevice()");
701 return FALSE;
702 }
703 return setDlgItems(hWnd);
704}
705
707{
708 if (lpnmhdr->code != TCN_SELCHANGE) {
709 return FALSE;
710 }
714 return TRUE;
715}
716
718{
719 switch(msg) {
720 case WM_INITDIALOG:
721 if (!initDialog(hWnd)) {
723 }
724 return TRUE;
725 case WM_CLOSE:
727 return TRUE;
728 case WM_NOTIFY:
729 return changeTab((LPNMHDR)lParam);
730 case WM_DESTROY:
731 cleanUp();
733 return TRUE;
734 case WM_COMMAND:
735 if (LOWORD(wParam) == IDB_CLOSE) {
737 return TRUE;
738 }
739 if (LOWORD(wParam) == IDB_APPLY) {
742 return TRUE;
743 }
744 break;
745 }
746 return 0;
747}
748
749void openURL(int control)
750{
751 char buffer[127];
752 GetWindowText(GetDlgItem(hWndChild[3], control), buffer, sizeof(buffer));
754}
755
757{
758 switch(msg) {
759 case WM_COMMAND:
760 switch (LOWORD(wParam)) {
761 case IDB_STARTSTOP:
762 if (stopTestTone()) {
763 SetDlgItemText(hWndChild[0], IDB_STARTSTOP, "&Play test tone");
764 return TRUE;
765 }
766 if (playTestTone()) {
768 return TRUE;
769 }
770 break;
771 case IDC_URL1:
772 case IDC_URL2:
774 break;
775 }
778 SetTextColor((HDC)wParam, 0xFF0000);
781 }
782 }
783
784 return 0;
785}
786
788{
789 unsigned char usage[] = "/h - print this help message\r\n" \
790 "/enable71Mode - change channel configuration to 7.1\r\n" \
791 "/enable51Mode - change channel configuration to 5.1\r\n" \
792 "/enable40Mode - change channel configuration to 4.0 (Quad)\r\n" \
793 "/enable20Mode - change channel configuration to 2.0 (Stereo)\r\n" \
794 "/enableSPDIFo - enable SPDIF-out\r\n" \
795 "/disableSPDIFo - disable SPDIF-out\r\n"\
796 "/enableSPDIFi - enable SPDIF-in recording\r\n" \
797 "/disableSPDIFi - disable SPDIF-in recording\r\n" \
798 "/enableLoopThru - enable loop-through from SPDIF-in to SPDIF-out\r\n" \
799 "/disableLoopThru - disable loop-through from SPDIF-in to SPDIF-out\r\n";
800
802 return;
803}
804
806 TCHAR SysDir[MAX_PATH];
807 unsigned int len;
808 if (GetSystemDirectory(SysDir, sizeof(SysDir))==0) {
809 PrintLastError("GetSystemDirectory()");
810 return;
811 }
812 len = strlen(SysDir);
813
814 strcat(SysDir, "\\cmicpl.cpl");
815 if (!DeleteFile(SysDir)) {
817 }
818 SysDir[len] = 0;
819
820 strcat(SysDir, "\\cmicontrol.exe");
821 if (!DeleteFile(SysDir)) {
823 }
824}
825
826
829 RegDeleteKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\CMIDriver");
830 MessageBox(NULL, "The CMI driver applications have been successfully removed from your computer!", "CMIDriver", MB_ICONINFORMATION);
831 ExitProcess(0);
832}
833
834bool checkToken(char* token) {
835 if ((strcmp(token, "?")==0) || (strcmp(token, "H")==0)) {
836 printUsage();
837 return TRUE;
838 } else
839 if (strcmp(token, "ENABLE71MODE")==0) {
841 } else
842 if (strcmp(token, "ENABLE51MODE")==0) {
844 } else
845 if ((strcmp(token, "ENABLE40MODE")==0) || (strcmp(token, "ENABLEQUADMODE")==0) || (strcmp(token, "QUAD")==0) ) {
847 } else
848 if ((strcmp(token, "ENABLE20MODE")==0) || (strcmp(token, "ENABLESTEREOMODE")==0) || (strcmp(token, "STEREO")==0) ) {
850 } else
851 if (strcmp(token, "ENABLESPDIFO")==0) {
853 } else
854 if (strcmp(token, "DISABLESPDIFO")==0) {
856 } else
857 if (strcmp(token, "ENABLESPDIFI")==0) {
859 } else
860 if (strcmp(token, "DISABLESPDIFI")==0) {
862 } else
863 if ((strcmp(token, "ENABLELOOPTHRU")==0) || (strcmp(token, "ENABLELOOPTHROUGH")==0) || (strcmp(token, "ENABLELOOP")==0) ) {
865 } else
866 if ((strcmp(token, "DISABLELOOPTHRU")==0) || (strcmp(token, "DISABLELOOPTHROUGH")==0) || (strcmp(token, "DISABLELOOP")==0) ) {
868 } else
869 if (strcmp(token, "UNINSTALL")==0) {
871 }
872 return FALSE;
873}
874
875int parseArguments(LPSTR szCmdLine) {
876 BOOL inToken = false, result;
877 int i = 0, j=0;
878 char token[MAX_TOKEN_SIZE];
879
880 if (openDevice(FALSE)) {
883 }
884
885 while (szCmdLine[i]) {
886 if (inToken) {
887 if (szCmdLine[i] == ' ') {
888 inToken = false;
889 token[j] = 0;
890 if (checkToken(token)) {
891 return TRUE;
892 }
893 } else {
894 token[j] = (char)toupper(szCmdLine[i]);
895 if (j < MAX_TOKEN_SIZE-1) {
896 j++;
897 }
898 }
899 } else {
900 if ((szCmdLine[i] == '-') || (szCmdLine[i] == '/')) {
901 j = 0;
902 inToken = true;
903 }
904 }
905
906 i++;
907 }
908 token[j] = 0;
910
912 if (currentChannelCount != -1)
914 return result;
915}
916
918{
919 WNDCLASSEX wce;
920
921 ZeroMemory(&wce, sizeof(wce));
922 wce.cbSize = sizeof(WNDCLASSEX);
923 if (GetClassInfoEx(hInst, "Static", &wce)==0) {
924 PrintLastError("GetClassInfoEx()");
925 return;
926 }
927
929 wce.hInstance = hInst;
930 wce.lpszClassName = "URLLink";
931 if (RegisterClassEx(&wce) == 0) {
932 PrintLastError("RegisterClassEx()");
933 }
934
935}
936
937int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
938{
939 WNDCLASSEX wce;
940 MSG msg;
941
942 ZeroMemory(&cmiData, sizeof(CMIDATA));
944 hWave = NULL;
945
946 if (szCmdLine && szCmdLine[0] != 0) {
947 int result = parseArguments(szCmdLine);
948 cleanUp();
949 return result;
950 }
951
952 if ((hWndMain = FindWindow("cmiControlPanel", NULL))) {
954 return FALSE;
955 }
956
960
961 ZeroMemory(&wce, sizeof(WNDCLASSEX));
962 wce.cbSize = sizeof(WNDCLASSEX);
964 wce.style = 0;
966 wce.hInstance = hInstance;
968 wce.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
969 wce.lpszClassName = "cmiControlPanel";
970 wce.lpszMenuName = NULL;
973 if(!RegisterClassEx(&wce)) {
974 PrintLastError("RegisterClassEx()");
975 return -1;
976 }
978
980 if (!hWndMain) {
981 PrintLastError("CreateDialogParam()");
982 return -1;
983 }
984
985 while (GetMessage(&msg, (HWND) NULL, 0, 0)) {
988 }
989 return 0;
990}
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int toupper(int c)
Definition: utclib.c:881
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define IDC_TAB
Definition: resource.h:12
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define IDC_VERSION
Definition: resource.h:290
#define IDD_MAIN
Definition: resource.h:106
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define DLGPROC
Definition: maze.c:62
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
Definition: directsound.c:504
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1787
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:2780
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
#define IDI_APP_ICON
Definition: resource.h:4
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned char
Definition: typeof.h:29
BOOL getDeviceInfo(const GUID *category, CMIDEV *pDev)
Definition: main.cpp:319
LRESULT CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.cpp:756
int parseArguments(LPSTR szCmdLine)
Definition: main.cpp:875
void updateChannelBoxes(HWND hWnd)
Definition: main.cpp:506
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.cpp:717
BOOL stopTestTone(void)
Definition: main.cpp:103
BOOL playTestTone()
Definition: main.cpp:139
void performUninstall()
Definition: main.cpp:827
BOOL initDialog(HWND hWnd)
Definition: main.cpp:670
BOOL setDriverData(CMIDEV *pDev)
Definition: main.cpp:446
void deleteDriverFiles()
Definition: main.cpp:805
BOOL setCurrentChannelConfig()
Definition: main.cpp:279
bool checkToken(char *token)
Definition: main.cpp:834
BOOL getCurrentChannelConfig()
Definition: main.cpp:243
BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext)
Definition: main.cpp:214
void InitURLControl()
Definition: main.cpp:917
BOOL getDriverData(CMIDEV *pDev)
Definition: main.cpp:420
BOOL changeTab(LPNMHDR lpnmhdr)
Definition: main.cpp:706
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
Definition: main.cpp:937
BOOL openDevice(bool handleError)
Definition: main.cpp:489
void PrintLastError(LPCSTR function)
Definition: main.cpp:31
BOOL getDeviceInterfaceDetail(const GUID *category, CMIDEV *pDev)
Definition: main.cpp:351
void openURL(int control)
Definition: main.cpp:749
BOOL generateTestSignal(double amplitude, int Channels, int SamplesPerSec, SHORT **buffer)
Definition: main.cpp:41
void cleanUp()
Definition: main.cpp:472
void printUsage()
Definition: main.cpp:787
UINT findWaveDeviceID()
Definition: main.cpp:122
BOOL applySettings()
Definition: main.cpp:633
BOOL setDlgItems(HWND hWnd)
Definition: main.cpp:549
#define MAX_TOKEN_SIZE
Definition: main.h:61
LRESULT currentTab
Definition: main.h:76
CMIDATA cmiData
Definition: main.h:78
#define BASS_FREQUENCY
Definition: main.h:55
#define SPEAKER_AMPLITUDE
Definition: main.h:59
#define SAMPLE_RATE
Definition: main.h:53
int currentChannelCount
Definition: main.h:81
CMIDEV cmiTopologyDev
Definition: main.h:77
#define SPEAKER_FREQUENCY
Definition: main.h:58
HFONT hURLFont
Definition: main.h:82
HWAVEOUT hWave
Definition: main.h:79
HWND hWndTab
Definition: main.h:74
HWND hWndChild[NUM_TABS]
Definition: main.h:75
WAVEHDR pwh
Definition: main.h:80
#define IDB_CLOSE
Definition: resource.h:35
#define IDC_CENTER
Definition: resource.h:50
#define IDC_SUB
Definition: resource.h:55
#define IDB_STARTSTOP
Definition: resource.h:56
#define IDC_LOOP_SPDF
Definition: resource.h:66
#define IDCB_CHANNELCONFIG
Definition: resource.h:47
#define IDC_BRIGHT
Definition: resource.h:54
#define IDC_URL2
Definition: resource.h:91
#define IDC_EN_SPDI
Definition: resource.h:67
#define IDC_BLEFT
Definition: resource.h:53
#define IDC_FMT_960_PCM
Definition: resource.h:74
#define IDC_FMT_480_MULTI_PCM
Definition: resource.h:76
#define IDC_FMT_441_DOLBY
Definition: resource.h:79
#define IDC_FMT_882_PCM
Definition: resource.h:73
#define IDC_CLEFT
Definition: resource.h:49
char * tabsName[]
Definition: resource.h:93
#define IDC_EN_SPDCOPYRHT
Definition: resource.h:61
#define IDC_HWREV
Definition: resource.h:86
#define IDC_EN_CLFE2LINE
Definition: resource.h:43
#define IDC_INV_SPDIFI
Definition: resource.h:64
#define IDC_URL1
Definition: resource.h:90
#define IDC_EN_SPDO
Definition: resource.h:59
#define IDC_MPUADR
Definition: resource.h:89
#define IDC_BASEADR
Definition: resource.h:88
#define IDC_MAXCHAN
Definition: resource.h:87
#define IDC_RIGHT
Definition: resource.h:52
#define IDC_EXCH_FB
Definition: resource.h:41
#define IDC_FMT_960_DOLBY
Definition: resource.h:82
#define IDT_SWAPJACKS
Definition: resource.h:38
#define NUM_TABS
Definition: resource.h:95
#define IDC_CRIGHT
Definition: resource.h:51
#define IDC_LEFT
Definition: resource.h:48
#define IDC_NOROUTE_LINE
Definition: resource.h:44
#define IDC_EN_REAR2LINE
Definition: resource.h:42
#define IDC_NOROUTE_MIC
Definition: resource.h:46
#define IDC_EN_CENTER2MIC
Definition: resource.h:45
#define IDC_SEL_SPDIFI
Definition: resource.h:63
#define IDC_FMT_882_DOLBY
Definition: resource.h:81
#define IDC_EN_SPDO5V
Definition: resource.h:60
#define IDC_EN_SPDIMONITOR
Definition: resource.h:68
#define IDC_FMT_480_DOLBY
Definition: resource.h:80
#define IDC_FMT_480_PCM
Definition: resource.h:72
#define IDC_FMT_960_MULTI_PCM
Definition: resource.h:78
int tabsResource[]
Definition: resource.h:94
#define IDB_APPLY
Definition: resource.h:36
#define IDC_FMT_441_PCM
Definition: resource.h:71
#define IDC_POLVALID
Definition: resource.h:65
#define IDC_FMT_882_MULTI_PCM
Definition: resource.h:77
#define IDC_FMT_441_MULTI_PCM
Definition: resource.h:75
#define DSSPEAKER_STEREO
Definition: dsound.h:308
#define DSSPEAKER_CONFIG(a)
Definition: dsound.h:323
#define DSSPEAKER_7POINT1
Definition: dsound.h:312
#define DSSPEAKER_QUAD
Definition: dsound.h:307
#define DirectSoundEnumerate
Definition: dsound.h:411
#define DSSPEAKER_5POINT1
Definition: dsound.h:310
HINSTANCE hInst
Definition: dxdiag.c:13
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei dataSize
Definition: glext.h:11123
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
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
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 token
Definition: glfuncs.h:210
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 GLint GLint j
Definition: glfuncs.h:250
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define ds
Definition: i386-dis.c:443
#define S_OK
Definition: intsafe.h:52
#define TEXT(s)
Definition: k32.h:26
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
#define WAVE_FORMAT_EXTENSIBLE
Definition: ksmedia.h:651
#define KSCATEGORY_TOPOLOGY
Definition: ksmedia.h:199
const GUID * guid
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WAVE_MAPPER
Definition: mmsystem.h:187
#define WHDR_ENDLOOP
Definition: mmsystem.h:196
#define WHDR_BEGINLOOP
Definition: mmsystem.h:195
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define waveOutGetDevCaps
Definition: mmsystem.h:2843
#define CALLBACK_NULL
Definition: mmsystem.h:147
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
short SHORT
Definition: pedump.c:59
#define FMT_960_MULTI_PCM
Definition: property.h:49
#define FMT_480_PCM
Definition: property.h:43
#define FMT_441_MULTI_PCM
Definition: property.h:46
#define FMT_882_DOLBY
Definition: property.h:52
#define KSPROPSETID_CMI
Definition: property.h:36
#define FMT_480_DOLBY
Definition: property.h:51
#define FMT_441_PCM
Definition: property.h:42
#define FMT_960_DOLBY
Definition: property.h:53
#define FMT_480_MULTI_PCM
Definition: property.h:47
#define KSPROPERTY_CMI_SET
Definition: property.h:40
#define KSPROPERTY_CMI_GET
Definition: property.h:39
#define FMT_882_PCM
Definition: property.h:44
#define FMT_441_DOLBY
Definition: property.h:50
#define FMT_960_PCM
Definition: property.h:45
#define FMT_882_MULTI_PCM
Definition: property.h:48
#define TCM_GETCURSEL
Definition: commctrl.h:4062
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
Definition: commctrl.h:4051
#define TCN_SELCHANGE
Definition: commctrl.h:4132
#define TC_ITEM
Definition: commctrl.h:4007
#define TCIF_TEXT
Definition: commctrl.h:3971
GUID * LPGUID
Definition: guiddef.h:81
#define WM_NOTIFY
Definition: richedit.h:61
#define DefDlgProc
Definition: ros2win.h:34
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_ENGLISH
Definition: nls.h:52
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define SUBLANG_ENGLISH_US
Definition: nls.h:222
SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_DEVICE_INTERFACE_DETAIL_DATA
Definition: setupapi.h:1149
#define SetupDiGetDeviceInterfaceDetail
Definition: setupapi.h:2601
#define SetupDiGetDeviceInstanceId
Definition: setupapi.h:2600
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2603
#define DIGCF_DEVICEINTERFACE
Definition: setupapi.h:174
#define SetupDiGetClassDevs
Definition: setupapi.h:2593
#define DIGCF_PRESENT
Definition: setupapi.h:171
SP_DEVICE_INTERFACE_DETAIL_DATA_A * PSP_DEVICE_INTERFACE_DETAIL_DATA
Definition: setupapi.h:1150
#define SPDRP_SERVICE
Definition: setupapi.h:511
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define ShellExecute
Definition: shellapi.h:690
UInt32 enableBass2Line
Definition: property.h:71
int hardwareRevision
Definition: property.h:65
UInt32 loopSPDI
Definition: property.h:81
UInt32 enableSPDO5V
Definition: property.h:76
UInt32 enableCenter2Line
Definition: property.h:72
UInt32 enableSPDIMonitor
Definition: property.h:69
UInt32 enableRear2Line
Definition: property.h:73
UInt32 enableCenter2Mic
Definition: property.h:74
UInt16 IOBase
Definition: property.h:66
UInt32 select2ndSPDI
Definition: property.h:78
UInt32 invertPhaseSPDI
Definition: property.h:79
char driverVersion[32]
Definition: property.h:64
UInt32 formatMask
Definition: property.h:82
UInt32 enableSPDI
Definition: property.h:83
UInt32 enableSPDOCopyright
Definition: property.h:77
UInt32 exchangeFrontBack
Definition: property.h:70
UInt16 MPUBase
Definition: property.h:67
UInt32 invertValidBitSPDI
Definition: property.h:80
UInt32 enableSPDO
Definition: property.h:75
UInt32 maxChannels
Definition: property.h:68
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
WAVEFORMATEX Format
Definition: ksmedia.h:638
WORD wValidBitsPerSample
Definition: ksmedia.h:641
union WAVEFORMATEXTENSIBLE::@3004 Samples
DWORD nAvgBytesPerSec
Definition: audioclient.idl:43
WORD wBitsPerSample
Definition: audioclient.idl:45
DWORD nSamplesPerSec
Definition: audioclient.idl:42
Definition: main.h:63
SP_DEVINFO_DATA InfoData
Definition: main.h:65
PSP_DEVICE_INTERFACE_DETAIL_DATA InterfaceDetailData
Definition: main.h:66
HDEVINFO Info
Definition: main.h:64
CHAR DevicePath[ANYSIZE_ARRAY]
Definition: setupapi.h:851
HINSTANCE hInstance
Definition: winuser.h:3196
HCURSOR hCursor
Definition: winuser.h:3198
LPCSTR lpszMenuName
Definition: winuser.h:3200
HICON hIconSm
Definition: winuser.h:3202
UINT style
Definition: winuser.h:3192
int cbWndExtra
Definition: winuser.h:3195
UINT cbSize
Definition: winuser.h:3191
WNDPROC lpfnWndProc
Definition: winuser.h:3193
LPCSTR lpszClassName
Definition: winuser.h:3201
HICON hIcon
Definition: winuser.h:3197
HBRUSH hbrBackground
Definition: winuser.h:3199
UINT code
Definition: winuser.h:3149
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1028
DWORD dwBufferLength
Definition: mmsystem.h:1015
DWORD dwLoops
Definition: mmsystem.h:1019
DWORD dwFlags
Definition: mmsystem.h:1018
LPSTR lpData
Definition: mmsystem.h:1014
#define ICON_BIG
Definition: tnclass.cpp:51
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
char * PSTR
Definition: typedefs.h:51
Definition: pdh_main.c:94
HWND hWndMain
Definition: welcome.c:60
#define FormatMessage
Definition: winbase.h:3666
#define ZeroMemory
Definition: winbase.h:1670
#define GetSystemDirectory
Definition: winbase.h:3713
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define LPTR
Definition: winbase.h:381
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
#define DeleteFile
Definition: winbase.h:3635
#define MoveFileEx
Definition: winbase.h:3749
#define MOVEFILE_DELAY_UNTIL_REBOOT
Definition: winbase.h:400
#define CreateFile
Definition: winbase.h:3620
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define VARIABLE_PITCH
Definition: wingdi.h:445
#define TRANSPARENT
Definition: wingdi.h:950
#define CreateFont
Definition: wingdi.h:4443
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define FF_SWISS
Definition: wingdi.h:452
UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
Definition: winmm.c:2388
UINT WINAPI waveOutGetNumDevs(void)
Definition: winmm.c:2140
UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
Definition: winmm.c:2344
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Definition: winmm.c:2249
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
Definition: winmm.c:2280
UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
Definition: winmm.c:2260
#define NORM_IGNORECASE
Definition: winnls.h:176
#define CSTR_EQUAL
Definition: winnls.h:456
#define CompareString
Definition: winnls.h:1174
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegDeleteKey
Definition: winreg.h:502
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define DLGWINDOWEXTRA
Definition: winuser.h:2555
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define SW_HIDE
Definition: winuser.h:762
#define WM_CLOSE
Definition: winuser.h:1611
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:912
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define BST_UNCHECKED
Definition: winuser.h:199
#define FindWindow
Definition: winuser.h:5767
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1730
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define IDC_ARROW
Definition: winuser.h:682
#define CB_SETCURSEL
Definition: winuser.h:1951
#define CreateDialogParam
Definition: winuser.h:5742
#define CB_RESETCONTENT
Definition: winuser.h:1949
#define WM_INITDIALOG
Definition: winuser.h:1729
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BM_SETCHECK
Definition: winuser.h:1911
#define SW_SHOWDEFAULT
Definition: winuser.h:774
#define GetMessage
Definition: winuser.h:5780
#define RegisterClassEx
Definition: winuser.h:5827
#define WM_SETFONT
Definition: winuser.h:1640
#define CB_ADDSTRING
Definition: winuser.h:1926
#define GetClassInfoEx
Definition: winuser.h:5770
#define LoadIcon
Definition: winuser.h:5803
#define SendMessage
Definition: winuser.h:5833
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LoadCursor
Definition: winuser.h:5802
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5709
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define MB_OK
Definition: winuser.h:784
#define wsprintf
Definition: winuser.h:5855
#define GetWindowText
Definition: winuser.h:5788
#define MessageBox
Definition: winuser.h:5812
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define IDC_HAND
Definition: winuser.h:693
#define SW_SHOW
Definition: winuser.h:769
#define WM_DESTROY
Definition: winuser.h:1599
#define SetWindowText
Definition: winuser.h:5847
#define DispatchMessage
Definition: winuser.h:5755
#define CB_GETCURSEL
Definition: winuser.h:1933
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define SetDlgItemText
Definition: winuser.h:5839
#define BST_CHECKED
Definition: winuser.h:197
#define COLOR_BTNFACE
Definition: winuser.h:922
#define BM_GETCHECK
Definition: winuser.h:1908
char TCHAR
Definition: xmlstorage.h:189
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
CHAR * PTSTR
Definition: xmlstorage.h:191
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192