reccently d3 from blizzard was shipped and I get a guestcode from a friend!
playing it linux especially on gentoo is not so hard. what definitley works is the installation and the videos aswell as the mainmenu...couldnt play yet cause the servers were full
with a standard wine install it didnt work
http://appdb.winehq.org/objectManager.p ... &iId=25588
here are my ebuilds and partches. just add the patches to /usr/portage/app-emulation/wine/files and then redit the /usr/portage/app-emulation/wine/wine-1.5.2-eubuild.
finally regenerate the manifest with
Code: Select all
repoman fixupdate from 17.05.2012
I add here the reset patch
/usr/portage/app-emulation/wine/files/reset.patch
source://http://bugs.winehq.org/attachment.cgi?id=39565
Code: Select all
--- a/dlls/wined3d/device.c
+++ a/dlls/wined3d/device.c
@@ -5294,6 +5294,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_surface_decref(device->onscreen_depth_stencil);
device->onscreen_depth_stencil = NULL;
}
+ wined3d_device_set_depth_stencil(device, NULL);
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
@@ -5393,11 +5394,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
device->onscreen_depth_stencil = NULL;
}
- /* Reset the depth stencil */
+ /* Apply the auto depth stencil if the app requested one */
if (swapchain_desc->enable_auto_depth_stencil)
wined3d_device_set_depth_stencil(device, device->auto_depth_stencil);
- else
- wined3d_device_set_depth_stencil(device, NULL);
TRACE("Resetting stateblock\n");
wined3d_stateblock_decref(device->updateStateBlock);
/usr/portage/app-emulation/wine/files/diablo3_1.patch
source:http://bugs.winehq.org/attachment.cgi?id=39500
Code: Select all
From 5154c12213cc2c960d8596660687add13d3421c7 Mon Sep 17 00:00:00 2001
From: William Pettersson <william.pettersson@gmail.com>
Date: Thu, 22 Mar 2012 22:20:40 +1000
Subject: [PATCH] GetExtendedTcpTable
Adds support for TCP_TABLE_OWNER_PID_ALL
in GetExtendedTcpTable.
---
dlls/iphlpapi/iphlpapi_main.c | 27 +++++-
dlls/iphlpapi/ipstats.c | 209 ++++++++++++++++++++++++++++++----------
dlls/iphlpapi/ipstats.h | 2 +
include/wine/server_protocol.h | 19 ++++-
server/process.c | 18 ++++
server/protocol.def | 8 ++
server/request.h | 6 +
server/trace.c | 13 +++
8 files changed, 248 insertions(+), 54 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index a569041..f54cb50 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1883,15 +1883,36 @@ DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder,
ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved)
{
+ DWORD table_size;
+ VOID *table;
+ DWORD ret;
+
TRACE("pTcpTable %p, pdwSize %p, bOrder %d, ulAf %u, TableClass %u, Reserved %u\n",
pTcpTable, pdwSize, bOrder, ulAf, TableClass, Reserved);
- if (ulAf == AF_INET6 || TableClass != TCP_TABLE_BASIC_ALL)
+ if (!pdwSize) return ERROR_INVALID_PARAMETER;
+
+ if (ulAf == AF_INET6)
{
- FIXME("ulAf = %u, TableClass = %u not supportted\n", ulAf, TableClass);
+ FIXME("AF_INET6 not supported\n");
return ERROR_NOT_SUPPORTED;
}
- return GetTcpTable(pTcpTable, pdwSize, bOrder);
+
+ ret = tcp_build_table(GetProcessHeap(), 0, &table, &table_size, bOrder, TableClass);
+ if (!ret) {
+ if (!pTcpTable || *pdwSize < table_size) {
+ *pdwSize = table_size;
+ ret = ERROR_INSUFFICIENT_BUFFER;
+ }
+ else {
+ *pdwSize = table_size;
+ memcpy(pTcpTable, table, table_size);
+ }
+ HeapFree(GetProcessHeap(), 0, table);
+ }
+
+ TRACE("returning %d\n", ret);
+ return ret;
}
/******************************************************************
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index db475fb..704160e 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <errno.h>
#include <sys/types.h>
+#include <dirent.h>
#ifdef HAVE_ALIAS_H
#include <alias.h>
#endif
@@ -1617,15 +1618,17 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOr
}
-static MIB_TCPTABLE *append_tcp_row( HANDLE heap, DWORD flags, MIB_TCPTABLE *table,
- DWORD *count, const MIB_TCPROW *row )
+static VOID *append_tcp_row( HANDLE heap, DWORD flags, VOID *table, DWORD *count,
+ const VOID *row, DWORD row_size, DWORD table_struct_size )
{
- if (table->dwNumEntries >= *count)
+ DWORD dwNumEntries = *(DWORD *)table;
+
+ if (dwNumEntries >= *count)
{
- MIB_TCPTABLE *new_table;
- DWORD new_count = table->dwNumEntries * 2;
+ VOID *new_table;
+ DWORD new_count = dwNumEntries * 2;
- if (!(new_table = HeapReAlloc( heap, flags, table, FIELD_OFFSET(MIB_TCPTABLE, table[new_count] ))))
+ if (!(new_table = HeapReAlloc( heap, flags, table, table_struct_size + row_size*new_count )))
{
HeapFree( heap, 0, table );
return NULL;
@@ -1633,7 +1636,8 @@ static MIB_TCPTABLE *append_tcp_row( HANDLE heap, DWORD flags, MIB_TCPTABLE *tab
*count = new_count;
table = new_table;
}
- memcpy( &table->table[table->dwNumEntries++], row, sizeof(*row) );
+ memcpy( (CHAR *)table + sizeof(DWORD) + dwNumEntries*row_size, row, row_size );
+ *(DWORD *)table = dwNumEntries+1;
return table;
}
@@ -1674,38 +1678,34 @@ static int compare_tcp_rows(const void *a, const void *b)
}
-/******************************************************************
- * AllocateAndGetTcpTableFromStack (IPHLPAPI.@)
- *
- * Get the TCP connection table.
- * Like GetTcpTable(), but allocate the returned table from heap.
- *
- * PARAMS
- * ppTcpTable [Out] pointer into which the MIB_TCPTABLE is
- * allocated and returned.
- * bOrder [In] whether to sort the table
- * heap [In] heap from which the table is allocated
- * flags [In] flags to HeapAlloc
- *
- * RETURNS
- * ERROR_INVALID_PARAMETER if ppTcpTable is NULL, whatever GetTcpTable()
- * returns otherwise.
- */
-DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bOrder,
- HANDLE heap, DWORD flags)
+#include "wine/server.h"
+#define STATUS_SUCCESS 0
+DWORD tcp_build_table(HANDLE heap, DWORD flags, VOID **table, DWORD *table_size, BOOL bOrder,
+ TCP_TABLE_CLASS TableClass)
{
- MIB_TCPTABLE *table;
- MIB_TCPROW row;
- DWORD ret = NO_ERROR, count = 16;
-
- TRACE("table %p, bOrder %d, heap %p, flags 0x%08x\n", ppTcpTable, bOrder, heap, flags);
+ DWORD ret = NO_ERROR, row_size, table_struct_size;
+ MIB_TCPROW_OWNER_PID row;
+ DWORD count = 16;
- if (!ppTcpTable) return ERROR_INVALID_PARAMETER;
+ switch(TableClass)
+ {
+ case TCP_TABLE_BASIC_ALL:
+ row_size = sizeof(MIB_TCPROW);
+ table_struct_size = sizeof(MIB_TCPTABLE)-row_size;
+ break;
+ case TCP_TABLE_OWNER_PID_ALL:
+ row_size = sizeof(MIB_TCPROW_OWNER_PID);
+ table_struct_size = sizeof(MIB_TCPTABLE_OWNER_PID)-row_size;
+ break;
+ default:
+ FIXME("TableClass = %u not supported\n", TableClass);
+ return ERROR_NOT_SUPPORTED;
+ }
- if (!(table = HeapAlloc( heap, flags, FIELD_OFFSET(MIB_TCPTABLE, table[count] ))))
+ if (!(*table = HeapAlloc( heap, flags, table_struct_size+row_size*count )))
return ERROR_OUTOFMEMORY;
- table->dwNumEntries = 0;
+ *(DWORD *)*table = 0;
#ifdef __linux__
{
@@ -1720,14 +1720,86 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
ptr = fgets(buf, sizeof(buf), fp);
while ((ptr = fgets(buf, sizeof(buf), fp)))
{
- if (sscanf( ptr, "%x: %x:%x %x:%x %x", &dummy, &row.dwLocalAddr, &row.dwLocalPort,
- &row.dwRemoteAddr, &row.dwRemotePort, &row.u.dwState ) != 6)
+ int inode;
+ int status = 0; /* STATUS_SUCCESS if the corresponding row
+ * has a wine-pid. */
+
+ if (sscanf( ptr, "%x: %x:%x %x:%x %x %*s %*s %*s %*s %*s %d", &dummy, &row.dwLocalAddr, &row.dwLocalPort,
+ &row.dwRemoteAddr, &row.dwRemotePort, &row.dwState, &inode ) != 7)
continue;
- row.dwLocalPort = htons( row.dwLocalPort );
- row.dwRemotePort = htons( row.dwRemotePort );
- row.u.State = TCPStateToMIBState( row.u.dwState );
- if (!(table = append_tcp_row( heap, flags, table, &count, &row )))
- break;
+ if (inode)
+ {
+ char fdDir[40];
+ char socketName[40];
+ DIR *proc;
+ struct dirent *procEnt;
+ int unix_pid=0;
+ sprintf(socketName,"socket:[%d]",inode);
+
+ /* To find the unix PID owning an inode,
+ * we traverse /proc, look inside each
+ * process directory, and read symbolic
+ * links in the fd subdirectory until
+ * we find one that matches socketName.
+ * We then check that this unix_pid
+ * actually corresponds to a wine-pid. */
+
+ if ( (proc = opendir("/proc")))
+ {
+ while ((procEnt = readdir(proc)))
+ {
+ if ((procEnt->d_name[0] >= '0') &&(procEnt->d_name[0] <= '9'))
+ {
+ DIR *fds;
+ struct dirent *ent;
+ sprintf(fdDir, "/proc/%d/fd", atoi(procEnt->d_name));
+ if ((fds = opendir(fdDir)))
+ {
+ while (( ent = readdir(fds) ) )
+ {
+ char fdLinkName[40];
+ char fdName[40];
+ int len;
+ sprintf(fdLinkName, "/proc/%s/fd/%s", procEnt->d_name, ent->d_name);
+ if ( (len = readlink(fdLinkName, fdName, 40)) > 0 )
+ {
+ fdName[len]='\0';
+ if ( (len == strlen(socketName)) && (strncmp(socketName,fdName, len) == 0))
+ {
+ unix_pid = atoi(procEnt->d_name);
+ SERVER_START_REQ( find_process )
+ {
+ req->unix_pid = unix_pid;
+ status = wine_server_call( req );
+ if (status == STATUS_SUCCESS)
+ row.dwOwningPid = reply->pid;
+ }
+ SERVER_END_REQ;
+ if (status == STATUS_SUCCESS)
+ {
+ closedir(fds);
+ closedir(proc);
+ goto found_pid;
+ }
+ }
+ }
+ }
+ closedir(fds);
+ }
+ }
+ }
+ closedir(proc);
+ }
+ }
+found_pid:
+ if (status == STATUS_SUCCESS)
+ {
+ row.dwLocalPort = htons( row.dwLocalPort );
+ row.dwRemotePort = htons( row.dwRemotePort );
+ row.dwState = TCPStateToMIBState( row.dwState );
+ if (!(*table = append_tcp_row( heap, flags, *table, &count, &row, row_size, table_struct_size )))
+ break;
+ }
}
fclose( fp );
}
@@ -1749,8 +1821,8 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
row.dwLocalPort = htons( entry->tcpConnLocalPort );
row.dwRemoteAddr = entry->tcpConnRemAddress;
row.dwRemotePort = htons( entry->tcpConnRemPort );
- row.u.dwState = entry->tcpConnState;
- if (!(table = append_tcp_row( heap, flags, table, &count, &row ))) break;
+ row.dwState = entry->tcpConnState;
+ if (!(*table = append_tcp_row( heap, flags, *table, &count, &row, row_size, table_struct_size ))) break;
}
HeapFree( GetProcessHeap(), 0, data );
}
@@ -1828,8 +1900,8 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
row.dwLocalPort = pINData->inp_lport;
row.dwRemoteAddr = pINData->inp_faddr.s_addr;
row.dwRemotePort = pINData->inp_fport;
- row.u.State = TCPStateToMIBState (pTCPData->t_state);
- if (!(table = append_tcp_row( heap, flags, table, &count, &row ))) break;
+ row.dwState = TCPStateToMIBState (pTCPData->t_state);
+ if (!(*table = append_tcp_row( heap, flags, *table, &count, &row, row_size, table_struct_size ))) break;
}
done:
@@ -1840,14 +1912,51 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
ret = ERROR_NOT_SUPPORTED;
#endif
- if (!table) return ERROR_OUTOFMEMORY;
+ if (!*table) return ERROR_OUTOFMEMORY;
if (!ret)
{
- if (bOrder && table->dwNumEntries)
- qsort( table->table, table->dwNumEntries, sizeof(row), compare_tcp_rows );
- *ppTcpTable = table;
+ DWORD dwNumEntries = *(DWORD *)*table;
+ if (bOrder && dwNumEntries)
+ qsort( (CHAR*)(*table) + sizeof(DWORD), dwNumEntries, row_size, compare_tcp_rows );
+ if (table_size)
+ *table_size = table_struct_size + row_size*dwNumEntries;
}
- else HeapFree( heap, flags, table );
+ else HeapFree( heap, flags, *table );
+ return ret;
+}
+
+
+/******************************************************************
+ * AllocateAndGetTcpTableFromStack (IPHLPAPI.@)
+ *
+ * Get the TCP connection table.
+ * Like GetTcpTable(), but allocate the returned table from heap.
+ *
+ * PARAMS
+ * ppTcpTable [Out] pointer into which the MIB_TCPTABLE is
+ * allocated and returned.
+ * bOrder [In] whether to sort the table
+ * heap [In] heap from which the table is allocated
+ * flags [In] flags to HeapAlloc
+ *
+ * RETURNS
+ * ERROR_INVALID_PARAMETER if ppTcpTable is NULL, whatever GetTcpTable()
+ * returns otherwise.
+ */
+DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bOrder,
+ HANDLE heap, DWORD flags)
+{
+ MIB_TCPTABLE *table;
+ DWORD ret;
+
+ TRACE("table %p, bOrder %d, heap %p, flags 0x%08x\n", ppTcpTable, bOrder, heap, flags);
+
+ if (!ppTcpTable) return ERROR_INVALID_PARAMETER;
+
+ ret = tcp_build_table(heap, flags, (VOID **)&table, NULL, bOrder, TCP_TABLE_BASIC_ALL);
+ if (ret == NO_ERROR)
+ *ppTcpTable = table;
+
TRACE( "returning ret %u table %p\n", ret, table );
return ret;
}
diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h
index 3522716..c546512 100644
--- a/dlls/iphlpapi/ipstats.h
+++ b/dlls/iphlpapi/ipstats.h
@@ -27,6 +27,8 @@
#include "winbase.h"
#include "iprtrmib.h"
+DWORD tcp_build_table(HANDLE heap, DWORD flags, VOID **table, DWORD *table_size, BOOL bOrder, TCP_TABLE_CLASS TableClass);
+
/* Fills in entry's interface stats, using name to find them.
* Returns ERROR_INVALID_PARAMETER if name or entry is NULL, NO_ERROR otherwise.
*/
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 0e989da..9851cbb 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -716,6 +716,20 @@ struct init_thread_reply
+struct find_process_request
+{
+ struct request_header __header;
+ int unix_pid;
+};
+struct find_process_reply
+{
+ struct reply_header __header;
+ process_id_t pid;
+ char __pad_12[4];
+};
+
+
+
struct terminate_process_request
{
struct request_header __header;
@@ -4897,6 +4911,7 @@ enum request
REQ_get_startup_info,
REQ_init_process_done,
REQ_init_thread,
+ REQ_find_process,
REQ_terminate_process,
REQ_terminate_thread,
REQ_get_process_info,
@@ -5151,6 +5166,7 @@ union generic_request
struct get_startup_info_request get_startup_info_request;
struct init_process_done_request init_process_done_request;
struct init_thread_request init_thread_request;
+ struct find_process_request find_process_request;
struct terminate_process_request terminate_process_request;
struct terminate_thread_request terminate_thread_request;
struct get_process_info_request get_process_info_request;
@@ -5403,6 +5419,7 @@ union generic_reply
struct get_startup_info_reply get_startup_info_reply;
struct init_process_done_reply init_process_done_reply;
struct init_thread_reply init_thread_reply;
+ struct find_process_reply find_process_reply;
struct terminate_process_reply terminate_process_reply;
struct terminate_thread_reply terminate_thread_reply;
struct get_process_info_reply get_process_info_reply;
@@ -5646,6 +5663,6 @@ union generic_reply
struct set_suspend_context_reply set_suspend_context_reply;
};
-#define SERVER_PROTOCOL_VERSION 431
+#define SERVER_PROTOCOL_VERSION 432
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/process.c b/server/process.c
index de3b594..2acaf77 100644
--- a/server/process.c
+++ b/server/process.c
@@ -989,6 +989,24 @@ DECL_HANDLER(new_process)
release_object( info );
}
+/* Find a process from the Unix pid */
+DECL_HANDLER(find_process)
+{
+ struct process *process;
+ int i;
+
+ for(i=0; i<used_ptid_entries; i++)
+ {
+ process = (struct process *) ptid_entries[i].ptr;
+ if (process && process->unix_pid == req->unix_pid)
+ {
+ reply->pid = get_process_id( process );
+ return;
+ }
+ }
+ set_error( STATUS_INVALID_PARAMETER );
+}
+
/* Retrieve information about a newly started process */
DECL_HANDLER(get_new_process_info)
{
diff --git a/server/protocol.def b/server/protocol.def
index 80c0cd3..b36b878 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -695,6 +695,14 @@ typedef union
@END
+/* Find a process from the Unix pid */
+@REQ(find_process)
+ int unix_pid; /* Unix pid of the process */
+@REPLY
+ process_id_t pid; /* Wine process id of the process */
+@END
+
+
/* Terminate a process */
@REQ(terminate_process)
obj_handle_t handle; /* process handle to terminate */
diff --git a/server/request.h b/server/request.h
index 5b45cf9..8d59a46 100644
--- a/server/request.h
+++ b/server/request.h
@@ -117,6 +117,7 @@ DECL_HANDLER(new_thread);
DECL_HANDLER(get_startup_info);
DECL_HANDLER(init_process_done);
DECL_HANDLER(init_thread);
+DECL_HANDLER(find_process);
DECL_HANDLER(terminate_process);
DECL_HANDLER(terminate_thread);
DECL_HANDLER(get_process_info);
@@ -370,6 +371,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_get_startup_info,
(req_handler)req_init_process_done,
(req_handler)req_init_thread,
+ (req_handler)req_find_process,
(req_handler)req_terminate_process,
(req_handler)req_terminate_thread,
(req_handler)req_get_process_info,
@@ -696,6 +698,10 @@ C_ASSERT( FIELD_OFFSET(struct init_thread_reply, info_size) == 24 );
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, version) == 28 );
C_ASSERT( FIELD_OFFSET(struct init_thread_reply, all_cpus) == 32 );
C_ASSERT( sizeof(struct init_thread_reply) == 40 );
+C_ASSERT( FIELD_OFFSET(struct find_process_request, unix_pid) == 12 );
+C_ASSERT( sizeof(struct find_process_request) == 16 );
+C_ASSERT( FIELD_OFFSET(struct find_process_reply, pid) == 8 );
+C_ASSERT( sizeof(struct find_process_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct terminate_process_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct terminate_process_request, exit_code) == 16 );
C_ASSERT( sizeof(struct terminate_process_request) == 24 );
diff --git a/server/trace.c b/server/trace.c
index cfef963..5b0c85e 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1100,6 +1100,16 @@ static void dump_init_thread_reply( const struct init_thread_reply *req )
fprintf( stderr, ", all_cpus=%08x", req->all_cpus );
}
+static void dump_find_process_request( const struct find_process_request *req )
+{
+ fprintf( stderr, " unix_pid=%d", req->unix_pid );
+}
+
+static void dump_find_process_reply( const struct find_process_reply *req )
+{
+ fprintf( stderr, " pid=%04x", req->pid );
+}
+
static void dump_terminate_process_request( const struct terminate_process_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
@@ -3920,6 +3930,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_get_startup_info_request,
(dump_func)dump_init_process_done_request,
(dump_func)dump_init_thread_request,
+ (dump_func)dump_find_process_request,
(dump_func)dump_terminate_process_request,
(dump_func)dump_terminate_thread_request,
(dump_func)dump_get_process_info_request,
@@ -4170,6 +4181,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_get_startup_info_reply,
NULL,
(dump_func)dump_init_thread_reply,
+ (dump_func)dump_find_process_reply,
(dump_func)dump_terminate_process_reply,
(dump_func)dump_terminate_thread_reply,
(dump_func)dump_get_process_info_reply,
@@ -4420,6 +4432,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"get_startup_info",
"init_process_done",
"init_thread",
+ "find_process",
"terminate_process",
"terminate_thread",
"get_process_info",
--
1.7.3.4
source:http://bugs.winehq.org/attachment.cgi?id=39494
Code: Select all
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index d3a4590..dd818f2 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1700,7 +1700,7 @@ static NTSTATUS WS2_async_accept( void *arg, IO_STATUS_BLOCK *iosb, NTSTATUS sta
if (status != STATUS_PENDING)
goto finish;
- return STATUS_SUCCESS;
+ return STATUS_ALERTED;
finish:
iosb->u.Status = status;
@@ -1708,8 +1708,6 @@ finish:
if (wsa->user_overlapped->hEvent)
SetEvent(wsa->user_overlapped->hEvent);
- if (wsa->cvalue)
- WS_AddCompletion( HANDLE2SOCKET(wsa->listen_socket), wsa->cvalue, iosb->u.Status, iosb->Information );
*apc = ws2_async_accept_apc;
return status;
@@ -2040,7 +2038,9 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
req->async.callback = wine_server_client_ptr( WS2_async_accept );
req->async.iosb = wine_server_client_ptr( overlapped );
req->async.arg = wine_server_client_ptr( wsa );
- /* We don't set event or completion since we may also have to read */
+ req->async.cvalue = cvalue;
+ /* We don't set event since we may also have to read, completion returns STATUS_ALERTED
+ * to indicate that no completion should be queued. */
status = wine_server_call( req );
}
SERVER_END_REQ;
diff --git a/server/async.c b/server/async.c
index dd28dff..b8be5cd 100644
--- a/server/async.c
+++ b/server/async.c
@@ -256,10 +256,12 @@ void async_set_result( struct object *obj, unsigned int status, unsigned int tot
else
{
if (async->timeout) remove_timeout_user( async->timeout );
+ if (async->completion && async->data.cvalue && status != STATUS_ALERTED)
+ add_completion( async->completion, async->comp_key, async->data.cvalue, status, total );
+ else if (async->completion && async->data.cvalue && status == STATUS_ALERTED)
+ status = STATUS_SUCCESS;
async->timeout = NULL;
async->status = status;
- if (async->completion && async->data.cvalue)
- add_completion( async->completion, async->comp_key, async->data.cvalue, status, total );
if (apc)
{
apc_call_t data;
/usr/portage/app-emulation/wine/wine-1.5.2.ebuild
source: gentoo, patches added by casualX
Code: Select all
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.5.2.ebuild,v 1.3 2012/05/12 21:12:50 tetromino Exp $
EAPI="4"
inherit autotools eutils flag-o-matic multilib pax-utils
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
inherit git-2
SRC_URI=""
#KEYWORDS=""
else
MY_P="${PN}-${PV/_/-}"
SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
S=${WORKDIR}/${MY_P}
fi
GV="1.5"
DESCRIPTION="free implementation of Windows(tm) on Unix"
HOMEPAGE="http://www.winehq.org/"
SRC_URI="${SRC_URI}
gecko? (
mirror://sourceforge/wine/wine_gecko-${GV}-x86.msi
win64? ( mirror://sourceforge/wine/wine_gecko-${GV}-x86_64.msi )
)"
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="alsa capi cups custom-cflags elibc_glibc fontconfig +gecko gnutls gphoto2 gsm gstreamer hardened jpeg lcms ldap mp3 ncurses nls odbc openal opencl +opengl +oss +perl png samba scanner selinux ssl test +threads +truetype udisks v4l +win32 +win64 +X xcomposite xinerama xml"
REQUIRED_USE="elibc_glibc? ( threads )" #286560
RESTRICT="test" #72375
MLIB_DEPS="amd64? (
truetype? ( >=app-emulation/emul-linux-x86-xlibs-2.1 )
X? (
>=app-emulation/emul-linux-x86-xlibs-2.1
>=app-emulation/emul-linux-x86-soundlibs-2.1
)
mp3? ( app-emulation/emul-linux-x86-soundlibs )
odbc? ( app-emulation/emul-linux-x86-db )
openal? ( app-emulation/emul-linux-x86-sdl )
opengl? ( app-emulation/emul-linux-x86-opengl )
scanner? ( app-emulation/emul-linux-x86-medialibs )
v4l? ( app-emulation/emul-linux-x86-medialibs )
app-emulation/emul-linux-x86-baselibs
>=sys-kernel/linux-headers-2.6
)"
RDEPEND="truetype? ( >=media-libs/freetype-2.0.0 media-fonts/corefonts )
perl? ( dev-lang/perl dev-perl/XML-Simple )
capi? ( net-dialup/capi4k-utils )
ncurses? ( >=sys-libs/ncurses-5.2 )
fontconfig? ( media-libs/fontconfig )
gphoto2? ( media-libs/libgphoto2 )
openal? ( media-libs/openal )
udisks? (
sys-apps/dbus
sys-fs/udisks:0
)
gnutls? ( net-libs/gnutls )
gstreamer? ( media-libs/gstreamer media-libs/gst-plugins-base )
X? (
x11-libs/libXcursor
x11-libs/libXrandr
x11-libs/libXi
x11-libs/libXmu
x11-libs/libXxf86vm
x11-apps/xmessage
)
xinerama? ( x11-libs/libXinerama )
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
opencl? ( virtual/opencl )
opengl? ( virtual/opengl )
gsm? ( media-sound/gsm )
jpeg? ( virtual/jpeg )
ldap? ( net-nds/openldap )
lcms? ( =media-libs/lcms-1* )
mp3? ( >=media-sound/mpg123-1.5.0 )
nls? ( sys-devel/gettext )
odbc? ( dev-db/unixODBC )
samba? ( >=net-fs/samba-3.0.25 )
selinux? ( sec-policy/selinux-wine )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
scanner? ( media-gfx/sane-backends )
ssl? ( dev-libs/openssl )
png? ( media-libs/libpng )
v4l? ( media-libs/libv4l )
!win64? ( ${MLIB_DEPS} )
win32? ( ${MLIB_DEPS} )
xcomposite? ( x11-libs/libXcomposite )"
DEPEND="${RDEPEND}
X? (
x11-proto/inputproto
x11-proto/xextproto
x11-proto/xf86vidmodeproto
)
xinerama? ( x11-proto/xineramaproto )
!hardened? ( sys-devel/prelink )
virtual/pkgconfig
virtual/yacc
sys-devel/flex"
src_unpack() {
if use win64 ; then
[[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]] \
&& die "you need gcc-4.4+ to build 64bit wine"
fi
if use win32 && use opencl; then
[[ x$(eselect opencl show) = "xintel" ]] &&
die "Cannot build wine[opencl,win32]: intel-ocl-sdk is 64-bit only" # 403947
fi
if [[ ${PV} == "9999" ]] ; then
git-2_src_unpack
else
unpack ${MY_P}.tar.bz2
fi
}
src_prepare() {
epatch "${FILESDIR}"/reset.patch
epatch "${FILESDIR}"/diablo3_1.patch
epatch "${FILESDIR}"/diablo3_2.patch
epatch "${FILESDIR}"/${PN}-1.1.15-winegcc.patch #260726
epatch "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
epatch_user #282735
eautoreconf
sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
sed -i '/^MimeType/d' tools/wine.desktop || die #117785
}
do_configure() {
local builddir="${WORKDIR}/wine$1"
mkdir -p "${builddir}"
pushd "${builddir}" >/dev/null
ECONF_SOURCE=${S} \
econf \
--sysconfdir=/etc/wine \
$(use_with alsa) \
$(use_with capi) \
$(use_with lcms cms) \
$(use_with cups) \
$(use_with ncurses curses) \
$(use_with udisks dbus) \
$(use_with fontconfig) \
$(use_with gnutls) \
$(use_with gphoto2 gphoto) \
$(use_with gsm) \
$(use_with gstreamer) \
--without-hal \
$(use_with jpeg) \
$(use_with ldap) \
$(use_with mp3 mpg123) \
$(use_with nls gettext) \
$(use_with openal) \
$(use_with opencl) \
$(use_with opengl) \
$(use_with ssl openssl) \
$(use_with oss) \
$(use_with png) \
$(use_with threads pthread) \
$(use_with scanner sane) \
$(use_enable test tests) \
$(use_with truetype freetype) \
$(use_with v4l) \
$(use_with X x) \
$(use_with xcomposite) \
$(use_with xinerama) \
$(use_with xml) \
$(use_with xml xslt) \
$2
emake -j1 depend
popd >/dev/null
}
src_configure() {
export LDCONFIG=/bin/true
use custom-cflags || strip-flags
if use win64 ; then
do_configure 64 --enable-win64
use win32 && ABI=x86 do_configure 32 --with-wine64=../wine64
else
ABI=x86 do_configure 32 --disable-win64
fi
}
src_compile() {
local b
for b in 64 32 ; do
local builddir="${WORKDIR}/wine${b}"
[[ -d ${builddir} ]] || continue
emake -C "${builddir}" all
done
}
src_install() {
local b
for b in 64 32 ; do
local builddir="${WORKDIR}/wine${b}"
[[ -d ${builddir} ]] || continue
emake -C "${builddir}" install DESTDIR="${D}"
done
dodoc ANNOUNCE AUTHORS README
if use gecko ; then
insinto /usr/share/wine/gecko
doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
use win64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
fi
if ! use perl ; then
rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
fi
if use win32 || ! use win64; then
pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
fi
use win64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
if use win64 && ! use win32; then
dosym /usr/bin/wine{64,} # 404331
dosym /usr/bin/wine{64,}-preloader
fi
}
Code: Select all
epatch "${FILESDIR}"/diablo3_1.patch
epatch "${FILESDIR}"/diablo3_2.patch



