forked from Mirrors/wine-wine
Save GET_APCS data before calling any asynchronous procedure calls, in
case the server is called during the APC.oldstable
parent
e3bd8d0adf
commit
8d5db55cc5
|
@ -24,15 +24,21 @@ static void call_apcs(void)
|
||||||
#define MAX_APCS 16
|
#define MAX_APCS 16
|
||||||
int i;
|
int i;
|
||||||
void *buffer[MAX_APCS * 2];
|
void *buffer[MAX_APCS * 2];
|
||||||
|
int count;
|
||||||
struct get_apcs_request *req = get_req_buffer();
|
struct get_apcs_request *req = get_req_buffer();
|
||||||
|
|
||||||
if (server_call( REQ_GET_APCS ) || !req->count) return;
|
if (server_call( REQ_GET_APCS ) || !req->count) return;
|
||||||
assert( req->count <= MAX_APCS );
|
assert( req->count <= MAX_APCS );
|
||||||
|
|
||||||
|
/* make a copy of the request buffer... it may get trashed *
|
||||||
|
* when the apcs are called */
|
||||||
memcpy( buffer, req->apcs, req->count * 2 * sizeof(req->apcs[0]) );
|
memcpy( buffer, req->apcs, req->count * 2 * sizeof(req->apcs[0]) );
|
||||||
for (i = 0; i < req->count * 2; i += 2)
|
count = req->count;
|
||||||
|
|
||||||
|
for (i = 0; i < count * 2; i += 2)
|
||||||
{
|
{
|
||||||
PAPCFUNC func = (PAPCFUNC)req->apcs[i];
|
PAPCFUNC func = (PAPCFUNC)buffer[i];
|
||||||
if (func) func( (ULONG_PTR)req->apcs[i+1] );
|
if (func) func( (ULONG_PTR)buffer[i+1] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue