| 1869 | } |
| 1870 | |
| 1871 | OSStatus ProxyAudioDevice::GetBoxPropertyData(AudioServerPlugInDriverRef inDriver, |
| 1872 | AudioObjectID inObjectID, |
| 1873 | pid_t inClientProcessID, |
| 1874 | const AudioObjectPropertyAddress *inAddress, |
| 1875 | UInt32 inQualifierDataSize, |
| 1876 | const void *inQualifierData, |
| 1877 | UInt32 inDataSize, |
| 1878 | UInt32 *outDataSize, |
| 1879 | void *outData) { |
| 1880 | #pragma unused(inQualifierDataSize, inQualifierData) |
| 1881 | |
| 1882 | // declare the local variables |
| 1883 | OSStatus theAnswer = 0; |
| 1884 | |
| 1885 | // check the arguments |
| 1886 | FailWithAction(inDriver != gAudioServerPlugInDriverRef, |
| 1887 | theAnswer = kAudioHardwareBadObjectError, |
| 1888 | Done, |
| 1889 | "GetBoxPropertyData: bad driver reference"); |
| 1890 | FailWithAction( |
| 1891 | inAddress == NULL, theAnswer = kAudioHardwareIllegalOperationError, Done, "GetBoxPropertyData: no address"); |
| 1892 | FailWithAction(outDataSize == NULL, |
| 1893 | theAnswer = kAudioHardwareIllegalOperationError, |
| 1894 | Done, |
| 1895 | "GetBoxPropertyData: no place to put the return value size"); |
| 1896 | FailWithAction(outData == NULL, |
| 1897 | theAnswer = kAudioHardwareIllegalOperationError, |
| 1898 | Done, |
| 1899 | "GetBoxPropertyData: no place to put the return value"); |
| 1900 | FailWithAction(inObjectID != kObjectID_Box, |
| 1901 | theAnswer = kAudioHardwareBadObjectError, |
| 1902 | Done, |
| 1903 | "GetBoxPropertyData: not the plug-in object"); |
| 1904 | |
| 1905 | // Note that for each object, this driver implements all the required properties plus a few |
| 1906 | // extras that are useful but not required. |
| 1907 | // |
| 1908 | // Also, since most of the data that will get returned is static, there are few instances where |
| 1909 | // it is necessary to lock the state mutex. |
| 1910 | switch (inAddress->mSelector) { |
| 1911 | case kAudioObjectPropertyBaseClass: |
| 1912 | // The base class for kAudioBoxClassID is kAudioObjectClassID |
| 1913 | FailWithAction(inDataSize < sizeof(AudioClassID), |
| 1914 | theAnswer = kAudioHardwareBadPropertySizeError, |
| 1915 | Done, |
| 1916 | "GetBoxPropertyData: not enough space for the return value of kAudioObjectPropertyBaseClass " |
| 1917 | "for the box"); |
| 1918 | *((AudioClassID *)outData) = kAudioObjectClassID; |
| 1919 | *outDataSize = sizeof(AudioClassID); |
| 1920 | break; |
| 1921 | |
| 1922 | case kAudioObjectPropertyClass: |
| 1923 | // The class is always kAudioBoxClassID for regular drivers |
| 1924 | FailWithAction( |
| 1925 | inDataSize < sizeof(AudioClassID), |
| 1926 | theAnswer = kAudioHardwareBadPropertySizeError, |
| 1927 | Done, |
| 1928 | "GetBoxPropertyData: not enough space for the return value of kAudioObjectPropertyClass for the box"); |
nothing calls this directly
no outgoing calls
no test coverage detected