Huw Davies (@huw) commented about dlls/mmdevapi/main.c:
+static char *get_test_connect_name(void) +{
- WCHAR path[MAX_PATH], *name;
- size_t len;
- char *str;
- GetModuleFileNameW(NULL, path, ARRAY_SIZE(path));
- name = wcsrchr(path, '\');
- name = name ? name + 1 : path;
- len = WideCharToMultiByte(CP_UTF8, 0, name, -1, NULL, 0, NULL, NULL);
- if (!(str = malloc(len)))
return NULL;
- WideCharToMultiByte(CP_UNIXCP, 0, name, -1, str, len, NULL, NULL);
The two different codepages don't look right. I realise this came from `winepulse` but we should fix the bug in there before copying it.
It would probably be cleaner to pass the unicode string straight to the driver and have the driver worry about converting it to whatever format it needs - I'd suggest doing this first.