Fixed incorrect pointer-cast arithmetic.
Extended ole trace information. Don't lose the existing pipes on alloc failure.
This commit is contained in:
parent
bbbc18b12c
commit
978a934245
|
@ -94,7 +94,7 @@ _xread(HANDLE hf, LPVOID ptr, DWORD size) {
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
if (res!=size) {
|
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 E_FAIL;
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -130,7 +130,7 @@ _xwrite(HANDLE hf, LPVOID ptr, DWORD size) {
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
if (res!=size) {
|
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 E_FAIL;
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -142,22 +142,24 @@ static HRESULT
|
||||||
PIPE_RegisterPipe(wine_marshal_id *mid, HANDLE hPipe, BOOL startreader) {
|
PIPE_RegisterPipe(wine_marshal_id *mid, HANDLE hPipe, BOOL startreader) {
|
||||||
int i;
|
int i;
|
||||||
char pipefn[100];
|
char pipefn[100];
|
||||||
|
wine_pipe *new_pipes;
|
||||||
|
|
||||||
for (i=0;i<nrofpipes;i++)
|
for (i=0;i<nrofpipes;i++)
|
||||||
if (pipes[i].mid.processid==mid->processid)
|
if (pipes[i].mid.processid==mid->processid)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
if (pipes)
|
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
|
else
|
||||||
pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
|
new_pipes=(wine_pipe*)HeapAlloc(GetProcessHeap(),0,sizeof(pipes[0]));
|
||||||
if (!pipes) return E_OUTOFMEMORY;
|
if (!new_pipes) return E_OUTOFMEMORY;
|
||||||
|
pipes = new_pipes;
|
||||||
sprintf(pipefn,OLESTUBMGR"_%08lx",mid->processid);
|
sprintf(pipefn,OLESTUBMGR"_%08lx",mid->processid);
|
||||||
memcpy(&(pipes[nrofpipes].mid),mid,sizeof(*mid));
|
memcpy(&(pipes[nrofpipes].mid),mid,sizeof(*mid));
|
||||||
pipes[nrofpipes].hPipe = hPipe;
|
pipes[nrofpipes].hPipe = hPipe;
|
||||||
InitializeCriticalSection(&(pipes[nrofpipes].crit));
|
InitializeCriticalSection(&(pipes[nrofpipes].crit));
|
||||||
nrofpipes++;
|
nrofpipes++;
|
||||||
if (startreader) {
|
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 {
|
} else {
|
||||||
pipes[nrofpipes-1].tid = GetCurrentThreadId();
|
pipes[nrofpipes-1].tid = GetCurrentThreadId();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue