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
July 2015
----- 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
2 participants
567 discussions
Start a n
N
ew thread
Michael Stefaniuc : qcap: Remove initialization code from QI of VfwCapture.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: 6984db834a0d9938a3ed83f0ab9f9783f5d0b4c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6984db834a0d9938a3ed83f0a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jul 27 09:26:56 2015 +0200 qcap: Remove initialization code from QI of VfwCapture. --- dlls/qcap/vfwcapture.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 7804a3d..67cc8f5 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -181,22 +181,6 @@ static HRESULT WINAPI VfwCapture_QueryInterface(IBaseFilter * iface, REFIID riid else if (IsEqualIID(riid, &IID_IPersistPropertyBag)) *ppv = &This->IPersistPropertyBag_iface; - if (!IsEqualIID(riid, &IID_IUnknown) && - !IsEqualIID(riid, &IID_IPersist) && - !IsEqualIID(riid, &IID_IPersistPropertyBag) && - !This->init) - { - FIXME("Capture system not initialised when looking for %s, " - "trying it on primary device now\n", debugstr_guid(riid)); - This->driver_info = qcap_driver_init( This->pOutputPin, 0 ); - if (!This->driver_info) - { - ERR("VfwCapture initialisation failed\n"); - return E_UNEXPECTED; - } - This->init = TRUE; - } - if (*ppv) { TRACE("Returning %s interface\n", debugstr_guid(riid));
1
0
0
0
Michael Stefaniuc : include: Add IAMVfwCaptureDialogs declaration.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: 7f1a5d46783861c5aa2975da6eedf1c9a0b0f7fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f1a5d46783861c5aa2975da6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jul 27 09:25:46 2015 +0200 include: Add IAMVfwCaptureDialogs declaration. --- include/axextend.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/axextend.idl b/include/axextend.idl index 207dbce..716740c 100644 --- a/include/axextend.idl +++ b/include/axextend.idl @@ -1258,3 +1258,23 @@ interface IAMGraphBuilderCallback : IUnknown HRESULT CreatedFilter( [in] IBaseFilter *pFil); }; + +[ + local, + object, + uuid(d8d715a0-6e5e-11d0-b3f0-00aa003761c5), + pointer_default(unique) +] +interface IAMVfwCaptureDialogs : IUnknown +{ + HRESULT HasDialog( + [in] int dialog); + HRESULT ShowDialog( + [in] int dialog, + [in] HWND hwnd); + HRESULT SendDriverMessage( + [in] int dialog, + [in] int msg, + [in] long data1, + [in] long data2); +};
1
0
0
0
Sebastian Lackner : ntdll: Reimplement RtlQueueWorkItem on top of new threadpool API.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: 9562e818101e67304c613dec922b86a793c26e59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9562e818101e67304c613dec9…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sun Jul 26 23:24:06 2015 +0200 ntdll: Reimplement RtlQueueWorkItem on top of new threadpool API. --- dlls/ntdll/threadpool.c | 143 +++++++++--------------------------------------- 1 file changed, 27 insertions(+), 116 deletions(-) diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 23091f3..ad4951f 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -42,44 +42,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(threadpool); * Old thread pooling API */ -#define OLD_WORKER_TIMEOUT 30000 /* 30 seconds */ +struct rtl_work_item +{ + PRTL_WORK_ITEM_ROUTINE function; + PVOID context; +}; + #define EXPIRE_NEVER (~(ULONGLONG)0) #define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ -static RTL_CRITICAL_SECTION_DEBUG critsect_debug; static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug; static struct { - /* threadpool_cs must be held while modifying the following four elements */ - struct list work_item_list; - LONG num_workers; - LONG num_busy_workers; - LONG num_items_processed; - RTL_CONDITION_VARIABLE threadpool_cond; - RTL_CRITICAL_SECTION threadpool_cs; HANDLE compl_port; RTL_CRITICAL_SECTION threadpool_compl_cs; } old_threadpool = { - LIST_INIT(old_threadpool.work_item_list), /* work_item_list */ - 0, /* num_workers */ - 0, /* num_busy_workers */ - 0, /* num_items_processed */ - RTL_CONDITION_VARIABLE_INIT, /* threadpool_cond */ - { &critsect_debug, -1, 0, 0, 0, 0 }, /* threadpool_cs */ NULL, /* compl_port */ { &critsect_compl_debug, -1, 0, 0, 0, 0 }, /* threadpool_compl_cs */ }; -static RTL_CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &old_threadpool.threadpool_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_cs") } -}; - static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug = { 0, 0, &old_threadpool.threadpool_compl_cs, @@ -87,13 +71,6 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_compl_debug = 0, 0, { (DWORD_PTR)(__FILE__ ": threadpool_compl_cs") } }; -struct work_item -{ - struct list entry; - PRTL_WORK_ITEM_ROUTINE function; - PVOID context; -}; - struct wait_work_item { HANDLE Object; @@ -364,47 +341,14 @@ static inline LONG interlocked_dec( PLONG dest ) return interlocked_xchg_add( dest, -1 ) - 1; } -static void WINAPI worker_thread_proc(void * param) +static void CALLBACK process_rtl_work_item( TP_CALLBACK_INSTANCE *instance, void *userdata ) { - struct list *item; - struct work_item *work_item_ptr, work_item; - LARGE_INTEGER timeout; - timeout.QuadPart = -(OLD_WORKER_TIMEOUT * (ULONGLONG)10000); - - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - old_threadpool.num_workers++; - - for (;;) - { - if ((item = list_head( &old_threadpool.work_item_list ))) - { - work_item_ptr = LIST_ENTRY( item, struct work_item, entry ); - list_remove( &work_item_ptr->entry ); - old_threadpool.num_busy_workers++; - old_threadpool.num_items_processed++; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - /* copy item to stack and do the work */ - work_item = *work_item_ptr; - RtlFreeHeap( GetProcessHeap(), 0, work_item_ptr ); - TRACE("executing %p(%p)\n", work_item.function, work_item.context); - work_item.function( work_item.context ); - - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - old_threadpool.num_busy_workers--; - } - else if (RtlSleepConditionVariableCS( &old_threadpool.threadpool_cond, - &old_threadpool.threadpool_cs, &timeout ) != STATUS_SUCCESS) - { - break; - } - } + struct rtl_work_item *item = userdata; - old_threadpool.num_workers--; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - RtlExitUserThread( 0 ); + TRACE("executing %p(%p)\n", item->function, item->context); + item->function( item->context ); - /* never reached */ + RtlFreeHeap( GetProcessHeap(), 0, item ); } /*********************************************************************** @@ -413,9 +357,9 @@ static void WINAPI worker_thread_proc(void * param) * Queues a work item into a thread in the thread pool. * * PARAMS - * Function [I] Work function to execute. - * Context [I] Context to pass to the work function when it is executed. - * Flags [I] Flags. See notes. + * function [I] Work function to execute. + * context [I] Context to pass to the work function when it is executed. + * flags [I] Flags. See notes. * * RETURNS * Success: STATUS_SUCCESS. @@ -429,59 +373,26 @@ static void WINAPI worker_thread_proc(void * param) *|WT_EXECUTELONGFUNCTION - Hints that the execution can take a long time. *|WT_TRANSFER_IMPERSONATION - Executes the function with the current access token. */ -NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE Function, PVOID Context, ULONG Flags) +NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context, ULONG flags ) { - HANDLE thread; + TP_CALLBACK_ENVIRON environment; + struct rtl_work_item *item; NTSTATUS status; - LONG items_processed; - struct work_item *work_item = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(struct work_item)); - if (!work_item) + item = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*item) ); + if (!item) return STATUS_NO_MEMORY; - work_item->function = Function; - work_item->context = Context; - - if (Flags & ~WT_EXECUTELONGFUNCTION) - FIXME("Flags 0x%x not supported\n", Flags); - - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - list_add_tail( &old_threadpool.work_item_list, &work_item->entry ); - status = (old_threadpool.num_workers > old_threadpool.num_busy_workers) ? - STATUS_SUCCESS : STATUS_UNSUCCESSFUL; - items_processed = old_threadpool.num_items_processed; - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - /* FIXME: tune this algorithm to not be as aggressive with creating threads - * if WT_EXECUTELONGFUNCTION isn't specified */ - if (status == STATUS_SUCCESS) - RtlWakeConditionVariable( &old_threadpool.threadpool_cond ); - else - { - status = RtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, NULL, 0, 0, - worker_thread_proc, NULL, &thread, NULL ); + memset( &environment, 0, sizeof(environment) ); + environment.Version = 1; + environment.u.s.LongFunction = (flags & WT_EXECUTELONGFUNCTION) != 0; + environment.u.s.Persistent = (flags & WT_EXECUTEINPERSISTENTTHREAD) != 0; - /* NOTE: we don't care if we couldn't create the thread if there is at - * least one other available to process the request */ - if (status == STATUS_SUCCESS) - NtClose( thread ); - else - { - RtlEnterCriticalSection( &old_threadpool.threadpool_cs ); - if (old_threadpool.num_workers > 0 || - old_threadpool.num_items_processed != items_processed) - { - status = STATUS_SUCCESS; - } - else - list_remove( &work_item->entry ); - RtlLeaveCriticalSection( &old_threadpool.threadpool_cs ); - - if (status != STATUS_SUCCESS) - RtlFreeHeap( GetProcessHeap(), 0, work_item ); - } - } + item->function = function; + item->context = context; + status = TpSimpleTryPost( process_rtl_work_item, item, &environment ); + if (status) RtlFreeHeap( GetProcessHeap(), 0, item ); return status; }
1
0
0
0
Sebastian Lackner : ntdll/tests: Add basic tests for RtlQueueWorkItem.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: c774a8c3ae89959be5798554cb60cb52dbfe1723 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c774a8c3ae89959be5798554c…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sun Jul 26 23:23:57 2015 +0200 ntdll/tests: Add basic tests for RtlQueueWorkItem. --- dlls/ntdll/tests/threadpool.c | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index c69902b..7be3f0d 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -98,6 +98,51 @@ static BOOL init_threadpool(void) #undef NTDLL_GET_PROC +static DWORD CALLBACK rtl_work_cb(void *userdata) +{ + HANDLE semaphore = userdata; + trace("Running rtl_work callback\n"); + ReleaseSemaphore(semaphore, 1, NULL); + return 0; +} + +static void test_RtlQueueWorkItem(void) +{ + HANDLE semaphore; + NTSTATUS status; + DWORD result; + + semaphore = CreateSemaphoreA(NULL, 0, 1, NULL); + ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEDEFAULT); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINIOTHREAD); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTEINPERSISTENTTHREAD); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_EXECUTELONGFUNCTION); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + status = RtlQueueWorkItem(rtl_work_cb, semaphore, WT_TRANSFER_IMPERSONATION); + ok(!status, "RtlQueueWorkItem failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + CloseHandle(semaphore); +} + static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) { HANDLE semaphore = userdata; @@ -1292,6 +1337,8 @@ static void test_tp_multi_wait(void) START_TEST(threadpool) { + test_RtlQueueWorkItem(); + if (!init_threadpool()) return;
1
0
0
0
Jacek Caban : widl: Don' t output C++ default value if the argument is followed by another without default value.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: dd58fcc10edb1d3b9d96151cded067e1631a54ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd58fcc10edb1d3b9d96151cd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 26 18:07:37 2015 +0200 widl: Don't output C++ default value if the argument is followed by another without default value. --- tools/widl/header.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index c23faf4..bf824d8 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -937,8 +937,18 @@ void write_args(FILE *h, const var_list_t *args, const char *name, int method, i if (method == 2) { const expr_t *expr = get_attrp(arg->attrs, ATTR_DEFAULTVALUE); if (expr) { - fprintf(h, " = "); - write_expr( h, expr, 0, 1, NULL, NULL, "" ); + const var_t *tail_arg; + + /* Output default value only if all following arguments also have default value. */ + LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) { + if(tail_arg == arg) { + fprintf(h, " = "); + write_expr( h, expr, 0, 1, NULL, NULL, "" ); + break; + } + if(!get_attrp(tail_arg->attrs, ATTR_DEFAULTVALUE)) + break; + } } } count++;
1
0
0
0
Hans Leidekker : netapi32: Implement DavGetHTTPFromUNCPath.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: 2e9a2d80626757b51357d83c4b702939752b74ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e9a2d80626757b51357d83c4…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jul 24 10:35:07 2015 +0200 netapi32: Implement DavGetHTTPFromUNCPath. --- dlls/netapi32/netapi32.c | 90 ++++++++++++++++++ dlls/netapi32/netapi32.spec | 1 + dlls/netapi32/tests/access.c | 218 +++++++++++++++++++++++++++++++++++++++++-- include/davclnt.h | 1 + 4 files changed, 301 insertions(+), 9 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2e9a2d80626757b51357d…
1
0
0
0
Hans Leidekker : netprofm: Improve the stub for INetworkCostManager:: GetDataPlanStatus.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: be7373f76420f93e19a265cd268911a3628af704 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be7373f76420f93e19a265cd2…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jul 24 10:34:36 2015 +0200 netprofm: Improve the stub for INetworkCostManager::GetDataPlanStatus. --- dlls/netprofm/Makefile.in | 1 + dlls/netprofm/list.c | 63 +++++++++++++++++++++++++++++++++++++++++++++- dlls/netprofm/tests/list.c | 7 ++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/dlls/netprofm/Makefile.in b/dlls/netprofm/Makefile.in index 4dadfb0..def2614 100644 --- a/dlls/netprofm/Makefile.in +++ b/dlls/netprofm/Makefile.in @@ -1,4 +1,5 @@ MODULE = netprofm.dll +IMPORTS = iphlpapi C_SRCS = \ list.c \ diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c index 842f335..1808178 100644 --- a/dlls/netprofm/list.c +++ b/dlls/netprofm/list.c @@ -23,6 +23,12 @@ #include <stdarg.h> #include "windef.h" #include "winbase.h" +#define USE_WS_PREFIX +#include "winsock2.h" +#include "ws2ipdef.h" +#include "iphlpapi.h" +#include "ifdef.h" +#include "netioapi.h" #include "initguid.h" #include "objbase.h" #include "ocidl.h" @@ -240,12 +246,67 @@ static HRESULT WINAPI cost_manager_GetCost( return S_OK; } +static BOOL map_address_6to4( const SOCKADDR_IN6 *addr6, SOCKADDR_IN *addr4 ) +{ + ULONG i; + + if (addr6->sin6_family != WS_AF_INET6) return FALSE; + + for (i = 0; i < 5; i++) + if (addr6->sin6_addr.u.Word[i]) return FALSE; + + if (addr6->sin6_addr.u.Word[5] != 0xffff) return FALSE; + + addr4->sin_family = WS_AF_INET; + addr4->sin_port = addr6->sin6_port; + addr4->sin_addr.S_un.S_addr = addr6->sin6_addr.u.Word[6] << 16 | addr6->sin6_addr.u.Word[7]; + memset( &addr4->sin_zero, 0, sizeof(addr4->sin_zero) ); + + return TRUE; +} + static HRESULT WINAPI cost_manager_GetDataPlanStatus( INetworkCostManager *iface, NLM_DATAPLAN_STATUS *pDataPlanStatus, NLM_SOCKADDR *pDestIPAddr) { + DWORD ret, index; + NET_LUID luid; + SOCKADDR *dst = (SOCKADDR *)pDestIPAddr; + SOCKADDR_IN addr4, *dst4; + FIXME( "%p, %p, %p\n", iface, pDataPlanStatus, pDestIPAddr ); - return E_NOTIMPL; + + if (!pDataPlanStatus) return E_POINTER; + + if (dst && ((dst->sa_family == WS_AF_INET && (dst4 = (SOCKADDR_IN *)dst)) || + ((dst->sa_family == WS_AF_INET6 && map_address_6to4( (const SOCKADDR_IN6 *)dst, &addr4 ) + && (dst4 = &addr4))))) + { + if ((ret = GetBestInterface( dst4->sin_addr.S_un.S_addr, &index ))) + return HRESULT_FROM_WIN32( ret ); + + if ((ret = ConvertInterfaceIndexToLuid( index, &luid ))) + return HRESULT_FROM_WIN32( ret ); + + if ((ret = ConvertInterfaceLuidToGuid( &luid, &pDataPlanStatus->InterfaceGuid ))) + return HRESULT_FROM_WIN32( ret ); + } + else + { + FIXME( "interface guid not found\n" ); + memset( &pDataPlanStatus->InterfaceGuid, 0, sizeof(pDataPlanStatus->InterfaceGuid) ); + } + + pDataPlanStatus->UsageData.UsageInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->UsageData.LastSyncTime, 0, sizeof(pDataPlanStatus->UsageData.LastSyncTime) ); + pDataPlanStatus->DataLimitInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->InboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->OutboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->NextBillingCycle, 0, sizeof(pDataPlanStatus->NextBillingCycle) ); + pDataPlanStatus->MaxTransferSizeInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->Reserved = 0; + + return S_OK; } static HRESULT WINAPI cost_manager_SetDestinationAddresses( diff --git a/dlls/netprofm/tests/list.c b/dlls/netprofm/tests/list.c index 7776f5c..7e885c3 100644 --- a/dlls/netprofm/tests/list.c +++ b/dlls/netprofm/tests/list.c @@ -67,6 +67,7 @@ static void test_INetworkListManager( void ) if (hr == S_OK) { DWORD cost; + NLM_DATAPLAN_STATUS status; hr = INetworkCostManager_GetCost( cost_mgr, NULL, NULL ); ok( hr == E_POINTER, "got %08x\n", hr ); @@ -76,6 +77,12 @@ static void test_INetworkListManager( void ) ok( hr == S_OK, "got %08x\n", hr ); ok( cost != 0xdeadbeef, "cost not set\n" ); + hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, NULL, NULL ); + ok( hr == E_POINTER, "got %08x\n", hr ); + + hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, &status, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + INetworkCostManager_Release( cost_mgr ); }
1
0
0
0
Hans Leidekker : netprofm: Create a connection point object for INetworkCostManagerEvents.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: c42f38fd17a954337b77cc6aaea187107599a4cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c42f38fd17a954337b77cc6aa…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jul 24 10:34:15 2015 +0200 netprofm: Create a connection point object for INetworkCostManagerEvents. --- dlls/netprofm/list.c | 3 ++- dlls/netprofm/tests/list.c | 6 +++++- include/netlistmgr.idl | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c index 783b9cd..842f335 100644 --- a/dlls/netprofm/list.c +++ b/dlls/netprofm/list.c @@ -489,7 +489,8 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo if (!riid || !cp) return E_POINTER; - if (IsEqualGUID( riid, &IID_INetworkListManagerEvents )) + if (IsEqualGUID( riid, &IID_INetworkListManagerEvents ) || + IsEqualGUID( riid, &IID_INetworkCostManagerEvents )) return connection_point_create( cp, riid, iface ); FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); diff --git a/dlls/netprofm/tests/list.c b/dlls/netprofm/tests/list.c index 06a8086..7776f5c 100644 --- a/dlls/netprofm/tests/list.c +++ b/dlls/netprofm/tests/list.c @@ -103,8 +103,12 @@ static void test_INetworkListManager( void ) ok( hr == S_OK, "got %08x\n", hr ); ok( !memcmp( &iid, &IID_INetworkListManagerEvents, sizeof(iid) ), "Expected iid to be IID_INetworkListManagerEvents\n" ); - IConnectionPoint_Release( pt ); + + hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkCostManagerEvents, &pt ); + ok( hr == S_OK || hr == CO_E_FAILEDTOIMPERSONATE, "got %08x\n", hr ); + if (hr == S_OK) IConnectionPoint_Release( pt ); + IConnectionPointContainer_Release( cpc ); INetworkListManager_Release( mgr ); } diff --git a/include/netlistmgr.idl b/include/netlistmgr.idl index 5d2c811..fd3ef77 100644 --- a/include/netlistmgr.idl +++ b/include/netlistmgr.idl @@ -68,6 +68,8 @@ typedef struct NLM_SOCKADDR BYTE data[128]; } NLM_SOCKADDR; +const UINT32 NLM_UNKNOWN_DATAPLAN_STATUS = 0xffffffff; + typedef struct NLM_USAGE_DATA { DWORD UsageInMegabytes; @@ -108,6 +110,21 @@ interface INetworkCostManager : IUnknown } [ + object, + pointer_default(unique), + uuid(dcb00009-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkCostManagerEvents : IUnknown +{ + HRESULT CostChanged( + [in] DWORD newCost, + [in, unique] NLM_SOCKADDR *pDestAddr); + + HRESULT DataPlanStatusChanged( + [in, unique] NLM_SOCKADDR *pDestAddr); +} + +[ dual, object, oleautomation,
1
0
0
0
Nikolay Sivov : user32: Don't send WM_GETTEXT from GetWindowText() with invalid buffer length.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: 516b21f4eec17beaf59412756a6436c242b90441 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=516b21f4eec17beaf59412756…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 23 22:31:07 2015 +0300 user32: Don't send WM_GETTEXT from GetWindowText() with invalid buffer length. --- dlls/user32/tests/win.c | 13 ++----------- dlls/user32/win.c | 12 ++++-------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 309b699..9f6c224 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -722,7 +722,6 @@ static struct wm_gettext_override_data BOOL enabled; /* when 1 bypasses default procedure */ char *buff; /* expected text buffer pointer */ WCHAR *buffW; /* same, for W test */ - int len; } g_wm_gettext_override; static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) @@ -810,8 +809,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR { char *text = (char*)lparam; ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text); - if (g_wm_gettext_override.len) - ok(*text == 0, "expected empty string buffer %x\n", *text); + ok(*text == 0, "expected empty string buffer %x\n", *text); return 0; } break; @@ -833,8 +831,7 @@ static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPAR { WCHAR *text = (WCHAR*)lparam; ok(g_wm_gettext_override.buffW == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buffW, text); - if (g_wm_gettext_override.len) - ok(*text == 0, "expected empty string buffer %x\n", *text); + ok(*text == 0, "expected empty string buffer %x\n", *text); return 0; } break; @@ -5819,7 +5816,6 @@ static void test_gettext(void) num_gettext_msgs = 0; memset( buf, 0xcc, sizeof(buf) ); g_wm_gettext_override.buff = buf; - g_wm_gettext_override.len = sizeof(buf); buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) ); ok( buf_len == 0, "got %d\n", buf_len ); ok( *buf == 0, "got %x\n", *buf ); @@ -5828,11 +5824,9 @@ static void test_gettext(void) num_gettext_msgs = 0; strcpy( buf, "blah" ); g_wm_gettext_override.buff = buf; - g_wm_gettext_override.len = 0; buf_len = GetWindowTextA( hwnd, buf, 0 ); ok( buf_len == 0, "got %d\n", buf_len ); ok( !strcmp(buf, "blah"), "got %s\n", buf ); -todo_wine ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); g_wm_gettext_override.enabled = FALSE; @@ -5846,7 +5840,6 @@ todo_wine num_gettext_msgs = 0; memset( bufW, 0xcc, sizeof(bufW) ); g_wm_gettext_override.buffW = bufW; - g_wm_gettext_override.len = sizeof(bufW)/sizeof(WCHAR); buf_len = GetWindowTextW( hwnd2, bufW, sizeof(bufW)/sizeof(WCHAR) ); ok( buf_len == 0, "got %d\n", buf_len ); ok( *bufW == 0, "got %x\n", *bufW ); @@ -5855,11 +5848,9 @@ todo_wine num_gettext_msgs = 0; memset( bufW, 0xcc, sizeof(bufW) ); g_wm_gettext_override.buffW = bufW; - g_wm_gettext_override.len = 0; buf_len = GetWindowTextW( hwnd2, bufW, 0 ); ok( buf_len == 0, "got %d\n", buf_len ); ok( *bufW == 0xcccc, "got %x\n", *bufW ); -todo_wine ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); g_wm_gettext_override.enabled = FALSE; diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 91f1871..e3650f5 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2676,17 +2676,15 @@ INT WINAPI GetWindowTextA( HWND hwnd, LPSTR lpString, INT nMaxCount ) { WCHAR *buffer; - if (!lpString) return 0; + if (!lpString || nMaxCount <= 0) return 0; if (WIN_IsCurrentProcess( hwnd )) { - if (nMaxCount > 0) - lpString[0] = 0; + lpString[0] = 0; return (INT)SendMessageA( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); } /* when window belongs to other process, don't send a message */ - if (nMaxCount <= 0) return 0; if (!(buffer = HeapAlloc( GetProcessHeap(), 0, nMaxCount * sizeof(WCHAR) ))) return 0; get_server_window_text( hwnd, buffer, nMaxCount ); if (!WideCharToMultiByte( CP_ACP, 0, buffer, -1, lpString, nMaxCount, NULL, NULL )) @@ -2725,17 +2723,15 @@ INT WINAPI InternalGetWindowText(HWND hwnd,LPWSTR lpString,INT nMaxCount ) */ INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount ) { - if (!lpString) return 0; + if (!lpString || nMaxCount <= 0) return 0; if (WIN_IsCurrentProcess( hwnd )) { - if (nMaxCount > 0) - lpString[0] = 0; + lpString[0] = 0; return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); } /* when window belongs to other process, don't send a message */ - if (nMaxCount <= 0) return 0; get_server_window_text( hwnd, lpString, nMaxCount ); return strlenW(lpString); }
1
0
0
0
Nikolay Sivov : user32: Initialize buffer before sending WM_GETTEXT.
by Alexandre Julliard
28 Jul '15
28 Jul '15
Module: wine Branch: master Commit: ee72b0fdc7ada3a9f83650bd5db996b14ac98c4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee72b0fdc7ada3a9f83650bd5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 23 22:30:41 2015 +0300 user32: Initialize buffer before sending WM_GETTEXT. --- dlls/user32/tests/win.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++- dlls/user32/win.c | 8 ++++ 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 689f0a2..309b699 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -717,6 +717,14 @@ static void test_enum_thread_windows(void) CloseHandle( handle ); } +static struct wm_gettext_override_data +{ + BOOL enabled; /* when 1 bypasses default procedure */ + char *buff; /* expected text buffer pointer */ + WCHAR *buffW; /* same, for W test */ + int len; +} g_wm_gettext_override; + static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -798,6 +806,14 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR break; case WM_GETTEXT: num_gettext_msgs++; + if (g_wm_gettext_override.enabled) + { + char *text = (char*)lparam; + ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text); + if (g_wm_gettext_override.len) + ok(*text == 0, "expected empty string buffer %x\n", *text); + return 0; + } break; case WM_SETTEXT: num_settext_msgs++; @@ -807,6 +823,26 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR return DefWindowProcA(hwnd, msg, wparam, lparam); } +static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_GETTEXT: + num_gettext_msgs++; + if (g_wm_gettext_override.enabled) + { + WCHAR *text = (WCHAR*)lparam; + ok(g_wm_gettext_override.buffW == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buffW, text); + if (g_wm_gettext_override.len) + ok(*text == 0, "expected empty string buffer %x\n", *text); + return 0; + } + break; + } + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -832,8 +868,11 @@ static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR return DefWindowProcA(hwnd, msg, wparam, lparam); } +static const WCHAR mainclassW[] = {'M','a','i','n','W','i','n','d','o','w','C','l','a','s','s','W',0}; + static BOOL RegisterWindowClasses(void) { + WNDCLASSW clsW; WNDCLASSA cls; cls.style = CS_DBLCLKS; @@ -849,6 +888,19 @@ static BOOL RegisterWindowClasses(void) if(!RegisterClassA(&cls)) return FALSE; + clsW.style = CS_DBLCLKS; + clsW.lpfnWndProc = main_window_procW; + clsW.cbClsExtra = 0; + clsW.cbWndExtra = 0; + clsW.hInstance = GetModuleHandleA(0); + clsW.hIcon = 0; + clsW.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + clsW.hbrBackground = GetStockObject(WHITE_BRUSH); + clsW.lpszMenuName = NULL; + clsW.lpszClassName = mainclassW; + + if(!RegisterClassW(&clsW)) return FALSE; + cls.style = 0; cls.lpfnWndProc = tool_window_procA; cls.cbClsExtra = 0; @@ -5726,11 +5778,12 @@ static DWORD CALLBACK settext_msg_thread( LPVOID arg ) static void test_gettext(void) { DWORD tid, num_msgs; + WCHAR bufW[32]; HANDLE thread; BOOL success; char buf[32]; INT buf_len; - HWND hwnd; + HWND hwnd, hwnd2; LRESULT r; MSG msg; @@ -5745,6 +5798,74 @@ static void test_gettext(void) ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf ); ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + /* other process window */ + strcpy( buf, "a" ); + buf_len = GetWindowTextA( GetDesktopWindow(), buf, sizeof(buf) ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( *buf == 0, "got wrong window text '%s'\n", buf ); + + strcpy( buf, "blah" ); + buf_len = GetWindowTextA( GetDesktopWindow(), buf, 0 ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( !strcmp(buf, "blah"), "got wrong window text '%s'\n", buf ); + + bufW[0] = 0xcc; + buf_len = GetWindowTextW( GetDesktopWindow(), bufW, 0 ); + ok( buf_len == 0, "expected a nonempty window text\n" ); + ok( bufW[0] == 0xcc, "got %x\n", bufW[0] ); + + g_wm_gettext_override.enabled = TRUE; + + num_gettext_msgs = 0; + memset( buf, 0xcc, sizeof(buf) ); + g_wm_gettext_override.buff = buf; + g_wm_gettext_override.len = sizeof(buf); + buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *buf == 0, "got %x\n", *buf ); + ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + num_gettext_msgs = 0; + strcpy( buf, "blah" ); + g_wm_gettext_override.buff = buf; + g_wm_gettext_override.len = 0; + buf_len = GetWindowTextA( hwnd, buf, 0 ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( !strcmp(buf, "blah"), "got %s\n", buf ); +todo_wine + ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + g_wm_gettext_override.enabled = FALSE; + + /* same for W window */ + hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() ); + + g_wm_gettext_override.enabled = TRUE; + + num_gettext_msgs = 0; + memset( bufW, 0xcc, sizeof(bufW) ); + g_wm_gettext_override.buffW = bufW; + g_wm_gettext_override.len = sizeof(bufW)/sizeof(WCHAR); + buf_len = GetWindowTextW( hwnd2, bufW, sizeof(bufW)/sizeof(WCHAR) ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *bufW == 0, "got %x\n", *bufW ); + ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + num_gettext_msgs = 0; + memset( bufW, 0xcc, sizeof(bufW) ); + g_wm_gettext_override.buffW = bufW; + g_wm_gettext_override.len = 0; + buf_len = GetWindowTextW( hwnd2, bufW, 0 ); + ok( buf_len == 0, "got %d\n", buf_len ); + ok( *bufW == 0xcccc, "got %x\n", *bufW ); +todo_wine + ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + + g_wm_gettext_override.enabled = FALSE; + + DestroyWindow( hwnd2 ); + /* test WM_GETTEXT */ num_gettext_msgs = 0; memset( buf, 0, sizeof(buf) ); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 7a3f484..91f1871 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2679,7 +2679,11 @@ INT WINAPI GetWindowTextA( HWND hwnd, LPSTR lpString, INT nMaxCount ) if (!lpString) return 0; if (WIN_IsCurrentProcess( hwnd )) + { + if (nMaxCount > 0) + lpString[0] = 0; return (INT)SendMessageA( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); + } /* when window belongs to other process, don't send a message */ if (nMaxCount <= 0) return 0; @@ -2724,7 +2728,11 @@ INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount ) if (!lpString) return 0; if (WIN_IsCurrentProcess( hwnd )) + { + if (nMaxCount > 0) + lpString[0] = 0; return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString ); + } /* when window belongs to other process, don't send a message */ if (nMaxCount <= 0) return 0;
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
57
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
Results per page:
10
25
50
100
200