19#define NONAMELESSUNION
30#include "mmdeviceapi.h"
36 {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
37 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
38 'W',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
39 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
40 'M',
'M',
'D',
'e',
'v',
'i',
'c',
'e',
's',
'\\',
41 'A',
'u',
'd',
'i',
'o',
'\\',
42 'R',
'e',
'n',
'd',
'e',
'r',0 };
43static const WCHAR propertiesW[] = {
'P',
'r',
'o',
'p',
'e',
'r',
't',
'i',
'e',
's',0};
54 hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv);
65 hr = IPropertyStore_GetValue(store, (
const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv);
67 ok(pv.vt ==
VT_LPWSTR && pv.u.pwszVal,
"FriendlyName value had wrong type: 0x%x or was NULL\n", pv.vt);
71 hr = IPropertyStore_GetValue(store, (
const PROPERTYKEY*)&DEVPKEY_DeviceInterface_Enabled, &pv);
73 ok(pv.vt ==
VT_EMPTY,
"Key should not be found\n");
77 hr = IPropertyStore_GetValue(store, (
const PROPERTYKEY*)&DEVPKEY_DeviceInterface_ClassGuid, &pv);
79 ok(pv.vt ==
VT_EMPTY,
"Key should not be found\n");
88 static const PROPERTYKEY deviceinterface_key = {
89 {0x233164c8, 0x1b2c, 0x4c7d, {0xbc, 0x68, 0xb6, 0x71, 0x68, 0x7a, 0x25, 0x67}}, 1
93 hr = IPropertyStore_GetValue(store, &deviceinterface_key, &pv);
95 ok(pv.vt ==
VT_LPWSTR,
"Got wrong variant type: 0x%x\n", pv.vt);
111 hr = IPropertyStore_GetCount(store, &propcount);
114 ok(propcount > 0,
"Propcount %d should be greater than zero\n", propcount);
116 for (prop = 0; prop < propcount; prop++) {
117 hr = IPropertyStore_GetAt(store, prop, &pkey);
125 broken(!found_name) ,
"DEVPKEY_Device_FriendlyName not found\n");
126 ok(found_desc,
"DEVPKEY_Device_DeviceDesc not found\n");
138 static const PROPERTYKEY PKEY_Bogus = {
139 {0x1da5d803, 0xd492, 0x4edd, {0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x00}}, 0x7f
141 static const WCHAR bogusW[] = {
'{',
'1',
'D',
'A',
'5',
'D',
'8',
'0',
'3',
'-',
'D',
'4',
'9',
'2',
'-',
'4',
'E',
'D',
'D',
'-',
'8',
'C',
'2',
'3',
'-',
'E',
'0',
'C',
'0',
'F',
'F',
'E',
'E',
'7',
'F',
'0',
'0',
'}',
',',
'1',
'2',
'7',0};
143 PropVariantInit(&pv);
146 hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv);
147 ok(
hr ==
S_OK,
"Failed to get Endpoint GUID: %08x\n",
hr);
149 guidW = pv.u.pwszVal;
154 hr = IPropertyStore_SetValue(store, &PKEY_Bogus, &pv);
158 win_skip(
"Missing permission to write to registry\n");
164 hr = IPropertyStore_GetValue(store, &PKEY_Bogus, &pv);
165 ok(
hr ==
S_OK,
"GetValue failed: %08x\n",
hr);
166 ok(pv.u.ulVal == 0xAB,
"Got wrong value: 0x%x\n", pv.u.ulVal);
179 size =
sizeof(regval);
183 ok(regval == 0xAB,
"Got wrong value: 0x%x\n", regval);
214 skip(
"mmdevapi not available: 0x%08x\n",
hr);
219 ok(
hr ==
S_OK ||
hr == E_NOTFOUND,
"GetDefaultAudioEndpoint failed: 0x%08x\n",
hr);
222 if (
hr == E_NOTFOUND)
223 skip(
"No sound card available\n");
225 skip(
"GetDefaultAudioEndpoint returns 0x%08x\n",
hr);
229 hr = IMMDevice_OpenPropertyStore(
dev, 3, &store);
236 ok(!store,
"Store set to non-NULL on failure: %p/%08x\n", store,
hr);
238 IPropertyStore_Release(store);
246 ok(
hr ==
S_OK,
"Opening valid store returned %08x\n",
hr);
254 IPropertyStore_Release(store);
256 IMMDevice_Release(
dev);
259 IMMDeviceEnumerator_Release(
mme);
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define GetProcAddress(x, y)
#define GetCurrentProcess()
#define WideCharToMultiByte
static void cleanup(void)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
GLuint GLuint GLsizei GLenum type
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define ERROR_FILE_NOT_FOUND
static void test_setvalue_on_wow64(IPropertyStore *store)
static BOOL *static const WCHAR software_renderW[]
static const WCHAR propertiesW[]
static void test_getat(IPropertyStore *store)
static void test_deviceinterface(IPropertyStore *store)
static IMMDeviceEnumerator * mme
#define IsEqualPropertyKey(a, b)
static void test_propertystore(void)
static const WCHAR props[]
#define HKEY_LOCAL_MACHINE