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 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
2 participants
664 discussions
Start a n
N
ew thread
Alexandre Julliard : winedbg: Add context dumping for x86_64.
by Alexandre Julliard
09 Apr '09
09 Apr '09
Module: wine Branch: master Commit: 09d7fa707f9cdef672c88a9d583629b02c28032a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09d7fa707f9cdef672c88a9d5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 8 20:40:35 2009 +0200 winedbg: Add context dumping for x86_64. --- programs/winedbg/be_x86_64.c | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/programs/winedbg/be_x86_64.c b/programs/winedbg/be_x86_64.c index f2dcc1a..b1315bb 100644 --- a/programs/winedbg/be_x86_64.c +++ b/programs/winedbg/be_x86_64.c @@ -66,7 +66,41 @@ static void be_x86_64_single_step(CONTEXT* ctx, unsigned enable) static void be_x86_64_print_context(HANDLE hThread, const CONTEXT* ctx, int all_regs) { - dbg_printf("Context printing for x86_64 not done yet\n"); + char *pt, buf[33]; + + dbg_printf("Register dump:\n"); + strcpy(buf, " - 00 - - - "); + pt = buf + strlen(buf) - 1; + if (ctx->EFlags & 0x00000001) *pt-- = 'C'; /* Carry Flag */ + if (ctx->EFlags & 0x00000002) *pt-- = '1'; + if (ctx->EFlags & 0x00000004) *pt-- = 'P'; /* Parity Flag */ + if (ctx->EFlags & 0x00000008) *pt-- = '-'; + if (ctx->EFlags & 0x00000010) *pt-- = 'A'; /* Auxiliary Carry Flag */ + if (ctx->EFlags & 0x00000020) *pt-- = '-'; + if (ctx->EFlags & 0x00000040) *pt-- = 'Z'; /* Zero Flag */ + if (ctx->EFlags & 0x00000080) *pt-- = 'S'; /* Sign Flag */ + if (ctx->EFlags & 0x00000100) *pt-- = 'T'; /* Trap/Trace Flag */ + if (ctx->EFlags & 0x00000200) *pt-- = 'I'; /* Interrupt Enable Flag */ + if (ctx->EFlags & 0x00000400) *pt-- = 'D'; /* Direction Indicator */ + if (ctx->EFlags & 0x00000800) *pt-- = 'O'; /* Overflow flags */ + if (ctx->EFlags & 0x00001000) *pt-- = '1'; /* I/O Privilege Level */ + if (ctx->EFlags & 0x00002000) *pt-- = '1'; /* I/O Privilege Level */ + if (ctx->EFlags & 0x00004000) *pt-- = 'N'; /* Nested Task Flag */ + if (ctx->EFlags & 0x00008000) *pt-- = '-'; + if (ctx->EFlags & 0x00010000) *pt-- = 'R'; /* Resume Flag */ + if (ctx->EFlags & 0x00020000) *pt-- = 'V'; /* Vritual Mode Flag */ + if (ctx->EFlags & 0x00040000) *pt-- = 'a'; /* Alignment Check Flag */ + + dbg_printf(" rip:%016lx rsp:%016lx rbp:%016lx eflags:%08x (%s)\n", + ctx->Rip, ctx->Rsp, ctx->Rbp, ctx->EFlags, buf); + dbg_printf(" rax:%016lx rbx:%016lx rcx:%016lx rdx:%016lx\n", + ctx->Rax, ctx->Rbx, ctx->Rcx, ctx->Rdx); + dbg_printf(" rsi:%016lx rdi:%016lx r8:%016lx r9:%016lx r10:%016lx\n", + ctx->Rsi, ctx->Rdi, ctx->R8, ctx->R9, ctx->R10 ); + dbg_printf(" r11:%016lx r12:%016lx r13:%016lx r14:%016lx r15:%016lx\n", + ctx->R11, ctx->R12, ctx->R13, ctx->R14, ctx->R15 ); + + if (all_regs) dbg_printf( "Floating point x86_64 dump not implemented\n" ); } static void be_x86_64_print_segment_info(HANDLE hThread, const CONTEXT* ctx)
1
0
0
0
Alexandre Julliard : ntdll: Set the proper context flags in the signal handlers for x86_64.
by Alexandre Julliard
09 Apr '09
09 Apr '09
Module: wine Branch: master Commit: 0865c278f27da7d0a45128caeeed99d090a80ff1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0865c278f27da7d0a45128cae…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 8 20:40:29 2009 +0200 ntdll: Set the proper context flags in the signal handlers for x86_64. --- dlls/ntdll/signal_x86_64.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 7a0defa..dfb1b51 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -189,6 +189,7 @@ static inline int dispatch_signal(unsigned int sig) */ static void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext ) { + context->ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS; context->Rax = RAX_sig(sigcontext); context->Rcx = RCX_sig(sigcontext); context->Rdx = RDX_sig(sigcontext); @@ -214,7 +215,11 @@ static void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext ) context->SegEs = 0; /* FIXME */ context->SegSs = 0; /* FIXME */ context->MxCsr = 0; /* FIXME */ - if (FPU_sig(sigcontext)) context->u.FltSave = *FPU_sig(sigcontext); + if (FPU_sig(sigcontext)) + { + context->ContextFlags |= CONTEXT_FLOATING_POINT; + context->u.FltSave = *FPU_sig(sigcontext); + } }
1
0
0
0
Alexandre Julliard : server: Define a generic context structure instead of using the platform-specific version .
by Alexandre Julliard
09 Apr '09
09 Apr '09
Module: wine Branch: master Commit: 5316dd011f15ca488ccfa69b5873b075407fe238 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5316dd011f15ca488ccfa69b5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 8 19:38:02 2009 +0200 server: Define a generic context structure instead of using the platform-specific version. --- dlls/ntdll/exception.c | 20 ++- dlls/ntdll/ntdll_misc.h | 2 + dlls/ntdll/signal_i386.c | 144 +++++++++++++++++ dlls/ntdll/signal_powerpc.c | 214 ++++++++++++++++++++++++- dlls/ntdll/signal_sparc.c | 132 +++++++++++++++ dlls/ntdll/signal_x86_64.c | 137 ++++++++++++++++ dlls/ntdll/thread.c | 51 +++++-- include/wine/server_protocol.h | 60 +++++++- server/Makefile.in | 5 - server/context_alpha.c | 348 ---------------------------------------- server/context_i386.c | 104 ------------ server/context_powerpc.c | 286 --------------------------------- server/context_sparc.c | 184 --------------------- server/context_x86_64.c | 104 ------------ server/debugger.c | 8 +- server/mach.c | 67 ++++----- server/procfs.c | 10 +- server/protocol.def | 58 +++++++- server/ptrace.c | 119 +++++++------- server/request.h | 3 +- server/thread.c | 83 ++++++++-- server/thread.h | 14 +-- server/trace.c | 210 +++++++++++++++++++++---- 23 files changed, 1135 insertions(+), 1228 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5316dd011f15ca488ccfa…
1
0
0
0
Alexandre Julliard : server: Make all dump function take a prefix string to simplify the tracing code.
by Alexandre Julliard
09 Apr '09
09 Apr '09
Module: wine Branch: master Commit: 53929f19066af05c92373dcd662c1d007b2f7692 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53929f19066af05c92373dcd6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Apr 3 18:02:21 2009 +0200 server: Make all dump function take a prefix string to simplify the tracing code. --- server/trace.c | 2778 ++++++++++++++++++++++----------------------------- tools/make_requests | 23 +- 2 files changed, 1202 insertions(+), 1599 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=53929f19066af05c92373…
1
0
0
0
Hans Leidekker : wininet: Add tests for asynchronous HttpSendRequestEx/ HttpEndRequest.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: 75857d7d67d9ce9cf1870cbd821364b28e458f82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=75857d7d67d9ce9cf1870cbd8…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Wed Apr 8 15:23:14 2009 +0200 wininet: Add tests for asynchronous HttpSendRequestEx/HttpEndRequest. --- dlls/wininet/tests/http.c | 192 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 192 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 044b96f..a573e14 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2285,6 +2285,197 @@ static void test_open_url_async(void) CloseHandle(ctx.event); } +enum api +{ + internet_connect = 1, + http_open_request, + http_send_request_ex, + internet_writefile, + http_end_request, + internet_close_handle +}; + +struct notification +{ + enum api function; /* api responsible for notification */ + unsigned int status; /* status received */ + int async; /* delivered from another thread? */ + int todo; +}; + +struct info +{ + enum api function; + const struct notification *test; + unsigned int count; + unsigned int index; + HANDLE wait; + DWORD thread; + unsigned int line; +}; + +static CRITICAL_SECTION notification_cs; + +static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen ) +{ + BOOL status_ok, function_ok; + struct info *info = (struct info *)context; + unsigned int i; + + EnterCriticalSection( ¬ification_cs ); + + if (status == INTERNET_STATUS_HANDLE_CREATED) + { + DWORD size = sizeof(struct info *); + HttpQueryInfoA( handle, INTERNET_OPTION_CONTEXT_VALUE, &info, &size, 0 ); + } + i = info->index; + if (i >= info->count) + { + LeaveCriticalSection( ¬ification_cs ); + return; + } + + status_ok = (info->test[i].status == status); + function_ok = (info->test[i].function == info->function); + + if (!info->test[i].todo) + { + ok( status_ok, "%u: expected status %u got %u\n", info->line, info->test[i].status, status ); + ok( function_ok, "%u: expected function %u got %u\n", info->line, info->test[i].function, info->function ); + + if (info->test[i].async) + ok(info->thread != GetCurrentThreadId(), "%u: expected thread %u got %u\n", + info->line, info->thread, GetCurrentThreadId()); + } + else + { + todo_wine ok( status_ok, "%u: expected status %u got %u\n", info->line, info->test[i].status, status ); + if (status_ok) + todo_wine ok( function_ok, "%u: expected function %u got %u\n", info->line, info->test[i].function, info->function ); + } + if (i == info->count - 1 || info->test[i].function != info->test[i + 1].function) SetEvent( info->wait ); + info->index++; + + LeaveCriticalSection( ¬ification_cs ); +} + +static void setup_test( struct info *info, enum api function, unsigned int line ) +{ + info->function = function; + info->line = line; +} + +static const struct notification async_send_request_ex_test[] = +{ + { internet_connect, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_open_request, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_send_request_ex, INTERNET_STATUS_RESOLVING_NAME, 1 }, + { http_send_request_ex, INTERNET_STATUS_NAME_RESOLVED, 1 }, + { http_send_request_ex, INTERNET_STATUS_CONNECTING_TO_SERVER, 1 }, + { http_send_request_ex, INTERNET_STATUS_CONNECTED_TO_SERVER, 1 }, + { http_send_request_ex, INTERNET_STATUS_SENDING_REQUEST, 1 }, + { http_send_request_ex, INTERNET_STATUS_REQUEST_SENT, 1 }, + { http_send_request_ex, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { internet_writefile, INTERNET_STATUS_SENDING_REQUEST, 0 }, + { internet_writefile, INTERNET_STATUS_REQUEST_SENT, 0 }, + { http_end_request, INTERNET_STATUS_RECEIVING_RESPONSE, 1 }, + { http_end_request, INTERNET_STATUS_RESPONSE_RECEIVED, 1 }, + { http_end_request, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, 1 }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, 1 } +}; + +static void test_async_HttpSendRequestEx(void) +{ + BOOL ret; + HINTERNET ses, req, con; + struct info info; + DWORD size, written, error; + INTERNET_BUFFERSA b; + static const char *accept[2] = {"*/*", NULL}; + static char data[] = "Public ID=codeweavers"; + char buffer[32]; + + InitializeCriticalSection( ¬ification_cs ); + + info.test = async_send_request_ex_test; + info.count = sizeof(async_send_request_ex_test)/sizeof(async_send_request_ex_test[0]); + info.index = 0; + info.wait = CreateEvent( NULL, FALSE, FALSE, NULL ); + info.thread = GetCurrentThreadId(); + + ses = InternetOpen( "winetest", 0, NULL, NULL, INTERNET_FLAG_ASYNC ); + ok( ses != NULL, "InternetOpen failed\n" ); + + pInternetSetStatusCallbackA( ses, check_notification ); + + setup_test( &info, internet_connect, __LINE__ ); + con = InternetConnect( ses, "
crossover.codeweavers.com
", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)&info ); + ok( con != NULL, "InternetConnect failed %u\n", GetLastError() ); + + WaitForSingleObject( info.wait, 10000 ); + + setup_test( &info, http_open_request, __LINE__ ); + req = HttpOpenRequest( con, "POST", "posttest.php", NULL, NULL, accept, 0, (DWORD_PTR)&info ); + ok( req != NULL, "HttpOpenRequest failed %u\n", GetLastError() ); + + WaitForSingleObject( info.wait, 10000 ); + + memset( &b, 0, sizeof(INTERNET_BUFFERSA) ); + b.dwStructSize = sizeof(INTERNET_BUFFERSA); + b.lpcszHeader = "Content-Type: application/x-www-form-urlencoded"; + b.dwHeadersLength = strlen( b.lpcszHeader ); + b.dwBufferTotal = strlen( data ); + + setup_test( &info, http_send_request_ex, __LINE__ ); + ret = HttpSendRequestExA( req, &b, NULL, 0x28, 0 ); + ok( !ret && GetLastError() == ERROR_IO_PENDING, "HttpSendRequestExA failed %d %u\n", ret, GetLastError() ); + + WaitForSingleObject( info.wait, 10000 ); + + size = sizeof(buffer); + SetLastError( 0xdeadbeef ); + ret = HttpQueryInfoA( req, HTTP_QUERY_CONTENT_ENCODING, buffer, &size, 0 ); + error = GetLastError(); + ok( !ret, "HttpQueryInfoA failed %u\n", GetLastError() ); + todo_wine + ok( error == ERROR_INTERNET_INCORRECT_HANDLE_STATE, + "expected ERROR_INTERNET_INCORRECT_HANDLE_STATE got %u\n", error ); + + written = 0; + size = strlen( data ); + setup_test( &info, internet_writefile, __LINE__ ); + ret = InternetWriteFile( req, data, size, &written ); + ok( ret, "InternetWriteFile failed %u\n", GetLastError() ); + ok( written == size, "expected %u got %u\n", written, size ); + + WaitForSingleObject( info.wait, 10000 ); + + SetLastError( 0xdeadbeef ); + ret = HttpEndRequestA( req, (void *)data, 0x28, 0 ); + error = GetLastError(); + ok( !ret, "HttpEndRequestA succeeded\n" ); + ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", error ); + + SetLastError( 0xdeadbeef ); + setup_test( &info, http_end_request, __LINE__ ); + ret = HttpEndRequestA( req, NULL, 0x28, 0 ); + error = GetLastError(); + ok( !ret, "HttpEndRequestA succeeded\n" ); + ok( error == ERROR_IO_PENDING, "expected ERROR_IO_PENDING got %u\n", error ); + + WaitForSingleObject( info.wait, 10000 ); + + setup_test( &info, internet_close_handle, __LINE__ ); + InternetCloseHandle( req ); + InternetCloseHandle( con ); + InternetCloseHandle( ses ); + + WaitForSingleObject( info.wait, 10000 ); + CloseHandle( info.wait ); +} + #define STATUS_STRING(status) \ memcpy(status_string[status], #status, sizeof(CHAR) * \ (strlen(#status) < MAX_STATUS_NAME ? \ @@ -2341,6 +2532,7 @@ START_TEST(http) InternetReadFile_test(0); InternetReadFileExA_test(INTERNET_FLAG_ASYNC); test_open_url_async(); + test_async_HttpSendRequestEx(); } InternetOpenRequest_test(); test_http_cache();
1
0
0
0
Hans Leidekker : wininet: Support asynchronous HttpEndRequest.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: 8077480b0e793219216b336c8d241a676afb4986 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8077480b0e793219216b336c8…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Wed Apr 8 15:22:44 2009 +0200 wininet: Support asynchronous HttpEndRequest. --- dlls/wininet/http.c | 168 ++++++++++++++++++++++++----------------------- dlls/wininet/internet.h | 7 ++ 2 files changed, 93 insertions(+), 82 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 3777d4c..8d03b61 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -714,57 +714,87 @@ BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext) { - LPINTERNET_BUFFERSA ptr; - LPINTERNET_BUFFERSW lpBuffersOutW,ptrW; + TRACE("(%p, %p, %08x, %08lx)\n", hRequest, lpBuffersOut, dwFlags, dwContext); + + if (lpBuffersOut) + { + INTERNET_SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + return HttpEndRequestW(hRequest, NULL, dwFlags, dwContext); +} + +static BOOL HTTP_HttpEndRequestW(LPWININETHTTPREQW lpwhr, DWORD dwFlags, DWORD_PTR dwContext) +{ BOOL rc = FALSE; + INT responseLen; + DWORD dwBufferSize; + INTERNET_ASYNC_RESULT iar; - TRACE("(%p, %p, %08x, %08lx): stub\n", hRequest, lpBuffersOut, dwFlags, - dwContext); + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_RECEIVING_RESPONSE, NULL, 0); - ptr = lpBuffersOut; - if (ptr) - lpBuffersOutW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(INTERNET_BUFFERSW)); - else - lpBuffersOutW = NULL; + responseLen = HTTP_GetResponseHeaders(lpwhr, TRUE); + if (responseLen) + rc = TRUE; - ptrW = lpBuffersOutW; - while (ptr) - { - if (ptr->lpvBuffer && ptr->dwBufferLength) - ptrW->lpvBuffer = HeapAlloc(GetProcessHeap(),0,ptr->dwBufferLength); - ptrW->dwBufferLength = ptr->dwBufferLength; - ptrW->dwBufferTotal= ptr->dwBufferTotal; + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_RESPONSE_RECEIVED, &responseLen, sizeof(DWORD)); - if (ptr->Next) - ptrW->Next = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, - sizeof(INTERNET_BUFFERSW)); + /* process cookies here. Is this right? */ + HTTP_ProcessCookies(lpwhr); - ptr = ptr->Next; - ptrW = ptrW->Next; - } + dwBufferSize = sizeof(lpwhr->dwContentLength); + if (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_CONTENT_LENGTH, + &lpwhr->dwContentLength, &dwBufferSize, NULL)) + lpwhr->dwContentLength = -1; - rc = HttpEndRequestW(hRequest, lpBuffersOutW, dwFlags, dwContext); + if (lpwhr->dwContentLength == 0) + HTTP_FinishedReading(lpwhr); - if (lpBuffersOutW) + if (!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_AUTO_REDIRECT)) { - ptrW = lpBuffersOutW; - while (ptrW) + DWORD dwCode,dwCodeLength = sizeof(DWORD); + if (HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_STATUS_CODE, &dwCode, &dwCodeLength, NULL) && + (dwCode == 302 || dwCode == 301 || dwCode == 303)) { - LPINTERNET_BUFFERSW ptrW2; - - FIXME("Do we need to translate info out of these buffer?\n"); - - HeapFree(GetProcessHeap(),0,ptrW->lpvBuffer); - ptrW2 = ptrW->Next; - HeapFree(GetProcessHeap(),0,ptrW); - ptrW = ptrW2; + WCHAR szNewLocation[INTERNET_MAX_URL_LENGTH]; + dwBufferSize=sizeof(szNewLocation); + if (HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_LOCATION, szNewLocation, &dwBufferSize, NULL)) + { + /* redirects are always GETs */ + HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb); + lpwhr->lpszVerb = WININET_strdupW(szGET); + HTTP_DrainContent(lpwhr); + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_REDIRECT, szNewLocation, dwBufferSize); + rc = HTTP_HandleRedirect(lpwhr, szNewLocation); + if (rc) + rc = HTTP_HttpSendRequestW(lpwhr, NULL, 0, NULL, 0, 0, TRUE); + } } } + iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet; + iar.dwError = rc ? 0 : INTERNET_GetLastError(); + + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_REQUEST_COMPLETE, &iar, + sizeof(INTERNET_ASYNC_RESULT)); return rc; } +static void AsyncHttpEndRequestProc(WORKREQUEST *work) +{ + struct WORKREQ_HTTPENDREQUESTW const *req = &work->u.HttpEndRequestW; + LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)work->hdr; + + TRACE("%p\n", lpwhr); + + HTTP_HttpEndRequestW(lpwhr, req->dwFlags, req->dwContext); +} + /*********************************************************************** * HttpEndRequestW (WININET.@) * @@ -780,10 +810,15 @@ BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, { BOOL rc = FALSE; LPWININETHTTPREQW lpwhr; - INT responseLen; - DWORD dwBufferSize; TRACE("-->\n"); + + if (lpBuffersOut) + { + INTERNET_SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) @@ -791,58 +826,27 @@ BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); if (lpwhr) WININET_Release( &lpwhr->hdr ); - return FALSE; + return FALSE; } - lpwhr->hdr.dwFlags |= dwFlags; - lpwhr->hdr.dwContext = dwContext; - /* We appear to do nothing with lpBuffersOut.. is that correct? */ - - SendAsyncCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, - INTERNET_STATUS_RECEIVING_RESPONSE, NULL, 0); - - responseLen = HTTP_GetResponseHeaders(lpwhr, TRUE); - if (responseLen) - rc = TRUE; - - SendAsyncCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, - INTERNET_STATUS_RESPONSE_RECEIVED, &responseLen, sizeof(DWORD)); - - /* process cookies here. Is this right? */ - HTTP_ProcessCookies(lpwhr); + if (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) + { + WORKREQUEST work; + struct WORKREQ_HTTPENDREQUESTW *request; - dwBufferSize = sizeof(lpwhr->dwContentLength); - if (!HTTP_HttpQueryInfoW(lpwhr,HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_CONTENT_LENGTH, - &lpwhr->dwContentLength,&dwBufferSize,NULL)) - lpwhr->dwContentLength = -1; + work.asyncproc = AsyncHttpEndRequestProc; + work.hdr = WININET_AddRef( &lpwhr->hdr ); - if (lpwhr->dwContentLength == 0) - HTTP_FinishedReading(lpwhr); + request = &work.u.HttpEndRequestW; + request->dwFlags = dwFlags; + request->dwContext = dwContext; - if(!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_AUTO_REDIRECT)) - { - DWORD dwCode,dwCodeLength=sizeof(DWORD); - if(HTTP_HttpQueryInfoW(lpwhr,HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_STATUS_CODE,&dwCode,&dwCodeLength,NULL) && - (dwCode==302 || dwCode==301 || dwCode==303)) - { - WCHAR szNewLocation[INTERNET_MAX_URL_LENGTH]; - dwBufferSize=sizeof(szNewLocation); - if(HTTP_HttpQueryInfoW(lpwhr,HTTP_QUERY_LOCATION,szNewLocation,&dwBufferSize,NULL)) - { - /* redirects are always GETs */ - HeapFree(GetProcessHeap(),0,lpwhr->lpszVerb); - lpwhr->lpszVerb = WININET_strdupW(szGET); - HTTP_DrainContent(lpwhr); - INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, - INTERNET_STATUS_REDIRECT, szNewLocation, - dwBufferSize); - rc = HTTP_HandleRedirect(lpwhr, szNewLocation); - if (rc) - rc = HTTP_HttpSendRequestW(lpwhr, NULL, 0, NULL, 0, 0, TRUE); - } - } + INTERNET_AsyncCall(&work); + INTERNET_SetLastError(ERROR_IO_PENDING); } + else + rc = HTTP_HttpEndRequestW(lpwhr, dwFlags, dwContext); WININET_Release( &lpwhr->hdr ); TRACE("%i <--\n",rc); diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 8e92788..f69c424 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -291,6 +291,12 @@ struct WORKREQ_HTTPSENDREQUESTW BOOL bEndRequest; }; +struct WORKREQ_HTTPENDREQUESTW +{ + DWORD dwFlags; + DWORD_PTR dwContext; +}; + struct WORKREQ_SENDCALLBACK { DWORD_PTR dwContext; @@ -337,6 +343,7 @@ typedef struct WORKREQ struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPFINDNEXTW FtpFindNextW; struct WORKREQ_HTTPSENDREQUESTW HttpSendRequestW; + struct WORKREQ_HTTPENDREQUESTW HttpEndRequestW; struct WORKREQ_SENDCALLBACK SendCallback; struct WORKREQ_INTERNETOPENURLW InternetOpenUrlW; struct WORKREQ_INTERNETREADFILEEXA InternetReadFileExA;
1
0
0
0
Hans Leidekker : wininet: Don't start reading when POST data hasn' t been completely written.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: 3a711fb56b394ffcaf1777c18b3325b4232abefe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a711fb56b394ffcaf1777c18…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Wed Apr 8 15:22:26 2009 +0200 wininet: Don't start reading when POST data hasn't been completely written. --- dlls/wininet/http.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index c35badc..3777d4c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3513,10 +3513,23 @@ lend: /* TODO: send notification for P3P header */ - if(lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) { - if(bSuccess) { - HTTP_ReceiveRequestData(lpwhr, TRUE); - }else { + if (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) + { + if (bSuccess) + { + if (lpwhr->dwBytesWritten == lpwhr->dwBytesToWrite) HTTP_ReceiveRequestData(lpwhr, TRUE); + else + { + iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet; + iar.dwError = 0; + + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_REQUEST_COMPLETE, &iar, + sizeof(INTERNET_ASYNC_RESULT)); + } + } + else + { iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet; iar.dwError = INTERNET_GetLastError();
1
0
0
0
Hans Leidekker : wininet: Send notifications from InternetWriteFile.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: 85eb438ff71733787d00b51e4cac169bc8ba24be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=85eb438ff71733787d00b51e4…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Wed Apr 8 15:22:05 2009 +0200 wininet: Send notifications from InternetWriteFile. --- dlls/wininet/http.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 4216e55..c35badc 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1878,10 +1878,13 @@ static BOOL HTTPREQ_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWOR BOOL ret; LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)hdr; + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_SENDING_REQUEST, NULL, 0); + *written = 0; if ((ret = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written))) lpwhr->dwBytesWritten += *written; + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_REQUEST_SENT, written, sizeof(DWORD)); return ret; }
1
0
0
0
Hans Leidekker : wininet: Keep track of the number of bytes written.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: 0fabf540e74d502a3a51ebc2e5fe90f1e7933cd0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0fabf540e74d502a3a51ebc2e…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Wed Apr 8 15:21:28 2009 +0200 wininet: Keep track of the number of bytes written. --- dlls/wininet/http.c | 10 +++++++++- dlls/wininet/internet.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 7b26070..4216e55 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1875,9 +1875,14 @@ static DWORD HTTPREQ_ReadFileExW(WININETHANDLEHEADER *hdr, INTERNET_BUFFERSW *bu static BOOL HTTPREQ_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWORD size, DWORD *written) { + BOOL ret; LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW)hdr; - return NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written); + *written = 0; + if ((ret = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written))) + lpwhr->dwBytesWritten += *written; + + return ret; } static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest) @@ -3259,6 +3264,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, { sprintfW(contentLengthStr, szContentLength, dwContentLength); HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW); + lpwhr->dwBytesToWrite = dwContentLength; } if (lpwhr->lpHttpSession->lpAppInfo->lpszAgent) { @@ -3357,6 +3363,8 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, NETCON_send(&lpwhr->netConnection, ascii_req, len, 0, &cnt); HeapFree( GetProcessHeap(), 0, ascii_req ); + lpwhr->dwBytesWritten = dwOptionalLength; + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_REQUEST_SENT, &len, sizeof(DWORD)); diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index fad69bd..8e92788 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -198,6 +198,8 @@ typedef struct LPWSTR lpszStatusText; DWORD dwContentLength; /* total number of bytes to be read */ DWORD dwContentRead; /* bytes of the content read so far */ + DWORD dwBytesToWrite; + DWORD dwBytesWritten; HTTPHEADERW *pCustHeaders; DWORD nCustHeaders; HANDLE hCacheFile;
1
0
0
0
Alexandre Julliard : ole32/tests: Avoid size_t in traces.
by Alexandre Julliard
08 Apr '09
08 Apr '09
Module: wine Branch: master Commit: c378490d7d89ef662e7908d0da7b093502e52ff7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c378490d7d89ef662e7908d0d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 8 16:09:34 2009 +0200 ole32/tests: Avoid size_t in traces. --- dlls/ole32/tests/clipboard.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 88b3ba6..fc55d38 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -716,7 +716,7 @@ static void test_cf_dataobject(IDataObject *data) ok(DataObjectImpl_GetDataHere_calls == 1, "got %d\n", DataObjectImpl_GetDataHere_calls); ptr = GlobalLock(h); size = GlobalSize(h); - ok(size == strlen(cmpl_stm_data), "expected %d got %d\n", strlen(cmpl_stm_data), size); + ok(size == strlen(cmpl_stm_data), "expected %d got %d\n", lstrlenA(cmpl_stm_data), size); ok(!memcmp(ptr, cmpl_stm_data, size), "mismatch\n"); GlobalUnlock(h); } @@ -731,7 +731,7 @@ static void test_cf_dataobject(IDataObject *data) ok(DataObjectImpl_GetDataHere_calls == 0, "got %d\n", DataObjectImpl_GetDataHere_calls); ptr = GlobalLock(h); size = GlobalSize(h); - ok(size == strlen(cmpl_text_data) + 1, "expected %d got %d\n", strlen(cmpl_text_data) + 1, size); + ok(size == strlen(cmpl_text_data) + 1, "expected %d got %d\n", lstrlenA(cmpl_text_data) + 1, size); ok(!memcmp(ptr, cmpl_text_data, size), "mismatch\n"); GlobalUnlock(h); }
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
67
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
Results per page:
10
25
50
100
200