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
April 2007
----- 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
4 participants
687 discussions
Start a n
N
ew thread
Chris Robinson : quartz: Tell filters to stop sending data when the chain is broken.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 30abd4ed155730b534897e05cec9a44454e4e05a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=30abd4ed155730b534897e05c…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Apr 3 11:04:59 2007 -0700 quartz: Tell filters to stop sending data when the chain is broken. --- dlls/quartz/pin.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 6791c2d..48cedfc 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -913,7 +913,10 @@ HRESULT OutputPin_SendSample(OutputPin * This, IMediaSample * pSample) * then it causes some problems (most notably with the native Video * Renderer) if we are re-entered for whatever reason */ hr = IMemInputPin_Receive(pMemConnected, pSample); - IBaseFilter_Release(pinInfo.pFilter); + + /* If the filter's destroyed, tell upstream to stop sending data */ + if(IBaseFilter_Release(pinInfo.pFilter) == 0 && SUCCEEDED(hr)) + hr = S_FALSE; } if (pMemConnected) IMemInputPin_Release(pMemConnected);
1
0
0
0
Chris Robinson : quartz: Don' t call ReleaseSemaphore on NULL semaphore handles.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 9d41c2e694760e34becadae0d8df34d59db8c7c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d41c2e694760e34becadae0d…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Wed Apr 4 05:07:31 2007 -0700 quartz: Don't call ReleaseSemaphore on NULL semaphore handles. --- dlls/quartz/memallocator.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index 9167990..3cabe12 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -394,7 +394,7 @@ static HRESULT WINAPI BaseMemAllocator_ReleaseBuffer(IMemAllocator * iface, IMed LeaveCriticalSection(&This->csState); /* notify a waiting thread that there is now a free buffer */ - if (!ReleaseSemaphore(This->hSemWaiting, 1, NULL)) + if (This->hSemWaiting && !ReleaseSemaphore(This->hSemWaiting, 1, NULL)) { ERR("ReleaseSemaphore failed with error %u\n", GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
1
0
0
0
Chris Robinson : quartz: Implement Get/SetSyncSource for the FilterGraph' s IMediaFilter interface.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: f9527e9ce8b2ac0d2e36c05921c6df2c9e9dee23 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9527e9ce8b2ac0d2e36c0592…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Apr 3 10:44:41 2007 -0700 quartz: Implement Get/SetSyncSource for the FilterGraph's IMediaFilter interface. --- dlls/quartz/filtergraph.c | 61 ++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 5964502..8f87870 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -181,6 +181,7 @@ typedef struct _IFilterGraphImpl { int nFilters; int filterCapacity; long nameIndex; + IReferenceClock *refClock; EventsQueue evqueue; HANDLE hEventCompletion; int CompletionStatus; @@ -263,8 +264,15 @@ static ULONG Filtergraph_Release(IFilterGraphImpl *This) { if (ref == 0) { int i; + + if (This->refClock) + IReferenceClock_Release(This->refClock); + for (i = 0; i < This->nFilters; i++) + { + IBaseFilter_SetSyncSource(This->ppFiltersInGraph[i], NULL); IBaseFilter_Release(This->ppFiltersInGraph[i]); + } for (i = 0; i < This->nItfCacheEntries; i++) IUnknown_Release(This->ItfCacheEntries[i].iface); IFilterMapper2_Release(This->pFilterMapper2); @@ -392,6 +400,7 @@ static HRESULT WINAPI GraphBuilder_AddFilter(IGraphBuilder *iface, This->ppFiltersInGraph[This->nFilters] = pFilter; This->pFilterNames[This->nFilters] = wszFilterName; This->nFilters++; + IBaseFilter_SetSyncSource(pFilter, This->refClock); } else CoTaskMemFree(wszFilterName); @@ -430,6 +439,7 @@ static HRESULT WINAPI GraphBuilder_RemoveFilter(IGraphBuilder *iface, hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]); if (SUCCEEDED(hr)) { + IBaseFilter_SetSyncSource(pFilter, NULL); IBaseFilter_Release(pFilter); CoTaskMemFree(This->pFilterNames[i]); memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i)); @@ -4253,16 +4263,58 @@ static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeou static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock) { - FIXME("(%p): stub\n", pClock); + ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface); + HRESULT hr = S_OK; + int i; - return E_NOTIMPL; + TRACE("(%p/%p)->(%p)\n", iface, This, pClock); + + EnterCriticalSection(&This->cs); + { + for (i = 0;i < This->nFilters;i++) + { + hr = IBaseFilter_SetSyncSource(This->ppFiltersInGraph[i], pClock); + if (FAILED(hr)) + break; + } + + if (FAILED(hr)) + { + for(;i >= 0;i--) + IBaseFilter_SetSyncSource(This->ppFiltersInGraph[i], This->refClock); + } + else + { + if (This->refClock) + IReferenceClock_Release(This->refClock); + This->refClock = pClock; + if (This->refClock) + IReferenceClock_AddRef(This->refClock); + } + } + LeaveCriticalSection(&This->cs); + + return hr; } static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock) { - FIXME("(%p): stub\n", ppClock); + ICOM_THIS_MULTI(IFilterGraphImpl, IMediaFilter_vtbl, iface); - return E_NOTIMPL; + TRACE("(%p/%p)->(%p)\n", iface, This, ppClock); + + if (!ppClock) + return E_POINTER; + + EnterCriticalSection(&This->cs); + { + *ppClock = This->refClock; + if (*ppClock) + IReferenceClock_AddRef(*ppClock); + } + LeaveCriticalSection(&This->cs); + + return S_OK; } static const IMediaFilterVtbl IMediaFilter_VTable = @@ -4535,6 +4587,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj) fimpl->nFilters = 0; fimpl->filterCapacity = 0; fimpl->nameIndex = 1; + fimpl->refClock = NULL; fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0); fimpl->HandleEcComplete = TRUE; fimpl->HandleEcRepaint = TRUE;
1
0
0
0
Alexandre Julliard : server: Use the standard file descriptor signal mechanism for directory changes.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: a8675531461c21aa8ae0dd43ff1dc403dbbedea5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8675531461c21aa8ae0dd43f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 19:54:33 2007 +0200 server: Use the standard file descriptor signal mechanism for directory changes. --- dlls/ntdll/directory.c | 9 -------- server/change.c | 50 +++-------------------------------------------- 2 files changed, 4 insertions(+), 55 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 50aaa27..ef6802b 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2178,15 +2178,6 @@ static void WINAPI read_changes_apc( void *user, PIO_STATUS_BLOCK iosb, ULONG st TRACE("%p %p %08x\n", info, iosb, status); - /* - * FIXME: race me! - * - * hEvent/hDir is set before the output buffer and iosb is updated. - * Since the thread that called NtNotifyChangeDirectoryFile is usually - * waiting, we'll be safe since we're called in that thread's context. - * If a different thread is waiting on our hEvent/hDir we're going to be - * in trouble... - */ SERVER_START_REQ( read_change ) { req->handle = info->FileHandle; diff --git a/server/change.c b/server/change.c index 30b7346..33034da 100644 --- a/server/change.c +++ b/server/change.c @@ -147,11 +147,9 @@ struct dir struct object obj; /* object header */ struct fd *fd; /* file descriptor to the directory */ struct list entry; /* entry in global change notifications list */ - struct event *event; unsigned int filter; /* notification filter */ int notified; /* SIGIO counter */ int want_data; /* return change data */ - long signaled; /* the file changed */ int subtree; /* do we want to watch subdirectories? */ struct list change_records; /* data for the change */ struct list in_entry; /* entry in the inode dirs list */ @@ -162,7 +160,6 @@ static struct fd *dir_get_fd( struct object *obj ); static unsigned int dir_map_access( struct object *obj, unsigned int access ); static void dir_dump( struct object *obj, int verbose ); static void dir_destroy( struct object *obj ); -static int dir_signaled( struct object *obj, struct thread *thread ); static const struct object_ops dir_ops = { @@ -170,7 +167,7 @@ static const struct object_ops dir_ops = dir_dump, /* dump */ add_queue, /* add_queue */ remove_queue, /* remove_queue */ - dir_signaled, /* signaled */ + default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */ dir_get_fd, /* get_fd */ @@ -254,15 +251,7 @@ static void dir_dump( struct object *obj, int verbose ) { struct dir *dir = (struct dir *)obj; assert( obj->ops == &dir_ops ); - fprintf( stderr, "Dirfile fd=%p event=%p filter=%08x\n", - dir->fd, dir->event, dir->filter ); -} - -static int dir_signaled( struct object *obj, struct thread *thread ) -{ - struct dir *dir = (struct dir *)obj; - assert (obj->ops == &dir_ops); - return (dir->event == NULL) && dir->signaled; + fprintf( stderr, "Dirfile fd=%p filter=%08x\n", dir->fd, dir->filter ); } /* enter here directly from SIGIO signal handler */ @@ -279,11 +268,6 @@ void do_change_notify( int unix_fd ) } } -static void dir_signal_changed( struct dir *dir ) -{ - if (!dir->event) wake_up( &dir->obj, 0 ); -} - /* SIGIO callback, called synchronously with the poll loop */ void sigio_callback(void) { @@ -291,13 +275,8 @@ void sigio_callback(void) LIST_FOR_EACH_ENTRY( dir, &change_list, struct dir, entry ) { - long count = interlocked_xchg( &dir->notified, 0 ); - if (count) - { - dir->signaled += count; - if (dir->signaled == count) /* was it 0? */ - dir_signal_changed( dir ); - } + if (interlocked_xchg( &dir->notified, 0 )) + fd_async_wake_up( dir->fd, ASYNC_TYPE_WAIT, STATUS_NOTIFY_ENUM_DIR ); } } @@ -342,7 +321,6 @@ static void dir_destroy( struct object *obj ) while ((record = get_first_change_record( dir ))) free( record ); - if (dir->event) release_object( dir->event ); release_object( dir->fd ); if (inotify_fd && list_empty( &change_list )) @@ -1038,10 +1016,8 @@ struct object *create_dir_obj( struct fd *fd ) return NULL; list_init( &dir->change_records ); - dir->event = NULL; dir->filter = 0; dir->notified = 0; - dir->signaled = 0; dir->want_data = 0; dir->inode = NULL; grab_object( fd ); @@ -1056,7 +1032,6 @@ struct object *create_dir_obj( struct fd *fd ) /* enable change notifications for a directory */ DECL_HANDLER(read_directory_changes) { - struct event *event = NULL; struct dir *dir; struct async *async; @@ -1070,15 +1045,6 @@ DECL_HANDLER(read_directory_changes) if (!dir) return; - /* possibly send changes through an event flag */ - if (req->async.event && - !(event = get_event_obj( current->process, req->async.event, EVENT_MODIFY_STATE ))) - goto end; - - /* discard the current data, and move onto the next event */ - if (dir->event) release_object( dir->event ); - dir->event = event; - /* requests don't timeout */ if (!(async = fd_queue_async( dir->fd, &req->async, ASYNC_TYPE_WAIT, 0 ))) goto end; @@ -1092,10 +1058,6 @@ DECL_HANDLER(read_directory_changes) dir->want_data = req->want_data; } - /* remove any notifications */ - if (dir->signaled>0) - dir->signaled--; - /* if there's already a change in the queue, send it */ if (!list_empty( &dir->change_records )) fd_async_wake_up( dir->fd, ASYNC_TYPE_WAIT, STATUS_ALERTED ); @@ -1129,9 +1091,5 @@ DECL_HANDLER(read_change) else set_error( STATUS_NO_DATA_DETECTED ); - /* now signal it */ - dir->signaled++; - dir_signal_changed( dir ); - release_object( dir ); }
1
0
0
0
Alexandre Julliard : server: Fix the handling of the signaled status for file descriptors.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: ba896e75d7fce68e5183007b65eae7e35490ccd4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba896e75d7fce68e5183007b6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 19:39:29 2007 +0200 server: Fix the handling of the signaled status for file descriptors. File handles are signaled when an I/O operation completes, and reset when another operation is queued. --- server/async.c | 2 + server/fd.c | 58 ++++++++++---------------------------------------- server/file.c | 4 +- server/file.h | 3 +- server/mailslot.c | 4 +- server/named_pipe.c | 8 +++--- server/serial.c | 4 +- 7 files changed, 25 insertions(+), 58 deletions(-) diff --git a/server/async.c b/server/async.c index 027dd25..e0877b2 100644 --- a/server/async.c +++ b/server/async.c @@ -193,6 +193,7 @@ struct async *create_async( struct thread *thread, struct async_queue *queue, co list_add_tail( &queue->queue, &async->queue_entry ); grab_object( async ); + if (queue->fd) set_fd_signaled( queue->fd, 0 ); if (event) reset_event( event ); return async; } @@ -230,6 +231,7 @@ void async_set_result( struct object *obj, unsigned int status ) thread_queue_apc( async->thread, NULL, &data ); } if (async->event) set_event( async->event ); + else if (async->queue->fd) set_fd_signaled( async->queue->fd, 1 ); } } diff --git a/server/fd.c b/server/fd.c index 25917ae..3a044b2 100644 --- a/server/fd.c +++ b/server/fd.c @@ -168,6 +168,7 @@ struct fd unsigned int access; /* file access (FILE_READ_DATA etc.) */ unsigned int sharing; /* file sharing mode */ int unix_fd; /* unix file descriptor */ + int signaled :1; /* is the fd signaled? */ int fs_locks :1; /* can we use filesystem locks for this fd? */ int unmounted :1;/* has the device been unmounted? */ int poll_index; /* index of fd in poll array */ @@ -1360,6 +1361,7 @@ static struct fd *alloc_fd_object(void) fd->access = 0; fd->sharing = 0; fd->unix_fd = -1; + fd->signaled = 1; fd->fs_locks = 1; fd->unmounted = 0; fd->poll_index = -1; @@ -1391,6 +1393,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use fd->access = 0; fd->sharing = 0; fd->unix_fd = -1; + fd->signaled = 0; fd->fs_locks = 0; fd->unmounted = 0; fd->poll_index = -1; @@ -1610,6 +1613,13 @@ int is_fd_removable( struct fd *fd ) return (fd->inode && fd->inode->device->removable); } +/* set or clear the fd signaled state */ +void set_fd_signaled( struct fd *fd, int signaled ) +{ + fd->signaled = signaled; + if (signaled) wake_up( fd->user, 0 ); +} + /* handler for close_handle that refuses to close fd-associated handles in other processes */ int fd_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) { @@ -1635,55 +1645,11 @@ int check_fd_events( struct fd *fd, int events ) return pfd.revents; } -/* default add_queue() routine for objects that poll() on an fd */ -int default_fd_add_queue( struct object *obj, struct wait_queue_entry *entry ) -{ - struct fd *fd = get_obj_fd( obj ); - - if (!fd) return 0; - if (!fd->inode && list_empty( &obj->wait_queue )) /* first on the queue */ - set_fd_events( fd, fd->fd_ops->get_poll_events( fd ) ); - add_queue( obj, entry ); - release_object( fd ); - return 1; -} - -/* default remove_queue() routine for objects that poll() on an fd */ -void default_fd_remove_queue( struct object *obj, struct wait_queue_entry *entry ) -{ - struct fd *fd = get_obj_fd( obj ); - - grab_object( obj ); - remove_queue( obj, entry ); - if (!fd->inode && list_empty( &obj->wait_queue )) /* last on the queue is gone */ - set_fd_events( fd, 0 ); - release_object( obj ); - release_object( fd ); -} - /* default signaled() routine for objects that poll() on an fd */ int default_fd_signaled( struct object *obj, struct thread *thread ) { - int events, ret; struct fd *fd = get_obj_fd( obj ); - - if (fd->inode) ret = 1; /* regular files are always signaled */ - else - { - events = fd->fd_ops->get_poll_events( fd ); - ret = check_fd_events( fd, events ) != 0; - - if (ret) - { - /* stop waiting on select() if we are signaled */ - set_fd_events( fd, 0 ); - } - else if (!list_empty( &obj->wait_queue )) - { - /* restart waiting on poll() if we are no longer signaled */ - set_fd_events( fd, events ); - } - } + int ret = fd->signaled; release_object( fd ); return ret; } @@ -1705,7 +1671,7 @@ void default_poll_event( struct fd *fd, int event ) /* if an error occurred, stop polling this fd to avoid busy-looping */ if (event & (POLLERR | POLLHUP)) set_fd_events( fd, -1 ); - wake_up( fd->user, 0 ); + else set_fd_events( fd, fd->fd_ops->get_poll_events( fd ) ); } struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count ) diff --git a/server/file.c b/server/file.c index 5f5349d..edc92f7 100644 --- a/server/file.c +++ b/server/file.c @@ -76,8 +76,8 @@ static const struct object_ops file_ops = { sizeof(struct file), /* size */ file_dump, /* dump */ - default_fd_add_queue, /* add_queue */ - default_fd_remove_queue, /* remove_queue */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */ diff --git a/server/file.h b/server/file.h index 3514022..096b9df 100644 --- a/server/file.h +++ b/server/file.h @@ -63,9 +63,8 @@ extern int check_fd_events( struct fd *fd, int events ); extern void set_fd_events( struct fd *fd, int events ); extern obj_handle_t lock_fd( struct fd *fd, file_pos_t offset, file_pos_t count, int shared, int wait ); extern void unlock_fd( struct fd *fd, file_pos_t offset, file_pos_t count ); +extern void set_fd_signaled( struct fd *fd, int signaled ); -extern int default_fd_add_queue( struct object *obj, struct wait_queue_entry *entry ); -extern void default_fd_remove_queue( struct object *obj, struct wait_queue_entry *entry ); extern int default_fd_signaled( struct object *obj, struct thread *thread ); extern int default_fd_get_poll_events( struct fd *fd ); extern void default_poll_event( struct fd *fd, int event ); diff --git a/server/mailslot.c b/server/mailslot.c index 89af2bf..2898d1a 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -74,8 +74,8 @@ static const struct object_ops mailslot_ops = { sizeof(struct mailslot), /* size */ mailslot_dump, /* dump */ - default_fd_add_queue, /* add_queue */ - default_fd_remove_queue, /* remove_queue */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */ diff --git a/server/named_pipe.c b/server/named_pipe.c index 0a4ab96..a736d83 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -143,8 +143,8 @@ static const struct object_ops pipe_server_ops = { sizeof(struct pipe_server), /* size */ pipe_server_dump, /* dump */ - default_fd_add_queue, /* add_queue */ - default_fd_remove_queue, /* remove_queue */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */ @@ -177,8 +177,8 @@ static const struct object_ops pipe_client_ops = { sizeof(struct pipe_client), /* size */ pipe_client_dump, /* dump */ - default_fd_add_queue, /* add_queue */ - default_fd_remove_queue, /* remove_queue */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */ diff --git a/server/serial.c b/server/serial.c index f2b88c1..8dc1d18 100644 --- a/server/serial.c +++ b/server/serial.c @@ -89,8 +89,8 @@ static const struct object_ops serial_ops = { sizeof(struct serial), /* size */ serial_dump, /* dump */ - default_fd_add_queue, /* add_queue */ - default_fd_remove_queue, /* remove_queue */ + add_queue, /* add_queue */ + remove_queue, /* remove_queue */ default_fd_signaled, /* signaled */ no_satisfied, /* satisfied */ no_signal, /* signal */
1
0
0
0
Alexandre Julliard : winex11.drv: Store the display file descriptor directly in the server message queue.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 072698c9539f5420f0996a3c03ea5f379786578e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=072698c9539f5420f0996a3c0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 18:02:53 2007 +0200 winex11.drv: Store the display file descriptor directly in the server message queue. Get rid of a few WaitForMultipleObjectsEx hacks. --- dlls/user32/message.c | 3 +-- dlls/winex11.drv/event.c | 18 ++++++------------ dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/x11drv_main.c | 34 +++++++++++++++++++++++++++------- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index bde85d9..f612277 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3188,13 +3188,12 @@ DWORD WINAPI MsgWaitForMultipleObjectsEx( DWORD count, CONST HANDLE *pHandles, } SERVER_END_REQ; - /* Add the thread event to the handle list */ + /* add the queue to the handle list */ for (i = 0; i < count; i++) handles[i] = pHandles[i]; handles[count] = get_server_queue_handle(); ReleaseThunkLock( &lock ); ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count+1, handles, timeout, mask, flags ); - if (ret == count+1) ret = count; /* pretend the msg queue is ready */ if (lock) RestoreThunkLock( lock ); return ret; } diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 0ea1f9c..ab890e9 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -278,32 +278,26 @@ static int process_events( Display *display, ULONG_PTR mask ) DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags ) { - DWORD i, ret; + DWORD ret; struct x11drv_thread_data *data = TlsGetValue( thread_data_tls_index ); - if (!data || data->process_event_count) + if (!data) { if (!count && !timeout) return WAIT_TIMEOUT; return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL, timeout, flags & MWMO_ALERTABLE ); } - /* check whether only server queue handle was passed in */ - if (count < 2) flags &= ~MWMO_WAITALL; + if (data->process_event_count) mask = 0; /* don't process nested events */ data->process_event_count++; - if (process_events( data->display, mask )) ret = count; + if (process_events( data->display, mask )) ret = count - 1; else if (count || timeout) { - HANDLE new_handles[MAXIMUM_WAIT_OBJECTS+1]; /* FIXME! */ - - for (i = 0; i < count; i++) new_handles[i] = handles[i]; - new_handles[count] = data->display_fd; - - ret = WaitForMultipleObjectsEx( count+1, new_handles, flags & MWMO_WAITALL, + ret = WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL, timeout, flags & MWMO_ALERTABLE ); - if (ret == count) process_events( data->display, mask ); + if (ret == count - 1) process_events( data->display, mask ); } else ret = WAIT_TIMEOUT; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 4053c2f..8de2e25 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -498,7 +498,6 @@ struct x11drv_escape_set_dce struct x11drv_thread_data { Display *display; - HANDLE display_fd; int process_event_count; /* recursion count for event processing */ Cursor cursor; /* current cursor */ Window cursor_window; /* current window that contains the cursor */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 078a514..8012c2d 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -459,7 +459,6 @@ static void thread_detach(void) if (data) { X11DRV_ResetSelectionOwner(); - CloseHandle( data->display_fd ); wine_tsx11_lock(); if (data->xim) XCloseIM( data->xim ); XCloseDisplay( data->display ); @@ -489,6 +488,32 @@ static void process_detach(void) } +/* store the display fd into the message queue */ +static void set_queue_display_fd( Display *display ) +{ + HANDLE handle; + int ret; + + if (wine_server_fd_to_handle( ConnectionNumber(display), GENERIC_READ | SYNCHRONIZE, 0, &handle )) + { + MESSAGE( "x11drv: Can't allocate handle for display fd\n" ); + ExitProcess(1); + } + SERVER_START_REQ( set_queue_fd ) + { + req->handle = handle; + ret = wine_server_call( req ); + } + SERVER_END_REQ; + if (ret) + { + MESSAGE( "x11drv: Can't store handle for display fd\n" ); + ExitProcess(1); + } + CloseHandle( handle ); +} + + /*********************************************************************** * X11DRV thread initialisation routine */ @@ -535,12 +560,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) else if (!(data->xim = X11DRV_SetupXIM( data->display, input_style ))) WARN("Input Method is not available\n"); - if (wine_server_fd_to_handle( ConnectionNumber(data->display), GENERIC_READ | SYNCHRONIZE, - 0, &data->display_fd )) - { - MESSAGE( "x11drv: Can't allocate handle for display fd\n" ); - ExitProcess(1); - } + set_queue_display_fd( data->display ); data->process_event_count = 0; data->cursor = None; data->cursor_window = None;
1
0
0
0
Alexandre Julliard : server: Add support for associating a file descriptor to a message queue.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 0cb29f47ca7a87c4c876a7c1796d3f1e0eec37f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0cb29f47ca7a87c4c876a7c17…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 18:02:01 2007 +0200 server: Add support for associating a file descriptor to a message queue. --- include/wine/server_protocol.h | 17 ++++++++++- server/protocol.def | 6 ++++ server/queue.c | 65 +++++++++++++++++++++++++++++++++++++++- server/request.h | 2 + server/trace.c | 8 +++++ 5 files changed, 96 insertions(+), 2 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index a254128..2c486e2 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2395,6 +2395,18 @@ struct get_msg_queue_reply +struct set_queue_fd_request +{ + struct request_header __header; + obj_handle_t handle; +}; +struct set_queue_fd_reply +{ + struct reply_header __header; +}; + + + struct set_queue_mask_request { struct request_header __header; @@ -4118,6 +4130,7 @@ enum request REQ_empty_atom_table, REQ_init_atom_table, REQ_get_msg_queue, + REQ_set_queue_fd, REQ_set_queue_mask, REQ_get_queue_status, REQ_get_process_idle_event, @@ -4341,6 +4354,7 @@ union generic_request struct empty_atom_table_request empty_atom_table_request; struct init_atom_table_request init_atom_table_request; struct get_msg_queue_request get_msg_queue_request; + struct set_queue_fd_request set_queue_fd_request; struct set_queue_mask_request set_queue_mask_request; struct get_queue_status_request get_queue_status_request; struct get_process_idle_event_request get_process_idle_event_request; @@ -4562,6 +4576,7 @@ union generic_reply struct empty_atom_table_reply empty_atom_table_reply; struct init_atom_table_reply init_atom_table_reply; struct get_msg_queue_reply get_msg_queue_reply; + struct set_queue_fd_reply set_queue_fd_reply; struct set_queue_mask_reply set_queue_mask_reply; struct get_queue_status_reply get_queue_status_reply; struct get_process_idle_event_reply get_process_idle_event_reply; @@ -4662,6 +4677,6 @@ union generic_reply struct allocate_locally_unique_id_reply allocate_locally_unique_id_reply; }; -#define SERVER_PROTOCOL_VERSION 289 +#define SERVER_PROTOCOL_VERSION 290 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index ef20235..48d1096 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1783,6 +1783,12 @@ enum char_info_mode @END +/* Set the file descriptor associated to the current thread queue */ +@REQ(set_queue_fd) + obj_handle_t handle; /* handle to the file descriptor */ +@END + + /* Set the current message queue wakeup mask */ @REQ(set_queue_mask) unsigned int wake_mask; /* wakeup bits mask */ diff --git a/server/queue.c b/server/queue.c index 1973152..4e66f99 100644 --- a/server/queue.c +++ b/server/queue.c @@ -113,6 +113,7 @@ struct thread_input struct msg_queue { struct object obj; /* object header */ + struct fd *fd; /* optional file descriptor to poll */ unsigned int wake_bits; /* wakeup bits */ unsigned int wake_mask; /* wakeup mask */ unsigned int changed_bits; /* changed wakeup bits */ @@ -139,6 +140,7 @@ static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry static int msg_queue_signaled( struct object *obj, struct thread *thread ); static int msg_queue_satisfied( struct object *obj, struct thread *thread ); static void msg_queue_destroy( struct object *obj ); +static void msg_queue_poll_event( struct fd *fd, int event ); static void thread_input_dump( struct object *obj, int verbose ); static void thread_input_destroy( struct object *obj ); static void timer_callback( void *private ); @@ -160,6 +162,16 @@ static const struct object_ops msg_queue_ops = msg_queue_destroy /* destroy */ }; +static const struct fd_ops msg_queue_fd_ops = +{ + NULL, /* get_poll_events */ + msg_queue_poll_event, /* poll_event */ + no_flush, /* flush */ + no_get_file_info, /* get_file_info */ + no_queue_async, /* queue_async */ + no_cancel_async /* cancel async */ +}; + static const struct object_ops thread_input_ops = { @@ -243,6 +255,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ if (!input && !(input = create_thread_input( thread ))) return NULL; if ((queue = alloc_object( &msg_queue_ops ))) { + queue->fd = NULL; queue->wake_bits = 0; queue->wake_mask = 0; queue->changed_bits = 0; @@ -778,6 +791,8 @@ static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *ent { if (process->idle_event) set_event( process->idle_event ); } + if (queue->fd && list_empty( &obj->wait_queue )) /* first on the queue */ + set_fd_events( queue->fd, POLLIN ); add_queue( obj, entry ); return 1; } @@ -788,6 +803,8 @@ static void msg_queue_remove_queue(struct object *obj, struct wait_queue_entry * struct process *process = entry->thread->process; remove_queue( obj, entry ); + if (queue->fd && list_empty( &obj->wait_queue )) /* last on the queue is gone */ + set_fd_events( queue->fd, 0 ); assert( entry->thread->queue == queue ); @@ -808,7 +825,18 @@ static void msg_queue_dump( struct object *obj, int verbose ) static int msg_queue_signaled( struct object *obj, struct thread *thread ) { struct msg_queue *queue = (struct msg_queue *)obj; - return is_signaled( queue ); + int ret = 0; + + if (queue->fd) + { + if ((ret = check_fd_events( queue->fd, POLLIN ))) + /* stop waiting on select() if we are signaled */ + set_fd_events( queue->fd, 0 ); + else if (!list_empty( &obj->wait_queue )) + /* restart waiting on poll() if we are no longer signaled */ + set_fd_events( queue->fd, POLLIN ); + } + return ret || is_signaled( queue ); } static int msg_queue_satisfied( struct object *obj, struct thread *thread ) @@ -843,6 +871,16 @@ static void msg_queue_destroy( struct object *obj ) if (queue->timeout) remove_timeout_user( queue->timeout ); if (queue->input) release_object( queue->input ); if (queue->hooks) release_object( queue->hooks ); + if (queue->fd) release_object( queue->fd ); +} + +static void msg_queue_poll_event( struct fd *fd, int event ) +{ + struct msg_queue *queue = get_fd_user( fd ); + assert( queue->obj.ops == &msg_queue_ops ); + + if (event & (POLLERR | POLLHUP)) set_fd_events( fd, -1 ); + wake_up( &queue->obj, 0 ); } static void thread_input_dump( struct object *obj, int verbose ) @@ -1524,6 +1562,31 @@ DECL_HANDLER(get_msg_queue) } +/* set the file descriptor associated to the current thread queue */ +DECL_HANDLER(set_queue_fd) +{ + struct msg_queue *queue = get_current_queue(); + struct file *file; + int unix_fd; + + if (queue->fd) /* fd can only be set once */ + { + set_error( STATUS_ACCESS_DENIED ); + return; + } + if (!(file = get_file_obj( current->process, req->handle, SYNCHRONIZE ))) return; + + if ((unix_fd = get_file_unix_fd( file )) != -1) + { + if ((unix_fd = dup( unix_fd )) != -1) + queue->fd = create_anonymous_fd( &msg_queue_fd_ops, unix_fd, &queue->obj ); + else + file_set_error(); + } + release_object( file ); +} + + /* set the current message queue wakeup mask */ DECL_HANDLER(set_queue_mask) { diff --git a/server/request.h b/server/request.h index aa4f8e4..5b28a7f 100644 --- a/server/request.h +++ b/server/request.h @@ -228,6 +228,7 @@ DECL_HANDLER(set_atom_information); DECL_HANDLER(empty_atom_table); DECL_HANDLER(init_atom_table); DECL_HANDLER(get_msg_queue); +DECL_HANDLER(set_queue_fd); DECL_HANDLER(set_queue_mask); DECL_HANDLER(get_queue_status); DECL_HANDLER(get_process_idle_event); @@ -450,6 +451,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_empty_atom_table, (req_handler)req_init_atom_table, (req_handler)req_get_msg_queue, + (req_handler)req_set_queue_fd, (req_handler)req_set_queue_mask, (req_handler)req_get_queue_status, (req_handler)req_get_process_idle_event, diff --git a/server/trace.c b/server/trace.c index c4572bd..0d11e7c 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2214,6 +2214,11 @@ static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req ) fprintf( stderr, " handle=%p", req->handle ); } +static void dump_set_queue_fd_request( const struct set_queue_fd_request *req ) +{ + fprintf( stderr, " handle=%p", req->handle ); +} + static void dump_set_queue_mask_request( const struct set_queue_mask_request *req ) { fprintf( stderr, " wake_mask=%08x,", req->wake_mask ); @@ -3568,6 +3573,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_empty_atom_table_request, (dump_func)dump_init_atom_table_request, (dump_func)dump_get_msg_queue_request, + (dump_func)dump_set_queue_fd_request, (dump_func)dump_set_queue_mask_request, (dump_func)dump_get_queue_status_request, (dump_func)dump_get_process_idle_event_request, @@ -3787,6 +3793,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)0, (dump_func)dump_init_atom_table_reply, (dump_func)dump_get_msg_queue_reply, + (dump_func)0, (dump_func)dump_set_queue_mask_reply, (dump_func)dump_get_queue_status_reply, (dump_func)dump_get_process_idle_event_reply, @@ -4006,6 +4013,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "empty_atom_table", "init_atom_table", "get_msg_queue", + "set_queue_fd", "set_queue_mask", "get_queue_status", "get_process_idle_event",
1
0
0
0
Alexandre Julliard : make_requests: More aggressive grepping for status values.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 3d39c620dabed9c32185c35f4084b93a38f103a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d39c620dabed9c32185c35f4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 18:01:22 2007 +0200 make_requests: More aggressive grepping for status values. --- server/trace.c | 5 +++++ tools/make_requests | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/trace.c b/server/trace.c index 898998b..c4572bd 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4112,12 +4112,14 @@ static const struct unsigned int value; } status_names[] = { + { "ABANDONED_WAIT_0", STATUS_ABANDONED_WAIT_0 }, { "ACCESS_DENIED", STATUS_ACCESS_DENIED }, { "ACCESS_VIOLATION", STATUS_ACCESS_VIOLATION }, { "ALERTED", STATUS_ALERTED }, { "ALIAS_EXISTS", STATUS_ALIAS_EXISTS }, { "BAD_DEVICE_TYPE", STATUS_BAD_DEVICE_TYPE }, { "BAD_IMPERSONATION_LEVEL", STATUS_BAD_IMPERSONATION_LEVEL }, + { "BREAKPOINT", STATUS_BREAKPOINT }, { "BUFFER_OVERFLOW", STATUS_BUFFER_OVERFLOW }, { "BUFFER_TOO_SMALL", STATUS_BUFFER_TOO_SMALL }, { "CANCELLED", STATUS_CANCELLED }, @@ -4135,6 +4137,7 @@ static const struct { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE }, { "FILE_IS_A_DIRECTORY", STATUS_FILE_IS_A_DIRECTORY }, { "FILE_LOCK_CONFLICT", STATUS_FILE_LOCK_CONFLICT }, + { "GENERIC_NOT_MAPPED", STATUS_GENERIC_NOT_MAPPED }, { "HANDLES_CLOSED", STATUS_HANDLES_CLOSED }, { "HANDLE_NOT_CLOSABLE", STATUS_HANDLE_NOT_CLOSABLE }, { "ILLEGAL_FUNCTION", STATUS_ILLEGAL_FUNCTION }, @@ -4143,6 +4146,7 @@ static const struct { "INVALID_FILE_FOR_SECTION", STATUS_INVALID_FILE_FOR_SECTION }, { "INVALID_HANDLE", STATUS_INVALID_HANDLE }, { "INVALID_PARAMETER", STATUS_INVALID_PARAMETER }, + { "INVALID_SECURITY_DESCR", STATUS_INVALID_SECURITY_DESCR }, { "IO_TIMEOUT", STATUS_IO_TIMEOUT }, { "KEY_DELETED", STATUS_KEY_DELETED }, { "MAPPED_FILE_SIZE_ZERO", STATUS_MAPPED_FILE_SIZE_ZERO }, @@ -4185,6 +4189,7 @@ static const struct { "TIMEOUT", STATUS_TIMEOUT }, { "TOO_MANY_OPENED_FILES", STATUS_TOO_MANY_OPENED_FILES }, { "UNSUCCESSFUL", STATUS_UNSUCCESSFUL }, + { "USER_APC", STATUS_USER_APC }, { "VOLUME_DISMOUNTED", STATUS_VOLUME_DISMOUNTED }, { "WAS_LOCKED", STATUS_WAS_LOCKED }, { NULL, 0 } diff --git a/tools/make_requests b/tools/make_requests index 6ce17f5..d5364d9 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -239,14 +239,11 @@ sub GET_ERROR_NAMES() my %errors = (); foreach my $f (glob "server/*.c") { + next if $f eq "server/trace.c"; open FILE, $f or die "Can't open $f"; while (<FILE>) { - if (/set_error\s*\(\s*STATUS_(\w+)\s*\)/) - { - $errors{$1} = "STATUS_$1" unless $1 eq "SUCCESS"; - } - elsif (/async_terminate_\w+\s*\(.*,\s*STATUS_(\w+)\s*\)/) + if (/STATUS_(\w+)/) { $errors{$1} = "STATUS_$1" unless $1 eq "SUCCESS"; }
1
0
0
0
Paul Vriens : odbccp32: Don't print *pcbPathOut as it can be NULL (Coverity ).
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 60ff8d17dd9fa78c4cda035ef4c342453b7c69eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=60ff8d17dd9fa78c4cda035ef…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Wed Apr 4 11:28:42 2007 +0200 odbccp32: Don't print *pcbPathOut as it can be NULL (Coverity). --- dlls/odbccp32/odbccp32.c | 4 +- dlls/odbccp32/tests/misc.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 5289e14..0d4662b 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -523,7 +523,7 @@ BOOL WINAPI SQLInstallDriverManagerW(LPWSTR lpszPath, WORD cbPathMax, WCHAR path[MAX_PATH]; clear_errors(); - TRACE("(%p %d %d)\n", lpszPath, cbPathMax, *pcbPathOut); + TRACE("(%p %d %p)\n", lpszPath, cbPathMax, pcbPathOut); len = GetSystemDirectoryW(path, MAX_PATH); @@ -546,7 +546,7 @@ BOOL WINAPI SQLInstallDriverManager(LPSTR lpszPath, WORD cbPathMax, WCHAR path[MAX_PATH]; clear_errors(); - TRACE("(%p %d %d)\n", lpszPath, cbPathMax, *pcbPathOut); + TRACE("(%p %d %p)\n", lpszPath, cbPathMax, pcbPathOut); ret = SQLInstallDriverManagerW(path, MAX_PATH, &cbOut); if (ret) diff --git a/dlls/odbccp32/tests/misc.c b/dlls/odbccp32/tests/misc.c index 0779b44..fdfecc0 100644 --- a/dlls/odbccp32/tests/misc.c +++ b/dlls/odbccp32/tests/misc.c @@ -74,8 +74,59 @@ static void test_SQLInstallerError(void) ok(sql_ret == SQL_SUCCESS_WITH_INFO, "SQLInstallerError(null addresses) failed with %d instead of SQL_SUCCESS_WITH_INFO\n", sql_ret); } +static void test_SQLInstallDriverManager(void) +{ + BOOL bool_ret; + RETCODE sql_ret; + DWORD error_code; + CHAR target_path[MAX_PATH]; + WORD path_out; + + /* NULL check */ + bool_ret = SQLInstallDriverManager(NULL, 0, NULL); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(!bool_ret, "SQLInstallDriverManager unexpectedly succeeded\n"); + todo_wine + ok(sql_ret == SQL_SUCCESS_WITH_INFO && error_code == ODBC_ERROR_INVALID_BUFF_LEN, + "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n"); + + /* Length smaller then MAX_PATH */ + bool_ret = SQLInstallDriverManager(target_path, MAX_PATH / 2, NULL); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + todo_wine { + ok(!bool_ret, "SQLInstallDriverManager unexpectedly succeeded\n"); + ok(sql_ret == SQL_SUCCESS_WITH_INFO && error_code == ODBC_ERROR_INVALID_BUFF_LEN, + "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n"); + } + + path_out = 0xcafe; + bool_ret = SQLInstallDriverManager(target_path, MAX_PATH / 2, &path_out); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + todo_wine { + ok(!bool_ret, "SQLInstallDriverManager unexpectedly succeeded\n"); + ok(sql_ret == SQL_SUCCESS_WITH_INFO && error_code == ODBC_ERROR_INVALID_BUFF_LEN, + "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n"); + ok(path_out == 0xcafe, "Expected path_out to not have changed\n"); + } + + /* Length OK */ + bool_ret = SQLInstallDriverManager(target_path, MAX_PATH, NULL); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(bool_ret, "SQLInstallDriverManager unexpectedly failed\n"); + ok(sql_ret == SQL_NO_DATA, "Expected SQL_NO_DATA, got %d\n", sql_ret); + + path_out = 0xcafe; + bool_ret = SQLInstallDriverManager(target_path, MAX_PATH, &path_out); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(bool_ret, "SQLInstallDriverManager unexpectedly failed\n"); + ok(sql_ret == SQL_NO_DATA, "Expected SQL_NO_DATA, got %d\n", sql_ret); + /* path_out should in practice be less then 0xcafe */ + ok(path_out != 0xcafe, "Expected path_out to show the correct amount of bytes\n"); +} + START_TEST(misc) { test_SQLConfigMode(); test_SQLInstallerError(); + test_SQLInstallDriverManager(); }
1
0
0
0
Aric Stewart : comctl32: Propsheet exception fix.
by Alexandre Julliard
04 Apr '07
04 Apr '07
Module: wine Branch: master Commit: 5688ffb7abb09469023a0bfe43595555962c5c4c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5688ffb7abb09469023a0bfe4…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Apr 3 12:58:19 2007 -0500 comctl32: Propsheet exception fix. Do not attempt to draw a page during WM_PAINT if there is no active page. --- dlls/comctl32/propsheet.c | 1 + dlls/comctl32/tests/propsheet.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index c84f23a..201e554 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -3229,6 +3229,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) WCHAR szBuffer[256]; int nLength; + if (psInfo->active_page < 0) return 1; hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps); if (!hdc) return 1; diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index db71bfe..8627351 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -98,7 +98,42 @@ static void test_title(void) DestroyWindow(hdlg); } +static void test_nopage(void) +{ + HPROPSHEETPAGE hpsp[1]; + PROPSHEETPAGEA psp; + PROPSHEETHEADERA psh; + HWND hdlg; + + memset(&psp, 0, sizeof(psp)); + psp.dwSize = sizeof(psp); + psp.dwFlags = 0; + psp.hInstance = GetModuleHandleW(NULL); + U(psp).pszTemplate = "prop_page1"; + U2(psp).pszIcon = NULL; + psp.pfnDlgProc = page_dlg_proc; + psp.lParam = 0; + + hpsp[0] = CreatePropertySheetPageA(&psp); + + memset(&psh, 0, sizeof(psh)); + psh.dwSize = sizeof(psh); + psh.dwFlags = PSH_MODELESS | PSH_USECALLBACK; + psh.pszCaption = "test caption"; + psh.nPages = 1; + psh.hwndParent = GetDesktopWindow(); + U3(psh).phpage = hpsp; + psh.pfnCallback = sheet_callback; + + hdlg = (HWND)PropertySheetA(&psh); + ShowWindow(hdlg,SW_NORMAL); + SendMessage(hdlg, PSM_REMOVEPAGE, 0, 0); + RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW); + DestroyWindow(hdlg); +} + START_TEST(propsheet) { test_title(); + test_nopage(); }
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
69
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
Results per page:
10
25
50
100
200