Commit 978a9342 authored by Bill Medland's avatar Bill Medland Committed by Alexandre Julliard

Fixed incorrect pointer-cast arithmetic.

Extended ole trace information. Don't lose the existing pipes on alloc failure.
parent bbbc18b1
......@@ -94,7 +94,7 @@ _xread(HANDLE hf, LPVOID ptr, DWORD size) {
return E_FAIL;
}
if (res!=size) {
FIXME("Read only %ld of %ld bytes.\n",res,size);
FIXME("Read only %ld of %ld bytes from %x.\n",res,size,hf);
return E_FAIL;
}
return S_OK;
......@@ -130,7 +130,7 @@ _xwrite(HANDLE hf, LPVOID ptr, DWORD size) {
return E_FAIL;
}
if (res!=size) {
FIXME("Wrote only %ld of %ld bytes.\n",res,size);
FIXME("Wrote only %ld of %ld bytes to %x.\n",res,size,hf);
return E_FAIL;
}
return S_OK;
......@@ -142,22 +142,24 @@ static HRESULT
PIPE_RegisterPipe(wine_marshal_id *mid, HANDLE hPipe, BOOL startreader) {
int i;
char pipefn[100];
wine_pipe *new_pipes;
for (i=0;i<nrofpipes;i++)
if (pipes[i].mid.processid==mid->processid)
return S_OK;
if (pipes)
pipes=(wine_pipe*)HeapReAlloc(GetProcessHeap(),0,pipes,sizeof(pipes[0])*(nrofpipes+1));
new_pipes=(wine_pipe*)HeapReAlloc(GetProcessHeap(),0,pipes,sizeof(pipes[0])*(nrofpipes+1));
else
pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
if (!pipes) return E_OUTOFMEMORY;
new_pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
if (!new_pipes) return E_OUTOFMEMORY;
pipes = new_pipes;
sprintf(pipefn,OLESTUBMGR"_%08lx",mid->processid);
memcpy(&(pipes[nrofpipes].mid),mid,sizeof(*mid));
pipes[nrofpipes].hPipe = hPipe;
InitializeCriticalSection(&(pipes[nrofpipes].crit));
nrofpipes++;
if (startreader) {
pipes[nrofpipes-1].hThread = CreateThread(NULL,0,_StubReaderThread,(LPVOID)pipes+(nrofpipes-1),0,&(pipes[nrofpipes-1].tid));
pipes[nrofpipes-1].hThread = CreateThread(NULL,0,_StubReaderThread,(LPVOID)(pipes+(nrofpipes-1)),0,&(pipes[nrofpipes-1].tid));
} else {
pipes[nrofpipes-1].tid = GetCurrentThreadId();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment