ReactOS.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
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
List overview
Download
Ros-diffs
September 2008
----- 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
ros-diffs@reactos.org
27 participants
747 discussions
Start a n
N
ew thread
[cwittich] 36034: fix winhttp_winetest
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Sep 7 09:49:11 2008 New Revision: 36034 URL:
http://svn.reactos.org/svn/reactos?rev=36034&view=rev
Log: fix winhttp_winetest Modified: trunk/rostests/winetests/winhttp/testlist.c Modified: trunk/rostests/winetests/winhttp/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/testlis…
============================================================================== --- trunk/rostests/winetests/winhttp/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/testlist.c [iso-8859-1] Sun Sep 7 09:49:11 2008 @@ -6,8 +6,10 @@ #define STANDALONE #include "wine/test.h" +extern void func_winhttp(void); const struct test winetest_testlist[] = { - { 0, 0 } + { "winhttp", func_winhttp }, + { 0, 0 } };
16 years, 3 months
1
0
0
0
[pschweitzer] 36033: - Completely removed previously commented code: there's no need to keep it, that's wine specific code. - Added a diff with that change
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Sep 7 09:06:11 2008 New Revision: 36033 URL:
http://svn.reactos.org/svn/reactos?rev=36033&view=rev
Log: - Completely removed previously commented code: there's no need to keep it, that's wine specific code. - Added a diff with that change Added: trunk/reactos/dll/win32/mscoree/mscoree_ros.diff (with props) Modified: trunk/reactos/dll/win32/mscoree/mscoree_main.c Modified: trunk/reactos/dll/win32/mscoree/mscoree_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mscoree/mscoree_main.c [iso-8859-1] Sun Sep 7 09:06:11 2008 @@ -112,8 +112,6 @@ switch (fdwReason) { - //case DLL_WINE_PREATTACH: - //return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); break; Added: trunk/reactos/dll/win32/mscoree/mscoree_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_ros.diff (added) +++ trunk/reactos/dll/win32/mscoree/mscoree_ros.diff [iso-8859-1] Sun Sep 7 09:06:11 2008 @@ -1,0 +1,11 @@ +--- mscoree_main.c Tue Jun 10 13:29:52 2008 ++++ mscoree_main.c Sun Sep 07 16:53:09 2008 +@@ -112,8 +112,6 @@ + + switch (fdwReason) + { +- case DLL_WINE_PREATTACH: +- return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; Propchange: trunk/reactos/dll/win32/mscoree/mscoree_ros.diff ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 3 months
1
0
0
0
[cwittich] 36032: properly zero terminate the buffer in GetComputerName
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Sep 7 09:04:18 2008 New Revision: 36032 URL:
http://svn.reactos.org/svn/reactos?rev=36032&view=rev
Log: properly zero terminate the buffer in GetComputerName Modified: trunk/reactos/dll/win32/kernel32/misc/computername.c Modified: trunk/reactos/dll/win32/kernel32/misc/computername.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/computername.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/computername.c [iso-8859-1] Sun Sep 7 09:04:18 2008 @@ -94,9 +94,8 @@ } if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) { - *nSize = KeyInfo->DataLength / sizeof(WCHAR); + *nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1; lpBuffer[*nSize] = 0; - (*nSize)--; } RtlCopyMemory (lpBuffer,
16 years, 3 months
1
0
0
0
[pschweitzer] 36031: Commit 2/2 Imported mstask_winetest.exe, winhttp_winetest.exe from Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Sep 7 08:50:21 2008 New Revision: 36031 URL:
http://svn.reactos.org/svn/reactos?rev=36031&view=rev
Log: Commit 2/2 Imported mstask_winetest.exe, winhttp_winetest.exe from Wine HEAD Added: trunk/rostests/winetests/mstask/ (with props) trunk/rostests/winetests/mstask/mstask.rbuild (with props) trunk/rostests/winetests/mstask/task.c (with props) trunk/rostests/winetests/mstask/task_scheduler.c (with props) trunk/rostests/winetests/mstask/task_trigger.c (with props) trunk/rostests/winetests/mstask/testlist.c (with props) trunk/rostests/winetests/winhttp/ (with props) trunk/rostests/winetests/winhttp/notification.c (with props) trunk/rostests/winetests/winhttp/testlist.c (with props) trunk/rostests/winetests/winhttp/winhttp.c (with props) trunk/rostests/winetests/winhttp/winhttp.rbuild (with props) Modified: trunk/rostests/winetests/directory.rbuild Modified: trunk/rostests/winetests/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/directory.rbuil…
============================================================================== --- trunk/rostests/winetests/directory.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/directory.rbuild [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -57,6 +57,9 @@ </directory> <directory name="msi"> <xi:include href="msi/msi.rbuild" /> + </directory> + <directory name="mstask"> + <xi:include href="mstask/mstask.rbuild" /> </directory> <directory name="msvcrt"> <xi:include href="msvcrt/msvcrt.rbuild" /> @@ -124,6 +127,9 @@ <directory name="version"> <xi:include href="version/version.rbuild" /> </directory> + <directory name="winhttp"> + <xi:include href="winhttp/winhttp.rbuild" /> + </directory> <directory name="wininet"> <xi:include href="wininet/wininet.rbuild" /> </directory> Propchange: trunk/rostests/winetests/mstask/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun Sep 7 08:50:21 2008 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/mstask/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/mstask/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/winetests/mstask/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/rostests/winetests/mstask/mstask.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mstask/mstask.r…
============================================================================== --- trunk/rostests/winetests/mstask/mstask.rbuild (added) +++ trunk/rostests/winetests/mstask/mstask.rbuild [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="mstask_winetest" type="win32cui" installbase="bin" installname="mstask_winetest.exe" allowwarnings="true"> + <include base="mstask_winetest">.</include> + <define name="WINVER">0x600</define> + <define name="_WIN32_WINNT">0x600</define> + <file>task.c</file> + <file>task_scheduler.c</file> + <file>task_trigger.c</file> + <file>testlist.c</file> + <library>wine</library> + <library>ole32</library> + <library>kernel32</library> + <library>ntdll</library> +</module> +</group> Propchange: trunk/rostests/winetests/mstask/mstask.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/mstask/task.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mstask/task.c?r…
============================================================================== --- trunk/rostests/winetests/mstask/task.c (added) +++ trunk/rostests/winetests/mstask/task.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,520 @@ +/* + * Test suite for Task interface + * + * Copyright (C) 2008 Google (Roy Shea) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "corerror.h" +#include "mstask.h" +#include "wine/test.h" + +static ITaskScheduler *test_task_scheduler; +static ITask *test_task; +static const WCHAR empty[] = {0}; + +/* allocate some tmp string space */ +/* FIXME: this is not 100% thread-safe */ +static char *get_tmp_space(int size) +{ + static char *list[16]; + static long pos; + char *ret; + int idx; + + idx = ++pos % (sizeof(list)/sizeof(list[0])); + if ((ret = realloc(list[idx], size))) + list[idx] = ret; + return ret; +} + +static const char *dbgstr_w(LPCWSTR str) +{ + char *buf; + int len; + if(!str) + return "(null)"; + len = lstrlenW(str) + 1; + buf = get_tmp_space(len); + WideCharToMultiByte(CP_ACP, 0, str, -1, buf, len, NULL, NULL); + return buf; +} + +static BOOL setup_task(void) +{ + HRESULT hres; + const WCHAR task_name[] = {'T','e','s','t','i','n','g', 0}; + + hres = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **) &test_task_scheduler); + if(hres != S_OK) + return FALSE; + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, &CLSID_CTask, + &IID_ITask, (IUnknown**)&test_task); + if(hres != S_OK) + { + ITaskScheduler_Release(test_task_scheduler); + return FALSE; + } + return TRUE; +} + +static void cleanup_task(void) +{ + ITask_Release(test_task); + ITaskScheduler_Release(test_task_scheduler); +} + +static LPCWSTR path_resolve_name(LPCWSTR base_name) +{ + static WCHAR buffer[MAX_PATH]; + int len; + + len = SearchPathW(NULL, base_name, NULL, 0, NULL, NULL); + if (len == 0) + return base_name; + else if (len < MAX_PATH) + { + SearchPathW(NULL, base_name, NULL, MAX_PATH, buffer, NULL); + return buffer; + } + return NULL; +} + +static void test_SetApplicationName_GetApplicationName(void) +{ + BOOL setup; + HRESULT hres; + LPWSTR stored_name; + LPCWSTR full_name; + const WCHAR non_application_name[] = {'N','o','S','u','c','h', + 'A','p','p','l','i','c','a','t','i','o','n', 0}; + const WCHAR notepad_exe[] = { + 'n','o','t','e','p','a','d','.','e','x','e', 0}; + const WCHAR notepad[] = {'n','o','t','e','p','a','d', 0}; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Attempt getting before setting application name */ + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(stored_name, empty), + "Got %s, expected empty string\n", dbgstr_w(stored_name)); + CoTaskMemFree(stored_name); + } + + /* Set application name to a nonexistent application and then get + * the application name that is actually stored */ + hres = ITask_SetApplicationName(test_task, non_application_name); + ok(hres == S_OK, "Failed setting name %s: %08x\n", + dbgstr_w(non_application_name), hres); + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + full_name = path_resolve_name(non_application_name); + ok(!lstrcmpW(stored_name, full_name), "Got %s, expected %s\n", + dbgstr_w(stored_name), dbgstr_w(full_name)); + CoTaskMemFree(stored_name); + } + + /* Set a valid application name with program type extension and then + * get the stored name */ + hres = ITask_SetApplicationName(test_task, notepad_exe); + ok(hres == S_OK, "Failed setting name %s: %08x\n", + dbgstr_w(notepad_exe), hres); + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + full_name = path_resolve_name(notepad_exe); + ok(!lstrcmpW(stored_name, full_name), "Got %s, expected %s\n", + dbgstr_w(stored_name), dbgstr_w(full_name)); + CoTaskMemFree(stored_name); + } + + /* Set a valid application name without program type extension and + * then get the stored name */ + hres = ITask_SetApplicationName(test_task, notepad); + ok(hres == S_OK, "Failed setting name %s: %08x\n", dbgstr_w(notepad), hres); + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + full_name = path_resolve_name(notepad); + ok(!lstrcmpW(stored_name, full_name), "Got %s, expected %s\n", + dbgstr_w(stored_name), dbgstr_w(full_name)); + CoTaskMemFree(stored_name); + } + + /* After having a valid application name set, set application the name + * to a nonexistent application and then get the name that is + * actually stored */ + hres = ITask_SetApplicationName(test_task, non_application_name); + ok(hres == S_OK, "Failed setting name %s: %08x\n", + dbgstr_w(non_application_name), hres); + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + full_name = path_resolve_name(non_application_name); + ok(!lstrcmpW(stored_name, full_name), "Got %s, expected %s\n", + dbgstr_w(stored_name), dbgstr_w(full_name)); + CoTaskMemFree(stored_name); + } + + /* Clear application name */ + hres = ITask_SetApplicationName(test_task, empty); + ok(hres == S_OK, "Failed setting name %s: %08x\n", dbgstr_w(empty), hres); + hres = ITask_GetApplicationName(test_task, &stored_name); + ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(stored_name, empty), + "Got %s, expected empty string\n", dbgstr_w(stored_name)); + CoTaskMemFree(stored_name); + } + + cleanup_task(); + return; +} + +static void test_CreateTrigger(void) +{ + BOOL setup; + HRESULT hres; + WORD trigger_index; + ITaskTrigger *test_trigger; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + hres = ITask_CreateTrigger(test_task, &trigger_index, &test_trigger); + ok(hres == S_OK, "Failed to create trigger: 0x%08x\n", hres); + if (hres != S_OK) + { + cleanup_task(); + return; + } + + ITaskTrigger_Release(test_trigger); + cleanup_task(); + return; +} + +static void test_SetParameters_GetParameters(void) +{ + BOOL setup; + HRESULT hres; + LPWSTR parameters; + const WCHAR parameters_a[] = {'f','o','o','.','t','x','t', 0}; + const WCHAR parameters_b[] = {'f','o','o','.','t','x','t',' ', + 'b','a','r','.','t','x','t', 0}; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Get parameters before setting them */ + hres = ITask_GetParameters(test_task, ¶meters); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(parameters, empty), + "Got %s, expected empty string\n", dbgstr_w(parameters)); + CoTaskMemFree(parameters); + } + + /* Set parameters to a simple string */ + hres = ITask_SetParameters(test_task, parameters_a); + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + dbgstr_w(parameters_a), hres); + hres = ITask_GetParameters(test_task, ¶meters); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(parameters, parameters_a), "Got %s, expected %s\n", + dbgstr_w(parameters), dbgstr_w(parameters_a)); + CoTaskMemFree(parameters); + } + + /* Update parameters to a different simple string */ + hres = ITask_SetParameters(test_task, parameters_b); + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + dbgstr_w(parameters_b), hres); + hres = ITask_GetParameters(test_task, ¶meters); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(parameters, parameters_b), "Got %s, expected %s\n", + dbgstr_w(parameters), dbgstr_w(parameters_b)); + CoTaskMemFree(parameters); + } + + /* Clear parameters */ + hres = ITask_SetParameters(test_task, empty); + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + dbgstr_w(empty), hres); + hres = ITask_GetParameters(test_task, ¶meters); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(parameters, empty), + "Got %s, expected empty string\n", dbgstr_w(parameters)); + CoTaskMemFree(parameters); + } + + cleanup_task(); + return; +} + +static void test_SetComment_GetComment(void) +{ + BOOL setup; + HRESULT hres; + LPWSTR comment; + const WCHAR comment_a[] = {'C','o','m','m','e','n','t','.', 0}; + const WCHAR comment_b[] = {'L','o','n','g','e','r',' ', + 'c','o','m','m','e','n','t','.', 0}; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Get comment before setting it*/ + hres = ITask_GetComment(test_task, &comment); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(comment, empty), + "Got %s, expected empty string\n", dbgstr_w(comment)); + CoTaskMemFree(comment); + } + + /* Set comment to a simple string */ + hres = ITask_SetComment(test_task, comment_a); + ok(hres == S_OK, "Failed setting comment %s: %08x\n", + dbgstr_w(comment_a), hres); + hres = ITask_GetComment(test_task, &comment); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(comment, comment_a), "Got %s, expected %s\n", + dbgstr_w(comment), dbgstr_w(comment_a)); + CoTaskMemFree(comment); + } + + /* Update comment to a different simple string */ + hres = ITask_SetComment(test_task, comment_b); + ok(hres == S_OK, "Failed setting comment %s: %08x\n", + dbgstr_w(comment_b), hres); + hres = ITask_GetComment(test_task, &comment); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(comment, comment_b), "Got %s, expected %s\n", + dbgstr_w(comment), dbgstr_w(comment_b)); + CoTaskMemFree(comment); + } + + /* Clear comment */ + hres = ITask_SetComment(test_task, empty); + ok(hres == S_OK, "Failed setting comment %s: %08x\n", + dbgstr_w(empty), hres); + hres = ITask_GetComment(test_task, &comment); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(comment, empty), + "Got %s, expected empty string\n", dbgstr_w(comment)); + CoTaskMemFree(comment); + } + + cleanup_task(); + return; +} + +static void test_SetMaxRunTime_GetMaxRunTime(void) +{ + BOOL setup; + HRESULT hres; + DWORD max_run_time; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Default time is 3 days: + * 3 days * 24 hours * 60 minutes * 60 seconds * 1000 ms = 259200000 */ + max_run_time = 0; + hres = ITask_GetMaxRunTime(test_task, &max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 259200000, "Expected 259200000: %d\n", max_run_time); + + /* Basic set test */ + max_run_time = 0; + hres = ITask_SetMaxRunTime(test_task, 1234); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + hres = ITask_GetMaxRunTime(test_task, &max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 1234, "Expected 1234: %d\n", max_run_time); + + /* Verify that time can be set to zero */ + max_run_time = 1; + hres = ITask_SetMaxRunTime(test_task, 0); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + hres = ITask_GetMaxRunTime(test_task, &max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 0, "Expected 0: %d\n", max_run_time); + + /* Check resolution by setting time to one */ + max_run_time = 0; + hres = ITask_SetMaxRunTime(test_task, 1); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + hres = ITask_GetMaxRunTime(test_task, &max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 1, "Expected 1: %d\n", max_run_time); + + /* Verify that time can be set to INFINITE */ + max_run_time = 0; + hres = ITask_SetMaxRunTime(test_task, INFINITE); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + hres = ITask_GetMaxRunTime(test_task, &max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == INFINITE, "Expected INFINITE: %d\n", max_run_time); + + cleanup_task(); + return; +} + +static void test_SetAccountInformation_GetAccountInformation(void) +{ + BOOL setup; + HRESULT hres; + LPWSTR account_name; + const WCHAR dummy_account_name[] = {'N', 'o', 'S', 'u', 'c', 'h', + 'A', 'c', 'c', 'o', 'u', 'n', 't', 0}; + const WCHAR dummy_account_name_b[] = {'N', 'o', 'S', 'u', 'c', 'h', + 'A', 'c', 'c', 'o', 'u', 'n', 't', 'B', 0}; + + setup = setup_task(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Get account information before it is set */ + hres = ITask_GetAccountInformation(test_task, &account_name); + /* WinXP returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND): 0x80070002 but + * Win2K returns SCHED_E_CANNOT_OPEN_TASK: 0x8004130d + * Win9x doesn't support security services */ + if (hres == SCHED_E_NO_SECURITY_SERVICES) + { + win_skip("Security services are not supported\n"); + cleanup_task(); + return; + } + ok(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hres == SCHED_E_CANNOT_OPEN_TASK, + "Unset account name generated: 0x%08x\n", hres); + + /* Attempt to set to a dummy account without a password */ + /* This test passes on WinXP but fails on Win2K */ + hres = ITask_SetAccountInformation(test_task, dummy_account_name, NULL); + ok(hres == S_OK, + "Failed setting dummy account with no password: %08x\n", hres); + hres = ITask_GetAccountInformation(test_task, &account_name); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(account_name, dummy_account_name), + "Got %s, expected %s\n", dbgstr_w(account_name), + dbgstr_w(dummy_account_name)); + CoTaskMemFree(account_name); + } + + /* Attempt to set to a dummy account with a (invalid) password */ + /* This test passes on WinXP but fails on Win2K */ + hres = ITask_SetAccountInformation(test_task, dummy_account_name_b, + dummy_account_name_b); + ok(hres == S_OK, + "Failed setting dummy account with password: %08x\n", hres); + hres = ITask_GetAccountInformation(test_task, &account_name); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(account_name, dummy_account_name_b), + "Got %s, expected %s\n", dbgstr_w(account_name), + dbgstr_w(dummy_account_name_b)); + CoTaskMemFree(account_name); + } + + /* Attempt to set to the local system account */ + hres = ITask_SetAccountInformation(test_task, empty, NULL); + ok(hres == S_OK, "Failed setting system account: %08x\n", hres); + hres = ITask_GetAccountInformation(test_task, &account_name); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + if (hres == S_OK) + { + ok(!lstrcmpW(account_name, empty), + "Got %s, expected empty string\n", dbgstr_w(account_name)); + CoTaskMemFree(account_name); + } + + cleanup_task(); + return; +} + +START_TEST(task) +{ + CoInitialize(NULL); + test_SetApplicationName_GetApplicationName(); + test_CreateTrigger(); + test_SetParameters_GetParameters(); + test_SetComment_GetComment(); + test_SetMaxRunTime_GetMaxRunTime(); + test_SetAccountInformation_GetAccountInformation(); + CoUninitialize(); +} Propchange: trunk/rostests/winetests/mstask/task.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/mstask/task_scheduler.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mstask/task_sch…
============================================================================== --- trunk/rostests/winetests/mstask/task_scheduler.c (added) +++ trunk/rostests/winetests/mstask/task_scheduler.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,111 @@ +/* + * Test suite for TaskScheduler interface + * + * Copyright (C) 2008 Google (Roy Shea) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "corerror.h" + +#include "initguid.h" +#include "mstask.h" +#include "wine/test.h" + +static ITaskScheduler *test_task_scheduler; + +static void test_NewWorkItem(void) +{ + HRESULT hres; + ITask *task; + const WCHAR task_name[] = {'T', 'e', 's', 't', 'i', 'n', 'g', 0}; + GUID GUID_BAD; + + /* Initialize a GUID that will not be a recognized CLSID or a IID */ + CoCreateGuid(&GUID_BAD); + + /* Create TaskScheduler */ + hres = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **) &test_task_scheduler); + ok(hres == S_OK, "CTaskScheduler CoCreateInstance failed: %08x\n", hres); + if (hres != S_OK) + { + skip("Failed to create task scheduler. Skipping tests.\n"); + return; + } + + /* Test basic task creation */ + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, + &CLSID_CTask, &IID_ITask, (IUnknown**)&task); + ok(hres == S_OK, "NewNetworkItem failed: %08x\n", hres); + if (hres == S_OK) + ITask_Release(task); + + /* Task creation attempt using invalid work item class ID */ + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, + &GUID_BAD, &IID_ITask, (IUnknown**)&task); + ok(hres == CLASS_E_CLASSNOTAVAILABLE, + "Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n", hres); + + /* Task creation attempt using invalid interface ID */ + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, + &CLSID_CTask, &GUID_BAD, (IUnknown**)&task); + ok(hres == E_NOINTERFACE, "Expected E_NOINTERFACE: %08x\n", hres); + + /* Task creation attempt using invalid work item class and interface ID */ + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, + &GUID_BAD, &GUID_BAD, (IUnknown**)&task); + ok(hres == CLASS_E_CLASSNOTAVAILABLE, + "Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n", hres); + + ITaskScheduler_Release(test_task_scheduler); + return; +} + +static void test_Activate(void) +{ + HRESULT hres; + ITask *task = NULL; + const WCHAR not_task_name[] = + {'N', 'o', 'S', 'u', 'c', 'h', 'T', 'a', 's', 'k', 0}; + + /* Create TaskScheduler */ + hres = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **) &test_task_scheduler); + ok(hres == S_OK, "CTaskScheduler CoCreateInstance failed: %08x\n", hres); + if (hres != S_OK) + { + skip("Failed to create task scheduler. Skipping tests.\n"); + return; + } + + /* Attempt to activate a nonexistent task */ + hres = ITaskScheduler_Activate(test_task_scheduler, not_task_name, + &IID_ITask, (IUnknown**)&task); + ok(hres == COR_E_FILENOTFOUND, "Expected COR_E_FILENOTFOUND: %08x\n", hres); + + ITaskScheduler_Release(test_task_scheduler); + return; +} + +START_TEST(task_scheduler) +{ + CoInitialize(NULL); + test_NewWorkItem(); + test_Activate(); + CoUninitialize(); +} Propchange: trunk/rostests/winetests/mstask/task_scheduler.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/mstask/task_trigger.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mstask/task_tri…
============================================================================== --- trunk/rostests/winetests/mstask/task_trigger.c (added) +++ trunk/rostests/winetests/mstask/task_trigger.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,380 @@ +/* + * Test suite for Task interface + * + * Copyright (C) 2008 Google (Roy Shea) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <corerror.h> + +#include "mstask.h" +#include "wine/test.h" + +static ITaskScheduler *test_task_scheduler; +static ITask *test_task; +static ITaskTrigger *test_trigger; +static WORD trigger_index; + +static BOOL setup_trigger(void) +{ + HRESULT hres; + const WCHAR task_name[] = {'T','e','s','t','i','n','g', 0}; + + hres = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **) &test_task_scheduler); + if(hres != S_OK) + return FALSE; + hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, + &CLSID_CTask, &IID_ITask, (IUnknown**)&test_task); + if(hres != S_OK) + { + ITaskScheduler_Release(test_task_scheduler); + return FALSE; + } + hres = ITask_CreateTrigger(test_task, &trigger_index, &test_trigger); + if(hres != S_OK) + { + ITask_Release(test_task); + ITaskScheduler_Release(test_task_scheduler); + return FALSE; + } + return TRUE; +} + +static void cleanup_trigger(void) +{ + ITaskTrigger_Release(test_trigger); + ITask_Release(test_task); + ITaskScheduler_Release(test_task_scheduler); +} + +static BOOL compare_trigger_state(TASK_TRIGGER found_state, + TASK_TRIGGER expected_state) +{ + ok(found_state.cbTriggerSize == expected_state.cbTriggerSize, + "cbTriggerSize: Found %d but expected %d\n", + found_state.cbTriggerSize, expected_state.cbTriggerSize); + + ok(found_state.Reserved1 == expected_state.Reserved1, + "Reserved1: Found %d but expected %d\n", + found_state.Reserved1, expected_state.Reserved1); + + ok(found_state.wBeginYear == expected_state.wBeginYear, + "wBeginYear: Found %d but expected %d\n", + found_state.wBeginYear, expected_state.wBeginYear); + + ok(found_state.wBeginMonth == expected_state.wBeginMonth, + "wBeginMonth: Found %d but expected %d\n", + found_state.wBeginMonth, expected_state.wBeginMonth); + + ok(found_state.wBeginDay == expected_state.wBeginDay, + "wBeginDay: Found %d but expected %d\n", + found_state.wBeginDay, expected_state.wBeginDay); + + ok(found_state.wEndYear == expected_state.wEndYear, + "wEndYear: Found %d but expected %d\n", + found_state.wEndYear, expected_state.wEndYear); + + ok(found_state.wEndMonth == expected_state.wEndMonth, + "wEndMonth: Found %d but expected %d\n", + found_state.wEndMonth, expected_state.wEndMonth); + + ok(found_state.wEndDay == expected_state.wEndDay, + "wEndDay: Found %d but expected %d\n", + found_state.wEndDay, expected_state.wEndDay); + + ok(found_state.wStartHour == expected_state.wStartHour, + "wStartHour: Found %d but expected %d\n", + found_state.wStartHour, expected_state.wStartHour); + + ok(found_state.wStartMinute == expected_state.wStartMinute, + "wStartMinute: Found %d but expected %d\n", + found_state.wStartMinute, expected_state.wStartMinute); + + ok(found_state.MinutesDuration == expected_state.MinutesDuration, + "MinutesDuration: Found %d but expected %d\n", + found_state.MinutesDuration, expected_state.MinutesDuration); + + ok(found_state.MinutesInterval == expected_state.MinutesInterval, + "MinutesInterval: Found %d but expected %d\n", + found_state.MinutesInterval, expected_state.MinutesInterval); + + ok(found_state.rgFlags == expected_state.rgFlags, + "rgFlags: Found %d but expected %d\n", + found_state.rgFlags, expected_state.rgFlags); + + ok(found_state.TriggerType == expected_state.TriggerType, + "TriggerType: Found %d but expected %d\n", + found_state.TriggerType, expected_state.TriggerType); + + ok(found_state.Type.Daily.DaysInterval == expected_state.Type.Daily.DaysInterval, + "Type.Daily.DaysInterval: Found %d but expected %d\n", + found_state.Type.Daily.DaysInterval, expected_state.Type.Daily.DaysInterval); + + ok(found_state.Reserved2 == expected_state.Reserved2, + "Reserved2: Found %d but expected %d\n", + found_state.Reserved2, expected_state.Reserved2); + + ok(found_state.wRandomMinutesInterval == expected_state.wRandomMinutesInterval, + "wRandomMinutesInterval: Found %d but expected %d\n", + found_state.wRandomMinutesInterval, expected_state.wRandomMinutesInterval); + + return TRUE; +} + +static void test_SetTrigger_GetTrigger(void) +{ + BOOL setup; + HRESULT hres; + TASK_TRIGGER trigger_state; + TASK_TRIGGER empty_trigger_state = { + sizeof(trigger_state), 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, 0, + TASK_TRIGGER_FLAG_DISABLED, TASK_TIME_TRIGGER_DAILY, {{1}}, + 0, 0 + }; + TASK_TRIGGER normal_trigger_state = { + sizeof(trigger_state), 0, + 1980, 1, 1, + 2980, 2, 2, + 3, 3, + 0, 0, + TASK_TRIGGER_FLAG_DISABLED, TASK_TIME_TRIGGER_DAILY, {{1}}, + 0, 0 + }; + SYSTEMTIME time; + + setup = setup_trigger(); + ok(setup, "Failed to setup test_task\n"); + if (!setup) + { + skip("Failed to create task. Skipping tests.\n"); + return; + } + + /* Setup a trigger with base values for this test run */ + GetLocalTime(&time); + empty_trigger_state.wStartHour = time.wHour; + empty_trigger_state.wStartMinute = time.wMinute; + empty_trigger_state.wBeginYear = time.wYear; + empty_trigger_state.wBeginMonth = time.wMonth; + empty_trigger_state.wBeginDay = time.wDay; + + /* Test trigger state after trigger creation but before setting * state */ + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + compare_trigger_state(trigger_state, empty_trigger_state); + + /* Test setting basic empty trigger */ + hres = ITaskTrigger_SetTrigger(test_trigger, &empty_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(hres == S_OK, "Failed to GetTrigger\n"); + compare_trigger_state(trigger_state, empty_trigger_state); + + /* Test setting basic non-empty trigger */ + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(hres == S_OK, "Failed to GetTrigger\n"); + compare_trigger_state(trigger_state, normal_trigger_state); + + /* The following tests modify the normal_trigger_state structure + * before each test, and return the normal_trigger_state structure + * back to its original valid state after each test. This keeps + * each test run independent. */ + + /* Test setting trigger with invalid cbTriggerSize */ + normal_trigger_state.cbTriggerSize = sizeof(trigger_state) - 1; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.cbTriggerSize = sizeof(trigger_state) + 1; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.cbTriggerSize = sizeof(trigger_state); + + /* Test setting trigger with invalid Reserved fields */ + normal_trigger_state.Reserved1 = 80; + normal_trigger_state.Reserved2 = 80; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(trigger_state.Reserved1 == 0 && trigger_state.Reserved2 == 0, + "Reserved fields should be set to zero\n"); + normal_trigger_state.Reserved1 = 0; + normal_trigger_state.Reserved2 = 0; + + /* Test setting trigger with invalid month */ + normal_trigger_state.wBeginMonth = 0; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wBeginMonth = 13; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wBeginMonth = 1; + + /* Test setting trigger with invalid begin date */ + normal_trigger_state.wBeginDay = 0; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wBeginDay = 32; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wBeginMonth = 2; + normal_trigger_state.wBeginDay = 30; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wBeginMonth = 1; + normal_trigger_state.wBeginDay = 1; + + /* Test setting trigger invalid end date */ + normal_trigger_state.wEndYear = 0; + normal_trigger_state.wEndMonth = 200; + normal_trigger_state.wEndDay = 200; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(trigger_state.wEndYear == 0, "End year should be 0: %d\n", + trigger_state.wEndYear); + ok(trigger_state.wEndMonth == 200, "End month should be 200: %d\n", + trigger_state.wEndMonth); + ok(trigger_state.wEndDay == 200, "End day should be 200: %d\n", + trigger_state.wEndDay); + normal_trigger_state.rgFlags = + TASK_TRIGGER_FLAG_DISABLED | TASK_TRIGGER_FLAG_HAS_END_DATE; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.rgFlags = TASK_TRIGGER_FLAG_DISABLED; + normal_trigger_state.wEndYear = 2980; + normal_trigger_state.wEndMonth = 1; + normal_trigger_state.wEndDay = 1; + + /* Test setting trigger with invalid hour or minute*/ + normal_trigger_state.wStartHour = 24; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wStartHour = 3; + normal_trigger_state.wStartHour = 60; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.wStartHour = 3; + + /* Test setting trigger with invalid duration / interval pairs */ + normal_trigger_state.MinutesDuration = 5; + normal_trigger_state.MinutesInterval = 5; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.MinutesDuration = 5; + normal_trigger_state.MinutesInterval = 6; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.MinutesDuration = 0; + normal_trigger_state.MinutesInterval = 6; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.MinutesDuration = 5; + normal_trigger_state.MinutesInterval = 0; + ok(hres == E_INVALIDARG, "Expected E_INVALIDARG: 0x%08x\n", hres); + normal_trigger_state.MinutesDuration = 0; + normal_trigger_state.MinutesInterval = 0; + + /* Test setting trigger with end date before start date */ + normal_trigger_state.wEndYear = 1979; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + normal_trigger_state.rgFlags = + TASK_TRIGGER_FLAG_DISABLED | TASK_TRIGGER_FLAG_HAS_END_DATE; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + normal_trigger_state.rgFlags = TASK_TRIGGER_FLAG_DISABLED; + normal_trigger_state.wEndYear = 2980; + normal_trigger_state.wEndMonth = 1; + normal_trigger_state.wEndDay = 1; + + + /* Test setting trigger with invalid TriggerType and Type */ + normal_trigger_state.TriggerType = TASK_TIME_TRIGGER_ONCE; + normal_trigger_state.Type.Weekly.WeeksInterval = 2; + normal_trigger_state.Type.Weekly.rgfDaysOfTheWeek = (TASK_MONDAY | TASK_TUESDAY); + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(trigger_state.Type.Weekly.WeeksInterval == 0xcfcf, + "Expected WeeksInterval set remain untouched: %d\n", + trigger_state.Type.Weekly.WeeksInterval); + ok(trigger_state.Type.Weekly.rgfDaysOfTheWeek == 0xcfcf, + "Expected WeeksInterval set remain untouched: %d\n", + trigger_state.Type.Weekly.rgfDaysOfTheWeek); + normal_trigger_state.TriggerType = TASK_TIME_TRIGGER_DAILY; + normal_trigger_state.Type.Daily.DaysInterval = 1; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + + /* Test setting trigger with set wRandomMinutesInterval */ + normal_trigger_state.wRandomMinutesInterval = 5; + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state); + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(trigger_state.wRandomMinutesInterval == 0, + "wRandomMinutesInterval should be set to zero\n"); + normal_trigger_state.wRandomMinutesInterval = 0; + + /* Test GetTrigger using invalid cbTriggerSiz in pTrigger. In + * contrast to available documentation, this succeeds in practice. */ + hres = ITaskTrigger_SetTrigger(test_trigger, &normal_trigger_state); + ok(hres == S_OK, "Failed to set trigger: 0x%08x\n", hres); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = sizeof(trigger_state) - 1; + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(hres == S_OK, "Failed to GetTrigger\n"); + ok(compare_trigger_state(trigger_state, normal_trigger_state), + "Invalid state\n"); + memset(&trigger_state, 0xcf, sizeof(trigger_state)); + trigger_state.cbTriggerSize = 0; + hres = ITaskTrigger_GetTrigger(test_trigger, &trigger_state); + ok(hres == S_OK, "Failed to GetTrigger\n"); + ok(compare_trigger_state(trigger_state, normal_trigger_state), + "Invalid state\n"); + + + cleanup_trigger(); + return; +} + + +START_TEST(task_trigger) +{ + CoInitialize(NULL); + test_SetTrigger_GetTrigger(); + CoUninitialize(); +} Propchange: trunk/rostests/winetests/mstask/task_trigger.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/mstask/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mstask/testlist…
============================================================================== --- trunk/rostests/winetests/mstask/testlist.c (added) +++ trunk/rostests/winetests/mstask/testlist.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,19 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + +extern void func_task(void); +extern void func_task_scheduler(void); +extern void func_task_trigger(void); + +const struct test winetest_testlist[] = +{ + { "task", func_task }, + { "task_scheduler", func_task_scheduler }, + { "task_trigger", func_task_trigger }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/mstask/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/rostests/winetests/winhttp/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun Sep 7 08:50:21 2008 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/winhttp/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/winhttp/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/winetests/winhttp/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/rostests/winetests/winhttp/notification.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/notific…
============================================================================== --- trunk/rostests/winetests/winhttp/notification.c (added) +++ trunk/rostests/winetests/winhttp/notification.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,267 @@ +/* + * test status notifications + * + * Copyright 2008 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdlib.h> +#include <windef.h> +#include <winbase.h> +#include <winhttp.h> + +#include "wine/test.h" + +static const WCHAR user_agent[] = {'w','i','n','e','t','e','s','t',0}; + +enum api +{ + winhttp_connect = 1, + winhttp_open_request, + winhttp_send_request, + winhttp_receive_response, + winhttp_close_handle +}; + +struct notification +{ + enum api function; /* api responsible for notification */ + unsigned int status; /* status received */ + int todo; +}; + +struct info +{ + enum api function; + const struct notification *test; + unsigned int count; + unsigned int index; +}; + +static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen ) +{ + struct info *info = (struct info *)context; + unsigned int i = info->index; + + if (status == WINHTTP_CALLBACK_STATUS_HANDLE_CREATED) + { + DWORD size = sizeof(struct info *); + WinHttpQueryOption( handle, WINHTTP_OPTION_CONTEXT_VALUE, &info, &size ); + } + ok(i < info->count, "unexpected notification 0x%08x\n", status); + if (i >= info->count) return; + if (!info->test[i].todo) + { + ok(info->test[i].status == status, "expected status 0x%08x got 0x%08x\n", info->test[i].status, status); + ok(info->test[i].function == info->function, "expected function %u got %u\n", info->test[i].function, info->function); + } + else todo_wine + { + ok(info->test[i].status == status, "expected status 0x%08x got 0x%08x\n", info->test[i].status, status); + ok(info->test[i].function == info->function, "expected function %u got %u\n", info->test[i].function, info->function); + } + info->index++; +} + +static const struct notification cache_test[] = +{ + { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1 } +}; + +static void test_connection_cache( void ) +{ + static const WCHAR codeweavers[] = {'w','w','w','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + + HANDLE ses, con, req; + DWORD size, status; + BOOL ret; + struct info info, *context = &info; + + info.test = cache_test; + info.count = sizeof(cache_test) / sizeof(cache_test[0]); + info.index = 0; + + ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); + + ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + info.function = winhttp_connect; + con = WinHttpConnect( ses, codeweavers, 0, 0 ); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + info.function = winhttp_open_request; + req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + info.function = winhttp_send_request; + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok(ret, "failed to send request %u\n", GetLastError()); + + info.function = winhttp_receive_response; + ret = WinHttpReceiveResponse( req, NULL ); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + info.function = winhttp_close_handle; + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); + + Sleep(2000); /* make sure connection is evicted from cache */ + + info.index = 0; + + ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); + + ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + info.function = winhttp_connect; + con = WinHttpConnect( ses, codeweavers, 0, 0 ); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + info.function = winhttp_open_request; + req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + info.function = winhttp_send_request; + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok(ret, "failed to send request %u\n", GetLastError()); + + info.function = winhttp_receive_response; + ret = WinHttpReceiveResponse( req, NULL ); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + info.function = winhttp_close_handle; + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); +} + +static const struct notification redirect_test[] = +{ + { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1 } +}; + +static void test_redirect( void ) +{ + static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + + HANDLE ses, con, req; + DWORD size, status; + BOOL ret; + struct info info, *context = &info; + + info.test = redirect_test; + info.count = sizeof(redirect_test) / sizeof(redirect_test[0]); + info.index = 0; + + ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); + + ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + info.function = winhttp_connect; + con = WinHttpConnect( ses, codeweavers, 0, 0 ); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + info.function = winhttp_open_request; + req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + info.function = winhttp_send_request; + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + + info.function = winhttp_receive_response; + ret = WinHttpReceiveResponse( req, NULL ); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + info.function = winhttp_close_handle; + WinHttpCloseHandle( req ); + WinHttpCloseHandle( con ); + WinHttpCloseHandle( ses ); +} + +START_TEST (notification) +{ + test_connection_cache(); + test_redirect(); +} Propchange: trunk/rostests/winetests/winhttp/notification.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/winhttp/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/testlis…
============================================================================== --- trunk/rostests/winetests/winhttp/testlist.c (added) +++ trunk/rostests/winetests/winhttp/testlist.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,13 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + + +const struct test winetest_testlist[] = +{ + { 0, 0 } +}; Propchange: trunk/rostests/winetests/winhttp/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/winhttp/winhttp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/winhttp…
============================================================================== --- trunk/rostests/winetests/winhttp/winhttp.c (added) +++ trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,670 @@ +/* + * WinHTTP - tests + * + * Copyright 2008 Google (Zac Brown) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdlib.h> +#include <windef.h> +#include <winbase.h> +#include <winhttp.h> + +#include "wine/test.h" + +static const WCHAR test_useragent[] = + {'W','i','n','e',' ','R','e','g','r','e','s','s','i','o','n',' ','T','e','s','t',0}; +static const WCHAR test_server[] = {'w','i','n','e','h','q','.','o','r','g',0}; + +static void test_OpenRequest (void) +{ + BOOL ret; + HINTERNET session, request, connection; + + session = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); + ok(session != NULL, "WinHttpOpen failed to open session.\n"); + + /* Test with a bad server name */ + SetLastError(0xdeadbeef); + connection = WinHttpConnect(session, NULL, INTERNET_DEFAULT_HTTP_PORT, 0); + ok (connection == NULL, "WinHttpConnect succeeded in opening connection to NULL server argument.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError()); + + /* Test with a valid server name */ + connection = WinHttpConnect (session, test_server, INTERNET_DEFAULT_HTTP_PORT, 0); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + + request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, 0); + if (request == NULL && GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED) + { + skip("Network unreachable, skipping.\n"); + goto done; + } + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); + + ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0); + ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); + ret = WinHttpCloseHandle(request); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + + done: + ret = WinHttpCloseHandle(connection); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ret = WinHttpCloseHandle(session); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); + +} + +static void test_SendRequest (void) +{ + HINTERNET session, request, connection; + DWORD header_len, optional_len, total_len; + DWORD bytes_rw; + BOOL ret; + CHAR buffer[256]; + int i; + + static const WCHAR test_site[] = {'c','r','o','s','s','o','v','e','r','.', + 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + static const WCHAR content_type[] = + {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ','a','p','p','l','i','c','a','t','i','o','n', + '/','x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0}; + static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0}; + static const WCHAR test_verb[] = {'P','O','S','T',0}; + static CHAR post_data[] = "mode=Test"; + static CHAR test_post[] = "mode => Test\\0\n"; + + header_len = -1L; + total_len = optional_len = sizeof(post_data); + memset(buffer, 0xff, sizeof(buffer)); + + session = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); + ok(session != NULL, "WinHttpOpen failed to open session.\n"); + + connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + + request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); + if (request == NULL && GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED) + { + skip("Network unreachable, skipping.\n"); + goto done; + } + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); + + ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, 0); + ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); + + for (i = 3; post_data[i]; i++) + { + bytes_rw = -1; + ret = WinHttpWriteData(request, &post_data[i], 1, &bytes_rw); + ok(ret == TRUE, "WinHttpWriteData failed: %u.\n", GetLastError()); + ok(bytes_rw == 1, "WinHttpWriteData failed, wrote %u bytes instead of 1 byte.\n", bytes_rw); + } + + ret = WinHttpReceiveResponse(request, NULL); + ok(ret == TRUE, "WinHttpReceiveResponse failed: %u.\n", GetLastError()); + + bytes_rw = -1; + ret = WinHttpReadData(request, buffer, sizeof(buffer) - 1, &bytes_rw); + ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError()); + + ok(bytes_rw == strlen(test_post), "Read %u bytes instead of %d.\n", bytes_rw, lstrlen(test_post)); + ok(strncmp(buffer, test_post, bytes_rw) == 0, "Data read did not match, got '%s'.\n", buffer); + + ret = WinHttpCloseHandle(request); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + done: + ret = WinHttpCloseHandle(connection); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ret = WinHttpCloseHandle(session); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); +} + +static void test_WinHttpTimeFromSystemTime(void) +{ + BOOL ret; + static const SYSTEMTIME time = {2008, 7, 1, 28, 10, 5, 52, 0}; + static const WCHAR expected_string[] = + {'M','o','n',',',' ','2','8',' ','J','u','l',' ','2','0','0','8',' ', + '1','0',':','0','5',':','5','2',' ','G','M','T',0}; + WCHAR time_string[WINHTTP_TIME_FORMAT_BUFSIZE+1]; + + ret = WinHttpTimeFromSystemTime(&time, time_string); + ok(ret == TRUE, "WinHttpTimeFromSystemTime failed: %u\n", GetLastError()); + ok(memcmp(time_string, expected_string, sizeof(expected_string)) == 0, + "Time string returned did not match expected time string.\n"); +} + +static void test_WinHttpTimeToSystemTime(void) +{ + BOOL ret; + SYSTEMTIME time; + static const SYSTEMTIME expected_time = {2008, 7, 1, 28, 10, 5, 52, 0}; + static const WCHAR time_string1[] = + {'M','o','n',',',' ','2','8',' ','J','u','l',' ','2','0','0','8',' ', + + '1','0',':','0','5',':','5','2',' ','G','M','T','\n',0}; + static const WCHAR time_string2[] = + {' ','m','o','n',' ','2','8',' ','j','u','l',' ','2','0','0','8',' ', + '1','0',' ','0','5',' ','5','2','\n',0}; + + ret = WinHttpTimeToSystemTime(time_string1, &time); + ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); + ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, + "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n"); + + ret = WinHttpTimeToSystemTime(time_string2, &time); + ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); + ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, + "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n"); +} + +static void test_WinHttpAddHeaders(void) +{ + HINTERNET session, request, connection; + BOOL ret; + WCHAR buffer[MAX_PATH]; + WCHAR check_buffer[MAX_PATH]; + DWORD index, len, oldlen; + + static const WCHAR test_site[] = {'c','r','o','s','s','o','v','e','r','.', + 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0}; + static const WCHAR test_verb[] = {'P','O','S','T',0}; + + static const WCHAR test_header_begin[] = + {'P','O','S','T',' ','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; + static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0}; + static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0}; + + static const WCHAR test_flag_coalesce[] = {'t','e','s','t','2',',',' ','t','e','s','t','4',0}; + static const WCHAR test_flag_coalesce_comma[] = + {'t','e','s','t','2',',',' ','t','e','s','t','4',',',' ','t','e','s','t','5',0}; + static const WCHAR test_flag_coalesce_semicolon[] = + {'t','e','s','t','2',',',' ','t','e','s','t','4',',',' ','t','e','s','t','5',';',' ','t','e','s','t','6',0}; + + static const WCHAR field[] = {'f','i','e','l','d',0}; + static const WCHAR value[] = {'v','a','l','u','e',' ',0}; + + static const WCHAR test_headers[][14] = + { + {'W','a','r','n','i','n','g',':','t','e','s','t','1',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','2',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','3',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','4',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','5',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','6',0}, + {'W','a','r','n','i','n','g',':','t','e','s','t','7',0}, + {0}, + {':',0}, + {'a',':',0}, + {':','b',0}, + {'c','d',0}, + {' ','e',' ',':','f',0}, + {'f','i','e','l','d',':',' ','v','a','l','u','e',' ',0} + }; + static const WCHAR test_indices[][6] = + { + {'t','e','s','t','1',0}, + {'t','e','s','t','2',0}, + {'t','e','s','t','3',0}, + {'t','e','s','t','4',0} + }; + + session = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); + ok(session != NULL, "WinHttpOpen failed to open session.\n"); + + connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + + request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, 0); + if (request == NULL && GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED) + { + skip("Network unreachable, skipping.\n"); + goto done; + } + ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %u.\n", GetLastError()); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded, found 'Warning' header.\n"); + ret = WinHttpAddRequestHeaders(request, test_headers[0], -1L, WINHTTP_ADDREQ_FLAG_ADD); + ok(ret == TRUE, "WinHttpAddRequestHeader failed to add new header, got %d with error %u.\n", ret, GetLastError()); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed: header index not incremented\n"); + ok(memcmp(buffer, test_indices[0], sizeof(test_indices[0])) == 0, "WinHttpQueryHeaders failed: incorrect string returned\n"); + ok(len == 5*sizeof(WCHAR), "WinHttpQueryHeaders failed: invalid length returned, expected 5, got %d\n", len); + + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded, second index should not exist.\n"); + + /* Try to fetch the header info with a buffer that's big enough to fit the + * string but not the NULL terminator. + */ + index = 0; + len = 5*sizeof(WCHAR); + memcpy(buffer, check_buffer, sizeof(buffer)); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded with a buffer that's too small.\n"); + ok(memcmp(buffer, check_buffer, sizeof(buffer)) == 0, + "WinHttpQueryHeaders failed, modified the buffer when it should not have.\n"); + ok(len == 6*sizeof(WCHAR), "WinHttpQueryHeaders returned invalid length, expected 12, got %d\n", len); + + /* Try with a NULL buffer */ + index = 0; + len = sizeof(buffer); + SetLastError(0xdeadbeef); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS_CRLF | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, NULL, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + ok(index == 0, "WinHttpQueryHeaders incorrectly incremented header index.\n"); + + /* Try with a NULL buffer and a length that's too small */ + index = 0; + len = 10; + SetLastError(0xdeadbeef); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS_CRLF | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, NULL, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICENT_BUFFER, go %u\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + ok(index == 0, "WinHttpQueryHeaders incorrectly incremented header index.\n"); + + index = 0; + len = 0; + SetLastError(0xdeadbeef); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS_CRLF | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, NULL, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + ok(index == 0, "WinHttpQueryHeaders failed: index was incremented.\n"); + + /* valid query */ + oldlen = len; + index = 0; + len = sizeof(buffer); + memset(buffer, 0xff, sizeof(buffer)); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS_CRLF | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: got %d\n", ret); + ok(len + sizeof(WCHAR) <= oldlen, "WinHttpQueryHeaders resulting length longer than advertized.\n"); + ok((len < sizeof(buffer) - sizeof(WCHAR)) && buffer[len / sizeof(WCHAR)] == 0, "WinHttpQueryHeaders did not append NULL terminator\n"); + ok(len == lstrlenW(buffer) * sizeof(WCHAR), "WinHttpQueryHeaders returned incorrect length.\n"); + ok(memcmp(buffer, test_header_begin, sizeof(test_header_begin)) == 0, + "WinHttpQueryHeaders returned invalid beginning of header string.\n"); + ok(memcmp(buffer + lstrlenW(buffer) - 4, test_header_end, sizeof(test_header_end)) == 0, + "WinHttpQueryHeaders returned invalid end of header string.\n"); + ok(index == 0, "WinHttpQueryHeaders incremented header index.\n"); + + index = 0; + len = 0; + SetLastError(0xdeadbeef); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, NULL, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + ok(index == 0, "WinHttpQueryHeaders failed: index was incremented.\n"); + + oldlen = len; + index = 0; + len = sizeof(buffer); + memset(buffer, 0xff, sizeof(buffer)); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed %u\n", GetLastError()); + ok(len + sizeof(WCHAR) <= oldlen, "resulting length longer than advertized\n"); + ok((len < sizeof(buffer) - sizeof(WCHAR)) && !buffer[len / sizeof(WCHAR)] && !buffer[len / sizeof(WCHAR) - 1], + "no double NULL terminator\n"); + ok(!memcmp(buffer, test_header_begin, sizeof(test_header_begin)), "invalid beginning of header string\n"); + ok(index == 0, "header index was incremented\n"); + + /* tests for more indices */ + ret = WinHttpAddRequestHeaders(request, test_headers[1], -1L, WINHTTP_ADDREQ_FLAG_ADD); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed to add duplicate header: %d\n", ret); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[0], sizeof(test_indices[0])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[1], sizeof(test_indices[1])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[2], -1L, WINHTTP_ADDREQ_FLAG_REPLACE); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed to add duplicate header.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[1], sizeof(test_indices[1])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + /* add if new flag */ + ret = WinHttpAddRequestHeaders(request, test_headers[3], -1L, WINHTTP_ADDREQ_FLAG_ADD_IF_NEW); + ok(ret == FALSE, "WinHttpAddRequestHeaders incorrectly replaced existing header.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[1], sizeof(test_indices[1])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); + + /* coalesce flag */ + ret = WinHttpAddRequestHeaders(request, test_headers[3], -1L, WINHTTP_ADDREQ_FLAG_COALESCE); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_flag_coalesce, sizeof(test_flag_coalesce)) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); + + /* coalesce with comma flag */ + ret = WinHttpAddRequestHeaders(request, test_headers[4], -1L, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_flag_coalesce_comma, sizeof(test_flag_coalesce_comma)) == 0, + "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); + + + /* coalesce with semicolon flag */ + ret = WinHttpAddRequestHeaders(request, test_headers[5], -1L, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_flag_coalesce_semicolon, sizeof(test_flag_coalesce_semicolon)) == 0, + "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); + + /* add and replace flags */ + ret = WinHttpAddRequestHeaders(request, test_headers[3], -1L, WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE); + ok(ret == TRUE, "WinHttpAddRequestHeaders failed with flag WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE.\n"); + + index = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[2], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); + ok(memcmp(buffer, test_indices[3], sizeof(test_indices[2])) == 0, "WinHttpQueryHeaders returned incorrect string.\n"); + + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + test_header_name, buffer, &len, &index); + ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[8], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(!ret, "WinHttpAddRequestHeaders failed\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[9], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(ret, "WinHttpAddRequestHeaders failed\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[10], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(!ret, "WinHttpAddRequestHeaders failed\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[11], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(!ret, "WinHttpAddRequestHeaders failed\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[12], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(!ret, "WinHttpAddRequestHeaders failed\n"); + + ret = WinHttpAddRequestHeaders(request, test_headers[13], ~0UL, WINHTTP_ADDREQ_FLAG_ADD); + ok(ret, "WinHttpAddRequestHeaders failed\n"); + + index = 0; + buffer[0] = 0; + len = sizeof(buffer); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, + field, buffer, &len, &index); + ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(!memcmp(buffer, value, sizeof(value)), "unexpected result\n"); + + ret = WinHttpCloseHandle(request); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + done: + ret = WinHttpCloseHandle(connection); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ret = WinHttpCloseHandle(session); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); + +} + +static void test_secure_connection(void) +{ + static const WCHAR google[] = {'w','w','w','.','g','o','o','g','l','e','.','c','o','m',0}; + + HANDLE ses, con, req; + DWORD size, status, policy; + BOOL ret; + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + policy = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS; + ret = WinHttpSetOption(ses, WINHTTP_OPTION_REDIRECT_POLICY, &policy, sizeof(policy)); + ok(ret, "failed to set redirect policy %u\n", GetLastError()); + + con = WinHttpConnect(ses, google, 443, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + /* try without setting WINHTTP_FLAG_SECURE */ + req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(!ret, "succeeded unexpectedly\n"); + + size = 0; + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL); + ok(!ret, "succeeded unexpectedly\n"); + + WinHttpCloseHandle(req); + + req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, WINHTTP_FLAG_SECURE); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + size = 0; + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL); + ok(!ret, "succeeded unexpectedly\n"); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); +} + +static void test_request_parameter_defaults(void) +{ + static const WCHAR empty[] = {0}; + static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + + HANDLE ses, con, req; + DWORD size, status; + BOOL ret; + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + con = WinHttpConnect(ses, codeweavers, 0, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + WinHttpCloseHandle(req); + + req = WinHttpOpenRequest(con, empty, empty, empty, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); +} + +START_TEST (winhttp) +{ + test_OpenRequest(); + test_SendRequest(); + test_WinHttpTimeFromSystemTime(); + test_WinHttpTimeToSystemTime(); + test_WinHttpAddHeaders(); + test_secure_connection(); + test_request_parameter_defaults(); +} Propchange: trunk/rostests/winetests/winhttp/winhttp.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/winhttp/winhttp.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/winhttp…
============================================================================== --- trunk/rostests/winetests/winhttp/winhttp.rbuild (added) +++ trunk/rostests/winetests/winhttp/winhttp.rbuild [iso-8859-1] Sun Sep 7 08:50:21 2008 @@ -1,0 +1,16 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="winhttp_winetest" type="win32cui" installbase="bin" installname="winhttp_winetest.exe" allowwarnings="true"> + <include base="winhttp_winetest">.</include> + <define name="WINVER">0x600</define> + <define name="_WIN32_WINNT">0x600</define> + <file>notification.c</file> + <file>testlist.c</file> + <file>winhttp.c</file> + <library>wine</library> + <library>winhttp</library> + <library>kernel32</library> + <library>ntdll</library> +</module> +</group> Propchange: trunk/rostests/winetests/winhttp/winhttp.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 3 months
1
0
0
0
[cwittich] 36030: Use MS-style imports instead of Borland-style for builtins patch by Alexandre Julliard <julliard at winehq.org>
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Sep 7 08:50:09 2008 New Revision: 36030 URL:
http://svn.reactos.org/svn/reactos?rev=36030&view=rev
Log: Use MS-style imports instead of Borland-style for builtins patch by Alexandre Julliard <julliard at
winehq.org
> Modified: trunk/reactos/tools/winebuild/import.c Modified: trunk/reactos/tools/winebuild/import.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/winebuild/import.c?r…
============================================================================== --- trunk/reactos/tools/winebuild/import.c [iso-8859-1] (original) +++ trunk/reactos/tools/winebuild/import.c [iso-8859-1] Sun Sep 7 08:50:09 2008 @@ -755,7 +755,8 @@ { if (dll_imports[i]->delay) continue; dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); - output( "\t.long 0\n" ); /* OriginalFirstThunk */ + output( "\t.long .L__wine_spec_import_data_names+%d-.L__wine_spec_rva_base\n", /* OriginalFirstThunk */ + j * get_ptr_size() ); output( "\t.long 0\n" ); /* TimeDateStamp */ output( "\t.long 0\n" ); /* ForwarderChain */ output( "\t.long .L__wine_spec_import_name_%s-.L__wine_spec_rva_base\n", /* Name */ @@ -771,7 +772,7 @@ output( "\t.long 0\n" ); /* FirstThunk */ output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); - output( ".L__wine_spec_import_data_ptrs:\n" ); + output( ".L__wine_spec_import_data_names:\n" ); for (i = 0; i < nb_imports; i++) { if (dll_imports[i]->delay) continue; @@ -790,6 +791,13 @@ output( "\t.long 0x8000%04x\n", odp->ordinal ); } } + output( "\t%s 0\n", get_asm_ptr_keyword() ); + } + output( ".L__wine_spec_import_data_ptrs:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) output( "\t%s 0\n", get_asm_ptr_keyword() ); output( "\t%s 0\n", get_asm_ptr_keyword() ); } output( ".L__wine_spec_imports_end:\n" );
16 years, 3 months
1
0
0
0
[pschweitzer] 36029: Commit 1/2 - Synced shlwapi.dll with Wine HEAD - Imported mstask.dll from Wine HEAD - Added mstask.dll, mstask_winetest.dll, winhttp_winetest.dll to bootcd - Update README.WINE
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Sep 7 08:49:02 2008 New Revision: 36029 URL:
http://svn.reactos.org/svn/reactos?rev=36029&view=rev
Log: Commit 1/2 - Synced shlwapi.dll with Wine HEAD - Imported mstask.dll from Wine HEAD - Added mstask.dll, mstask_winetest.dll, winhttp_winetest.dll to bootcd - Update README.WINE Added: trunk/reactos/dll/win32/mstask/ (with props) trunk/reactos/dll/win32/mstask/factory.c (with props) trunk/reactos/dll/win32/mstask/mstask.inf (with props) trunk/reactos/dll/win32/mstask/mstask.rbuild (with props) trunk/reactos/dll/win32/mstask/mstask.spec (with props) trunk/reactos/dll/win32/mstask/mstask_local.idl (with props) trunk/reactos/dll/win32/mstask/mstask_main.c (with props) trunk/reactos/dll/win32/mstask/mstask_private.h (with props) trunk/reactos/dll/win32/mstask/rsrc.rc (with props) trunk/reactos/dll/win32/mstask/task.c (with props) trunk/reactos/dll/win32/mstask/task_scheduler.c (with props) trunk/reactos/dll/win32/mstask/task_trigger.c (with props) trunk/reactos/dll/win32/shlwapi/shlwapi_Zh.rc (with props) trunk/reactos/include/psdk/mstask.idl (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/path.c trunk/reactos/dll/win32/shlwapi/shlwapi.rc trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/url.c trunk/reactos/dll/win32/win32.rbuild trunk/reactos/include/ndk/rtltypes.h trunk/reactos/include/psdk/prsht.h trunk/reactos/include/psdk/psdk.rbuild trunk/reactos/include/psdk/winbase.h trunk/reactos/include/psdk/winerror.h trunk/reactos/include/psdk/winnt.h trunk/reactos/include/psdk/wtypes.idl trunk/reactos/lib/sdk/uuid/uuid.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=360…
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
Added: trunk/reactos/dll/win32/mstask/factory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/factory.c…
Added: trunk/reactos/dll/win32/mstask/mstask.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask.in…
Added: trunk/reactos/dll/win32/mstask/mstask.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask.rb…
Added: trunk/reactos/dll/win32/mstask/mstask.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask.sp…
Added: trunk/reactos/dll/win32/mstask/mstask_local.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_lo…
Added: trunk/reactos/dll/win32/mstask/mstask_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_ma…
Added: trunk/reactos/dll/win32/mstask/mstask_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_pr…
Added: trunk/reactos/dll/win32/mstask/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/rsrc.rc?r…
Added: trunk/reactos/dll/win32/mstask/task.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task.c?re…
Added: trunk/reactos/dll/win32/mstask/task_scheduler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_sche…
Added: trunk/reactos/dll/win32/mstask/task_trigger.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_trig…
Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
Modified: trunk/reactos/dll/win32/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
Modified: trunk/reactos/dll/win32/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
Modified: trunk/reactos/include/ndk/rtltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
Added: trunk/reactos/include/psdk/mstask.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mstask.idl?re…
Modified: trunk/reactos/include/psdk/prsht.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/prsht.h?rev=3…
Modified: trunk/reactos/include/psdk/psdk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/psdk.rbuild?r…
Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
Modified: trunk/reactos/include/psdk/winerror.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winerror.h?re…
Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=3…
Modified: trunk/reactos/include/psdk/wtypes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wtypes.idl?re…
Modified: trunk/reactos/lib/sdk/uuid/uuid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/uuid/uuid.c?rev=36…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
16 years, 3 months
1
0
0
0
[cgutman] 36028: - Also display status when we fail
by cgutman@svn.reactos.org
Author: cgutman Date: Sun Sep 7 07:46:58 2008 New Revision: 36028 URL:
http://svn.reactos.org/svn/reactos?rev=36028&view=rev
Log: - Also display status when we fail Modified: trunk/reactos/drivers/network/ndis/ndis/io.c Modified: trunk/reactos/drivers/network/ndis/ndis/io.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] Sun Sep 7 07:46:58 2008 @@ -811,7 +811,7 @@ return NDIS_STATUS_RESOURCE_CONFLICT; } - NDIS_DbgPrint(MIN_TRACE, ("Function failed\n")); + NDIS_DbgPrint(MIN_TRACE, ("Function failed. Status (0x%X).\n", Status)); return NDIS_STATUS_FAILURE; }
16 years, 3 months
1
0
0
0
[hpoussin] 36027: Create missing directories when updating
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Sep 7 06:55:34 2008 New Revision: 36027 URL:
http://svn.reactos.org/svn/reactos?rev=36027&view=rev
Log: Create missing directories when updating Modified: trunk/tools/wineimport.cmd Modified: trunk/tools/wineimport.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/wineimport.cmd?rev=36027&r1=…
============================================================================== --- trunk/tools/wineimport.cmd [iso-8859-1] (original) +++ trunk/tools/wineimport.cmd [iso-8859-1] Sun Sep 7 06:55:34 2008 @@ -43,7 +43,7 @@ COLOR 00 GOTO :eof :download_update ->NUL 2>NUL cvs.exe -z 3 update -PA wine/dlls/%2 +>NUL 2>NUL cvs.exe -z 3 update -dPA wine/dlls/%2 :download_next SHIFT IF NOT "%2" == "" GOTO startdownload
16 years, 3 months
1
0
0
0
[dchapyshev] 36026: - Add mscoree to bootcd and docs
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Sep 7 06:55:28 2008 New Revision: 36026 URL:
http://svn.reactos.org/svn/reactos?rev=36026&view=rev
Log: - Add mscoree to bootcd and docs Modified: trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Sun Sep 7 06:55:28 2008 @@ -274,6 +274,7 @@ dll\win32\mpr\mpr.dll 1 dll\win32\msacm32\msacm32.dll 1 dll\win32\msafd\msafd.dll 1 +dll\win32\mscoree\mscoree.dll 1 dll\win32\msgina\msgina.dll 1 dll\win32\mshtml\mshtml.dll 1 dll\win32\msi\msi.dll 1 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 7 06:55:28 2008 @@ -60,6 +60,7 @@ reactos/dll/win32/mlang # Autosync reactos/dll/win32/mpr # Autosync reactos/dll/win32/msacm32 # Out of sync +reactos/dll/win32/mscoree # Autosync reactos/dll/win32/mshtml # Autosync reactos/dll/win32/msimg32 # Autosync reactos/dll/win32/msi # Autosync
16 years, 3 months
1
0
0
0
[dchapyshev] 36025: - Add mscoree from wine
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Sep 7 06:48:34 2008 New Revision: 36025 URL:
http://svn.reactos.org/svn/reactos?rev=36025&view=rev
Log: - Add mscoree from wine Added: trunk/reactos/dll/win32/mscoree/ (with props) trunk/reactos/dll/win32/mscoree/corruntimehost.c (with props) trunk/reactos/dll/win32/mscoree/mscoree.rbuild (with props) trunk/reactos/dll/win32/mscoree/mscoree.spec (with props) trunk/reactos/dll/win32/mscoree/mscoree_main.c (with props) trunk/reactos/dll/win32/mscoree/mscoree_private.h (with props) Modified: trunk/reactos/dll/win32/win32.rbuild Propchange: trunk/reactos/dll/win32/mscoree/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun Sep 7 06:48:34 2008 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/mscoree/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/mscoree/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/mscoree/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/mscoree/corruntimehost.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/corrunti…
============================================================================== --- trunk/reactos/dll/win32/mscoree/corruntimehost.c (added) +++ trunk/reactos/dll/win32/mscoree/corruntimehost.c [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -1,0 +1,288 @@ +/* + * + * Copyright 2008 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "ole2.h" + +#include "cor.h" +#include "mscoree.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL( mscoree ); + +typedef struct _corruntimehost +{ + const struct ICorRuntimeHostVtbl *lpVtbl; + LONG ref; +} corruntimehost; + +static inline corruntimehost *impl_from_ICorRuntimeHost( ICorRuntimeHost *iface ) +{ + return (corruntimehost *)((char*)iface - FIELD_OFFSET(corruntimehost, lpVtbl)); +} + +/*** IUnknown methods ***/ +static HRESULT WINAPI corruntimehost_QueryInterface(ICorRuntimeHost* iface, + REFIID riid, + void **ppvObject) +{ + corruntimehost *This = impl_from_ICorRuntimeHost( iface ); + TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); + + if ( IsEqualGUID( riid, &IID_ICorRuntimeHost ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else + { + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + ICorRuntimeHost_AddRef( iface ); + + return S_OK; +} + +static ULONG WINAPI corruntimehost_AddRef(ICorRuntimeHost* iface) +{ + corruntimehost *This = impl_from_ICorRuntimeHost( iface ); + return InterlockedIncrement( &This->ref ); +} + +static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost* iface) +{ + corruntimehost *This = impl_from_ICorRuntimeHost( iface ); + ULONG ref; + + ref = InterlockedDecrement( &This->ref ); + if ( ref == 0 ) + { + HeapFree( GetProcessHeap(), 0, This ); + } + + return ref; +} + +/*** ICorRuntimeHost methods ***/ +static HRESULT WINAPI corruntimehost_CreateLogicalThreadState( + ICorRuntimeHost* iface) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_DeleteLogicalThreadState( + ICorRuntimeHost* iface) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_SwitchInLogicalThreadState( + ICorRuntimeHost* iface, + DWORD *fiberCookie) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_SwitchOutLogicalThreadState( + ICorRuntimeHost* iface, + DWORD **fiberCookie) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_LocksHeldByLogicalThread( + ICorRuntimeHost* iface, + DWORD *pCount) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_MapFile( + ICorRuntimeHost* iface, + HANDLE hFile, + HMODULE *mapAddress) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_GetConfiguration( + ICorRuntimeHost* iface, + ICorConfiguration **pConfiguration) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_Start( + ICorRuntimeHost* iface) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_Stop( + ICorRuntimeHost* iface) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CreateDomain( + ICorRuntimeHost* iface, + LPCWSTR friendlyName, + IUnknown *identityArray, + IUnknown **appDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_GetDefaultDomain( + ICorRuntimeHost* iface, + IUnknown **pAppDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_EnumDomains( + ICorRuntimeHost* iface, + HDOMAINENUM *hEnum) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_NextDomain( + ICorRuntimeHost* iface, + HDOMAINENUM hEnum, + IUnknown **appDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CloseEnum( + ICorRuntimeHost* iface, + HDOMAINENUM hEnum) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CreateDomainEx( + ICorRuntimeHost* iface, + LPCWSTR friendlyName, + IUnknown *setup, + IUnknown *evidence, + IUnknown **appDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CreateDomainSetup( + ICorRuntimeHost* iface, + IUnknown **appDomainSetup) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CreateEvidence( + ICorRuntimeHost* iface, + IUnknown **evidence) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_UnloadDomain( + ICorRuntimeHost* iface, + IUnknown *appDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI corruntimehost_CurrentDomain( + ICorRuntimeHost* iface, + IUnknown **appDomain) +{ + FIXME("stub %p\n", iface); + return E_NOTIMPL; +} + +static const struct ICorRuntimeHostVtbl corruntimehost_vtbl = +{ + corruntimehost_QueryInterface, + corruntimehost_AddRef, + corruntimehost_Release, + corruntimehost_CreateLogicalThreadState, + corruntimehost_DeleteLogicalThreadState, + corruntimehost_SwitchInLogicalThreadState, + corruntimehost_SwitchOutLogicalThreadState, + corruntimehost_LocksHeldByLogicalThread, + corruntimehost_MapFile, + corruntimehost_GetConfiguration, + corruntimehost_Start, + corruntimehost_Stop, + corruntimehost_CreateDomain, + corruntimehost_GetDefaultDomain, + corruntimehost_EnumDomains, + corruntimehost_NextDomain, + corruntimehost_CloseEnum, + corruntimehost_CreateDomainEx, + corruntimehost_CreateDomainSetup, + corruntimehost_CreateEvidence, + corruntimehost_UnloadDomain, + corruntimehost_CurrentDomain +}; + +IUnknown* create_corruntimehost(void) +{ + corruntimehost *This; + + This = HeapAlloc( GetProcessHeap(), 0, sizeof *This ); + if ( !This ) + return NULL; + + This->lpVtbl = &corruntimehost_vtbl; + This->ref = 1; + + FIXME("return iface %p\n", This); + + return (IUnknown*) &This->lpVtbl; +} Propchange: trunk/reactos/dll/win32/mscoree/corruntimehost.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mscoree/mscoree.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree.…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree.rbuild (added) +++ trunk/reactos/dll/win32/mscoree/mscoree.rbuild [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -1,0 +1,11 @@ +<module name="mscoree" type="win32dll" baseaddress="${BASEADDRESS_MSCOREE}" installbase="system32" installname="mscoree.dll"> + <importlibrary definition="mscoree.spec.def" /> + <include base="mscoree">.</include> + <library>wine</library> + <library>kernel32</library> + <library>advapi32</library> + <library>uuid</library> + <file>corruntimehost.c</file> + <file>mscoree_main.c</file> + <file>mscoree.spec</file> +</module> Propchange: trunk/reactos/dll/win32/mscoree/mscoree.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mscoree/mscoree.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree.…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree.spec (added) +++ trunk/reactos/dll/win32/mscoree/mscoree.spec [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -1,0 +1,117 @@ +17 stub InitErrors +18 stub PostError +19 stub InitSSAutoEnterThread +20 stub UpdateError +22 stdcall LoadStringRC(long ptr long long) +23 stub ReOpenMetaDataWithMemory + +@ stub CallFunctionShim +@ stub CloseCtrs +@ stub ClrCreateManagedInstance +@ stub CoEEShutDownCOM +@ stdcall CoInitializeCor(long) +@ stub CoInitializeEE +@ stub CoUninitializeCor +@ stub CoUninitializeEE +@ stub CollectCtrs +@ stdcall CorBindToCurrentRuntime(wstr ptr ptr ptr) +@ stub CorBindToRuntime +@ stub CorBindToRuntimeByCfg +@ stub CorBindToRuntimeByPath +@ stub CorBindToRuntimeByPathEx +@ stdcall CorBindToRuntimeEx(wstr wstr long ptr ptr ptr) +@ stdcall CorBindToRuntimeHost(wstr wstr wstr ptr long ptr ptr ptr) +@ stub CorDllMainWorker +@ stdcall CorExitProcess(long) +@ stub CorGetSvc +@ stub CorIsLatestSvc +@ stub CorMarkThreadInThreadPool +@ stub CorTickleSvc +@ stub CreateConfigStream +@ stub CreateDebuggingInterfaceFromVersion +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stub DllRegisterServer +@ stub DllUnregisterServer +@ stub EEDllGetClassObjectFromClass +@ stub EEDllRegisterServer +@ stub EEDllUnregisterServer +@ stdcall GetAssemblyMDImport(ptr ptr ptr) +@ stub GetCORRequiredVersion +@ stub GetCORRootDirectory +@ stdcall GetCORSystemDirectory(ptr long ptr) +@ stdcall GetCORVersion(ptr long ptr) +@ stub GetCompileInfo +@ stub GetFileVersion +@ stub GetHashFromAssemblyFile +@ stub GetHashFromAssemblyFileW +@ stub GetHashFromBlob +@ stub GetHashFromFile +@ stub GetHashFromFileW +@ stub GetHashFromHandle +@ stub GetHostConfigurationFile +@ stub GetMetaDataInternalInterface +@ stub GetMetaDataInternalInterfaceFromPublic +@ stub GetMetaDataPublicInterfaceFromInternal +@ stub GetPermissionRequests +@ stub GetPrivateContextsPerfCounters +@ stub GetProcessExecutableHeap +@ stub GetRealProcAddress +@ stdcall GetRequestedRuntimeInfo(wstr wstr wstr long long ptr long ptr ptr long ptr) +@ stub GetRequestedRuntimeVersion +@ stub GetRequestedRuntimeVersionForCLSID +@ stub GetStartupFlags +@ stub GetTargetForVTableEntry +@ stub GetTokenForVTableEntry +@ stdcall GetVersionFromProcess(ptr ptr long ptr) +@ stub GetXMLElement +@ stub GetXMLElementAttribute +@ stub GetXMLObject +@ stdcall LoadLibraryShim(ptr ptr ptr ptr) +@ stub LoadLibraryWithPolicyShim +@ stdcall LoadStringRCEx(long long ptr long long ptr) +@ stub LockClrVersion +@ stub MetaDataGetDispenser +@ stdcall ND_CopyObjDst(ptr ptr long long) +@ stdcall ND_CopyObjSrc(ptr long ptr long) +@ stdcall ND_RI2(ptr long) +@ stdcall ND_RI4(ptr long) +@ stdcall -ret64 ND_RI8(ptr long) +@ stdcall ND_RU1(ptr long) +@ stdcall ND_WI2(ptr long long) +@ stdcall ND_WI4(ptr long long) +@ stdcall ND_WI8(ptr long double) +@ stdcall ND_WU1(ptr long long) +@ stub OpenCtrs +@ stub ReOpenMetaDataWithMemoryEx +@ stub RunDll@ShimW +@ stub RuntimeOSHandle +@ stub RuntimeOpenImage +@ stub RuntimeReleaseHandle +@ stub SetTargetForVTableEntry +@ stub StrongNameCompareAssemblies +@ stub StrongNameErrorInfo +@ stub StrongNameFreeBuffer +@ stub StrongNameGetBlob +@ stub StrongNameGetBlobFromImage +@ stub StrongNameGetPublicKey +@ stub StrongNameHashSize +@ stub StrongNameKeyDelete +@ stub StrongNameKeyGen +@ stub StrongNameKeyGenEx +@ stub StrongNameKeyInstall +@ stub StrongNameSignatureGeneration +@ stub StrongNameSignatureGenerationEx +@ stub StrongNameSignatureSize +@ stub StrongNameSignatureVerification +@ stub StrongNameSignatureVerificationEx +@ stub StrongNameSignatureVerificationFromImage +@ stub StrongNameTokenFromAssembly +@ stub StrongNameTokenFromAssemblyEx +@ stub StrongNameTokenFromPublicKey +@ stub TranslateSecurityAttributes +@ stdcall _CorDllMain(long long ptr) +@ stdcall _CorExeMain2(ptr long ptr ptr ptr) +@ stdcall _CorExeMain() +@ stdcall _CorImageUnloading(ptr) +@ stdcall _CorValidateImage(ptr ptr) Propchange: trunk/reactos/dll/win32/mscoree/mscoree.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mscoree/mscoree_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_main.c (added) +++ trunk/reactos/dll/win32/mscoree/mscoree_main.c [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -1,0 +1,384 @@ +/* + * Implementation of mscoree.dll + * Microsoft Component Object Runtime Execution Engine + * + * Copyright 2006 Paul Chitescu + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "ole2.h" + +#include "initguid.h" +#include "cor.h" +#include "mscoree.h" +#include "mscoree_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL( mscoree ); + +static LPWSTR get_mono_exe(void) +{ + static const WCHAR mono_exe[] = {'b','i','n','\\','m','o','n','o','.','e','x','e',' ',0}; + static const WCHAR mono_key[] = {'S','o','f','t','w','a','r','e','\\','N','o','v','e','l','l','\\','M','o','n','o',0}; + static const WCHAR defaul_clr[] = {'D','e','f','a','u','l','t','C','L','R',0}; + static const WCHAR install_root[] = {'S','d','k','I','n','s','t','a','l','l','R','o','o','t',0}; + static const WCHAR slash[] = {'\\',0}; + + WCHAR version[64], version_key[MAX_PATH], root[MAX_PATH], *ret; + DWORD len, size; + HKEY key; + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, mono_key, 0, KEY_READ, &key)) + return NULL; + + len = sizeof(version); + if (RegQueryValueExW(key, defaul_clr, 0, NULL, (LPBYTE)version, &len)) + { + RegCloseKey(key); + return NULL; + } + RegCloseKey(key); + + lstrcpyW(version_key, mono_key); + lstrcatW(version_key, slash); + lstrcatW(version_key, version); + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, version_key, 0, KEY_READ, &key)) + return NULL; + + len = sizeof(root); + if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)root, &len)) + { + RegCloseKey(key); + return NULL; + } + RegCloseKey(key); + + size = len + sizeof(slash) + sizeof(mono_exe); + if (!(ret = HeapAlloc(GetProcessHeap(), 0, size))) return NULL; + + lstrcpyW(ret, root); + lstrcatW(ret, slash); + lstrcatW(ret, mono_exe); + + return ret; +} + +HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, + LPCWSTR pwszHostConfigFile, VOID *pReserved, + DWORD startupFlags, REFCLSID rclsid, + REFIID riid, LPVOID *ppv) +{ + WCHAR *mono_exe; + + FIXME("(%s, %s, %s, %p, %d, %p, %p, %p): semi-stub!\n", debugstr_w(pwszVersion), + debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved, + startupFlags, rclsid, riid, ppv); + + if (!(mono_exe = get_mono_exe())) + { + MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n"); + return E_FAIL; + } + + HeapFree(GetProcessHeap(), 0, mono_exe); + + return S_OK; +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) + { + //case DLL_WINE_PREATTACH: + //return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +BOOL WINAPI _CorDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + FIXME("(%p, %d, %p): stub\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +__int32 WINAPI _CorExeMain(void) +{ + STARTUPINFOW si; + PROCESS_INFORMATION pi; + WCHAR *mono_exe, *cmd_line; + DWORD size, exit_code; + + if (!(mono_exe = get_mono_exe())) + { + MESSAGE("install the Windows version of Mono to run .NET executables\n"); + return -1; + } + + size = (lstrlenW(mono_exe) + lstrlenW(GetCommandLineW()) + 1) * sizeof(WCHAR); + if (!(cmd_line = HeapAlloc(GetProcessHeap(), 0, size))) + { + HeapFree(GetProcessHeap(), 0, mono_exe); + return -1; + } + + lstrcpyW(cmd_line, mono_exe); + HeapFree(GetProcessHeap(), 0, mono_exe); + lstrcatW(cmd_line, GetCommandLineW()); + + TRACE("new command line: %s\n", debugstr_w(cmd_line)); + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + if (!CreateProcessW(NULL, cmd_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + HeapFree(GetProcessHeap(), 0, cmd_line); + return -1; + } + HeapFree(GetProcessHeap(), 0, cmd_line); + + /* wait for the process to exit */ + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess(pi.hProcess, &exit_code); + + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + return (int)exit_code; +} + +__int32 WINAPI _CorExeMain2(PBYTE ptrMemory, DWORD cntMemory, LPWSTR imageName, LPWSTR loaderName, LPWSTR cmdLine) +{ + TRACE("(%p, %u, %s, %s, %s)\n", ptrMemory, cntMemory, debugstr_w(imageName), debugstr_w(loaderName), debugstr_w(cmdLine)); + FIXME("Directly running .NET applications not supported.\n"); + return -1; +} + +void WINAPI CorExitProcess(int exitCode) +{ + FIXME("(%x) stub\n", exitCode); + ExitProcess(exitCode); +} + +VOID WINAPI _CorImageUnloading(PVOID imageBase) +{ + TRACE("(%p): stub\n", imageBase); +} + +HRESULT WINAPI _CorValidateImage(PVOID* imageBase, LPCWSTR imageName) +{ + TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName)); + return E_FAIL; +} + +HRESULT WINAPI GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength) +{ + FIXME("(%p, %d, %p): stub!\n", pbuffer, cchBuffer, dwLength); + + if (!dwLength) + return E_POINTER; + + *dwLength = 0; + + return S_OK; +} + +HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength) +{ + static const WCHAR version[] = {'v','1','.','1','.','4','3','2','2',0}; + + FIXME("(%p, %d, %p): semi-stub!\n", pbuffer, cchBuffer, dwLength); + + if (!dwLength) + return E_POINTER; + + *dwLength = lstrlenW(version); + + if (cchBuffer < *dwLength) + return ERROR_INSUFFICIENT_BUFFER; + + if (pbuffer) + lstrcpyW(pbuffer, version); + + return S_OK; +} + +HRESULT WINAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile, + DWORD startupFlags, DWORD runtimeInfoFlags, LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength, + LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength) +{ + FIXME("(%s, %s, %s, 0x%08x, 0x%08x, %p, 0x%08x, %p, %p, 0x%08x, %p) stub\n", debugstr_w(pExe), + debugstr_w(pwszVersion), debugstr_w(pConfigurationFile), startupFlags, runtimeInfoFlags, pDirectory, + dwDirectory, dwDirectoryLength, pVersion, cchBuffer, dwlength); + return GetCORVersion(pVersion, cchBuffer, dwlength); +} + +HRESULT WINAPI LoadLibraryShim( LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE * phModDll) +{ + FIXME("(%p %s, %p, %p, %p): semi-stub\n", szDllName, debugstr_w(szDllName), szVersion, pvReserved, phModDll); + + if (phModDll) *phModDll = LoadLibraryW(szDllName); + return S_OK; +} + +HRESULT WINAPI CoInitializeCor(DWORD fFlags) +{ + FIXME("(0x%08x): stub\n", fFlags); + return S_OK; +} + +HRESULT WINAPI GetAssemblyMDImport(LPCWSTR szFileName, REFIID riid, IUnknown **ppIUnk) +{ + FIXME("(%p %s, %p, %p): stub\n", szFileName, debugstr_w(szFileName), riid, *ppIUnk); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +HRESULT WINAPI GetVersionFromProcess(HANDLE hProcess, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwLength) +{ + FIXME("(%p, %p, %d, %p): stub\n", hProcess, pVersion, cchBuffer, dwLength); + return E_NOTIMPL; +} + +HRESULT WINAPI LoadStringRCEx(LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int* pBufLen) +{ + HRESULT res = S_OK; + if ((iBufLen <= 0) || !pBuffer) + return E_INVALIDARG; + pBuffer[0] = 0; + if (resId) { + FIXME("(%d, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen); + res = E_NOTIMPL; + } + else + res = E_FAIL; + if (pBufLen) + *pBufLen = lstrlenW(pBuffer); + return res; +} + +HRESULT WINAPI LoadStringRC(UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet) +{ + return LoadStringRCEx(-1, resId, pBuffer, iBufLen, bQuiet, NULL); +} + +HRESULT WINAPI CorBindToRuntimeEx(LPWSTR szVersion, LPWSTR szBuildFlavor, DWORD nflags, REFCLSID rslsid, + REFIID riid, LPVOID *ppv) +{ + FIXME("%s %s %d %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ), + debugstr_guid( riid ), ppv); + + if(IsEqualGUID( riid, &IID_ICorRuntimeHost )) + { + *ppv = create_corruntimehost(); + return S_OK; + } + *ppv = NULL; + return E_NOTIMPL; +} + +HRESULT WINAPI CorBindToCurrentRuntime(LPCWSTR filename, REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ + FIXME("(%s, %s, %s, %p): stub\n", debugstr_w(filename), debugstr_guid(rclsid), debugstr_guid(riid), ppv); + return E_NOTIMPL; +} + +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + FIXME("(%p, %p, %p): stub\n", rclsid, riid, ppv); + if(!ppv) + return E_INVALIDARG; + + return E_NOTIMPL; +} + +HRESULT WINAPI DllCanUnloadNow(VOID) +{ + FIXME("stub\n"); + return S_OK; +} + +INT WINAPI ND_RU1( const void *ptr, INT offset ) +{ + return *((const BYTE *)ptr + offset); +} + +INT WINAPI ND_RI2( const void *ptr, INT offset ) +{ + return *(const SHORT *)((const BYTE *)ptr + offset); +} + +INT WINAPI ND_RI4( const void *ptr, INT offset ) +{ + return *(const INT *)((const BYTE *)ptr + offset); +} + +INT64 WINAPI ND_RI8( const void *ptr, INT offset ) +{ + return *(const INT64 *)((const BYTE *)ptr + offset); +} + +void WINAPI ND_WU1( void *ptr, INT offset, BYTE val ) +{ + *((BYTE *)ptr + offset) = val; +} + +void WINAPI ND_WI2( void *ptr, INT offset, SHORT val ) +{ + *(SHORT *)((BYTE *)ptr + offset) = val; +} + +void WINAPI ND_WI4( void *ptr, INT offset, INT val ) +{ + *(INT *)((BYTE *)ptr + offset) = val; +} + +void WINAPI ND_WI8( void *ptr, INT offset, INT64 val ) +{ + *(INT64 *)((BYTE *)ptr + offset) = val; +} + +void WINAPI ND_CopyObjDst( const void *src, void *dst, INT offset, INT size ) +{ + memcpy( (BYTE *)dst + offset, src, size ); +} + +void WINAPI ND_CopyObjSrc( const void *src, INT offset, void *dst, INT size ) +{ + memcpy( dst, (const BYTE *)src + offset, size ); +} Propchange: trunk/reactos/dll/win32/mscoree/mscoree_main.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mscoree/mscoree_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/mscoree_…
============================================================================== --- trunk/reactos/dll/win32/mscoree/mscoree_private.h (added) +++ trunk/reactos/dll/win32/mscoree/mscoree_private.h [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -1,0 +1,26 @@ +/* + * + * Copyright 2008 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __MSCOREE_PRIVATE__ +#define __MSCOREE_PRIVATE__ + +extern IUnknown* create_corruntimehost(void); + + +#endif /* __MSCOREE_PRIVATE__ */ Propchange: trunk/reactos/dll/win32/mscoree/mscoree_private.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sun Sep 7 06:48:34 2008 @@ -154,6 +154,9 @@ <directory name="msafd"> <xi:include href="msafd/msafd.rbuild" /> </directory> +<directory name="mscoree"> + <xi:include href="mscoree/mscoree.rbuild" /> +</directory> <directory name="msgina"> <xi:include href="msgina/msgina.rbuild" /> </directory>
16 years, 3 months
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
75
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
Results per page:
10
25
50
100
200