This will make the Wow64 syscall rather simpler.
Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/wineoss.drv/mmdevdrv.c | 12 +++++++----- dlls/wineoss.drv/oss.c | 18 ++++++++---------- dlls/wineoss.drv/unixlib.h | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index c9aae98ec2e..9c1261ce05c 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -390,8 +390,10 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **gu }
for(i = 0; i < params.num; i++){ - unsigned int name_size = (wcslen(params.endpoints[i].name) + 1) * sizeof(WCHAR); - unsigned int dev_size = strlen(params.endpoints[i].device) + 1; + WCHAR *name = (WCHAR *)((char *)params.endpoints + params.endpoints[i].name); + char *device = (char *)params.endpoints + params.endpoints[i].device; + unsigned int name_size = (wcslen(name) + 1) * sizeof(WCHAR); + unsigned int dev_size = strlen(device) + 1; OSSDevice *oss_dev;
ids[i] = HeapAlloc(GetProcessHeap(), 0, name_size); @@ -401,12 +403,12 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **gu params.result = E_OUTOFMEMORY; goto end; } - memcpy(ids[i], params.endpoints[i].name, name_size); - get_device_guid(flow, params.endpoints[i].device, guids + i); + memcpy(ids[i], name, name_size); + get_device_guid(flow, device, guids + i);
oss_dev->flow = flow; oss_dev->guid = guids[i]; - memcpy(oss_dev->devnode, params.endpoints[i].device, dev_size); + memcpy(oss_dev->devnode, device, dev_size); device_add(oss_dev); } *def_index = params.default_idx; diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index a628548ddcd..986ed274445 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -226,11 +226,10 @@ static NTSTATUS get_endpoint_ids(void *args) WCHAR name[ARRAY_SIZE(ai.name) + ARRAY_SIZE(outW)]; char device[OSS_DEVNODE_SIZE]; } *info; - unsigned int i, j, num, needed, name_len, device_len, default_idx = 0; + unsigned int i, j, num, needed, name_len, device_len, offset, default_idx = 0; char default_device[OSS_DEVNODE_SIZE]; struct endpoint *endpoint; int mixer_fd; - char *ptr;
mixer_fd = open("/dev/mixer", O_RDONLY, 0); if(mixer_fd < 0){ @@ -333,9 +332,8 @@ static NTSTATUS get_endpoint_ids(void *args) } close(mixer_fd);
- needed = num * sizeof(*params->endpoints); + offset = needed = num * sizeof(*params->endpoints); endpoint = params->endpoints; - ptr = (char *)(endpoint + num);
for(i = 0; i < num; i++){ name_len = wcslen(info[i].name) + 1; @@ -343,12 +341,12 @@ static NTSTATUS get_endpoint_ids(void *args) needed += name_len * sizeof(WCHAR) + ((device_len + 1) & ~1);
if(needed <= params->size){ - endpoint->name = (WCHAR *)ptr; - memcpy(endpoint->name, info[i].name, name_len * sizeof(WCHAR)); - ptr += name_len * sizeof(WCHAR); - endpoint->device = ptr; - memcpy(endpoint->device, info[i].device, device_len); - ptr += (device_len + 1) & ~1; + endpoint->name = offset; + memcpy((char *)params->endpoints + offset, info[i].name, name_len * sizeof(WCHAR)); + offset += name_len * sizeof(WCHAR); + endpoint->device = offset; + memcpy((char *)params->endpoints + offset, info[i].device, device_len); + offset += (device_len + 1) & ~1; endpoint++; } } diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 278dfdbe612..208dec7f69d 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -36,8 +36,8 @@ struct test_connect_params
struct endpoint { - WCHAR *name; - char *device; + unsigned int name; + unsigned int device; };
struct get_endpoint_ids_params