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 2013
----- 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
461 discussions
Start a n
N
ew thread
Dmitry Timoshkov : ntdll/tests: Use official path for temporary files instead of current directory.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: fca3231914561cf7502af10e9688078d5b435121 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fca3231914561cf7502af10e9…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Aug 20 20:22:08 2013 +0900 ntdll/tests: Use official path for temporary files instead of current directory. --- dlls/ntdll/tests/file.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index cc0b5c2..7771795 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -863,9 +863,10 @@ static void append_file_test(void) NTSTATUS status; IO_STATUS_BLOCK iosb; DWORD written; - char buffer[128]; + char path[MAX_PATH], buffer[MAX_PATH]; - GetTempFileNameA( ".", "foo", 0, buffer ); + GetTempPathA( MAX_PATH, path ); + GetTempFileNameA( path, "foo", 0, buffer ); /* It is possible to open a file with only FILE_APPEND_DATA access flags. It matches the O_WRONLY|O_APPEND open() posix behavior */ handle = CreateFileA(buffer, FILE_APPEND_DATA, 0, NULL, CREATE_ALWAYS, @@ -1872,7 +1873,6 @@ static void test_NtCreateFile(void) /*18*/{ FILE_SUPERSEDE, 0, 0, FILE_CREATED, FILE_ATTRIBUTE_ARCHIVE, TRUE } }; static const WCHAR fooW[] = {'f','o','o',0}; - static const WCHAR dotW[] = {'.',0}; NTSTATUS status; HANDLE handle; WCHAR path[MAX_PATH]; @@ -1881,7 +1881,8 @@ static void test_NtCreateFile(void) UNICODE_STRING nameW; DWORD ret, i; - GetTempFileNameW(dotW, fooW, 0, path); + GetTempPathW(MAX_PATH, path); + GetTempFileNameW(path, fooW, 0, path); DeleteFileW(path); pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
1
0
0
0
Dmitry Timoshkov : ntdll/tests: Check WriteFile return values.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 87db683aad87de07f0f3ef8ae5e46d9c624abeca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=87db683aad87de07f0f3ef8ae…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Aug 20 20:21:27 2013 +0900 ntdll/tests: Check WriteFile return values. --- dlls/ntdll/tests/file.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 77a8431..cc0b5c2 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -505,7 +505,8 @@ static void read_file_test(void) 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" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* iosb updated here by async i/o */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -530,7 +531,8 @@ static void read_file_test(void) 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" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* iosb updated here by async i/o */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -548,7 +550,8 @@ static void read_file_test(void) U(iosb).Status = 0xdeadbabe; iosb.Information = 0xdeadbeef; ResetEvent( event ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); status = pNtReadFile( read, event, apc, &apc_count, &iosb, buffer, 1, NULL, NULL ); ok( status == STATUS_SUCCESS, "wrong status %x\n", status ); ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -571,7 +574,8 @@ static void read_file_test(void) 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" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* partial read is good enough */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( is_signaled( event ), "event is signaled\n" );
1
0
0
0
Dmitry Timoshkov : ntdll: Last parameter of NtSetIoCompletion is 64-bit on 64-bit platforms.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 7cab2e99c314b08fa4d81e82b32035d7293f4327 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7cab2e99c314b08fa4d81e82b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Aug 20 20:20:39 2013 +0900 ntdll: Last parameter of NtSetIoCompletion is 64-bit on 64-bit platforms. --- dlls/ntdll/sync.c | 4 ++-- dlls/ntdll/tests/file.c | 14 +++++++++++--- include/winternl.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 58dde65..7e3b57f 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -1297,11 +1297,11 @@ NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK Desire */ NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKey, ULONG_PTR CompletionValue, NTSTATUS Status, - ULONG NumberOfBytesTransferred ) + SIZE_T NumberOfBytesTransferred ) { NTSTATUS status; - TRACE("(%p, %lx, %lx, %x, %d)\n", CompletionPort, CompletionKey, + TRACE("(%p, %lx, %lx, %x, %lx)\n", CompletionPort, CompletionKey, CompletionValue, Status, NumberOfBytesTransferred); SERVER_START_REQ( add_completion ) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 3a1efdd..77a8431 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -72,7 +72,7 @@ static NTSTATUS (WINAPI *pNtCreateIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_AT static NTSTATUS (WINAPI *pNtOpenIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES); static NTSTATUS (WINAPI *pNtQueryIoCompletion)(HANDLE, IO_COMPLETION_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI *pNtRemoveIoCompletion)(HANDLE, PULONG_PTR, PULONG_PTR, PIO_STATUS_BLOCK, PLARGE_INTEGER); -static NTSTATUS (WINAPI *pNtSetIoCompletion)(HANDLE, ULONG_PTR, ULONG_PTR, NTSTATUS, ULONG); +static NTSTATUS (WINAPI *pNtSetIoCompletion)(HANDLE, ULONG_PTR, ULONG_PTR, NTSTATUS, SIZE_T); static NTSTATUS (WINAPI *pNtSetInformationFile)(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtQueryInformationFile)(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK, @@ -990,8 +990,11 @@ static void test_iocp_setcompletion(HANDLE h) { NTSTATUS res; ULONG count; + SIZE_T size = 3; - res = pNtSetIoCompletion( h, CKEY_FIRST, CVALUE_FIRST, STATUS_INVALID_DEVICE_REQUEST, 3 ); + if (sizeof(size) > 4) size |= (ULONGLONG)0x12345678 << 32; + + res = pNtSetIoCompletion( h, CKEY_FIRST, CVALUE_FIRST, STATUS_INVALID_DEVICE_REQUEST, size ); ok( res == STATUS_SUCCESS, "NtSetIoCompletion failed: %x\n", res ); count = get_pending_msgs(h); @@ -1000,7 +1003,12 @@ static void test_iocp_setcompletion(HANDLE h) if (get_msg(h)) { ok( completionKey == CKEY_FIRST, "Invalid completion key: %lx\n", completionKey ); - ok( ioSb.Information == 3, "Invalid ioSb.Information: %ld\n", ioSb.Information ); + /* FIXME: Remove once Wine is fixed */ + if (sizeof(size) > 4) +todo_wine + ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); + else + ok( ioSb.Information == size, "Invalid ioSb.Information: %lu\n", ioSb.Information ); ok( U(ioSb).Status == STATUS_INVALID_DEVICE_REQUEST, "Invalid ioSb.Status: %x\n", U(ioSb).Status); ok( completionValue == CVALUE_FIRST, "Invalid completion value: %lx\n", completionValue ); } diff --git a/include/winternl.h b/include/winternl.h index 07ebbab..d3c1ce8 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2208,7 +2208,7 @@ NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLA NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE); -NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,ULONG); +NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T); NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY); NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE); NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
1
0
0
0
Alexandre Julliard : ntdll: Silence some printf format warnings.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: c2d7347e2a0c1a59a25817660d233f858dd52b67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2d7347e2a0c1a59a25817660…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 20 20:51:19 2013 +0200 ntdll: Silence some printf format warnings. --- dlls/ntdll/signal_x86_64.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index f5a8ec9..8bcf71b 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1826,7 +1826,7 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun if (is_inside_signal_stack( stack )) { ERR( "nested exception on signal stack in thread %04x eip %016lx esp %016lx stack %p-%p\n", - GetCurrentThreadId(), RIP_sig(sigcontext), RSP_sig(sigcontext), + GetCurrentThreadId(), (ULONG_PTR)RIP_sig(sigcontext), (ULONG_PTR)RSP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, NtCurrentTeb()->Tib.StackBase ); abort_thread(1); } @@ -1836,7 +1836,7 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun (char *)stack > (char *)NtCurrentTeb()->Tib.StackBase) { WARN( "exception outside of stack limits in thread %04x eip %016lx esp %016lx stack %p-%p\n", - GetCurrentThreadId(), RIP_sig(sigcontext), RSP_sig(sigcontext), + GetCurrentThreadId(), (ULONG_PTR)RIP_sig(sigcontext), (ULONG_PTR)RSP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, NtCurrentTeb()->Tib.StackBase ); } else if ((char *)(stack - 1) < (char *)NtCurrentTeb()->DeallocationStack + 4096) @@ -1844,8 +1844,8 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun /* stack overflow on last page, unrecoverable */ UINT diff = (char *)NtCurrentTeb()->DeallocationStack + 4096 - (char *)(stack - 1); ERR( "stack overflow %u bytes in thread %04x eip %016lx esp %016lx stack %p-%p-%p\n", - diff, GetCurrentThreadId(), RIP_sig(sigcontext), - RSP_sig(sigcontext), NtCurrentTeb()->DeallocationStack, + diff, GetCurrentThreadId(), (ULONG_PTR)RIP_sig(sigcontext), + (ULONG_PTR)RSP_sig(sigcontext), NtCurrentTeb()->DeallocationStack, NtCurrentTeb()->Tib.StackLimit, NtCurrentTeb()->Tib.StackBase ); abort_thread(1); } @@ -1857,8 +1857,8 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun { UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)(stack - 1); ERR( "stack overflow %u bytes in thread %04x eip %016lx esp %016lx stack %p-%p-%p\n", - diff, GetCurrentThreadId(), RIP_sig(sigcontext), - RSP_sig(sigcontext), NtCurrentTeb()->DeallocationStack, + diff, GetCurrentThreadId(), (ULONG_PTR)RIP_sig(sigcontext), + (ULONG_PTR)RSP_sig(sigcontext), NtCurrentTeb()->DeallocationStack, NtCurrentTeb()->Tib.StackLimit, NtCurrentTeb()->Tib.StackBase ); abort_thread(1); } @@ -2255,7 +2255,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) rec->ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; break; default: - ERR( "Got unexpected trap %ld\n", TRAP_sig(ucontext) ); + ERR( "Got unexpected trap %ld\n", (ULONG_PTR)TRAP_sig(ucontext) ); /* fall through */ case TRAP_x86_NMI: /* NMI interrupt */ case TRAP_x86_DNA: /* Device not available exception */
1
0
0
0
Alexandre Julliard : ntdll: Add a magic number to validate timer queue pointers.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 2810c5647f70bfaca2f76f3f72553fb2bbaae879 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2810c5647f70bfaca2f76f3f7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 20 20:13:58 2013 +0200 ntdll: Add a magic number to validate timer queue pointers. --- dlls/ntdll/threadpool.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index e33a025..4edd069 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -553,6 +553,7 @@ struct queue_timer struct timer_queue { + DWORD magic; RTL_CRITICAL_SECTION cs; struct list timers; /* sorted by expiration time */ BOOL quit; /* queue should be deleted; once set, never unset */ @@ -561,6 +562,7 @@ struct timer_queue }; #define EXPIRE_NEVER (~(ULONGLONG) 0) +#define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ static void queue_remove_timer(struct queue_timer *t) { @@ -748,6 +750,7 @@ static void WINAPI timer_queue_thread_proc(LPVOID p) NtClose(q->event); RtlDeleteCriticalSection(&q->cs); + q->magic = 0; RtlFreeHeap(GetProcessHeap(), 0, q); } @@ -788,6 +791,7 @@ NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE NewTimerQueue) RtlInitializeCriticalSection(&q->cs); list_init(&q->timers); q->quit = FALSE; + q->magic = TIMER_QUEUE_MAGIC; status = NtCreateEvent(&q->event, EVENT_ALL_ACCESS, NULL, SynchronizationEvent, FALSE); if (status != STATUS_SUCCESS) { @@ -830,7 +834,7 @@ NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent) HANDLE thread; NTSTATUS status; - if (!q) + if (!q || q->magic != TIMER_QUEUE_MAGIC) return STATUS_INVALID_HANDLE; thread = q->thread; @@ -925,8 +929,9 @@ NTSTATUS WINAPI RtlCreateTimer(PHANDLE NewTimer, HANDLE TimerQueue, NTSTATUS status; struct queue_timer *t; struct timer_queue *q = get_timer_queue(TimerQueue); - if (!q) - return STATUS_NO_MEMORY; + + if (!q) return STATUS_NO_MEMORY; + if (q->magic != TIMER_QUEUE_MAGIC) return STATUS_INVALID_HANDLE; t = RtlAllocateHeap(GetProcessHeap(), 0, sizeof *t); if (!t)
1
0
0
0
Hans Leidekker : rpcrt4: Try to authorize with the first HTTP request instead of waiting for a challenge .
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: d5b2c8e943445bbe5361ff6975578a116b91ba44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5b2c8e943445bbe5361ff697…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Aug 20 12:55:13 2013 +0200 rpcrt4: Try to authorize with the first HTTP request instead of waiting for a challenge. --- dlls/rpcrt4/rpc_transport.c | 99 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 99 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 921c43d..e7f10ab 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2355,6 +2355,98 @@ static RPC_STATUS rpcrt4_http_prepare_out_pipe(HINTERNET out_request, return RPC_S_OK; } +static UINT encode_base64(const char *bin, unsigned int len, WCHAR *base64) +{ + static char enc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + UINT i = 0, x; + + while (len > 0) + { + /* first 6 bits, all from bin[0] */ + base64[i++] = enc[(bin[0] & 0xfc) >> 2]; + x = (bin[0] & 3) << 4; + + /* next 6 bits, 2 from bin[0] and 4 from bin[1] */ + if (len == 1) + { + base64[i++] = enc[x]; + base64[i++] = '='; + base64[i++] = '='; + break; + } + base64[i++] = enc[x | ((bin[1] & 0xf0) >> 4)]; + x = (bin[1] & 0x0f) << 2; + + /* next 6 bits 4 from bin[1] and 2 from bin[2] */ + if (len == 2) + { + base64[i++] = enc[x]; + base64[i++] = '='; + break; + } + base64[i++] = enc[x | ((bin[2] & 0xc0) >> 6)]; + + /* last 6 bits, all from bin [2] */ + base64[i++] = enc[bin[2] & 0x3f]; + bin += 3; + len -= 3; + } + base64[i] = 0; + return i; +} + +static RPC_STATUS insert_authorization_header(HINTERNET request, RpcQualityOfService *qos) +{ + static const WCHAR basicW[] = + {'A','u','t','h','o','r','i','z','a','t','i','o','n',':',' ','B','a','s','i','c',' '}; + RPC_HTTP_TRANSPORT_CREDENTIALS_W *creds; + SEC_WINNT_AUTH_IDENTITY_W *id; + int len, datalen, userlen, passlen; + WCHAR *header, *ptr; + char *data; + RPC_STATUS status = RPC_S_SERVER_UNAVAILABLE; + + if (!qos || qos->qos->AdditionalSecurityInfoType != RPC_C_AUTHN_INFO_TYPE_HTTP) + return RPC_S_OK; + + creds = qos->qos->u.HttpCredentials; + if (creds->AuthenticationTarget != RPC_C_HTTP_AUTHN_TARGET_SERVER || !creds->NumberOfAuthnSchemes) + return RPC_S_OK; + + if (creds->AuthnSchemes[0] != RPC_C_HTTP_AUTHN_SCHEME_BASIC) + { + FIXME("scheme %u not supported\n", creds->AuthnSchemes[0]); + return RPC_S_OK; + } + id = creds->TransportCredentials; + if (!id->User || !id->Password) return RPC_S_OK; + + userlen = WideCharToMultiByte(CP_UTF8, 0, id->User, id->UserLength, NULL, 0, NULL, NULL); + passlen = WideCharToMultiByte(CP_UTF8, 0, id->Password, id->PasswordLength, NULL, 0, NULL, NULL); + + datalen = userlen + passlen + 1; + if (!(data = HeapAlloc(GetProcessHeap(), 0, datalen))) return RPC_S_OUT_OF_MEMORY; + + WideCharToMultiByte(CP_UTF8, 0, id->User, id->UserLength, data, userlen, NULL, NULL); + data[userlen] = ':'; + WideCharToMultiByte(CP_UTF8, 0, id->Password, id->PasswordLength, data + userlen + 1, passlen, NULL, NULL); + + len = ((datalen + 2) * 4) / 3; + if ((header = HeapAlloc(GetProcessHeap(), 0, sizeof(basicW) + (len + 2) * sizeof(WCHAR)))) + { + memcpy(header, basicW, sizeof(basicW)); + ptr = header + sizeof(basicW) / sizeof(basicW[0]); + len = encode_base64(data, datalen, ptr); + ptr[len++] = '\r'; + ptr[len++] = '\n'; + ptr[len] = 0; + if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_ADD_IF_NEW))) status = RPC_S_OK; + HeapFree(GetProcessHeap(), 0, header); + } + HeapFree(GetProcessHeap(), 0, data); + return status; +} + static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) { RpcConnection_http *httpc = (RpcConnection_http *)Connection; @@ -2415,6 +2507,10 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) HeapFree(GetProcessHeap(), 0, url); return RPC_S_SERVER_UNAVAILABLE; } + status = insert_authorization_header(httpc->in_request, httpc->common.QOS); + if (status != RPC_S_OK) + return status; + httpc->out_request = HttpOpenRequestW(httpc->session, wszVerbOut, url, NULL, NULL, wszAcceptTypes, flags, (DWORD_PTR)httpc->async_data); HeapFree(GetProcessHeap(), 0, url); @@ -2423,6 +2519,9 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) ERR("HttpOpenRequestW failed with error %d\n", GetLastError()); return RPC_S_SERVER_UNAVAILABLE; } + status = insert_authorization_header(httpc->out_request, httpc->common.QOS); + if (status != RPC_S_OK) + return status; status = rpcrt4_http_prepare_in_pipe(httpc->in_request, httpc->async_data,
1
0
0
0
Hans Leidekker : rpcrt4: Trace the first authentication scheme in RpcBindingSetAuthInfoExA/W.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 1cef6a2322d8a39178ac6c86d4b14f765194ad84 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1cef6a2322d8a39178ac6c86d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Aug 20 12:54:30 2013 +0200 rpcrt4: Trace the first authentication scheme in RpcBindingSetAuthInfoExA/W. --- dlls/rpcrt4/rpc_binding.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index 161420d..5b49643 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -1663,12 +1663,13 @@ RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, const RPC_SECURITY_QOS_V2_A *SecurityQos2 = (const RPC_SECURITY_QOS_V2_A *)SecurityQos; TRACE(", AdditionalSecurityInfoType=%d", SecurityQos2->AdditionalSecurityInfoType); if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - TRACE(", { %p, 0x%x, %d, %d, %p, %s }", + TRACE(", { %p, 0x%x, %d, %d, %p(%u), %s }", SecurityQos2->u.HttpCredentials->TransportCredentials, SecurityQos2->u.HttpCredentials->Flags, SecurityQos2->u.HttpCredentials->AuthenticationTarget, SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, SecurityQos2->u.HttpCredentials->AuthnSchemes, + SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0, SecurityQos2->u.HttpCredentials->ServerCertificateSubject); } TRACE("}\n"); @@ -1793,12 +1794,13 @@ RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, const RPC_SECURITY_QOS_V2_W *SecurityQos2 = (const RPC_SECURITY_QOS_V2_W *)SecurityQos; TRACE(", AdditionalSecurityInfoType=%d", SecurityQos2->AdditionalSecurityInfoType); if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - TRACE(", { %p, 0x%x, %d, %d, %p, %s }", + TRACE(", { %p, 0x%x, %d, %d, %p(%u), %s }", SecurityQos2->u.HttpCredentials->TransportCredentials, SecurityQos2->u.HttpCredentials->Flags, SecurityQos2->u.HttpCredentials->AuthenticationTarget, SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, SecurityQos2->u.HttpCredentials->AuthnSchemes, + SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0, debugstr_w(SecurityQos2->u.HttpCredentials->ServerCertificateSubject)); } TRACE("}\n");
1
0
0
0
Hans Leidekker : rpcrt4: Include authentication schemes in the quality of service match.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 1e3186c6c74b1e8ec6c140eee59815d492a32335 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e3186c6c74b1e8ec6c140eee…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Aug 20 12:54:06 2013 +0200 rpcrt4: Include authentication schemes in the quality of service match. --- dlls/rpcrt4/rpc_binding.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index e575e65..161420d 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -1414,7 +1414,18 @@ BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQuali if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget) return FALSE; - /* authentication schemes and server certificate subject not currently used */ + if (http_credentials1->NumberOfAuthnSchemes != http_credentials2->NumberOfAuthnSchemes) + return FALSE; + + if ((!http_credentials1->AuthnSchemes && http_credentials2->AuthnSchemes) || + (http_credentials1->AuthnSchemes && !http_credentials2->AuthnSchemes)) + return FALSE; + + if (memcmp(http_credentials1->AuthnSchemes, http_credentials2->AuthnSchemes, + http_credentials1->NumberOfAuthnSchemes * sizeof(http_credentials1->AuthnSchemes[0]))) + return FALSE; + + /* server certificate subject not currently used */ if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials) {
1
0
0
0
Hans Leidekker : rpcrt4: Accept NULL server principal name in RpcBindingSetAuthInfoExA.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: 4557e50575c251a656a968add5aa4e3abfcb53e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4557e50575c251a656a968add…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Aug 20 12:53:30 2013 +0200 rpcrt4: Accept NULL server principal name in RpcBindingSetAuthInfoExA. --- dlls/rpcrt4/rpc_binding.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index 8152f87..e575e65 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -1729,7 +1729,7 @@ RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, if (r == RPC_S_OK) { new_auth_info->server_principal_name = RPCRT4_strdupAtoW((char *)ServerPrincName); - if (new_auth_info->server_principal_name) + if (!ServerPrincName || new_auth_info->server_principal_name) { if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); bind->AuthInfo = new_auth_info;
1
0
0
0
Nikolay Sivov : xmllite: Support predefined xml entities.
by Alexandre Julliard
20 Aug '13
20 Aug '13
Module: wine Branch: master Commit: c75726ba76935553bf37facc07677152d8956f08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c75726ba76935553bf37facc0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 20 14:07:32 2013 +0400 xmllite: Support predefined xml entities. --- dlls/xmllite/reader.c | 79 ++++++++++++++++++++++++++++++++++++++----- dlls/xmllite/tests/reader.c | 3 ++ 2 files changed, 73 insertions(+), 9 deletions(-) diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index efdc6ff..e193e9d 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -207,9 +207,9 @@ static const struct IUnknownVtbl xmlreaderinputvtbl; */ typedef struct { - WCHAR *start; /* input position where value starts */ - UINT len; /* length in WCHARs, altered after ReadValueChunk */ WCHAR *str; /* allocated null-terminated string */ + UINT len; /* length in WCHARs, altered after ReadValueChunk */ + WCHAR *start; /* input position where value starts */ } strval; static WCHAR emptyW[] = {0}; @@ -1788,11 +1788,50 @@ static void reader_normalize_space(xmlreader *reader, WCHAR *ptr) *ptr = ' '; } +static WCHAR get_predefined_entity(const strval *name) +{ + static const WCHAR entltW[] = {'l','t'}; + static const WCHAR entgtW[] = {'g','t'}; + static const WCHAR entampW[] = {'a','m','p'}; + static const WCHAR entaposW[] = {'a','p','o','s'}; + static const WCHAR entquotW[] = {'q','u','o','t'}; + + static const strval lt = { (WCHAR*)entltW, 2 }; + static const strval gt = { (WCHAR*)entgtW, 2 }; + static const strval amp = { (WCHAR*)entampW, 3 }; + static const strval apos = { (WCHAR*)entaposW, 4 }; + static const strval quot = { (WCHAR*)entquotW, 4 }; + + switch (name->str[0]) + { + case 'l': + if (strval_eq(name, <)) return '<'; + break; + case 'g': + if (strval_eq(name, >)) return '>'; + break; + case 'a': + if (strval_eq(name, &)) + return '&'; + else if (strval_eq(name, &apos)) + return '\''; + break; + case 'q': + if (strval_eq(name, ")) return '\"'; + break; + default: + ; + } + + return 0; +} + /* [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' */ static HRESULT reader_parse_reference(xmlreader *reader) { + encoded_buffer *buffer = &reader->input->buffer->utf16; WCHAR *start = reader_get_cur(reader), *ptr; WCHAR ch = 0; int len; @@ -1803,8 +1842,6 @@ static HRESULT reader_parse_reference(xmlreader *reader) if (*ptr == '#') { - encoded_buffer *buffer = &reader->input->buffer->utf16; - reader_skipn(reader, 1); ptr = reader_get_cur(reader); @@ -1850,16 +1887,40 @@ static HRESULT reader_parse_reference(xmlreader *reader) len = buffer->written - ((char*)ptr - buffer->data) - sizeof(WCHAR); memmove(start+1, ptr+1, len); - buffer->cur = (char*)start; + buffer->cur = (char*)(start+1); *start = ch; - - return S_OK; } else - FIXME("Entity references not supported\n"); + { + strval name; + HRESULT hr; - return E_NOTIMPL; + hr = reader_parse_name(reader, &name); + if (FAILED(hr)) return hr; + + ptr = reader_get_cur(reader); + if (*ptr != ';') return WC_E_SEMICOLON; + + /* predefined entities resolve to a single character */ + ch = get_predefined_entity(&name); + if (ch) + { + len = buffer->written - ((char*)ptr - buffer->data) - sizeof(WCHAR); + memmove(start+1, ptr+1, len); + buffer->cur = (char*)(start+1); + + *start = ch; + } + else + { + FIXME("undeclared entity %s\n", debugstr_wn(name.str, name.len)); + return WC_E_UNDECLAREDENTITY; + } + + } + + return S_OK; } /* [10 NS] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" */ diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index b53c044..d7400bc 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -1576,6 +1576,8 @@ static struct test_entry attributes_tests[] = { { "<a attr1=\"\r\n\tval\n\"/>", "attr1", " val ", S_OK }, { "<a attr1=\"val \"/>", "attr1", "val ", S_OK }, { "<a attr1=\"val \"/>", "attr1", "val ", S_OK }, + { "<a attr1=\"<>&'"\"/>", "attr1", "<>&\'\"", S_OK }, + { "<a attr1=\"&entname;\"/>", NULL, NULL, WC_E_UNDECLAREDENTITY }, { "<a attr1=\"val\"/>", NULL, NULL, WC_E_XMLCHARACTER }, { "<a attr1=\"val &#a;\"/>", NULL, NULL, WC_E_DIGIT, WC_E_SEMICOLON }, { "<a attr1=\"val a;\"/>", NULL, NULL, WC_E_SEMICOLON }, @@ -1583,6 +1585,7 @@ static struct test_entry attributes_tests[] = { { "<a attr1=\"val &#xg;\"/>", NULL, NULL, WC_E_HEXDIGIT, WC_E_SEMICOLON }, { "<a attr1=attrvalue/>", NULL, NULL, WC_E_QUOTE }, { "<a attr1=\"attr<value\"/>", NULL, NULL, WC_E_LESSTHAN }, + { "<a attr1=\"&entname\"/>", NULL, NULL, WC_E_SEMICOLON }, { NULL } };
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
47
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
Results per page:
10
25
50
100
200