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
September 2010
----- 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
852 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Better checks for too old jscript.dll versions.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: a8e969236f057e0741675b47cc9d30e68a555af6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8e969236f057e0741675b47c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 21 15:58:48 2010 +0200 jscript: Better checks for too old jscript.dll versions. --- dlls/jscript/tests/activex.c | 60 ++++++++++++++++++++++++----------------- dlls/jscript/tests/jscript.c | 28 +++++++++++++++---- dlls/jscript/tests/run.c | 7 +++++ 3 files changed, 64 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/tests/activex.c b/dlls/jscript/tests/activex.c index ba3f8bd..faf73d3 100644 --- a/dlls/jscript/tests/activex.c +++ b/dlls/jscript/tests/activex.c @@ -701,7 +701,7 @@ static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const cha ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres); } -static IActiveScriptParse *create_script(void) +static IActiveScriptParse *create_script(BOOL skip_tests) { IActiveScriptParse *parser; IActiveScript *script; @@ -719,11 +719,13 @@ static IActiveScriptParse *create_script(void) hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&script); - ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + if(!skip_tests) + ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); if(FAILED(hres)) return NULL; - set_safety_options((IUnknown*)script); + if(!skip_tests) + set_safety_options((IUnknown*)script); hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); @@ -743,17 +745,19 @@ static IActiveScriptParse *create_script(void) IActiveScript_Release(script); - parse_script_a(parser, - "function testException(func, type, number) {\n" - "try {\n" - " func();\n" - "}catch(e) {\n" - " ok(e.name === type, 'e.name = ' + e.name + ', expected ' + type)\n" - " ok(e.number === number, 'e.number = ' + e.number + ', expected ' + number);\n" - " return;\n" - "}" - "ok(false, 'exception expected');\n" - "}"); + if(!skip_tests) { + parse_script_a(parser, + "function testException(func, type, number) {\n" + " try {\n" + " func();\n" + " }catch(e) {\n" + " ok(e.name === type, 'e.name = ' + e.name + ', expected ' + type)\n" + " ok(e.number === number, 'e.number = ' + e.number + ', expected ' + number);\n" + " return;\n" + " }\n" + " ok(false, 'exception expected');\n" + "}"); + } return parser; } @@ -800,7 +804,7 @@ static void test_ActiveXObject(void) IActiveScriptParse *parser; IDispatchEx *proc; - parser = create_script(); + parser = create_script(FALSE); SET_EXPECT(Host_QS_SecMgr); SET_EXPECT(ProcessUrlAction); @@ -845,7 +849,7 @@ static void test_ActiveXObject(void) IDispatchEx_Release(proc); IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); proc = parse_procedure_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); SET_EXPECT(Host_QS_SecMgr); @@ -867,7 +871,7 @@ static void test_ActiveXObject(void) IDispatchEx_Release(proc); IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); QS_SecMgr_hres = E_NOINTERFACE; SET_EXPECT(Host_QS_SecMgr); @@ -876,7 +880,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); ProcessUrlAction_hres = E_FAIL; SET_EXPECT(Host_QS_SecMgr); @@ -887,7 +891,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); ProcessUrlAction_policy = URLPOLICY_DISALLOW; SET_EXPECT(Host_QS_SecMgr); @@ -898,7 +902,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); CreateInstance_hres = E_FAIL; SET_EXPECT(Host_QS_SecMgr); @@ -911,7 +915,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); QueryCustomPolicy_hres = E_FAIL; SET_EXPECT(Host_QS_SecMgr); @@ -926,7 +930,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); QueryCustomPolicy_psize = 6; SET_EXPECT(Host_QS_SecMgr); @@ -945,7 +949,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); QueryCustomPolicy_policy = URLPOLICY_DISALLOW; SET_EXPECT(Host_QS_SecMgr); @@ -981,7 +985,7 @@ static void test_ActiveXObject(void) IUnknown_Release(parser); - parser = create_script(); + parser = create_script(FALSE); object_with_site = &ObjectWithSite; SET_EXPECT(Host_QS_SecMgr); @@ -1062,18 +1066,24 @@ static BOOL register_activex(void) static BOOL check_jscript(void) { + IActiveScriptProperty *script_prop; IActiveScriptParse *parser; BSTR str; HRESULT hres; - parser = create_script(); + parser = create_script(TRUE); if(!parser) return FALSE; str = a2bstr("if(!('localeCompare' in String.prototype)) throw 1;"); hres = IActiveScriptParse64_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); SysFreeString(str); + + if(hres == S_OK) + hres = IUnknown_QueryInterface(parser, &IID_IActiveScriptProperty, (void**)&script_prop); IUnknown_Release(parser); + if(hres == S_OK) + IActiveScriptProperty_Release(script_prop); return hres == S_OK; } diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c index f7f1e30..ce25781 100644 --- a/dlls/jscript/tests/jscript.c +++ b/dlls/jscript/tests/jscript.c @@ -335,10 +335,9 @@ static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *v hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty, (void**)&script_prop); - if(FAILED(hres)) { - win_skip("IActiveScriptProperty not supported\n"); - return E_NOTIMPL; - } + ok(hres == S_OK, "Could not get IActiveScriptProperty: %08x\n", hres); + if(FAILED(hres)) + return hres; hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val); IActiveScriptProperty_Release(script_prop); @@ -523,12 +522,29 @@ static void test_jscript2(void) ok(!ref, "ref = %d\n", ref); } +static BOOL check_jscript(void) +{ + IActiveScriptProperty *script_prop; + HRESULT hres; + + hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IActiveScriptProperty, (void**)&script_prop); + if(SUCCEEDED(hres)) + IActiveScriptProperty_Release(script_prop); + + return hres == S_OK; +} + START_TEST(jscript) { CoInitialize(NULL); - test_jscript(); - test_jscript2(); + if(check_jscript()) { + test_jscript(); + test_jscript2(); + }else { + win_skip("Broken engine, probably too old\n"); + } CoUninitialize(); } diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 303907e..4df315c 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -1090,9 +1090,16 @@ static void run_tests(void) static BOOL check_jscript(void) { + IActiveScriptProperty *script_prop; BSTR str; HRESULT hres; + hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IActiveScriptProperty, (void**)&script_prop); + if(FAILED(hres)) + return FALSE; + IActiveScriptProperty_Release(script_prop); + str = a2bstr("if(!('localeCompare' in String.prototype)) throw 1;"); hres = parse_script(0, str); SysFreeString(str);
1
0
0
0
Dmitry Timoshkov : user32: UpdateLayeredWindow() should fail on non-layered or already initialized window.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: a7188842afe7cb35b15980a3ffd1c8fa5aa23391 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7188842afe7cb35b15980a3f…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Sep 21 16:35:30 2010 +0900 user32: UpdateLayeredWindow() should fail on non-layered or already initialized window. --- dlls/user32/tests/win.c | 36 +++++++++++++++++++++++++++++++++++- dlls/user32/win.c | 7 +++++++ 2 files changed, 42 insertions(+), 1 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 190ca79..1434bc8 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -49,6 +49,7 @@ static BOOL (WINAPI *pGetWindowInfo)(HWND,WINDOWINFO*); static UINT (WINAPI *pGetWindowModuleFileNameA)(HWND,LPSTR,UINT); static BOOL (WINAPI *pGetLayeredWindowAttributes)(HWND,COLORREF*,BYTE*,DWORD*); static BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); +static BOOL (WINAPI *pUpdateLayeredWindow)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD); static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO); static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); static int (WINAPI *pGetWindowRgnBox)(HWND,LPRECT); @@ -5568,16 +5569,29 @@ static void test_layered_window(void) COLORREF key = 0; BYTE alpha = 0; DWORD flags = 0; + POINT pt = { 0, 0 }; + SIZE sz = { 200, 200 }; + HDC hdc; + HBITMAP hbm; BOOL ret; - if (!pGetLayeredWindowAttributes || !pSetLayeredWindowAttributes) + if (!pGetLayeredWindowAttributes || !pSetLayeredWindowAttributes || !pUpdateLayeredWindow) { win_skip( "layered windows not supported\n" ); return; } + + hdc = CreateCompatibleDC( 0 ); + hbm = CreateCompatibleBitmap( hdc, 200, 200 ); + SelectObject( hdc, hbm ); + hwnd = CreateWindowExA(0, "MainWindowClass", "message window", WS_CAPTION, 100, 100, 200, 200, 0, 0, 0, NULL); assert( hwnd ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on non-layered window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0, 0, LWA_ALPHA ); @@ -5585,6 +5599,10 @@ static void test_layered_window(void) SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( ret, "UpdateLayeredWindow should succeed on layered window\n" ); + ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); + ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0x123456, 44, LWA_ALPHA ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); @@ -5592,14 +5610,23 @@ static void test_layered_window(void) ok( key == 0x123456 || key == 0, "wrong color key %x\n", key ); ok( alpha == 44, "wrong alpha %u\n", alpha ); ok( flags == LWA_ALPHA, "wrong flags %x\n", flags ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); /* clearing WS_EX_LAYERED resets attributes */ SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on no longer layered window\n" ); SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( ret, "UpdateLayeredWindow should succeed on layered window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0x654321, 22, LWA_COLORKEY | LWA_ALPHA ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); @@ -5607,6 +5634,10 @@ static void test_layered_window(void) ok( key == 0x654321, "wrong color key %x\n", key ); ok( alpha == 22, "wrong alpha %u\n", alpha ); ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %x\n", flags ); + SetLastError( 0xdeadbeef ); + ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); + ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); ret = pSetLayeredWindowAttributes( hwnd, 0x888888, 33, LWA_COLORKEY ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); @@ -5640,6 +5671,8 @@ static void test_layered_window(void) ok( flags == 0, "wrong flags %x\n", flags ); DestroyWindow( hwnd ); + DeleteDC( hdc ); + DeleteObject( hbm ); } static MONITORINFO mi; @@ -6140,6 +6173,7 @@ START_TEST(win) pGetWindowModuleFileNameA = (void *)GetProcAddress( user32, "GetWindowModuleFileNameA" ); pGetLayeredWindowAttributes = (void *)GetProcAddress( user32, "GetLayeredWindowAttributes" ); pSetLayeredWindowAttributes = (void *)GetProcAddress( user32, "SetLayeredWindowAttributes" ); + pUpdateLayeredWindow = (void *)GetProcAddress( user32, "UpdateLayeredWindow" ); pGetMonitorInfoA = (void *)GetProcAddress( user32, "GetMonitorInfoA" ); pMonitorFromPoint = (void *)GetProcAddress( user32, "MonitorFromPoint" ); pGetWindowRgnBox = (void *)GetProcAddress( user32, "GetWindowRgnBox" ); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 63f6689..d691676 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3434,6 +3434,13 @@ BOOL WINAPI UpdateLayeredWindowIndirect( HWND hwnd, const UPDATELAYEREDWINDOWINF { BYTE alpha = 0xff; + if (!(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED) || + GetLayeredWindowAttributes( hwnd, NULL, NULL, NULL )) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + if (!(info->dwFlags & ULW_EX_NORESIZE) && (info->pptDst || info->psize)) { int x = 0, y = 0, cx = 0, cy = 0;
1
0
0
0
Gerald Pfeifer : widl: Avoid duplicate assignments in resolve_expression.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 17ee7300f88f4f15c996f2eb12b3dbdf0111f603 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17ee7300f88f4f15c996f2eb1…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Sun Sep 19 12:06:52 2010 +0200 widl: Avoid duplicate assignments in resolve_expression. --- tools/widl/expr.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/tools/widl/expr.c b/tools/widl/expr.c index 8511ce5..e1a5196 100644 --- a/tools/widl/expr.c +++ b/tools/widl/expr.c @@ -513,27 +513,22 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc case EXPR_HEXNUM: case EXPR_NUM: case EXPR_TRUEFALSE: - result.is_variable = FALSE; result.is_temporary = FALSE; result.type = type_new_int(TYPE_BASIC_INT, 0); break; case EXPR_STRLIT: - result.is_variable = FALSE; result.is_temporary = TRUE; result.type = type_new_pointer(RPC_FC_UP, type_new_int(TYPE_BASIC_CHAR, 0), NULL); break; case EXPR_WSTRLIT: - result.is_variable = FALSE; result.is_temporary = TRUE; result.type = type_new_pointer(RPC_FC_UP, type_new_int(TYPE_BASIC_WCHAR, 0), NULL); break; case EXPR_CHARCONST: - result.is_variable = FALSE; result.is_temporary = TRUE; result.type = type_new_int(TYPE_BASIC_CHAR, 0); break; case EXPR_DOUBLE: - result.is_variable = FALSE; result.is_temporary = TRUE; result.type = type_new_basic(TYPE_BASIC_DOUBLE); break; @@ -596,7 +591,6 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc result.type = e->u.tref; break; case EXPR_SIZEOF: - result.is_variable = FALSE; result.is_temporary = FALSE; result.type = type_new_int(TYPE_BASIC_INT, 0); break; @@ -634,7 +628,6 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc result_right = resolve_expression(expr_loc, cont_type, e->u.ext); check_scalar_type(expr_loc, cont_type, result_left.type); check_scalar_type(expr_loc, cont_type, result_right.type); - result.is_variable = FALSE; result.is_temporary = FALSE; result.type = type_new_int(TYPE_BASIC_INT, 0); break;
1
0
0
0
Alexandre Julliard : krnl386.exe: Get rid of the useless config.sys parser.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 18bb9da5bce2fc188a7f2662ebe465900cec2343 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18bb9da5bce2fc188a7f2662e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 21 15:59:45 2010 +0200 krnl386.exe: Get rid of the useless config.sys parser. --- dlls/krnl386.exe16/Makefile.in | 1 - dlls/krnl386.exe16/dosconf.c | 484 ---------------------------------------- dlls/krnl386.exe16/dosexe.h | 22 -- dlls/krnl386.exe16/int21.c | 17 +- 4 files changed, 7 insertions(+), 517 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=18bb9da5bce2fc188a7f2…
1
0
0
0
Alexandre Julliard : wineps: Add a comment about the trap for code checking tools.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 1f3873aae7310cd40e9fcfb0739e281bcbf32806 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f3873aae7310cd40e9fcfb07…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 21 15:55:33 2010 +0200 wineps: Add a comment about the trap for code checking tools. --- dlls/wineps.drv/init.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 685a56a..f0c4e18 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -271,6 +271,7 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW) LPDEVMODEA dmA; DWORD size; BOOL Formname; + /* there is no pointer dereference here, if your code checking tool complains it's broken */ ptrdiff_t off_formname = (const char *)dmW->dmFormName - (const char *)dmW; if(!dmW) return NULL;
1
0
0
0
Paul Vriens : ddraw: Pass the correct size to memset (Coccinelle).
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: c0ff1aec0362a15bc44160e44d45051662c67b68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0ff1aec0362a15bc44160e44…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Tue Sep 21 14:37:38 2010 +0200 ddraw: Pass the correct size to memset (Coccinelle). --- dlls/ddraw/ddraw.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 7552144..f3ebade 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -5090,7 +5090,7 @@ HRESULT IDirect3DImpl_GetCaps(IWineD3D *wined3d, D3DDEVICEDESC *desc1, D3DDEVICE desc7->dwReserved4 = 0; /* Fill the old structure */ - memset(desc1, 0, sizeof(desc1)); + memset(desc1, 0, sizeof(*desc1)); desc1->dwSize = sizeof(D3DDEVICEDESC); desc1->dwFlags = D3DDD_COLORMODEL | D3DDD_DEVCAPS
1
0
0
0
Alexandre Julliard : wined3d: Reduce the size of a huge function that takes ages to compile.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 97c4ab23ab25d8c943dc1ece4f5637a8a99d4be7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97c4ab23ab25d8c943dc1ece4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 21 15:47:22 2010 +0200 wined3d: Reduce the size of a huge function that takes ages to compile. --- dlls/wined3d/directx.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index ff41438..e8bbe77 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2188,6 +2188,23 @@ static const struct blit_shader *select_blit_implementation(struct wined3d_adapt else return &ffp_blit; } +static void load_gl_funcs(struct wined3d_gl_info *gl_info, DWORD gl_version) +{ + DWORD ver; + +#define USE_GL_FUNC(type, pfn, ext, replace) \ + if (gl_info->supported[ext]) gl_info->pfn = (type)pwglGetProcAddress(#pfn); \ + else if ((ver = ver_for_ext(ext)) && ver <= gl_version) gl_info->pfn = (type)pwglGetProcAddress(#replace); \ + else gl_info->pfn = NULL; + + GL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC + +#define USE_GL_FUNC(type, pfn, ext, replace) gl_info->pfn = (type)pwglGetProcAddress(#pfn); + WGL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC +} + /* Context activation is done by the caller. */ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter) { @@ -2322,19 +2339,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter) } /* Now work out what GL support this card really has */ -#define USE_GL_FUNC(type, pfn, ext, replace) \ -{ \ - DWORD ver = ver_for_ext(ext); \ - if (gl_info->supported[ext]) gl_info->pfn = (type)pwglGetProcAddress(#pfn); \ - else if (ver && ver <= gl_version) gl_info->pfn = (type)pwglGetProcAddress(#replace); \ - else gl_info->pfn = NULL; \ -} - GL_EXT_FUNCS_GEN; -#undef USE_GL_FUNC - -#define USE_GL_FUNC(type, pfn, ext, replace) gl_info->pfn = (type)pwglGetProcAddress(#pfn); - WGL_EXT_FUNCS_GEN; -#undef USE_GL_FUNC + load_gl_funcs( gl_info, gl_version ); ENTER_GL();
1
0
0
0
Andrew Nguyen : taskkill: Implement forcible termination by process name.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: a7431fe90fa82ab3313b582aeb2c6af7cbf9de36 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7431fe90fa82ab3313b582ae…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Sep 21 02:21:23 2010 -0500 taskkill: Implement forcible termination by process name. --- programs/taskkill/En.rc | 1 + programs/taskkill/taskkill.c | 51 +++++++++++++++++++++++++++++++++++++++++- programs/taskkill/taskkill.h | 7 +++-- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/programs/taskkill/En.rc b/programs/taskkill/En.rc index 724f907..f7fcfd6 100644 --- a/programs/taskkill/En.rc +++ b/programs/taskkill/En.rc @@ -34,6 +34,7 @@ STRINGTABLE STRING_CLOSE_PID_SEARCH, "Close message sent to top-level windows of process with PID %u.\n" STRING_CLOSE_PROC_SRCH, "Close message sent to top-level windows of process \"%s\" with PID %u.\n" STRING_TERM_PID_SEARCH, "Process with PID %u was forcibly terminated.\n" + STRING_TERM_PROC_SEARCH, "Process \"%s\" with PID %u was forcibly terminated.\n" STRING_SEARCH_FAILED, "Error: Could not find process \"%s\".\n" STRING_ENUM_FAILED, "Error: Unable to enumerate the process list.\n" STRING_TERMINATE_FAILED, "Error: Unable to terminate process \"%s\".\n" diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index d864e60..c3080e5 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -280,9 +280,17 @@ static int send_close_messages(void) static int terminate_processes(void) { + DWORD *pid_list, pid_list_size; unsigned int i; int status_code = 0; + pid_list = enumerate_processes(&pid_list_size); + if (!pid_list) + { + taskkill_message(STRING_ENUM_FAILED); + return 1; + } + for (i = 0; i < task_count; i++) { WCHAR *p = task_list[i]; @@ -323,9 +331,50 @@ static int terminate_processes(void) CloseHandle(process); } else - WINE_FIXME("Forcible process termination by name is not implemented\n"); + { + DWORD index; + BOOL found_process = FALSE; + + for (index = 0; index < pid_list_size; index++) + { + WCHAR process_name[MAX_PATH]; + + if (get_process_name_from_pid(pid_list[index], process_name, MAX_PATH) && + !strcmpiW(process_name, task_list[i])) + { + HANDLE process; + + process = OpenProcess(PROCESS_TERMINATE, FALSE, pid_list[index]); + if (!process) + { + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; + continue; + } + + if (!TerminateProcess(process, 0)) + { + taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); + status_code = 1; + CloseHandle(process); + continue; + } + + found_process = TRUE; + taskkill_message_printfW(STRING_TERM_PROC_SEARCH, task_list[i], pid_list[index]); + CloseHandle(process); + } + } + + if (!found_process) + { + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; + } + } } + HeapFree(GetProcessHeap(), 0, pid_list); return status_code; } diff --git a/programs/taskkill/taskkill.h b/programs/taskkill/taskkill.h index a70cab0..e535a01 100644 --- a/programs/taskkill/taskkill.h +++ b/programs/taskkill/taskkill.h @@ -30,6 +30,7 @@ #define STRING_CLOSE_PID_SEARCH 107 #define STRING_CLOSE_PROC_SRCH 108 #define STRING_TERM_PID_SEARCH 109 -#define STRING_SEARCH_FAILED 110 -#define STRING_ENUM_FAILED 111 -#define STRING_TERMINATE_FAILED 112 +#define STRING_TERM_PROC_SEARCH 110 +#define STRING_SEARCH_FAILED 111 +#define STRING_ENUM_FAILED 112 +#define STRING_TERMINATE_FAILED 113
1
0
0
0
Andrew Nguyen : taskkill: Implement forcible termination by process identifier.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 6cfeeed0df3c25a44d71485ba82cf46512179dcb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6cfeeed0df3c25a44d71485ba…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Sep 21 02:21:14 2010 -0500 taskkill: Implement forcible termination by process identifier. --- programs/taskkill/En.rc | 2 + programs/taskkill/taskkill.c | 53 +++++++++++++++++++++++++++++++++++++++++- programs/taskkill/taskkill.h | 6 +++- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/programs/taskkill/En.rc b/programs/taskkill/En.rc index a37321d..724f907 100644 --- a/programs/taskkill/En.rc +++ b/programs/taskkill/En.rc @@ -33,6 +33,8 @@ STRINGTABLE STRING_MUTUAL_EXCLUSIVE, "Error: Options /im and /pid are mutually exclusive.\n" STRING_CLOSE_PID_SEARCH, "Close message sent to top-level windows of process with PID %u.\n" STRING_CLOSE_PROC_SRCH, "Close message sent to top-level windows of process \"%s\" with PID %u.\n" + STRING_TERM_PID_SEARCH, "Process with PID %u was forcibly terminated.\n" STRING_SEARCH_FAILED, "Error: Could not find process \"%s\".\n" STRING_ENUM_FAILED, "Error: Unable to enumerate the process list.\n" + STRING_TERMINATE_FAILED, "Error: Unable to terminate process \"%s\".\n" } diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index f24883b..d864e60 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -278,6 +278,57 @@ static int send_close_messages(void) return status_code; } +static int terminate_processes(void) +{ + unsigned int i; + int status_code = 0; + + for (i = 0; i < task_count; i++) + { + WCHAR *p = task_list[i]; + BOOL is_numeric = TRUE; + + /* Determine whether the string is not numeric. */ + while (*p) + { + if (!isdigitW(*p++)) + { + is_numeric = FALSE; + break; + } + } + + if (is_numeric) + { + DWORD pid = atoiW(task_list[i]); + HANDLE process; + + process = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + if (!process) + { + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; + continue; + } + + if (!TerminateProcess(process, 0)) + { + taskkill_message_printfW(STRING_TERMINATE_FAILED, task_list[i]); + status_code = 1; + CloseHandle(process); + continue; + } + + taskkill_message_printfW(STRING_TERM_PID_SEARCH, pid); + CloseHandle(process); + } + else + WINE_FIXME("Forcible process termination by name is not implemented\n"); + } + + return status_code; +} + static BOOL add_to_task_list(WCHAR *name) { static unsigned int list_size = 16; @@ -389,7 +440,7 @@ int wmain(int argc, WCHAR *argv[]) } if (force_termination) - WINE_FIXME("Forced termination is not implemented\n"); + status_code = terminate_processes(); else status_code = send_close_messages(); diff --git a/programs/taskkill/taskkill.h b/programs/taskkill/taskkill.h index 802d523..a70cab0 100644 --- a/programs/taskkill/taskkill.h +++ b/programs/taskkill/taskkill.h @@ -29,5 +29,7 @@ #define STRING_MUTUAL_EXCLUSIVE 106 #define STRING_CLOSE_PID_SEARCH 107 #define STRING_CLOSE_PROC_SRCH 108 -#define STRING_SEARCH_FAILED 109 -#define STRING_ENUM_FAILED 110 +#define STRING_TERM_PID_SEARCH 109 +#define STRING_SEARCH_FAILED 110 +#define STRING_ENUM_FAILED 111 +#define STRING_TERMINATE_FAILED 112
1
0
0
0
Andrew Nguyen : taskkill: Implement graceful termination by process name.
by Alexandre Julliard
21 Sep '10
21 Sep '10
Module: wine Branch: master Commit: 1ef5affbf36c01f1e3ba91bd94e393b35ba33285 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ef5affbf36c01f1e3ba91bd9…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue Sep 21 02:20:58 2010 -0500 taskkill: Implement graceful termination by process name. --- programs/taskkill/En.rc | 2 + programs/taskkill/Makefile.in | 2 +- programs/taskkill/taskkill.c | 102 ++++++++++++++++++++++++++++++++++++++++- programs/taskkill/taskkill.h | 4 +- 4 files changed, 107 insertions(+), 3 deletions(-) diff --git a/programs/taskkill/En.rc b/programs/taskkill/En.rc index ccad885..a37321d 100644 --- a/programs/taskkill/En.rc +++ b/programs/taskkill/En.rc @@ -32,5 +32,7 @@ STRINGTABLE STRING_MISSING_PARAM, "Error: Option %s expects a command line parameter.\n" STRING_MUTUAL_EXCLUSIVE, "Error: Options /im and /pid are mutually exclusive.\n" STRING_CLOSE_PID_SEARCH, "Close message sent to top-level windows of process with PID %u.\n" + STRING_CLOSE_PROC_SRCH, "Close message sent to top-level windows of process \"%s\" with PID %u.\n" STRING_SEARCH_FAILED, "Error: Could not find process \"%s\".\n" + STRING_ENUM_FAILED, "Error: Unable to enumerate the process list.\n" } diff --git a/programs/taskkill/Makefile.in b/programs/taskkill/Makefile.in index 9dce65a..b3bfff3 100644 --- a/programs/taskkill/Makefile.in +++ b/programs/taskkill/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DWINE_NO_UNICODE_MACROS MODULE = taskkill.exe APPMODE = -mconsole -municode -IMPORTS = user32 +IMPORTS = psapi user32 C_SRCS = taskkill.c diff --git a/programs/taskkill/taskkill.c b/programs/taskkill/taskkill.c index 4b9fb94..f24883b 100644 --- a/programs/taskkill/taskkill.c +++ b/programs/taskkill/taskkill.c @@ -20,6 +20,7 @@ */ #include <windows.h> +#include <psapi.h> #include <wine/debug.h> #include <wine/unicode.h> @@ -123,6 +124,72 @@ static BOOL CALLBACK pid_enum_proc(HWND hwnd, LPARAM lParam) return TRUE; } +static DWORD *enumerate_processes(DWORD *list_count) +{ + DWORD *pid_list, alloc_bytes = 1024 * sizeof(*pid_list), needed_bytes; + + pid_list = HeapAlloc(GetProcessHeap(), 0, alloc_bytes); + if (!pid_list) + return NULL; + + for (;;) + { + DWORD *realloc_list; + + if (!EnumProcesses(pid_list, alloc_bytes, &needed_bytes)) + { + HeapFree(GetProcessHeap(), 0, pid_list); + return NULL; + } + + /* EnumProcesses can't signal an insufficient buffer condition, so the + * only way to possibly determine whether a larger buffer is required + * is to see whether the written number of bytes is the same as the + * buffer size. If so, the buffer will be reallocated to twice the + * size. */ + if (alloc_bytes != needed_bytes) + break; + + alloc_bytes *= 2; + realloc_list = HeapReAlloc(GetProcessHeap(), 0, pid_list, alloc_bytes); + if (!realloc_list) + { + HeapFree(GetProcessHeap(), 0, pid_list); + return NULL; + } + pid_list = realloc_list; + } + + *list_count = needed_bytes / sizeof(*pid_list); + return pid_list; +} + +static BOOL get_process_name_from_pid(DWORD pid, WCHAR *buf, DWORD chars) +{ + HANDLE process; + HMODULE module; + DWORD required_size; + + process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); + if (!process) + return FALSE; + + if (!EnumProcessModules(process, &module, sizeof(module), &required_size)) + { + CloseHandle(process); + return FALSE; + } + + if (!GetModuleBaseNameW(process, module, buf, chars)) + { + CloseHandle(process); + return FALSE; + } + + CloseHandle(process); + return TRUE; +} + /* The implemented task enumeration and termination behavior does not * exactly match native behavior. On Windows: * @@ -139,9 +206,17 @@ static BOOL CALLBACK pid_enum_proc(HWND hwnd, LPARAM lParam) * system processes. */ static int send_close_messages(void) { + DWORD *pid_list, pid_list_size; unsigned int i; int status_code = 0; + pid_list = enumerate_processes(&pid_list_size); + if (!pid_list) + { + taskkill_message(STRING_ENUM_FAILED); + return 1; + } + for (i = 0; i < task_count; i++) { WCHAR *p = task_list[i]; @@ -172,9 +247,34 @@ static int send_close_messages(void) } } else - WINE_FIXME("Termination by name is not implemented\n"); + { + DWORD index; + BOOL found_process = FALSE; + + for (index = 0; index < pid_list_size; index++) + { + WCHAR process_name[MAX_PATH]; + + if (get_process_name_from_pid(pid_list[index], process_name, MAX_PATH) && + !strcmpiW(process_name, task_list[i])) + { + struct pid_close_info info = { pid_list[index] }; + + found_process = TRUE; + EnumWindows(pid_enum_proc, (LPARAM)&info); + taskkill_message_printfW(STRING_CLOSE_PROC_SRCH, process_name, pid_list[index]); + } + } + + if (!found_process) + { + taskkill_message_printfW(STRING_SEARCH_FAILED, task_list[i]); + status_code = 128; + } + } } + HeapFree(GetProcessHeap(), 0, pid_list); return status_code; } diff --git a/programs/taskkill/taskkill.h b/programs/taskkill/taskkill.h index 1cc09af..802d523 100644 --- a/programs/taskkill/taskkill.h +++ b/programs/taskkill/taskkill.h @@ -28,4 +28,6 @@ #define STRING_MISSING_PARAM 105 #define STRING_MUTUAL_EXCLUSIVE 106 #define STRING_CLOSE_PID_SEARCH 107 -#define STRING_SEARCH_FAILED 108 +#define STRING_CLOSE_PROC_SRCH 108 +#define STRING_SEARCH_FAILED 109 +#define STRING_ENUM_FAILED 110
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200