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
August 2009
----- 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
1042 discussions
Start a n
N
ew thread
Alexandre Julliard : comctl32/tests: Fix a number of listview message test failures.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: 576a398338b6b69e29d81d6d564a40dcaffe27dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=576a398338b6b69e29d81d6d5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 14:25:24 2009 +0200 comctl32/tests: Fix a number of listview message test failures. --- dlls/comctl32/tests/listview.c | 57 +++++++++++++++++++++++---------------- dlls/comctl32/tests/msg.c | 5 +++ 2 files changed, 39 insertions(+), 23 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=576a398338b6b69e29d81…
1
0
0
0
Alexandre Julliard : advapi32: Fix sid pointer calculation in LsaLookupNames2.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: 4f71d33dfabad2678a27dfe221feb825ed498c7e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4f71d33dfabad2678a27dfe22…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 13:23:23 2009 +0200 advapi32: Fix sid pointer calculation in LsaLookupNames2. --- dlls/advapi32/lsa.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c index 66727ba..796fa45 100644 --- a/dlls/advapi32/lsa.c +++ b/dlls/advapi32/lsa.c @@ -350,7 +350,7 @@ NTSTATUS WINAPI LsaLookupNames2( LSA_HANDLE policy, ULONG flags, ULONG count, size = sizeof(LSA_TRANSLATED_SID2) * count + sid_size_total; if (!(*sids = HeapAlloc( GetProcessHeap(), 0, size) )) return STATUS_NO_MEMORY; - sid = (SID *)*sids + sizeof(LSA_TRANSLATED_SID2) * mapped; + sid = (SID *)(*sids + count); if (!(*domains = HeapAlloc( GetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST) ))) {
1
0
0
0
Alexandre Julliard : ole32/tests: Don' t release the token object since it doesn't have a proper ref count.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: a104766b078a0fbd3010b06679e6dc23cf8a26d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a104766b078a0fbd3010b0667…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 13:00:31 2009 +0200 ole32/tests: Don't release the token object since it doesn't have a proper ref count. --- dlls/ole32/tests/compobj.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 9fc3b20..1cfe86b 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -1325,7 +1325,6 @@ static void test_CoGetContextToken(void) token = 0; hr = pCoGetContextToken(&token); ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr); - IUnknown_Release((IUnknown *)token); SetEvent(info.stop); ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" ); @@ -1349,7 +1348,7 @@ static void test_CoGetContextToken(void) ok(token, "Expected token != 0\n"); refs = IUnknown_AddRef((IUnknown *)token); - ok(refs == 1, "Expected 1, got %u\n", refs); + todo_wine ok(refs == 1, "Expected 1, got %u\n", refs); hr = pCoGetObjectContext(&IID_IObjContext, (void **)&ctx); ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr); @@ -1362,7 +1361,7 @@ static void test_CoGetContextToken(void) todo_wine ok(refs == 2, "Expected 2, got %u\n", refs); refs = IUnknown_Release((IUnknown *)token); - todo_wine ok(refs == 1, "Expected 1, got %u\n", refs); + ok(refs == 1, "Expected 1, got %u\n", refs); /* CoGetContextToken does not add a reference */ token = 0;
1
0
0
0
Alexandre Julliard : ole32/tests: Avoid infinite waits in tests.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: 9b2e414e914a760ff408611cafdd9db6429e9307 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b2e414e914a760ff408611ca…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 12:48:57 2009 +0200 ole32/tests: Avoid infinite waits in tests. --- dlls/ole32/tests/compobj.c | 30 +++++++++++++++--------------- dlls/ole32/tests/marshal.c | 28 ++++++++++++++-------------- 2 files changed, 29 insertions(+), 29 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9b2e414e914a760ff4086…
1
0
0
0
Mike Kaplinskiy : ntdll/tests: Test NtCancelIoFile(Ex).
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: 8c0eec2c6b00b2d29f9f856beb20f3f91b9c809f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c0eec2c6b00b2d29f9f856be…
Author: Mike Kaplinskiy <mike.kaplinskiy(a)gmail.com> Date: Thu Aug 13 18:56:23 2009 -0400 ntdll/tests: Test NtCancelIoFile(Ex). --- dlls/ntdll/tests/file.c | 87 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 84 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index ba3c688..26a854a 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -54,6 +54,7 @@ static NTSTATUS (WINAPI *pNtWriteFile)(HANDLE hFile, HANDLE hEvent, PIO_STATUS_BLOCK io_status, const void* buffer, ULONG length, PLARGE_INTEGER offset, PULONG key); +static NTSTATUS (WINAPI *pNtCancelIoFile)(HANDLE hFile, PIO_STATUS_BLOCK io_status); static NTSTATUS (WINAPI *pNtCancelIoFileEx)(HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATUS_BLOCK io_status); static NTSTATUS (WINAPI *pNtClose)( PHANDLE ); @@ -208,7 +209,7 @@ static void read_file_test(void) const char text[] = "foobar"; HANDLE handle, read, write; NTSTATUS status; - IO_STATUS_BLOCK iosb; + IO_STATUS_BLOCK iosb, iosb2; DWORD written; int apc_count = 0; char buffer[128]; @@ -356,11 +357,63 @@ static void read_file_test(void) ok( apc_count == 1, "apc was not called\n" ); CloseHandle( read ); + if (!create_pipe( &read, &write, FILE_FLAG_OVERLAPPED, 4096 )) return; + ok(DuplicateHandle(GetCurrentProcess(), read, GetCurrentProcess(), &handle, 0, TRUE, DUPLICATE_SAME_ACCESS), + "Failed to duplicate handle: %d\n", GetLastError()); + + apc_count = 0; + U(iosb).Status = 0xdeadbabe; + iosb.Information = 0xdeadbeef; + status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, 2, NULL, NULL ); + ok( status == STATUS_PENDING, "wrong status %x\n", status ); + ok( !is_signaled( event ), "event is signaled\n" ); + ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); + ok( !apc_count, "apc was called\n" ); + /* Cancel by other handle */ + status = pNtCancelIoFile( read, &iosb2 ); + ok(status == STATUS_SUCCESS, "failed to cancel by different handle: %x\n", status); + Sleep(1); /* FIXME: needed for wine to run the i/o apc */ + ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); + ok( is_signaled( event ), "event is signaled\n" ); + todo_wine ok( !apc_count, "apc was called\n" ); + SleepEx( 1, TRUE ); /* alertable sleep */ + ok( apc_count == 1, "apc was not called\n" ); + + apc_count = 0; + U(iosb).Status = 0xdeadbabe; + iosb.Information = 0xdeadbeef; + status = pNtReadFile( read, event, apc, &apc_count, &iosb, buffer, 2, NULL, NULL ); + ok( status == STATUS_PENDING, "wrong status %x\n", status ); + ok( !is_signaled( event ), "event is signaled\n" ); + ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); + ok( !apc_count, "apc was called\n" ); + /* Close queued handle */ + CloseHandle( read ); + SleepEx( 1, TRUE ); /* alertable sleep */ + ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); + status = pNtCancelIoFile( read, &iosb2 ); + ok(status == STATUS_INVALID_HANDLE, "cancelled by closed handle?\n"); + status = pNtCancelIoFile( handle, &iosb2 ); + ok(status == STATUS_SUCCESS, "failed to cancel: %x\n", status); + Sleep(1); /* FIXME: needed for wine to run the i/o apc */ + ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); + ok( is_signaled( event ), "event is signaled\n" ); + todo_wine ok( !apc_count, "apc was called\n" ); + SleepEx( 1, TRUE ); /* alertable sleep */ + ok( apc_count == 1, "apc was not called\n" ); + CloseHandle( handle ); + CloseHandle( write ); + if (pNtCancelIoFileEx) { - IO_STATUS_BLOCK iosb2; - /* test param order for NtCancelIoFileEx */ + /* Basic Cancel Ex */ if (!create_pipe( &read, &write, FILE_FLAG_OVERLAPPED, 4096 )) return; + apc_count = 0; U(iosb).Status = 0xdeadbabe; iosb.Information = 0xdeadbeef; @@ -379,6 +432,33 @@ static void read_file_test(void) todo_wine ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); + + /* Duplicate iosb */ + apc_count = 0; + U(iosb).Status = 0xdeadbabe; + iosb.Information = 0xdeadbeef; + status = pNtReadFile( read, event, apc, &apc_count, &iosb, buffer, 2, NULL, NULL ); + ok( status == STATUS_PENDING, "wrong status %x\n", status ); + ok( !is_signaled( event ), "event is signaled\n" ); + ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); + ok( !apc_count, "apc was called\n" ); + status = pNtReadFile( read, event, apc, &apc_count, &iosb, buffer, 2, NULL, NULL ); + ok( status == STATUS_PENDING, "wrong status %x\n", status ); + ok( !is_signaled( event ), "event is signaled\n" ); + ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); + ok( !apc_count, "apc was called\n" ); + status = pNtCancelIoFileEx( read, &iosb, &iosb2 ); + ok(status == STATUS_SUCCESS, "Failed to cancel I/O\n"); + Sleep(1); /* FIXME: needed for wine to run the i/o apc */ + ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); + ok( is_signaled( event ), "event is signaled\n" ); + todo_wine ok( !apc_count, "apc was called\n" ); + SleepEx( 1, TRUE ); /* alertable sleep */ + ok( apc_count == 2, "apc was not called\n" ); + CloseHandle( read ); CloseHandle( write ); } @@ -741,6 +821,7 @@ START_TEST(file) pNtDeleteFile = (void *)GetProcAddress(hntdll, "NtDeleteFile"); pNtReadFile = (void *)GetProcAddress(hntdll, "NtReadFile"); pNtWriteFile = (void *)GetProcAddress(hntdll, "NtWriteFile"); + pNtCancelIoFile = (void *)GetProcAddress(hntdll, "NtCancelIoFile"); pNtCancelIoFileEx = (void *)GetProcAddress(hntdll, "NtCancelIoFileEx"); pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); pNtCreateIoCompletion = (void *)GetProcAddress(hntdll, "NtCreateIoCompletion");
1
0
0
0
Mike Kaplinskiy : kernel32: Implement CancelIoEx.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: a5c03fbc72f5b084723a7f1181d90731abea8872 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a5c03fbc72f5b084723a7f118…
Author: Mike Kaplinskiy <mike.kaplinskiy(a)gmail.com> Date: Sun Aug 9 00:12:52 2009 -0400 kernel32: Implement CancelIoEx. --- dlls/kernel32/file.c | 26 ++++++++++++++++++++++++++ dlls/kernel32/kernel32.spec | 1 + include/winbase.h | 1 + 3 files changed, 28 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 9742964..d9fbddb 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -625,6 +625,32 @@ BOOL WINAPI GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, } /*********************************************************************** + * CancelIoEx (KERNEL32.@) + * + * Cancels pending I/O operations on a file given the overlapped used. + * + * PARAMS + * handle [I] File handle. + * lpOverlapped [I,OPT] pointer to overlapped (if null, cancel all) + * + * RETURNS + * Success: TRUE. + * Failure: FALSE, check GetLastError(). + */ +BOOL WINAPI CancelIoEx(HANDLE handle, LPOVERLAPPED lpOverlapped) +{ + IO_STATUS_BLOCK io_status; + + NtCancelIoFileEx(handle, (PIO_STATUS_BLOCK) lpOverlapped, &io_status); + if (io_status.u.Status) + { + SetLastError( RtlNtStatusToDosError( io_status.u.Status ) ); + return FALSE; + } + return TRUE; +} + +/*********************************************************************** * CancelIo (KERNEL32.@) * * Cancels pending I/O operations initiated by the current thread on a file. diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 2fd1b10..458a47d 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -177,6 +177,7 @@ @ stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) @ stub CancelDeviceWakeupRequest @ stdcall CancelIo(long) +@ stdcall CancelIoEx(long ptr) # @ stub CancelTimerQueueTimer @ stdcall CancelWaitableTimer(long) @ stdcall ChangeTimerQueueTimer(ptr ptr long long) diff --git a/include/winbase.h b/include/winbase.h index 9e52bde..791d58e 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1323,6 +1323,7 @@ WINBASEAPI BOOL WINAPI CallNamedPipeA(LPCSTR,LPVOID,DWORD,LPVOID,DWORD,LP WINBASEAPI BOOL WINAPI CallNamedPipeW(LPCWSTR,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,DWORD); #define CallNamedPipe WINELIB_NAME_AW(CallNamedPipe) WINBASEAPI BOOL WINAPI CancelIo(HANDLE); +WINBASEAPI BOOL WINAPI CancelIoEx(HANDLE,LPOVERLAPPED); WINBASEAPI BOOL WINAPI CancelWaitableTimer(HANDLE); WINBASEAPI BOOL WINAPI ChangeTimerQueueTimer(HANDLE,HANDLE,ULONG,ULONG); WINADVAPI BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
1
0
0
0
Mike Kaplinskiy : ntdll: Implement NtCancelIoFileEx and fix NtCancelIoFile.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: af25949a51f8ef8bd6edfd1b078d7760c13c6702 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af25949a51f8ef8bd6edfd1b0…
Author: Mike Kaplinskiy <mike.kaplinskiy(a)gmail.com> Date: Sun Aug 9 00:11:30 2009 -0400 ntdll: Implement NtCancelIoFileEx and fix NtCancelIoFile. --- dlls/ntdll/file.c | 44 +++++++++++++++++++++++++++++++++++++++++--- dlls/ntdll/ntdll.spec | 2 ++ dlls/ntdll/tests/change.c | 5 ++--- dlls/ntdll/tests/file.c | 2 +- include/winternl.h | 1 + 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 3fa6f19..561baf0 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -2604,6 +2604,38 @@ NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes ) } /****************************************************************** + * NtCancelIoFileEx (NTDLL.@) + * + * + */ +NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATUS_BLOCK io_status ) +{ + LARGE_INTEGER timeout; + + TRACE("%p %p %p\n", hFile, iosb, io_status ); + + SERVER_START_REQ( cancel_async ) + { + req->handle = wine_server_obj_handle( hFile ); + req->iosb = wine_server_client_ptr( iosb ); + req->only_thread = FALSE; + io_status->u.Status = wine_server_call( req ); + } + SERVER_END_REQ; + if (io_status->u.Status) + return io_status->u.Status; + + /* Let some APC be run, so that we can run the remaining APCs on hFile + * either the cancelation of the pending one, but also the execution + * of the queued APC, but not yet run. This is needed to ensure proper + * clean-up of allocated data. + */ + timeout.u.LowPart = timeout.u.HighPart = 0; + NtDelayExecution( TRUE, &timeout ); + return io_status->u.Status; +} + +/****************************************************************** * NtCancelIoFile (NTDLL.@) * * @@ -2616,17 +2648,23 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status ) SERVER_START_REQ( cancel_async ) { - req->handle = wine_server_obj_handle( hFile ); - wine_server_call( req ); + req->handle = wine_server_obj_handle( hFile ); + req->iosb = 0; + req->only_thread = TRUE; + io_status->u.Status = wine_server_call( req ); } SERVER_END_REQ; + if (io_status->u.Status) + return io_status->u.Status; + /* Let some APC be run, so that we can run the remaining APCs on hFile * either the cancelation of the pending one, but also the execution * of the queued APC, but not yet run. This is needed to ensure proper * clean-up of allocated data. */ timeout.u.LowPart = timeout.u.HighPart = 0; - return io_status->u.Status = NtDelayExecution( TRUE, &timeout ); + NtDelayExecution( TRUE, &timeout ); + return io_status->u.Status; } /****************************************************************************** diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 03686b2..6ec1dc0 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -109,6 +109,7 @@ @ stub NtCallbackReturn # @ stub NtCancelDeviceWakeupRequest @ stdcall NtCancelIoFile(long ptr) +@ stdcall NtCancelIoFileEx(long ptr ptr) @ stdcall NtCancelTimer(long ptr) @ stdcall NtClearEvent(long) @ stdcall NtClose(long) @@ -959,6 +960,7 @@ @ stub ZwCallbackReturn # @ stub ZwCancelDeviceWakeupRequest @ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile +@ stdcall ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx @ stdcall ZwCancelTimer(long ptr) NtCancelTimer @ stdcall ZwClearEvent(long) NtClearEvent @ stdcall ZwClose(long) NtClose diff --git a/dlls/ntdll/tests/change.c b/dlls/ntdll/tests/change.c index f395962..ed7f22c 100644 --- a/dlls/ntdll/tests/change.c +++ b/dlls/ntdll/tests/change.c @@ -295,15 +295,14 @@ static void test_ntncdf_async(void) ok(U(iosb).Status == 0x01234567, "status set too soon\n"); ok(iosb.Information == 0x12345678, "info set too soon\n"); - todo_wine { r = pNtCancelIoFile(hdir, &iosb); ok( r == STATUS_SUCCESS, "cancel failed\n"); CloseHandle(hdir); ok(U(iosb).Status == STATUS_SUCCESS, "status wrong\n"); - ok(U(iosb2).Status == STATUS_CANCELLED, "status wrong\n"); - } + todo_wine ok(U(iosb2).Status == STATUS_CANCELLED, "status wrong\n"); + ok(iosb.Information == 0, "info wrong\n"); ok(iosb2.Information == 0, "info wrong\n"); diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index a0e713a..ba3c688 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -376,7 +376,7 @@ static void read_file_test(void) ok( U(iosb).Status == STATUS_CANCELLED, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); ok( is_signaled( event ), "event is signaled\n" ); - ok( !apc_count, "apc was called\n" ); + todo_wine ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( apc_count == 1, "apc was not called\n" ); CloseHandle( read ); diff --git a/include/winternl.h b/include/winternl.h index 6d0b480..1d300bf 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2013,6 +2013,7 @@ NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID); NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE); NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS); NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK); +NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK); NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*); NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE); NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
1
0
0
0
Mike Kaplinskiy : server: Change cancel_async to take an optional iosb and only_thread.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: b05774ee7e92143fb6b763247c3ed5e2a1b521d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b05774ee7e92143fb6b763247…
Author: Mike Kaplinskiy <mike.kaplinskiy(a)gmail.com> Date: Sun Aug 9 00:08:27 2009 -0400 server: Change cancel_async to take an optional iosb and only_thread. --- include/wine/server_protocol.h | 5 ++++- server/async.c | 22 ++++++++++++++++++++++ server/fd.c | 15 ++++++++++----- server/file.h | 6 ++++-- server/protocol.def | 2 ++ server/request.h | 4 +++- server/sock.c | 11 +++++++---- server/trace.c | 4 +++- 8 files changed, 55 insertions(+), 14 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index c7566ea..c926f6d 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2859,6 +2859,9 @@ struct cancel_async_request { struct request_header __header; obj_handle_t handle; + client_ptr_t iosb; + int only_thread; + char __pad_28[4]; }; struct cancel_async_reply { @@ -5312,6 +5315,6 @@ union generic_reply struct set_window_layered_info_reply set_window_layered_info_reply; }; -#define SERVER_PROTOCOL_VERSION 387 +#define SERVER_PROTOCOL_VERSION 388 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/async.c b/server/async.c index 91f0c44..73cd76d 100644 --- a/server/async.c +++ b/server/async.c @@ -288,6 +288,28 @@ int async_waiting( struct async_queue *queue ) return async->status == STATUS_PENDING; } +int async_wake_up_by( struct async_queue *queue, struct process *process, + struct thread *thread, client_ptr_t iosb, unsigned int status ) +{ + struct list *ptr, *next; + int woken = 0; + + if (!queue || (!process && !thread && !iosb)) return 0; + + LIST_FOR_EACH_SAFE( ptr, next, &queue->queue ) + { + struct async *async = LIST_ENTRY( ptr, struct async, queue_entry ); + if ( (!process || async->thread->process == process) && + (!thread || async->thread == thread) && + (!iosb || async->data.iosb == iosb) ) + { + async_terminate( async, status ); + woken++; + } + } + return woken; +} + /* wake up async operations on the queue */ void async_wake_up( struct async_queue *queue, unsigned int status ) { diff --git a/server/fd.c b/server/fd.c index a57001a..d2da624 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1856,11 +1856,15 @@ void default_fd_reselect_async( struct fd *fd, struct async_queue *queue ) } /* default cancel_async() fd routine */ -void default_fd_cancel_async( struct fd *fd ) +void default_fd_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb ) { - async_wake_up( fd->read_q, STATUS_CANCELLED ); - async_wake_up( fd->write_q, STATUS_CANCELLED ); - async_wake_up( fd->wait_q, STATUS_CANCELLED ); + int n = 0; + + n += async_wake_up_by( fd->read_q, process, thread, iosb, STATUS_CANCELLED ); + n += async_wake_up_by( fd->write_q, process, thread, iosb, STATUS_CANCELLED ); + n += async_wake_up_by( fd->wait_q, process, thread, iosb, STATUS_CANCELLED ); + if (!n && iosb) + set_error( STATUS_NOT_FOUND ); } /* default flush() routine */ @@ -2064,10 +2068,11 @@ DECL_HANDLER(register_async) DECL_HANDLER(cancel_async) { struct fd *fd = get_handle_fd_obj( current->process, req->handle, 0 ); + struct thread *thread = req->only_thread ? current : NULL; if (fd) { - if (get_unix_fd( fd ) != -1) fd->fd_ops->cancel_async( fd ); + if (get_unix_fd( fd ) != -1) fd->fd_ops->cancel_async( fd, current->process, thread, req->iosb ); release_object( fd ); } } diff --git a/server/file.h b/server/file.h index 77de546..f59ec9e 100644 --- a/server/file.h +++ b/server/file.h @@ -46,7 +46,7 @@ struct fd_ops /* selected events for async i/o need an update */ void (*reselect_async)( struct fd *, struct async_queue *queue ); /* cancel an async operation */ - void (*cancel_async)(struct fd *); + void (*cancel_async)(struct fd *, struct process *process, struct thread *thread, client_ptr_t iosb); }; /* file descriptor functions */ @@ -83,7 +83,7 @@ extern obj_handle_t default_fd_ioctl( struct fd *fd, ioctl_code_t code, const as int blocking, const void *data, data_size_t size ); extern void default_fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count ); extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue ); -extern void default_fd_cancel_async( struct fd *fd ); +extern void default_fd_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb ); extern void no_flush( struct fd *fd, struct event **event ); extern void main_loop(void); extern void remove_process_locks( struct process *process ); @@ -143,6 +143,8 @@ extern void async_set_result( struct object *obj, unsigned int status, unsigned int total, client_ptr_t apc ); extern int async_waiting( struct async_queue *queue ); extern void async_terminate( struct async *async, unsigned int status ); +extern int async_wake_up_by( struct async_queue *queue, struct process *process, + struct thread *thread, client_ptr_t iosb, unsigned int status ); extern void async_wake_up( struct async_queue *queue, unsigned int status ); extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key ); extern void fd_copy_completion( struct fd *src, struct fd *dst ); diff --git a/server/protocol.def b/server/protocol.def index e871736..1dcc042 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2072,6 +2072,8 @@ enum message_type /* Cancel all async op on a fd */ @REQ(cancel_async) obj_handle_t handle; /* handle to comm port, socket or file */ + client_ptr_t iosb; /* I/O status block (NULL=all) */ + int only_thread; /* cancel matching this thread */ @END diff --git a/server/request.h b/server/request.h index 4fc3bd6..a0efd2d 100644 --- a/server/request.h +++ b/server/request.h @@ -1351,7 +1351,9 @@ C_ASSERT( FIELD_OFFSET(struct register_async_request, async) == 16 ); C_ASSERT( FIELD_OFFSET(struct register_async_request, count) == 56 ); C_ASSERT( sizeof(struct register_async_request) == 64 ); C_ASSERT( FIELD_OFFSET(struct cancel_async_request, handle) == 12 ); -C_ASSERT( sizeof(struct cancel_async_request) == 16 ); +C_ASSERT( FIELD_OFFSET(struct cancel_async_request, iosb) == 16 ); +C_ASSERT( FIELD_OFFSET(struct cancel_async_request, only_thread) == 24 ); +C_ASSERT( sizeof(struct cancel_async_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct ioctl_request, code) == 12 ); C_ASSERT( FIELD_OFFSET(struct ioctl_request, async) == 16 ); C_ASSERT( FIELD_OFFSET(struct ioctl_request, blocking) == 56 ); diff --git a/server/sock.c b/server/sock.c index baaa9df..71d8ccb 100644 --- a/server/sock.c +++ b/server/sock.c @@ -97,7 +97,7 @@ static void sock_poll_event( struct fd *fd, int event ); static enum server_fd_type sock_get_fd_type( struct fd *fd ); static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count ); static void sock_reselect_async( struct fd *fd, struct async_queue *queue ); -static void sock_cancel_async( struct fd *fd ); +static void sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb ); static int sock_get_error( int err ); static void sock_set_error(void); @@ -538,13 +538,16 @@ static void sock_reselect_async( struct fd *fd, struct async_queue *queue ) if (events) sock_try_event( sock, events ); } -static void sock_cancel_async( struct fd *fd ) +static void sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb ) { struct sock *sock = get_fd_user( fd ); + int n = 0; assert( sock->obj.ops == &sock_ops ); - async_wake_up( sock->read_q, STATUS_CANCELLED ); - async_wake_up( sock->write_q, STATUS_CANCELLED ); + n += async_wake_up_by( sock->read_q, process, thread, iosb, STATUS_CANCELLED ); + n += async_wake_up_by( sock->write_q, process, thread, iosb, STATUS_CANCELLED ); + if (!n && iosb) + set_error( STATUS_NOT_FOUND ); } static struct fd *sock_get_fd( struct object *obj ) diff --git a/server/trace.c b/server/trace.c index d24f653..be3f1c6 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2568,6 +2568,8 @@ static void dump_register_async_request( const struct register_async_request *re static void dump_cancel_async_request( const struct cancel_async_request *req ) { fprintf( stderr, " handle=%04x", req->handle ); + dump_uint64( ", iosb=", &req->iosb ); + fprintf( stderr, ", only_thread=%d", req->only_thread ); } static void dump_ioctl_request( const struct ioctl_request *req ) @@ -4583,12 +4585,12 @@ static const struct { "IO_TIMEOUT", STATUS_IO_TIMEOUT }, { "KEY_DELETED", STATUS_KEY_DELETED }, { "MAPPED_FILE_SIZE_ZERO", STATUS_MAPPED_FILE_SIZE_ZERO }, - { "MEDIA_WRITE_PROTECTED", STATUS_MEDIA_WRITE_PROTECTED }, { "MUTANT_NOT_OWNED", STATUS_MUTANT_NOT_OWNED }, { "NAME_TOO_LONG", STATUS_NAME_TOO_LONG }, { "NOTIFY_ENUM_DIR", STATUS_NOTIFY_ENUM_DIR }, { "NOT_ALL_ASSIGNED", STATUS_NOT_ALL_ASSIGNED }, { "NOT_A_DIRECTORY", STATUS_NOT_A_DIRECTORY }, + { "NOT_FOUND", STATUS_NOT_FOUND }, { "NOT_IMPLEMENTED", STATUS_NOT_IMPLEMENTED }, { "NOT_REGISTRY_FILE", STATUS_NOT_REGISTRY_FILE }, { "NOT_SUPPORTED", STATUS_NOT_SUPPORTED },
1
0
0
0
Alexandre Julliard : kernel32: Use a longer wineboot timeout for the initial prefix creation.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: e49918b5a2cdcbf5e775bda499e0c266532540fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e49918b5a2cdcbf5e775bda49…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 12:17:04 2009 +0200 kernel32: Use a longer wineboot timeout for the initial prefix creation. --- dlls/kernel32/process.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 0be47e7..92eb01a 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -1079,9 +1079,11 @@ void CDECL __wine_kernel_init(void) if (boot_events[0]) { - DWORD count = 1; + DWORD timeout = 30000, count = 1; + if (boot_events[1]) count++; - if (WaitForMultipleObjects( count, boot_events, FALSE, 30000 ) == WAIT_TIMEOUT) + if (!got_environment) timeout = 300000; /* initial prefix creation can take longer */ + if (WaitForMultipleObjects( count, boot_events, FALSE, timeout ) == WAIT_TIMEOUT) ERR( "boot event wait timed out\n" ); CloseHandle( boot_events[0] ); if (boot_events[1]) CloseHandle( boot_events[1] );
1
0
0
0
Alexandre Julliard : kernel32: Don' t wait for wineboot once the process is no longer running.
by Alexandre Julliard
18 Aug '09
18 Aug '09
Module: wine Branch: master Commit: d492389d23d08147b95f9007e99908d074793ee7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d492389d23d08147b95f9007e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 18 12:14:12 2009 +0200 kernel32: Don't wait for wineboot once the process is no longer running. --- dlls/kernel32/process.c | 36 ++++++++++++++++++++++-------------- 1 files changed, 22 insertions(+), 14 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index e007c2a..0be47e7 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -881,17 +881,17 @@ static void init_windows_dirs(void) /*********************************************************************** * start_wineboot * - * Start the wineboot process if necessary. Return the event to wait on. + * Start the wineboot process if necessary. Return the handles to wait on. */ -static HANDLE start_wineboot(void) +static void start_wineboot( HANDLE handles[2] ) { static const WCHAR wineboot_eventW[] = {'_','_','w','i','n','e','b','o','o','t','_','e','v','e','n','t',0}; - HANDLE event; - if (!(event = CreateEventW( NULL, TRUE, FALSE, wineboot_eventW ))) + handles[1] = 0; + if (!(handles[0] = CreateEventW( NULL, TRUE, FALSE, wineboot_eventW ))) { ERR( "failed to create wineboot event, expect trouble\n" ); - return 0; + return; } if (GetLastError() != ERROR_ALREADY_EXISTS) /* we created it */ { @@ -913,12 +913,15 @@ static HANDLE start_wineboot(void) { TRACE( "started wineboot pid %04x tid %04x\n", pi.dwProcessId, pi.dwThreadId ); CloseHandle( pi.hThread ); - CloseHandle( pi.hProcess ); - + handles[1] = pi.hProcess; + } + else + { + ERR( "failed to start wineboot, err %u\n", GetLastError() ); + CloseHandle( handles[0] ); + handles[0] = 0; } - else ERR( "failed to start wineboot, err %u\n", GetLastError() ); } - return event; } @@ -1016,7 +1019,7 @@ void CDECL __wine_kernel_init(void) WCHAR *p, main_exe_name[MAX_PATH+1]; PEB *peb = NtCurrentTeb()->Peb; RTL_USER_PROCESS_PARAMETERS *params = peb->ProcessParameters; - HANDLE boot_event = 0; + HANDLE boot_events[2]; BOOL got_environment = TRUE; /* Initialize everything */ @@ -1045,6 +1048,7 @@ void CDECL __wine_kernel_init(void) set_process_name( __wine_main_argc, __wine_main_argv ); set_library_wargv( __wine_main_argv ); + boot_events[0] = boot_events[1] = 0; if (peb->ProcessParameters->ImagePathName.Buffer) { @@ -1060,7 +1064,7 @@ void CDECL __wine_kernel_init(void) } update_library_argv0( main_exe_name ); if (!build_command_line( __wine_main_wargv )) goto error; - boot_event = start_wineboot(); + start_wineboot( boot_events ); } /* if there's no extension, append a dot to prevent LoadLibrary from appending .dll */ @@ -1073,10 +1077,14 @@ void CDECL __wine_kernel_init(void) RtlInitUnicodeString( &NtCurrentTeb()->Peb->ProcessParameters->DllPath, MODULE_get_dll_load_path(main_exe_name) ); - if (boot_event) + if (boot_events[0]) { - if (WaitForSingleObject( boot_event, 30000 )) ERR( "boot event wait timed out\n" ); - CloseHandle( boot_event ); + DWORD count = 1; + if (boot_events[1]) count++; + if (WaitForMultipleObjects( count, boot_events, FALSE, 30000 ) == WAIT_TIMEOUT) + ERR( "boot event wait timed out\n" ); + CloseHandle( boot_events[0] ); + if (boot_events[1]) CloseHandle( boot_events[1] ); /* if we didn't find environment section, try again now that wineboot has run */ if (!got_environment) {
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
105
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Results per page:
10
25
50
100
200