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
December 2009
----- 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
22 participants
501 discussions
Start a n
N
ew thread
[cwittich] 44439: sync msi_winetest with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 15:46:53 2009 New Revision: 44439 URL:
http://svn.reactos.org/svn/reactos?rev=44439&view=rev
Log: sync msi_winetest with wine 1.1.34 Modified: trunk/rostests/winetests/msi/automation.c trunk/rostests/winetests/msi/db.c trunk/rostests/winetests/msi/install.c Modified: trunk/rostests/winetests/msi/automation.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/automation.…
============================================================================== --- trunk/rostests/winetests/msi/automation.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/automation.c [iso-8859-1] Sun Dec 6 15:46:53 2009 @@ -1506,8 +1506,7 @@ hr = SummaryInfo_PropertyGet(pSummaryInfo, PID_LASTSAVE_DTM, &varresult, V_VT(&var)); ok(hr == S_OK, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr); - /* FIXME: Off by one second */ - todo_wine ok(V_DATE(&var) == V_DATE(&varresult), "SummaryInfo_PropertyGet expected %lf, but returned %lf\n", V_DATE(&var), V_DATE(&varresult)); + ok(V_DATE(&var) == V_DATE(&varresult), "SummaryInfo_PropertyGet expected %lf, but returned %lf\n", V_DATE(&var), V_DATE(&varresult)); VariantClear(&varresult); VariantClear(&var); @@ -1714,12 +1713,12 @@ /* Session::Mode, put */ hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE); - todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool); ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); ok(bool, "Reboot at end session mode is %d, expected 1\n", bool); hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE); /* set it again so we don't reboot */ - todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); /* Session::Database, get */ hr = Session_Database(pSession, &pDatabase); Modified: trunk/rostests/winetests/msi/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=44…
============================================================================== --- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Sun Dec 6 15:46:53 2009 @@ -7899,6 +7899,80 @@ DeleteFileA("refdb.msi"); DeleteFileA("codepage.idt"); DeleteFileA("binary.dat"); +} + +static void test_select_with_tablenames(void) +{ + MSIHANDLE hdb, view, rec; + LPCSTR query; + UINT r; + int i; + + int vals[4][2] = { + {1,12}, + {4,12}, + {1,15}, + {4,15}}; + + hdb = create_db(); + ok(hdb, "failed to create db\n"); + + /* Build a pair of tables with the same column names, but unique data */ + query = "CREATE TABLE `T1` ( `A` SHORT, `B` SHORT PRIMARY KEY `A`)"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `T1` ( `A`, `B` ) VALUES ( 1, 2 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `T1` ( `A`, `B` ) VALUES ( 4, 5 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "CREATE TABLE `T2` ( `A` SHORT, `B` SHORT PRIMARY KEY `A`)"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `T2` ( `A`, `B` ) VALUES ( 11, 12 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `T2` ( `A`, `B` ) VALUES ( 14, 15 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + + /* Test that selection based on prefixing the column with the table + * actually selects the right data */ + + query = "SELECT T1.A, T2.B FROM T1,T2"; + r = MsiDatabaseOpenView(hdb, query, &view); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = MsiViewExecute(view, 0); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + for (i = 0; i < 4; i++) + { + r = MsiViewFetch(view, &rec); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = MsiRecordGetInteger(rec, 1); + ok(r == vals[i][0], "Expected %d, got %d\n", vals[i][0], r); + + r = MsiRecordGetInteger(rec, 2); + ok(r == vals[i][1], "Expected %d, got %d\n", vals[i][1], r); + + MsiCloseHandle(rec); + } + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + + MsiViewClose(view); + MsiCloseHandle(view); + MsiCloseHandle(hdb); + DeleteFileA(msifile); } UINT ordervals[6][3] = @@ -8579,6 +8653,7 @@ test_dbtopackage(); test_droptable(); test_dbmerge(); + test_select_with_tablenames(); test_insertorder(); test_columnorder(); test_suminfo_import(); Modified: trunk/rostests/winetests/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
============================================================================== --- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Sun Dec 6 15:46:53 2009 @@ -920,6 +920,32 @@ "CustomAction\tAction\n" "TestInstalledProp\t19\t\tTest failed\t\n"; +static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostFinalize\t\t1000\n" + "ValidateProductID\t\t700\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "RemoveFiles\t\t3500\n" + "InstallFiles\t\t4000\n" + "RegisterUser\t\t6000\n" + "RegisterProduct\t\t6100\n" + "PublishFeatures\t\t6300\n" + "PublishProduct\t\t6400\n" + "InstallFinalize\t\t6600\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "UnpublishFeatures\t\t1800\n" + "InstallValidate\t\t1400\n" + "LaunchConditions\t\t100\n" + "TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n"; + +static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n" + "s72\ti2\tS64\tS0\tS255\n" + "CustomAction\tAction\n" + "TestAllUsersProp\t19\t\tTest failed\t\n"; + typedef struct _msi_table { const CHAR *filename; @@ -1547,6 +1573,19 @@ ADD_TABLE(property) }; +static const msi_table aup_tables[] = +{ + ADD_TABLE(component), + ADD_TABLE(directory), + ADD_TABLE(feature), + ADD_TABLE(feature_comp), + ADD_TABLE(file), + ADD_TABLE(aup_install_exec_seq), + ADD_TABLE(aup_custom_action), + ADD_TABLE(media), + ADD_TABLE(property) +}; + static const msi_table fiu_tables[] = { ADD_TABLE(rof_component), @@ -2810,7 +2849,7 @@ ReadFile(file, buf, sizeof(buf) - 1, &size, NULL); CloseHandle(file); } - ok( !lstrcmp( buf, "maximus" ), "Expected file to be overwritten, got '%s'\n", buf ); + ok(!memcmp( buf, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf); ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "File not installed\n"); @@ -6730,6 +6769,37 @@ delete_test_files(); } +static void test_allusers_prop(void) +{ + UINT r; + + create_test_files(); + create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, "FULL=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n"); + ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n"); + ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\changed", FALSE), "File not installed\n"); + ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\first", FALSE), "File not installed\n"); + ok(delete_pf("msitest\\filename", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n"); + ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); + ok(delete_pf("msitest", FALSE), "File not installed\n"); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + delete_test_files(); +} + static char session_manager[] = "System\\CurrentControlSet\\Control\\Session Manager"; static char rename_ops[] = "PendingFileRenameOperations"; @@ -7065,6 +7135,7 @@ test_file_in_use(); test_file_in_use_cab(); test_MsiSetExternalUI(); + test_allusers_prop(); DeleteFileA(log_file);
15 years
1
0
0
0
[tkreuzer] 44438: copy widl from trunk
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Dec 6 15:44:33 2009 New Revision: 44438 URL:
http://svn.reactos.org/svn/reactos?rev=44438&view=rev
Log: copy widl from trunk Modified: branches/ros-amd64-bringup/reactos/tools/widl/header.c branches/ros-amd64-bringup/reactos/tools/widl/parser.tab.c branches/ros-amd64-bringup/reactos/tools/widl/parser.y branches/ros-amd64-bringup/reactos/tools/widl/typegen.c Modified: branches/ros-amd64-bringup/reactos/tools/widl/header.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
============================================================================== --- branches/ros-amd64-bringup/reactos/tools/widl/header.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/widl/header.c [iso-8859-1] Sun Dec 6 15:44:33 2009 @@ -318,14 +318,14 @@ { if (is_conformant_array(t)) { - fprintf(h, "[%s]", is_field ? "1" : ""); - t = type_array_get_element(t); - } - for ( ; - type_get_type(t) == TYPE_ARRAY && !type_array_is_decl_as_ptr(t); - t = type_array_get_element(t)) - fprintf(h, "[%u]", type_array_get_dim(t)); - } + fprintf(h, "[%s]", is_field ? "1" : ""); + t = type_array_get_element(t); + } + for ( ; + type_get_type(t) == TYPE_ARRAY && !type_array_is_decl_as_ptr(t); + t = type_array_get_element(t)) + fprintf(h, "[%u]", type_array_get_dim(t)); + } break; case TYPE_BITFIELD: fprintf(h, " : %lu", type_bitfield_get_bits(t)->cval); @@ -343,7 +343,7 @@ case TYPE_INTERFACE: case TYPE_POINTER: break; -} + } } static void write_type_v(FILE *h, type_t *t, int is_field, int declonly, const char *name) @@ -354,40 +354,40 @@ if (!h) return; if (t) { - for (pt = t; is_ptr(pt); pt = type_pointer_get_ref(pt), ptr_level++) - ; - - if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { - int i; - const char *callconv = get_attrp(pt->attrs, ATTR_CALLCONV); - if (!callconv) callconv = ""; - if (is_attr(pt->attrs, ATTR_INLINE)) fprintf(h, "inline "); - write_type_left(h, type_function_get_rettype(pt), declonly); - fputc(' ', h); - if (ptr_level) fputc('(', h); - fprintf(h, "%s ", callconv); - for (i = 0; i < ptr_level; i++) - fputc('*', h); - } else - write_type_left(h, t, declonly); + for (pt = t; is_ptr(pt); pt = type_pointer_get_ref(pt), ptr_level++) + ; + + if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { + int i; + const char *callconv = get_attrp(pt->attrs, ATTR_CALLCONV); + if (!callconv) callconv = ""; + if (is_attr(pt->attrs, ATTR_INLINE)) fprintf(h, "inline "); + write_type_left(h, type_function_get_rettype(pt), declonly); + fputc(' ', h); + if (ptr_level) fputc('(', h); + fprintf(h, "%s ", callconv); + for (i = 0; i < ptr_level; i++) + fputc('*', h); + } else + write_type_left(h, t, declonly); } if (name) fprintf(h, "%s%s", !t || needs_space_after(t) ? " " : "", name ); if (t) { - if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { - const var_list_t *args = type_function_get_args(pt); - - if (ptr_level) fputc(')', h); - fputc('(', h); - if (args) - write_args(h, args, NULL, 0, FALSE); - else - fprintf(h, "void"); - fputc(')', h); - } else - write_type_right(h, t, is_field); -} + if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) { + const var_list_t *args = type_function_get_args(pt); + + if (ptr_level) fputc(')', h); + fputc('(', h); + if (args) + write_args(h, args, NULL, 0, FALSE); + else + fprintf(h, "void"); + fputc(')', h); + } else + write_type_right(h, t, is_field); + } } void write_type_def_or_decl(FILE *f, type_t *t, int field, const char *name) Modified: branches/ros-amd64-bringup/reactos/tools/widl/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
============================================================================== --- branches/ros-amd64-bringup/reactos/tools/widl/parser.tab.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/widl/parser.tab.c [iso-8859-1] Sun Dec 6 15:44:33 2009 @@ -5541,7 +5541,7 @@ } static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl, - int top) + int top) { var_t *v = decl->var; expr_list_t *sizes = get_attrp(attrs, ATTR_SIZEIS); @@ -5614,8 +5614,8 @@ type_t *t = type; if (!is_ptr(v->type) && !arr) - error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", - v->name); + error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", + v->name); while (is_ptr(t)) t = type_pointer_get_ref(t); @@ -6712,7 +6712,7 @@ var.name = xstrdup("return value"); check_field_common(func->type, funcname, &var); free(var.name); -} + } } static void add_explicit_handle_if_necessary(var_t *func) Modified: branches/ros-amd64-bringup/reactos/tools/widl/parser.y URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
============================================================================== --- branches/ros-amd64-bringup/reactos/tools/widl/parser.y [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/widl/parser.y [iso-8859-1] Sun Dec 6 15:44:33 2009 @@ -1376,7 +1376,7 @@ } static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl, - int top) + int top) { var_t *v = decl->var; expr_list_t *sizes = get_attrp(attrs, ATTR_SIZEIS); @@ -1449,8 +1449,8 @@ type_t *t = type; if (!is_ptr(v->type) && !arr) - error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", - v->name); + error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", + v->name); while (is_ptr(t)) t = type_pointer_get_ref(t); @@ -2547,7 +2547,7 @@ var.name = xstrdup("return value"); check_field_common(func->type, funcname, &var); free(var.name); -} + } } static void add_explicit_handle_if_necessary(var_t *func) Modified: branches/ros-amd64-bringup/reactos/tools/widl/typegen.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
============================================================================== --- branches/ros-amd64-bringup/reactos/tools/widl/typegen.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/widl/typegen.c [iso-8859-1] Sun Dec 6 15:44:33 2009 @@ -3249,7 +3249,7 @@ local_var_prefix, var->name); print_file(file, indent+1, "0x%02x /* %s */);\n", fc, string_of_type(fc)); - } + } else { const type_t *ref = is_ptr(type) ? type_pointer_get_ref(type) : type; @@ -3298,45 +3298,45 @@ size = 0; } - if (phase == PHASE_MARSHAL) - print_file(file, indent, "MIDL_memset(__frame->_StubMsg.Buffer, 0, (0x%x - (ULONG_PTR)__frame->_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1); - print_file(file, indent, "__frame->_StubMsg.Buffer = (unsigned char *)(((ULONG_PTR)__frame->_StubMsg.Buffer + %u) & ~0x%x);\n", - alignment - 1, alignment - 1); - - if (phase == PHASE_MARSHAL) - { - print_file(file, indent, "*("); + if (phase == PHASE_MARSHAL) + print_file(file, indent, "MIDL_memset(__frame->_StubMsg.Buffer, 0, (0x%x - (ULONG_PTR)__frame->_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1); + print_file(file, indent, "__frame->_StubMsg.Buffer = (unsigned char *)(((ULONG_PTR)__frame->_StubMsg.Buffer + %u) & ~0x%x);\n", + alignment - 1, alignment - 1); + + if (phase == PHASE_MARSHAL) + { + print_file(file, indent, "*("); + write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); + if (is_ptr(type)) + fprintf(file, " *)__frame->_StubMsg.Buffer = *"); + else + fprintf(file, " *)__frame->_StubMsg.Buffer = "); + fprintf(file, "%s%s", local_var_prefix, varname); + fprintf(file, ";\n"); + } + else if (phase == PHASE_UNMARSHAL) + { + print_file(file, indent, "if (__frame->_StubMsg.Buffer + sizeof("); + write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); + fprintf(file, ") > __frame->_StubMsg.BufferEnd)\n"); + print_file(file, indent, "{\n"); + print_file(file, indent + 1, "RpcRaiseException(RPC_X_BAD_STUB_DATA);\n"); + print_file(file, indent, "}\n"); + print_file(file, indent, "%s%s%s", + (pass == PASS_IN || pass == PASS_RETURN) ? "" : "*", + local_var_prefix, varname); + if (pass == PASS_IN && is_ptr(type)) + fprintf(file, " = ("); + else + fprintf(file, " = *("); + write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); + fprintf(file, " *)__frame->_StubMsg.Buffer;\n"); + } + + print_file(file, indent, "__frame->_StubMsg.Buffer += sizeof("); write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); - if (is_ptr(type)) - fprintf(file, " *)__frame->_StubMsg.Buffer = *"); - else - fprintf(file, " *)__frame->_StubMsg.Buffer = "); - fprintf(file, "%s%s", local_var_prefix, varname); - fprintf(file, ";\n"); - } - else if (phase == PHASE_UNMARSHAL) - { - print_file(file, indent, "if (__frame->_StubMsg.Buffer + sizeof("); - write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); - fprintf(file, ") > __frame->_StubMsg.BufferEnd)\n"); - print_file(file, indent, "{\n"); - print_file(file, indent + 1, "RpcRaiseException(RPC_X_BAD_STUB_DATA);\n"); - print_file(file, indent, "}\n"); - print_file(file, indent, "%s%s%s", - (pass == PASS_IN || pass == PASS_RETURN) ? "" : "*", - local_var_prefix, varname); - if (pass == PASS_IN && is_ptr(type)) - fprintf(file, " = ("); - else - fprintf(file, " = *("); - write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); - fprintf(file, " *)__frame->_StubMsg.Buffer;\n"); - } - - print_file(file, indent, "__frame->_StubMsg.Buffer += sizeof("); - write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL); - fprintf(file, ");\n"); -} + fprintf(file, ");\n"); + } } /* returns whether the MaxCount, Offset or ActualCount members need to be @@ -3589,7 +3589,7 @@ break; } case TGT_BASIC: - print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); + print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); break; case TGT_ENUM: print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); @@ -3661,7 +3661,7 @@ if (pointer_type == RPC_FC_RP) switch (typegen_detect_type(ref, NULL, TDT_ALL_TYPES)) { case TGT_BASIC: - print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); + print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); break; case TGT_ENUM: /* base types have known sizes, so don't need a sizing pass
15 years
1
0
0
0
[janderwald] 44437: Return correct error code
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Dec 6 11:37:23 2009 New Revision: 44437 URL:
http://svn.reactos.org/svn/reactos?rev=44437&view=rev
Log: Return correct error code Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wave.c Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wave.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wave.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wave.c [iso-8859-1] Sun Dec 6 11:37:23 2009 @@ -706,7 +706,7 @@ if (!NT_SUCCESS(Status)) { /* failed to open the pin */ - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + return SetIrpIoStatus(Irp, STATUS_NOT_SUPPORTED, 0); } /* store the handle */
15 years
1
0
0
0
[cwittich] 44436: sync netapi32_winetest with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 10:50:53 2009 New Revision: 44436 URL:
http://svn.reactos.org/svn/reactos?rev=44436&view=rev
Log: sync netapi32_winetest with wine 1.1.34 Modified: trunk/rostests/winetests/netapi32/access.c trunk/rostests/winetests/netapi32/apibuf.c trunk/rostests/winetests/netapi32/wksta.c Modified: trunk/rostests/winetests/netapi32/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/netapi32/access…
============================================================================== --- trunk/rostests/winetests/netapi32/access.c [iso-8859-1] (original) +++ trunk/rostests/winetests/netapi32/access.c [iso-8859-1] Sun Dec 6 10:50:53 2009 @@ -155,16 +155,19 @@ todo_wine { /* FIXME - Currently Wine can't verify whether the network path is good or bad */ rc=pNetUserGetInfo(sBadNetPath, sTestUserName, 0, (LPBYTE *)&ui0); - ok(rc == ERROR_BAD_NETPATH || rc == ERROR_NETWORK_UNREACHABLE, + ok(rc == ERROR_BAD_NETPATH || + rc == ERROR_NETWORK_UNREACHABLE || + rc == RPC_S_SERVER_UNAVAILABLE || + rc == RPC_S_INVALID_NET_ADDR, /* Some Win7 */ "Bad Network Path: rc=%d\n",rc); } rc=pNetUserGetInfo(sEmptyStr, sTestUserName, 0, (LPBYTE *)&ui0); ok(rc == ERROR_BAD_NETPATH || rc == NERR_Success, "Bad Network Path: rc=%d\n",rc); rc=pNetUserGetInfo(sInvalidName, sTestUserName, 0, (LPBYTE *)&ui0); - ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%d\n",rc); + ok(rc == ERROR_INVALID_NAME || rc == ERROR_INVALID_HANDLE,"Invalid Server Name: rc=%d\n",rc); rc=pNetUserGetInfo(sInvalidName2, sTestUserName, 0, (LPBYTE *)&ui0); - ok(rc == ERROR_INVALID_NAME,"Invalid Server Name: rc=%d\n",rc); + ok(rc == ERROR_INVALID_NAME || rc == ERROR_INVALID_HANDLE,"Invalid Server Name: rc=%d\n",rc); if(delete_test_user() != NERR_Success) trace("Deleting the test user failed. You might have to manually delete it.\n"); Modified: trunk/rostests/winetests/netapi32/apibuf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/netapi32/apibuf…
============================================================================== --- trunk/rostests/winetests/netapi32/apibuf.c [iso-8859-1] (original) +++ trunk/rostests/winetests/netapi32/apibuf.c [iso-8859-1] Sun Dec 6 10:50:53 2009 @@ -54,7 +54,6 @@ ok(pNetApiBufferFree(p) == NERR_Success, "Freed\n"); - ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n"); ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer\n"); /* border reallocate cases */ Modified: trunk/rostests/winetests/netapi32/wksta.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/netapi32/wksta.…
============================================================================== --- trunk/rostests/winetests/netapi32/wksta.c [iso-8859-1] (original) +++ trunk/rostests/winetests/netapi32/wksta.c [iso-8859-1] Sun Dec 6 10:50:53 2009 @@ -173,7 +173,8 @@ ok(bufPtr != NULL, "got data back\n"); ok(entriesRead > 0, "read at least one transport\n"); - ok(totalEntries > 0, "at least one transport\n"); + ok(totalEntries > 0 || broken(totalEntries == 0) /* Win7 */, + "at least one transport\n"); pNetApiBufferFree(bufPtr); } } @@ -198,7 +199,10 @@ } if (init_wksta_tests()) { - run_get_comp_name_tests(); + if (pNetpGetComputerName) + run_get_comp_name_tests(); + else + win_skip("Function NetpGetComputerName not available\n"); run_wkstausergetinfo_tests(); run_wkstatransportenum_tests(); }
15 years
1
0
0
0
[cwittich] 44435: sync msxml3_winetest with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 10:48:52 2009 New Revision: 44435 URL:
http://svn.reactos.org/svn/reactos?rev=44435&view=rev
Log: sync msxml3_winetest with wine 1.1.34 Modified: trunk/rostests/winetests/msxml3/domdoc.c Modified: trunk/rostests/winetests/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
============================================================================== --- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Sun Dec 6 10:48:52 2009 @@ -147,8 +147,33 @@ "</h1></body></html>"; static const CHAR szTypeValueXML[] = -"<?xml version=\"1.0\" encoding=\"utf-8\"?>" -"<string>Wine</string>"; +"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +"<root xmlns:dt=\"urn:schemas-microsoft-com:datatypes\">\n" +" <string>Wine</string>\n" +" <string2 dt:dt=\"string\">String</string2>\n" +" <number dt:dt=\"number\">12.44</number>\n" +" <number2 dt:dt=\"NUMbEr\">-3.71e3</number2>\n" +" <int dt:dt=\"int\">-13</int>\n" +" <fixed dt:dt=\"fixed.14.4\">7322.9371</fixed>\n" +" <bool dt:dt=\"boolean\">1</bool>\n" +" <datetime dt:dt=\"datetime\">2009-11-18T03:21:33.12</datetime>\n" +" <datetimetz dt:dt=\"datetime.tz\">2003-07-11T11:13:57+03:00</datetimetz>\n" +" <date dt:dt=\"date\">3721-11-01</date>\n" +" <time dt:dt=\"time\">13:57:12.31321</time>\n" +" <timetz dt:dt=\"time.tz\">23:21:01.13+03:21</timetz>\n" +" <i1 dt:dt=\"i1\">-13</i1>\n" +" <i2 dt:dt=\"i2\">31915</i2>\n" +" <i4 dt:dt=\"i4\">-312232</i4>\n" +" <ui1 dt:dt=\"ui1\">123</ui1>\n" +" <ui2 dt:dt=\"ui2\">48282</ui2>\n" +" <ui4 dt:dt=\"ui4\">949281</ui4>\n" +" <r4 dt:dt=\"r4\">213124.0</r4>\n" +" <r8 dt:dt=\"r8\">0.412</r8>\n" +" <float dt:dt=\"float\">41221.421</float>\n" +" <uuid dt:dt=\"uuid\">333C7BC4-460F-11D0-BC04-0080C7055a83</uuid>\n" +" <binhex dt:dt=\"bin.hex\">fffca012003c</binhex>\n" +" <binbase64 dt:dt=\"bin.base64\">YmFzZTY0IHRlc3Q=</binbase64>\n" +"</root>"; static const CHAR szBasicTransformSSXMLPart1[] = "<?xml version=\"1.0\"?>" @@ -184,6 +209,9 @@ static const WCHAR szNonExistentFile[] = { 'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', '.', 'x', 'm', 'l', 0 }; +static const WCHAR szNonExistentAttribute[] = { + 'n','o','n','E','x','i','s','i','t','i','n','g','A','t','t','r','i','b','u','t','e',0 +}; static const WCHAR szDocument[] = { '#', 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', 0 }; @@ -243,6 +271,8 @@ HRESULT r = expr; \ ok(r == (expect), #expr " returned %x, expected %x\n", r, expect); \ } + +#define double_eq(x, y) ok((x)-(y)<=1e-14*(x) && (x)-(y)>=-1e-14*(x), "expected %.16g, got %.16g\n", x, y) static BSTR alloc_str_from_narrow(const char *str) { @@ -1003,6 +1033,10 @@ CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc ); if( r != S_OK ) return; + if (!doc) { + ok( FALSE, "no document\n"); + return; + } b = FALSE; str = SysAllocString( szComplete4 ); @@ -1011,19 +1045,14 @@ ok( b == VARIANT_TRUE, "failed to load XML string\n"); SysFreeString( str ); - if (doc) - { - b = 1; - r = IXMLDOMNode_hasChildNodes( doc, &b ); - ok( r == S_OK, "hasChildNoes bad return\n"); - ok( b == VARIANT_TRUE, "hasChildNoes wrong result\n"); - - r = IXMLDOMDocument_get_documentElement( doc, &element ); - ok( r == S_OK, "should be a document element\n"); - ok( element != NULL, "should be an element\n"); - } - else - ok( FALSE, "no document\n"); + b = 1; + r = IXMLDOMNode_hasChildNodes( doc, &b ); + ok( r == S_OK, "hasChildNoes bad return\n"); + ok( b == VARIANT_TRUE, "hasChildNoes wrong result\n"); + + r = IXMLDOMDocument_get_documentElement( doc, &element ); + ok( r == S_OK, "should be a document element\n"); + ok( element != NULL, "should be an element\n"); VariantInit(&var); ok( V_VT(&var) == VT_EMPTY, "variant init failed\n"); @@ -1084,7 +1113,7 @@ SysFreeString( str ); attr = (IXMLDOMAttribute*)0xdeadbeef; - str = _bstr_("nonExisitingAttribute"); + str = SysAllocString( szNonExistentAttribute ); r = IXMLDOMElement_getAttributeNode( element, str, &attr); ok( r == S_FALSE, "getAttributeNode ret %08x\n", r ); ok( attr == NULL, "getAttributeNode ret %p, expected NULL\n", attr ); @@ -1290,7 +1319,6 @@ /* now traverse the tree from the root element */ if (element) { - IXMLDOMNode *node; r = IXMLDOMNode_get_childNodes( element, &list ); ok( r == S_OK, "get_childNodes returned wrong code\n"); @@ -1306,18 +1334,18 @@ IXMLDOMNodeList_AddRef(list); expect_list_and_release(list, "E1.E2.D1 E2.E2.D1 E3.E2.D1 E4.E2.D1"); ole_check(IXMLDOMNodeList_reset(list)); + + node = (void*)0xdeadbeef; + r = IXMLDOMNode_selectSingleNode( element, szdl, &node ); + ok( r == S_FALSE, "ret %08x\n", r ); + ok( node == NULL, "node %p\n", node ); + r = IXMLDOMNode_selectSingleNode( element, szbs, &node ); + ok( r == S_OK, "ret %08x\n", r ); + r = IXMLDOMNode_Release( node ); + ok( r == 0, "ret %08x\n", r ); } else ok( FALSE, "no element\n"); - - node = (void*)0xdeadbeef; - r = IXMLDOMNode_selectSingleNode( element, szdl, &node ); - ok( r == S_FALSE, "ret %08x\n", r ); - ok( node == NULL, "node %p\n", node ); - r = IXMLDOMNode_selectSingleNode( element, szbs, &node ); - ok( r == S_OK, "ret %08x\n", r ); - r = IXMLDOMNode_Release( node ); - ok( r == 0, "ret %08x\n", r ); if (list) { @@ -1412,8 +1440,7 @@ if (element) IXMLDOMElement_Release( element ); - if (doc) - ok(IXMLDOMDocument_Release( doc ) == 0, "document is not destroyed\n"); + ok(IXMLDOMDocument_Release( doc ) == 0, "document is not destroyed\n"); } static void test_refs(void) @@ -3972,7 +3999,7 @@ hr = IXMLDOMDocument2_get_nodeTypedValue(doc, &v); ok(hr == S_FALSE, "ret %08x\n", hr ); - hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("string"), &pNode); + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/string"), &pNode); ok(hr == S_OK, "ret %08x\n", hr ); if(hr == S_OK) { @@ -3987,8 +4014,315 @@ hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BSTR, "incorrect type\n"); ok(!lstrcmpW( V_BSTR(&v), _bstr_("Wine") ), "incorrect value\n"); VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/string2"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BSTR, "incorrect type\n"); + ok(!lstrcmpW( V_BSTR(&v), _bstr_("String") ), "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/number"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BSTR, "incorrect type\n"); + ok(!lstrcmpW( V_BSTR(&v), _bstr_("12.44") ), "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/number2"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BSTR, "incorrect type\n"); + ok(!lstrcmpW( V_BSTR(&v), _bstr_("-3.71e3") ), "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/int"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_I4, "incorrect type\n"); + ok(V_I4(&v) == -13, "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/fixed"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_CY, "incorrect type\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/bool"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BOOL, "incorrect type\n"); + ok(V_BOOL(&v) == VARIANT_TRUE, "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/datetime"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_DATE, "incorrect type\n"); + double_eq(40135.13996527778, V_DATE(&v)); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/datetimetz"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_DATE, "incorrect type\n"); + double_eq(37813.59302083334, V_DATE(&v)); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/date"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_DATE, "incorrect type\n"); + double_eq(665413.0, V_DATE(&v)); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/time"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_DATE, "incorrect type\n"); + double_eq(0.5813888888888888, V_DATE(&v)); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/timetz"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_DATE, "incorrect type\n"); + double_eq(1.112511574074074, V_DATE(&v)); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/i1"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_I1, "incorrect type\n"); + ok(V_I1(&v) == -13, "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/i2"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_I2, "incorrect type\n"); + ok(V_I2(&v) == 31915, "incorrect value\n"); + VariantClear( &v ); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/i4"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_I4, "incorrect type\n"); + ok(V_I4(&v) == -312232, "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/ui1"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_UI1, "incorrect type\n"); + ok(V_UI1(&v) == 123, "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/ui2"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_UI2, "incorrect type\n"); + ok(V_UI2(&v) == 48282, "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/ui4"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_UI4, "incorrect type\n"); + ok(V_UI4(&v) == 949281, "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/r4"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_R4, "incorrect type\n"); + double_eq(213124.0, V_R4(&v)); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/r8"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_R8, "incorrect type\n"); + double_eq(0.412, V_R8(&v)); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/float"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_R8, "incorrect type\n"); + double_eq(41221.421, V_R8(&v)); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/uuid"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == VT_BSTR, "incorrect type\n"); + ok(!lstrcmpW(V_BSTR(&v), _bstr_("333C7BC4-460F-11D0-BC04-0080C7055a83")), "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/binhex"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + BYTE bytes[] = {0xff,0xfc,0xa0,0x12,0x00,0x3c}; + + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == (VT_ARRAY|VT_UI1), "incorrect type\n"); + ok(V_ARRAY(&v)->rgsabound[0].cElements == 6, "incorrect array size\n"); + if(V_ARRAY(&v)->rgsabound[0].cElements == 6) + ok(!memcmp(bytes, V_ARRAY(&v)->pvData, sizeof(bytes)), "incorrect value\n"); + VariantClear(&v); + + IXMLDOMNode_Release(pNode); + } + + hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/binbase64"), &pNode); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + BYTE bytes[] = {0x62,0x61,0x73,0x65,0x36,0x34,0x20,0x74,0x65,0x73,0x74}; + + hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(V_VT(&v) == (VT_ARRAY|VT_UI1), "incorrect type\n"); + ok(V_ARRAY(&v)->rgsabound[0].cElements == 11, "incorrect array size\n"); + if(V_ARRAY(&v)->rgsabound[0].cElements == 11) + ok(!memcmp(bytes, V_ARRAY(&v)->pvData, sizeof(bytes)), "incorrect value\n"); + VariantClear(&v); IXMLDOMNode_Release(pNode); }
15 years
1
0
0
0
[cwittich] 44434: sync rsaenh with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 10:41:08 2009 New Revision: 44434 URL:
http://svn.reactos.org/svn/reactos?rev=44434&view=rev
Log: sync rsaenh with wine 1.1.34 Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rsaenh/rsaenh.c?…
============================================================================== --- trunk/reactos/dll/win32/rsaenh/rsaenh.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rsaenh/rsaenh.c [iso-8859-1] Sun Dec 6 10:41:08 2009 @@ -2324,7 +2324,7 @@ if (Final) { if (pbData[*pdwDataLen-1] && pbData[*pdwDataLen-1] <= pCryptKey->dwBlockLen && - pbData[*pdwDataLen-1] < *pdwDataLen) { + pbData[*pdwDataLen-1] <= *pdwDataLen) { BOOL padOkay = TRUE; /* check that every bad byte has the same value */
15 years
1
0
0
0
[cwittich] 44433: sync rsaenh_winetest with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 10:40:22 2009 New Revision: 44433 URL:
http://svn.reactos.org/svn/reactos?rev=44433&view=rev
Log: sync rsaenh_winetest with wine 1.1.34 Modified: trunk/rostests/winetests/rsaenh/rsaenh.c Modified: trunk/rostests/winetests/rsaenh/rsaenh.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rsaenh/rsaenh.c…
============================================================================== --- trunk/rostests/winetests/rsaenh/rsaenh.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rsaenh/rsaenh.c [iso-8859-1] Sun Dec 6 10:40:22 2009 @@ -72,9 +72,15 @@ HKEY hkey; char guid[MAX_PATH]; DWORD size = MAX_PATH; + HRESULT ret; /* Get the MachineGUID */ - RegOpenKeyA(HKEY_LOCAL_MACHINE, szCryptography, &hkey); + ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, szCryptography, 0, KEY_READ | KEY_WOW64_64KEY, &hkey); + if (ret == ERROR_ACCESS_DENIED) + { + /* Windows 2000 can't handle KEY_WOW64_64KEY */ + RegOpenKeyA(HKEY_LOCAL_MACHINE, szCryptography, &hkey); + } RegQueryValueExA(hkey, szMachineGuid, NULL, NULL, (LPBYTE)guid, &size); RegCloseKey(hkey); @@ -2085,7 +2091,7 @@ if (result) { ok(dataLen == sizeof(test_string), "unexpected size %d\n", dataLen); - ok(!memcmp(data, test_string, sizeof(test_string)), "unexpected value"); + ok(!memcmp(data, test_string, sizeof(test_string)), "unexpected value\n"); } CryptReleaseContext(prov, 0);
15 years
1
0
0
0
[cwittich] 44432: sync crypt32_winetest with wine 1.1.34
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Dec 6 10:36:50 2009 New Revision: 44432 URL:
http://svn.reactos.org/svn/reactos?rev=44432&view=rev
Log: sync crypt32_winetest with wine 1.1.34 Modified: trunk/rostests/winetests/crypt32/cert.c trunk/rostests/winetests/crypt32/chain.c trunk/rostests/winetests/crypt32/crl.c trunk/rostests/winetests/crypt32/encode.c trunk/rostests/winetests/crypt32/protectdata.c Modified: trunk/rostests/winetests/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/cert.c?…
============================================================================== --- trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] Sun Dec 6 10:36:50 2009 @@ -2541,6 +2541,29 @@ CertFreeCertificateContext(contexts[2]); } +static BYTE cn[] = { +0x30,0x14,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x03,0x13,0x09,0x4a,0x75, +0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67 }; +static BYTE cnWithLeadingSpace[] = { +0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x20,0x4a, +0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67 }; +static BYTE cnWithTrailingSpace[] = { +0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75, +0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x20 }; +static BYTE cnWithIntermediateSpace[] = { +0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75, +0x61,0x6e,0x20,0x20,0x4c,0x61,0x6e,0x67 }; +static BYTE cnThenO[] = { +0x30,0x2d,0x31,0x2b,0x30,0x10,0x06,0x03,0x55,0x04,0x03,0x13,0x09,0x4a,0x75, +0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x30,0x17,0x06,0x03,0x55,0x04,0x0a,0x13, +0x10,0x54,0x68,0x65,0x20,0x57,0x69,0x6e,0x65,0x20,0x50,0x72,0x6f,0x6a,0x65, +0x63,0x74 }; +static BYTE oThenCN[] = { +0x30,0x2d,0x31,0x2b,0x30,0x10,0x06,0x03,0x55,0x04,0x0a,0x13,0x09,0x4a,0x75, +0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x30,0x17,0x06,0x03,0x55,0x04,0x03,0x13, +0x10,0x54,0x68,0x65,0x20,0x57,0x69,0x6e,0x65,0x20,0x50,0x72,0x6f,0x6a,0x65, +0x63,0x74 }; + static void testCompareCertName(void) { static BYTE bogus[] = { 1, 2, 3, 4 }; @@ -2572,6 +2595,167 @@ blob2.cbData = sizeof(emptyPrime); ret = CertCompareCertificateName(0, &blob1, &blob2); ok(!ret, "Expected failure\n"); + /* Tests to show that CertCompareCertificateName doesn't decode the name + * to remove spaces, or to do an order-independent comparison. + */ + /* Compare CN="Juan Lang" with CN=" Juan Lang" */ + blob1.pbData = cn; + blob1.cbData = sizeof(cn); + blob2.pbData = cnWithLeadingSpace; + blob2.cbData = sizeof(cnWithLeadingSpace); + ret = CertCompareCertificateName(0, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + ret = CertCompareCertificateName(X509_ASN_ENCODING, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + /* Compare CN="Juan Lang" with CN="Juan Lang " */ + blob2.pbData = cnWithTrailingSpace; + blob2.cbData = sizeof(cnWithTrailingSpace); + ret = CertCompareCertificateName(0, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + ret = CertCompareCertificateName(X509_ASN_ENCODING, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + /* Compare CN="Juan Lang" with CN="Juan Lang" */ + blob2.pbData = cnWithIntermediateSpace; + blob2.cbData = sizeof(cnWithIntermediateSpace); + ret = CertCompareCertificateName(0, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + ret = CertCompareCertificateName(X509_ASN_ENCODING, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + /* Compare 'CN="Juan Lang", O="The Wine Project"' with + * 'O="The Wine Project", CN="Juan Lang"' + */ + blob1.pbData = cnThenO; + blob1.cbData = sizeof(cnThenO); + blob2.pbData = oThenCN; + blob2.cbData = sizeof(oThenCN); + ret = CertCompareCertificateName(0, &blob1, &blob2); + ok(!ret, "Expected failure\n"); + ret = CertCompareCertificateName(X509_ASN_ENCODING, &blob1, &blob2); + ok(!ret, "Expected failure\n"); +} + +static void testIsRDNAttrsInCertificateName(void) +{ + static char oid_1_2_3[] = "1.2.3"; + static char oid_common_name[] = szOID_COMMON_NAME; + static char oid_organization[] = szOID_ORGANIZATION_NAME; + static char juan[] = "Juan Lang"; + static char juan_with_leading_space[] = " Juan Lang"; + static char juan_with_intermediate_space[] = "Juan Lang"; + static char juan_with_trailing_space[] = "Juan Lang "; + static char juan_lower_case[] = "juan lang"; + static WCHAR juanW[] = { 'J','u','a','n',' ','L','a','n','g',0 }; + static char the_wine_project[] = "The Wine Project"; + BOOL ret; + CERT_NAME_BLOB name; + CERT_RDN_ATTR attr[2]; + CERT_RDN rdn = { 0, NULL }; + + name.cbData = sizeof(cn); + name.pbData = cn; + if (0) + { + /* Crash */ + ret = CertIsRDNAttrsInCertificateName(0, 0, NULL, NULL); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, + NULL); + } + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(0, 0, &name, NULL); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, + "expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError()); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(ret, "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); + attr[0].pszObjId = oid_1_2_3; + rdn.rgRDNAttr = attr; + rdn.cRDNAttr = 1; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + attr[0].pszObjId = oid_common_name; + attr[0].dwValueType = CERT_RDN_PRINTABLE_STRING; + attr[0].Value.cbData = strlen(juan); + attr[0].Value.pbData = (BYTE *)juan; + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(ret, "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); + /* Again, spaces are not removed for name comparison. */ + attr[0].Value.cbData = strlen(juan_with_leading_space); + attr[0].Value.pbData = (BYTE *)juan_with_leading_space; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + attr[0].Value.cbData = strlen(juan_with_intermediate_space); + attr[0].Value.pbData = (BYTE *)juan_with_intermediate_space; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + attr[0].Value.cbData = strlen(juan_with_trailing_space); + attr[0].Value.pbData = (BYTE *)juan_with_trailing_space; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + /* The lower case name isn't matched unless a case insensitive match is + * specified. + */ + attr[0].Value.cbData = strlen(juan_lower_case); + attr[0].Value.pbData = (BYTE *)juan_lower_case; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, + CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG, &name, &rdn); + ok(ret || + broken(!ret && GetLastError() == CRYPT_E_NO_MATCH), /* Older crypt32 */ + "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); + /* The values don't match unless they have the same RDN type */ + attr[0].dwValueType = CERT_RDN_UNICODE_STRING; + attr[0].Value.cbData = lstrlenW(juanW) * sizeof(WCHAR); + attr[0].Value.pbData = (BYTE *)juanW; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, + CERT_UNICODE_IS_RDN_ATTRS_FLAG, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + attr[0].dwValueType = CERT_RDN_IA5_STRING; + attr[0].Value.cbData = strlen(juan); + attr[0].Value.pbData = (BYTE *)juan; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + /* All attributes must be present */ + attr[0].dwValueType = CERT_RDN_PRINTABLE_STRING; + attr[0].Value.cbData = strlen(juan); + attr[0].Value.pbData = (BYTE *)juan; + attr[1].pszObjId = oid_organization; + attr[1].dwValueType = CERT_RDN_PRINTABLE_STRING; + attr[1].Value.cbData = strlen(the_wine_project); + attr[1].Value.pbData = (BYTE *)the_wine_project; + rdn.cRDNAttr = 2; + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + /* Order also matters */ + name.pbData = cnThenO; + name.cbData = sizeof(cnThenO); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(ret, "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); + name.pbData = oThenCN; + name.cbData = sizeof(oThenCN); + SetLastError(0xdeadbeef); + ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, 0, &name, &rdn); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); } static BYTE int1[] = { 0x88, 0xff, 0xff, 0xff }; @@ -2880,12 +3064,99 @@ CertFreeCertificateContext(context1); } +static const BYTE rootWithKeySignAndCRLSign[] = { +0x30,0x82,0x01,0xdf,0x30,0x82,0x01,0x4c,0xa0,0x03,0x02,0x01,0x02,0x02,0x10, +0x5b,0xc7,0x0b,0x27,0x99,0xbb,0x2e,0x99,0x47,0x9d,0x45,0x4e,0x7c,0x1a,0xca, +0xe8,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x30,0x10,0x31, +0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x31, +0x30,0x1e,0x17,0x0d,0x30,0x37,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30, +0x30,0x5a,0x17,0x0d,0x30,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35, +0x39,0x5a,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05, +0x43,0x65,0x72,0x74,0x31,0x30,0x81,0x9f,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48, +0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00,0x30,0x81,0x89, +0x02,0x81,0x81,0x00,0xad,0x7e,0xca,0xf3,0xe5,0x99,0xc2,0x2a,0xca,0x50,0x82, +0x7c,0x2d,0xa4,0x81,0xcd,0x0d,0x0d,0x86,0xd7,0xd8,0xb2,0xde,0xc5,0xc3,0x34, +0x9e,0x07,0x78,0x08,0x11,0x12,0x2d,0x21,0x0a,0x09,0x07,0x14,0x03,0x7a,0xe7, +0x3b,0x58,0xf1,0xde,0x3e,0x01,0x25,0x93,0xab,0x8f,0xce,0x1f,0xc1,0x33,0x91, +0xfe,0x59,0xb9,0x3b,0x9e,0x95,0x12,0x89,0x8e,0xc3,0x4b,0x98,0x1b,0x99,0xc5, +0x07,0xe2,0xdf,0x15,0x4c,0x39,0x76,0x06,0xad,0xdb,0x16,0x06,0x49,0xba,0xcd, +0x0f,0x07,0xd6,0xea,0x27,0xa6,0xfe,0x3d,0x88,0xe5,0x97,0x45,0x72,0xb6,0x1c, +0xc0,0x1c,0xb1,0xa2,0x89,0xe8,0x37,0x9e,0xf6,0x2a,0xcf,0xd5,0x1f,0x2f,0x35, +0x5e,0x8f,0x3a,0x9c,0x61,0xb1,0xf1,0x6c,0xff,0x8c,0xb2,0x2f,0x02,0x03,0x01, +0x00,0x01,0xa3,0x42,0x30,0x40,0x30,0x0e,0x06,0x03,0x55,0x1d,0x0f,0x01,0x01, +0xff,0x04,0x04,0x03,0x02,0x00,0x06,0x30,0x0f,0x06,0x03,0x55,0x1d,0x13,0x01, +0x01,0xff,0x04,0x05,0x30,0x03,0x01,0x01,0xff,0x30,0x1d,0x06,0x03,0x55,0x1d, +0x0e,0x04,0x16,0x04,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2,0x28,0x89,0xa0, +0x58,0xff,0x98,0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x09,0x06,0x05,0x2b, +0x0e,0x03,0x02,0x1d,0x05,0x00,0x03,0x81,0x81,0x00,0x74,0xcb,0x21,0xfd,0x2d, +0x25,0xdc,0xa5,0xaa,0xa1,0x26,0xdc,0x8b,0x40,0x11,0x64,0xae,0x5c,0x71,0x3c, +0x28,0xbc,0xf9,0xb3,0xcb,0xa5,0x94,0xb2,0x8d,0x4c,0x23,0x2b,0x9b,0xde,0x2c, +0x4c,0x30,0x04,0xc6,0x88,0x10,0x2f,0x53,0xfd,0x6c,0x82,0xf1,0x13,0xfb,0xda, +0x27,0x75,0x25,0x48,0xe4,0x72,0x09,0x2a,0xee,0xb4,0x1e,0xc9,0x55,0xf5,0xf7, +0x82,0x91,0xd8,0x4b,0xe4,0x3a,0xfe,0x97,0x87,0xdf,0xfb,0x15,0x5a,0x12,0x3e, +0x12,0xe6,0xad,0x40,0x0b,0xcf,0xee,0x1a,0x44,0xe0,0x83,0xb2,0x67,0x94,0xd4, +0x2e,0x7c,0xf2,0x06,0x9d,0xb3,0x3b,0x7e,0x2f,0xda,0x25,0x66,0x7e,0xa7,0x1f, +0x45,0xd4,0xf5,0xe3,0xdf,0x2a,0xf1,0x18,0x28,0x20,0xb5,0xf8,0xf5,0x8d,0x7a, +0x2e,0x84,0xee }; +static const BYTE eeCert[] = { +0x30,0x82,0x01,0xb9,0x30,0x82,0x01,0x22,0xa0,0x03,0x02,0x01,0x02,0x02,0x01, +0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05, +0x00,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43, +0x65,0x72,0x74,0x31,0x30,0x1e,0x17,0x0d,0x30,0x37,0x30,0x35,0x30,0x31,0x30, +0x30,0x30,0x30,0x30,0x30,0x5a,0x17,0x0d,0x30,0x37,0x31,0x30,0x30,0x31,0x30, +0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55, +0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x32,0x30,0x81,0x9f,0x30,0x0d,0x06, +0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d, +0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xb8,0x52,0xda,0xc5,0x4b,0x3f,0xe5, +0x33,0x0e,0x67,0x5f,0x48,0x21,0xdc,0x7e,0xef,0x37,0x33,0xba,0xff,0xb4,0xc6, +0xdc,0xb6,0x17,0x8e,0x20,0x55,0x07,0x12,0xd2,0x7b,0x3c,0xce,0x30,0xc5,0xa7, +0x48,0x9f,0x6e,0xfe,0xb8,0xbe,0xdb,0x9f,0x9b,0x17,0x60,0x16,0xde,0xc6,0x8b, +0x47,0xd1,0x57,0x71,0x3c,0x93,0xfc,0xbd,0xec,0x44,0x32,0x3b,0xb9,0xcf,0x6b, +0x05,0x72,0xa7,0x87,0x8e,0x7e,0xd4,0x9a,0x87,0x1c,0x2f,0xb7,0x82,0x40,0xfc, +0x6a,0x80,0x83,0x68,0x28,0xce,0x84,0xf4,0x0b,0x2e,0x44,0xcb,0x53,0xac,0x85, +0x85,0xb5,0x46,0x36,0x98,0x3c,0x10,0x02,0xaa,0x02,0xbc,0x8b,0xa2,0x23,0xb2, +0xd3,0x51,0x9a,0x22,0x4a,0xe3,0xaa,0x4e,0x7c,0xda,0x38,0xcf,0x49,0x98,0x72, +0xa3,0x02,0x03,0x01,0x00,0x01,0xa3,0x23,0x30,0x21,0x30,0x1f,0x06,0x03,0x55, +0x1d,0x23,0x04,0x18,0x30,0x18,0x80,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2, +0x28,0x89,0xa0,0x58,0xff,0x98,0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x0d, +0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x81, +0x81,0x00,0x8a,0x49,0xa9,0x86,0x5e,0xc9,0x33,0x7e,0xfd,0xab,0x64,0x1f,0x6d, +0x00,0xd7,0x9b,0xec,0xd1,0x5b,0x38,0xcc,0xd6,0xf3,0xf2,0xb4,0x75,0x70,0x00, +0x82,0x9d,0x37,0x58,0xe1,0xcd,0x2c,0x61,0xb3,0x28,0xe7,0x8a,0x00,0xbe,0x6e, +0xca,0xe8,0x55,0xd5,0xad,0x3a,0xea,0xaf,0x13,0x20,0x1c,0x44,0xfc,0xb4,0xf9, +0x29,0x2b,0xdc,0x8a,0x2d,0x1b,0x27,0x9e,0xb9,0x3b,0x4a,0x71,0x9d,0x47,0x7d, +0xf7,0x92,0x6b,0x21,0x7f,0xfa,0x88,0x79,0x94,0x33,0xf6,0xdd,0x92,0x04,0x92, +0xd6,0x5e,0x0a,0x74,0xf2,0x85,0xa6,0xd5,0x3c,0x28,0xc0,0x89,0x5d,0xda,0xf3, +0xa6,0x01,0xc2,0xe9,0xa3,0xc1,0xb7,0x21,0x08,0xba,0x18,0x07,0x45,0xeb,0x77, +0x7d,0xcd,0xc6,0xe7,0x2a,0x7b,0x46,0xd2,0x3d,0xb5 }; +static const BYTE rootSignedCRL[] = { +0x30,0x82,0x01,0x1f,0x30,0x81,0x89,0x02,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a, +0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x10,0x31,0x0e,0x30, +0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x31,0x17,0x0d, +0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x17,0x0d, +0x30,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5a,0x30,0x14, +0x30,0x12,0x02,0x01,0x01,0x17,0x0d,0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30, +0x30,0x30,0x30,0x30,0x5a,0xa0,0x2f,0x30,0x2d,0x30,0x0a,0x06,0x03,0x55,0x1d, +0x14,0x04,0x03,0x02,0x01,0x01,0x30,0x1f,0x06,0x03,0x55,0x1d,0x23,0x04,0x18, +0x30,0x18,0x80,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2,0x28,0x89,0xa0,0x58, +0xff,0x98,0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x0d,0x06,0x09,0x2a,0x86, +0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0xa3,0xcf, +0x17,0x5d,0x7a,0x08,0xab,0x11,0x1a,0xbd,0x5c,0xde,0x9a,0x22,0x92,0x38,0xe6, +0x96,0xcc,0xb1,0xc5,0x42,0x86,0xa6,0xae,0xad,0xa3,0x1a,0x2b,0xa0,0xb0,0x65, +0xaa,0x9c,0xd7,0x2d,0x44,0x8c,0xae,0x61,0xc7,0x30,0x17,0x89,0x84,0x3b,0x4a, +0x8f,0x17,0x08,0x06,0x37,0x1c,0xf7,0x2d,0x4e,0x47,0x07,0x61,0x50,0xd9,0x06, +0xd1,0x46,0xed,0x0a,0xbb,0xc3,0x9b,0x36,0x0b,0xa7,0x27,0x2f,0x2b,0x55,0xce, +0x2a,0xa5,0x60,0xc6,0x53,0x28,0xe8,0xee,0xad,0x0e,0x2b,0xe8,0xd7,0x5f,0xc9, +0xa5,0xed,0xf9,0x77,0xb0,0x3c,0x81,0xcf,0xcc,0x49,0xb2,0x1a,0xc3,0xfd,0x34, +0xd5,0xbc,0xb0,0xd5,0xa5,0x9c,0x1b,0x72,0xc3,0x0f,0xa3,0xe3,0x3c,0xf0,0xc3, +0x91,0xe8,0x93,0x4f,0xd4,0x2f }; + static void testVerifyRevocation(void) { BOOL ret; CERT_REVOCATION_STATUS status = { 0 }; - PCCERT_CONTEXT cert = CertCreateCertificateContext(X509_ASN_ENCODING, - bigCert, sizeof(bigCert)); + PCCERT_CONTEXT certs[2]; + CERT_REVOCATION_PARA revPara = { sizeof(revPara), 0 }; /* Crash ret = CertVerifyRevocation(0, 0, 0, NULL, 0, NULL, NULL); @@ -2901,16 +3172,103 @@ ok(ret, "CertVerifyRevocation failed: %08x\n", GetLastError()); ret = CertVerifyRevocation(2, 0, 0, NULL, 0, NULL, &status); ok(ret, "CertVerifyRevocation failed: %08x\n", GetLastError()); - SetLastError(0xdeadbeef); - ret = CertVerifyRevocation(0, 0, 1, (void **)&cert, 0, NULL, &status); + certs[0] = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, + sizeof(bigCert)); + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(0, 0, 1, (void **)certs, 0, NULL, &status); ok(!ret && GetLastError() == CRYPT_E_NO_REVOCATION_DLL, "Expected CRYPT_E_NO_REVOCATION_DLL, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); - ret = CertVerifyRevocation(0, 2, 1, (void **)&cert, 0, NULL, &status); + ret = CertVerifyRevocation(0, 2, 1, (void **)certs, 0, NULL, &status); ok(!ret && GetLastError() == CRYPT_E_NO_REVOCATION_DLL, "Expected CRYPT_E_NO_REVOCATION_DLL, got %08x\n", GetLastError()); - CertFreeCertificateContext(cert); + CertFreeCertificateContext(certs[0]); + + certs[0] = CertCreateCertificateContext(X509_ASN_ENCODING, + rootWithKeySignAndCRLSign, sizeof(rootWithKeySignAndCRLSign)); + certs[1] = CertCreateCertificateContext(X509_ASN_ENCODING, + eeCert, sizeof(eeCert)); + /* The root cert itself can't be checked for revocation */ + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 1, (void **)certs, 0, NULL, &status); + ok(!ret && GetLastError() == CRYPT_E_NO_REVOCATION_CHECK, + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK, + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + /* Neither can the end cert */ + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 1, (void **)&certs[1], 0, NULL, &status); + ok(!ret && (GetLastError() == CRYPT_E_NO_REVOCATION_CHECK /* Win9x */ || + GetLastError() == CRYPT_E_REVOCATION_OFFLINE), + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK /* Win9x */ || + status.dwError == CRYPT_E_REVOCATION_OFFLINE, + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + /* Both certs together can't, either (they're not CRLs) */ + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 2, (void **)certs, 0, NULL, &status); + ok(!ret && (GetLastError() == CRYPT_E_NO_REVOCATION_CHECK || + GetLastError() == CRYPT_E_REVOCATION_OFFLINE /* WinME */), + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK || + status.dwError == CRYPT_E_REVOCATION_OFFLINE /* WinME */, + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + /* Now add a CRL to the hCrlStore */ + revPara.hCrlStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCRLToStore(revPara.hCrlStore, X509_ASN_ENCODING, + rootSignedCRL, sizeof(rootSignedCRL), CERT_STORE_ADD_ALWAYS, NULL); + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 2, (void **)certs, 0, &revPara, &status); + ok(!ret && (GetLastError() == CRYPT_E_NO_REVOCATION_CHECK || + GetLastError() == CRYPT_E_REVOCATION_OFFLINE /* WinME */), + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK || + status.dwError == CRYPT_E_REVOCATION_OFFLINE /* WinME */, + "expected CRYPT_E_NO_REVOCATION_CHECK or CRYPT_E_REVOCATION_OFFLINE, got %08x\n", + status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + /* Specifying CERT_VERIFY_REV_CHAIN_FLAG doesn't change things either */ + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 2, (void **)certs, CERT_VERIFY_REV_CHAIN_FLAG, &revPara, &status); + ok(!ret && GetLastError() == CRYPT_E_NO_REVOCATION_CHECK, + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK, + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + /* Again, specifying the issuer cert: no change */ + revPara.pIssuerCert = certs[0]; + SetLastError(0xdeadbeef); + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, + 1, (void **)&certs[1], 0, &revPara, &status); + /* Win2k thinks the cert is revoked, and it is, except the CRL is out of + * date, hence the revocation status should be unknown. + */ + ok(!ret && (GetLastError() == CRYPT_E_NO_REVOCATION_CHECK || + broken(GetLastError() == CRYPT_E_REVOKED /* Win2k */)), + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", GetLastError()); + ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK || + broken(status.dwError == CRYPT_E_REVOKED /* Win2k */), + "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", status.dwError); + ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex); + CertCloseStore(revPara.hCrlStore, 0); + CertFreeCertificateContext(certs[1]); + CertFreeCertificateContext(certs[0]); } static BYTE privKey[] = { @@ -3283,4 +3641,5 @@ testVerifyRevocation(); testAcquireCertPrivateKey(); testGetPublicKeyLength(); + testIsRDNAttrsInCertificateName(); } Modified: trunk/rostests/winetests/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/chain.c…
============================================================================== --- trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] Sun Dec 6 10:36:50 2009 @@ -2927,7 +2927,8 @@ static const CERT_TRUST_STATUS elementStatus19[] = { { CERT_TRUST_NO_ERROR, CERT_TRUST_HAS_NAME_MATCH_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, - CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER }, + CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER | + CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, }; static const SimpleChainStatusCheck simpleStatus19[] = { { sizeof(elementStatus19) / sizeof(elementStatus19[0]), elementStatus19 }, @@ -2951,7 +2952,8 @@ static const CERT_TRUST_STATUS elementStatus21[] = { { CERT_TRUST_NO_ERROR, CERT_TRUST_HAS_NAME_MATCH_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, - CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER }, + CERT_TRUST_IS_SELF_SIGNED | CERT_TRUST_HAS_NAME_MATCH_ISSUER | + CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, }; static const SimpleChainStatusCheck simpleStatus21[] = { { sizeof(elementStatus21) / sizeof(elementStatus21[0]), elementStatus21 }, @@ -3257,7 +3259,7 @@ CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT, CERT_TRUST_HAS_PREFERRED_ISSUER | CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, + { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, 1, simpleStatus19 }, 0 }, /* Older versions of crypt32 do not set @@ -3278,7 +3280,7 @@ CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT, CERT_TRUST_HAS_PREFERRED_ISSUER | CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, + { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, 1, simpleStatus21 }, 0 }, { { sizeof(chain22) / sizeof(chain22[0]), chain22 }, @@ -3405,8 +3407,9 @@ { sizeof(chain27) / sizeof(chain27[0]), chain27 }, { { CERT_TRUST_IS_NOT_TIME_NESTED | CERT_TRUST_IS_NOT_VALID_FOR_USAGE | CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT, - CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, + CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS | CERT_TRUST_HAS_PREFERRED_ISSUER }, + { CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT, + CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS }, 1, simpleStatus27Broken }, 0 }; @@ -3421,7 +3424,12 @@ PCCERT_CONTEXT cert; CERT_CHAIN_PARA para = { 0 }; PCCERT_CHAIN_CONTEXT chain; + FILETIME fileTime; DWORD i; + HCERTSTORE store; + static char one_two_three[] = "1.2.3"; + static char oid_server_auth[] = szOID_PKIX_KP_SERVER_AUTH; + LPSTR oids[2]; /* Basic parameter checks */ if (0) @@ -3481,6 +3489,68 @@ CertFreeCertificateContext(cert); + /* Test usage match with Google's cert */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + verisignCA, sizeof(verisignCA), CERT_STORE_ADD_ALWAYS, NULL); + CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + thawte_sgc_ca, sizeof(thawte_sgc_ca), CERT_STORE_ADD_ALWAYS, NULL); + cert = CertCreateCertificateContext(X509_ASN_ENCODING, + google, sizeof(google)); + SystemTimeToFileTime(&oct2009, &fileTime); + memset(¶, 0, sizeof(para)); + para.cbSize = sizeof(para); + oids[0] = one_two_three; + para.RequestedUsage.dwType = USAGE_MATCH_TYPE_AND; + para.RequestedUsage.Usage.rgpszUsageIdentifier = oids; + para.RequestedUsage.Usage.cUsageIdentifier = 1; + ret = pCertGetCertificateChain(NULL, cert, &fileTime, store, ¶, + 0, NULL, &chain); + ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); + if (ret) + { + ok(chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_VALID_FOR_USAGE, + "expected CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + CertFreeCertificateChain(chain); + } + oids[0] = oid_server_auth; + ret = pCertGetCertificateChain(NULL, cert, &fileTime, store, ¶, + 0, NULL, &chain); + ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); + if (ret) + { + ok(!(chain->TrustStatus.dwErrorStatus & + CERT_TRUST_IS_NOT_VALID_FOR_USAGE), + "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + CertFreeCertificateChain(chain); + } + oids[1] = one_two_three; + para.RequestedUsage.Usage.cUsageIdentifier = 2; + para.RequestedUsage.dwType = USAGE_MATCH_TYPE_AND; + ret = pCertGetCertificateChain(NULL, cert, &fileTime, store, ¶, + 0, NULL, &chain); + ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); + if (ret) + { + ok(chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_VALID_FOR_USAGE, + "expected CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + CertFreeCertificateChain(chain); + } + para.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR; + ret = pCertGetCertificateChain(NULL, cert, &fileTime, store, ¶, + 0, NULL, &chain); + ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); + if (ret) + { + ok(!(chain->TrustStatus.dwErrorStatus & + CERT_TRUST_IS_NOT_VALID_FOR_USAGE), + "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + CertFreeCertificateChain(chain); + } + CertCloseStore(store, 0); + CertFreeCertificateContext(cert); + for (i = 0; i < sizeof(chainCheck) / sizeof(chainCheck[0]); i++) { chain = getChain(&chainCheck[i].certs, 0, TRUE, &oct2007, @@ -3510,8 +3580,10 @@ { ok(chain->TrustStatus.dwErrorStatus == chainCheckEmbeddedNull.status.status.dwErrorStatus || - broken(chain->TrustStatus.dwErrorStatus == - chainCheckEmbeddedNullBroken.status.status.dwErrorStatus), + broken((chain->TrustStatus.dwErrorStatus & + ~chainCheckEmbeddedNullBroken.status.statusToIgnore.dwErrorStatus) == + (chainCheckEmbeddedNullBroken.status.status.dwErrorStatus & + ~chainCheckEmbeddedNullBroken.status.statusToIgnore.dwErrorStatus)), "unexpected chain error status %08x\n", chain->TrustStatus.dwErrorStatus); if (chainCheckEmbeddedNull.status.status.dwErrorStatus == Modified: trunk/rostests/winetests/crypt32/crl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/crl.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] Sun Dec 6 10:36:50 2009 @@ -223,271 +223,21 @@ CertCloseStore(store, 0); } -static void testFindCRL(void) -{ - HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, - CERT_STORE_CREATE_NEW_FLAG, NULL); - PCCRL_CONTEXT context; - PCCERT_CONTEXT cert; - BOOL ret; - - if (!store) return; - if (!pCertFindCRLInStore) - { - win_skip("CertFindCRLInStore() is not available\n"); - return; - } - - ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, - sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); - ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); - - /* Crashes - context = pCertFindCRLInStore(NULL, 0, 0, 0, NULL, NULL); - */ - - /* Find any context */ - context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ANY, NULL, NULL); - ok(context != NULL, "Expected a context\n"); - if (context) - CertFreeCRLContext(context); - /* Bogus flags are ignored */ - context = pCertFindCRLInStore(store, 0, 1234, CRL_FIND_ANY, NULL, NULL); - ok(context != NULL, "Expected a context\n"); - if (context) - CertFreeCRLContext(context); - /* CRL encoding type is ignored too */ - context = pCertFindCRLInStore(store, 1234, 0, CRL_FIND_ANY, NULL, NULL); - ok(context != NULL, "Expected a context\n"); - if (context) - CertFreeCRLContext(context); - - /* This appears to match any cert */ - context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, NULL, NULL); - ok(context != NULL, "Expected a context\n"); - if (context) - CertFreeCRLContext(context); - - /* Try to match an issuer that isn't in the store */ - cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2, - sizeof(bigCert2)); - ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", - GetLastError()); - context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL); - ok(context == NULL, "Expected no matching context\n"); - CertFreeCertificateContext(cert); - - /* Match an issuer that is in the store */ - cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, - sizeof(bigCert)); - ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", - GetLastError()); - context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL); - ok(context != NULL, "Expected a context\n"); - if (context) - CertFreeCRLContext(context); - CertFreeCertificateContext(cert); - - CertCloseStore(store, 0); -} - -static void testGetCRLFromStore(void) -{ - HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, - CERT_STORE_CREATE_NEW_FLAG, NULL); - PCCRL_CONTEXT context; - PCCERT_CONTEXT cert; - DWORD flags; - BOOL ret; - - if (!store) return; - - /* Crash - context = CertGetCRLFromStore(NULL, NULL, NULL, NULL); - context = CertGetCRLFromStore(store, NULL, NULL, NULL); - */ - - /* Bogus flags */ - flags = 0xffffffff; - context = CertGetCRLFromStore(store, NULL, NULL, &flags); - ok(!context && GetLastError() == E_INVALIDARG, - "Expected E_INVALIDARG, got %08x\n", GetLastError()); - - /* Test an empty store */ - flags = 0; - context = CertGetCRLFromStore(store, NULL, NULL, &flags); - ok(context == NULL && GetLastError() == CRYPT_E_NOT_FOUND, - "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); - - ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, - sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); - ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); - - /* NULL matches any CRL */ - flags = 0; - context = CertGetCRLFromStore(store, NULL, NULL, &flags); - ok(context != NULL, "Expected a context\n"); - CertFreeCRLContext(context); - - /* This cert's issuer isn't in */ - cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2, - sizeof(bigCert2)); - ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", - GetLastError()); - context = CertGetCRLFromStore(store, cert, NULL, &flags); - ok(context == NULL && GetLastError() == CRYPT_E_NOT_FOUND, - "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); - CertFreeCertificateContext(cert); - - /* But this one is */ - cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, - sizeof(bigCert)); - ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", - GetLastError()); - context = CertGetCRLFromStore(store, cert, NULL, &flags); - ok(context != NULL, "Expected a context\n"); - CertFreeCRLContext(context); - CertFreeCertificateContext(cert); - - CertCloseStore(store, 0); -} - -static void checkCRLHash(const BYTE *data, DWORD dataLen, ALG_ID algID, - PCCRL_CONTEXT context, DWORD propID) -{ - BYTE hash[20] = { 0 }, hashProperty[20]; - BOOL ret; - DWORD size; - - memset(hash, 0, sizeof(hash)); - memset(hashProperty, 0, sizeof(hashProperty)); - size = sizeof(hash); - ret = CryptHashCertificate(0, algID, 0, data, dataLen, hash, &size); - ok(ret, "CryptHashCertificate failed: %08x\n", GetLastError()); - ret = CertGetCRLContextProperty(context, propID, hashProperty, &size); - ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); - ok(!memcmp(hash, hashProperty, size), "Unexpected hash for property %d\n", - propID); -} - -static void testCRLProperties(void) -{ - PCCRL_CONTEXT context = CertCreateCRLContext(X509_ASN_ENCODING, - CRL, sizeof(CRL)); - - ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); - if (context) - { - DWORD propID, numProps, access, size; - BOOL ret; - BYTE hash[20] = { 0 }, hashProperty[20]; - CRYPT_DATA_BLOB blob; - - /* This crashes - propID = CertEnumCRLContextProperties(NULL, 0); - */ - - propID = 0; - numProps = 0; - do { - propID = CertEnumCRLContextProperties(context, propID); - if (propID) - numProps++; - } while (propID != 0); - ok(numProps == 0, "Expected 0 properties, got %d\n", numProps); - - /* Tests with a NULL cert context. Prop ID 0 fails.. */ - ret = CertSetCRLContextProperty(NULL, 0, 0, NULL); - ok(!ret && GetLastError() == E_INVALIDARG, - "Expected E_INVALIDARG, got %08x\n", GetLastError()); - /* while this just crashes. - ret = CertSetCRLContextProperty(NULL, CERT_KEY_PROV_HANDLE_PROP_ID, 0, - NULL); - */ - - ret = CertSetCRLContextProperty(context, 0, 0, NULL); - ok(!ret && GetLastError() == E_INVALIDARG, - "Expected E_INVALIDARG, got %08x\n", GetLastError()); - /* Can't set the cert property directly, this crashes. - ret = CertSetCRLContextProperty(context, CERT_CRL_PROP_ID, 0, CRL); - */ - - /* These all crash. - ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0, - NULL); - ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, NULL, NULL); - ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, - hashProperty, NULL); - */ - /* A missing prop */ - size = 0; - ret = CertGetCRLContextProperty(context, CERT_KEY_PROV_INFO_PROP_ID, - NULL, &size); - ok(!ret && GetLastError() == CRYPT_E_NOT_FOUND, - "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); - /* And, an implicit property */ - ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, - NULL, &size); - ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); - ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, - &access, &size); - ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); - ok(!(access & CERT_ACCESS_STATE_WRITE_PERSIST_FLAG), - "Didn't expect a persisted crl\n"); - /* Trying to set this "read only" property crashes. - access |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG; - ret = CertSetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0, - &access); - */ - - /* Can I set the hash to an invalid hash? */ - blob.pbData = hash; - blob.cbData = sizeof(hash); - ret = CertSetCRLContextProperty(context, CERT_HASH_PROP_ID, 0, &blob); - ok(ret, "CertSetCRLContextProperty failed: %08x\n", - GetLastError()); - size = sizeof(hashProperty); - ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, - hashProperty, &size); - ok(!memcmp(hashProperty, hash, sizeof(hash)), "Unexpected hash\n"); - /* Delete the (bogus) hash, and get the real one */ - ret = CertSetCRLContextProperty(context, CERT_HASH_PROP_ID, 0, NULL); - ok(ret, "CertSetCRLContextProperty failed: %08x\n", GetLastError()); - checkCRLHash(CRL, sizeof(CRL), CALG_SHA1, context, CERT_HASH_PROP_ID); - - /* Now that the hash property is set, we should get one property when - * enumerating. - */ - propID = 0; - numProps = 0; - do { - propID = CertEnumCRLContextProperties(context, propID); - if (propID) - numProps++; - } while (propID != 0); - ok(numProps == 1, "Expected 1 properties, got %d\n", numProps); - - /* Check a few other implicit properties */ - checkCRLHash(CRL, sizeof(CRL), CALG_MD5, context, - CERT_MD5_HASH_PROP_ID); - - CertFreeCRLContext(context); - } -} - static const BYTE v1CRLWithIssuerAndEntry[] = { 0x30, 0x44, 0x30, 0x02, 0x06, 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x16, 0x30, 0x14, 0x02, 0x01, 0x01, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a }; -static const BYTE v2CRLWithIssuingDistPoint[] = { 0x30,0x5c,0x02,0x01,0x01, - 0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03, - 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x18,0x0f,0x31, - 0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30, - 0x16,0x30,0x14,0x02,0x01,0x01,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30, - 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0xa0,0x13,0x30,0x11,0x30,0x0f,0x06, - 0x03,0x55,0x1d,0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; +static const BYTE v2CRLWithIssuingDistPoint[] = { +0x30,0x70,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11, +0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e, +0x67,0x00,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30, +0x30,0x30,0x30,0x5a,0x30,0x16,0x30,0x14,0x02,0x01,0x01,0x18,0x0f,0x31,0x36, +0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0xa0,0x27, +0x30,0x25,0x30,0x23,0x06,0x03,0x55,0x1d,0x1c,0x01,0x01,0xff,0x04,0x19,0x30, +0x17,0xa0,0x15,0xa0,0x13,0x86,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77, +0x69,0x6e,0x65,0x68,0x71,0x2e,0x6f,0x72,0x67 }; static const BYTE verisignCRL[] = { 0x30, 0x82, 0x01, 0xb1, 0x30, 0x82, 0x01, 0x1a, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x02, 0x05, 0x00, 0x30, 0x61, 0x31, 0x11, 0x30, 0x0f, 0x06, @@ -523,11 +273,683 @@ 0x28, 0x52, 0xa0, 0x06, 0x4e, 0xb1, 0xc8, 0x92, 0x0c, 0x97, 0xbe, 0x15, 0x07, 0xab, 0x7a, 0xc9, 0xea, 0x08, 0x67, 0x43, 0x4d, 0x51, 0x63, 0x3b, 0x9c, 0x9c, 0xcd }; +static const BYTE verisignCommercialSoftPubCA[] = { +0x30,0x82,0x02,0x40,0x30,0x82,0x01,0xa9,0x02,0x10,0x03,0xc7,0x8f,0x37,0xdb,0x92, +0x28,0xdf,0x3c,0xbb,0x1a,0xad,0x82,0xfa,0x67,0x10,0x30,0x0d,0x06,0x09,0x2a,0x86, +0x48,0x86,0xf7,0x0d,0x01,0x01,0x02,0x05,0x00,0x30,0x61,0x31,0x11,0x30,0x0f,0x06, +0x03,0x55,0x04,0x07,0x13,0x08,0x49,0x6e,0x74,0x65,0x72,0x6e,0x65,0x74,0x31,0x17, +0x30,0x15,0x06,0x03,0x55,0x04,0x0a,0x13,0x0e,0x56,0x65,0x72,0x69,0x53,0x69,0x67, +0x6e,0x2c,0x20,0x49,0x6e,0x63,0x2e,0x31,0x33,0x30,0x31,0x06,0x03,0x55,0x04,0x0b, +0x13,0x2a,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6e,0x20,0x43,0x6f,0x6d,0x6d,0x65, +0x72,0x63,0x69,0x61,0x6c,0x20,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x20,0x50, +0x75,0x62,0x6c,0x69,0x73,0x68,0x65,0x72,0x73,0x20,0x43,0x41,0x30,0x1e,0x17,0x0d, +0x39,0x36,0x30,0x34,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x17,0x0d,0x30, +0x34,0x30,0x31,0x30,0x37,0x32,0x33,0x35,0x39,0x35,0x39,0x5a,0x30,0x61,0x31,0x11, +0x30,0x0f,0x06,0x03,0x55,0x04,0x07,0x13,0x08,0x49,0x6e,0x74,0x65,0x72,0x6e,0x65, +0x74,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0a,0x13,0x0e,0x56,0x65,0x72,0x69, +0x53,0x69,0x67,0x6e,0x2c,0x20,0x49,0x6e,0x63,0x2e,0x31,0x33,0x30,0x31,0x06,0x03, +0x55,0x04,0x0b,0x13,0x2a,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6e,0x20,0x43,0x6f, +0x6d,0x6d,0x65,0x72,0x63,0x69,0x61,0x6c,0x20,0x53,0x6f,0x66,0x74,0x77,0x61,0x72, +0x65,0x20,0x50,0x75,0x62,0x6c,0x69,0x73,0x68,0x65,0x72,0x73,0x20,0x43,0x41,0x30, +0x81,0x9f,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05, +0x00,0x03,0x81,0x8d,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xc3,0xd3,0x69,0x65, +0x52,0x01,0x94,0x54,0xab,0x28,0xc6,0x62,0x18,0xb3,0x54,0x55,0xc5,0x44,0x87,0x45, +0x4a,0x3b,0xc2,0x7e,0xd8,0xd3,0xd7,0xc8,0x80,0x86,0x8d,0xd8,0x0c,0xf1,0x16,0x9c, +0xcc,0x6b,0xa9,0x29,0xb2,0x8f,0x76,0x73,0x92,0xc8,0xc5,0x62,0xa6,0x3c,0xed,0x1e, +0x05,0x75,0xf0,0x13,0x00,0x6c,0x14,0x4d,0xd4,0x98,0x90,0x07,0xbe,0x69,0x73,0x81, +0xb8,0x62,0x4e,0x31,0x1e,0xd1,0xfc,0xc9,0x0c,0xeb,0x7d,0x90,0xbf,0xae,0xb4,0x47, +0x51,0xec,0x6f,0xce,0x64,0x35,0x02,0xd6,0x7d,0x67,0x05,0x77,0xe2,0x8f,0xd9,0x51, +0xd7,0xfb,0x97,0x19,0xbc,0x3e,0xd7,0x77,0x81,0xc6,0x43,0xdd,0xf2,0xdd,0xdf,0xca, +0xa3,0x83,0x8b,0xcb,0x41,0xc1,0x3d,0x22,0x48,0x48,0xa6,0x19,0x02,0x03,0x01,0x00, +0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x02,0x05,0x00, +0x03,0x81,0x81,0x00,0xb5,0xbc,0xb0,0x75,0x6a,0x89,0xa2,0x86,0xbd,0x64,0x78,0xc3, +0xa7,0x32,0x75,0x72,0x11,0xaa,0x26,0x02,0x17,0x60,0x30,0x4c,0xe3,0x48,0x34,0x19, +0xb9,0x52,0x4a,0x51,0x18,0x80,0xfe,0x53,0x2d,0x7b,0xd5,0x31,0x8c,0xc5,0x65,0x99, +0x41,0x41,0x2f,0xf2,0xae,0x63,0x7a,0xe8,0x73,0x99,0x15,0x90,0x1a,0x1f,0x7a,0x8b, +0x41,0xd0,0x8e,0x3a,0xd0,0xcd,0x38,0x34,0x44,0xd0,0x75,0xf8,0xea,0x71,0xc4,0x81, +0x19,0x38,0x17,0x35,0x4a,0xae,0xc5,0x3e,0x32,0xe6,0x21,0xb8,0x05,0xc0,0x93,0xe1, +0xc7,0x38,0x5c,0xd8,0xf7,0x93,0x38,0x64,0x90,0xed,0x54,0xce,0xca,0xd3,0xd3,0xd0, +0x5f,0xef,0x04,0x9b,0xde,0x02,0x82,0xdd,0x88,0x29,0xb1,0xc3,0x4f,0xa5,0xcd,0x71, +0x64,0x31,0x3c,0x3c +}; +static const BYTE rootWithKeySignAndCRLSign[] = { +0x30,0x82,0x01,0xdf,0x30,0x82,0x01,0x4c,0xa0,0x03,0x02,0x01,0x02,0x02,0x10, +0x5b,0xc7,0x0b,0x27,0x99,0xbb,0x2e,0x99,0x47,0x9d,0x45,0x4e,0x7c,0x1a,0xca, +0xe8,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03,0x02,0x1d,0x05,0x00,0x30,0x10,0x31, +0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x31, +0x30,0x1e,0x17,0x0d,0x30,0x37,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30, +0x30,0x5a,0x17,0x0d,0x30,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35, +0x39,0x5a,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05, +0x43,0x65,0x72,0x74,0x31,0x30,0x81,0x9f,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48, +0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00,0x30,0x81,0x89, +0x02,0x81,0x81,0x00,0xad,0x7e,0xca,0xf3,0xe5,0x99,0xc2,0x2a,0xca,0x50,0x82, +0x7c,0x2d,0xa4,0x81,0xcd,0x0d,0x0d,0x86,0xd7,0xd8,0xb2,0xde,0xc5,0xc3,0x34, +0x9e,0x07,0x78,0x08,0x11,0x12,0x2d,0x21,0x0a,0x09,0x07,0x14,0x03,0x7a,0xe7, +0x3b,0x58,0xf1,0xde,0x3e,0x01,0x25,0x93,0xab,0x8f,0xce,0x1f,0xc1,0x33,0x91, +0xfe,0x59,0xb9,0x3b,0x9e,0x95,0x12,0x89,0x8e,0xc3,0x4b,0x98,0x1b,0x99,0xc5, +0x07,0xe2,0xdf,0x15,0x4c,0x39,0x76,0x06,0xad,0xdb,0x16,0x06,0x49,0xba,0xcd, +0x0f,0x07,0xd6,0xea,0x27,0xa6,0xfe,0x3d,0x88,0xe5,0x97,0x45,0x72,0xb6,0x1c, +0xc0,0x1c,0xb1,0xa2,0x89,0xe8,0x37,0x9e,0xf6,0x2a,0xcf,0xd5,0x1f,0x2f,0x35, +0x5e,0x8f,0x3a,0x9c,0x61,0xb1,0xf1,0x6c,0xff,0x8c,0xb2,0x2f,0x02,0x03,0x01, +0x00,0x01,0xa3,0x42,0x30,0x40,0x30,0x0e,0x06,0x03,0x55,0x1d,0x0f,0x01,0x01, +0xff,0x04,0x04,0x03,0x02,0x00,0x06,0x30,0x0f,0x06,0x03,0x55,0x1d,0x13,0x01, +0x01,0xff,0x04,0x05,0x30,0x03,0x01,0x01,0xff,0x30,0x1d,0x06,0x03,0x55,0x1d, +0x0e,0x04,0x16,0x04,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2,0x28,0x89,0xa0, +0x58,0xff,0x98,0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x09,0x06,0x05,0x2b, +0x0e,0x03,0x02,0x1d,0x05,0x00,0x03,0x81,0x81,0x00,0x74,0xcb,0x21,0xfd,0x2d, +0x25,0xdc,0xa5,0xaa,0xa1,0x26,0xdc,0x8b,0x40,0x11,0x64,0xae,0x5c,0x71,0x3c, +0x28,0xbc,0xf9,0xb3,0xcb,0xa5,0x94,0xb2,0x8d,0x4c,0x23,0x2b,0x9b,0xde,0x2c, +0x4c,0x30,0x04,0xc6,0x88,0x10,0x2f,0x53,0xfd,0x6c,0x82,0xf1,0x13,0xfb,0xda, +0x27,0x75,0x25,0x48,0xe4,0x72,0x09,0x2a,0xee,0xb4,0x1e,0xc9,0x55,0xf5,0xf7, +0x82,0x91,0xd8,0x4b,0xe4,0x3a,0xfe,0x97,0x87,0xdf,0xfb,0x15,0x5a,0x12,0x3e, +0x12,0xe6,0xad,0x40,0x0b,0xcf,0xee,0x1a,0x44,0xe0,0x83,0xb2,0x67,0x94,0xd4, +0x2e,0x7c,0xf2,0x06,0x9d,0xb3,0x3b,0x7e,0x2f,0xda,0x25,0x66,0x7e,0xa7,0x1f, +0x45,0xd4,0xf5,0xe3,0xdf,0x2a,0xf1,0x18,0x28,0x20,0xb5,0xf8,0xf5,0x8d,0x7a, +0x2e,0x84,0xee }; +static const BYTE eeCert[] = { +0x30,0x82,0x01,0x93,0x30,0x81,0xfd,0xa0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, +0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00, +0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65, +0x72,0x74,0x31,0x30,0x1e,0x17,0x0d,0x30,0x37,0x30,0x35,0x30,0x31,0x30,0x30, +0x30,0x30,0x30,0x30,0x5a,0x17,0x0d,0x30,0x37,0x31,0x30,0x30,0x31,0x30,0x30, +0x30,0x30,0x30,0x30,0x5a,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04, +0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x32,0x30,0x81,0x9f,0x30,0x0d,0x06,0x09, +0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00, +0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xb8,0x52,0xda,0xc5,0x4b,0x3f,0xe5,0x33, +0x0e,0x67,0x5f,0x48,0x21,0xdc,0x7e,0xef,0x37,0x33,0xba,0xff,0xb4,0xc6,0xdc, +0xb6,0x17,0x8e,0x20,0x55,0x07,0x12,0xd2,0x7b,0x3c,0xce,0x30,0xc5,0xa7,0x48, +0x9f,0x6e,0xfe,0xb8,0xbe,0xdb,0x9f,0x9b,0x17,0x60,0x16,0xde,0xc6,0x8b,0x47, +0xd1,0x57,0x71,0x3c,0x93,0xfc,0xbd,0xec,0x44,0x32,0x3b,0xb9,0xcf,0x6b,0x05, +0x72,0xa7,0x87,0x8e,0x7e,0xd4,0x9a,0x87,0x1c,0x2f,0xb7,0x82,0x40,0xfc,0x6a, +0x80,0x83,0x68,0x28,0xce,0x84,0xf4,0x0b,0x2e,0x44,0xcb,0x53,0xac,0x85,0x85, +0xb5,0x46,0x36,0x98,0x3c,0x10,0x02,0xaa,0x02,0xbc,0x8b,0xa2,0x23,0xb2,0xd3, +0x51,0x9a,0x22,0x4a,0xe3,0xaa,0x4e,0x7c,0xda,0x38,0xcf,0x49,0x98,0x72,0xa3, +0x02,0x03,0x01,0x00,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d, +0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x22,0xf1,0x66,0x00,0x79,0xd2, +0xe6,0xb2,0xb2,0xf7,0x2f,0x98,0x92,0x7d,0x73,0xc3,0x6c,0x5c,0x77,0x20,0xe3, +0xbf,0x3e,0xe0,0xb3,0x5c,0x68,0xb4,0x9b,0x3a,0x41,0xae,0x94,0xa0,0x80,0x3a, +0xfe,0x5d,0x7a,0x56,0x87,0x85,0x44,0x45,0xcf,0xa6,0xd3,0x10,0xe7,0x73,0x41, +0xf2,0x7f,0x88,0x85,0x91,0x8e,0xe6,0xec,0xe2,0xce,0x08,0xbc,0xa5,0x76,0xe5, +0x4d,0x1d,0xb7,0x70,0x31,0xdd,0xc9,0x9a,0x15,0x32,0x11,0x5a,0x4e,0x62,0xc8, +0xd1,0xf8,0xec,0x46,0x39,0x5b,0xe7,0x67,0x1f,0x58,0xe8,0xa1,0xa0,0x5b,0xf7, +0x8a,0x6d,0x5f,0x91,0x18,0xd4,0x90,0x85,0xff,0x30,0xc7,0xca,0x9c,0xc6,0x92, +0xb0,0xca,0x16,0xc4,0xa4,0xc0,0xd6,0xe8,0xff,0x15,0x19,0xd1,0x30,0x61,0xf3, +0xef,0x9f }; +static const BYTE rootSignedCRL[] = { +0x30,0x82,0x01,0x1d,0x30,0x81,0x87,0x02,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a, +0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x10,0x31,0x0e,0x30, +0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x31,0x17,0x0d, +0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x17,0x0d, +0x30,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5a,0x30,0x14, +0x30,0x12,0x02,0x01,0x01,0x17,0x0d,0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30, +0x30,0x30,0x30,0x30,0x5a,0xa0,0x2d,0x30,0x2b,0x30,0x0a,0x06,0x03,0x55,0x1d, +0x14,0x04,0x03,0x02,0x01,0x01,0x30,0x1d,0x06,0x03,0x55,0x1d,0x23,0x04,0x16, +0x04,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2,0x28,0x89,0xa0,0x58,0xff,0x98, +0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86, +0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x9b,0x2b,0x99,0x0d, +0x16,0x83,0x93,0x54,0x29,0x3a,0xa6,0x53,0x5d,0xf8,0xa6,0x73,0x9f,0x2a,0x45, +0x39,0x91,0xff,0x91,0x1c,0x27,0x06,0xe8,0xdb,0x72,0x3f,0x66,0x89,0x15,0x68, +0x55,0xd5,0x49,0x63,0xa6,0x00,0xe9,0x66,0x9c,0x97,0xf9,0xb3,0xb3,0x2b,0x1b, +0xc7,0x79,0x46,0xa8,0xd8,0x2b,0x78,0x27,0xa0,0x70,0x02,0x81,0xc6,0x40,0xb3, +0x76,0x32,0x65,0x4c,0xf8,0xff,0x1d,0x41,0x6e,0x16,0x09,0xa2,0x8a,0x7b,0x0c, +0xd0,0xa6,0x9b,0x61,0xa3,0x7c,0x02,0x91,0x79,0xdf,0x6a,0x5e,0x88,0x95,0x66, +0x33,0x17,0xcb,0x5a,0xd2,0xdc,0x89,0x05,0x62,0x97,0x60,0x73,0x7b,0x2c,0x1a, +0x90,0x20,0x73,0x24,0x9f,0x45,0x22,0x4b,0xc1,0x33,0xd1,0xda,0xd8,0x7e,0x1b, +0x3d,0x74,0xd6,0x3b }; + +static void testFindCRL(void) +{ + HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + PCCRL_CONTEXT context; + PCCERT_CONTEXT cert, endCert, rootCert; + CRL_FIND_ISSUED_FOR_PARA issuedForPara = { NULL, NULL }; + DWORD count, revoked_count; + BOOL ret; + + if (!store) return; + if (!pCertFindCRLInStore) + { + win_skip("CertFindCRLInStore() is not available\n"); + return; + } + + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + + /* Crashes + context = pCertFindCRLInStore(NULL, 0, 0, 0, NULL, NULL); + */ + + /* Find any context */ + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ANY, NULL, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + /* Bogus flags are ignored */ + context = pCertFindCRLInStore(store, 0, 1234, CRL_FIND_ANY, NULL, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + /* CRL encoding type is ignored too */ + context = pCertFindCRLInStore(store, 1234, 0, CRL_FIND_ANY, NULL, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + + /* This appears to match any cert */ + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, NULL, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + + /* Try to match an issuer that isn't in the store */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2, + sizeof(bigCert2)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL); + ok(context == NULL, "Expected no matching context\n"); + CertFreeCertificateContext(cert); + + /* Match an issuer that is in the store */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, + sizeof(bigCert)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + + /* Try various find flags */ + context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_SIGNATURE_FLAG, + CRL_FIND_ISSUED_BY, cert, NULL); + ok(!context || broken(context != NULL /* Win9x */), "unexpected context\n"); + /* The CRL doesn't have an AKI extension, so it matches any cert */ + context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG, + CRL_FIND_ISSUED_BY, cert, NULL); + ok(context != NULL, "Expected a context\n"); + if (context) + CertFreeCRLContext(context); + + if (0) + { + /* Crash or return NULL/STATUS_ACCESS_VIOLATION */ + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, NULL, + NULL); + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, NULL); + } + /* Test whether the cert matches the CRL in the store */ + issuedForPara.pSubjectCert = cert; + issuedForPara.pIssuerCert = cert; + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, NULL); + ok(context != NULL || broken(!context /* Win9x, NT4 */), + "Expected a context\n"); + if (context) + { + ok(context->cbCrlEncoded == sizeof(signedCRL), + "unexpected CRL size %d\n", context->cbCrlEncoded); + ok(!memcmp(context->pbCrlEncoded, signedCRL, context->cbCrlEncoded), + "unexpected CRL data\n"); + CertFreeCRLContext(context); + } + + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, + v1CRLWithIssuerAndEntry, sizeof(v1CRLWithIssuerAndEntry), + CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, + v2CRLWithIssuingDistPoint, sizeof(v2CRLWithIssuingDistPoint), + CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, + verisignCRL, sizeof(verisignCRL), CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + issuedForPara.pSubjectCert = cert; + issuedForPara.pIssuerCert = cert; + context = NULL; + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(cert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + /* signedCRL, v1CRLWithIssuerAndEntry, and v2CRLWithIssuingDistPoint all + * match cert's issuer, but verisignCRL does not, so the expected count + * is 0. + */ + ok(count == 3 || broken(count == 0 /* NT4, Win9x */), + "expected 3 matching CRLs, got %d\n", count); + /* Only v1CRLWithIssuerAndEntry and v2CRLWithIssuingDistPoint contain + * entries, so the count of CRL entries that match cert is 2. + */ + ok(revoked_count == 2 || broken(revoked_count == 0 /* NT4, Win9x */), + "expected 2 matching CRL entries, got %d\n", revoked_count); + + CertFreeCertificateContext(cert); + + /* Try again with a cert that doesn't match any CRLs in the store */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, + bigCertWithDifferentIssuer, sizeof(bigCertWithDifferentIssuer)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + issuedForPara.pSubjectCert = cert; + issuedForPara.pIssuerCert = cert; + context = NULL; + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(cert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 0, "expected 0 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + CertFreeCertificateContext(cert); + + /* Test again with a real certificate and CRL. The certificate wasn't + * revoked, but its issuer does have a CRL. + */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, + verisignCommercialSoftPubCA, sizeof(verisignCommercialSoftPubCA)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + issuedForPara.pIssuerCert = cert; + issuedForPara.pSubjectCert = cert; + context = NULL; + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(cert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 1 || broken(count == 0 /* Win9x, NT4 */), + "expected 1 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + CertFreeCertificateContext(cert); + + CertCloseStore(store, 0); + + /* This test uses a synthesized chain (rootWithKeySignAndCRLSign -> + * eeCert) whose end certificate is in the CRL. + */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + /* Add a CRL for the end certificate */ + CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, + rootSignedCRL, sizeof(rootSignedCRL), CERT_STORE_ADD_ALWAYS, NULL); + /* Add another CRL unrelated to the tested chain */ + CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, + verisignCRL, sizeof(verisignCRL), CERT_STORE_ADD_ALWAYS, NULL); + endCert = CertCreateCertificateContext(X509_ASN_ENCODING, + eeCert, sizeof(eeCert)); + rootCert = CertCreateCertificateContext(X509_ASN_ENCODING, + rootWithKeySignAndCRLSign, sizeof(rootWithKeySignAndCRLSign)); + issuedForPara.pSubjectCert = endCert; + issuedForPara.pIssuerCert = rootCert; + context = NULL; + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, + &issuedForPara, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 1 || broken(count == 0 /* Win9x, NT4 */), + "expected 1 matching CRLs, got %d\n", count); + ok(revoked_count == 1 || broken(revoked_count == 0 /* Win9x, NT4 */), + "expected 1 matching CRL entries, got %d\n", revoked_count); + + /* Test CRL_FIND_ISSUED_BY flags */ + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, + endCert, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 0, "expected 0 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, + rootCert, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 1, "expected 1 matching CRLs, got %d\n", count); + ok(revoked_count == 1, "expected 1 matching CRL entries, got %d\n", + revoked_count); + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG, + CRL_FIND_ISSUED_BY, endCert, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 0, "expected 0 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG, + CRL_FIND_ISSUED_BY, rootCert, context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(rootCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 0 || broken(count == 1 /* Win9x */), + "expected 0 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, + CRL_FIND_ISSUED_BY_SIGNATURE_FLAG, CRL_FIND_ISSUED_BY, endCert, + context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 0, "expected 0 matching CRLs, got %d\n", count); + ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n", + revoked_count); + count = revoked_count = 0; + do { + context = pCertFindCRLInStore(store, 0, + CRL_FIND_ISSUED_BY_SIGNATURE_FLAG, CRL_FIND_ISSUED_BY, rootCert, + context); + if (context) + { + PCRL_ENTRY entry; + + count++; + if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) && + entry) + revoked_count++; + } + } while (context); + ok(count == 1, "expected 1 matching CRLs, got %d\n", count); + ok(revoked_count == 1, "expected 1 matching CRL entries, got %d\n", + revoked_count); + CertFreeCertificateContext(rootCert); + CertFreeCertificateContext(endCert); + + CertCloseStore(store, 0); +} + +static void testGetCRLFromStore(void) +{ + HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + PCCRL_CONTEXT context; + PCCERT_CONTEXT cert; + DWORD flags; + BOOL ret; + + if (!store) return; + + /* Crash + context = CertGetCRLFromStore(NULL, NULL, NULL, NULL); + context = CertGetCRLFromStore(store, NULL, NULL, NULL); + */ + + /* Bogus flags */ + flags = 0xffffffff; + context = CertGetCRLFromStore(store, NULL, NULL, &flags); + ok(!context && GetLastError() == E_INVALIDARG, + "Expected E_INVALIDARG, got %08x\n", GetLastError()); + + /* Test an empty store */ + flags = 0; + context = CertGetCRLFromStore(store, NULL, NULL, &flags); + ok(context == NULL && GetLastError() == CRYPT_E_NOT_FOUND, + "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); + + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + + /* NULL matches any CRL */ + flags = 0; + context = CertGetCRLFromStore(store, NULL, NULL, &flags); + ok(context != NULL, "Expected a context\n"); + CertFreeCRLContext(context); + + /* This cert's issuer isn't in */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2, + sizeof(bigCert2)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + context = CertGetCRLFromStore(store, cert, NULL, &flags); + ok(context == NULL && GetLastError() == CRYPT_E_NOT_FOUND, + "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); + CertFreeCertificateContext(cert); + + /* But this one is */ + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, + sizeof(bigCert)); + ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + context = CertGetCRLFromStore(store, cert, NULL, &flags); + ok(context != NULL, "Expected a context\n"); + CertFreeCRLContext(context); + CertFreeCertificateContext(cert); + + CertCloseStore(store, 0); +} + +static void checkCRLHash(const BYTE *data, DWORD dataLen, ALG_ID algID, + PCCRL_CONTEXT context, DWORD propID) +{ + BYTE hash[20] = { 0 }, hashProperty[20]; + BOOL ret; + DWORD size; + + memset(hash, 0, sizeof(hash)); + memset(hashProperty, 0, sizeof(hashProperty)); + size = sizeof(hash); + ret = CryptHashCertificate(0, algID, 0, data, dataLen, hash, &size); + ok(ret, "CryptHashCertificate failed: %08x\n", GetLastError()); + ret = CertGetCRLContextProperty(context, propID, hashProperty, &size); + ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); + ok(!memcmp(hash, hashProperty, size), "Unexpected hash for property %d\n", + propID); +} + +static void testCRLProperties(void) +{ + PCCRL_CONTEXT context = CertCreateCRLContext(X509_ASN_ENCODING, + CRL, sizeof(CRL)); + + ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); + if (context) + { + DWORD propID, numProps, access, size; + BOOL ret; + BYTE hash[20] = { 0 }, hashProperty[20]; + CRYPT_DATA_BLOB blob; + + /* This crashes + propID = CertEnumCRLContextProperties(NULL, 0); + */ + + propID = 0; + numProps = 0; + do { + propID = CertEnumCRLContextProperties(context, propID); + if (propID) + numProps++; + } while (propID != 0); + ok(numProps == 0, "Expected 0 properties, got %d\n", numProps); + + /* Tests with a NULL cert context. Prop ID 0 fails.. */ + ret = CertSetCRLContextProperty(NULL, 0, 0, NULL); + ok(!ret && GetLastError() == E_INVALIDARG, + "Expected E_INVALIDARG, got %08x\n", GetLastError()); + /* while this just crashes. + ret = CertSetCRLContextProperty(NULL, CERT_KEY_PROV_HANDLE_PROP_ID, 0, + NULL); + */ + + ret = CertSetCRLContextProperty(context, 0, 0, NULL); + ok(!ret && GetLastError() == E_INVALIDARG, + "Expected E_INVALIDARG, got %08x\n", GetLastError()); + /* Can't set the cert property directly, this crashes. + ret = CertSetCRLContextProperty(context, CERT_CRL_PROP_ID, 0, CRL); + */ + + /* These all crash. + ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0, + NULL); + ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, NULL, NULL); + ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, + hashProperty, NULL); + */ + /* A missing prop */ + size = 0; + ret = CertGetCRLContextProperty(context, CERT_KEY_PROV_INFO_PROP_ID, + NULL, &size); + ok(!ret && GetLastError() == CRYPT_E_NOT_FOUND, + "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError()); + /* And, an implicit property */ + ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, + NULL, &size); + ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); + ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, + &access, &size); + ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError()); + ok(!(access & CERT_ACCESS_STATE_WRITE_PERSIST_FLAG), + "Didn't expect a persisted crl\n"); + /* Trying to set this "read only" property crashes. + access |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG; + ret = CertSetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0, + &access); + */ + + /* Can I set the hash to an invalid hash? */ + blob.pbData = hash; + blob.cbData = sizeof(hash); + ret = CertSetCRLContextProperty(context, CERT_HASH_PROP_ID, 0, &blob); + ok(ret, "CertSetCRLContextProperty failed: %08x\n", + GetLastError()); + size = sizeof(hashProperty); + ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, + hashProperty, &size); + ok(!memcmp(hashProperty, hash, sizeof(hash)), "Unexpected hash\n"); + /* Delete the (bogus) hash, and get the real one */ + ret = CertSetCRLContextProperty(context, CERT_HASH_PROP_ID, 0, NULL); + ok(ret, "CertSetCRLContextProperty failed: %08x\n", GetLastError()); + checkCRLHash(CRL, sizeof(CRL), CALG_SHA1, context, CERT_HASH_PROP_ID); + + /* Now that the hash property is set, we should get one property when + * enumerating. + */ + propID = 0; + numProps = 0; + do { + propID = CertEnumCRLContextProperties(context, propID); + if (propID) + numProps++; + } while (propID != 0); + ok(numProps == 1, "Expected 1 properties, got %d\n", numProps); + + /* Check a few other implicit properties */ + checkCRLHash(CRL, sizeof(CRL), CALG_MD5, context, + CERT_MD5_HASH_PROP_ID); + + CertFreeCRLContext(context); + } +} + +static const BYTE bigCertWithCRLDistPoints[] = { +0x30,0x81,0xa5,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30, +0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61, +0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31, +0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31, +0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,0x11, +0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e, +0x67,0x00,0x30,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01, +0x01,0x01,0x05,0x00,0x03,0x11,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, +0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xa3,0x26,0x30,0x24,0x30,0x22,0x06, +0x03,0x55,0x1d,0x1f,0x04,0x1b,0x30,0x19,0x30,0x17,0xa0,0x15,0xa0,0x13,0x86, +0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,0x2e, +0x6f,0x72,0x67 }; static void testIsValidCRLForCert(void) { BOOL ret; - PCCERT_CONTEXT cert1, cert2; + PCCERT_CONTEXT cert1, cert2, cert3; PCCRL_CONTEXT crl; HCERTSTORE store; @@ -568,52 +990,69 @@ CertFreeCRLContext(crl); - /* Yet with a CRL_ISSUING_DIST_POINT in the CRL, I still can't get this - * to say the CRL is not valid for either cert. + /* With a CRL_ISSUING_DIST_POINT in the CRL, it returns FALSE, since the + * cert doesn't have the same extension in it. */ crl = CertCreateCRLContext(X509_ASN_ENCODING, v2CRLWithIssuingDistPoint, sizeof(v2CRLWithIssuingDistPoint)); + ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); + + ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL); + ok(!ret && GetLastError() == CRYPT_E_NO_MATCH, + "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); + + /* With a CRL_ISSUING_DIST_POINT in the CRL, it matches the cert containing + * a CRL_DIST_POINTS_INFO extension. + */ + cert3 = CertCreateCertificateContext(X509_ASN_ENCODING, + bigCertWithCRLDistPoints, sizeof(bigCertWithCRLDistPoints)); + ok(cert3 != NULL, "CertCreateCertificateContext failed: %08x\n", + GetLastError()); + ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL); + ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); + + CertFreeCRLContext(crl); + + /* And again, with a real CRL, the CRL is valid for all three certs. */ + crl = CertCreateCRLContext(X509_ASN_ENCODING, verisignCRL, + sizeof(verisignCRL)); ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL); ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL); ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); + ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL); + ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); CertFreeCRLContext(crl); - /* And again, with a real CRL, the CRL is valid for both certs. */ - crl = CertCreateCRLContext(X509_ASN_ENCODING, verisignCRL, - sizeof(verisignCRL)); - ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); + /* One last test: a CRL in a different store than the cert is also valid + * for the cert. + */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); + + ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, verisignCRL, + sizeof(verisignCRL), CERT_STORE_ADD_ALWAYS, &crl); + ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL); ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL); ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); + ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL); + ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); CertFreeCRLContext(crl); - /* One last test: a CRL in a different store than the cert is also valid - * for the cert, so CertIsValidCRLForCertificate must always return TRUE? - */ - store = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, - CERT_STORE_CREATE_NEW_FLAG, NULL); - ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); - - ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, verisignCRL, - sizeof(verisignCRL), CERT_STORE_ADD_ALWAYS, &crl); - ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); - - ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL); - ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); - ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL); - ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError()); - - CertFreeCRLContext(crl); - CertCloseStore(store, 0); + CertFreeCertificateContext(cert3); CertFreeCertificateContext(cert2); CertFreeCertificateContext(cert1); } @@ -710,8 +1149,8 @@ CertFreeCRLContext(crl); /* Check against CRL with different issuer and entry for the cert */ - crl = CertCreateCRLContext(X509_ASN_ENCODING, v1CRLWithIssuerAndEntry, - sizeof(v1CRLWithIssuerAndEntry)); + crl = CertCreateCRLContext(X509_ASN_ENCODING, crlWithDifferentIssuer, + sizeof(crlWithDifferentIssuer)); ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError()); ret = CertVerifyCRLRevocation(X509_ASN_ENCODING, cert->pCertInfo, 1, (PCRL_INFO *)&crl->pCrlInfo); Modified: trunk/rostests/winetests/crypt32/encode.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/encode.…
============================================================================== --- trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] Sun Dec 6 10:36:50 2009 @@ -1387,8 +1387,9 @@ embeddedNullNameValue.encoded, embeddedNullNameValue.encodedSize, CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_SHARE_OID_STRING_FLAG, NULL, &buf, &bufSize); - ok(ret, "Value type %d: CryptDecodeObjectEx failed: %08x\n", - embeddedNullNameValue.value.dwValueType, GetLastError()); + /* Some Windows versions disallow name values with embedded NULLs, so + * either success or failure is acceptable. + */ if (ret) { CERT_NAME_VALUE rdnEncodedValue = { CERT_RDN_ENCODED_BLOB, @@ -3851,23 +3852,14 @@ 0x02,0x01,0x01,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30, 0x30,0x30,0x30,0x30,0x5a,0xa0,0x13,0x30,0x11,0x30,0x0f,0x06,0x03,0x55,0x1d, 0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; -static const BYTE v2CRLWithIssuingDistPoint[] = { 0x30,0x5c,0x02,0x01,0x01, - 0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03, - 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x18,0x0f,0x31, - 0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30, - 0x16,0x30,0x14,0x02,0x01,0x01,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30, - 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0xa0,0x13,0x30,0x11,0x30,0x0f,0x06, - 0x03,0x55,0x1d,0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 }; static void test_encodeCRLToBeSigned(DWORD dwEncoding) { BOOL ret; BYTE *buf = NULL; - static CHAR oid_issuing_dist_point[] = szOID_ISSUING_DIST_POINT; DWORD size = 0; CRL_INFO info = { 0 }; CRL_ENTRY entry = { { 0 }, { 0 }, 0, 0 }; - CERT_EXTENSION ext; /* Test with a V1 CRL */ ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, @@ -3976,21 +3968,6 @@ { ok(size == sizeof(v2CRLWithExt), "Wrong size %d\n", size); ok(!memcmp(buf, v2CRLWithExt, size), "Got unexpected value\n"); - LocalFree(buf); - } - /* a v2 CRL with an issuing dist point extension */ - ext.pszObjId = oid_issuing_dist_point; - ext.fCritical = TRUE; - ext.Value.cbData = sizeof(urlIDP); - ext.Value.pbData = (LPBYTE)urlIDP; - entry.rgExtension = &ext; - ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, - CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); - ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); - if (buf) - { - ok(size == sizeof(v2CRLWithIssuingDistPoint), "Wrong size %d\n", size); - ok(!memcmp(buf, v2CRLWithIssuingDistPoint, size), "Unexpected value\n"); LocalFree(buf); } } @@ -4686,19 +4663,6 @@ info->cExtension); LocalFree(buf); } - /* And again, with an issuing dist point */ - ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, - v2CRLWithIssuingDistPoint, sizeof(v2CRLWithIssuingDistPoint), - CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size); - ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); - if (buf) - { - CRL_INFO *info = (CRL_INFO *)buf; - - ok(info->cExtension == 1, "Expected 1 extensions, got %d\n", - info->cExtension); - LocalFree(buf); - } } static const LPCSTR keyUsages[] = { szOID_PKIX_KP_CODE_SIGNING, Modified: trunk/rostests/winetests/crypt32/protectdata.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/protect…
============================================================================== --- trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] Sun Dec 6 10:36:50 2009 @@ -213,7 +213,7 @@ plain.cbData=0; } -static void test_simpleroundtrip(const char *plaintext, int wine_fails) +static void test_simpleroundtrip(const char *plaintext) { DATA_BLOB input; DATA_BLOB encrypted; @@ -234,17 +234,9 @@ } res = pCryptUnprotectData(&encrypted, NULL, NULL, NULL, NULL, 0, &output); - if (wine_fails) { - todo_wine - ok(res != 0, "can't unprotect; last error %u\n", GetLastError()); - } else { - ok(res != 0, "can't unprotect; last error %u\n", GetLastError()); - } - - if (res) { - ok(output.cbData == strlen(plaintext), "output wrong length %d for input '%s', wanted %d\n", output.cbData, plaintext, strlen(plaintext)); - ok(!memcmp(plaintext, (char *)output.pbData, output.cbData), "output wrong contents for input '%s'\n", plaintext); - } + ok(res != 0, "can't unprotect; last error %u\n", GetLastError()); + ok(output.cbData == strlen(plaintext), "output wrong length %d for input '%s', wanted %d\n", output.cbData, plaintext, strlen(plaintext)); + ok(!memcmp(plaintext, (char *)output.pbData, output.cbData), "output wrong contents for input '%s'\n", plaintext); } START_TEST(protectdata) @@ -262,8 +254,8 @@ protected=FALSE; test_cryptprotectdata(); test_cryptunprotectdata(); - test_simpleroundtrip("", 1); - test_simpleroundtrip("hello", 0); + test_simpleroundtrip(""); + test_simpleroundtrip("hello"); /* deinit globals here */ if (cipher.pbData) LocalFree(cipher.pbData);
15 years
1
0
0
0
[tkreuzer] 44431: Merge from amd64 branch: - 34939 fix several ULONG / ULONG_PTR / SIZE_T issues (Timo Kreuzer) - 40088 implement __mulh and __umulh (Timo Kreuzer)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Dec 6 04:24:18 2009 New Revision: 44431 URL:
http://svn.reactos.org/svn/reactos?rev=44431&view=rev
Log: Merge from amd64 branch: - 34939 fix several ULONG / ULONG_PTR / SIZE_T issues (Timo Kreuzer) - 40088 implement __mulh and __umulh (Timo Kreuzer) Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h trunk/reactos/include/ndk/amd64/ (props changed) trunk/reactos/include/ndk/amd64/asmmacro.S (props changed) trunk/reactos/ntoskrnl/mm/pool.c trunk/reactos/ntoskrnl/mm/region.c trunk/reactos/ntoskrnl/mm/rpoolmgr.h trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/ntoskrnl/mm/sysldr.c Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
============================================================================== --- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -968,6 +968,23 @@ return retval; } +#ifdef _M_AMD64 + +__INTRIN_INLINE __int64 __mulh(__int64 a, __int64 b) +{ + __int64 retval; + __asm__("imulq %[b]" : "=d" (retval) : [a] "a" (a), [b] "rm" (b)); + return retval; +} + +__INTRIN_INLINE unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b) +{ + unsigned __int64 retval; + __asm__("mulq %[b]" : "=d" (retval) : [a] "a" (a), [b] "rm" (b)); + return retval; +} + +#endif /*** Port I/O ***/ __INTRIN_INLINE unsigned char __inbyte(const unsigned short Port) Propchange: trunk/reactos/include/ndk/amd64/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sun Dec 6 04:24:18 2009 @@ -1,1 +1,1 @@ -/branches/ros-amd64-bringup/reactos/include/ndk/amd64:34925,34967,34970,35323-35324,35347-35348,35361,35436,35509,35588,35739,35823,35952,35966,36360,37323,37434,37472,37475,37536,37820-37821,37869,37990,38013-38014,43426,43454 +/branches/ros-amd64-bringup/reactos/include/ndk/amd64:34925,34967,34970,35323-35324,35347-35348,35361,35436,35509,35588,35739,35823,35952,35966,36360,37323,37434,37472,37475,37536,37820-37821,37869,37990,38013-38014,39338,40088,43426,43454 Propchange: trunk/reactos/include/ndk/amd64/asmmacro.S ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sun Dec 6 04:24:18 2009 @@ -1,1 +1,1 @@ -/branches/ros-amd64-bringup/reactos/include/ndk/amd64/asmmacro.S:37475,37536,37820-37821,37869,37990,38013-38014,43426,43454 +/branches/ros-amd64-bringup/reactos/include/ndk/amd64/asmmacro.S:37475,37536,37820-37821,37869,37990,38013-38014,39338,40088,43426,43454 Modified: trunk/reactos/ntoskrnl/mm/pool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pool.c?rev=444…
============================================================================== --- trunk/reactos/ntoskrnl/mm/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/pool.c [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -92,7 +92,7 @@ * @implemented */ PVOID NTAPI -ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes) +ExAllocatePool (POOL_TYPE PoolType, SIZE_T NumberOfBytes) /* * FUNCTION: Allocates pool memory of a specified type and returns a pointer * to the allocated block. This routine is used for general purpose allocation @@ -141,7 +141,7 @@ * @implemented */ PVOID NTAPI -ExAllocatePoolWithTag (POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag) +ExAllocatePoolWithTag (POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag) { PVOID Block; Modified: trunk/reactos/ntoskrnl/mm/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/region.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/mm/region.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/region.c [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -238,7 +238,7 @@ VOID NTAPI -MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, +MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type, ULONG Protect) { PMM_REGION Region; Modified: trunk/reactos/ntoskrnl/mm/rpoolmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rpoolmgr.h?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/rpoolmgr.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/rpoolmgr.h [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -12,7 +12,7 @@ typedef unsigned long rulong; -#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize) +#define R_IS_POOL_PTR(pool,ptr) (((void*)(ULONG_PTR)(ptr) >= pool->UserBase) && ((ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize))) #define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) ) #define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize ) @@ -712,7 +712,7 @@ if ( R_IS_POOL_PTR(pool,NumberOfBytes) ) { R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes ); - RUsedRedZoneCheck(pool,RBodyToHdr((void*)NumberOfBytes), (char*)NumberOfBytes, __FILE__, __LINE__ ); + RUsedRedZoneCheck(pool,RBodyToHdr((void*)(ULONG_PTR)NumberOfBytes), (char*)(ULONG_PTR)NumberOfBytes, __FILE__, __LINE__ ); R_RELEASE_MUTEX(pool); return NULL; } Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -2472,6 +2472,7 @@ LARGE_INTEGER Offset; CHAR Buffer; FILE_STANDARD_INFORMATION FileInfo; + ULONG Length; /* * Create the section @@ -2534,7 +2535,8 @@ FileStandardInformation, sizeof(FILE_STANDARD_INFORMATION), &FileInfo, - &Iosb.Information); + &Length); + Iosb.Information = Length; if (!NT_SUCCESS(Status)) { ObDereferenceObject(Section); @@ -4294,8 +4296,8 @@ NtQuerySection(IN HANDLE SectionHandle, IN SECTION_INFORMATION_CLASS SectionInformationClass, OUT PVOID SectionInformation, - IN ULONG SectionInformationLength, - OUT PULONG ResultLength OPTIONAL) + IN SIZE_T SectionInformationLength, + OUT PSIZE_T ResultLength OPTIONAL) { PROS_SECTION_OBJECT Section; KPROCESSOR_MODE PreviousMode; @@ -4874,7 +4876,7 @@ NTSTATUS NTAPI MmMapViewInSystemSpace (IN PVOID SectionObject, OUT PVOID * MappedBase, - IN OUT PULONG ViewSize) + IN OUT PSIZE_T ViewSize) { PROS_SECTION_OBJECT Section; PMMSUPPORT AddressSpace; Modified: trunk/reactos/ntoskrnl/mm/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/sysldr.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] Sun Dec 6 04:24:18 2009 @@ -704,7 +704,7 @@ ForwardName->Hint = 0; /* Set the new address */ - *(PULONG)&ForwardThunk.u1.AddressOfData = (ULONG)ForwardName; + ForwardThunk.u1.AddressOfData = (ULONG_PTR)ForwardName; /* Snap the forwarder */ Status = MiSnapThunk(LdrEntry->DllBase,
15 years
1
0
0
0
[tkreuzer] 44430: - merge r44429 - fix hal_generic_amd64.rbuild - add missing files
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Dec 6 03:44:06 2009 New Revision: 44430 URL:
http://svn.reactos.org/svn/reactos?rev=44430&view=rev
Log: - merge r44429 - fix hal_generic_amd64.rbuild - add missing files Added: trunk/reactos/lib/sdk/crt/except/amd64/ trunk/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s (with props) trunk/reactos/lib/sdk/crt/except/amd64/seh.s (with props) Modified: trunk/reactos/ReactOS-amd64.rbuild trunk/reactos/ReactOS-generic.rbuild trunk/reactos/ReactOS-i386.rbuild trunk/reactos/hal/halx86/hal_generic_amd64.rbuild Modified: trunk/reactos/ReactOS-amd64.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-amd64.rbuild?rev=4…
============================================================================== --- trunk/reactos/ReactOS-amd64.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-amd64.rbuild [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -6,6 +6,8 @@ <xi:include href="config-amd64.template.rbuild" /> </xi:fallback> </xi:include> + + <xi:include href="ReactOS-generic.rbuild" /> <define name="_M_AMD64" /> <define name="_AMD64_" /> @@ -21,132 +23,31 @@ <property name="usewrc" value="false"/> <property name="WINEBUILD_FLAGS" value="--kill-at"/> - <if property="OPTIMIZE" value="1"> - <compilerflag>-Os</compilerflag> - <compilerflag>-ftracer</compilerflag> - <compilerflag>-momit-leaf-frame-pointer</compilerflag> - </if> - <if property="OPTIMIZE" value="2"> - <compilerflag>-Os</compilerflag> - </if> - <if property="OPTIMIZE" value="3"> - <compilerflag>-O1</compilerflag> - </if> - <if property="OPTIMIZE" value="4"> - <compilerflag>-O2</compilerflag> - </if> - <if property="OPTIMIZE" value="5"> - <compilerflag>-O3</compilerflag> - </if> - - <compilerflag>-U_X86_</compilerflag> - <compilerflag>-mpreferred-stack-boundary=4</compilerflag> - <compilerflag>-fno-strict-aliasing</compilerflag> - <compilerflag>-Wno-strict-aliasing</compilerflag> - <compilerflag>-Wpointer-arith</compilerflag> - <compilerflag>-Wno-multichar</compilerflag> - <compilerflag>-Wno-format</compilerflag> - <!-- compilerflag>-H</compilerflag> enable this for header traces --> + <group compilerset="gcc"> + <if property="OPTIMIZE" value="1"> + <compilerflag>-ftracer</compilerflag> + <compilerflag>-momit-leaf-frame-pointer</compilerflag> + </if> + <compilerflag>-mpreferred-stack-boundary=4</compilerflag> + <compilerflag compiler="midl">-m64 --win64</compilerflag> + <!-- compilerflag compiler="cc,cxx">-gstabs+</compilerflag --> + <!-- compilerflag compiler="as">-gstabs+</compilerflag --> + <compilerflag>-U_X86_</compilerflag> + <compilerflag>-Wno-format</compilerflag> + </group> <group linkerset="ld"> <linkerflag>-disable-stdcall-fixup</linkerflag> - <linkerflag>-static</linkerflag> - <linkerflag>--unique=.eh_frame</linkerflag> <linkerflag>-file-alignment=0x1000</linkerflag> <linkerflag>-section-alignment=0x1000</linkerflag> + <linkerflag>--unique=.eh_frame</linkerflag> + <linkerflag>-static</linkerflag> </group> - -<!-- Here starts <xi:include href="ReactOS-generic.rbuild" /> --> - - <xi:include href="baseaddress.rbuild" /> - - <define name="__REACTOS__" /> - <define name="__REACTOS__" host="true" /> - - <if property="DBG" value="1"> - <define name="DBG">1</define> - <define name="_SEH_ENABLE_TRACE" /> - <property name="DBG_OR_KDBG" value="true" /> - </if> - <if property="DBG" value="0"> - <define name="DBG">0</define> - </if> - - <if property="KDBG" value="1"> - <define name="KDBG">1</define> - <property name="DBG_OR_KDBG" value="true" /> - </if> - - <!-- The version target valid values are: Nt4 , NT5 , NT51 --> - <property name="VERSION_TARGET" value="NT52" /> - - <if property="VERSION_TARGET" value="NT4"> - <define name="WINVER">0x400</define> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x400</define> - <define name="_WIN32_WINDOWS">0x400</define> - <define name="_SETUPAPI_VER">0x400</define> - </if> - - <if property="VERSION_TARGET" value="NT5"> - <define name="WINVER">0x500</define> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x500</define> - <define name="_WIN32_WINDOWS">0x500</define> - <define name="_SETUPAPI_VER">0x500</define> - </if> - - <if property="VERSION_TARGET" value="NT51"> - <define name="WINVER">0x501</define> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <define name="_WIN32_WINDOWS">0x501</define> - <define name="_SETUPAPI_VER">0x501</define> - </if> - - <if property="VERSION_TARGET" value="NT52"> - <define name="WINVER">0x502</define> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x502</define> - <define name="_WIN32_WINDOWS">0x502</define> - <define name="_SETUPAPI_VER">0x502</define> - </if> - - <if property="VERSION_TARGET" value="NT6"> - <define name="WINVER">0x600</define> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x600</define> - <define name="_WIN32_WINDOWS">0x600</define> - <define name="_SETUPAPI_VER">0x600</define> - </if> - - <include>.</include> - <include>include</include> - <include root="intermediate">include</include> - <include>include/psdk</include> - <include root="intermediate">include/psdk</include> - <include>include/dxsdk</include> - <include root="intermediate">include/dxsdk</include> - <include>include/crt</include> - <include>include/crt/mingw32</include> - <include>include/ddk</include> - <include>include/GL</include> - <include>include/ndk</include> - <include>include/reactos</include> - <include root="intermediate">include/reactos</include> - <include root="intermediate">include/reactos/mc</include> - <include>include/reactos/libs</include> - - <include host="true">include</include> - <include host="true" root="intermediate">include</include> - <include host="true">include/reactos</include> - <include host="true">include/reactos/wine</include> <if property="USERMODE" value="1"> <directory name="base"> <xi:include href="base/base.rbuild" /> </directory> - <directory name="dll"> <xi:include href="dll/dll.rbuild" /> </directory> @@ -155,173 +56,35 @@ <directory name="boot"> <xi:include href="boot/boot.rbuild" /> </directory> - <directory name="drivers"> - <directory name="base"> - <xi:include href="drivers/base/directory.rbuild" /> - </directory> - <directory name="bus"> - <xi:include href="drivers/bus/directory.rbuild" /> - </directory> - <directory name="directx"> - <xi:include href="drivers/directx/directory.rbuild" /> - </directory> - <directory name="filesystems"> - <xi:include href="drivers/filesystems/directory.rbuild" /> - </directory> - <directory name="input"> - <xi:include href="drivers/input/directory.rbuild" /> - </directory> - <directory name="ksfilter"> - <xi:include href="drivers/ksfilter/directory.rbuild" /> - </directory> - - <!-- directory name="multimedia"> - <xi:include href="drivers/multimedia/directory.rbuild" /> - </directory --> - - <directory name="network"> - <xi:include href="drivers/network/directory.rbuild" /> - </directory> - <directory name="parallel"> - <xi:include href="drivers/parallel/directory.rbuild" /> - </directory> - <directory name="serial"> - <xi:include href="drivers/serial/directory.rbuild" /> - </directory> - <directory name="setup"> - <xi:include href="drivers/setup/directory.rbuild" /> - </directory> - <directory name="storage"> - <xi:include href="drivers/storage/directory.rbuild" /> - </directory> - <directory name="usb"> - <xi:include href="drivers/usb/directory.rbuild" /> - </directory> - <directory name="video"> - <xi:include href="drivers/video/directory.rbuild" /> - </directory> - <directory name="wdm"> - <xi:include href="drivers/wdm/wdm.rbuild" /> - </directory> - <directory name="wmi"> - <xi:include href="drivers/wmi/wmilib.rbuild" /> - </directory> + <xi:include href="drivers/drivers.rbuild" /> </directory> - <directory name="hal"> <xi:include href="hal/hal.rbuild" /> </directory> - <directory name="include"> <xi:include href="include/directory.rbuild" /> </directory> - <directory name="lib"> - <directory name="3rdparty"> - <directory name="adns"> - <xi:include href="lib/3rdparty/adns/adns.rbuild" /> - </directory> - <directory name="bzip2"> - <xi:include href="lib/3rdparty/bzip2/bzip2.rbuild" /> - </directory> - <directory name="cardlib"> - <xi:include href="lib/3rdparty/cardlib/cardlib.rbuild" /> - </directory> - <directory name="expat"> - <xi:include href="lib/3rdparty/expat/expat.rbuild" /> - </directory> - <directory name="freetype"> - <xi:include href="lib/3rdparty/freetype/freetype.rbuild" /> - </directory> - <directory name="icu4ros"> - <xi:include href="lib/3rdparty/icu4ros/icu4ros.rbuild" /> - </directory> - <directory name="libsamplerate"> - <xi:include href="lib/3rdparty/libsamplerate/libsamplerate.rbuild" /> - </directory> - <directory name="libwine"> - <xi:include href="lib/3rdparty/libwine/libwine.rbuild" /> - </directory> - <directory name="libxml2"> - <xi:include href="lib/3rdparty/libxml2/libxml2.rbuild" /> - </directory> - - <if property="USERMODE" value="1"> - <directory name="mingw"> - <xi:include href="lib/3rdparty/mingw/mingw.rbuild" /> - </directory> - </if> - <directory name="zlib"> - <xi:include href="lib/3rdparty/zlib/zlib.rbuild" /> - </directory> - </directory> - <directory name="sdk"> - <xi:include href="lib/sdk/sdk.rbuild" /> - </directory> - <directory name="cmlib"> - <xi:include href="lib/cmlib/cmlib.rbuild" /> - </directory> - <directory name="debugsup"> - <xi:include href="lib/debugsup/debugsup.rbuild" /> - </directory> - <directory name="drivers"> - <xi:include href="lib/drivers/directory.rbuild" /> - </directory> - <directory name="epsapi"> - <xi:include href="lib/epsapi/epsapi.rbuild" /> - </directory> - <directory name="fslib"> - <xi:include href="lib/fslib/directory.rbuild" /> - </directory> - <directory name="host"> - <xi:include href="lib/host/directory.rbuild" /> - </directory> - <directory name="inflib"> - <xi:include href="lib/inflib/inflib.rbuild" /> - </directory> - <directory name="nls"> - <xi:include href="lib/nls/nls.rbuild" /> - </directory> - <directory name="ntdllsys"> - <xi:include href="lib/ntdllsys/ntdllsys.rbuild" /> - </directory> - <directory name="pseh"> - <xi:include href="lib/pseh/pseh.rbuild" /> - </directory> - <directory name="recyclebin"> - <xi:include href="lib/recyclebin/recyclebin.rbuild" /> - </directory> - <directory name="rossym"> - <xi:include href="lib/rossym/rossym.rbuild" /> - </directory> - <directory name="rtl"> - <xi:include href="lib/rtl/rtl.rbuild" /> - </directory> - <directory name="smlib"> - <xi:include href="lib/smlib/smlib.rbuild" /> - </directory> - <directory name="win32ksys"> - <xi:include href="lib/win32ksys/win32ksys.rbuild" /> - </directory> + <xi:include href="lib/lib.rbuild" /> </directory> - <directory name="media"> <xi:include href="media/media.rbuild" /> </directory> - + <directory name="modules"> + <xi:include href="modules/directory.rbuild" /> + </directory> <directory name="ntoskrnl"> <xi:include href="ntoskrnl/ntoskrnl.rbuild" /> + <if property="BUILD_MP" value="1"> + <xi:include href="ntoskrnl/ntkrnlmp.rbuild" /> + </if> </directory> - <directory name="subsystems"> <xi:include href="subsystems/subsystems.rbuild" /> </directory> - <directory name="tools"> <xi:include href="tools/tools.rbuild" /> </directory> -<!-- Here ends <xi:include href="ReactOS-generic.rbuild" /> --> - </project> Modified: trunk/reactos/ReactOS-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-generic.rbuild?rev…
============================================================================== --- trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -89,8 +89,6 @@ <group compilerset="gcc"> <compilerflag>-Wall</compilerflag> <compilerflag compiler="cxx">-Wno-non-virtual-dtor</compilerflag> - <compilerflag compiler="cc,cxx">-gstabs+</compilerflag> - <compilerflag compiler="as">-gstabs+</compilerflag> </group> <group compilerset="msc"> @@ -156,5 +154,4 @@ <compilerflag>/GS-</compilerflag> </group> - <define name="_USE_32BIT_TIME_T" /> </group> Modified: trunk/reactos/ReactOS-i386.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-i386.rbuild?rev=44…
============================================================================== --- trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -15,6 +15,7 @@ <define name="TARGET_i386" host="true" /> <define name="USE_COMPILER_EXCEPTIONS" /> + <define name="_USE_32BIT_TIME_T" /> <property name="PLATFORM" value="PC"/> @@ -25,6 +26,8 @@ </if> <compilerflag>-mpreferred-stack-boundary=2</compilerflag> <compilerflag compiler="midl">-m32 --win32</compilerflag> + <compilerflag compiler="cc,cxx">-gstabs+</compilerflag> + <compilerflag compiler="as">-gstabs+</compilerflag> </group> <group linkerset="ld"> Modified: trunk/reactos/hal/halx86/hal_generic_amd64.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic_amd…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic_amd64.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_generic_amd64.rbuild [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -10,6 +10,7 @@ <file>bushndlr.c</file> <file>isabus.c</file> <file>halbus.c</file> + <file>pcibus.c</file> <file>pcidata.c</file> <file>sysbus.c</file> </directory> @@ -18,7 +19,6 @@ <file>dma.c</file> <file>drive.c</file> <file>display.c</file> - <file>pci.c</file> <file>profil.c</file> <file>reboot.c</file> <file>sysinfo.c</file> Added: trunk/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/amd64/c…
============================================================================== --- trunk/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s (added) +++ trunk/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -1,0 +1,31 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of _chkstk and _alloca_probe + * FILE: lib/sdk/crt/math/amd64/chkstk_asm.s + * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <ndk/amd64/asm.h> +#include <ndk/amd64/asmmacro.S> + +.intel_syntax noprefix + +.global _MsgUnimplemented +_MsgUnimplemented: +.asciz "WARNING: %s at %s:%d is UNIMPLEMENTED!\n" + + +.proc _chkstk + UNIMPLEMENTED chkstk + ret +.endproc + +.proc _alloca_probe + UNIMPLEMENTED alloca_probe + ret +.endproc + +/* EOF */ Propchange: trunk/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/sdk/crt/except/amd64/seh.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/amd64/s…
============================================================================== --- trunk/reactos/lib/sdk/crt/except/amd64/seh.s (added) +++ trunk/reactos/lib/sdk/crt/except/amd64/seh.s [iso-8859-1] Sun Dec 6 03:44:06 2009 @@ -1,0 +1,56 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS CRT + * FILE: lib/crt/misc/i386/seh.S + * PURPOSE: SEH Support for the CRT + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <ndk/asm.h> +.intel_syntax noprefix + +#define DISPOSITION_DISMISS 0 +#define DISPOSITION_CONTINUE_SEARCH 1 +#define DISPOSITION_COLLIDED_UNWIND 3 + +/* GLOBALS *******************************************************************/ + +.globl __global_unwind2 +.globl __local_unwind2 +.globl __abnormal_termination +.globl __except_handler2 +.globl __except_handler3 + +/* FUNCTIONS *****************************************************************/ + +.func unwind_handler +_unwind_handler: + ret +.endfunc + +.func _global_unwind2 +__global_unwind2: + ret +.endfunc + +.func _abnormal_termination +__abnormal_termination: + ret +.endfunc + +.func _local_unwind2 +__local_unwind2: + ret +.endfunc + +.func _except_handler2 +__except_handler2: + ret +.endfunc + +.func _except_handler3 +__except_handler3: + ret +.endfunc Propchange: trunk/reactos/lib/sdk/crt/except/amd64/seh.s ------------------------------------------------------------------------------ svn:eol-style = native
15 years
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
51
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
Results per page:
10
25
50
100
200