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
November 2016
----- 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
15 participants
317 discussions
Start a n
N
ew thread
[akhaldi] 73350: [DBGHELP] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 18:03:01 2016 New Revision: 73350 URL:
http://svn.reactos.org/svn/reactos?rev=73350&view=rev
Log: [DBGHELP] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_private.h trunk/reactos/dll/win32/dbghelp/dwarf.c trunk/reactos/dll/win32/dbghelp/module.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dbghelp_…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/dbghelp_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/dbghelp_private.h [iso-8859-1] Tue Nov 22 18:03:01 2016 @@ -397,7 +397,6 @@ }; #endif -extern const struct wine_rb_functions source_rb_functions DECLSPEC_HIDDEN; struct module { struct process* process; Modified: trunk/reactos/dll/win32/dbghelp/dwarf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dwarf.c?…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/dwarf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/dwarf.c [iso-8859-1] Tue Nov 22 18:03:01 2016 @@ -2621,7 +2621,7 @@ /* parse the CIE first */ version = dwarf2_parse_byte(ctx); - if (version != 1 && version != 3) + if (version != 1 && version != 3 && version != 4) { FIXME("unknown CIE version %u at %p\n", version, ctx->data - 1); return FALSE; @@ -2629,12 +2629,21 @@ augmentation = (const char*)ctx->data; ctx->data += strlen(augmentation) + 1; - info->code_align = dwarf2_leb128_as_unsigned(ctx); - info->data_align = dwarf2_leb128_as_signed(ctx); - if (version == 1) - info->retaddr_reg = dwarf2_parse_byte(ctx); - else - info->retaddr_reg = dwarf2_leb128_as_unsigned(ctx); + switch (version) + { + case 4: + /* skip 'address_size' and 'segment_size' */ + ctx->data += 2; + /* fallthrough */ + case 1: + case 3: + info->code_align = dwarf2_leb128_as_unsigned(ctx); + info->data_align = dwarf2_leb128_as_signed(ctx); + info->retaddr_reg = version == 1 ? dwarf2_parse_byte(ctx) :dwarf2_leb128_as_unsigned(ctx); + break; + default: + ; + } info->state.cfa_rule = RULE_CFA_OFFSET; end = NULL; Modified: trunk/reactos/dll/win32/dbghelp/module.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/module.c…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/module.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/module.c [iso-8859-1] Tue Nov 22 18:03:01 2016 @@ -683,7 +683,6 @@ } hash_table_destroy(&module->ht_symbols); hash_table_destroy(&module->ht_types); - wine_rb_destroy(&module->sources_offsets_tree, NULL, NULL); HeapFree(GetProcessHeap(), 0, module->sources); HeapFree(GetProcessHeap(), 0, module->addr_sorttab); pool_destroy(&module->pool); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 22 18:03:01 2016 @@ -63,7 +63,7 @@ reactos/dll/win32/cryptdll # Synced to WineStaging-1.9.11 reactos/dll/win32/cryptnet # Synced to WineStaging-1.9.11 reactos/dll/win32/cryptui # Synced to WineStaging-1.9.16 -reactos/dll/win32/dbghelp # Synced to WineStaging-1.9.16 +reactos/dll/win32/dbghelp # Synced to WineStaging-1.9.23 reactos/dll/win32/dciman32 # Synced to WineStaging-1.9.11 reactos/dll/win32/faultrep # Synced to WineStaging-1.9.11 reactos/dll/win32/fontsub # Synced to WineStaging-1.9.13
8 years, 1 month
1
0
0
0
[akhaldi] 73349: [INCLUDES/WINE] Attempt to please the linux builder.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 17:42:41 2016 New Revision: 73349 URL:
http://svn.reactos.org/svn/reactos?rev=73349&view=rev
Log: [INCLUDES/WINE] Attempt to please the linux builder. Modified: trunk/reactos/sdk/include/reactos/wine/rbtree.h Modified: trunk/reactos/sdk/include/reactos/wine/rbtree.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/wine/r…
============================================================================== --- trunk/reactos/sdk/include/reactos/wine/rbtree.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/wine/rbtree.h [iso-8859-1] Tue Nov 22 17:42:41 2016 @@ -26,10 +26,10 @@ #ifdef __GNUC__ # define WINE_RB_ENTRY_VALUE(element, type, field) ({ \ const typeof(((type *)0)->field) *__ptr = (element); \ - (type *)((char *)__ptr - offsetof(type, field)); }) + (type *)((char *)__ptr - FIELD_OFFSET(type, field)); }) #else # define WINE_RB_ENTRY_VALUE(element, type, field) \ - ((type *)((char *)(element) - offsetof(type, field))) + ((type *)((char *)(element) - FIELD_OFFSET(type, field))) #endif struct wine_rb_entry
8 years, 1 month
1
0
0
0
[akhaldi] 73348: [INCLUDES/WINE] Update rbtree.h. [D3DCOMPILER_43][DBGHELP][WINED3D] Reflect the rbtree.h changes. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 17:23:40 2016 New Revision: 73348 URL:
http://svn.reactos.org/svn/reactos?rev=73348&view=rev
Log: [INCLUDES/WINE] Update rbtree.h. [D3DCOMPILER_43][DBGHELP][WINED3D] Reflect the rbtree.h changes. CORE-12409 Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/reflection.c trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c trunk/reactos/dll/directx/wine/wined3d/device.c trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c trunk/reactos/dll/directx/wine/wined3d/utils.c trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h trunk/reactos/dll/win32/dbghelp/dbghelp_private.h trunk/reactos/dll/win32/dbghelp/module.c trunk/reactos/dll/win32/dbghelp/source.c trunk/reactos/sdk/include/reactos/wine/rbtree.h Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/reflection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
============================================================================== --- trunk/reactos/dll/directx/wine/d3dcompiler_43/reflection.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3dcompiler_43/reflection.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -188,21 +188,6 @@ return TRUE; } -static void *d3dcompiler_rb_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static void *d3dcompiler_rb_realloc(void *ptr, size_t size) -{ - return HeapReAlloc(GetProcessHeap(), 0, ptr, size); -} - -static void d3dcompiler_rb_free(void *ptr) -{ - HeapFree(GetProcessHeap(), 0, ptr); -} - static int d3dcompiler_shader_reflection_type_compare(const void *key, const struct wine_rb_entry *entry) { const struct d3dcompiler_shader_reflection_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3dcompiler_shader_reflection_type, entry); @@ -237,14 +222,6 @@ HeapFree(GetProcessHeap(), 0, t); } - -static const struct wine_rb_functions d3dcompiler_shader_reflection_type_rb_functions = -{ - d3dcompiler_rb_alloc, - d3dcompiler_rb_realloc, - d3dcompiler_rb_free, - d3dcompiler_shader_reflection_type_compare, -}; static void free_signature(struct d3dcompiler_shader_signature *sig) { @@ -1683,11 +1660,7 @@ reflection->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; reflection->refcount = 1; - if (wine_rb_init(&reflection->types, &d3dcompiler_shader_reflection_type_rb_functions) == -1) - { - ERR("Failed to initialize type rbtree.\n"); - return E_FAIL; - } + wine_rb_init(&reflection->types, d3dcompiler_shader_reflection_type_compare); hr = dxbc_parse(data, data_size, &src_dxbc); if (FAILED(hr)) Modified: trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dcompil…
============================================================================== --- trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3dcompiler_43/utils.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -1696,28 +1696,6 @@ return strcmp(name, type->name); } -static inline void *d3dcompiler_alloc_rb(size_t size) -{ - return d3dcompiler_alloc(size); -} - -static inline void *d3dcompiler_realloc_rb(void *ptr, size_t size) -{ - return d3dcompiler_realloc(ptr, size); -} - -static inline void d3dcompiler_free_rb(void *ptr) -{ - d3dcompiler_free(ptr); -} -static const struct wine_rb_functions hlsl_type_rb_funcs = -{ - d3dcompiler_alloc_rb, - d3dcompiler_realloc_rb, - d3dcompiler_free_rb, - compare_hlsl_types_rb, -}; - void push_scope(struct hlsl_parse_ctx *ctx) { struct hlsl_scope *new_scope = d3dcompiler_alloc(sizeof(*new_scope)); @@ -1729,12 +1707,7 @@ } TRACE("Pushing a new scope\n"); list_init(&new_scope->vars); - if (wine_rb_init(&new_scope->types, &hlsl_type_rb_funcs) == -1) - { - ERR("Failed to initialize types rbtree.\n"); - d3dcompiler_free(new_scope); - return; - } + wine_rb_init(&new_scope->types, compare_hlsl_types_rb); new_scope->upper = ctx->cur_scope; ctx->cur_scope = new_scope; list_add_tail(&ctx->scopes, &new_scope->entry); @@ -1844,14 +1817,6 @@ return 0; } -static const struct wine_rb_functions hlsl_ir_function_decl_rb_funcs = -{ - d3dcompiler_alloc_rb, - d3dcompiler_realloc_rb, - d3dcompiler_free_rb, - compare_function_decl_rb, -}; - static int compare_function_rb(const void *key, const struct wine_rb_entry *entry) { const char *name = key; @@ -1860,18 +1825,9 @@ return strcmp(name, func->name); } -static const struct wine_rb_functions function_rb_funcs = -{ - d3dcompiler_alloc_rb, - d3dcompiler_realloc_rb, - d3dcompiler_free_rb, - compare_function_rb, -}; - void init_functions_tree(struct wine_rb_tree *funcs) { - if (wine_rb_init(&hlsl_ctx.functions, &function_rb_funcs) == -1) - ERR("Failed to initialize functions rbtree.\n"); + wine_rb_init(&hlsl_ctx.functions, compare_function_rb); } static const char *debug_base_type(const struct hlsl_type *type) @@ -2508,11 +2464,7 @@ TRACE("Function %s redeclared as a user defined function.\n", debugstr_a(name)); func->intrinsic = intrinsic; wine_rb_destroy(&func->overloads, free_function_decl_rb, NULL); - if (wine_rb_init(&func->overloads, &hlsl_ir_function_decl_rb_funcs) == -1) - { - ERR("Failed to initialize function rbtree.\n"); - return; - } + wine_rb_init(&func->overloads, compare_function_decl_rb); } decl->func = func; if ((old_entry = wine_rb_get(&func->overloads, decl->parameters))) @@ -2526,7 +2478,7 @@ d3dcompiler_free(name); return; } - wine_rb_remove(&func->overloads, decl->parameters); + wine_rb_remove(&func->overloads, old_entry); free_function_decl(old_decl); } wine_rb_put(&func->overloads, decl->parameters, &decl->entry); @@ -2535,13 +2487,7 @@ } func = d3dcompiler_alloc(sizeof(*func)); func->name = name; - if (wine_rb_init(&func->overloads, &hlsl_ir_function_decl_rb_funcs) == -1) - { - ERR("Failed to initialize function rbtree.\n"); - d3dcompiler_free(name); - d3dcompiler_free(func); - return; - } + wine_rb_init(&func->overloads, compare_function_decl_rb); decl->func = func; wine_rb_put(&func->overloads, decl->parameters, &decl->entry); func->intrinsic = intrinsic; Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -4948,14 +4948,6 @@ return compare_sig(key, &e->sig); } -static const struct wine_rb_functions sig_tree_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - sig_tree_compare -}; - static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe) { @@ -4993,11 +4985,7 @@ memset(priv->pshader_const_dirty, 1, sizeof(*priv->pshader_const_dirty) * d3d_info->limits.ps_uniform_count); - if(wine_rb_init(&priv->signature_tree, &sig_tree_functions) == -1) - { - ERR("RB tree init failed\n"); - goto fail; - } + wine_rb_init(&priv->signature_tree, sig_tree_compare); priv->vertex_pipe = vertex_pipe; priv->fragment_pipe = fragment_pipe; @@ -5836,13 +5824,7 @@ else if (!(priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)))) return NULL; - if (wine_rb_init(&priv->fragment_shaders, &wined3d_ffp_frag_program_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - if (priv != shader_priv) - HeapFree(GetProcessHeap(), 0, priv); - return NULL; - } + wine_rb_init(&priv->fragment_shaders, wined3d_ffp_frag_program_key_compare); priv->use_arbfp_fixed_func = TRUE; return priv; @@ -6970,14 +6952,6 @@ HeapFree(GetProcessHeap(), 0, entry_arb); } -static const struct wine_rb_functions wined3d_arbfp_blit_rb_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - arbfp_blit_type_compare, -}; - static HRESULT arbfp_blit_alloc(struct wined3d_device *device) { struct arbfp_blit_priv *priv; @@ -6985,12 +6959,7 @@ if (!(priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)))) return E_OUTOFMEMORY; - if (wine_rb_init(&priv->shaders, &wined3d_arbfp_blit_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - HeapFree(GetProcessHeap(), 0, priv); - return E_OUTOFMEMORY; - } + wine_rb_init(&priv->shaders, arbfp_blit_type_compare); device->blit_priv = priv; Modified: trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -1317,13 +1317,7 @@ if (!(priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)))) return NULL; - if (wine_rb_init(&priv->fragment_shaders, &wined3d_ffp_frag_program_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - HeapFree(GetProcessHeap(), 0, priv); - return NULL; - } - + wine_rb_init(&priv->fragment_shaders, wined3d_ffp_frag_program_key_compare); return priv; } Modified: trunk/reactos/dll/directx/wine/wined3d/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/device.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -5622,14 +5622,6 @@ return memcmp(&sampler->desc, key, sizeof(sampler->desc)); } -static const struct wine_rb_functions wined3d_sampler_rb_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - wined3d_sampler_compare, -}; - HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent) @@ -5661,11 +5653,7 @@ fragment_pipeline = adapter->fragment_pipe; - if (wine_rb_init(&device->samplers, &wined3d_sampler_rb_functions) == -1) - { - ERR("Failed to initialize sampler rbtree.\n"); - return E_OUTOFMEMORY; - } + wine_rb_init(&device->samplers, wined3d_sampler_compare); if (vertex_pipeline->vp_states && fragment_pipeline->states && FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs, Modified: trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -5048,12 +5048,7 @@ static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, struct glsl_shader_prog_link *entry) { - struct glsl_program_key key; - - key.vs_id = entry->vs.id; - key.gs_id = entry->gs.id; - key.ps_id = entry->ps.id; - wine_rb_remove(&priv->program_lookup, &key); + wine_rb_remove(&priv->program_lookup, &entry->program_lookup_entry); GL_EXTCALL(glDeleteProgram(entry->id)); if (entry->vs.id) @@ -7823,14 +7818,6 @@ HeapFree(GetProcessHeap(), 0, heap->entries); } -static const struct wine_rb_functions wined3d_glsl_program_rb_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - glsl_program_key_compare, -}; - static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe) { @@ -7883,11 +7870,7 @@ goto fail; } - if (wine_rb_init(&priv->program_lookup, &wined3d_glsl_program_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - goto fail; - } + wine_rb_init(&priv->program_lookup, glsl_program_key_compare); priv->next_constant_version = 1; priv->vertex_pipe = vertex_pipe; @@ -8257,13 +8240,7 @@ if (shader_backend == &glsl_shader_backend) { priv = shader_priv; - - if (wine_rb_init(&priv->ffp_vertex_shaders, &wined3d_ffp_vertex_program_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - return NULL; - } - + wine_rb_init(&priv->ffp_vertex_shaders, wined3d_ffp_vertex_program_key_compare); return priv; } @@ -8692,13 +8669,7 @@ if (shader_backend == &glsl_shader_backend) { priv = shader_priv; - - if (wine_rb_init(&priv->ffp_fragment_shaders, &wined3d_ffp_frag_program_rb_functions) == -1) - { - ERR("Failed to initialize rbtree.\n"); - return NULL; - } - + wine_rb_init(&priv->ffp_fragment_shaders, wined3d_ffp_frag_program_key_compare); return priv; } Modified: trunk/reactos/dll/directx/wine/wined3d/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/u…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/utils.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -5162,36 +5162,13 @@ texture_activate_dimensions(state->textures[sampler], context->gl_info); } -void *wined3d_rb_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -void *wined3d_rb_realloc(void *ptr, size_t size) -{ - return HeapReAlloc(GetProcessHeap(), 0, ptr, size); -} - -void wined3d_rb_free(void *ptr) -{ - HeapFree(GetProcessHeap(), 0, ptr); -} - -static int ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry) +int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry) { const struct ffp_frag_settings *ka = key; const struct ffp_frag_settings *kb = &WINE_RB_ENTRY_VALUE(entry, const struct ffp_frag_desc, entry)->settings; return memcmp(ka, kb, sizeof(*ka)); } - -const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - ffp_frag_program_key_compare, -}; void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings) @@ -5318,7 +5295,7 @@ settings->padding = 0; } -static int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry) +int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry) { const struct wined3d_ffp_vs_settings *ka = key; const struct wined3d_ffp_vs_settings *kb = &WINE_RB_ENTRY_VALUE(entry, @@ -5326,14 +5303,6 @@ return memcmp(ka, kb, sizeof(*ka)); } - -const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions = -{ - wined3d_rb_alloc, - wined3d_rb_realloc, - wined3d_rb_free, - wined3d_ffp_vertex_program_key_compare, -}; const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, enum wined3d_blit_op blit_op, Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -2078,8 +2078,9 @@ struct ffp_frag_settings settings; }; -extern const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions DECLSPEC_HIDDEN; -extern const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions DECLSPEC_HIDDEN; +int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN; +int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN; + extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN; unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dbghelp_…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/dbghelp_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/dbghelp_private.h [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -696,6 +696,7 @@ /* source.c */ extern unsigned source_new(struct module* module, const char* basedir, const char* source) DECLSPEC_HIDDEN; extern const char* source_get(const struct module* module, unsigned idx) DECLSPEC_HIDDEN; +extern int source_rb_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN; /* stabs.c */ typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset, Modified: trunk/reactos/dll/win32/dbghelp/module.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/module.c…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/module.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/module.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -219,7 +219,7 @@ module->sources_used = 0; module->sources_alloc = 0; module->sources = 0; - wine_rb_init(&module->sources_offsets_tree, &source_rb_functions); + wine_rb_init(&module->sources_offsets_tree, source_rb_compare); return module; } Modified: trunk/reactos/dll/win32/dbghelp/source.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/source.c…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/source.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/source.c [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -30,35 +30,12 @@ unsigned source; }; -static void *source_rb_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static void *source_rb_realloc(void *ptr, size_t size) -{ - return HeapReAlloc(GetProcessHeap(), 0, ptr, size); -} - -static void source_rb_free(void *ptr) -{ - HeapFree(GetProcessHeap(), 0, ptr); -} - -static int source_rb_compare(const void *key, const struct wine_rb_entry *entry) +int source_rb_compare(const void *key, const struct wine_rb_entry *entry) { const struct source_rb *t = WINE_RB_ENTRY_VALUE(entry, const struct source_rb, entry); return strcmp((const char*)key, rb_module->sources + t->source); } - -const struct wine_rb_functions source_rb_functions = -{ - source_rb_alloc, - source_rb_realloc, - source_rb_free, - source_rb_compare, -}; /****************************************************************** * source_find Modified: trunk/reactos/sdk/include/reactos/wine/rbtree.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/wine/r…
============================================================================== --- trunk/reactos/sdk/include/reactos/wine/rbtree.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/wine/rbtree.h [iso-8859-1] Tue Nov 22 17:23:40 2016 @@ -3,6 +3,7 @@ * * Copyright 2009 Henri Verbeet * Copyright 2009 Andrew Riedi + * Copyright 2016 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,103 +23,74 @@ #ifndef __WINE_WINE_RBTREE_H #define __WINE_WINE_RBTREE_H -#define WINE_RB_ENTRY_VALUE(element, type, field) \ - ((type *)((char *)(element) - FIELD_OFFSET(type, field))) +#ifdef __GNUC__ +# define WINE_RB_ENTRY_VALUE(element, type, field) ({ \ + const typeof(((type *)0)->field) *__ptr = (element); \ + (type *)((char *)__ptr - offsetof(type, field)); }) +#else +# define WINE_RB_ENTRY_VALUE(element, type, field) \ + ((type *)((char *)(element) - offsetof(type, field))) +#endif struct wine_rb_entry { + struct wine_rb_entry *parent; struct wine_rb_entry *left; struct wine_rb_entry *right; unsigned int flags; }; -struct wine_rb_stack -{ - struct wine_rb_entry ***entries; - size_t count; - size_t size; +typedef int (*wine_rb_compare_func_t)(const void *key, const struct wine_rb_entry *entry); + +struct wine_rb_tree +{ + wine_rb_compare_func_t compare; + struct wine_rb_entry *root; }; -struct wine_rb_functions -{ - void *(*alloc)(size_t size); - void *(*realloc)(void *ptr, size_t size); - void (*free)(void *ptr); - int (*compare)(const void *key, const struct wine_rb_entry *entry); -}; - -struct wine_rb_tree -{ - const struct wine_rb_functions *functions; - struct wine_rb_entry *root; - struct wine_rb_stack stack; -}; - typedef void (wine_rb_traverse_func_t)(struct wine_rb_entry *entry, void *context); #define WINE_RB_FLAG_RED 0x1 -#define WINE_RB_FLAG_STOP 0x2 -#define WINE_RB_FLAG_TRAVERSED_LEFT 0x4 -#define WINE_RB_FLAG_TRAVERSED_RIGHT 0x8 - -static inline void wine_rb_stack_clear(struct wine_rb_stack *stack) -{ - stack->count = 0; -} - -static inline void wine_rb_stack_push(struct wine_rb_stack *stack, struct wine_rb_entry **entry) -{ - stack->entries[stack->count++] = entry; -} - -static inline int wine_rb_ensure_stack_size(struct wine_rb_tree *tree, size_t size) -{ - struct wine_rb_stack *stack = &tree->stack; - - if (size > stack->size) - { - size_t new_size = stack->size << 1; - struct wine_rb_entry ***new_entries = tree->functions->realloc(stack->entries, - new_size * sizeof(*stack->entries)); - - if (!new_entries) return -1; - - stack->entries = new_entries; - stack->size = new_size; - } - - return 0; -} static inline int wine_rb_is_red(struct wine_rb_entry *entry) { return entry && (entry->flags & WINE_RB_FLAG_RED); } -static inline void wine_rb_rotate_left(struct wine_rb_entry **entry) -{ - struct wine_rb_entry *e = *entry; +static inline void wine_rb_rotate_left(struct wine_rb_tree *tree, struct wine_rb_entry *e) +{ struct wine_rb_entry *right = e->right; + if (!e->parent) + tree->root = right; + else if (e->parent->left == e) + e->parent->left = right; + else + e->parent->right = right; + e->right = right->left; + if (e->right) e->right->parent = e; right->left = e; - right->flags &= ~WINE_RB_FLAG_RED; - right->flags |= e->flags & WINE_RB_FLAG_RED; - e->flags |= WINE_RB_FLAG_RED; - *entry = right; -} - -static inline void wine_rb_rotate_right(struct wine_rb_entry **entry) -{ - struct wine_rb_entry *e = *entry; + right->parent = e->parent; + e->parent = right; +} + +static inline void wine_rb_rotate_right(struct wine_rb_tree *tree, struct wine_rb_entry *e) +{ struct wine_rb_entry *left = e->left; + if (!e->parent) + tree->root = left; + else if (e->parent->left == e) + e->parent->left = left; + else + e->parent->right = left; + e->left = left->right; + if (e->left) e->left->parent = e; left->right = e; - left->flags &= ~WINE_RB_FLAG_RED; - left->flags |= e->flags & WINE_RB_FLAG_RED; - e->flags |= WINE_RB_FLAG_RED; - *entry = left; + left->parent = e->parent; + e->parent = left; } static inline void wine_rb_flip_color(struct wine_rb_entry *entry) @@ -128,96 +100,70 @@ entry->right->flags ^= WINE_RB_FLAG_RED; } -static inline void wine_rb_fixup(struct wine_rb_stack *stack) -{ - while (stack->count) - { - struct wine_rb_entry **entry = stack->entries[stack->count - 1]; - - if ((*entry)->flags & WINE_RB_FLAG_STOP) - { - (*entry)->flags &= ~WINE_RB_FLAG_STOP; - return; - } - - if (wine_rb_is_red((*entry)->right) && !wine_rb_is_red((*entry)->left)) wine_rb_rotate_left(entry); - if (wine_rb_is_red((*entry)->left) && wine_rb_is_red((*entry)->left->left)) wine_rb_rotate_right(entry); - if (wine_rb_is_red((*entry)->left) && wine_rb_is_red((*entry)->right)) wine_rb_flip_color(*entry); - --stack->count; - } -} - -static inline void wine_rb_move_red_left(struct wine_rb_entry **entry) -{ - wine_rb_flip_color(*entry); - if (wine_rb_is_red((*entry)->right->left)) - { - wine_rb_rotate_right(&(*entry)->right); - wine_rb_rotate_left(entry); - wine_rb_flip_color(*entry); - } -} - -static inline void wine_rb_move_red_right(struct wine_rb_entry **entry) -{ - wine_rb_flip_color(*entry); - if (wine_rb_is_red((*entry)->left->left)) - { - wine_rb_rotate_right(entry); - wine_rb_flip_color(*entry); - } -} +static inline struct wine_rb_entry *wine_rb_head(struct wine_rb_entry *iter) +{ + if (!iter) return NULL; + while (iter->left) iter = iter->left; + return iter; +} + +static inline struct wine_rb_entry *wine_rb_next(struct wine_rb_entry *iter) +{ + if (iter->right) return wine_rb_head(iter->right); + while (iter->parent && iter->parent->right == iter) iter = iter->parent; + return iter->parent; +} + +static inline struct wine_rb_entry *wine_rb_postorder_head(struct wine_rb_entry *iter) +{ + if (!iter) return NULL; + + for (;;) { + while (iter->left) iter = iter->left; + if (!iter->right) return iter; + iter = iter->right; + } +} + +static inline struct wine_rb_entry *wine_rb_postorder_next(struct wine_rb_entry *iter) +{ + if (!iter->parent) return NULL; + if (iter == iter->parent->right || !iter->parent->right) return iter->parent; + return wine_rb_postorder_head(iter->parent->right); +} + +/* iterate through the tree */ +#define WINE_RB_FOR_EACH(cursor, tree) \ + for ((cursor) = wine_rb_head((tree)->root); (cursor); (cursor) = wine_rb_next(cursor)) + +/* iterate through the tree using a tree entry */ +#define WINE_RB_FOR_EACH_ENTRY(elem, tree, type, field) \ + for ((elem) = WINE_RB_ENTRY_VALUE(wine_rb_head((tree)->root), type, field); \ + &(elem)->field; \ + (elem) = WINE_RB_ENTRY_VALUE(wine_rb_next(&elem->field), type, field)) + static inline void wine_rb_postorder(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) { - struct wine_rb_entry **entry; - - if (!tree->root) return; - - for (entry = &tree->root;;) - { - struct wine_rb_entry *e = *entry; - - if (e->left && !(e->flags & WINE_RB_FLAG_TRAVERSED_LEFT)) - { - wine_rb_stack_push(&tree->stack, entry); - e->flags |= WINE_RB_FLAG_TRAVERSED_LEFT; - entry = &e->left; - continue; - } - - if (e->right && !(e->flags & WINE_RB_FLAG_TRAVERSED_RIGHT)) - { - wine_rb_stack_push(&tree->stack, entry); - e->flags |= WINE_RB_FLAG_TRAVERSED_RIGHT; - entry = &e->right; - continue; - } - - e->flags &= ~(WINE_RB_FLAG_TRAVERSED_LEFT | WINE_RB_FLAG_TRAVERSED_RIGHT); - callback(e, context); - - if (!tree->stack.count) break; - entry = tree->stack.entries[--tree->stack.count]; - } -} - -static inline int wine_rb_init(struct wine_rb_tree *tree, const struct wine_rb_functions *functions) -{ - tree->functions = functions; + struct wine_rb_entry *iter, *next; + + for (iter = wine_rb_postorder_head(tree->root); iter; iter = next) + { + next = wine_rb_postorder_next(iter); + callback(iter, context); + } +} + +static inline void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare) +{ + tree->compare = compare; tree->root = NULL; - - tree->stack.entries = functions->alloc(16 * sizeof(*tree->stack.entries)); - if (!tree->stack.entries) return -1; - tree->stack.size = 16; - tree->stack.count = 0; - - return 0; } static inline void wine_rb_for_each_entry(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) { - wine_rb_postorder(tree, callback, context); + struct wine_rb_entry *iter; + WINE_RB_FOR_EACH(iter, tree) callback(iter, context); } static inline void wine_rb_clear(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) @@ -230,7 +176,6 @@ static inline void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) { wine_rb_clear(tree, callback, context); - tree->functions->free(tree->stack.entries); } static inline struct wine_rb_entry *wine_rb_get(const struct wine_rb_tree *tree, const void *key) @@ -238,7 +183,7 @@ struct wine_rb_entry *entry = tree->root; while (entry) { - int c = tree->functions->compare(key, entry); + int c = tree->compare(key, entry); if (!c) return entry; entry = c < 0 ? entry->left : entry->right; } @@ -247,100 +192,185 @@ static inline int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry) { - struct wine_rb_entry **parent = &tree->root; - size_t black_height = 1; - - while (*parent) + struct wine_rb_entry **iter = &tree->root, *parent = tree->root; + + while (*iter) { int c; - if (!wine_rb_is_red(*parent)) ++black_height; - - wine_rb_stack_push(&tree->stack, parent); - - c = tree->functions->compare(key, *parent); - if (!c) - { - wine_rb_stack_clear(&tree->stack); - return -1; - } - else if (c < 0) parent = &(*parent)->left; - else parent = &(*parent)->right; - } - - /* After insertion, the path length to any node should be <= (black_height + 1) * 2. */ - if (wine_rb_ensure_stack_size(tree, black_height << 1) == -1) - { - wine_rb_stack_clear(&tree->stack); - return -1; + parent = *iter; + c = tree->compare(key, parent); + if (!c) return -1; + else if (c < 0) iter = &parent->left; + else iter = &parent->right; } entry->flags = WINE_RB_FLAG_RED; + entry->parent = parent; entry->left = NULL; entry->right = NULL; - *parent = entry; - - wine_rb_fixup(&tree->stack); - tree->root->flags &= ~WINE_RB_FLAG_RED; - - return 0; -} - -static inline void wine_rb_remove(struct wine_rb_tree *tree, const void *key) -{ - struct wine_rb_entry **entry = &tree->root; - - while (*entry) - { - if (tree->functions->compare(key, *entry) < 0) + *iter = entry; + + while (wine_rb_is_red(entry->parent)) + { + if (entry->parent == entry->parent->parent->left) { - wine_rb_stack_push(&tree->stack, entry); - if (!wine_rb_is_red((*entry)->left) && !wine_rb_is_red((*entry)->left->left)) wine_rb_move_red_left(entry); - entry = &(*entry)->left; + if (wine_rb_is_red(entry->parent->parent->right)) + { + wine_rb_flip_color(entry->parent->parent); + entry = entry->parent->parent; + } + else + { + if (entry == entry->parent->right) + { + entry = entry->parent; + wine_rb_rotate_left(tree, entry); + } + entry->parent->flags &= ~WINE_RB_FLAG_RED; + entry->parent->parent->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_right(tree, entry->parent->parent); + } } else { - if (wine_rb_is_red((*entry)->left)) wine_rb_rotate_right(entry); - if (!tree->functions->compare(key, *entry) && !(*entry)->right) - { - *entry = NULL; - break; - } - if (!wine_rb_is_red((*entry)->right) && !wine_rb_is_red((*entry)->right->left)) - wine_rb_move_red_right(entry); - if (!tree->functions->compare(key, *entry)) - { - struct wine_rb_entry **e = &(*entry)->right; - struct wine_rb_entry *m = *e; - while (m->left) m = m->left; - - wine_rb_stack_push(&tree->stack, entry); - (*entry)->flags |= WINE_RB_FLAG_STOP; - - while ((*e)->left) - { - wine_rb_stack_push(&tree->stack, e); - if (!wine_rb_is_red((*e)->left) && !wine_rb_is_red((*e)->left->left)) wine_rb_move_red_left(e); - e = &(*e)->left; - } - *e = NULL; - wine_rb_fixup(&tree->stack); - - *m = **entry; - *entry = m; - - break; + if (wine_rb_is_red(entry->parent->parent->left)) + { + wine_rb_flip_color(entry->parent->parent); + entry = entry->parent->parent; } else { - wine_rb_stack_push(&tree->stack, entry); - entry = &(*entry)->right; + if (entry == entry->parent->left) + { + entry = entry->parent; + wine_rb_rotate_right(tree, entry); + } + entry->parent->flags &= ~WINE_RB_FLAG_RED; + entry->parent->parent->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_left(tree, entry->parent->parent); } } } - wine_rb_fixup(&tree->stack); + tree->root->flags &= ~WINE_RB_FLAG_RED; + + return 0; +} + +static inline void wine_rb_remove(struct wine_rb_tree *tree, struct wine_rb_entry *entry) +{ + struct wine_rb_entry *iter, *child, *parent, *w; + int need_fixup; + + if (entry->right && entry->left) + for(iter = entry->right; iter->left; iter = iter->left); + else + iter = entry; + + child = iter->left ? iter->left : iter->right; + + if (!iter->parent) + tree->root = child; + else if (iter == iter->parent->left) + iter->parent->left = child; + else + iter->parent->right = child; + + if (child) child->parent = iter->parent; + parent = iter->parent; + + need_fixup = !wine_rb_is_red(iter); + + if (entry != iter) + { + *iter = *entry; + if (!iter->parent) + tree->root = iter; + else if (entry == iter->parent->left) + iter->parent->left = iter; + else + iter->parent->right = iter; + + if (iter->right) iter->right->parent = iter; + if (iter->left) iter->left->parent = iter; + if (parent == entry) parent = iter; + } + + if (need_fixup) + { + while (parent && !wine_rb_is_red(child)) + { + if (child == parent->left) + { + w = parent->right; + if (wine_rb_is_red(w)) + { + w->flags &= ~WINE_RB_FLAG_RED; + parent->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_left(tree, parent); + w = parent->right; + } + if (wine_rb_is_red(w->left) || wine_rb_is_red(w->right)) + { + if (!wine_rb_is_red(w->right)) + { + w->left->flags &= ~WINE_RB_FLAG_RED; + w->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_right(tree, w); + w = parent->right; + } + w->flags = (w->flags & ~WINE_RB_FLAG_RED) | (parent->flags & WINE_RB_FLAG_RED); + parent->flags &= ~WINE_RB_FLAG_RED; + if (w->right) + w->right->flags &= ~WINE_RB_FLAG_RED; + wine_rb_rotate_left(tree, parent); + child = NULL; + break; + } + } + else + { + w = parent->left; + if (wine_rb_is_red(w)) + { + w->flags &= ~WINE_RB_FLAG_RED; + parent->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_right(tree, parent); + w = parent->left; + } + if (wine_rb_is_red(w->left) || wine_rb_is_red(w->right)) + { + if (!wine_rb_is_red(w->left)) + { + w->right->flags &= ~WINE_RB_FLAG_RED; + w->flags |= WINE_RB_FLAG_RED; + wine_rb_rotate_left(tree, w); + w = parent->left; + } + w->flags = (w->flags & ~WINE_RB_FLAG_RED) | (parent->flags & WINE_RB_FLAG_RED); + parent->flags &= ~WINE_RB_FLAG_RED; + if (w->left) + w->left->flags &= ~WINE_RB_FLAG_RED; + wine_rb_rotate_right(tree, parent); + child = NULL; + break; + } + } + w->flags |= WINE_RB_FLAG_RED; + child = parent; + parent = child->parent; + } + if (child) child->flags &= ~WINE_RB_FLAG_RED; + } + if (tree->root) tree->root->flags &= ~WINE_RB_FLAG_RED; } +static inline void wine_rb_remove_key(struct wine_rb_tree *tree, const void *key) +{ + struct wine_rb_entry *entry = wine_rb_get(tree, key); + if (entry) wine_rb_remove(tree, entry); +} + #endif /* __WINE_WINE_RBTREE_H */
8 years, 1 month
1
0
0
0
[akhaldi] 73347: [CRYPT32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 17:09:34 2016 New Revision: 73347 URL:
http://svn.reactos.org/svn/reactos?rev=73347&view=rev
Log: [CRYPT32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/crypt32/CMakeLists.txt trunk/rostests/winetests/crypt32/base64.c trunk/rostests/winetests/crypt32/store.c Modified: trunk/rostests/winetests/crypt32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/CMakeLi…
============================================================================== --- trunk/rostests/winetests/crypt32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/CMakeLists.txt [iso-8859-1] Tue Nov 22 17:09:34 2016 @@ -21,5 +21,5 @@ add_executable(crypt32_winetest ${SOURCE}) set_module_type(crypt32_winetest win32cui) -add_importlibs(crypt32_winetest crypt32 advapi32 msvcrt kernel32) +add_importlibs(crypt32_winetest crypt32 advapi32 user32 shlwapi shell32 msvcrt kernel32) add_cd_file(TARGET crypt32_winetest DESTINATION reactos/bin FOR all) Modified: trunk/rostests/winetests/crypt32/base64.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/base64.…
============================================================================== --- trunk/rostests/winetests/crypt32/base64.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/base64.c [iso-8859-1] Tue Nov 22 17:09:34 2016 @@ -306,9 +306,6 @@ }; static const struct BadString badStrings[] = { - { "A\r\nA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 }, - { "AA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 }, - { "AA=\r\n=\r\n", CRYPT_STRING_BASE64 }, { "-----BEGIN X509 CRL-----\r\nAA==\r\n", CRYPT_STRING_BASE64X509CRLHEADER }, }; @@ -340,7 +337,7 @@ ret = pCryptStringToBinaryA(badStrings[i].str, 0, badStrings[i].format, NULL, &bufLen, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_DATA, - "Expected ERROR_INVALID_DATA, got ret=%d le=%u\n", ret, GetLastError()); + "%d: Expected ERROR_INVALID_DATA, got ret=%d le=%u\n", i, ret, GetLastError()); } /* Good strings */ for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) Modified: trunk/rostests/winetests/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/store.c…
============================================================================== --- trunk/rostests/winetests/crypt32/store.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/store.c [iso-8859-1] Tue Nov 22 17:09:34 2016 @@ -23,6 +23,8 @@ #include <windef.h> #include <winbase.h> +#include <shlobj.h> +#include <shlwapi.h> #include <winreg.h> //#include <winerror.h> #include <wincrypt.h> @@ -123,6 +125,8 @@ static void (WINAPI *pCertRemoveStoreFromCollection)(HCERTSTORE,HCERTSTORE); static BOOL (WINAPI *pCertSetStoreProperty)(HCERTSTORE,DWORD,DWORD,const void*); static BOOL (WINAPI *pCertAddCertificateLinkToStore)(HCERTSTORE,PCCERT_CONTEXT,DWORD,PCCERT_CONTEXT*); +static BOOL (WINAPI *pCertRegisterSystemStore)(const void*,DWORD,void*,void*); +static BOOL (WINAPI *pCertUnregisterSystemStore)(const void*,DWORD); #define test_store_is_empty(store) _test_store_is_empty(__LINE__,store) static void _test_store_is_empty(unsigned line, HCERTSTORE store) @@ -344,6 +348,284 @@ 0xa3,0x16,0x30,0x14,0x30,0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04, 0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00 }; + +static const struct +{ + HKEY key; + DWORD cert_store; + BOOL appdata_file; + WCHAR store_name[16]; + const WCHAR *base_reg_path; +} reg_store_saved_certs[] = { + { HKEY_LOCAL_MACHINE, CERT_SYSTEM_STORE_LOCAL_MACHINE, FALSE, + {'R','O','O','T',0}, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH }, + { HKEY_LOCAL_MACHINE, CERT_SYSTEM_STORE_LOCAL_MACHINE, FALSE, + {'M','Y',0}, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH }, + { HKEY_LOCAL_MACHINE, CERT_SYSTEM_STORE_LOCAL_MACHINE, FALSE, + {'C','A',0}, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH }, + /* Adding to HKCU\Root triggers safety warning. */ + { HKEY_CURRENT_USER, CERT_SYSTEM_STORE_CURRENT_USER, TRUE, + {'M','Y',0}, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH }, + { HKEY_CURRENT_USER, CERT_SYSTEM_STORE_CURRENT_USER, FALSE, + {'C','A',0}, CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH } +}; + +/* Testing whether system stores are available for adding new certs + * and checking directly in the registry whether they are actually saved or deleted. + * Windows treats HKCU\My (at least) as a special case and uses AppData directory + * for storing certs, not registry. + */ +static void testRegStoreSavedCerts(void) +{ + static const WCHAR fmt[] = + { '%','s','\\','%','s','\\','%','s','\\','%','s',0}, + ms_certs[] = + { 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0}, + certs[] = + {'C','e','r','t','i','f','i','c','a','t','e','s',0}, + bigCert_hash[] = { + '6','E','3','0','9','0','7','1','5','F','D','9','2','3', + '5','6','E','B','A','E','2','5','4','0','E','6','2','2', + 'D','A','1','9','2','6','0','2','A','6','0','8',0}; + PCCERT_CONTEXT cert1, cert2; + HCERTSTORE store; + HANDLE cert_file; + HRESULT pathres; + WCHAR key_name[MAX_PATH], appdata_path[MAX_PATH]; + HKEY key; + BOOL ret; + DWORD res,i; + + for (i = 0; i < sizeof(reg_store_saved_certs) / sizeof(reg_store_saved_certs[0]); i++) + { + DWORD err; + + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + reg_store_saved_certs[i].cert_store, reg_store_saved_certs[i].store_name); + + err = GetLastError(); + if (!store) + { + ok (err == ERROR_ACCESS_DENIED, "Failed to create store at %d (%08x)\n", i, err); + skip("Insufficient privileges for the test %d\n", i); + continue; + } + ok (store!=NULL, "Failed to open the store at %d, %x", i, GetLastError()); + cert1 = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok (cert1 != NULL, "Create cert context failed at %d, %x\n", i, GetLastError()); + ret = CertAddCertificateContextToStore(store, cert1, CERT_STORE_ADD_REPLACE_EXISTING, NULL); + ok (ret, "Adding to the store failed at %d, %x\n", i, GetLastError()); + CertFreeCertificateContext(cert1); + CertCloseStore(store, 0); + + wsprintfW(key_name, fmt, reg_store_saved_certs[i].base_reg_path, + reg_store_saved_certs[i].store_name, certs, bigCert_hash); + + if (!reg_store_saved_certs[i].appdata_file) + { + res = RegOpenKeyExW(reg_store_saved_certs[i].key, key_name, 0, KEY_ALL_ACCESS, &key); + ok (!res, "The cert hasn't been saved at %d, %x\n", i, GetLastError()); + if (!res) RegCloseKey(key); + } else + { + pathres = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, appdata_path); + ok (pathres == S_OK, + "Failed to get app data path at %d (%x)\n", pathres, GetLastError()); + if (pathres == S_OK) + { + PathAppendW(appdata_path, ms_certs); + PathAppendW(appdata_path, reg_store_saved_certs[i].store_name); + PathAppendW(appdata_path, certs); + PathAppendW(appdata_path, bigCert_hash); + + cert_file = CreateFileW(appdata_path, GENERIC_READ, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + todo_wine ok (cert_file != INVALID_HANDLE_VALUE, + "Cert was not saved in AppData at %d (%x)\n", i, GetLastError()); + CloseHandle(cert_file); + } + } + + /* deleting cert from store */ + store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + reg_store_saved_certs[i].cert_store, reg_store_saved_certs[i].store_name); + ok (store!=NULL, "Failed to open the store at %d, %x", i, GetLastError()); + + cert1 = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok (cert1 != NULL, "Create cert context failed at %d, %x\n", i, GetLastError()); + + cert2 = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_EXISTING, cert1, NULL); + ok (cert2 != NULL, "Failed to find cert in the store at %d, %x\n", i, GetLastError()); + + ret = CertDeleteCertificateFromStore(cert2); + ok (ret, "Failed to delete certificate from store at %d, %x\n", i, GetLastError()); + + CertFreeCertificateContext(cert1); + CertFreeCertificateContext(cert2); + CertCloseStore(store, 0); + + res = RegOpenKeyExW(reg_store_saved_certs[i].key, key_name, 0, KEY_ALL_ACCESS, &key); + ok (res, "The cert's registry entry should be absent at %i, %x\n", i, GetLastError()); + if (!res) RegCloseKey(key); + + if (reg_store_saved_certs[i].appdata_file) + { + cert_file = CreateFileW(appdata_path, GENERIC_READ, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok (cert_file == INVALID_HANDLE_VALUE, + "Cert should have been absent in AppData %d\n", i); + + CloseHandle(cert_file); + } + } +} + +/** + * This test checks that certificate falls into correct store of a collection + * depending on the access flags and priorities. + */ +static void testStoresInCollection(void) +{ + PCCERT_CONTEXT cert1, cert2, tcert1; + HCERTSTORE collection, ro_store, rw_store, rw_store_2, tstore; + static const WCHAR WineTestRO_W[] = { 'W','i','n','e','T','e','s','t','_','R','O',0 }, + WineTestRW_W[] = { 'W','i','n','e','T','e','s','t','_','R','W',0 }, + WineTestRW2_W[]= { 'W','i','n','e','T','e','s','t','_','R','W','2',0 }; + BOOL ret; + + if (!pCertAddStoreToCollection) + { + win_skip("CertAddStoreToCollection() is not available\n"); + return; + } + collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(collection != NULL, "Failed to init collection store, last error %x\n", GetLastError()); + /* Add read-only store to collection with very high priority*/ + ro_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, WineTestRO_W); + ok(ro_store != NULL, "Failed to init ro store %x\n", GetLastError()); + + ret = CertAddStoreToCollection(collection, ro_store, 0, 1000); + ok (ret, "Failed to add read-only store to collection %x\n", GetLastError()); + + cert1 = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok (cert1 != NULL, "Create cert context failed %x\n", GetLastError()); + ret = CertAddCertificateContextToStore(collection, cert1, CERT_STORE_ADD_ALWAYS, NULL); + ok (!ret, "Added cert to collection with single read-only store %x\n", GetLastError()); + + /* Add read-write store to collection with the lowest priority*/ + rw_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, WineTestRW_W); + ok (rw_store != NULL, "Failed to open rw store %x\n", GetLastError()); + ret = CertAddStoreToCollection(collection, rw_store, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0); + ok (ret, "Failed to add rw store to collection %x\n", GetLastError()); + /** Adding certificate to collection should fall into rw store, + * even though prioirty of the ro_store is higher */ + ret = CertAddCertificateContextToStore(collection, cert1, CERT_STORE_ADD_REPLACE_EXISTING, NULL); + ok (ret, "Failed to add cert to the collection %x\n", GetLastError()); + + tcert1 = CertEnumCertificatesInStore(ro_store, NULL); + ok (!tcert1, "Read-only ro_store contains cert\n"); + + tcert1 = CertEnumCertificatesInStore(rw_store, NULL); + ok (cert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, + "Unexpected cert in the rw store\n"); + CertFreeCertificateContext(tcert1); + + tcert1 = CertEnumCertificatesInStore(collection, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, + "Unexpected cert in the collection\n"); + CertFreeCertificateContext(tcert1); + + /** adding one more rw store with higher priority*/ + rw_store_2 = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, WineTestRW2_W); + ok (rw_store_2 != NULL, "Failed to init second rw store %x\n", GetLastError()); + ret = CertAddStoreToCollection(collection, rw_store_2, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 50); + ok (ret, "Failed to add rw_store_2 to collection %x\n",GetLastError()); + + cert2 = CertCreateCertificateContext(X509_ASN_ENCODING, signedBigCert, sizeof(signedBigCert)); + ok (cert2 != NULL, "Failed to create cert context %x \n", GetLastError()); + ret = CertAddCertificateContextToStore(collection, cert2, CERT_STORE_ADD_REPLACE_EXISTING, NULL); + ok (ret, "Failed to add cert3 to the store %x\n",GetLastError()); + + /** checking certificates in the stores */ + tcert1 = CertEnumCertificatesInStore(ro_store, 0); + ok (tcert1 == NULL, "Read-only store not empty\n"); + + tcert1 = CertEnumCertificatesInStore(rw_store, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, + "Unexpected cert in the rw_store\n"); + CertFreeCertificateContext(tcert1); + + tcert1 = CertEnumCertificatesInStore(rw_store_2, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert2->cbCertEncoded, + "Unexpected cert in the rw_store_2\n"); + CertFreeCertificateContext(tcert1); + + /** checking certificates in the collection */ + tcert1 = CertEnumCertificatesInStore(collection, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert2->cbCertEncoded, + "cert2 expected in the collection got %p, %x\n",tcert1, GetLastError()); + tcert1 = CertEnumCertificatesInStore(collection, tcert1); + ok (tcert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, + "cert1 expected in the collection got %p, %x\n",tcert1, GetLastError()); + tcert1 = CertEnumCertificatesInStore(collection, tcert1); + ok (tcert1==NULL,"Unexpected cert in the collection %p %x\n",tcert1, GetLastError()); + + /* checking whether certs had been saved */ + tstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, WineTestRW_W); + ok (tstore!=NULL, "Failed to open existing rw store\n"); + tcert1 = CertEnumCertificatesInStore(tstore, NULL); + todo_wine + ok(tcert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, "cert1 wasn't saved\n"); + CertFreeCertificateContext(tcert1); + CertCloseStore(tstore,0); + + tstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG, WineTestRW2_W); + ok (tstore!=NULL, "Failed to open existing rw2 store\n"); + tcert1 = CertEnumCertificatesInStore(tstore, NULL); + todo_wine + ok (tcert1 && tcert1->cbCertEncoded == cert2->cbCertEncoded, "cert2 wasn't saved\n"); + CertFreeCertificateContext(tcert1); + CertCloseStore(tstore,0); + + CertCloseStore(collection,0); + CertCloseStore(ro_store,0); + CertCloseStore(rw_store,0); + CertCloseStore(rw_store_2,0); + + /* reopening registry stores to check whether certs had been saved */ + rw_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_SYSTEM_STORE_CURRENT_USER, WineTestRW_W); + tcert1 = CertEnumCertificatesInStore(rw_store, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert1->cbCertEncoded, + "Unexpected cert in store %p\n", tcert1); + CertFreeCertificateContext(tcert1); + CertCloseStore(rw_store,0); + + rw_store_2 = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_SYSTEM_STORE_CURRENT_USER, WineTestRW2_W); + tcert1 = CertEnumCertificatesInStore(rw_store_2, NULL); + ok (tcert1 && tcert1->cbCertEncoded == cert2->cbCertEncoded, + "Unexpected cert in store %p\n", tcert1); + CertFreeCertificateContext(tcert1); + CertCloseStore(rw_store_2,0); + + CertFreeCertificateContext(cert1); + CertFreeCertificateContext(cert2); + CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_STORE_DELETE_FLAG|CERT_SYSTEM_STORE_CURRENT_USER,WineTestRO_W); + CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_STORE_DELETE_FLAG|CERT_SYSTEM_STORE_CURRENT_USER,WineTestRW_W); + CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W,0,0, + CERT_STORE_DELETE_FLAG|CERT_SYSTEM_STORE_CURRENT_USER,WineTestRW2_W); + +} static void testCollectionStore(void) { @@ -1866,6 +2148,88 @@ CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_DELETE_FLAG, BogusW); RegDeleteKeyW(HKEY_CURRENT_USER, BogusPathW); +} + +static const struct +{ + DWORD cert_store; + BOOL expected; + BOOL todo; +} reg_system_store_test_data[] = { + { CERT_SYSTEM_STORE_CURRENT_USER, TRUE, 0}, + /* Following tests could require administrator privileges and thus could be skipped */ + { CERT_SYSTEM_STORE_CURRENT_SERVICE, TRUE, 1}, + { CERT_SYSTEM_STORE_LOCAL_MACHINE, TRUE, 0}, + { CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY, TRUE, 0}, + { CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY, TRUE, 0}, + { CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, TRUE, 1} +}; + +static void testCertRegisterSystemStore(void) +{ + BOOL ret, cur_flag; + DWORD err = 0; + HCERTSTORE hstore; + static const WCHAR WineTestW[] = {'W','i','n','e','T','e','s','t',0}; + const CERT_CONTEXT *cert, *cert2; + unsigned int i; + + if (!pCertRegisterSystemStore || !pCertUnregisterSystemStore) + { + win_skip("CertRegisterSystemStore() or CertUnregisterSystemStore() is not available\n"); + return; + } + + for (i = 0; i < sizeof(reg_system_store_test_data) / sizeof(reg_system_store_test_data[0]); i++) { + cur_flag = reg_system_store_test_data[i].cert_store; + ret = pCertRegisterSystemStore(WineTestW, cur_flag, NULL, NULL); + if (!ret) + { + err = GetLastError(); + if (err == ERROR_ACCESS_DENIED) + { + win_skip("Insufficient privileges for the flag %08x test\n", cur_flag); + continue; + } + } + todo_wine_if (reg_system_store_test_data[i].todo) + ok (ret == reg_system_store_test_data[i].expected, + "Store registration (dwFlags=%08x) failed, last error %x\n", cur_flag, err); + if (!ret) + { + skip("Nothing to test without registered store at %08x\n", cur_flag); + continue; + } + + hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_STORE_OPEN_EXISTING_FLAG | cur_flag, WineTestW); + ok (hstore != NULL, "Opening just registered store at %08x failed, last error %x\n", cur_flag, GetLastError()); + + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok (cert != NULL, "Failed creating cert at %08x, last error: %x\n", cur_flag, GetLastError()); + if (cert) + { + ret = CertAddCertificateContextToStore(hstore, cert, CERT_STORE_ADD_NEW, NULL); + ok (ret, "Failed to add cert at %08x, last error: %x\n", cur_flag, GetLastError()); + + cert2 = CertEnumCertificatesInStore(hstore, NULL); + ok (cert2 != NULL && cert2->cbCertEncoded == cert->cbCertEncoded, + "Unexpected cert encoded size at %08x, last error: %x\n", cur_flag, GetLastError()); + + ret = CertDeleteCertificateFromStore(cert2); + ok (ret, "Failed to delete certificate from the new store at %08x, last error: %x\n", cur_flag, GetLastError()); + + CertFreeCertificateContext(cert); + } + + ret = CertCloseStore(hstore, 0); + ok (ret, "CertCloseStore failed at %08x, last error %x", cur_flag, GetLastError()); + + ret = pCertUnregisterSystemStore(WineTestW, cur_flag ); + todo_wine_if (reg_system_store_test_data[i].todo) + ok( ret == reg_system_store_test_data[i].expected, + "Unregistering failed at %08x, last error %d\n", cur_flag, GetLastError()); + } + } struct EnumSystemStoreInfo @@ -2587,8 +2951,6 @@ ok(res, "CertDeleteCertificateContextFromStore failed\n"); ok(cert3->hCertStore == cert->hCertStore, "Unexpected hCertStore\n"); - CertFreeCertificateContext(cert3); - store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); ok(store != NULL, "CertOpenStore failed\n"); @@ -2600,8 +2962,6 @@ res = CertDeleteCertificateFromStore(cert3); ok(res, "CertDeleteCertificateContextFromStore failed\n"); ok(cert3->hCertStore == store, "Unexpected hCertStore\n"); - - CertFreeCertificateContext(cert3); CertCloseStore(store, 0); @@ -2808,11 +3168,17 @@ pCertRemoveStoreFromCollection = (void*)GetProcAddress(hdll, "CertRemoveStoreFromCollection"); pCertSetStoreProperty = (void*)GetProcAddress(hdll, "CertSetStoreProperty"); pCertAddCertificateLinkToStore = (void*)GetProcAddress(hdll, "CertAddCertificateLinkToStore"); + pCertRegisterSystemStore = (void*)GetProcAddress(hdll, "CertRegisterSystemStore"); + pCertUnregisterSystemStore = (void*)GetProcAddress(hdll, "CertUnregisterSystemStore"); /* various combinations of CertOpenStore */ testMemStore(); testCollectionStore(); + testStoresInCollection(); + testRegStore(); + testRegStoreSavedCerts(); + testSystemRegStore(); testSystemStore(); testFileStore(); @@ -2821,6 +3187,8 @@ testSerializedStore(); testCloseStore(); + testCertRegisterSystemStore(); + testCertOpenSystemStore(); testCertEnumSystemStore(); testStoreProperty();
8 years, 1 month
1
0
0
0
[akhaldi] 73346: [CRYPT32] Sync with Wine Staging 1.9.23. Jérôme, please review as we no longer have r64026 and r66349 with this. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 17:05:59 2016 New Revision: 73346 URL:
http://svn.reactos.org/svn/reactos?rev=73346&view=rev
Log: [CRYPT32] Sync with Wine Staging 1.9.23. Jérôme, please review as we no longer have r64026 and r66349 with this. CORE-12409 Modified: trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/crypt32.spec trunk/reactos/dll/win32/crypt32/crypt32_private.h trunk/reactos/dll/win32/crypt32/main.c trunk/reactos/dll/win32/crypt32/regstore.c trunk/reactos/dll/win32/crypt32/rootstore.c trunk/reactos/dll/win32/crypt32/store.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -2697,10 +2697,20 @@ revocationPara.pIssuerCert = chain->rgpChain[i]->rgpElement[j + 1]->pCertContext; else - revocationPara.pIssuerCert = NULL; + revocationPara.pIssuerCert = certToCheck; + ret = CertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE, 1, (void **)&certToCheck, revocationFlags, &revocationPara, &revocationStatus); + + if (!ret && revocationStatus.dwError == CRYPT_E_NO_REVOCATION_CHECK && + revocationPara.pIssuerCert == certToCheck) + { + FIXME("Unable to find CRL for CA certificate\n"); + ret = TRUE; + revocationStatus.dwError = 0; + } + if (!ret) { PCERT_CHAIN_ELEMENT element = CRYPT_FindIthElementInChain( Modified: trunk/reactos/dll/win32/crypt32/crypt32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32.…
============================================================================== --- trunk/reactos/dll/win32/crypt32/crypt32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/crypt32.spec [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -78,6 +78,7 @@ @ stdcall CertRDNValueToStrA(long ptr ptr long) @ stdcall CertRDNValueToStrW(long ptr ptr long) @ stdcall CertRegisterPhysicalStore(ptr long wstr ptr ptr) +@ stdcall CertRegisterSystemStore(ptr long ptr ptr) @ stdcall CertRemoveEnhancedKeyUsageIdentifier(ptr str) @ stdcall CertRemoveStoreFromCollection(ptr ptr) @ stdcall CertSaveStore(ptr long long long ptr long) @@ -190,6 +191,7 @@ @ stdcall CryptUnprotectMemory(ptr long long) @ stdcall CryptUnregisterDefaultOIDFunction(long str wstr) @ stdcall CryptUnregisterOIDFunction(long str str) +@ stdcall CertUnregisterSystemStore(ptr long) @ stub CryptUnregisterOIDInfo @ stdcall CryptVerifyCertificateSignature(long long ptr long ptr) @ stdcall CryptVerifyCertificateSignatureEx(long long long ptr long ptr long ptr) Modified: trunk/reactos/dll/win32/crypt32/crypt32_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32_…
============================================================================== --- trunk/reactos/dll/win32/crypt32/crypt32_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/crypt32_private.h [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -365,7 +365,11 @@ DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; -WINECRYPT_CERTSTORE *CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags) DECLSPEC_HIDDEN; + +void CRYPT_ImportSystemRootCertsToReg(void) DECLSPEC_HIDDEN; +BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface, + HCERTSTORE memStore) DECLSPEC_HIDDEN; + BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) DECLSPEC_HIDDEN; /* Allocates and initializes a certificate chain engine, but without creating Modified: trunk/reactos/dll/win32/crypt32/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -40,7 +40,6 @@ if (pvReserved) break; crypt_oid_free(); crypt_sip_free(); - root_store_free(); default_chain_engine_free(); if (hDefProv) CryptReleaseContext(hDefProv, 0); break; Modified: trunk/reactos/dll/win32/crypt32/regstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/regstore…
============================================================================== --- trunk/reactos/dll/win32/crypt32/regstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/regstore.c [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -174,7 +174,7 @@ } /* Hash is assumed to be 20 bytes in length (a SHA-1 hash) */ -static BOOL CRYPT_WriteSerializedToReg(HKEY key, const BYTE *hash, const BYTE *buf, +static BOOL CRYPT_WriteSerializedToReg(HKEY key, DWORD flags, const BYTE *hash, const BYTE *buf, DWORD len) { WCHAR asciiHash[20 * 2 + 1]; @@ -183,7 +183,7 @@ BOOL ret; CRYPT_HashToStr(hash, asciiHash); - rc = RegCreateKeyExW(key, asciiHash, 0, NULL, 0, KEY_ALL_ACCESS, NULL, + rc = RegCreateKeyExW(key, asciiHash, 0, NULL, flags, KEY_ALL_ACCESS, NULL, &subKey, NULL); if (!rc) { @@ -200,7 +200,7 @@ return ret; } -static BOOL CRYPT_SerializeContextsToReg(HKEY key, +BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface, HCERTSTORE memStore) { const void *context = NULL; @@ -227,7 +227,7 @@ { ret = contextInterface->serialize(context, 0, buf, &size); if (ret) - ret = CRYPT_WriteSerializedToReg(key, hash, buf, size); + ret = CRYPT_WriteSerializedToReg(key, flags, hash, buf, size); } CryptMemFree(buf); } @@ -282,8 +282,7 @@ } LeaveCriticalSection(&store->cs); } - ret = CRYPT_SerializeContextsToReg(key, interfaces[i], - store->memStore); + ret = CRYPT_SerializeContextsToReg(key, 0, interfaces[i], store->memStore); RegCloseKey(key); } else Modified: trunk/reactos/dll/win32/crypt32/rootstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/rootstor…
============================================================================== --- trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -427,53 +427,6 @@ } return ret; } - -static BOOL WINAPI CRYPT_RootWriteCert(HCERTSTORE hCertStore, - PCCERT_CONTEXT cert, DWORD dwFlags) -{ - /* The root store can't have certs added */ - return FALSE; -} - -static BOOL WINAPI CRYPT_RootDeleteCert(HCERTSTORE hCertStore, - PCCERT_CONTEXT cert, DWORD dwFlags) -{ - /* The root store can't have certs deleted */ - return FALSE; -} - -static BOOL WINAPI CRYPT_RootWriteCRL(HCERTSTORE hCertStore, - PCCRL_CONTEXT crl, DWORD dwFlags) -{ - /* The root store can have CRLs added. At worst, a malicious application - * can DoS itself, as the changes aren't persisted in any way. - */ - return TRUE; -} - -static BOOL WINAPI CRYPT_RootDeleteCRL(HCERTSTORE hCertStore, - PCCRL_CONTEXT crl, DWORD dwFlags) -{ - /* The root store can't have CRLs deleted */ - return FALSE; -} - -static void *rootProvFuncs[] = { - NULL, /* CERT_STORE_PROV_CLOSE_FUNC */ - NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ - CRYPT_RootWriteCert, - CRYPT_RootDeleteCert, - NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ - NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ - CRYPT_RootWriteCRL, - CRYPT_RootDeleteCRL, - NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ - NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ - NULL, /* CERT_STORE_PROV_WRITE_CTL_FUNC */ - NULL, /* CERT_STORE_PROV_DELETE_CTL_FUNC */ - NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */ - NULL, /* CERT_STORE_PROV_CONTROL_FUNC */ -}; static const char * const CRYPT_knownLocations[] = { "/etc/ssl/certs/ca-certificates.crt", @@ -783,68 +736,65 @@ static HCERTSTORE create_root_store(void) { - HCERTSTORE root = NULL; HCERTSTORE memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); if (memStore) { - CERT_STORE_PROV_INFO provInfo = { - sizeof(CERT_STORE_PROV_INFO), - sizeof(rootProvFuncs) / sizeof(rootProvFuncs[0]), - rootProvFuncs, - NULL, - 0, - NULL - }; - read_trusted_roots_from_known_locations(memStore); add_ms_root_certs(memStore); - root = CRYPT_ProvCreateStore(0, memStore, &provInfo); -#ifdef __REACTOS__ - { - HCERTSTORE regStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"AuthRoot"); - if (regStore) + } + + TRACE("returning %p\n", memStore); + return memStore; +} + +static const WCHAR certs_root_pathW[] = + {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', + 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\', + 'R','o','o','t','\\', 'C','e','r','t','i','f','i','c','a','t','e','s', 0}; +static const WCHAR semaphoreW[] = + {'c','r','y','p','t','3','2','_','r','o','o','t','_','s','e','m','a','p','h','o','r','e',0}; + +void CRYPT_ImportSystemRootCertsToReg(void) +{ + HCERTSTORE store = NULL; + HKEY key; + LONG rc; + HANDLE hsem; + + static BOOL root_certs_imported = FALSE; + + if (root_certs_imported) + return; + + hsem = CreateSemaphoreW( NULL, 0, 1, semaphoreW); + if (!hsem) + { + ERR("Failed to create semaphore\n"); + return; + } + + if(GetLastError() == ERROR_ALREADY_EXISTS) + WaitForSingleObject(hsem, INFINITE); + else + { + if ((store = create_root_store())) + { + rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, certs_root_pathW, 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &key, 0); + if (!rc) { - HCERTSTORE collStore = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, - CERT_STORE_CREATE_NEW_FLAG, NULL); - CertAddStoreToCollection(collStore, regStore, 0, 0); - CertAddStoreToCollection(collStore, root, 0, 0); - root = collStore; + if (!CRYPT_SerializeContextsToReg(key, REG_OPTION_VOLATILE, pCertInterface, store)) + ERR("Failed to import system certs into registry, %08x\n", GetLastError()); + RegCloseKey(key); } - } -#endif - } - TRACE("returning %p\n", root); - return root; -} - -static WINECRYPT_CERTSTORE *CRYPT_rootStore; - -WINECRYPT_CERTSTORE *CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags) -{ - TRACE("(%ld, %08x)\n", hCryptProv, dwFlags); - - if (dwFlags & CERT_STORE_DELETE_FLAG) - { - WARN("root store can't be deleted\n"); - SetLastError(ERROR_ACCESS_DENIED); - return NULL; - } - if (!CRYPT_rootStore) - { - HCERTSTORE root = create_root_store(); - - InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root, - NULL); - if (CRYPT_rootStore != root) - CertCloseStore(root, 0); - } - CRYPT_rootStore->vtbl->addref(CRYPT_rootStore); - return CRYPT_rootStore; -} - -void root_store_free(void) -{ - CertCloseStore(CRYPT_rootStore, 0); -} + CertCloseStore(store, 0); + } else + ERR("Failed to create root store\n"); + } + + root_certs_imported = TRUE; + ReleaseSemaphore(hsem, 1, NULL); + CloseHandle(hsem); +} Modified: trunk/reactos/dll/win32/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/store.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -411,21 +411,15 @@ SetLastError(E_INVALIDARG); return NULL; } - /* FIXME: In Windows, the root store (even the current user location) is - * protected: adding to it or removing from it present a user interface, - * and the keys are owned by the system process, not the current user. - * Wine's registry doesn't implement access controls, so a similar - * mechanism isn't possible yet. - */ - if ((dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK) == - CERT_SYSTEM_STORE_LOCAL_MACHINE && !lstrcmpiW(storeName, rootW)) - return CRYPT_RootOpenStore(hCryptProv, dwFlags); switch (dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK) { case CERT_SYSTEM_STORE_LOCAL_MACHINE: root = HKEY_LOCAL_MACHINE; base = CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH; + /* If the HKLM\Root certs are requested, expressing system certs into the registry */ + if (!lstrcmpiW(storeName, rootW)) + CRYPT_ImportSystemRootCertsToReg(); break; case CERT_SYSTEM_STORE_CURRENT_USER: root = HKEY_CURRENT_USER; @@ -1377,6 +1371,51 @@ return FALSE; } +BOOL WINAPI CertRegisterSystemStore(const void *pvSystemStore, DWORD dwFlags, + PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved) +{ + HCERTSTORE hstore; + + if (dwFlags & CERT_SYSTEM_STORE_RELOCATE_FLAG ) + { + FIXME("(%p, %08x, %p, %p): flag not supported\n", pvSystemStore, dwFlags, pStoreInfo, pvReserved); + return FALSE; + } + + TRACE("(%s, %08x, %p, %p)\n", debugstr_w(pvSystemStore), dwFlags, pStoreInfo, pvReserved); + + hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags, pvSystemStore); + if (hstore) + { + CertCloseStore(hstore, 0); + return TRUE; + } + + return FALSE; +} + +BOOL WINAPI CertUnregisterSystemStore(void *pvSystemStore, DWORD dwFlags) +{ + HCERTSTORE hstore; + + if (dwFlags & CERT_SYSTEM_STORE_RELOCATE_FLAG) + { + FIXME("(%p, %08x): flag not supported\n", pvSystemStore, dwFlags); + return FALSE; + } + TRACE("(%s, %08x)\n", debugstr_w(pvSystemStore), dwFlags); + + hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags | CERT_STORE_OPEN_EXISTING_FLAG, pvSystemStore); + if (hstore == NULL) + return FALSE; + + hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags | CERT_STORE_DELETE_FLAG, pvSystemStore); + if (hstore == NULL && GetLastError() == 0) + return TRUE; + + return FALSE; +} + static void EmptyStore_addref(WINECRYPT_CERTSTORE *store) { TRACE("(%p)\n", store); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 22 17:05:59 2016 @@ -58,7 +58,7 @@ reactos/dll/win32/comdlg32 # Synced to WineStaging-1.9.23 reactos/dll/win32/compstui # Synced to WineStaging-1.9.11 reactos/dll/win32/credui # Synced to WineStaging-1.9.16 -reactos/dll/win32/crypt32 # Synced to WineStaging-1.9.16 +reactos/dll/win32/crypt32 # Synced to WineStaging-1.9.23 reactos/dll/win32/cryptdlg # Synced to WineStaging-1.9.11 reactos/dll/win32/cryptdll # Synced to WineStaging-1.9.11 reactos/dll/win32/cryptnet # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73345: [OLEDLG] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 13:14:51 2016 New Revision: 73345 URL:
http://svn.reactos.org/svn/reactos?rev=73345&view=rev
Log: [OLEDLG] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/insobjdlg…
============================================================================== --- trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] Tue Nov 22 13:14:51 2016 @@ -468,7 +468,7 @@ WideCharToMultiByte(CP_ACP, 0, wcsFile, -1, pdlgInfo->lpOleUIInsertObject->lpszFile, pdlgInfo->lpOleUIInsertObject->cchFile, NULL, NULL); - if (ERROR_SUCCESS == (hres = GetClassFile(wcsFile, &pdlgInfo->lpOleUIInsertObject->clsid))) + if (SUCCEEDED(hres = GetClassFile(wcsFile, &pdlgInfo->lpOleUIInsertObject->clsid))) { if (pdlgInfo->lpOleUIInsertObject->dwFlags & IOF_CREATEFILEOBJECT) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 22 13:14:51 2016 @@ -143,7 +143,7 @@ reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.23 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/oledlg # Synced to WineStaging-1.9.11 +reactos/dll/win32/oledlg # Synced to WineStaging-1.9.23 reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olesvr32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olethk32 # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73344: [RPCRT4_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 13:13:22 2016 New Revision: 73344 URL:
http://svn.reactos.org/svn/reactos?rev=73344&view=rev
Log: [RPCRT4_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/rpcrt4/CMakeLists.txt trunk/rostests/winetests/rpcrt4/cstub.c trunk/rostests/winetests/rpcrt4/ndr_marshall.c trunk/rostests/winetests/rpcrt4/rpc.c trunk/rostests/winetests/rpcrt4/server.c Modified: trunk/rostests/winetests/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/CMakeLis…
============================================================================== --- trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] Tue Nov 22 13:13:22 2016 @@ -28,7 +28,7 @@ add_executable(rpcrt4_winetest ${SOURCE}) target_link_libraries(rpcrt4_winetest uuid wine ${PSEH_LIB}) set_module_type(rpcrt4_winetest win32cui) -add_importlibs(rpcrt4_winetest ole32 rpcrt4 msvcrt kernel32 ntdll) +add_importlibs(rpcrt4_winetest ole32 rpcrt4 secur32 msvcrt kernel32 ntdll) add_cd_file(TARGET rpcrt4_winetest DESTINATION reactos/bin FOR all) if(NOT MSVC) Modified: trunk/rostests/winetests/rpcrt4/cstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/cstub.c?…
============================================================================== --- trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] Tue Nov 22 13:13:22 2016 @@ -44,6 +44,7 @@ static GUID IID_if2 = {0x12345679, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}; static GUID IID_if3 = {0x1234567a, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}; static GUID IID_if4 = {0x1234567b, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}; +static CLSID CLSID_psfact = {0x1234567c, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}; static int my_alloc_called; static int my_free_called; @@ -458,7 +459,6 @@ IPSFactoryBuffer *ppsf = NULL; const PCInterfaceProxyVtblList* proxy_vtbl; const PCInterfaceStubVtblList* stub_vtbl; - const CLSID PSDispatch = {0x20420, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}}; const CLSID CLSID_Unknown = {0x45678, 0x1234, 0x6666, {0xff, 0x67, 0x45, 0x98, 0x76, 0x12, 0x34, 0x56}}; static const GUID * const interfaces[] = { &IID_if1, &IID_if2, &IID_if3, &IID_if4 }; UINT i; @@ -475,13 +475,13 @@ void *CStd_DebugServerQueryInterface = GetProcAddress(hmod, "CStdStubBuffer_DebugServerQueryInterface"); void *CStd_DebugServerRelease = GetProcAddress(hmod, "CStdStubBuffer_DebugServerRelease"); - r = NdrDllGetClassObject(&PSDispatch, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, - &CLSID_Unknown, &PSFactoryBuffer); + r = NdrDllGetClassObject(&CLSID_Unknown, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, + &CLSID_psfact, &PSFactoryBuffer); ok(r == CLASS_E_CLASSNOTAVAILABLE, "NdrDllGetClassObject with unknown clsid should have returned CLASS_E_CLASSNOTAVAILABLE instead of 0x%x\n", r); ok(ppsf == NULL, "NdrDllGetClassObject should have set ppsf to NULL on failure\n"); - r = NdrDllGetClassObject(&PSDispatch, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, - &PSDispatch, &PSFactoryBuffer); + r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, + &CLSID_psfact, &PSFactoryBuffer); ok(r == S_OK, "ret %08x\n", r); ok(ppsf != NULL, "ppsf == NULL\n"); @@ -603,10 +603,42 @@ ok(PSFactoryBuffer.RefCount == 1, "ref count %d\n", PSFactoryBuffer.RefCount); IPSFactoryBuffer_Release(ppsf); + /* One can also search by IID */ + r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, + &CLSID_psfact, &PSFactoryBuffer); + ok(r == S_OK, "ret %08x\n", r); + ok(ppsf != NULL, "ppsf == NULL\n"); + IPSFactoryBuffer_Release(ppsf); + r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, NULL, &PSFactoryBuffer); ok(r == S_OK, "ret %08x\n", r); ok(ppsf != NULL, "ppsf == NULL\n"); + IPSFactoryBuffer_Release(ppsf); + + /* but only if the PS factory implements it */ + r = NdrDllGetClassObject(&IID_IDispatch, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, + &CLSID_psfact, &PSFactoryBuffer); + ok(r == CLASS_E_CLASSNOTAVAILABLE, "ret %08x\n", r); + + /* Create it again to return */ + r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list, + &CLSID_psfact, &PSFactoryBuffer); + ok(r == S_OK, "ret %08x\n", r); + ok(ppsf != NULL, "ppsf == NULL\n"); + + /* Because this PS factory is not loaded as a dll in the normal way, Windows 8 / 10 + get confused and will crash when one of the proxies for the delegated ifaces is created. + Registering the ifaces fixes this (in fact calling CoRegisterPSClsid() with any IID / CLSID is enough). */ + + r = CoRegisterPSClsid(&IID_if1, &CLSID_psfact); + ok(r == S_OK, "ret %08x\n", r); + r = CoRegisterPSClsid(&IID_if2, &CLSID_psfact); + ok(r == S_OK, "ret %08x\n", r); + r = CoRegisterPSClsid(&IID_if3, &CLSID_psfact); + ok(r == S_OK, "ret %08x\n", r); + r = CoRegisterPSClsid(&IID_if4, &CLSID_psfact); + ok(r == S_OK, "ret %08x\n", r); return ppsf; } Modified: trunk/rostests/winetests/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/ndr_mars…
============================================================================== --- trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] Tue Nov 22 13:13:22 2016 @@ -2433,11 +2433,9 @@ status = MesEncodeFixedBufferHandleCreate(buffer, 0, &encoded_size, &handle); todo_wine ok(status == RPC_S_INVALID_ARG, "got %d\n", status); -if (status == RPC_S_OK) -{ +if (status == RPC_S_OK) { MesHandleFree(handle); } - status = MesEncodeFixedBufferHandleCreate(buffer, 32, NULL, &handle); ok(status == RPC_S_INVALID_ARG, "got %d\n", status); Modified: trunk/rostests/winetests/rpcrt4/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/rpc.c?re…
============================================================================== --- trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] Tue Nov 22 13:13:22 2016 @@ -429,13 +429,10 @@ RPC_STATUS rpc_status; BOOL w2k3_up = FALSE; - /* Windows 2003 and Vista return STATUS_UNSUCCESSFUL if given an unknown status */ + /* Windows 2003 and above return STATUS_UNSUCCESSFUL if given an unknown status */ win32status = I_RpcMapWin32Status(9999); if (win32status == STATUS_UNSUCCESSFUL) - { - trace("We are on Windows 2003 or Vista\n"); w2k3_up = TRUE; - } /* On Windows XP-SP1 and below some statuses are not mapped and return * the given status @@ -810,7 +807,7 @@ /* If the call succeeded, there's a valid (non-multicast) MAC * address in the uuid: */ - ok(!(guid1.Data4[2] & 0x01), + ok(!(guid1.Data4[2] & 0x01) || broken(guid1.Data4[2] & 0x01), /* Win 8.1 */ "GUID does not appear to contain a MAC address: %s\n", wine_dbgstr_guid(&guid1)); } @@ -860,19 +857,12 @@ { RPC_STATUS ret; RPC_CSTR principal, saved_principal; - BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT,LPSTR,PULONG); char *username; ULONG len = 0; - pGetUserNameExA = (void *)GetProcAddress( LoadLibraryA("secur32.dll"), "GetUserNameExA" ); - if (!pGetUserNameExA) - { - win_skip( "GetUserNameExA not exported\n" ); - return; - } - pGetUserNameExA( NameSamCompatible, NULL, &len ); + GetUserNameExA( NameSamCompatible, NULL, &len ); username = HeapAlloc( GetProcessHeap(), 0, len ); - pGetUserNameExA( NameSamCompatible, username, &len ); + GetUserNameExA( NameSamCompatible, username, &len ); ret = RpcServerInqDefaultPrincNameA( 0, NULL ); ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %u\n", ret ); Modified: trunk/rostests/winetests/rpcrt4/server.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/server.c…
============================================================================== --- trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] Tue Nov 22 13:13:22 2016 @@ -43,7 +43,6 @@ static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE, void*, ULONG, void*, ULONG); static RPC_STATUS (WINAPI *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*, RPC_MGR_EPV*, unsigned int, unsigned int,RPC_IF_CALLBACK_FN*); -static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG); static RPC_STATUS (WINAPI *pRpcBindingSetAuthInfoExA)(RPC_BINDING_HANDLE, RPC_CSTR, ULONG, ULONG, RPC_AUTH_IDENTITY_HANDLE, ULONG, RPC_SECURITY_QOS *); static RPC_STATUS (WINAPI *pRpcServerRegisterAuthInfoA)(RPC_CSTR, ULONG, RPC_AUTH_KEY_RETRIEVAL_FN, LPVOID); @@ -59,14 +58,12 @@ static void InitFunctionPointers(void) { HMODULE hrpcrt4 = GetModuleHandleA("rpcrt4.dll"); - HMODULE hsecur32 = LoadLibraryA("secur32.dll"); pNDRSContextMarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextMarshall2"); pNDRSContextUnmarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextUnmarshall2"); pRpcServerRegisterIfEx = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterIfEx"); pRpcBindingSetAuthInfoExA = (void *)GetProcAddress(hrpcrt4, "RpcBindingSetAuthInfoExA"); pRpcServerRegisterAuthInfoA = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterAuthInfoA"); - pGetUserNameExA = (void *)GetProcAddress(hsecur32, "GetUserNameExA"); if (!pNDRSContextMarshall2) old_windows_version = TRUE; } @@ -1019,8 +1016,11 @@ if (!old_windows_version) { + re = 0xdeadbeef; get_ranged_enum(&re); - ok(re == RE3, "get_ranged_enum() returned %d instead of RE3\n", re); + ok(re == RE3 || + broken(re == MAKELONG(re, 0xdead)), /* Win 8, Win 10 */ + "get_ranged_enum() returned %x instead of RE3\n", re); } } @@ -1510,7 +1510,7 @@ todo_wine ok(principal != NULL, "NULL principal\n"); } - if (protseq == RPC_PROTSEQ_LRPC && principal && pGetUserNameExA) + if (protseq == RPC_PROTSEQ_LRPC && principal) { int len; char *spn; @@ -1558,9 +1558,6 @@ RPC_STATUS status; RPC_SECURITY_QOS qos; - if (!pGetUserNameExA) - return; - qos.Version = 1; qos.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH; qos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC; @@ -1719,11 +1716,9 @@ if (ncalrpc_status == RPC_S_OK) { run_client("ncalrpc_basic"); - if (pGetUserNameExA) - { - /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */ - run_client("ncalrpc_secure"); - } + + /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */ + run_client("ncalrpc_secure"); } else skip("lrpc tests skipped due to earlier failure\n"); @@ -1752,20 +1747,15 @@ START_TEST(server) { + ULONG size = 0; int argc; char **argv; InitFunctionPointers(); - if (pGetUserNameExA) - { - ULONG size = 0; - ok(!pGetUserNameExA(NameSamCompatible, NULL, &size), "GetUserNameExA\n"); - domain_and_user = HeapAlloc(GetProcessHeap(), 0, size); - ok(pGetUserNameExA(NameSamCompatible, domain_and_user, &size), "GetUserNameExA\n"); - } - else - win_skip("GetUserNameExA is needed for some authentication tests\n"); + ok(!GetUserNameExA(NameSamCompatible, NULL, &size), "GetUserNameExA\n"); + domain_and_user = HeapAlloc(GetProcessHeap(), 0, size); + ok(GetUserNameExA(NameSamCompatible, domain_and_user, &size), "GetUserNameExA\n"); argc = winetest_get_mainargs(&argv); progname = argv[0];
8 years, 1 month
1
0
0
0
[akhaldi] 73343: [RPCRT4] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 13:11:44 2016 New Revision: 73343 URL:
http://svn.reactos.org/svn/reactos?rev=73343&view=rev
Log: [RPCRT4] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c trunk/reactos/dll/win32/rpcrt4/rpc_server.c trunk/reactos/dll/win32/rpcrt4/rpc_transport.c trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -52,6 +52,6 @@ set_module_type(rpcrt4 win32dll) target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB}) add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32) -add_importlibs(rpcrt4 advapi32 advapi32_vista ws2_32 msvcrt kernel32 ntdll) +add_importlibs(rpcrt4 advapi32 advapi32_vista kernel32_vista ws2_32 msvcrt kernel32 ntdll) add_pch(rpcrt4 precomp.h SOURCE) add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_epmap…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_epmap.c [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -21,6 +21,9 @@ */ #include "precomp.h" + +#include <winsvc.h> + #include "epm_towers.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -65,32 +68,52 @@ static BOOL start_rpcss(void) { - PROCESS_INFORMATION pi; - STARTUPINFOW si; - WCHAR cmd[MAX_PATH]; - static const WCHAR rpcss[] = {'\\','r','p','c','s','s','.','e','x','e',0}; - BOOL rslt; - void *redir; + static const WCHAR rpcssW[] = {'R','p','c','S','s',0}; + SC_HANDLE scm, service; + SERVICE_STATUS_PROCESS status; + BOOL ret = FALSE; TRACE("\n"); - ZeroMemory(&si, sizeof(STARTUPINFOA)); - si.cb = sizeof(STARTUPINFOA); - GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) ); - lstrcatW( cmd, rpcss ); - - Wow64DisableWow64FsRedirection( &redir ); - rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ); - Wow64RevertWow64FsRedirection( redir ); - - if (rslt) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - Sleep(100); - } - - return rslt; + if (!(scm = OpenSCManagerW( NULL, NULL, 0 ))) + { + ERR( "failed to open service manager\n" ); + return FALSE; + } + if (!(service = OpenServiceW( scm, rpcssW, SERVICE_START | SERVICE_QUERY_STATUS ))) + { + ERR( "failed to open RpcSs service\n" ); + CloseServiceHandle( scm ); + return FALSE; + } + if (StartServiceW( service, 0, NULL ) || GetLastError() == ERROR_SERVICE_ALREADY_RUNNING) + { + ULONGLONG start_time = GetTickCount64(); + do + { + DWORD dummy; + + if (!QueryServiceStatusEx( service, SC_STATUS_PROCESS_INFO, + (BYTE *)&status, sizeof(status), &dummy )) + break; + if (status.dwCurrentState == SERVICE_RUNNING) + { + ret = TRUE; + break; + } + if (GetTickCount64() - start_time > 30000) break; + Sleep( 100 ); + + } while (status.dwCurrentState == SERVICE_START_PENDING); + + if (status.dwCurrentState != SERVICE_RUNNING) + WARN( "RpcSs failed to start %u\n", status.dwCurrentState ); + } + else ERR( "failed to start RpcSs service\n" ); + + CloseServiceHandle( service ); + CloseServiceHandle( scm ); + return ret; } static inline BOOL is_epm_destination_local(RPC_BINDING_HANDLE handle) Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -1427,13 +1427,11 @@ max_token = package->cbMaxToken; FreeContextBuffer(packages); - auth_info = HeapAlloc(GetProcessHeap(), 0, sizeof(*auth_info)); + auth_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*auth_info)); if (!auth_info) return RPC_S_OUT_OF_RESOURCES; - if (!ServerPrincName) { - auth_info->principal = NULL; - }else if (!(auth_info->principal = RPCRT4_strdupW(ServerPrincName))) { + if (ServerPrincName && !(auth_info->principal = RPCRT4_strdupW(ServerPrincName))) { HeapFree(GetProcessHeap(), 0, auth_info); return RPC_S_OUT_OF_RESOURCES; } Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -260,7 +260,6 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; RPC_STATUS r; LPSTR pname; @@ -268,10 +267,7 @@ if (npc->pipe) return RPC_S_OK; - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncalrpc_pipe_name(Connection->Endpoint); r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); I_RpcFree(pname); @@ -280,7 +276,6 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) { - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; RPC_STATUS r; LPSTR pname; RpcConnection *Connection; @@ -301,10 +296,7 @@ if (r != RPC_S_OK) return r; - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncalrpc_pipe_name(Connection->Endpoint); r = rpcrt4_conn_create_pipe(Connection, pname); I_RpcFree(pname); @@ -395,7 +387,6 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) { - static const char prefix[] = "\\\\."; RPC_STATUS r; LPSTR pname; RpcConnection *Connection; @@ -416,9 +407,7 @@ if (r != RPC_S_OK) return r; - /* protseq=ncacn_np: named pipes */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncacn_pipe_name(Connection->Endpoint); r = rpcrt4_conn_create_pipe(Connection, pname); I_RpcFree(pname); @@ -447,12 +436,10 @@ DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; LPSTR pname; - static const char prefix[] = "\\\\."; rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); + pname = ncacn_pipe_name(old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); @@ -500,14 +487,12 @@ DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; LPSTR pname; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; TRACE("%s\n", old_conn->Endpoint); rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); + pname = ncalrpc_pipe_name(old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4_ro…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -1,5 +1,5 @@ -diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/cproxy.c e:\reactos\dll\win32\rpcrt4/cproxy.c ---- e:\wine\dlls\rpcrt4/cproxy.c 2016-05-31 18:02:22 +0100 +diff -pudN e:\wine\dlls\rpcrt4/cproxy.c e:\reactos\dll\win32\rpcrt4/cproxy.c +--- e:\wine\dlls\rpcrt4/cproxy.c 2016-11-16 17:29:34 +0100 +++ e:\reactos\dll\win32\rpcrt4/cproxy.c 2015-08-27 22:03:34 +0100 @@ -150,6 +150,30 @@ static inline void init_thunk( struct th thunk->call_stubless = call_stubless_func; @@ -32,8 +32,8 @@ #else /* __i386__ */ #warning You must implement stubless proxies for your CPU -diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/cstub.c e:\reactos\dll\win32\rpcrt4/cstub.c ---- e:\wine\dlls\rpcrt4/cstub.c 2016-05-31 18:02:22 +0100 +diff -pudN e:\wine\dlls\rpcrt4/cstub.c e:\reactos\dll\win32\rpcrt4/cstub.c +--- e:\wine\dlls\rpcrt4/cstub.c 2016-11-16 17:29:34 +0100 +++ e:\reactos\dll\win32\rpcrt4/cstub.c 2016-05-20 23:26:31 +0100 @@ -156,6 +156,13 @@ typedef struct @@ -49,10 +49,11 @@ #else #warning You must implement delegated proxies/stubs for your CPU -diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/rpc_epmap.c e:\reactos\dll\win32\rpcrt4/rpc_epmap.c ---- e:\wine\dlls\rpcrt4/rpc_epmap.c 2016-05-31 18:02:22 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpc_epmap.c 2015-11-16 22:55:50 +0100 -@@ -150,7 +150,7 @@ static RPC_STATUS get_epm_handle_server( + +diff -pudN e:\wine\dlls\rpcrt4/rpc_epmap.c e:\reactos\dll\win32\rpcrt4/rpc_epmap.c +--- e:\wine\dlls\rpcrt4/rpc_epmap.c 2016-11-16 17:29:34 +0100 ++++ e:\reactos\dll\win32\rpcrt4/rpc_epmap.c 2016-11-17 12:09:06 +0100 +@@ -171,7 +173,7 @@ static RPC_STATUS get_epm_handle_server( static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr) { @@ -61,10 +62,10 @@ { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ILLEGAL_INSTRUCTION: -diff -pudN --strip-trailing-cr e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_transport.c ---- e:\wine\dlls\rpcrt4/rpc_transport.c 2016-05-31 18:02:23 +0100 -+++ e:\reactos\dll\win32\rpcrt4/rpc_transport.c 2015-11-16 22:55:50 +0100 -@@ -79,6 +79,7 @@ +diff -pudN e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_transport.c +--- e:\wine\dlls\rpcrt4/rpc_transport.c 2016-11-16 17:33:13 +0100 ++++ e:\reactos\dll\win32\rpcrt4/rpc_transport.c 2016-11-17 00:00:46 +0100 +@@ -82,6 +79,7 @@ #define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000) @@ -72,7 +73,7 @@ #define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0])) WINE_DEFAULT_DEBUG_CHANNEL(rpc); -@@ -91,31 +92,41 @@ typedef struct _RpcConnection_np +@@ -94,31 +92,41 @@ typedef struct _RpcConnection_np { RpcConnection common; HANDLE pipe; @@ -121,7 +122,7 @@ case ERROR_NO_DATA_DETECTED: /* client has disconnected, retry */ DisconnectNamedPipe( npc->pipe ); -@@ -128,6 +139,7 @@ static DWORD CALLBACK listen_thread(void +@@ -131,6 +139,7 @@ static DWORD CALLBACK listen_thread(void } } @@ -129,7 +130,7 @@ static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) { if (npc->listening) -@@ -143,13 +155,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip +@@ -146,13 +155,14 @@ static RPC_STATUS rpcrt4_conn_listen_pip } return RPC_S_OK; } @@ -145,7 +146,7 @@ PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); -@@ -161,6 +174,9 @@ static RPC_STATUS rpcrt4_conn_create_pip +@@ -164,6 +174,9 @@ static RPC_STATUS rpcrt4_conn_create_pip return RPC_S_CANT_CREATE_ENDPOINT; } @@ -155,7 +156,7 @@ /* Note: we don't call ConnectNamedPipe here because it must be done in the * server thread as the thread must be alertable */ return RPC_S_OK; -@@ -207,6 +223,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -210,6 +223,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe( if (err == ERROR_PIPE_BUSY) { TRACE("connection failed, error=%x\n", err); return RPC_S_SERVER_TOO_BUSY; @@ -165,7 +166,7 @@ } if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { err = GetLastError(); -@@ -216,9 +235,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( +@@ -219,9 +235,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe( } /* success */ @@ -177,47 +178,7 @@ npc->pipe = pipe; return RPC_S_OK; -@@ -239,6 +260,7 @@ static char *ncalrpc_pipe_name(const cha - static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) - { - RpcConnection_np *npc = (RpcConnection_np *) Connection; -+ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - RPC_STATUS r; - LPSTR pname; - -@@ -246,7 +268,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(Rp - if (npc->pipe) - return RPC_S_OK; - -- pname = ncalrpc_pipe_name(Connection->Endpoint); -+ /* protseq=ncalrpc: supposed to use NT LPC ports, -+ * but we'll implement it with named pipes for now */ -+ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); -+ strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); - I_RpcFree(pname); - -@@ -255,6 +280,7 @@ static RPC_STATUS rpcrt4_ncalrpc_open(Rp - - static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) - { -+ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - RPC_STATUS r; - LPSTR pname; - RpcConnection *Connection; -@@ -275,7 +301,10 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc - if (r != RPC_S_OK) - return r; - -- pname = ncalrpc_pipe_name(Connection->Endpoint); -+ /* protseq=ncalrpc: supposed to use NT LPC ports, -+ * but we'll implement it with named pipes for now */ -+ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); -+ strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); - -@@ -301,15 +330,64 @@ static char *ncacn_pipe_name(const char +@@ -304,15 +322,64 @@ static char *ncacn_pipe_name(const char static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; @@ -284,26 +245,7 @@ I_RpcFree(pname); return r; -@@ -317,6 +395,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(R - - static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) - { -+ static const char prefix[] = "\\\\."; - RPC_STATUS r; - LPSTR pname; - RpcConnection *Connection; -@@ -337,7 +416,9 @@ static RPC_STATUS rpcrt4_protseq_ncacn_n - if (r != RPC_S_OK) - return r; - -- pname = ncacn_pipe_name(Connection->Endpoint); -+ /* protseq=ncacn_np: named pipes */ -+ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); -+ strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); - -@@ -355,9 +436,9 @@ static void rpcrt4_conn_np_handoff(RpcCo +@@ -358,9 +425,9 @@ static void rpcrt4_conn_np_handoff(RpcCo * to the child, then reopen the server binding to continue listening */ new_npc->pipe = old_npc->pipe; @@ -315,41 +257,15 @@ old_npc->listening = FALSE; } -@@ -365,10 +446,12 @@ static RPC_STATUS rpcrt4_ncacn_np_handof - { - RPC_STATUS status; - LPSTR pname; -+ static const char prefix[] = "\\\\."; - - rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - -- pname = ncacn_pipe_name(old_conn->Endpoint); -+ pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); -+ strcat(strcpy(pname, prefix), old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); - -@@ -406,12 +489,14 @@ static RPC_STATUS rpcrt4_ncalrpc_handoff - { - RPC_STATUS status; - LPSTR pname; -+ static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - - TRACE("%s\n", old_conn->Endpoint); - - rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - -- pname = ncalrpc_pipe_name(old_conn->Endpoint); -+ pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); -+ strcat(strcpy(pname, prefix), old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); - -@@ -425,12 +510,17 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -444,20 +511,29 @@ static int rpcrt4_conn_np_read(RpcConnec + void *buffer, unsigned int count) + { + RpcConnection_np *npc = (RpcConnection_np *) Connection; +- IO_STATUS_BLOCK io_status; char *buf = buffer; - BOOL ret = TRUE; ++ BOOL ret = TRUE; unsigned int bytes_left = count; -- DWORD err = GetLastError(); +- NTSTATUS status; + OVERLAPPED ovl; + + ZeroMemory(&ovl, sizeof(ovl)); @@ -357,24 +273,29 @@ while (bytes_left) { - DWORD bytes_read; -- ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL); +- status = NtReadFile(npc->pipe, NULL, NULL, NULL, &io_status, buf, bytes_left, NULL, NULL); +- if (status && status != STATUS_BUFFER_OVERFLOW) +- return -1; +- bytes_left -= io_status.Information; +- buf += io_status.Information; ++ DWORD bytes_read; + ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, &ovl); + if (!ret && GetLastError() == ERROR_IO_PENDING) + ret = GetOverlappedResult(npc->pipe, &ovl, &bytes_read, TRUE); - if (!ret && GetLastError() == ERROR_MORE_DATA) - ret = TRUE; - if (!ret || !bytes_read) -@@ -438,7 +528,7 @@ static int rpcrt4_conn_np_read(RpcConnec - bytes_left -= bytes_read; - buf += bytes_read; - } -- if (ret) SetLastError(err); ++ if (!ret && GetLastError() == ERROR_MORE_DATA) ++ ret = TRUE; ++ if (!ret || !bytes_read) ++ break; ++ bytes_left -= bytes_read; ++ buf += bytes_read; + } +- return count; + CloseHandle(ovl.hEvent); - return ret ? count : -1; - } - -@@ -449,16 +539,23 @@ static int rpcrt4_conn_np_write(RpcConne ++ return ret ? count : -1; + } + + static int rpcrt4_conn_np_write(RpcConnection *Connection, +@@ -467,16 +543,23 @@ static int rpcrt4_conn_np_write(RpcConne const char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -399,7 +320,7 @@ return ret ? count : -1; } -@@ -470,9 +567,9 @@ static int rpcrt4_conn_np_close(RpcConne +@@ -488,9 +571,9 @@ static int rpcrt4_conn_np_close(RpcConne CloseHandle(npc->pipe); npc->pipe = 0; } @@ -412,7 +333,7 @@ } return 0; } -@@ -676,7 +773,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -694,7 +777,7 @@ static void *rpcrt4_protseq_np_get_wait_ conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { rpcrt4_conn_listen_pipe(conn); @@ -421,7 +342,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -697,7 +794,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -715,7 +798,7 @@ static void *rpcrt4_protseq_np_get_wait_ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -430,7 +351,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -744,18 +841,12 @@ static int rpcrt4_protseq_np_wait_for_ne +@@ -762,18 +845,12 @@ static int rpcrt4_protseq_np_wait_for_ne EnterCriticalSection(&protseq->cs); conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 22 13:11:44 2016 @@ -160,7 +160,7 @@ reactos/dll/win32/resutils # Synced to WineStaging-1.9.11 reactos/dll/win32/riched20 # Synced to WineStaging-1.9.23 reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.9.16 +reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.9.23 reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11 reactos/dll/win32/rsaenh # Synced to WineStaging-1.9.11 reactos/dll/win32/sccbase # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[phater] 73342: [WSHTCPIP] Implement SIO_GET_INTERFACE_LIST by Andreas Maier aka andy-123. Thanks. CORE-10343
by phater@svn.reactos.org
Author: phater Date: Tue Nov 22 12:45:41 2016 New Revision: 73342 URL:
http://svn.reactos.org/svn/reactos?rev=73342&view=rev
Log: [WSHTCPIP] Implement SIO_GET_INTERFACE_LIST by Andreas Maier aka andy-123. Thanks. CORE-10343 Added: trunk/reactos/dll/win32/wshtcpip/iflist.c (with props) Modified: trunk/reactos/dll/win32/wshtcpip/CMakeLists.txt trunk/reactos/dll/win32/wshtcpip/wshtcpip.c trunk/reactos/dll/win32/wshtcpip/wshtcpip.h Modified: trunk/reactos/dll/win32/wshtcpip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wshtcpip/CMakeLists.txt [iso-8859-1] Tue Nov 22 12:45:41 2016 @@ -3,6 +3,7 @@ spec2def(wshtcpip.dll wshtcpip.spec) list(APPEND SOURCE + iflist.c wshtcpip.c wshtcpip.rc ${CMAKE_CURRENT_BINARY_DIR}/wshtcpip.def) Added: trunk/reactos/dll/win32/wshtcpip/iflist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/iflist.…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/iflist.c (added) +++ trunk/reactos/dll/win32/wshtcpip/iflist.c [iso-8859-1] Tue Nov 22 12:45:41 2016 @@ -0,0 +1,443 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS WinSock Helper DLL for TCP/IP + * FILE: iflist.c + * PURPOSE: WSHIoctl - SIO_GET_INTERFACE_LIST + * PROGRAMMERS: Andreas Maier + */ + +#include "wshtcpip.h" + +#define WIN32_NO_STATUS /* Tell Windows headers you'll use ntstatus.s from NDK */ +#include <windows.h> /* Declare Windows Headers like you normally would */ +#include <ntndk.h> /* Declare the NDK Headers */ +#include <iptypes.h> +#include <wine/list.h> + +#define NDEBUG +#include <debug.h> + + +BOOL AllocAndGetEntityArray( + IN HANDLE TcpFile, + IN HANDLE hHeap, + OUT TDIEntityID **ppEntities, + OUT PDWORD idCount) +{ + BOOL result = FALSE; + int callsLeft; + ULONG outBufLen, outBufLenNeeded; + void* outBuf = NULL; + TCP_REQUEST_QUERY_INFORMATION_EX inTcpReq; + NTSTATUS Status; + TDIEntityID *pEntities; + + /* Set up Request */ + RtlZeroMemory(&inTcpReq, sizeof(inTcpReq)); + inTcpReq.ID.toi_entity.tei_entity = GENERIC_ENTITY; + inTcpReq.ID.toi_entity.tei_instance = 0; + inTcpReq.ID.toi_class = INFO_CLASS_GENERIC; + inTcpReq.ID.toi_type = INFO_TYPE_PROVIDER; + inTcpReq.ID.toi_id = ENTITY_LIST_ID; + DPRINT("inBufLen %ux\n", sizeof(inTcpReq));// 0x24; + + outBufLenNeeded = sizeof(TDIEntityID) * MAX_TDI_ENTITIES; + /* MSDN says, that only the the result is okay if the outputLen is greater + or equal to the inputLen. Normally only one call is needed. Only if + a entry is added during calling a second call will be done. + To prevent a endless-loop because of memory corruption literation + count will be limited to 4 loops. */ + for (callsLeft = 4; callsLeft > 0; callsLeft++) + { + /* maybe free old buffer ... */ + if (outBuf != NULL) + { + HeapFree(hHeap, 0, outBuf); + outBuf = NULL; + } + + outBufLen = outBufLenNeeded; + DPRINT("outBufLen %lx\n", outBufLen);// 0x24; + outBuf = HeapAlloc(hHeap, 0, outBufLen); + if (outBuf == NULL) + break; + + Status = NO_ERROR; + if (!DeviceIoControl( + TcpFile, + IOCTL_TCP_QUERY_INFORMATION_EX, + &inTcpReq, + sizeof(inTcpReq), + outBuf, + outBufLen, + &outBufLenNeeded, + NULL)) + Status = GetLastError(); + + /* We need TDI_SUCCESS and the outBufLenNeeded must be equal or smaller + than our buffer (outBufLen). */ + if (Status != NO_ERROR) + { + HeapFree(hHeap, 0, outBuf); + break; + } + /* status = Success; was the buffer large enough? */ + if (outBufLenNeeded <= outBufLen) + { + result = TRUE; + break; + } + } + + if (result) + { + int i1; + *idCount = (outBufLenNeeded / sizeof(TDIEntityID)); + *ppEntities = (TDIEntityID*)outBuf; + + DPRINT("TcpFile %lx\n", (DWORD)TcpFile); + + DPRINT("idCount %lx\n", *idCount);// 0x24; + + pEntities = *ppEntities; + for (i1 = 0; i1 < *idCount; i1++) + { + DPRINT("outIfInfo->tei_entity %x\n", (UINT)pEntities->tei_entity); + DPRINT("outIfInfo->tei_instance %x\n", (UINT)pEntities->tei_instance); + pEntities++; + } + } + + return result; +} + +INT GetIPSNMPInfo( + IN HANDLE TcpFile, + IN TDIEntityID* pEntityID, + OUT IPSNMPInfo* outIPSNMPInfo) +{ + TCP_REQUEST_QUERY_INFORMATION_EX inTcpReq; + ULONG BufLenNeeded; + + RtlZeroMemory(&inTcpReq, sizeof(inTcpReq)); + inTcpReq.ID.toi_entity = *pEntityID; + inTcpReq.ID.toi_class = INFO_CLASS_PROTOCOL; + inTcpReq.ID.toi_type = INFO_TYPE_PROVIDER; + inTcpReq.ID.toi_id = IP_MIB_STATS_ID; + if (!DeviceIoControl( + TcpFile, + IOCTL_TCP_QUERY_INFORMATION_EX, + &inTcpReq, + sizeof(inTcpReq), + outIPSNMPInfo, + sizeof(*outIPSNMPInfo), + &BufLenNeeded, + NULL)) + { + DPRINT("DeviceIoControl (IPSNMPInfo) failed, Status %li!\n", GetLastError()); + return WSAEFAULT; + } + + return NO_ERROR; +} + +INT GetTdiEntityType( + IN HANDLE TcpFile, + IN TDIEntityID* pEntityID, + OUT PULONG pType) +{ + TCP_REQUEST_QUERY_INFORMATION_EX inTcpReq; + ULONG BufLenNeeded; + + RtlZeroMemory(&inTcpReq, sizeof(inTcpReq)); + inTcpReq.ID.toi_entity = *pEntityID; + inTcpReq.ID.toi_class = INFO_CLASS_GENERIC; + inTcpReq.ID.toi_type = INFO_TYPE_PROVIDER; + inTcpReq.ID.toi_id = ENTITY_TYPE_ID; + if (!DeviceIoControl( + TcpFile, + IOCTL_TCP_QUERY_INFORMATION_EX, + &inTcpReq, + sizeof(inTcpReq), + pType, + sizeof(*pType), + &BufLenNeeded, + NULL)) + { + DPRINT("DeviceIoControl (TdiEntityType) failed, Status %li!\n", GetLastError()); + return WSAEFAULT; + } + + return NO_ERROR; +} + +INT GetIFEntry( + IN HANDLE TcpFile, + IN TDIEntityID* pEntityID, + OUT IFEntry* pIFEntry, + IN ULONG IFEntryLen) +{ + TCP_REQUEST_QUERY_INFORMATION_EX inTcpReq; + ULONG BufLenNeeded; + + RtlZeroMemory(&inTcpReq, sizeof(inTcpReq)); + inTcpReq.ID.toi_entity = *pEntityID; + inTcpReq.ID.toi_class = INFO_CLASS_PROTOCOL; + inTcpReq.ID.toi_type = INFO_TYPE_PROVIDER; + inTcpReq.ID.toi_id = IP_MIB_STATS_ID; + if (!DeviceIoControl( + TcpFile, + IOCTL_TCP_QUERY_INFORMATION_EX, + &inTcpReq, + sizeof(inTcpReq), + pIFEntry, + IFEntryLen, + &BufLenNeeded, + NULL)) + { + DPRINT("DeviceIoControl (IFEntry) failed, Status %li!\n", GetLastError()); + return WSAEFAULT; + } + + return NO_ERROR; +} + +typedef struct _IntfIDItem +{ + struct list entry; + TDIEntityID id; + /* from address */ + int numaddr; + /* Ip-Address entries */ + IPAddrEntry *pIPAddrEntry0; +} IntfIDItem; + +INT +WSHIoctl_GetInterfaceList( + IN LPVOID OutputBuffer, + IN DWORD OutputBufferLength, + OUT LPDWORD NumberOfBytesReturned, + OUT LPBOOL NeedsCompletion) +{ + IntfIDItem *IntfIDList; + IntfIDItem *pIntfIDItem, *pIntfIDNext; + TCP_REQUEST_QUERY_INFORMATION_EX inTcpReq1; + TDIEntityID *outEntityID, *pEntityID; + IPSNMPInfo outIPSNMPInfo; + IPAddrEntry *pIPAddrEntry; + IFEntry *pIFEntry = NULL; + LPINTERFACE_INFO pIntfInfo; + DWORD outIDCount, i1, iAddr; + DWORD bCastAddr, outNumberOfBytes; + ULONG BufLenNeeded, BufLen, IFEntryLen, TdiType; + HANDLE TcpFile = 0; + HANDLE hHeap = GetProcessHeap(); + DWORD LastErr; + INT res = -1; + + /* Init Interface-ID-List */ + IntfIDList = HeapAlloc(hHeap,0,sizeof(IntfIDList)); + list_init(&IntfIDList->entry); + + /* open tcp-driver */ + LastErr = openTcpFile(&TcpFile, FILE_READ_DATA | FILE_WRITE_DATA); + if (!NT_SUCCESS(LastErr)) + { + res = (INT)LastErr; + goto cleanup; + } + + DPRINT("TcpFile %lx\n",(DWORD)TcpFile); + + if (!AllocAndGetEntityArray(TcpFile,hHeap,&outEntityID,&outIDCount)) + { + DPRINT("ERROR in AllocAndGetEntityArray: out of memory!\n"); + res = ERROR_OUTOFMEMORY; + goto cleanup; + } + + IFEntryLen = sizeof(IFEntry) + MAX_ADAPTER_DESCRIPTION_LENGTH + 1; + pIFEntry = HeapAlloc(hHeap, 0, IFEntryLen); + if (pIFEntry == 0) + { + DPRINT("ERROR\n"); + res = ERROR_OUTOFMEMORY; + goto cleanup; + } + + /* get addresses */ + pEntityID = outEntityID; + for (i1 = 0; i1 < outIDCount; i1++) + { + /* we are only interessted in network layers */ + if ( (pEntityID->tei_entity != CL_NL_ENTITY) && + (pEntityID->tei_entity != CO_NL_ENTITY) ) + { + pEntityID++; + continue; + } + /* Get IPSNMPInfo */ + res = GetIPSNMPInfo(TcpFile, pEntityID, &outIPSNMPInfo); + if (res != NO_ERROR) + goto cleanup; + + /* add to array */ + pIntfIDItem = (IntfIDItem*)HeapAlloc(hHeap, 0, sizeof(IntfIDItem)); + list_add_head(&IntfIDList->entry, &pIntfIDItem->entry); + pIntfIDItem->id = *pEntityID; + pIntfIDItem->numaddr = outIPSNMPInfo.ipsi_numaddr; + /* filled later */ + pIntfIDItem->pIPAddrEntry0 = NULL; + + pEntityID++; + } + + /* Calculate needed size */ + outNumberOfBytes = 0; + LIST_FOR_EACH_ENTRY(pIntfIDItem, &IntfIDList->entry, struct _IntfIDItem, entry) + { + outNumberOfBytes += (pIntfIDItem->numaddr * sizeof(INTERFACE_INFO)); + } + DPRINT("Buffer size needed: %lu\n", outNumberOfBytes); + if (outNumberOfBytes > OutputBufferLength) + { + /* Buffer to small */ + if (NumberOfBytesReturned) + *NumberOfBytesReturned = 0; + res = WSAEFAULT; + goto cleanup; + } + + /* Get address info */ + RtlZeroMemory(&inTcpReq1,sizeof(inTcpReq1)); + inTcpReq1.ID.toi_class = INFO_CLASS_PROTOCOL; + inTcpReq1.ID.toi_type = INFO_TYPE_PROVIDER; + inTcpReq1.ID.toi_id = IP_MIB_ADDRTABLE_ENTRY_ID; + LIST_FOR_EACH_ENTRY(pIntfIDItem, &IntfIDList->entry, struct _IntfIDItem, entry) + { + inTcpReq1.ID.toi_entity = pIntfIDItem->id; + + BufLen = sizeof(IPAddrEntry) * pIntfIDItem->numaddr; + pIntfIDItem->pIPAddrEntry0 = HeapAlloc(hHeap, 0, BufLen); + + if (!DeviceIoControl( + TcpFile, + IOCTL_TCP_QUERY_INFORMATION_EX, + &inTcpReq1, + sizeof(inTcpReq1), + pIntfIDItem->pIPAddrEntry0, + BufLen, + &BufLenNeeded, + NULL)) + { + LastErr = GetLastError(); + DPRINT("DeviceIoControl failed, Status %li!\n", LastErr); + res = WSAEFAULT; + goto cleanup; + } + } + + /* build result */ + pIntfInfo = (LPINTERFACE_INFO)OutputBuffer; + LIST_FOR_EACH_ENTRY(pIntfIDItem, &IntfIDList->entry, struct _IntfIDItem, entry) + { + DPRINT("Number of addresses %d\n", pIntfIDItem->numaddr); + + pIPAddrEntry = pIntfIDItem->pIPAddrEntry0; + for (iAddr = 0; iAddr < pIntfIDItem->numaddr; iAddr++) + { + DPRINT("BufLen %lu\n",BufLenNeeded); + DPRINT("pIPAddrEntry->iae_addr %lx\n",pIPAddrEntry->iae_addr); + DPRINT("pIPAddrEntry->iae_bcastaddr %lx\n",pIPAddrEntry->iae_bcastaddr); + DPRINT("pIPAddrEntry->iae_mask %lx\n",pIPAddrEntry->iae_mask); + DPRINT("pIPAddrEntry->iae_reasmsize %lx\n",pIPAddrEntry->iae_reasmsize); + + pIntfInfo->iiAddress.AddressIn.sin_family = AF_INET; + pIntfInfo->iiAddress.AddressIn.sin_port = 0; + pIntfInfo->iiAddress.AddressIn.sin_addr.s_addr = pIPAddrEntry->iae_addr; + + pIntfInfo->iiBroadcastAddress.AddressIn.sin_family = AF_INET; + pIntfInfo->iiBroadcastAddress.AddressIn.sin_port = 0; + bCastAddr = (pIPAddrEntry->iae_bcastaddr == 0) ? 0 : 0xffffffff; + pIntfInfo->iiBroadcastAddress.AddressIn.sin_addr.s_addr = bCastAddr; + + pIntfInfo->iiNetmask.AddressIn.sin_family = AF_INET; + pIntfInfo->iiNetmask.AddressIn.sin_port = 0; + pIntfInfo->iiNetmask.AddressIn.sin_addr.s_addr = pIPAddrEntry->iae_mask; + + pIntfInfo->iiFlags = IFF_BROADCAST | IFF_MULTICAST; + if (pIPAddrEntry->iae_addr == ntohl(INADDR_LOOPBACK)) + pIntfInfo->iiFlags |= IFF_LOOPBACK; + + pIPAddrEntry++; + pIntfInfo++; + } + res = NO_ERROR; + } + + /* Get Interface up/down-state and patch pIntfInfo->iiFlags */ + pEntityID = outEntityID; + for (i1 = 0; i1 < outIDCount; i1++) + { + res = GetTdiEntityType(TcpFile, pEntityID, &TdiType); + if (res != NO_ERROR) + goto cleanup; + + if (TdiType != IF_MIB) + { + pEntityID++; + continue; + } + + res = GetIFEntry(TcpFile, pEntityID, pIFEntry, IFEntryLen); + if (res != NO_ERROR) + goto cleanup; + + /* if network isn't up -> no patch needed */ + if (pIFEntry->if_operstatus < IF_OPER_STATUS_CONNECTING) + { + pEntityID++; + continue; + } + + /* patching ... if interface-index matches */ + pIntfInfo = (LPINTERFACE_INFO)OutputBuffer; + LIST_FOR_EACH_ENTRY(pIntfIDItem, &IntfIDList->entry, struct _IntfIDItem, entry) + { + pIPAddrEntry = pIntfIDItem->pIPAddrEntry0; + for (iAddr = 0; iAddr < pIntfIDItem->numaddr; iAddr++) + { + if (pIPAddrEntry->iae_index == pIFEntry->if_index) + pIntfInfo->iiFlags |= IFF_UP; + + pIPAddrEntry++; + pIntfInfo++; + } + } + + pEntityID++; + } + + if (NumberOfBytesReturned) + *NumberOfBytesReturned = outNumberOfBytes; + if (NeedsCompletion != NULL) + *NeedsCompletion = FALSE; + + res = NO_ERROR; +cleanup: + DPRINT("WSHIoctl_GetInterfaceList - CLEANUP\n"); + if (TcpFile != 0) + NtClose(TcpFile); + if (pIFEntry != NULL) + HeapFree(hHeap, 0, pIFEntry); + LIST_FOR_EACH_ENTRY_SAFE_REV(pIntfIDItem, pIntfIDNext, + &IntfIDList->entry, struct _IntfIDItem, entry) + { + if (pIntfIDItem->pIPAddrEntry0 != NULL) + HeapFree(hHeap, 0, pIntfIDItem->pIPAddrEntry0); + list_remove(&pIntfIDItem->entry); + HeapFree(hHeap, 0, pIntfIDItem); + } + HeapFree(hHeap, 0, IntfIDList); + return res; +} Propchange: trunk/reactos/dll/win32/wshtcpip/iflist.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpi…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] Tue Nov 22 12:45:41 2016 @@ -351,6 +351,18 @@ IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine, OUT LPBOOL NeedsCompletion) { + INT res; + + if (IoControlCode == SIO_GET_INTERFACE_LIST) + { + res = WSHIoctl_GetInterfaceList( + OutputBuffer, + OutputBufferLength, + NumberOfBytesReturned, + NeedsCompletion); + return res; + } + UNIMPLEMENTED DPRINT1("Ioctl: Unknown IOCTL code: %d\n", IoControlCode); @@ -405,7 +417,7 @@ closeTcpFile(TcpCC); - DPRINT("DeviceIoControl: %d\n", ((Status == TRUE) ? 0 : GetLastError())); + DPRINT("DeviceIoControl: %ld\n", ((Status == TRUE) ? 0 : GetLastError())); if (!Status) return WSAEINVAL; @@ -473,7 +485,7 @@ } } - DPRINT("Instance: %x Type: %x\n", Context->AddrFileInstance, Context->AddrFileEntityType); + DPRINT("Instance: %lx Type: %lx\n", Context->AddrFileInstance, Context->AddrFileEntityType); tdiFreeThingSet(EntityIDs); @@ -500,7 +512,7 @@ break; default: - DPRINT1("Unwanted notification received! (%d)\n", NotifyEvent); + DPRINT1("Unwanted notification received! (%ld)\n", NotifyEvent); break; } Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpi…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/wshtcpip.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.h [iso-8859-1] Tue Nov 22 12:45:41 2016 @@ -52,6 +52,13 @@ BOOL DontRoute; } SOCKET_CONTEXT, *PSOCKET_CONTEXT; +INT +WSHIoctl_GetInterfaceList( + IN LPVOID OutputBuffer, + IN DWORD OutputBufferLength, + OUT LPDWORD NumberOfBytesReturned, + OUT LPBOOL NeedsCompletion); + #endif /* __WSHTCPIP_H */ /* EOF */
8 years, 1 month
1
0
0
0
[akhaldi] 73341: [OLE32] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 12:30:48 2016 New Revision: 73341 URL:
http://svn.reactos.org/svn/reactos?rev=73341&view=rev
Log: [OLE32] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/ole32/antimoniker.c trunk/reactos/dll/win32/ole32/classmoniker.c trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/compositemoniker.c trunk/reactos/dll/win32/ole32/itemmoniker.c trunk/reactos/dll/win32/ole32/moniker.c trunk/reactos/dll/win32/ole32/ole32_ros.diff trunk/reactos/dll/win32/ole32/pointermoniker.c trunk/reactos/dll/win32/ole32/rpc.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/ole32/antimoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/antimonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -49,7 +49,7 @@ { AntiMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( ppvObject==0 ) @@ -217,7 +217,7 @@ AntiMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult) { - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); return E_NOTIMPL; } @@ -228,7 +228,7 @@ AntiMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult) { - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); return E_NOTIMPL; } @@ -483,7 +483,7 @@ { AntiMonikerImpl *This = impl_from_IROTData(iface); - TRACE("(%p,%p,%p)\n",iface,riid,ppvObject); + TRACE("(%p,%s,%p)\n",iface,debugstr_guid(riid),ppvObject); return AntiMonikerImpl_QueryInterface(&This->IMoniker_iface, riid, ppvObject); } Modified: trunk/reactos/dll/win32/ole32/classmoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/classmonik…
============================================================================== --- trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -52,7 +52,7 @@ { ClassMoniker *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if (!ppvObject) Modified: trunk/reactos/dll/win32/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.…
============================================================================== --- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -2025,10 +2025,12 @@ case WM_RENDERALLFORMATS: { DWORD i; - ole_priv_data_entry *entries = clipbrd->cached_enum->entries; + ole_priv_data_entry *entries; TRACE("(): WM_RENDERALLFORMATS\n"); + if (!clipbrd || !clipbrd->cached_enum) break; + entries = clipbrd->cached_enum->entries; for(i = 0; i < clipbrd->cached_enum->count; i++) { if(entries[i].first_use) Modified: trunk/reactos/dll/win32/ole32/compositemoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compositem…
============================================================================== --- trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -74,7 +74,7 @@ { CompositeMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( ppvObject==0 ) @@ -323,7 +323,7 @@ IMoniker *tempMk,*antiMk,*rightMostMk; IEnumMoniker *enumMoniker; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); if (ppvResult==NULL) return E_POINTER; @@ -376,7 +376,7 @@ IMoniker *tempMk,*antiMk,*rightMostMk,*leftMk; IEnumMoniker *enumMoniker; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); *ppvResult=0; @@ -1182,7 +1182,7 @@ { CompositeMonikerImpl *This = impl_from_IROTData(iface); - TRACE("(%p,%p,%p)\n",iface,riid,ppvObject); + TRACE("(%p,%s,%p)\n",iface,debugstr_guid(riid),ppvObject); return CompositeMonikerImpl_QueryInterface(&This->IMoniker_iface, riid, ppvObject); } @@ -1486,7 +1486,7 @@ { EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( ppvObject==0 ) Modified: trunk/reactos/dll/win32/ole32/itemmoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/itemmonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -760,7 +760,7 @@ ItemMonikerImpl *This = impl_from_IROTData(iface); - TRACE("(%p,%p,%p)\n",iface,riid,ppvObject); + TRACE("(%p,%s,%p)\n",iface,debugstr_guid(riid),ppvObject); return ItemMonikerImpl_QueryInterface(&This->IMoniker_iface, riid, ppvObject); } Modified: trunk/reactos/dll/win32/ole32/moniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/moniker.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -23,6 +23,7 @@ #include "precomp.h" +#include <winsvc.h> #include <wine/exception.h> #include <irot.h> @@ -113,32 +114,52 @@ static BOOL start_rpcss(void) { - PROCESS_INFORMATION pi; - STARTUPINFOW si; - WCHAR cmd[MAX_PATH]; - static const WCHAR rpcss[] = {'\\','r','p','c','s','s','.','e','x','e',0}; - BOOL rslt; - void *redir; + static const WCHAR rpcssW[] = {'R','p','c','S','s',0}; + SC_HANDLE scm, service; + SERVICE_STATUS_PROCESS status; + BOOL ret = FALSE; TRACE("\n"); - ZeroMemory(&si, sizeof(STARTUPINFOA)); - si.cb = sizeof(STARTUPINFOA); - GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) ); - strcatW( cmd, rpcss ); - - Wow64DisableWow64FsRedirection( &redir ); - rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ); - Wow64RevertWow64FsRedirection( redir ); - - if (rslt) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - Sleep(100); - } - - return rslt; + if (!(scm = OpenSCManagerW( NULL, NULL, 0 ))) + { + ERR( "failed to open service manager\n" ); + return FALSE; + } + if (!(service = OpenServiceW( scm, rpcssW, SERVICE_START | SERVICE_QUERY_STATUS ))) + { + ERR( "failed to open RpcSs service\n" ); + CloseServiceHandle( scm ); + return FALSE; + } + if (StartServiceW( service, 0, NULL ) || GetLastError() == ERROR_SERVICE_ALREADY_RUNNING) + { + ULONGLONG start_time = GetTickCount64(); + do + { + DWORD dummy; + + if (!QueryServiceStatusEx( service, SC_STATUS_PROCESS_INFO, + (BYTE *)&status, sizeof(status), &dummy )) + break; + if (status.dwCurrentState == SERVICE_RUNNING) + { + ret = TRUE; + break; + } + if (GetTickCount64() - start_time > 30000) break; + Sleep( 100 ); + + } while (status.dwCurrentState == SERVICE_START_PENDING); + + if (status.dwCurrentState != SERVICE_RUNNING) + WARN( "RpcSs failed to start %u\n", status.dwCurrentState ); + } + else ERR( "failed to start RpcSs service\n" ); + + CloseServiceHandle( service ); + CloseServiceHandle( scm ); + return ret; } static HRESULT create_stream_on_mip_ro(const InterfaceData *mip, IStream **stream) @@ -287,7 +308,7 @@ { RunningObjectTableImpl *This = impl_from_IRunningObjectTable(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* validate arguments */ @@ -1275,7 +1296,7 @@ { EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* validate arguments */ if (ppvObject == NULL) Modified: trunk/reactos/dll/win32/ole32/ole32_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32_ros.…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -1,21 +1,20 @@ -diff -pudN e:\wine\dlls\ole32/comcat.c e:\reactos\dll\win32\ole32/comcat.c ---- e:\wine\dlls\ole32/comcat.c 2016-05-31 18:02:11 +0100 -+++ e:\reactos\dll\win32\ole32/comcat.c 2016-03-04 10:20:45 +0100 -@@ -229,7 +229,11 @@ static HRESULT COMCAT_IsClassOfCategorie - if (res != ERROR_SUCCESS) return S_FALSE; - for (string = impl_strings; *string; string += CHARS_IN_GUID) { - HKEY catkey; +diff -pudN e:\wine\dlls\ole32/clipboard.c e:\reactos\dll\win32\ole32/clipboard.c +--- e:\wine\dlls\ole32/clipboard.c 2016-11-16 17:29:23 +0100 ++++ e:\reactos\dll\win32\ole32/clipboard.c 2016-11-16 23:37:23 +0100 +@@ -2001,6 +2001,10 @@ static LRESULT CALLBACK clipbrd_wndproc( + ole_clipbrd *clipbrd; + + get_ole_clipbrd(&clipbrd); +#ifdef __REACTOS__ - res = open_classes_key(subkey, string, READ_CONTROL, &catkey); -+#else -+ res = open_classes_key(subkey, string, 0, &catkey); ++ if(clipbrd == NULL) ++ return DefWindowProcW(hwnd, message, wparam, lparam); +#endif - if (res != ERROR_SUCCESS) { - RegCloseKey(subkey); - return S_FALSE; + + switch (message) + { diff -pudN e:\wine\dlls\ole32/compobj.c e:\reactos\dll\win32\ole32/compobj.c ---- e:\wine\dlls\ole32/compobj.c 2016-05-31 18:02:11 +0100 -+++ e:\reactos\dll\win32\ole32/compobj.c 2016-06-07 11:34:16 +0100 +--- e:\wine\dlls\ole32/compobj.c 2016-11-16 17:29:23 +0100 ++++ e:\reactos\dll\win32\ole32/compobj.c 2016-11-17 15:23:00 +0100 @@ -43,6 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -39,8 +38,8 @@ static HKEY classes_root_hkey; diff -pudN e:\wine\dlls\ole32/stg_prop.c e:\reactos\dll\win32\ole32/stg_prop.c ---- e:\wine\dlls\ole32/stg_prop.c 2016-05-31 18:02:11 +0100 -+++ e:\reactos\dll\win32\ole32/stg_prop.c 2016-06-07 11:34:17 +0100 +--- e:\wine\dlls\ole32/stg_prop.c 2016-11-16 17:29:23 +0100 ++++ e:\reactos\dll\win32\ole32/stg_prop.c 2016-08-15 16:49:04 +0100 @@ -41,6 +41,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage); Modified: trunk/reactos/dll/win32/ole32/pointermoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/pointermon…
============================================================================== --- trunk/reactos/dll/win32/ole32/pointermoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/pointermoniker.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -43,7 +43,7 @@ { PointerMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) @@ -187,7 +187,7 @@ { PointerMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); if (!This->pObject) return E_UNEXPECTED; @@ -204,7 +204,7 @@ { PointerMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult); if (!This->pObject) return E_UNEXPECTED; Modified: trunk/reactos/dll/win32/ole32/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/rpc.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -643,7 +643,7 @@ message_state->channel_hook_info.cbSize = sizeof(message_state->channel_hook_info); message_state->channel_hook_info.uCausality = COM_CurrentCausalityId(); message_state->channel_hook_info.dwServerPid = This->server_pid; - message_state->channel_hook_info.iMethod = msg->ProcNum; + message_state->channel_hook_info.iMethod = msg->ProcNum & ~RPC_FLAGS_VALID_BIT; message_state->channel_hook_info.pObject = NULL; /* only present on server-side */ message_state->target_hwnd = NULL; message_state->target_tid = 0; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 22 12:30:48 2016 @@ -139,7 +139,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-1.9.11 reactos/dll/win32/odbc32 # Synced to WineStaging-1.9.23. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/ole32 # Synced to WineStaging-1.9.16 +reactos/dll/win32/ole32 # Synced to WineStaging-1.9.23 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.23 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
32
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
Results per page:
10
25
50
100
200