winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
618 discussions
Start a n
N
ew thread
Józef Kucia : wined3d: Simplify shader_arb_destroy().
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 2f917d79beb60e2fd97218b1a853e8162fa28bfa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f917d79beb60e2fd97218b1…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Aug 21 10:24:26 2018 +0200 wined3d: Simplify shader_arb_destroy(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 54 +++++++++++++++------------------------ 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 00b326f..7cd7d2d 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4733,56 +4733,42 @@ static void shader_arb_disable(void *shader_priv, struct wined3d_context *contex static void shader_arb_destroy(struct wined3d_shader *shader) { struct wined3d_device *device = shader->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + unsigned int i; + + /* This can happen if a shader was never compiled */ + if (!shader->backend_data) + return; + + context = context_acquire(device, NULL, 0); + gl_info = context->gl_info; if (shader_is_pshader_version(shader->reg_maps.shader_version.type)) { struct arb_pshader_private *shader_data = shader->backend_data; - UINT i; - - if(!shader_data) return; /* This can happen if a shader was never compiled */ - - if (shader_data->num_gl_shaders) - { - struct wined3d_context *context = context_acquire(device, NULL, 0); - for (i = 0; i < shader_data->num_gl_shaders; ++i) - { - GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId)); - checkGLcall("GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId))"); - } - - context_release(context); - } + for (i = 0; i < shader_data->num_gl_shaders; ++i) + GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId)); heap_free(shader_data->gl_shaders); - heap_free(shader_data); - shader->backend_data = NULL; } else { struct arb_vshader_private *shader_data = shader->backend_data; - UINT i; - if(!shader_data) return; /* This can happen if a shader was never compiled */ + for (i = 0; i < shader_data->num_gl_shaders; ++i) + GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId)); - if (shader_data->num_gl_shaders) - { - struct wined3d_context *context = context_acquire(device, NULL, 0); + heap_free(shader_data->gl_shaders); + } - for (i = 0; i < shader_data->num_gl_shaders; ++i) - { - GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId)); - checkGLcall("GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId))"); - } + checkGLcall("delete programs"); - context_release(context); - } + context_release(context); - heap_free(shader_data->gl_shaders); - heap_free(shader_data); - shader->backend_data = NULL; - } + heap_free(shader->backend_data); + shader->backend_data = NULL; } static int sig_tree_compare(const void *key, const struct wine_rb_entry *entry)
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Fix scrolling for multi-column listboxes.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: f025570c801d72f8355a988d58a28bfe75390a8a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f025570c801d72f8355a988d…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Aug 16 18:03:49 2018 +0300 user32/listbox: Fix scrolling for multi-column listboxes. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=38565
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 991ab87..3f1396d 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -300,28 +300,27 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll ) if (descr->top_item == index) return LB_OKAY; if (scroll) { - INT diff; + INT dx = 0, dy = 0; if (descr->style & LBS_MULTICOLUMN) - diff = (descr->top_item - index) / descr->page_size * descr->column_width; + dx = (descr->top_item - index) / descr->page_size * descr->column_width; else if (descr->style & LBS_OWNERDRAWVARIABLE) { INT i; - diff = 0; if (index > descr->top_item) { for (i = index - 1; i >= descr->top_item; i--) - diff -= descr->items[i].height; + dy -= descr->items[i].height; } else { for (i = index; i < descr->top_item; i++) - diff += descr->items[i].height; + dy += descr->items[i].height; } } else - diff = (descr->top_item - index) * descr->item_height; + dy = (descr->top_item - index) * descr->item_height; - ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL, + ScrollWindowEx( descr->self, dx, dy, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); } else
1
0
0
0
Gabriel Ivăncescu : comctl32/listbox: Fix scrolling for multi-column listboxes.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 3f266610d5e8d720e245c06a4115980dd6f70e1a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3f266610d5e8d720e245c06a…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Aug 16 18:03:49 2018 +0300 comctl32/listbox: Fix scrolling for multi-column listboxes. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=38565
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index b3491bb..5235ffd 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -275,28 +275,27 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll ) if (descr->top_item == index) return LB_OKAY; if (scroll) { - INT diff; + INT dx = 0, dy = 0; if (descr->style & LBS_MULTICOLUMN) - diff = (descr->top_item - index) / descr->page_size * descr->column_width; + dx = (descr->top_item - index) / descr->page_size * descr->column_width; else if (descr->style & LBS_OWNERDRAWVARIABLE) { INT i; - diff = 0; if (index > descr->top_item) { for (i = index - 1; i >= descr->top_item; i--) - diff -= descr->items[i].height; + dy -= descr->items[i].height; } else { for (i = index; i < descr->top_item; i++) - diff += descr->items[i].height; + dy += descr->items[i].height; } } else - diff = (descr->top_item - index) * descr->item_height; + dy = (descr->top_item - index) * descr->item_height; - ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL, + ScrollWindowEx( descr->self, dx, dy, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); } else
1
0
0
0
Nikolay Sivov : wmp: Implement GetClassInfo().
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 470ea0d51bee73ca5012eb9ffe70f3f92add7506 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=470ea0d51bee73ca5012eb9f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 21 10:19:39 2018 +0300 wmp: Implement GetClassInfo(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmp/oleobj.c | 11 ++++++--- dlls/wmp/tests/oleobj.c | 10 ++++++++ dlls/wmp/wmp_main.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wmp/wmp_private.h | 15 +++++++++++ 4 files changed, 99 insertions(+), 3 deletions(-) diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c index a90a0c2..cbbd965 100644 --- a/dlls/wmp/oleobj.c +++ b/dlls/wmp/oleobj.c @@ -760,11 +760,16 @@ static ULONG WINAPI ProvideClassInfo2_Release(IProvideClassInfo2 *iface) return IOleObject_Release(&This->IOleObject_iface); } -static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI) +static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ti) { WindowsMediaPlayer *This = impl_from_IProvideClassInfo2(iface); - FIXME("(%p)->(%p)\n", This, ppTI); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, ti); + + if (!ti) + return E_POINTER; + + return get_typeinfo(WindowsMediaPlayer_tid, ti); } static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID) diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index 472b985..2250b75 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -1199,6 +1199,8 @@ static void test_wmp(void) IOleObject *oleobj; IWMPCore *wmpcore; DWORD misc_status; + TYPEATTR *attr; + ITypeInfo *ti; RECT pos = {0,0,100,100}; HWND hwnd; GUID guid; @@ -1232,6 +1234,14 @@ static void test_wmp(void) ok(hres == S_OK, "GetGUID failed: %08x\n", hres); ok(IsEqualGUID(&guid, &IID__WMPOCXEvents), "guid = %s\n", wine_dbgstr_guid(&guid)); + hres = IProvideClassInfo2_GetClassInfo(class_info, &ti); + ok(hres == S_OK, "Failed to get class info, hr %#x.\n", hres); + hres = ITypeInfo_GetTypeAttr(ti, &attr); + ok(hres == S_OK, "Failed to get type attributes, hr %#x.\n", hres); + ok(IsEqualGUID(&CLSID_WindowsMediaPlayer, &attr->guid), "Unexpected typeinfo guid %s\n", wine_dbgstr_guid(&attr->guid)); + ITypeInfo_ReleaseTypeAttr(ti, attr); + ITypeInfo_Release(ti); + IProvideClassInfo2_Release(class_info); test_QI((IUnknown*)oleobj); diff --git a/dlls/wmp/wmp_main.c b/dlls/wmp/wmp_main.c index 273d193..2541fc5 100644 --- a/dlls/wmp/wmp_main.c +++ b/dlls/wmp/wmp_main.c @@ -27,6 +27,71 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmp); HINSTANCE wmp_instance; DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); +static REFIID tid_ids[] = { +#define XIID(iface) &IID_ ## iface, +#define CTID(name) &CLSID_ ## name, +TID_LIST +#undef XIID +#undef CTID +}; + +static ITypeLib *typelib; +static ITypeInfo *typeinfos[LAST_tid]; + +static HRESULT load_typelib(void) +{ + ITypeLib *tl; + HRESULT hr; + + hr = LoadRegTypeLib(&LIBID_WMPLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl); + if (FAILED(hr)) { + ERR("LoadRegTypeLib failed: %08x\n", hr); + return hr; + } + + if (InterlockedCompareExchangePointer((void **)&typelib, tl, NULL)) + ITypeLib_Release(tl); + return hr; +} + +HRESULT get_typeinfo(typeinfo_id tid, ITypeInfo **typeinfo) +{ + HRESULT hr; + + if (!typelib) + hr = load_typelib(); + if (!typelib) + return hr; + + if (!typeinfos[tid]) { + ITypeInfo *ti; + + hr = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti); + if (FAILED(hr)) { + ERR("GetTypeInfoOfGuid (%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hr); + return hr; + } + + if (InterlockedCompareExchangePointer((void **)(typeinfos + tid), ti, NULL)) + ITypeInfo_Release(ti); + } + + *typeinfo = typeinfos[tid]; + ITypeInfo_AddRef(*typeinfo); + return S_OK; +} + +static void release_typelib(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(typeinfos); i++) + if (typeinfos[i]) + ITypeInfo_Release(typeinfos[i]); + + ITypeLib_Release(typelib); +} + static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) { *ppv = NULL; @@ -93,6 +158,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) case DLL_PROCESS_DETACH: unregister_wmp_class(); unregister_player_msg_class(); + release_typelib(); break; } diff --git a/dlls/wmp/wmp_private.h b/dlls/wmp/wmp_private.h index 9617be0..ab9c6d0 100644 --- a/dlls/wmp/wmp_private.h +++ b/dlls/wmp/wmp_private.h @@ -25,6 +25,21 @@ #include "dshow.h" #include "wmp.h" +#define TID_LIST \ + XIID(NULL) \ + CTID(WindowsMediaPlayer) + +typedef enum { +#define XIID(iface) iface ## _tid, +#define CTID(name) name ## _tid, +TID_LIST +#undef XIID +#undef CTID + LAST_tid +} typeinfo_id; + +HRESULT get_typeinfo(typeinfo_id tid, ITypeInfo **typeinfo) DECLSPEC_HIDDEN; + typedef struct { IConnectionPoint IConnectionPoint_iface;
1
0
0
0
Alistair Leslie-Hughes : odbccp32: Implement SQLValidDSN/W.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 990f08dc73ef2c52d097f628581cd32213d0847e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=990f08dc73ef2c52d097f628…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Aug 21 04:00:52 2018 +0000 odbccp32: Implement SQLValidDSN/W. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/odbccp32/odbccp32.c | 25 ++++++++++++++----- dlls/odbccp32/tests/misc.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index a253035..60254d0 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -29,6 +29,7 @@ #include "winbase.h" #include "winreg.h" #include "winnls.h" +#include "sqlext.h" #include "wine/unicode.h" #include "wine/debug.h" #include "wine/heap.h" @@ -1514,18 +1515,30 @@ BOOL WINAPI SQLSetConfigMode(UWORD wConfigMode) BOOL WINAPI SQLValidDSNW(LPCWSTR lpszDSN) { + static const WCHAR invalid[] = {'[',']','{','}','(',')',',',';','?','*','=','!','@','\\',0}; clear_errors(); - FIXME("%s\n", debugstr_w(lpszDSN)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + TRACE("%s\n", debugstr_w(lpszDSN)); + + if(strlenW(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrkW(lpszDSN, invalid) != NULL) + { + return FALSE; + } + + return TRUE; } BOOL WINAPI SQLValidDSN(LPCSTR lpszDSN) { + static const char *invalid = "[]{}(),;?*=!@\\"; clear_errors(); - FIXME("%s\n", debugstr_a(lpszDSN)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + TRACE("%s\n", debugstr_a(lpszDSN)); + + if(strlen(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrk(lpszDSN, invalid) != NULL) + { + return FALSE; + } + + return TRUE; } BOOL WINAPI SQLWriteDSNToIniW(LPCWSTR lpszDSN, LPCWSTR lpszDriver) diff --git a/dlls/odbccp32/tests/misc.c b/dlls/odbccp32/tests/misc.c index be3873ac..dc65bdf 100644 --- a/dlls/odbccp32/tests/misc.c +++ b/dlls/odbccp32/tests/misc.c @@ -682,6 +682,65 @@ static void test_SQLGetInstalledDrivers(void) SQLRemoveDriver("Wine test", TRUE, NULL); } +static void test_SQLValidDSN(void) +{ + static const char *invalid = "[]{}(),;?*=!@\\"; + char str[10]; + int i; + BOOL ret; + + strcpy(str, "wine10"); + for(i = 0; i < strlen(invalid); i++) + { + str[4] = invalid[i]; + ret = SQLValidDSN(str); + ok(!ret, "got %d\n", ret); + } + + /* Too large */ + ret = SQLValidDSN("Wine123456789012345678901234567890"); + ok(!ret, "got %d\n", ret); + + /* Valid with a space */ + ret = SQLValidDSN("Wine Vinegar"); + ok(ret, "got %d\n", ret); + + /* Max DSN name value */ + ret = SQLValidDSN("12345678901234567890123456789012"); + ok(ret, "got %d\n", ret); +} + +static void test_SQLValidDSNW(void) +{ + static const WCHAR invalid[] = {'[',']','{','}','(',')',',',';','?','*','=','!','@','\\',0}; + static const WCHAR value[] = { 'w','i','n','e','1','0',0}; + static const WCHAR too_large[] = { 'W','i','n','e','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5', + '6','7','8','9','0','1','2','3','4','5','6','7','8','9','0', 0}; + static const WCHAR with_space[] = { 'W','i','n','e',' ','V','i','n','e','g','a','r', 0}; + static const WCHAR max_dsn[] = { '1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0', + '1','2','3','4','5','6','7','8','9','0','1','2', 0}; + WCHAR str[10]; + int i; + BOOL ret; + + lstrcpyW(str, value); + for(i = 0; i < lstrlenW(invalid); i++) + { + str[4] = invalid[i]; + ret = SQLValidDSNW(str); + ok(!ret, "got %d\n", ret); + } + + ret = SQLValidDSNW(too_large); + ok(!ret, "got %d\n", ret); + + ret = SQLValidDSNW(with_space); + ok(ret, "got %d\n", ret); + + ret = SQLValidDSNW(max_dsn); + ok(ret, "got %d\n", ret); +} + START_TEST(misc) { test_SQLConfigMode(); @@ -693,4 +752,6 @@ START_TEST(misc) test_SQLInstallDriverEx(); test_SQLInstallTranslatorEx(); test_SQLGetInstalledDrivers(); + test_SQLValidDSN(); + test_SQLValidDSNW(); }
1
0
0
0
Michael Stefaniuc : cmd: Use the ARRAY_SIZE() macro.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 04413abcc72f5e04c153a0a1c5f82cdb3c351963 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04413abcc72f5e04c153a0a1…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Mon Aug 20 21:15:42 2018 +0200 cmd: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/cmd/batch.c | 2 +- programs/cmd/builtins.c | 150 ++++++++++++++++++++--------------------------- programs/cmd/directory.c | 12 ++-- programs/cmd/wcmdmain.c | 66 ++++++++++----------- 4 files changed, 102 insertions(+), 128 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=04413abcc72f5e04c153…
1
0
0
0
Chip Davis : ntdll: When an exception happens in DllMain(), print the code.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: e6c6874ec323c9d657bfa9b69e04cb2a8cc1a522 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e6c6874ec323c9d657bfa9b6…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Mon Aug 20 13:42:54 2018 -0500 ntdll: When an exception happens in DllMain(), print the code. Also print exceptions from TLS callbacks. Useful for debugging exceptions that prevent DLLs from loading. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8d18af8..26b2431 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1175,8 +1175,8 @@ static void call_tls_callbacks( HMODULE module, UINT reason ) } __EXCEPT_ALL { - TRACE_(relay)("\1exception in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", - callback, module, reason_names[reason] ); + TRACE_(relay)("\1exception %08x in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", + GetExceptionCode(), callback, module, reason_names[reason] ); return; } __ENDTRY @@ -1222,9 +1222,9 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved } __EXCEPT_ALL { - TRACE_(relay)("\1exception in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", - entry, module, reason_names[reason], lpReserved ); status = GetExceptionCode(); + TRACE_(relay)("\1exception %08x in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", + status, entry, module, reason_names[reason], lpReserved ); } __ENDTRY
1
0
0
0
Jacek Caban : server: Require FILE_READ_ATTRIBUTES access in get_named_pipe_info.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: d4e0f0a12fdca62fea49a635418d19eb0c0d72af URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d4e0f0a12fdca62fea49a635…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 20 19:29:56 2018 +0200 server: Require FILE_READ_ATTRIBUTES access in get_named_pipe_info. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/pipe.c | 6 ++++-- server/named_pipe.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 1d77d88..ebf228d 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -756,16 +756,18 @@ static void test_filepipeinfo(void) res = pNtQueryInformationFile(hClient, &iosb, &local_info, sizeof(local_info), FilePipeLocalInformation); - todo_wine ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile(FilePipeLocalInformation) returned: %x\n", res); res = pNtQueryInformationFile(hClient, &iosb, &local_info, sizeof(local_info), FilePipeInformation); - todo_wine ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile(FilePipeInformation) returned: %x\n", res); + res = pNtQueryInformationFile(hClient, &iosb, &local_info, sizeof(local_info), + FileNameInformation); + ok(res == STATUS_SUCCESS, "NtQueryInformationFile(FileNameInformation) returned: %x\n", res); + CloseHandle(hClient); CloseHandle(hServer); } diff --git a/server/named_pipe.c b/server/named_pipe.c index ba6f507..c006acb 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -1284,7 +1284,7 @@ DECL_HANDLER(get_named_pipe_info) clear_error(); pipe_end = (struct pipe_end *)get_handle_obj( current->process, req->handle, - 0, &pipe_client_ops ); + FILE_READ_ATTRIBUTES, &pipe_client_ops ); if (!pipe_end) return; }
1
0
0
0
Jacek Caban : kernel32: Always create file with FILE_READ_ATTRIBUTES access in CreateFile.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 58233b47e0117db1f4767ee5d54ba169976905b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=58233b47e0117db1f4767ee5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 20 19:29:46 2018 +0200 kernel32: Always create file with FILE_READ_ATTRIBUTES access in CreateFile. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 4 ---- dlls/kernel32/file.c | 4 ++-- dlls/kernel32/tests/pipe.c | 5 +++++ dlls/ntdll/tests/pipe.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 925e6fa..aebf3b8 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -5620,7 +5620,6 @@ static void test_file_security(HANDLE token) ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); access = get_obj_access(file); -todo_wine ok(access == (FILE_READ_ATTRIBUTES | SYNCHRONIZE), "expected FILE_READ_ATTRIBUTES | SYNCHRONIZE, got %#x\n", access); bytes = 0xdeadbeef; @@ -5637,7 +5636,6 @@ todo_wine ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); access = get_obj_access(file); -todo_wine ok(access == (FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES), "expected FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES, got %#x\n", access); bytes = 0xdeadbeef; @@ -5678,7 +5676,6 @@ todo_wine ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); access = get_obj_access(file); -todo_wine ok(access == (FILE_READ_ATTRIBUTES | SYNCHRONIZE), "expected FILE_READ_ATTRIBUTES | SYNCHRONIZE, got %#x\n", access); CloseHandle(file); @@ -5688,7 +5685,6 @@ todo_wine ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); access = get_obj_access(file); -todo_wine ok(access == (FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES), "expected FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES, got %#x\n", access); CloseHandle(file); diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index b558f8e..081f076 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1582,8 +1582,8 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT; - status = NtCreateFile( &ret, access | SYNCHRONIZE, &attr, &io, NULL, attributes, - sharing, nt_disposition[creation - CREATE_NEW], + status = NtCreateFile( &ret, access | SYNCHRONIZE | FILE_READ_ATTRIBUTES, &attr, &io, + NULL, attributes, sharing, nt_disposition[creation - CREATE_NEW], options, NULL, 0 ); if (status) { diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 1e67f70..10c971b 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -666,6 +666,11 @@ static void test_CreateNamedPipe(int pipemode) test_file_access(hnp, SYNCHRONIZE | READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_PROPERTIES | FILE_APPEND_DATA | FILE_WRITE_DATA); + hFile = CreateFileA(PIPENAME, 0, 0, NULL, OPEN_EXISTING, 0, 0); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + test_file_access(hFile, SYNCHRONIZE | FILE_READ_ATTRIBUTES); + CloseHandle(hFile); + CloseHandle(hnp); if (winetest_debug > 1) trace("test_CreateNamedPipe returning\n"); diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index d6a0d41..1d77d88 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -113,6 +113,20 @@ static inline BOOL is_signaled( HANDLE obj ) return WaitForSingleObject( obj, 0 ) == WAIT_OBJECT_0; } +#define test_file_access(a,b) _test_file_access(__LINE__,a,b) +static void _test_file_access(unsigned line, HANDLE handle, DWORD expected_access) +{ + FILE_ACCESS_INFORMATION info; + IO_STATUS_BLOCK io; + NTSTATUS status; + + memset(&info, 0x11, sizeof(info)); + status = NtQueryInformationFile(handle, &io, &info, sizeof(info), FileAccessInformation); + ok_(__FILE__,line)(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); + ok_(__FILE__,line)(info.AccessFlags == expected_access, "got access %08x expected %08x\n", + info.AccessFlags, expected_access); +} + static const WCHAR testpipe[] = { '\\', '\\', '.', '\\', 'p', 'i', 'p', 'e', '\\', 't', 'e', 's', 't', 'p', 'i', 'p', 'e', 0 }; static const WCHAR testpipe_nt[] = { '\\', '?', '?', '\\', 'p', 'i', 'p', 'e', '\\', @@ -562,6 +576,7 @@ static void _check_pipe_handle_state(int line, HANDLE handle, ULONG read, ULONG static void test_filepipeinfo(void) { + FILE_PIPE_LOCAL_INFORMATION local_info; IO_STATUS_BLOCK iosb; OBJECT_ATTRIBUTES attr; UNICODE_STRING name; @@ -726,6 +741,33 @@ static void test_filepipeinfo(void) check_pipe_handle_state(hServer, 1, 0); CloseHandle(hServer); + + res = pNtCreateNamedPipeFile(&hServer, + FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, + &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_CREATE, + 0, 1, 1, 0, 0xFFFFFFFF, 500, 500, &timeout); + ok(!res, "NtCreateNamedPipeFile returned %x\n", res); + + res = NtCreateFile(&hClient, SYNCHRONIZE, &attr, &iosb, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); + ok(!res, "NtCreateFile returned %x\n", res); + + test_file_access(hClient, SYNCHRONIZE); + + res = pNtQueryInformationFile(hClient, &iosb, &local_info, sizeof(local_info), + FilePipeLocalInformation); + todo_wine + ok(res == STATUS_ACCESS_DENIED, + "NtQueryInformationFile(FilePipeLocalInformation) returned: %x\n", res); + + res = pNtQueryInformationFile(hClient, &iosb, &local_info, sizeof(local_info), + FilePipeInformation); + todo_wine + ok(res == STATUS_ACCESS_DENIED, + "NtQueryInformationFile(FilePipeInformation) returned: %x\n", res); + + CloseHandle(hClient); + CloseHandle(hServer); } static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
1
0
0
0
Jacek Caban : kernel32: Use proper access flags in CreatePipe.
by Alexandre Julliard
21 Aug '18
21 Aug '18
Module: wine Branch: master Commit: 8712db6f554349728663bff0ff2b03334aa905b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8712db6f554349728663bff0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 20 19:29:30 2018 +0200 kernel32: Use proper access flags in CreatePipe. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/sync.c | 6 +++--- dlls/kernel32/tests/pipe.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index 6c7249c..a855e95 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -2085,8 +2085,8 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, snprintfW(name, ARRAY_SIZE(name), nameFmt, GetCurrentProcessId(), ++index); RtlInitUnicodeString(&nt_name, name); - status = NtCreateNamedPipeFile(&hr, GENERIC_READ | SYNCHRONIZE, &attr, &iosb, - FILE_SHARE_WRITE, FILE_OVERWRITE_IF, + status = NtCreateNamedPipeFile(&hr, GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, + &attr, &iosb, FILE_SHARE_WRITE, FILE_OVERWRITE_IF, FILE_SYNCHRONOUS_IO_NONALERT, FALSE, FALSE, FALSE, 1, size, size, &timeout); @@ -2099,7 +2099,7 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, /* from completion sakeness, I think system resources might be exhausted before this happens !! */ if (hr == INVALID_HANDLE_VALUE) return FALSE; - status = NtOpenFile(&hw, GENERIC_WRITE | SYNCHRONIZE, &attr, &iosb, 0, + status = NtOpenFile(&hw, GENERIC_WRITE | FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, 0, FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); if (status) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 209a0c0..1e67f70 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -1534,6 +1534,11 @@ static void test_CreatePipe(void) ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, 0) != 0, "CreatePipe failed\n"); test_pipe_info(piperead, FILE_PIPE_SERVER_END, 4096, 4096, 1); test_pipe_info(pipewrite, 0, 4096, 4096, 1); + test_file_access(piperead, SYNCHRONIZE | READ_CONTROL | FILE_WRITE_ATTRIBUTES + | FILE_READ_ATTRIBUTES | FILE_READ_PROPERTIES | FILE_READ_DATA); + test_file_access(pipewrite, SYNCHRONIZE | READ_CONTROL | FILE_WRITE_ATTRIBUTES + | FILE_READ_ATTRIBUTES | FILE_WRITE_PROPERTIES | FILE_APPEND_DATA + | FILE_WRITE_DATA); ok(WriteFile(pipewrite,PIPENAME,sizeof(PIPENAME), &written, NULL), "Write to anonymous pipe failed\n"); ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %d bytes\n", written);
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200