winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
699 discussions
Start a n
N
ew thread
Eric Pouech : richedit: Check return of GetScrollInfo before accessing the returned structure.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: cb4f8a80dee8bf5c3c2a29b76a09166c2228d448 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb4f8a80dee8bf5c3c2a29b76…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Jan 4 21:12:14 2008 +0100 richedit: Check return of GetScrollInfo before accessing the returned structure. --- dlls/riched20/paint.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 91e283a..03a588c 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -697,8 +697,7 @@ int ME_GetYScrollPos(ME_TextEditor *editor) SCROLLINFO si; si.cbSize = sizeof(si); si.fMask = SIF_POS; - GetScrollInfo(editor->hWnd, SB_VERT, &si); - return si.nPos; + return GetScrollInfo(editor->hWnd, SB_VERT, &si) ? si.nPos : 0; } BOOL ME_GetYScrollVisible(ME_TextEditor *editor)
1
0
0
0
Eric Pouech : richedit: Initialize all the cursors at editor creation.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: f33a27517bdc484ed45103aa8aefe6bd3a0fab4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f33a27517bdc484ed45103aa8…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Jan 4 21:12:09 2008 +0100 richedit: Initialize all the cursors at editor creation. --- dlls/riched20/editor.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index a9948b2..43c27d1 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1172,6 +1172,8 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->pCursors[0].nOffset = 0; ed->pCursors[1].pRun = ME_FindItemFwd(ed->pBuffer->pFirst, diRun); ed->pCursors[1].nOffset = 0; + ed->pCursors[2] = ed->pCursors[0]; + ed->pCursors[3] = ed->pCursors[1]; ed->nLastTotalLength = ed->nTotalLength = 0; ed->nHeight = 0; ed->nUDArrowX = -1;
1
0
0
0
Eric Pouech : richedit: Only copy the charset when it's defined.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: a3597cbe3b617b6f87f121880a5d29939f4c5dac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3597cbe3b617b6f87f121880…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Jan 4 21:12:03 2008 +0100 richedit: Only copy the charset when it's defined. --- dlls/riched20/style.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 91b8c36..453c15b 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -321,7 +321,8 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s) lf->lfHeight = (lf->lfHeight*2)/3; /*lf.lfQuality = PROOF_QUALITY; */ lf->lfPitchAndFamily = s->fmt.bPitchAndFamily; - lf->lfCharSet = s->fmt.bCharSet; + if (s->fmt.dwMask & CFM_CHARSET) + lf->lfCharSet = s->fmt.bCharSet; } void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt)
1
0
0
0
Rob Shearman : rpcrt4: Don't set Buffer to NULL in I_RpcFreeBuffer.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: 0e6d5202c889acec7a07237fb3c3f25305e07050 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0e6d5202c889acec7a07237fb…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 17:37:59 2008 +0000 rpcrt4: Don't set Buffer to NULL in I_RpcFreeBuffer. --- dlls/rpcrt4/rpc_message.c | 10 +++------- dlls/rpcrt4/tests/ndr_marshall.c | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 1248e46..9f0df05 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -917,12 +917,10 @@ fail: RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg) { TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); - /* FIXME: pfnAllocate? */ pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); TRACE("Buffer=%p\n", pMsg->Buffer); - /* FIXME: which errors to return? */ - return pMsg->Buffer ? S_OK : E_OUTOFMEMORY; + return pMsg->Buffer ? RPC_S_OK : ERROR_OUTOFMEMORY; } /*********************************************************************** @@ -934,7 +932,7 @@ static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg) pMsg->Buffer = HeapReAlloc(GetProcessHeap(), 0, pMsg->Buffer, pMsg->BufferLength); TRACE("Buffer=%p\n", pMsg->Buffer); - return pMsg->Buffer ? RPC_S_OK : RPC_S_OUT_OF_RESOURCES; + return pMsg->Buffer ? RPC_S_OK : ERROR_OUTOFMEMORY; } /*********************************************************************** @@ -955,10 +953,8 @@ static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg) RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg) { TRACE("(%p) Buffer=%p\n", pMsg, pMsg->Buffer); - /* FIXME: pfnFree? */ HeapFree(GetProcessHeap(), 0, pMsg->Buffer); - pMsg->Buffer = NULL; - return S_OK; + return RPC_S_OK; } /*********************************************************************** diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c index 86ec190..d02135b 100644 --- a/dlls/rpcrt4/tests/ndr_marshall.c +++ b/dlls/rpcrt4/tests/ndr_marshall.c @@ -1576,7 +1576,6 @@ todo_wine StubMsg.BufferLength = 1; NdrFreeBuffer(&StubMsg); ok(RpcMessage.Handle != NULL, "RpcMessage.Handle should not have been NULL\n"); -todo_wine ok(RpcMessage.Buffer != NULL, "RpcMessage.Buffer should not have been NULL\n"); ok(RpcMessage.BufferLength == 10, "RpcMessage.BufferLength should have been left as 10 instead of %d\n", RpcMessage.BufferLength); ok(StubMsg.Buffer != NULL, "Buffer should not have been NULL\n");
1
0
0
0
Rob Shearman : rpcrt4: Add some tests for NdrGetBuffer and NdrFreeBuffer.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: 1bb6c1b4d121a89ff90b0e22bcaceb021c9ff1a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1bb6c1b4d121a89ff90b0e22b…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 17:37:31 2008 +0000 rpcrt4: Add some tests for NdrGetBuffer and NdrFreeBuffer. --- dlls/rpcrt4/tests/ndr_marshall.c | 82 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c index eadb9c7..86ec190 100644 --- a/dlls/rpcrt4/tests/ndr_marshall.c +++ b/dlls/rpcrt4/tests/ndr_marshall.c @@ -72,6 +72,31 @@ static const MIDL_STUB_DESC Object_StubDesc = 0 /* Reserved5 */ }; +static RPC_DISPATCH_FUNCTION IFoo_table[] = +{ + 0 +}; + +static RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable = +{ + 0, + IFoo_table +}; + +static const RPC_SERVER_INTERFACE IFoo___RpcServerInterface = +{ + sizeof(RPC_SERVER_INTERFACE), + {{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x34}},{0,0}}, + {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}}, + &IFoo_v0_0_DispatchTable, + 0, + 0, + 0, + 0, + 0, +}; + +static RPC_IF_HANDLE IFoo_v0_0_s_ifspec = (RPC_IF_HANDLE)& IFoo___RpcServerInterface; static void test_ndr_simple_type(void) { @@ -1509,6 +1534,62 @@ static void test_nonconformant_string(void) HeapFree(GetProcessHeap(), 0, StubMsg.RpcMsg->Buffer); } +static void test_ndr_buffer(void) +{ + static unsigned char ncalrpc[] = "ncalrpc"; + static unsigned char endpoint[] = "winetest:" __FILE__; + RPC_MESSAGE RpcMessage; + MIDL_STUB_MESSAGE StubMsg; + MIDL_STUB_DESC StubDesc = Object_StubDesc; + unsigned char *ret; + unsigned char *binding; + RPC_BINDING_HANDLE Handle; + RPC_STATUS status; + + StubDesc.RpcInterfaceInformation = (void *)&IFoo___RpcServerInterface; + + ok(RPC_S_OK == RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL), "RpcServerUseProtseqEp\n"); + ok(RPC_S_OK == RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL), "RpcServerRegisterIf\n"); + ok(RPC_S_OK == RpcServerListen(1, 20, TRUE), "RpcServerListen\n"); + + status = RpcStringBindingCompose(NULL, ncalrpc, NULL, endpoint, NULL, &binding); + ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status); + + status = RpcBindingFromStringBinding(binding, &Handle); + ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%lu)\n", status); + + NdrClientInitializeNew(&RpcMessage, &StubMsg, &StubDesc, 5); + + ret = NdrGetBuffer(&StubMsg, 10, Handle); + ok(ret == StubMsg.Buffer, "NdrGetBuffer should have returned the same value as StubMsg.Buffer instead of %p\n", ret); + ok(RpcMessage.Handle != NULL, "RpcMessage.Handle should not have been NULL\n"); + ok(RpcMessage.Buffer != NULL, "RpcMessage.Buffer should not have been NULL\n"); + ok(RpcMessage.BufferLength == 10, "RpcMessage.BufferLength should have been 10 instead of %d\n", RpcMessage.BufferLength); + ok(RpcMessage.RpcFlags == 0, "RpcMessage.RpcFlags should have been 0x0 instead of 0x%lx\n", RpcMessage.RpcFlags); + ok(StubMsg.Buffer != NULL, "Buffer should not have been NULL\n"); + ok(!StubMsg.BufferStart, "BufferStart should have been NULL instead of %p\n", StubMsg.BufferStart); + ok(!StubMsg.BufferEnd, "BufferEnd should have been NULL instead of %p\n", StubMsg.BufferEnd); +todo_wine + ok(StubMsg.BufferLength == 0, "BufferLength should have left as 0 instead of being set to %d\n", StubMsg.BufferLength); + ok(StubMsg.fBufferValid == TRUE, "fBufferValid should have been TRUE instead of 0x%x\n", StubMsg.fBufferValid); + + StubMsg.BufferLength = 1; + NdrFreeBuffer(&StubMsg); + ok(RpcMessage.Handle != NULL, "RpcMessage.Handle should not have been NULL\n"); +todo_wine + ok(RpcMessage.Buffer != NULL, "RpcMessage.Buffer should not have been NULL\n"); + ok(RpcMessage.BufferLength == 10, "RpcMessage.BufferLength should have been left as 10 instead of %d\n", RpcMessage.BufferLength); + ok(StubMsg.Buffer != NULL, "Buffer should not have been NULL\n"); + ok(StubMsg.BufferLength == 1, "BufferLength should have left as 1 instead of being set to %d\n", StubMsg.BufferLength); + ok(StubMsg.fBufferValid == FALSE, "fBufferValid should have been FALSE instead of 0x%x\n", StubMsg.fBufferValid); + + /* attempt double-free */ + NdrFreeBuffer(&StubMsg); + + status = RpcServerUnregisterIf(NULL, NULL, FALSE); + ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%lu)\n", status); +} + START_TEST( ndr_marshall ) { test_ndr_simple_type(); @@ -1521,4 +1602,5 @@ START_TEST( ndr_marshall ) test_conformant_array(); test_conformant_string(); test_nonconformant_string(); + test_ndr_buffer(); }
1
0
0
0
Rob Shearman : ole32: Clear the RPC_MESSAGE structure before using it.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: cf8da82ad37eb07b48c8ae6eae0fce5f0571a52e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf8da82ad37eb07b48c8ae6ea…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 17:44:01 2008 +0000 ole32: Clear the RPC_MESSAGE structure before using it. The RPC runtime could use some of the parameters, expecting them to be initialised. --- dlls/ole32/oleproxy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index 9af6c59..bc87997 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -376,9 +376,9 @@ static HRESULT WINAPI CFProxy_CreateInstance( * * Data: Only the 'IID'. */ + memset(&msg, 0, sizeof(msg)); msg.iMethod = 3; msg.cbBuffer = sizeof(*riid); - msg.Buffer = NULL; hres = IRpcChannelBuffer_GetBuffer(This->chanbuf,&msg,&IID_IClassFactory); if (hres) { FIXME("IRpcChannelBuffer_GetBuffer failed with %x?\n",hres);
1
0
0
0
Rob Shearman : kernel32: Implement RegisterWaitForSingleObjectEx.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: 628a515b83c317388ddb4fa9a7b29a42135acee0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=628a515b83c317388ddb4fa9a…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 17:43:56 2008 +0000 kernel32: Implement RegisterWaitForSingleObjectEx. --- dlls/kernel32/sync.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index 168a00f..b8b8f0c 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -270,9 +270,19 @@ HANDLE WINAPI RegisterWaitForSingleObjectEx( HANDLE hObject, WAITORTIMERCALLBACK Callback, PVOID Context, ULONG dwMilliseconds, ULONG dwFlags ) { - FIXME("%p %p %p %d %d\n", + NTSTATUS status; + HANDLE hNewWaitObject; + + TRACE("%p %p %p %d %d\n", hObject,Callback,Context,dwMilliseconds,dwFlags); - return 0; + + status = RtlRegisterWait( &hNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags ); + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return NULL; + } + return hNewWaitObject; } /***********************************************************************
1
0
0
0
Rob Shearman : svchost: Add a FIXME for an undocumented function ( SvchostPushServiceGlobals) that some native services expect to be called by native svchost.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: 3a0e472ada2b893cea31434ecc776452ed096a25 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a0e472ada2b893cea31434ec…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 17:23:36 2008 +0000 svchost: Add a FIXME for an undocumented function (SvchostPushServiceGlobals) that some native services expect to be called by native svchost. --- programs/svchost/svchost.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/programs/svchost/svchost.c b/programs/svchost/svchost.c index 43112f7..573a6a3 100644 --- a/programs/svchost/svchost.c +++ b/programs/svchost/svchost.c @@ -229,6 +229,12 @@ static BOOL AddServiceElem(LPWSTR service_name, goto cleanup; } + if (GetProcAddress(library, "SvchostPushServiceGlobals")) + { + WINE_FIXME("library %s expects undocumented SvchostPushServiceGlobals function to be called\n", + wine_dbgstr_w(dll_name_long)); + } + /* Fill in the service table entry */ service_table_entry->lpServiceName = service_name; service_table_entry->lpServiceProc = service_main_func;
1
0
0
0
Rob Shearman : ole32: Determine the destination for the COM call and initialise the necessary parameters in ClientRpcChannelBuffer_GetBuffer instead of ClientRpcChannelBuffer_SendReceive .
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: d84f0abb70c9e53f9d7fecdaefd206aafa906faf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d84f0abb70c9e53f9d7fecdae…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 16:25:39 2008 +0000 ole32: Determine the destination for the COM call and initialise the necessary parameters in ClientRpcChannelBuffer_GetBuffer instead of ClientRpcChannelBuffer_SendReceive. The parameters are then freed in the matching ClientRpcChannelBuffer_FreeBuffer function. --- dlls/ole32/rpc.c | 125 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 73 insertions(+), 52 deletions(-) diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 9fbff88..fdb49cb 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -129,6 +129,8 @@ struct message_state SChannelHookCallInfo channel_hook_info; /* client only */ + HWND target_hwnd; + DWORD target_tid; struct dispatch_params params; }; @@ -562,6 +564,24 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, return HRESULT_FROM_WIN32(status); } +static HANDLE ClientRpcChannelBuffer_GetEventHandle(ClientRpcChannelBuffer *This) +{ + HANDLE event = InterlockedExchangePointer(&This->event, NULL); + + /* Note: must be auto-reset event so we can reuse it without a call + * to ResetEvent */ + if (!event) event = CreateEventW(NULL, FALSE, FALSE, NULL); + + return event; +} + +static void ClientRpcChannelBuffer_ReleaseEventHandle(ClientRpcChannelBuffer *This, HANDLE event) +{ + if (InterlockedCompareExchangePointer(&This->event, event, NULL)) + /* already a handle cached in This */ + CloseHandle(event); +} + static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, RPCOLEMESSAGE* olemsg, REFIID riid) { ClientRpcChannelBuffer *This = (ClientRpcChannelBuffer *)iface; @@ -574,6 +594,9 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, struct channel_hook_buffer_data *channel_hook_data; unsigned int channel_hook_count; ULONG extension_count; + IPID ipid; + HRESULT hr; + APARTMENT *apt = NULL; TRACE("(%p)->(%p,%s)\n", This, olemsg, debugstr_guid(riid)); @@ -597,12 +620,17 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, msg->Handle = This->bind; msg->RpcInterfaceInformation = cif; + message_state->prefix_data_len = 0; + message_state->binding_handle = This->bind; + message_state->channel_hook_info.iid = *riid; message_state->channel_hook_info.cbSize = sizeof(message_state->channel_hook_info); message_state->channel_hook_info.uCausality = COM_CurrentCausalityId(); message_state->channel_hook_info.dwServerPid = This->server_pid; message_state->channel_hook_info.iMethod = msg->ProcNum; message_state->channel_hook_info.pObject = NULL; /* only present on server-side */ + message_state->target_hwnd = NULL; + message_state->target_tid = 0; memset(&message_state->params, 0, sizeof(message_state->params)); extensions_size = ChannelHooks_ClientGetSize(&message_state->channel_hook_info, @@ -616,10 +644,40 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]); } + RpcBindingInqObject(message_state->binding_handle, &ipid); + hr = ipid_get_dispatch_params(&ipid, &apt, &message_state->params.stub, + &message_state->params.chan, + &message_state->params.iid, + &message_state->params.iface); + if (hr == S_OK) + { + /* stub, chan, iface and iid are unneeded in multi-threaded case as we go + * via the RPC runtime */ + if (apt->multi_threaded) + { + IRpcStubBuffer_Release(message_state->params.stub); + message_state->params.stub = NULL; + IRpcChannelBuffer_Release(message_state->params.chan); + message_state->params.chan = NULL; + message_state->params.iface = NULL; + } + else + { + message_state->target_hwnd = apartment_getwindow(apt); + message_state->target_tid = apt->tid; + /* we assume later on that this being non-NULL is the indicator that + * means call directly instead of going through RPC runtime */ + if (!message_state->target_hwnd) + ERR("window for apartment %s is NULL\n", wine_dbgstr_longlong(apt->oxid)); + } + } + if (apt) apartment_release(apt); + message_state->params.handle = ClientRpcChannelBuffer_GetEventHandle(This); + /* Note: message_state->params.msg is initialised in + * ClientRpcChannelBuffer_SendReceive */ + status = I_RpcGetBuffer(msg); - message_state->prefix_data_len = 0; - message_state->binding_handle = This->bind; msg->Handle = message_state; if (status == RPC_S_OK) @@ -682,24 +740,6 @@ static HRESULT WINAPI ServerRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac return E_NOTIMPL; } -static HANDLE ClientRpcChannelBuffer_GetEventHandle(ClientRpcChannelBuffer *This) -{ - HANDLE event = InterlockedExchangePointer(&This->event, NULL); - - /* Note: must be auto-reset event so we can reuse it without a call - * to ResetEvent */ - if (!event) event = CreateEventW(NULL, FALSE, FALSE, NULL); - - return event; -} - -static void ClientRpcChannelBuffer_ReleaseEventHandle(ClientRpcChannelBuffer *This, HANDLE event) -{ - if (InterlockedCompareExchangePointer(&This->event, event, NULL)) - /* already a handle cached in This */ - CloseHandle(event); -} - /* this thread runs an outgoing RPC */ static DWORD WINAPI rpc_sendreceive_thread(LPVOID param) { @@ -735,8 +775,6 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac RPC_MESSAGE *msg = (RPC_MESSAGE *)olemsg; RPC_STATUS status; DWORD index; - APARTMENT *apt = NULL; - IPID ipid; struct message_state *message_state; ORPCTHAT orpcthat; ORPC_EXTENT_ARRAY orpc_ext_array; @@ -771,10 +809,6 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac msg->Buffer = (char *)msg->Buffer - message_state->prefix_data_len; msg->BufferLength += message_state->prefix_data_len; - message_state->params.msg = olemsg; - message_state->params.status = RPC_S_OK; - message_state->params.hr = S_OK; - /* Note: this is an optimization in the Microsoft OLE runtime that we need * to copy, as shown by the test_no_couninitialize_client test. without * short-circuiting the RPC runtime in the case below, the test will @@ -782,25 +816,16 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac * a thread to process the RPC when this function is called indirectly * from DllMain */ - RpcBindingInqObject(message_state->binding_handle, &ipid); - hr = ipid_get_dispatch_params(&ipid, &apt, &message_state->params.stub, - &message_state->params.chan, - &message_state->params.iid, - &message_state->params.iface); - message_state->params.handle = ClientRpcChannelBuffer_GetEventHandle(This); - if ((hr == S_OK) && !apt->multi_threaded) + message_state->params.msg = olemsg; + if (message_state->target_hwnd) { - TRACE("Calling apartment thread 0x%08x...\n", apt->tid); + TRACE("Calling apartment thread 0x%08x...\n", message_state->target_tid); - if (!PostMessageW(apartment_getwindow(apt), DM_EXECUTERPC, 0, + if (!PostMessageW(message_state->target_hwnd, DM_EXECUTERPC, 0, (LPARAM)&message_state->params)) { ERR("PostMessage failed with error %u\n", GetLastError()); - IRpcStubBuffer_Release(message_state->params.stub); - message_state->params.stub = NULL; - IRpcChannelBuffer_Release(message_state->params.chan); - message_state->params.chan = NULL; /* Note: message_state->params.iface doesn't have a reference and * so doesn't need to be released */ @@ -809,16 +834,6 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac } else { - if (hr == S_OK) - { - /* otherwise, we go via RPC runtime so the stub and channel aren't - * needed here */ - IRpcStubBuffer_Release(message_state->params.stub); - message_state->params.stub = NULL; - IRpcChannelBuffer_Release(message_state->params.chan); - message_state->params.chan = NULL; - } - /* we use a separate thread here because we need to be able to * pump the message loop in the application thread: if we do not, * any windows created by this thread will hang and RPCs that try @@ -833,7 +848,6 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac else hr = S_OK; } - if (apt) apartment_release(apt); if (hr == S_OK) { @@ -950,6 +964,11 @@ static HRESULT WINAPI ClientRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface HeapFree(GetProcessHeap(), 0, msg->RpcInterfaceInformation); msg->RpcInterfaceInformation = NULL; + + if (message_state->params.stub) + IRpcStubBuffer_Release(message_state->params.stub); + if (message_state->params.chan) + IRpcChannelBuffer_Release(message_state->params.chan); HeapFree(GetProcessHeap(), 0, message_state); TRACE("-- %ld\n", status); @@ -1344,8 +1363,6 @@ exit_reset_state: exit: HeapFree(GetProcessHeap(), 0, message_state); - IRpcStubBuffer_Release(params->stub); - IRpcChannelBuffer_Release(params->chan); if (params->handle) SetEvent(params->handle); } @@ -1418,6 +1435,10 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg) } hr = params->hr; + if (params->chan) + IRpcChannelBuffer_Release(params->chan); + if (params->stub) + IRpcStubBuffer_Release(params->stub); HeapFree(GetProcessHeap(), 0, params); apartment_release(apt);
1
0
0
0
Rob Shearman : widl: Make the offset of conformant string types point to the start of the conformant string format chars , not the pointer type.
by Alexandre Julliard
07 Jan '08
07 Jan '08
Module: wine Branch: master Commit: 13f9c71960495c3696c40622653f9d59d18bd72c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13f9c71960495c3696c406226…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Fri Jan 4 16:24:42 2008 +0000 widl: Make the offset of conformant string types point to the start of the conformant string format chars, not the pointer type. Otherwise, writing a type at top-level could cause the pointer format string to be used in non-top-level places which may cause memory corruption during freeing. --- tools/widl/typegen.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index f40399f..55fb3fa 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1472,11 +1472,9 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, const char *name, unsigned int *typestring_offset, int toplevel) { - size_t start_offset = *typestring_offset; + size_t start_offset; unsigned char rtype; - update_tfsoff(type, start_offset, file); - if (toplevel && is_declptr(type)) { unsigned char flag = is_conformant_array(type) ? 0 : RPC_FC_P_SIMPLEPOINTER; @@ -1494,6 +1492,9 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, } } + start_offset = *typestring_offset; + update_tfsoff(type, start_offset, file); + rtype = type->ref->type; if ((rtype != RPC_FC_BYTE) && (rtype != RPC_FC_CHAR) && (rtype != RPC_FC_WCHAR)) @@ -2743,10 +2744,11 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func, } if ((phase == PHASE_FREE) || (pointer_type == RPC_FC_UP)) - print_phase_function(file, indent, "Pointer", phase, var, start_offset); + print_phase_function(file, indent, "Pointer", phase, var, + start_offset - (type->size_is ? 4 : 2)); else print_phase_function(file, indent, "ConformantString", phase, var, - start_offset + (type->size_is ? 4 : 2)); + start_offset); } } else if (is_array(type))
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
70
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Results per page:
10
25
50
100
200