ReactOS  0.4.15-dev-1207-g698a8e6
mintopo.cpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2006-2008 dogbert <dogber1@gmail.com>
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8 1. Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10 2. 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.
13 3. 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 
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #include "limits.h"
29 #include "mintopo.hpp"
30 #include "mintopotables.hpp"
31 #define NTSTRSAFE_LIB //for Windows 2000 compatibility
32 #include "ntstrsafe.h"
33 
34 #ifdef _MSC_VER
35 #pragma code_seg("PAGE")
36 #endif
37 
39 {
40  PAGED_CODE();
41  ASSERT(Unknown);
42  STD_CREATE_BODY_(CCMITopology,Unknown,UnknownOuter,PoolType,PMINIPORTTOPOLOGY);
43 }
44 
45 STDMETHODIMP CCMITopology::NonDelegatingQueryInterface(REFIID Interface, PVOID* Object)
46 {
47  PAGED_CODE();
48  ASSERT(Object);
49  DBGPRINT(("CCMITopology::NonDelegatingQueryInterface"));
50 
53  } else if (IsEqualGUIDAligned(Interface,IID_IMiniport)) {
54  *Object = PVOID(PMINIPORT(this));
55  } else if (IsEqualGUIDAligned(Interface,IID_IMiniportTopology)) {
56  *Object = PVOID(PMINIPORTTOPOLOGY(this));
57  } else if (IsEqualGUIDAligned (Interface, IID_ICMITopolgy)) {
58  *Object = (PVOID)(PMINIPORTTOPOLOGY)this;
59  } else {
60  *Object = NULL;
61  }
62 
63  if (*Object) {
64  PUNKNOWN(*Object)->AddRef();
65  return STATUS_SUCCESS;
66  }
67 
69 }
70 
72 {
73  PAGED_CODE();
74 
75  DBGPRINT(("CCMITopology::~CCMITopology"));
76 
77  storeMixerSettingsToRegistry(); //or not. during system shutdown, this doesn't seem to work.
78  cm->TopoMiniport = NULL;
79 
80  if (CMIAdapter) {
81  CMIAdapter->Release();
82  }
83 }
84 
86 {
87  PAGED_CODE();
88  ASSERT(UnknownAdapter);
89  ASSERT(Port);
90  DBGPRINT(("CCMITopology::Init"));
91 
92  NTSTATUS ntStatus = UnknownAdapter->QueryInterface(IID_ICMIAdapter, (PVOID *)&CMIAdapter);
93 
94  if (!NT_SUCCESS(ntStatus)) {
95  DBGPRINT(("UnknownAdapter->QueryInterface() failed"));
97  }
98 
99  CMIAdapter->resetMixer();
102  functrl1Register = 0;
103  chformatRegister = 0;
104  legacyRegister = 0;
105  miscctrlRegister = 0;
106 
107  cm = CMIAdapter->getCMI8738Info();
108  cm->TopoMiniport = this; //this is not really nice
109  loadMixerSettingsFromRegistry();
110 
111  return STATUS_SUCCESS;
112 }
113 
114 STDMETHODIMP CCMITopology::GetDescription(PPCFILTER_DESCRIPTOR* OutFilterDescriptor)
115 {
116  PAGED_CODE();
117  ASSERT(OutFilterDescriptor);
118  DBGPRINT(("CCMITopology::GetDescription"));
119 
120  *OutFilterDescriptor = &MiniportFilterDescriptor;
121 
122  return STATUS_SUCCESS;
123 }
124 
125 STDMETHODIMP CCMITopology::loadMixerSettingsFromRegistry()
126 {
127  PAGED_CODE();
128  DBGPRINT(("CCMITopology::loadMixerSettingsFromRegistry"));
129 
130  PREGISTRYKEY DriverKey;
131  PREGISTRYKEY SettingsKey;
133  PCPROPERTY_REQUEST PropertyRequest;
135  DWORD Channel;
136  PVOID KeyInfo;
138  WCHAR buffer[128];
139 
140  if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
141  DBGPRINT(("CMIAdapter->getDeviceObject() failed"));
142  return STATUS_UNSUCCESSFUL;
143  }
144 
146 
147  NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
148 
149  if(!NT_SUCCESS(ntStatus)) {
150  DBGPRINT(("PcNewRegistryKey() failed"));
151  return STATUS_UNSUCCESSFUL;
152  }
153 
154  RtlInitUnicodeString(&KeyName, L"Settings");
155 
156  ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
157  if(!NT_SUCCESS(ntStatus)) {
158  DBGPRINT(("DriverKey->NewSubKey() failed"));
159  return STATUS_UNSUCCESSFUL;
160  }
161 
162  KeyInfo = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), 'dbrt');
163  if(KeyInfo == NULL) {
164  DBGPRINT(("ExAllocatePoolWithTag() failed"));
165  return STATUS_UNSUCCESSFUL;
166  }
167 
168  PropertyRequest.MajorTarget = this;
169  PropertyRequest.Verb = KSPROPERTY_TYPE_SET;
170  PropertyRequest.Instance = &Channel;
171  PropertyRequest.InstanceSize = sizeof(DWORD);
172  PropertyRequest.Value = &(PKEY_VALUE_PARTIAL_INFORMATION(KeyInfo)->Data);
173  PropertyRequest.ValueSize = sizeof(DWORD);
174  PropertyRequest.PropertyItem = &PropertyItem;
175 
176  for (unsigned int i=0;i < SIZEOF_ARRAY(TopologyNodes); i++) {
177  PropertyRequest.Node = i;
178 
179  Channel = CHAN_LEFT;
180  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dLeft", i);
181  if (!NT_SUCCESS(ntStatus)) {
182  DBGPRINT(("RtlStringCbPrintfW() failed"));
183  }
185  ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
186  if (NT_SUCCESS(ntStatus)) {
187  if(PKEY_VALUE_PARTIAL_INFORMATION(KeyInfo)->DataLength == sizeof(DWORD)) {
190  PropertyHandler_Level(&PropertyRequest);
191  }
194  PropertyHandler_OnOff(&PropertyRequest);
195  }
198  PropertyHandler_OnOff(&PropertyRequest);
199  }
200  }
201  } else {
202  // default values
203  if (i == KSNODE_TOPO_IEC_OUT) {
205  *(PBOOL(PropertyRequest.Value)) = true;
206  PropertyHandler_OnOff(&PropertyRequest);
207  }
210  *(PBOOL(PropertyRequest.Value)) = true;
211  PropertyHandler_OnOff(&PropertyRequest);
212  }
213  if (i == KSNODE_TOPO_CENTER2MIC) {
215  *(PBOOL(PropertyRequest.Value)) = false;
216  PropertyHandler_OnOff(&PropertyRequest);
217  }
218  if (i == KSNODE_TOPO_IEC_MONITOR) {
220  *(PBOOL(PropertyRequest.Value)) = true;
221  PropertyHandler_OnOff(&PropertyRequest);
222  }
223  }
224 
225  Channel = CHAN_RIGHT;
226  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dRight", i);
227  if (!NT_SUCCESS(ntStatus)) {
228  DBGPRINT(("RtlStringCbPrintfW() failed"));
229  }
231  ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
232  if (NT_SUCCESS(ntStatus)) {
233  if(PKEY_VALUE_PARTIAL_INFORMATION(KeyInfo)->DataLength == sizeof(DWORD)) {
236  PropertyHandler_Level(&PropertyRequest);
237  }
240  PropertyHandler_OnOff(&PropertyRequest);
241  }
244  PropertyHandler_OnOff(&PropertyRequest);
245  }
246  }
247  } else {
248  if (i == KSNODE_TOPO_IEC_OUT) {
250  *(PBOOL(PropertyRequest.Value)) = true;
251  PropertyHandler_OnOff(&PropertyRequest);
252  }
255  *(PBOOL(PropertyRequest.Value)) = true;
256  PropertyHandler_OnOff(&PropertyRequest);
257  }
258  }
259 
260  }
261  RtlInitUnicodeString(&KeyName, L"FormatMask");
262  ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
263  if (NT_SUCCESS (ntStatus)) {
265  if (PartialInfo->DataLength == sizeof(DWORD)) {
266  cm->formatMask = (*(PLONG)PartialInfo->Data);
267  }
268  } else {
270  if (cm->chipVersion >= 68) {
272  }
273  }
274 
275  ExFreePoolWithTag (KeyInfo,'dbrt');
276 
277  SettingsKey->Release();
278  DriverKey->Release();
279 
281 
282  return STATUS_SUCCESS;
283 }
284 
285 STDMETHODIMP CCMITopology::storeMixerSettingsToRegistry()
286 {
287  PAGED_CODE();
288  DBGPRINT(("CCMITopology::storeMixerSettingsToRegistry"));
289 
290  PREGISTRYKEY DriverKey;
291  PREGISTRYKEY SettingsKey;
293  PCPROPERTY_REQUEST PropertyRequest;
295  DWORD Value,Channel;
296  WCHAR buffer[128];
297 
298  if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
299  return STATUS_UNSUCCESSFUL;
300  }
301 
302  NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
303 
304  if(!NT_SUCCESS(ntStatus)) {
305  DBGPRINT(("PcNewRegistryKey() failed"));
306  return STATUS_UNSUCCESSFUL;
307  }
308 
309  RtlInitUnicodeString(&KeyName, L"Settings");
310 
311  ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
312 
313  if(!NT_SUCCESS(ntStatus)) {
314  DBGPRINT(("DriverKey->NewSubKey() failed"));
315  return STATUS_UNSUCCESSFUL;
316  }
317 
318  PropertyRequest.MajorTarget = this;
319  PropertyRequest.Verb = KSPROPERTY_TYPE_GET;
320  PropertyRequest.Instance = &Channel;
321  PropertyRequest.InstanceSize = sizeof(DWORD);
322  PropertyRequest.Value = &Value;
323  PropertyRequest.ValueSize = sizeof(DWORD);
324  PropertyRequest.PropertyItem = &PropertyItem;
325 
326  for (unsigned int i=0;i < SIZEOF_ARRAY(TopologyNodes); i++) {
327  PropertyRequest.Node = i;
329  PropertyRequest.Node = i;
331 
332  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dLeft", i);
333  if (!NT_SUCCESS(ntStatus)) {
334  DBGPRINT(("RtlStringCbPrintfW() failed"));
335  }
337  Channel = CHAN_LEFT;
338  ntStatus = PropertyHandler_Level(&PropertyRequest);
339  if (NT_SUCCESS(ntStatus)) {
340  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
341  if(!NT_SUCCESS(ntStatus)) {
342  DBGPRINT(("SetValueKey() failed"));
343  break;
344  }
345  }
346 
347  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dRight", i);
348  if (!NT_SUCCESS(ntStatus)) {
349  DBGPRINT(("RtlStringCbPrintfW() failed"));
350  }
352  Channel = CHAN_RIGHT;
353  ntStatus = PropertyHandler_Level(&PropertyRequest);
354  if (NT_SUCCESS(ntStatus)) {
355  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
356  if(!NT_SUCCESS(ntStatus)) {
357  DBGPRINT(("SetValueKey() failed"));
358  break;
359  }
360  }
361 
362  }
365  PropertyHandler_OnOff(&PropertyRequest);
366 
367  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dLeft", i);
368  if (!NT_SUCCESS(ntStatus)) {
369  DBGPRINT(("RtlStringCbPrintfW() failed"));
370  }
372  Channel = CHAN_LEFT;
373  ntStatus = PropertyHandler_OnOff(&PropertyRequest);
374  if (NT_SUCCESS(ntStatus)) {
375  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
376  if(!NT_SUCCESS(ntStatus)) {
377  DBGPRINT(("SetValueKey() failed"));
378  break;
379  }
380  }
381 
382  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dRight", i);
383  if (!NT_SUCCESS(ntStatus)) {
384  DBGPRINT(("RtlStringCbPrintfW() failed"));
385  }
387  Channel = CHAN_RIGHT;
388  ntStatus = PropertyHandler_OnOff(&PropertyRequest);
389  if (NT_SUCCESS(ntStatus)) {
390  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
391  if(!NT_SUCCESS(ntStatus)) {
392  DBGPRINT(("SetValueKey() failed"));
393  break;
394  }
395  }
396  }
399  PropertyHandler_OnOff(&PropertyRequest);
400 
401  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dLeft", i);
402  if (!NT_SUCCESS(ntStatus)) {
403  DBGPRINT(("RtlStringCbPrintfW() failed"));
404  }
406  Channel = CHAN_LEFT;
407  ntStatus = PropertyHandler_OnOff(&PropertyRequest);
408  if (NT_SUCCESS(ntStatus)) {
409  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
410  if(!NT_SUCCESS(ntStatus)) {
411  DBGPRINT(("SetValueKey() failed"));
412  break;
413  }
414  }
415 
416  ntStatus = RtlStringCbPrintfW(buffer, sizeof(buffer), L"Node%dRight", i);
417  if (!NT_SUCCESS(ntStatus)) {
418  DBGPRINT(("RtlStringCbPrintfW() failed"));
419  }
421  Channel = CHAN_RIGHT;
422  ntStatus = PropertyHandler_OnOff(&PropertyRequest);
423  if (NT_SUCCESS(ntStatus)) {
424  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
425  if(!NT_SUCCESS(ntStatus)) {
426  DBGPRINT(("SetValueKey() failed"));
427  break;
428  }
429  }
430  }
431  }
432  Value = cm->formatMask;
433  RtlInitUnicodeString(&KeyName, L"FormatMask");
434  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
435  if (!NT_SUCCESS(ntStatus)) {
436  DBGPRINT(("SetValueKey() failed"));
437  }
438 
439  SettingsKey->Release();
440  DriverKey->Release();
441 
442  return STATUS_SUCCESS;
443 }
444 
445 STDMETHODIMP CCMITopology::loadMixerSettingsFromMemory()
446 {
447  PAGED_CODE();
448  DBGPRINT(("CCMITopology::loadMixerSettingsFromMemory"));
449 
450  CMIAdapter->resetMixer();
451  CMIAdapter->loadSBMixerFromMemory();
452  CMIAdapter->writeUInt8(REG_MIXER1, mixer1Register);
455  CMIAdapter->writeUInt8(REG_MIXER4, mixer4Register);
456 
457  CMIAdapter->setUInt32Bit(REG_FUNCTRL1, functrl1Register);
458  CMIAdapter->setUInt32Bit(REG_CHFORMAT, chformatRegister);
459  CMIAdapter->setUInt32Bit(REG_LEGACY, legacyRegister);
460  CMIAdapter->setUInt32Bit(REG_MISCCTRL, miscctrlRegister);
461 
462  return STATUS_SUCCESS;
463 }
464 
465 STDMETHODIMP CCMITopology::storeMixerSettingsToMemory()
466 {
467  PAGED_CODE();
468  DBGPRINT(("CCMITopology::storeMixerSettingsToMemory"));
469 
470  mixer1Register = CMIAdapter->readUInt8(REG_MIXER1);
471  mixer4Register = CMIAdapter->readUInt8(REG_MIXER4);
476 
477  return STATUS_SUCCESS;
478 }
479 
481 {
482  PAGED_CODE();
483  ASSERT(PropertyRequest);
484  DBGPRINT(("[PropertyHandler_OnOff]"));
485 
486  CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
487 
489  UInt8 mask, reg;
490  LONG channel;
491 
492  if (PropertyRequest->Node == ULONG(-1)) {
493  return ntStatus;
494  }
495 
496  if ( ((PropertyRequest->Verb & KSPROPERTY_TYPE_GET) || (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)) && (PropertyRequest->InstanceSize >= sizeof(LONG)) ) {
497  channel = *(PLONG(PropertyRequest->Instance));
498  if (PropertyRequest->ValueSize >= sizeof(BOOL)) {
499 
500  if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_MUTE) {
501  PBOOL Muted = PBOOL(PropertyRequest->Value);
502  switch (PropertyRequest->Node) {
503 
505  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
506  *Muted = (that->CMIAdapter->readUInt8(REG_MIXER1) & MUTE_WAVE);
507  }
508  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
509  if (*Muted) {
510  that->CMIAdapter->setUInt8Bit(REG_MIXER1, MUTE_WAVE);
511  } else {
512  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, MUTE_WAVE);
513  }
514  }
515  ntStatus = STATUS_SUCCESS;
516  break;
517 
519  switch (channel) {
520  case CHAN_LEFT: mask = MUTE_AUX_L; break;
521  case CHAN_RIGHT: mask = MUTE_AUX_R; break;
522  default: return ntStatus;
523  }
524 
525  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
526  *Muted = !(that->micVolumeRegister & mask);
527  }
528  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
529  if (*Muted) {
530  that->micVolumeRegister &= ~mask;
531  } else {
532  that->micVolumeRegister |= mask;
533  }
534  that->CMIAdapter->writeUInt8(REG_MIXER2, that->micVolumeRegister);
535  }
536  ntStatus = STATUS_SUCCESS;
537  break;
538 
540  if (channel != CHAN_LEFT) {
541  return ntStatus;
542  }
543 
544  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
545  *Muted = !(that->CMIAdapter->readMixer(SBREG_OUTPUTCTRL) & EN_MIC);
546  }
547  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
548  if (*Muted) {
549  that->CMIAdapter->clearMixerBit(SBREG_OUTPUTCTRL, EN_MIC);
550  } else {
551  that->CMIAdapter->setMixerBit(SBREG_OUTPUTCTRL, EN_MIC);
552  }
553  }
554  ntStatus = STATUS_SUCCESS;
555  break;
556 
557  case KSNODE_TOPO_CD_MUTE:
558  switch (channel) {
559  case CHAN_LEFT: mask = EN_CD_L; break;
560  case CHAN_RIGHT: mask = EN_CD_R; break;
561  default: return ntStatus;
562  }
563  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
564  *Muted = !(that->CMIAdapter->readMixer(SBREG_OUTPUTCTRL) & mask);
565  }
566  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
567  if (*Muted) {
568  that->CMIAdapter->clearMixerBit(SBREG_OUTPUTCTRL, mask);
569  } else {
570  that->CMIAdapter->setMixerBit(SBREG_OUTPUTCTRL, mask);
571  }
572  }
573  ntStatus = STATUS_SUCCESS;
574  break;
575 
577  switch (channel) {
578  case CHAN_LEFT: mask = EN_LINEIN_L; break;
579  case CHAN_RIGHT: mask = EN_LINEIN_R; break;
580  default: return ntStatus;
581  }
582  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
583  *Muted = !(that->CMIAdapter->readMixer(SBREG_OUTPUTCTRL) & mask);
584  }
585  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
586  if (*Muted) {
587  that->CMIAdapter->clearMixerBit(SBREG_OUTPUTCTRL, mask);
588  } else {
589  that->CMIAdapter->setMixerBit(SBREG_OUTPUTCTRL, mask);
590  }
591  }
592  ntStatus = STATUS_SUCCESS;
593  break;
594 
596  if (channel != CHAN_LEFT) {
597  return ntStatus;
598  }
599  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
600  *Muted = !(that->CMIAdapter->readMixer(SBREG_IN_CTRL_L) & EN_MIC);
601  }
602  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
603  if (*Muted) {
604  that->CMIAdapter->clearMixerBit(SBREG_IN_CTRL_L, EN_MIC);
605  that->CMIAdapter->clearMixerBit(SBREG_IN_CTRL_R, EN_MIC);
606  } else {
607  that->CMIAdapter->setMixerBit(SBREG_IN_CTRL_L, EN_MIC);
608  that->CMIAdapter->setMixerBit(SBREG_IN_CTRL_R, EN_MIC);
609  }
610  }
611  ntStatus = STATUS_SUCCESS;
612  break;
613 
615  switch (channel) {
616  case CHAN_LEFT: mask = EN_CD_L; reg = SBREG_IN_CTRL_L; break;
617  case CHAN_RIGHT: mask = EN_CD_R; reg = SBREG_IN_CTRL_R; break;
618  default: return ntStatus;
619  }
620  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
621  *Muted = !(that->CMIAdapter->readMixer(reg) & mask);
622  }
623  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
624  if (*Muted) {
625  that->CMIAdapter->clearMixerBit(reg, mask);
626  } else {
627  that->CMIAdapter->setMixerBit(reg, mask);
628  }
629  }
630  ntStatus = STATUS_SUCCESS;
631  break;
632 
634  switch (channel) {
635  case CHAN_LEFT: mask = EN_LINEIN_L; reg = SBREG_IN_CTRL_L; break;
636  case CHAN_RIGHT: mask = EN_LINEIN_R; reg = SBREG_IN_CTRL_R; break;
637  default: return ntStatus;
638  }
639  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
640  *Muted = !(that->CMIAdapter->readMixer(reg) & mask);
641  }
642  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
643  if (*Muted) {
644  that->CMIAdapter->clearMixerBit(reg, mask);
645  } else {
646  that->CMIAdapter->setMixerBit(reg, mask);
647  }
648  }
649  ntStatus = STATUS_SUCCESS;
650  break;
651 
652 
654  switch (channel) {
655  case CHAN_LEFT: mask = MUTE_RAUX_L; break;
656  case CHAN_RIGHT: mask = MUTE_RAUX_R; break;
657  default: return ntStatus;
658  }
659  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
660  *Muted = !(that->micVolumeRegister & mask) ;
661  }
662  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
663  if (*Muted) {
664  that->micVolumeRegister &= ~mask;
665  } else {
666  that->micVolumeRegister |= mask;
667  }
668  that->CMIAdapter->writeUInt8(REG_MIXER2, that->micVolumeRegister);
669  }
670  ntStatus = STATUS_SUCCESS;
671  break;
672 
674  switch (channel) {
675  case CHAN_LEFT: mask = EN_WAVEIN_L; break;
676  case CHAN_RIGHT: mask = EN_WAVEIN_R; break;
677  default: return ntStatus;
678  }
679  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
680 // *Muted = !(that->CMIAdapter->readUInt8(REG_MIXER1) & mask);
681  *Muted = !(that->cm->enableSPDIFIn);
682  ntStatus = STATUS_SUCCESS;
683  }
684  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
685  if (*Muted) {
686  that->cm->enableSPDIFIn = FALSE;
687  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, mask);
688  } else {
689  that->cm->enableSPDIFIn = TRUE;
690  that->CMIAdapter->setUInt8Bit(REG_MIXER1, mask);
691  }
692  ntStatus = STATUS_SUCCESS;
693  }
694  break;
695 
697  channel = (1 << channel);
698  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
699  *Muted = that->masterMuteDummy & channel;
700  }
701  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
702  if (*Muted) {
703  that->masterMuteDummy |= channel;
704  } else {
705  that->masterMuteDummy &= ~channel;
706  }
707  }
708  ntStatus = STATUS_SUCCESS;
709  break;
710  }
711  }
712 
713  if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_LOUDNESS) {
714  PBOOL LoudnessOn = PBOOL(PropertyRequest->Value);
715  switch (PropertyRequest->Node) {
717  if (channel == CHAN_LEFT) {
718  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
719  *LoudnessOn = (that->CMIAdapter->readMixer(SBREG_EXTENSION) & EN_MICBOOST);
720  }
721  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
722  if (*LoudnessOn) {
723  that->CMIAdapter->setMixerBit(SBREG_EXTENSION, EN_MICBOOST);
724  } else {
725  that->CMIAdapter->clearMixerBit(SBREG_EXTENSION, EN_MICBOOST);
726  }
727  }
728  ntStatus = STATUS_SUCCESS;
729  }
730  break;
732  if (channel == CHAN_LEFT) {
733  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
734  *LoudnessOn = !(that->CMIAdapter->readUInt8(REG_MIXER2) & DIS_MICGAIN);
735  }
736  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
737  if (*LoudnessOn) {
738  that->CMIAdapter->clearUInt8Bit(REG_MIXER2, DIS_MICGAIN);
739  } else {
740  that->CMIAdapter->setUInt8Bit(REG_MIXER2, DIS_MICGAIN);
741  }
742  }
743  ntStatus = STATUS_SUCCESS;
744  }
745  break;
746  case KSNODE_TOPO_IEC_5V:
747  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
748  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_MISCCTRL) & EN_SPDO5V);
749  }
750  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
751  if (*LoudnessOn) {
752  that->CMIAdapter->setUInt32Bit(REG_MISCCTRL, EN_SPDO5V);
753  } else {
754  that->CMIAdapter->clearUInt32Bit(REG_MISCCTRL, EN_SPDO5V);
755  }
756  }
757  ntStatus = STATUS_SUCCESS;
758  break;
759  case KSNODE_TOPO_IEC_OUT:
760  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
761  if (that->cm) {
762  *LoudnessOn = that->cm->enableSPDIFOut;
763  }
764  }
765  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
766  if (that->cm) {
767  that->cm->enableSPDIFOut = (*LoudnessOn);
768  }
769  }
770  ntStatus = STATUS_SUCCESS;
771  break;
772 
774  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
775  if (that->cm->chipVersion <= 37) {
776  *LoudnessOn = (that->CMIAdapter->readUInt8(REG_MIXER4) & INV_SPDIFI1);
777  } else {
778  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & INV_SPDIFI2);
779  }
780  }
781  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
782  if (*LoudnessOn) {
783  if (that->cm->chipVersion <= 37) {
784  that->CMIAdapter->setUInt8Bit(REG_MIXER4, INV_SPDIFI1);
785  } else {
786  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, INV_SPDIFI2);
787  }
788  } else {
789  if (that->cm->chipVersion <= 37) {
790  that->CMIAdapter->clearUInt8Bit(REG_MIXER4, INV_SPDIFI1);
791  } else {
792  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, INV_SPDIFI2);
793  }
794  }
795  }
796  ntStatus = STATUS_SUCCESS;
797  break;
798 
800  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
801  *LoudnessOn = (that->CMIAdapter->readUInt8(REG_MIXER1) & EN_SPDI2DAC);
802  }
803  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
804  if (*LoudnessOn) {
805  that->CMIAdapter->setUInt8Bit(REG_MIXER1, EN_SPDI2DAC);
806  } else {
807  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, EN_SPDI2DAC);
808  }
809  if (that->cm) {
810  that->cm->enableSPDIFInMonitor = *LoudnessOn;
811  }
812  }
813  ntStatus = STATUS_SUCCESS;
814  break;
815 
817  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
818  if (that->cm->chipVersion <= 37) {
819  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & SEL_SPDIFI1);
820  } else {
821  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_MISCCTRL) & SEL_SPDIFI2);
822  }
823  }
824  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
825  if (*LoudnessOn) {
826  if (that->cm->chipVersion <= 37) {
827  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, SEL_SPDIFI1);
828  } else {
829  that->CMIAdapter->setUInt32Bit(REG_MISCCTRL, SEL_SPDIFI2);
830  }
831  } else {
832  if (that->cm->chipVersion <= 37) {
833  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, SEL_SPDIFI1);
834  } else {
835  that->CMIAdapter->clearUInt32Bit(REG_MISCCTRL, SEL_SPDIFI2);
836  }
837  }
838  }
839  ntStatus = STATUS_SUCCESS;
840  break;
841 
842  case KSNODE_TOPO_XCHG_FB:
843  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
844  *LoudnessOn = (that->CMIAdapter->readUInt8(REG_MIXER1) & REAR2FRONT);
845  }
846  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
847  if (*LoudnessOn) {
848  that->CMIAdapter->setUInt8Bit(REG_MIXER1, REAR2FRONT);
849  } else {
850  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, REAR2FRONT);
851  }
852  }
853  ntStatus = STATUS_SUCCESS;
854  break;
855 
857  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
858  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_LEGACY) & BASS2LINE);
859  }
860  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
861  if (*LoudnessOn) {
862  that->CMIAdapter->setUInt32Bit(REG_LEGACY, BASS2LINE);
863  } else {
864  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, BASS2LINE);
865  }
866  }
867  ntStatus = STATUS_SUCCESS;
868  break;
869 
871  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
872  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_LEGACY) & CENTER2LINE);
873  }
874  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
875  if (*LoudnessOn) {
876  that->CMIAdapter->setUInt32Bit(REG_LEGACY, CENTER2LINE);
877  } else {
878  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, CENTER2LINE);
879  }
880  }
881  ntStatus = STATUS_SUCCESS;
882  break;
883 
885  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
886  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_LEGACY) & EN_SPDCOPYRHT);
887  }
888  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
889  if (*LoudnessOn) {
890  that->CMIAdapter->setUInt32Bit(REG_LEGACY, EN_SPDCOPYRHT);
891  } else {
892  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, EN_SPDCOPYRHT);
893  }
894  }
895  ntStatus = STATUS_SUCCESS;
896  break;
897 
899  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
900  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & POLVALID);
901  }
902  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
903  if (*LoudnessOn) {
904  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, POLVALID);
905  } else {
906  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, POLVALID);
907  }
908  }
909  ntStatus = STATUS_SUCCESS;
910  break;
911 
913  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
914  *LoudnessOn = (that->CMIAdapter->readUInt32(REG_FUNCTRL1) & LOOP_SPDF);
915  }
916  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
917  if (*LoudnessOn) {
918  that->CMIAdapter->setUInt32Bit(REG_FUNCTRL1, LOOP_SPDF);
919  } else {
920  that->CMIAdapter->clearUInt32Bit(REG_FUNCTRL1, LOOP_SPDF);
921  }
922  }
923  ntStatus = STATUS_SUCCESS;
924  break;
925 
927  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
928  *LoudnessOn = (that->CMIAdapter->readUInt8(REG_MIXER1) & REAR2LINE);
929  }
930  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded)) {
931  if (*LoudnessOn) {
932  that->CMIAdapter->setUInt8Bit(REG_MIXER1, REAR2LINE);
933  } else {
934  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, REAR2LINE);
935  }
936  }
937  ntStatus = STATUS_SUCCESS;
938  break;
939 
941  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
942  *LoudnessOn = (that->CMIAdapter->readUInt8(REG_MIXER4) & CENTER2MIC) && (that->cm->chipVersion > 37);
943  }
944  if ((PropertyRequest->Verb & KSPROPERTY_TYPE_SET) && !(that->settingsLoaded) && (that->cm->chipVersion > 37)) {
945  if (*LoudnessOn) {
946  that->CMIAdapter->setUInt8Bit(REG_MIXER4, CENTER2MIC);
947  } else {
948  that->CMIAdapter->clearUInt8Bit(REG_MIXER4, CENTER2MIC);
949  }
950  }
951  ntStatus = STATUS_SUCCESS;
952  break;
953  }
954  }
955 
956  if ((NT_SUCCESS(ntStatus)) && (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)) {
957  PropertyRequest->ValueSize = sizeof(BOOL);
958  }
959 
960  }
961  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
962  bool supported = false;
963  if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_MUTE) {
964  switch (PropertyRequest->Node) {
965  case KSNODE_TOPO_CD_MUTE:
976  supported = true;
977  }
978  }
979 
980  if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_LOUDNESS) {
981  switch (PropertyRequest->Node) {
984  case KSNODE_TOPO_IEC_5V:
985  case KSNODE_TOPO_IEC_OUT:
989  case KSNODE_TOPO_XCHG_FB:
996  supported = true;
997  }
998  if ((PropertyRequest->Node == KSNODE_TOPO_CENTER2MIC) && (that->cm->chipVersion > 37)) {
999  supported = true;
1000  }
1001  }
1002 
1003  if (supported) {
1004  if (PropertyRequest->ValueSize >= (sizeof(KSPROPERTY_DESCRIPTION))) {
1005  PKSPROPERTY_DESCRIPTION PropDesc = PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
1006 
1008  PropDesc->DescriptionSize = sizeof(KSPROPERTY_DESCRIPTION);
1010  PropDesc->PropTypeSet.Id = VT_BOOL;
1011  PropDesc->PropTypeSet.Flags = 0;
1012  PropDesc->MembersListCount = 0;
1013  PropDesc->Reserved = 0;
1014 
1015  PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION);
1016  ntStatus = STATUS_SUCCESS;
1017  } else if (PropertyRequest->ValueSize >= sizeof(ULONG)) {
1018  PULONG AccessFlags = PULONG(PropertyRequest->Value);
1019 
1021 
1022  PropertyRequest->ValueSize = sizeof(ULONG);
1023  ntStatus = STATUS_SUCCESS;
1024  }
1025  }
1026  }
1027 
1028  return ntStatus;
1029 }
1030 
1032 {
1033  PAGED_CODE();
1034  ASSERT(PropertyRequest);
1035  DBGPRINT(("[BasicSupportHandler]"));
1036 
1038 
1039  if (PropertyRequest->ValueSize >= (sizeof(KSPROPERTY_DESCRIPTION))) {
1040  PKSPROPERTY_DESCRIPTION PropDesc = PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
1041 
1045  PropDesc->PropTypeSet.Id = VT_I4;
1046  PropDesc->PropTypeSet.Flags = 0;
1047  PropDesc->MembersListCount = 1;
1048  PropDesc->Reserved = 0;
1049 
1050  if (PropertyRequest->ValueSize >= (sizeof(KSPROPERTY_DESCRIPTION) + sizeof(KSPROPERTY_MEMBERSHEADER) + sizeof(KSPROPERTY_STEPPING_LONG))) {
1051  PKSPROPERTY_MEMBERSHEADER Members = PKSPROPERTY_MEMBERSHEADER(PropDesc + 1);
1052 
1054  Members->MembersSize = sizeof(KSPROPERTY_STEPPING_LONG);
1055  Members->MembersCount = 1;
1056  Members->Flags = 0;
1057 
1059 
1060  for (unsigned int i=0;i<SIZEOF_ARRAY(VolTable);i++) {
1061  if (VolTable[i].node == PropertyRequest->Node) {
1062  Range->Bounds.SignedMaximum = (VolTable[i].max << 16);
1063  Range->Bounds.SignedMinimum = (VolTable[i].min << 16);
1064  Range->SteppingDelta = (VolTable[i].step << 16);
1065  ntStatus = STATUS_SUCCESS;
1066  }
1067  }
1068  if (!NT_SUCCESS(ntStatus)) {
1069  switch (PropertyRequest->Node) {
1071  Range->Bounds.SignedMaximum = 0;
1072  Range->Bounds.SignedMinimum = (-60 << 16);
1073  Range->SteppingDelta = (4 << 16);
1074  ntStatus = STATUS_SUCCESS;
1075  break;
1077  Range->Bounds.SignedMaximum = 0;
1078  Range->Bounds.SignedMinimum = (-56 << 16);
1079  Range->SteppingDelta = (8 << 16);
1080  ntStatus = STATUS_SUCCESS;
1081  break;
1082  }
1083  }
1084  Range->Reserved = 0;
1085 
1086  PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION) + sizeof(KSPROPERTY_MEMBERSHEADER) + sizeof(KSPROPERTY_STEPPING_LONG);
1087  } else {
1088  PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION);
1089  ntStatus = STATUS_SUCCESS;
1090  }
1091  } else if (PropertyRequest->ValueSize >= sizeof(ULONG)) {
1092  PULONG AccessFlags = PULONG(PropertyRequest->Value);
1094  PropertyRequest->ValueSize = sizeof(ULONG);
1095  ntStatus = STATUS_SUCCESS;
1096  }
1097 
1098  return ntStatus;
1099 }
1100 
1102 {
1103  PAGED_CODE();
1104  ASSERT(PropertyRequest);
1105  DBGPRINT(("[PropertyHandler_Level]"));
1106 
1107  CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
1109  UInt32 channel;
1110  UInt8 mixerValue;
1111 
1112  if ((PropertyRequest->Node == ULONG(-1)) || (PropertyRequest->Node >= KSNODE_TOPO_INVALID) || (PropertyRequest->PropertyItem->Id != KSPROPERTY_AUDIO_VOLUMELEVEL)) {
1113  return ntStatus;
1114  }
1115 
1116  if ( ((PropertyRequest->Verb & KSPROPERTY_TYPE_GET) || (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)) && (PropertyRequest->InstanceSize >= sizeof(LONG)) ) {
1117 
1118  channel = *(PLONG(PropertyRequest->Instance));
1119 
1120  if ((PropertyRequest->Node == KSNODE_TOPO_MICOUT_VOLUME) && (channel != CHAN_LEFT)) {
1121  return STATUS_INVALID_PARAMETER;
1122  }
1123 
1124  if ( ( (channel == CHAN_LEFT) || (channel == CHAN_RIGHT) ) && (PropertyRequest->ValueSize >= sizeof(LONG))) {
1125 
1126  PLONG Level = (PLONG)PropertyRequest->Value;
1127 
1128  for (unsigned int i=0;i<SIZEOF_ARRAY(VolTable);i++)
1129  {
1130  if (VolTable[i].node == PropertyRequest->Node) {
1131  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1132 
1133  mixerValue = (that->CMIAdapter->readMixer(VolTable[i].reg+channel) >> VolTable[i].shift) & VolTable[i].mask;
1134  *Level = that->NodeCache[(2*PropertyRequest->Node)+channel];
1135 
1136  if (mixerValue != ((*Level >> (VolTable[i].dbshift+16))+VolTable[i].mask)) {
1137  *Level = (mixerValue - VolTable[i].mask) << (16+VolTable[i].dbshift);
1138  that->NodeCache[(2*PropertyRequest->Node)+channel] = *Level;
1139  }
1140  } else
1141  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
1142  if (*Level <= (VolTable[i].min << 16)) {
1143  mixerValue = 0;
1144  that->NodeCache[(2*PropertyRequest->Node)+channel] = VolTable[i].min << 16;
1145  } else
1146  if (*Level >= (VolTable[i].max << 16)) {
1147  mixerValue = VolTable[i].mask;
1148  that->NodeCache[(2*PropertyRequest->Node)+channel] = VolTable[i].max << 16;
1149  } else {
1150  mixerValue = ((*Level >> (VolTable[i].dbshift+16)) + VolTable[i].mask) & VolTable[i].mask;
1151  that->NodeCache[(2*PropertyRequest->Node)+channel] = *Level;
1152  }
1153  that->CMIAdapter->writeMixer(VolTable[i].reg+channel, mixerValue << VolTable[i].shift);
1154  }
1155  ntStatus = STATUS_SUCCESS;
1156  }
1157  }
1158  if (PropertyRequest->Node == KSNODE_TOPO_AUX_VOLUME) {
1159  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1160  mixerValue = that->auxVolumeRegister;
1161  *Level = that->NodeCache[(2*PropertyRequest->Node)+channel];
1162  if (channel == CHAN_LEFT) {
1163  mixerValue >>= 4;
1164  }
1165  mixerValue &= 0x0F;
1166  if (mixerValue != ((*Level >> 18)+0x0F)) {
1167  *Level = (mixerValue - 0x0F) << 18;
1168  that->NodeCache[(2*PropertyRequest->Node)+channel] = *Level;
1169  }
1170  } else
1171  if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
1172  if (*Level <= (-30 << 16)) {
1173  mixerValue = 0;
1174  that->NodeCache[(2*PropertyRequest->Node)+channel] = -30 << 16;
1175  } else
1176  if (*Level >= 0) {
1177  mixerValue = 0x0F;
1178  that->NodeCache[(2*PropertyRequest->Node)+channel] = 0;
1179  } else {
1180  mixerValue = ((*Level >> 18) + 0x0F) & 0x0F;
1181  that->NodeCache[(2*PropertyRequest->Node)+channel] = *Level;
1182  }
1183 
1184  if (channel == CHAN_RIGHT) {
1185  that->auxVolumeRegister = (that->auxVolumeRegister & 0xF0) | mixerValue;
1186  } else if (channel == CHAN_LEFT) {
1187  that->auxVolumeRegister = (that->auxVolumeRegister & 0x0F) | (mixerValue << 4);
1188  }
1189  that->CMIAdapter->writeUInt8(REG_MIXER3, that->auxVolumeRegister);
1190  }
1191  ntStatus = STATUS_SUCCESS;
1192  }
1193  if ((PropertyRequest->Node == KSNODE_TOPO_MICIN_VOLUME) && (channel == CHAN_LEFT)) {
1194  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1195  *Level = that->NodeCache[(2*PropertyRequest->Node)];
1196  mixerValue = that->micVolumeRegister >> 1 & 0x7;
1197  if (mixerValue != ((*Level >> 19)+0x07)) {
1198  *Level = (mixerValue - 0x07) << 19;
1199  that->NodeCache[(2*PropertyRequest->Node)] = *Level;
1200  }
1201  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
1202  if (*Level <= (-56 << 16)) {
1203  mixerValue = 0;
1204  that->NodeCache[(2*PropertyRequest->Node)] = -56 << 16;
1205  } else if (*Level >= 0) {
1206  mixerValue = 0x07;
1207  that->NodeCache[(2*PropertyRequest->Node)] = 0;
1208  } else {
1209  mixerValue = ((*Level >> 19) + 0x07) & 0x07;
1210  that->NodeCache[(2*PropertyRequest->Node)] = *Level;
1211  }
1212  that->micVolumeRegister &= ~(0x07 << 1);
1213  that->micVolumeRegister |= mixerValue << 1;
1214  that->CMIAdapter->writeUInt8(REG_MIXER2, that->micVolumeRegister);
1215  }
1216  ntStatus = STATUS_SUCCESS;
1217  }
1218  if ((NT_SUCCESS(ntStatus)) && (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)) {
1219  PropertyRequest->ValueSize = sizeof(LONG);
1220  }
1221  }
1222  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
1223  switch(PropertyRequest->Node) {
1226  case KSNODE_TOPO_CD_VOLUME:
1231  ntStatus = BasicSupportHandler(PropertyRequest);
1232  break;
1233  }
1234  }
1235 
1236  return ntStatus;
1237 }
1238 
1240 {
1241  PAGED_CODE();
1242  ASSERT(PropertyRequest);
1243  DBGPRINT(("[PropertyHandler_CpuResources]"));
1244 
1246 
1247  if (PropertyRequest->Node == (ULONG)-1) {
1248  return ntStatus;
1249  }
1250  if (PropertyRequest->Node >= KSNODE_TOPO_INVALID) {
1251  return ntStatus;
1252  }
1253 
1254  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1255  if (PropertyRequest->ValueSize >= sizeof(LONG)) {
1256  *((PLONG)PropertyRequest->Value) = KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU;
1257 
1258  PropertyRequest->ValueSize = sizeof(LONG);
1259  ntStatus = STATUS_SUCCESS;
1260  } else {
1261  ntStatus = STATUS_BUFFER_TOO_SMALL;
1262  }
1263  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
1264  if (PropertyRequest->ValueSize >= (sizeof(KSPROPERTY_DESCRIPTION))) {
1265  PKSPROPERTY_DESCRIPTION PropDesc = PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
1266 
1269  PropDesc->DescriptionSize = sizeof(KSPROPERTY_DESCRIPTION);
1271  PropDesc->PropTypeSet.Id = VT_I4;
1272  PropDesc->PropTypeSet.Flags = 0;
1273  PropDesc->MembersListCount = 0;
1274  PropDesc->Reserved = 0;
1275 
1276  PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION);
1277  ntStatus = STATUS_SUCCESS;
1278  } else if (PropertyRequest->ValueSize >= sizeof(ULONG)) {
1279  PULONG AccessFlags = PULONG(PropertyRequest->Value);
1280 
1282 
1283  PropertyRequest->ValueSize = sizeof(ULONG);
1284  ntStatus = STATUS_SUCCESS;
1285  }
1286  }
1287 
1288  return ntStatus;
1289 }
1290 
1292 {
1293  PAGED_CODE();
1294  ASSERT(PropertyRequest);
1295  DBGPRINT(("[PropertyHandler_ComponentId]"));
1296 
1298  CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
1299 
1300  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1301  if (PropertyRequest->ValueSize >= sizeof(KSCOMPONENTID)) {
1302  PKSCOMPONENTID pComponentId = (PKSCOMPONENTID)PropertyRequest->Value;
1303 
1304  pComponentId->Manufacturer = MANUFACTURER_CM8738;
1305  pComponentId->Product = PRODUCT_CM8738;
1306  pComponentId->Component = COMPONENT_CM8738;
1307  pComponentId->Name = GUID_NULL;
1308  pComponentId->Version = CMIPCI_VERSION;
1309  pComponentId->Revision = that->cm->chipVersion;
1310 
1311  PropertyRequest->ValueSize = sizeof(KSCOMPONENTID);
1312  ntStatus = STATUS_SUCCESS;
1313  } else if (PropertyRequest->ValueSize == 0) {
1314  PropertyRequest->ValueSize = sizeof(KSCOMPONENTID);
1315  ntStatus = STATUS_BUFFER_OVERFLOW;
1316  } else {
1317  PropertyRequest->ValueSize = 0;
1318  ntStatus = STATUS_BUFFER_TOO_SMALL;
1319  }
1320  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
1321  if (PropertyRequest->ValueSize >= sizeof(ULONG)) {
1322  PULONG AccessFlags = PULONG(PropertyRequest->Value);
1323 
1325 
1326  PropertyRequest->ValueSize = sizeof(ULONG);
1327  ntStatus = STATUS_SUCCESS;
1328  } else {
1329  PropertyRequest->ValueSize = 0;
1330  ntStatus = STATUS_BUFFER_TOO_SMALL;
1331  }
1332  }
1333 
1334  return ntStatus;
1335 }
1336 
1338 {
1339  PAGED_CODE();
1340  ASSERT(PropertyRequest);
1341  DBGPRINT(("[PropertyHandler_Private]"));
1342 
1344  CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
1345 
1346  if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
1347  if (PropertyRequest->PropertyItem->Id != KSPROPERTY_CMI_GET) {
1349  }
1350 
1351  if (PropertyRequest->ValueSize == 0) {
1352  PropertyRequest->ValueSize = sizeof(CMIDATA);
1353  return STATUS_BUFFER_OVERFLOW;
1354  } else if (PropertyRequest->ValueSize < sizeof (CMIDATA)) {
1355  PropertyRequest->ValueSize = 0;
1356  return STATUS_BUFFER_TOO_SMALL;
1357  }
1358 
1359  CMIDATA* cmiData = (CMIDATA*)PropertyRequest->Value;
1360 #ifdef WAVERT
1362 #else
1364 #endif
1366  cmiData->maxChannels = that->cm->maxChannels;
1367  cmiData->IOBase = (USHORT)((ULONG_PTR)that->cm->IOBase);
1368  cmiData->MPUBase = (USHORT)((ULONG_PTR)that->cm->MPUBase);
1369  cmiData->enableSPDO = that->cm->enableSPDIFOut;
1371  cmiData->enableSPDI = that->cm->enableSPDIFIn;
1372  cmiData->formatMask = that->cm->formatMask;
1373  cmiData->exchangeFrontBack = (that->CMIAdapter->readUInt8(REG_MIXER1) & REAR2FRONT);
1374  cmiData->enableSPDO5V = (that->CMIAdapter->readUInt32(REG_MISCCTRL) & EN_SPDO5V);
1375  cmiData->enableBass2Line = (that->CMIAdapter->readUInt32(REG_LEGACY) & BASS2LINE);
1376  cmiData->enableCenter2Line = (that->CMIAdapter->readUInt32(REG_LEGACY) & CENTER2LINE);
1377  cmiData->enableRear2Line = (that->CMIAdapter->readUInt8(REG_MIXER1) & REAR2LINE);
1378  cmiData->enableCenter2Mic = (that->CMIAdapter->readUInt8(REG_MIXER4) & CENTER2MIC) && (that->cm->chipVersion > 37);
1380  cmiData->invertValidBitSPDI = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & POLVALID);
1381  cmiData->loopSPDI = (that->CMIAdapter->readUInt32(REG_FUNCTRL1) & LOOP_SPDF);
1382  if (that->cm->chipVersion <= 37) {
1383  cmiData->select2ndSPDI = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & SEL_SPDIFI1);
1384  cmiData->invertPhaseSPDI = (that->CMIAdapter->readUInt8(REG_MIXER4) & INV_SPDIFI1);
1385  } else {
1386  cmiData->select2ndSPDI = (that->CMIAdapter->readUInt32(REG_MISCCTRL) & SEL_SPDIFI2);
1387  cmiData->invertPhaseSPDI = (that->CMIAdapter->readUInt32(REG_CHFORMAT) & INV_SPDIFI2);
1388  }
1389 
1390  PropertyRequest->ValueSize = sizeof(CMIDATA);
1391  ntStatus = STATUS_SUCCESS;
1392  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
1393  if (PropertyRequest->PropertyItem->Id != KSPROPERTY_CMI_SET) {
1395  }
1396 
1397  if (PropertyRequest->ValueSize == 0) {
1398  PropertyRequest->ValueSize = sizeof(CMIDATA);
1399  return STATUS_BUFFER_OVERFLOW;
1400  } else if (PropertyRequest->ValueSize < sizeof (CMIDATA)) {
1401  PropertyRequest->ValueSize = 0;
1402  return STATUS_BUFFER_TOO_SMALL;
1403  }
1404  CMIDATA* cmiData = (CMIDATA*)PropertyRequest->Value;
1405  that->cm->enableSPDIFIn = cmiData->enableSPDI;
1406  that->cm->enableSPDIFOut = cmiData->enableSPDO;
1407  that->cm->formatMask = cmiData->formatMask;
1409 
1410  if (cmiData->enableSPDI) {
1411  that->CMIAdapter->setUInt8Bit(REG_MIXER1, EN_WAVEIN_L | EN_WAVEIN_R);
1412  } else {
1413  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, EN_WAVEIN_L | EN_WAVEIN_R);
1414  }
1415 
1416  if (cmiData->exchangeFrontBack) {
1417  that->CMIAdapter->setUInt8Bit(REG_MIXER1, REAR2FRONT);
1418  } else {
1419  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, REAR2FRONT);
1420  }
1421  if (cmiData->enableSPDO5V) {
1422  that->CMIAdapter->setUInt32Bit(REG_MISCCTRL, EN_SPDO5V);
1423  } else {
1424  that->CMIAdapter->clearUInt32Bit(REG_MISCCTRL, EN_SPDO5V);
1425  }
1426  if (cmiData->enableSPDIMonitor) {
1427  that->CMIAdapter->setUInt8Bit(REG_MIXER1, EN_SPDI2DAC);
1428  } else {
1429  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, EN_SPDI2DAC);
1430  }
1431  if (cmiData->enableBass2Line) {
1432  that->CMIAdapter->setUInt32Bit(REG_LEGACY, BASS2LINE);
1433  } else {
1434  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, BASS2LINE);
1435  }
1436  if (cmiData->enableCenter2Line) {
1437  that->CMIAdapter->setUInt32Bit(REG_LEGACY, CENTER2LINE);
1438  } else {
1439  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, CENTER2LINE);
1440  }
1441  if (cmiData->enableRear2Line) {
1442  that->CMIAdapter->setUInt8Bit(REG_MIXER1, REAR2LINE);
1443  } else {
1444  that->CMIAdapter->clearUInt8Bit(REG_MIXER1, REAR2LINE);
1445  }
1446  if (that->cm->chipVersion > 37) {
1447  if (cmiData->enableCenter2Mic) {
1448  that->CMIAdapter->setUInt8Bit(REG_MIXER4, CENTER2MIC);
1449  } else {
1450  that->CMIAdapter->clearUInt8Bit(REG_MIXER4, CENTER2MIC);
1451  }
1452  }
1454  that->CMIAdapter->setUInt32Bit(REG_LEGACY, EN_SPDCOPYRHT);
1455  } else {
1456  that->CMIAdapter->clearUInt32Bit(REG_LEGACY, EN_SPDCOPYRHT);
1457  }
1458  if (cmiData->invertValidBitSPDI) {
1459  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, POLVALID);
1460  } else {
1461  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, POLVALID);
1462  }
1463  if (cmiData->loopSPDI) {
1464  that->CMIAdapter->setUInt32Bit(REG_FUNCTRL1, LOOP_SPDF);
1465  } else {
1466  that->CMIAdapter->clearUInt32Bit(REG_FUNCTRL1, LOOP_SPDF);
1467  }
1468  if (cmiData->select2ndSPDI) {
1469  if (that->cm->chipVersion <= 37) {
1470  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, SEL_SPDIFI1);
1471  } else {
1472  that->CMIAdapter->setUInt32Bit(REG_MISCCTRL, SEL_SPDIFI2);
1473  }
1474  } else {
1475  if (that->cm->chipVersion <= 37) {
1476  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, SEL_SPDIFI1);
1477  } else {
1478  that->CMIAdapter->clearUInt32Bit(REG_MISCCTRL, SEL_SPDIFI2);
1479  }
1480  }
1481  if (cmiData->invertPhaseSPDI) {
1482  if (that->cm->chipVersion <= 37) {
1483  that->CMIAdapter->setUInt8Bit(REG_MIXER4, INV_SPDIFI1);
1484  } else {
1485  that->CMIAdapter->setUInt32Bit(REG_CHFORMAT, INV_SPDIFI2);
1486  }
1487  } else {
1488  if (that->cm->chipVersion <= 37) {
1489  that->CMIAdapter->clearUInt8Bit(REG_MIXER4, INV_SPDIFI1);
1490  } else {
1491  that->CMIAdapter->clearUInt32Bit(REG_CHFORMAT, INV_SPDIFI2);
1492  }
1493  }
1494 
1495  that->storeMixerSettingsToRegistry();
1496 
1497  ntStatus = STATUS_SUCCESS;
1498  } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
1499  if (PropertyRequest->ValueSize >= sizeof(ULONG)) {
1500  PULONG AccessFlags = PULONG(PropertyRequest->Value);
1501 
1503 
1504  PropertyRequest->ValueSize = sizeof(ULONG);
1505  ntStatus = STATUS_SUCCESS;
1506  } else {
1507  PropertyRequest->ValueSize = 0;
1508  ntStatus = STATUS_BUFFER_TOO_SMALL;
1509  }
1510  }
1511 
1512  return ntStatus;
1513 }
#define SBREG_IN_CTRL_L
Definition: cmireg.hpp:167
UInt32 invertPhaseSPDI
Definition: property.h:79
UInt32 maxChannels
Definition: property.h:68
UInt32 * IOBase
Definition: interfaces.hpp:141
#define FMT_882_DOLBY
Definition: property.h:52
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
PCMIADAPTER CMIAdapter
Definition: mintopo.hpp:38
UInt32 miscctrlRegister
Definition: mintopo.hpp:41
#define REG_FUNCTRL1
Definition: cmireg.hpp:43
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
CPPORT Port[4]
Definition: headless.c:34
struct KSCOMPONENTID * PKSCOMPONENTID
UInt32 enableSPDIMonitor
Definition: property.h:69
#define max(a, b)
Definition: svc.c:63
#define DBGPRINT(...)
Definition: pdo.c:21
#define REFIID
Definition: guiddef.h:118
UInt32 enableSPDI
Definition: property.h:83
int hardwareRevision
Definition: property.h:65
#define shift
Definition: input.c:1756
Definition: compat.h:2157
UInt8 mixer1Register
Definition: mintopo.hpp:40
#define SEL_SPDIFI2
Definition: cmireg.hpp:113
Type
Definition: Type.h:6
IPortTopology * PPORTTOPOLOGY
Definition: portcls.h:1403
IMiniportTopology * PMINIPORTTOPOLOGY
Definition: portcls.h:1431
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define FMT_480_MULTI_PCM
Definition: property.h:47
#define EN_WAVEIN_R
Definition: cmireg.hpp:133
#define EN_WAVEIN_L
Definition: cmireg.hpp:132
GUID Component
Definition: ks.h:1466
#define TRUE
Definition: types.h:120
UInt32 formatMask
Definition: property.h:82
#define EN_SPDCOPYRHT
Definition: cmireg.hpp:103
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
DWORD UInt32
Definition: chm_lib.c:104
UInt32 functrl1Register
Definition: mintopo.hpp:41
#define REFCLSID
Definition: guiddef.h:117
const VolumeTable VolTable[]
GUID Name
Definition: ks.h:1467
#define KSPROPERTY_CMI_GET
Definition: property.h:39
#define CENTER2MIC
Definition: cmireg.hpp:150
#define CHAN_LEFT
Definition: interfaces.hpp:66
#define EN_SPDI2DAC
Definition: cmireg.hpp:130
const GUID KSNODETYPE_MUTE
Definition: sup.c:19
LONG NTSTATUS
Definition: precomp.h:26
#define UInt8
Definition: interfaces.hpp:75
#define REG_CHFORMAT
Definition: cmireg.hpp:60
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
GLuint buffer
Definition: glext.h:5915
UInt32 loopSPDI
Definition: property.h:81
const GUID KSNODETYPE_VOLUME
Definition: sup.c:21
UInt32 invertValidBitSPDI
Definition: property.h:80
const GUID KSPROPTYPESETID_General
Definition: property.c:17
UInt8 micVolumeRegister
Definition: mintopo.hpp:40
char driverVersion[32]
Definition: property.h:64
#define FMT_480_PCM
Definition: property.h:43
ULONG Revision
Definition: ks.h:1469
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
#define REG_MISCCTRL
Definition: cmireg.hpp:111
bool enableSPDIFOut
Definition: interfaces.hpp:145
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:385
#define CHAN_RIGHT
Definition: interfaces.hpp:67
#define REAR2LINE
Definition: cmireg.hpp:135
#define EN_MICBOOST
Definition: cmireg.hpp:171
#define BOOL
Definition: nt_native.h:43
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
#define DWORD
Definition: nt_native.h:44
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
UInt8 mixer4Register
Definition: mintopo.hpp:40
#define KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU
Definition: ksmedia.h:1098
#define BASS2LINE
Definition: cmireg.hpp:100
GUID Set
Definition: dmksctrl.h:76
IN UCHAR Value
Definition: halp.h:394
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
NTSTATUS NTAPI CreateMiniportTopologyCMI(PUNKNOWN *Unknown, REFCLSID, PUNKNOWN UnknownOuter, POOL_TYPE PoolType)
Definition: mintopo.cpp:38
#define REG_MIXER3
Definition: cmireg.hpp:146
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:240
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define REG_LEGACY
Definition: cmireg.hpp:98
#define INV_SPDIFI2
Definition: cmireg.hpp:66
#define REAR2FRONT
Definition: cmireg.hpp:134
ULONG Version
Definition: ks.h:1468
UInt32 enableCenter2Mic
Definition: property.h:74
const GUID KSNODETYPE_LOUDNESS
Definition: sup.c:18
#define FMT_441_PCM
Definition: property.h:42
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 SBREG_EXTENSION
Definition: cmireg.hpp:170
GLenum GLint GLuint mask
Definition: glext.h:6028
UInt32 enableSPDOCopyright
Definition: property.h:77
struct KSPROPERTY_MEMBERSHEADER * PKSPROPERTY_MEMBERSHEADER
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
UInt32 enableCenter2Line
Definition: property.h:72
UInt32 * MPUBase
Definition: interfaces.hpp:142
UInt32 chformatRegister
Definition: mintopo.hpp:41
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
UInt16 MPUBase
Definition: property.h:67
PCMITOPOLOGY TopoMiniport
Definition: interfaces.hpp:144
#define FMT_441_DOLBY
Definition: property.h:50
CMIDATA cmiData
Definition: main.h:78
#define STDMETHODIMP
Definition: basetyps.h:43
#define SBREG_OUTPUTCTRL
Definition: cmireg.hpp:160
UInt32 enableSPDO5V
Definition: property.h:76
NTSTATUS NTAPI PropertyHandler_ComponentId(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1291
smooth NULL
Definition: ftsmooth.c:416
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1437
#define EN_CD_L
Definition: cmireg.hpp:162
void * PVOID
Definition: retypes.h:9
KSIDENTIFIER PropTypeSet
Definition: ks.h:1541
BOOL * PBOOL
Definition: windef.h:161
UInt32 enableSPDO
Definition: property.h:75
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
#define PRODUCT_CM8738
Definition: interfaces.hpp:277
#define FMT_960_MULTI_PCM
Definition: property.h:49
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KSPROPERTY_TYPE_BASICSUPPORT
Definition: dmksctrl.h:45
const PCPROPERTY_ITEM * PropertyItem
Definition: portcls.h:261
#define KSPROPERTY_CMI_SET
Definition: property.h:40
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
struct KSPROPERTY_STEPPING_LONG * PKSPROPERTY_STEPPING_LONG
#define SIZEOF_ARRAY(ar)
Definition: cdrom.h:1482
ULONG DescriptionSize
Definition: ks.h:1540
GUID Product
Definition: ks.h:1465
IRegistryKey * PREGISTRYKEY
Definition: portcls.h:999
ULONG Id
Definition: dmksctrl.h:77
if(!(yy_init))
Definition: macro.lex.yy.c:714
UInt32 exchangeFrontBack
Definition: property.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1173
INT POOL_TYPE
Definition: typedefs.h:78
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
const GUID IID_IUnknown
#define EN_SPDO5V
Definition: cmireg.hpp:121
UInt32 masterMuteDummy
Definition: mintopo.hpp:43
UInt32 formatMask
Definition: interfaces.hpp:148
#define EN_LINEIN_R
Definition: cmireg.hpp:165
#define for
Definition: utility.h:88
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MANUFACTURER_CM8738
Definition: interfaces.hpp:289
#define MUTE_AUX_R
Definition: cmireg.hpp:142
UInt32 enableRear2Line
Definition: property.h:73
struct _MINIPORT * PMINIPORT
#define FMT_960_PCM
Definition: property.h:45
static IUnknown Object
Definition: main.c:512
ULONG AddRef()
#define EN_MIC
Definition: cmireg.hpp:161
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define SBREG_IN_CTRL_R
Definition: cmireg.hpp:168
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define REG_MIXER4
Definition: cmireg.hpp:148
friend NTSTATUS NTAPI PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:480
UInt16 IOBase
Definition: property.h:66
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
NTSTATUS NTAPI PcNewRegistryKey(OUT PREGISTRYKEY *OutRegistryKey, IN PUNKNOWN OuterUnknown OPTIONAL, IN ULONG RegistryKeyType, IN ACCESS_MASK DesiredAccess, IN PVOID DeviceObject OPTIONAL, IN PVOID SubDevice OPTIONAL, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG CreateOptions OPTIONAL, OUT PULONG Disposition OPTIONAL)
Definition: registry.cpp:281
struct PropertyItem PropertyItem
#define EN_CD_R
Definition: cmireg.hpp:163
UInt32 maxChannels
Definition: interfaces.hpp:136
#define REG_MIXER1
Definition: cmireg.hpp:129
UInt32 enableBass2Line
Definition: property.h:71
#define POLVALID
Definition: cmireg.hpp:64
#define GUID_NULL
Definition: ks.h:106
#define KSPROPERTY_MEMBER_STEPPEDRANGES
Definition: ks.h:1559
PUNKNOWN MajorTarget
Definition: portcls.h:258
NTSTATUS NTAPI PropertyHandler_CpuResources(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1239
Definition: range.c:39
#define LOOP_SPDF
Definition: cmireg.hpp:50
bool enableSPDIFIn
Definition: interfaces.hpp:146
IResourceList * PRESOURCELIST
Definition: portcls.h:442
#define MUTE_RAUX_L
Definition: cmireg.hpp:143
BOOLEAN settingsLoaded
Definition: mintopo.hpp:44
NTSTATUS NTAPI PropertyHandler_OnOff(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:480
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define COMPONENT_CM8738
Definition: interfaces.hpp:283
#define CENTER2LINE
Definition: cmireg.hpp:99
unsigned short USHORT
Definition: pedump.c:61
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define CMIVERSION
Definition: debug.hpp:31
CMI8738Info * cm
Definition: mintopo.hpp:39
#define MUTE_AUX_L
Definition: cmireg.hpp:141
unsigned int * PULONG
Definition: retypes.h:1
#define min(a, b)
Definition: monoChain.cc:55
#define MUTE_RAUX_R
Definition: cmireg.hpp:144
static PCNODE_DESCRIPTOR TopologyNodes[]
static int reg
Definition: i386-dis.c:1275
#define FMT_480_DOLBY
Definition: property.h:51
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
friend NTSTATUS NTAPI PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1101
UInt32 legacyRegister
Definition: mintopo.hpp:41
#define FMT_882_MULTI_PCM
Definition: property.h:48
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
bool enableSPDIFInMonitor
Definition: interfaces.hpp:147
#define FMT_960_DOLBY
Definition: property.h:53
#define INV_SPDIFI1
Definition: cmireg.hpp:149
#define DIS_MICGAIN
Definition: cmireg.hpp:140
static NTSTATUS BasicSupportHandler(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1031
#define FMT_882_PCM
Definition: property.h:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define SEL_SPDIFI1
Definition: cmireg.hpp:71
IN PRESOURCELIST IN PPORTTOPOLOGY Port
Definition: mintopo.hpp:77
UInt8 auxVolumeRegister
Definition: mintopo.hpp:40
NTSTATUS NTAPI PropertyHandler_Private(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1337
ULONG MembersListCount
Definition: ks.h:1542
UInt32 NodeCache[2 *KSNODE_TOPO_INVALID]
Definition: mintopo.hpp:42
#define REG_MIXER2
Definition: cmireg.hpp:139
GUID Manufacturer
Definition: ks.h:1464
return STATUS_SUCCESS
Definition: btrfs.c:3014
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
#define FMT_441_MULTI_PCM
Definition: property.h:46
#define REG_DWORD
Definition: sdbapi.c:596
signed int * PLONG
Definition: retypes.h:5
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define CMIPCI_VERSION
Definition: interfaces.hpp:292
static PCFILTER_DESCRIPTOR MiniportFilterDescriptor
struct KSPROPERTY_DESCRIPTION * PKSPROPERTY_DESCRIPTION
#define EN_LINEIN_L
Definition: cmireg.hpp:164
Definition: dlist.c:348
#define PAGED_CODE()
#define MUTE_WAVE
Definition: cmireg.hpp:136
UInt32 select2ndSPDI
Definition: property.h:78
NTSTATUS NTAPI PropertyHandler_Level(PPCPROPERTY_REQUEST PropertyRequest)
Definition: mintopo.cpp:1101