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
November 2008
----- 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
734 discussions
Start a n
N
ew thread
Alexandre Julliard : ole32/tests: Use a CLSID that is more likely to exist on old Windows versions.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 48d41dbc37545ce7fd8ec9f3b0964eab4fadbf93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48d41dbc37545ce7fd8ec9f3b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 13 21:45:25 2008 +0100 ole32/tests: Use a CLSID that is more likely to exist on old Windows versions. --- dlls/ole32/tests/compobj.c | 45 +++++++++++++++++++------------------------ 1 files changed, 20 insertions(+), 25 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index bdc34d9..b30e939 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -40,18 +40,13 @@ HRESULT (WINAPI * pCoGetObjectContext)(REFIID riid, LPVOID *ppv); #define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks) static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; -static const CLSID CLSID_CDeviceMoniker = { 0x4315d437, 0x5b8c, 0x11d0, { 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 } }; -static WCHAR devicedotone[] = {'d','e','v','i','c','e','.','1',0}; +static const CLSID CLSID_StdFont = { 0x0be35203, 0x8f91, 0x11ce, { 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51 } }; +static WCHAR stdfont[] = {'S','t','d','F','o','n','t',0}; static const WCHAR wszNonExistent[] = {'N','o','n','E','x','i','s','t','e','n','t',0}; -static WCHAR wszCLSID_CDeviceMoniker[] = +static WCHAR wszCLSID_StdFont[] = { - '{', - '4','3','1','5','d','4','3','7','-', - '5','b','8','c','-', - '1','1','d','0','-', - 'b','d','3','b','-', - '0','0','a','0','c','9','1','1','c','e','8','6', - '}',0 + '{','0','b','e','3','5','2','0','3','-','8','f','9','1','-','1','1','c','e','-', + '9','d','e','3','-','0','0','a','a','0','0','4','b','b','8','5','1','}',0 }; static const IID IID_IWineTest = @@ -143,11 +138,11 @@ static IClassFactory Test_ClassFactory = { &TestClassFactory_Vtbl }; static void test_ProgIDFromCLSID(void) { LPWSTR progid; - HRESULT hr = ProgIDFromCLSID(&CLSID_CDeviceMoniker, &progid); + HRESULT hr = ProgIDFromCLSID(&CLSID_StdFont, &progid); ok(hr == S_OK, "ProgIDFromCLSID failed with error 0x%08x\n", hr); if (hr == S_OK) { - ok(!lstrcmpiW(progid, devicedotone), "Didn't get expected prog ID\n"); + ok(!lstrcmpiW(progid, stdfont), "Didn't get expected prog ID\n"); CoTaskMemFree(progid); } @@ -156,20 +151,20 @@ static void test_ProgIDFromCLSID(void) ok(hr == REGDB_E_CLASSNOTREG, "ProgIDFromCLSID returned %08x\n", hr); ok(progid == NULL, "ProgIDFromCLSID returns with progid %p\n", progid); - hr = ProgIDFromCLSID(&CLSID_CDeviceMoniker, NULL); + hr = ProgIDFromCLSID(&CLSID_StdFont, NULL); ok(hr == E_INVALIDARG, "ProgIDFromCLSID should return E_INVALIDARG instead of 0x%08x\n", hr); } static void test_CLSIDFromProgID(void) { CLSID clsid; - HRESULT hr = CLSIDFromProgID(devicedotone, &clsid); + HRESULT hr = CLSIDFromProgID(stdfont, &clsid); ok(hr == S_OK, "CLSIDFromProgID failed with error 0x%08x\n", hr); - ok(IsEqualCLSID(&clsid, &CLSID_CDeviceMoniker), "clsid wasn't equal to CLSID_CDeviceMoniker\n"); + ok(IsEqualCLSID(&clsid, &CLSID_StdFont), "clsid wasn't equal to CLSID_StdFont\n"); - hr = CLSIDFromString(devicedotone, &clsid); + hr = CLSIDFromString(stdfont, &clsid); ok_ole_success(hr, "CLSIDFromString"); - ok(IsEqualCLSID(&clsid, &CLSID_CDeviceMoniker), "clsid wasn't equal to CLSID_CDeviceMoniker\n"); + ok(IsEqualCLSID(&clsid, &CLSID_StdFont), "clsid wasn't equal to CLSID_StdFont\n"); /* test some failure cases */ @@ -188,9 +183,9 @@ static void test_CLSIDFromProgID(void) static void test_CLSIDFromString(void) { CLSID clsid; - HRESULT hr = CLSIDFromString(wszCLSID_CDeviceMoniker, &clsid); + HRESULT hr = CLSIDFromString(wszCLSID_StdFont, &clsid); ok_ole_success(hr, "CLSIDFromString"); - ok(IsEqualCLSID(&clsid, &CLSID_CDeviceMoniker), "clsid wasn't equal to CLSID_CDeviceMoniker\n"); + ok(IsEqualCLSID(&clsid, &CLSID_StdFont), "clsid wasn't equal to CLSID_StdFont\n"); hr = CLSIDFromString(NULL, &clsid); ok_ole_success(hr, "CLSIDFromString"); @@ -202,19 +197,19 @@ static void test_StringFromGUID2(void) WCHAR str[50]; int len; /* Test corner cases for buffer size */ - len = StringFromGUID2(&CLSID_CDeviceMoniker,str,50); + len = StringFromGUID2(&CLSID_StdFont,str,50); ok(len == 39, "len: %d (expected 39)\n", len); - ok(!lstrcmpiW(str, wszCLSID_CDeviceMoniker),"string wan't equal for CLSID_CDeviceMoniker\n"); + ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wan't equal for CLSID_StdFont\n"); memset(str,0,sizeof str); - len = StringFromGUID2(&CLSID_CDeviceMoniker,str,39); + len = StringFromGUID2(&CLSID_StdFont,str,39); ok(len == 39, "len: %d (expected 39)\n", len); - ok(!lstrcmpiW(str, wszCLSID_CDeviceMoniker),"string wan't equal for CLSID_CDeviceMoniker\n"); + ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wan't equal for CLSID_StdFont\n"); - len = StringFromGUID2(&CLSID_CDeviceMoniker,str,38); + len = StringFromGUID2(&CLSID_StdFont,str,38); ok(len == 0, "len: %d (expected 0)\n", len); - len = StringFromGUID2(&CLSID_CDeviceMoniker,str,30); + len = StringFromGUID2(&CLSID_StdFont,str,30); ok(len == 0, "len: %d (expected 0)\n", len); }
1
0
0
0
Alexandre Julliard : ole32/tests: Fix a couple of global stream test failures on Win9x.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 5ca20cd482130aa916575d8f1a56899fa01f0434 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ca20cd482130aa916575d8f1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 13 21:45:04 2008 +0100 ole32/tests: Fix a couple of global stream test failures on Win9x. --- dlls/ole32/tests/hglobalstream.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/tests/hglobalstream.c b/dlls/ole32/tests/hglobalstream.c index eb98a18..cae13ed 100644 --- a/dlls/ole32/tests/hglobalstream.c +++ b/dlls/ole32/tests/hglobalstream.c @@ -92,7 +92,8 @@ static void test_streamonhglobal(IStream *pStream) ull.u.HighPart = -1; ull.u.LowPart = -1; hr = IStream_SetSize(pStream, ull); - ok(hr == E_OUTOFMEMORY, "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr); + ok(hr == E_OUTOFMEMORY || broken(hr == S_OK), /* win9x */ + "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr); } static HRESULT WINAPI TestStream_QueryInterface(IStream *iface, REFIID riid, void **ppv) @@ -261,18 +262,19 @@ static void test_copyto(void) static void test_freed_hglobal(void) { + static const char teststring[] = "this is a test string"; HRESULT hr; IStream *pStream; HGLOBAL hglobal; char *p; - char buffer[10]; + char buffer[sizeof(teststring) + 8]; ULARGE_INTEGER ull; ULONG read, written; - hglobal = GlobalAlloc(GMEM_DDESHARE|GMEM_NODISCARD|GMEM_MOVEABLE, strlen("Rob") + 1); + hglobal = GlobalAlloc(GMEM_DDESHARE|GMEM_NODISCARD|GMEM_MOVEABLE, strlen(teststring) + 1); ok(hglobal != NULL, "GlobalAlloc failed with error %d\n", GetLastError()); p = GlobalLock(hglobal); - strcpy(p, "Rob"); + strcpy(p, teststring); GlobalUnlock(hglobal); hr = CreateStreamOnHGlobal(hglobal, FALSE, &pStream); @@ -280,8 +282,10 @@ static void test_freed_hglobal(void) hr = IStream_Read(pStream, buffer, sizeof(buffer), &read); ok_ole_success(hr, "IStream_Read"); - ok(!strcmp(buffer, "Rob"), "buffer data %s differs\n", buffer); - ok(read == strlen("Rob") + 1, "read should be 4 instead of %d\n", read); + ok(!strcmp(buffer, teststring), "buffer data %s differs\n", buffer); + ok(read == sizeof(teststring) || + broken(read == ((sizeof(teststring) + 3) & ~3)), /* win9x rounds the size */ + "read should be sizeof(teststring) instead of %d\n", read); GlobalFree(hglobal);
1
0
0
0
Paul Vriens : msi/tests: Skip some tests on Win9x and WinMe.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 1dba41b104a12dccff2468e572c5d0683fb7cc3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1dba41b104a12dccff2468e57…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Thu Nov 13 15:34:22 2008 +0100 msi/tests: Skip some tests on Win9x and WinMe. --- dlls/msi/tests/install.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 6ae2a51..bc98840 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -5185,6 +5185,17 @@ static void test_MsiConfigureProductEx(void) CHAR keypath[MAX_PATH * 2]; CHAR localpack[MAX_PATH]; + /* skip these tests if we are on Win9x or WinMe */ + lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); + lstrcatA(keypath, "Installer\\UserData"); + res = RegOpenKeyA(HKEY_LOCAL_MACHINE, keypath, &props); + if (res == ERROR_FILE_NOT_FOUND) + { + win_skip("Different registry keys on Win9x and WinMe\n"); + return; + } + RegCloseKey(props); + CreateDirectoryA("msitest", NULL); create_file("msitest\\hydrogen", 500); create_file("msitest\\helium", 500);
1
0
0
0
Paul Vriens : gdi32/tests: Fix a few failures on Win9x and WinMe.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: decb70d95cb9a619433df5aeb38e4e023dc7cff4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=decb70d95cb9a619433df5aeb…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Thu Nov 13 14:41:34 2008 +0100 gdi32/tests: Fix a few failures on Win9x and WinMe. --- dlls/gdi32/tests/metafile.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 499fd6c..85bc529 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -2119,7 +2119,9 @@ static void test_SetEnhMetaFileBits(void) SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(sizeof(data), data); ok(!hemf, "SetEnhMetaFileBits should fail\n"); - ok(GetLastError() == ERROR_INVALID_DATA, "expected ERROR_INVALID_DATA, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_DATA || + GetLastError() == ERROR_INVALID_PARAMETER, /* Win9x, WinMe */ + "expected ERROR_INVALID_DATA or ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); emh = (ENHMETAHEADER *)data; memset(emh, 0, sizeof(*emh)); @@ -2141,15 +2143,23 @@ static void test_SetEnhMetaFileBits(void) emh->nBytes++; SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(emh->nBytes, data); - ok(!hemf, "SetEnhMetaFileBits should fail\n"); - /* XP doesn't set error in this case */ + ok(!hemf || + broken(hemf != NULL), /* Win9x, WinMe */ + "SetEnhMetaFileBits should fail\n"); + todo_wine + ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError()); + DeleteEnhMetaFile(hemf); emh->dSignature = 0; emh->nBytes--; SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(emh->nBytes, data); - ok(!hemf, "SetEnhMetaFileBits should fail\n"); - /* XP doesn't set error in this case */ + ok(!hemf || + broken(hemf != NULL), /* Win9x, WinMe */ + "SetEnhMetaFileBits should fail\n"); + todo_wine + ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError()); + DeleteEnhMetaFile(hemf); } START_TEST(metafile)
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixTransformation2D.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 09c6caea062c4aeaaea874bf6805ba31afdce39d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09c6caea062c4aeaaea874bf6…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Wed Nov 12 19:16:30 2008 +0100 d3dx8: Implement D3DXMatrixTransformation2D. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/math.c | 80 +++++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/tests/math.c | 79 ++++++++++++++++++++++++++++++++++++++++++ include/d3dx9math.h | 1 + 4 files changed, 161 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 9058dd7..d7fba36 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -225,7 +225,7 @@ @ stdcall D3DXMatrixScaling(ptr long long long) d3dx8.D3DXMatrixScaling @ stdcall D3DXMatrixShadow(ptr ptr ptr) d3dx8.D3DXMatrixShadow @ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXMatrixTransformation -@ stub D3DXMatrixTransformation2D +@ stdcall D3DXMatrixTransformation2D(ptr ptr long ptr ptr long ptr) @ stdcall D3DXMatrixTranslation(ptr long long long) d3dx8.D3DXMatrixTranslation @ stdcall D3DXMatrixTranspose(ptr ptr) d3dx8.D3DXMatrixTranspose @ stub D3DXOptimizeFaces diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c index b5cdde2..a00ffc5 100644 --- a/dlls/d3dx9_36/math.c +++ b/dlls/d3dx9_36/math.c @@ -1,6 +1,7 @@ /* * Mathematical operations specific to D3DX9. * + * Copyright (C) 2008 David Adam * Copyright (C) 2008 Philip Nilsson * * This library is free software; you can redistribute it and/or @@ -130,6 +131,85 @@ HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutr } /************************************************************************* + * D3DXMatrixTransformation2D + */ +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D( + D3DXMATRIX *pout, CONST D3DXVECTOR2 *pscalingcenter, + FLOAT scalingrotation, CONST D3DXVECTOR2 *pscaling, + CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, + CONST D3DXVECTOR2 *ptranslation) +{ + D3DXQUATERNION rot, sca_rot; + D3DXVECTOR3 rot_center, sca, sca_center, trans; + + if ( pscalingcenter ) + { + sca_center.x=pscalingcenter->x; + sca_center.y=pscalingcenter->y; + sca_center.z=0.0f; + } + else + { + sca_center.x=0.0f; + sca_center.y=0.0f; + sca_center.z=0.0f; + } + + if ( pscaling ) + { + sca.x=pscaling->x; + sca.y=pscaling->y; + sca.z=0.0f; + } + else + { + sca.x=0.0f; + sca.y=0.0f; + sca.z=0.0f; + } + + if ( protationcenter ) + { + rot_center.x=protationcenter->x; + rot_center.y=protationcenter->y; + rot_center.z=0.0f; + } + else + { + rot_center.x=0.0f; + rot_center.y=0.0f; + rot_center.z=0.0f; + } + + if ( ptranslation ) + { + trans.x=ptranslation->x; + trans.y=ptranslation->y; + trans.z=0.0f; + } + else + { + trans.x=0.0f; + trans.y=0.0f; + trans.z=0.0f; + } + + rot.w=cos(rotation/2.0f); + rot.x=0.0f; + rot.y=0.0f; + rot.z=sin(rotation/2.0f); + + sca_rot.w=cos(scalingrotation/2.0f); + sca_rot.x=0.0f; + sca_rot.y=0.0f; + sca_rot.z=sin(scalingrotation/2.0f); + + D3DXMatrixTransformation(pout, &sca_center, &sca_rot, &sca, &rot_center, &rot, &trans); + + return pout; +} + +/************************************************************************* * D3DXPlaneTransformArray */ D3DXPLANE* WINAPI D3DXPlaneTransformArray( diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index 2930d34..cc71b33 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -1,4 +1,5 @@ /* + * Copyright 2008 David Adam * Copyright 2008 Philip Nilsson * * This library is free software; you can redistribute it and/or @@ -584,6 +585,83 @@ static void test_Matrix_Decompose(void) ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %x\n", hr); } +static void test_Matrix_Transformation2D(void) +{ + D3DXMATRIX exp_mat, got_mat; + D3DXVECTOR2 rot_center, sca, sca_center, trans; + FLOAT rot, sca_rot; + + rot_center.x = 3.0f; + rot_center.y = 4.0f; + + sca.x = 12.0f; + sca.y = -3.0f; + + sca_center.x = 9.0f; + sca_center.y = -5.0f; + + trans.x = -6.0f; + trans.y = 7.0f; + + rot = D3DX_PI/3.0f; + + sca_rot = 5.0f*D3DX_PI/4.0f; + + exp_mat.m[0][0] = -4.245192f; + exp_mat.m[1][0] = -0.147116f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = 45.265373f; + exp_mat.m[0][1] = 7.647113f; + exp_mat.m[1][1] = 8.745192f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = -13.401899f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = 0.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, &sca, &rot_center, rot, &trans); + + expect_mat(&exp_mat, &got_mat); + +/*_________*/ + + sca_center.x = 9.0f; + sca_center.y = -5.0f; + + trans.x = -6.0f; + trans.y = 7.0f; + + rot = D3DX_PI/3.0f; + + sca_rot = 5.0f*D3DX_PI/4.0f; + + exp_mat.m[0][0] = 0.0f; + exp_mat.m[1][0] = 0.0f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = 2.830127f; + exp_mat.m[0][1] = 0.0f; + exp_mat.m[1][1] = 0.0f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = 12.294229f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = 0.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, NULL, NULL, rot, &trans); + + expect_mat(&exp_mat, &got_mat); +} + static void test_D3DXVec_Array(void) { unsigned int i; @@ -725,5 +803,6 @@ START_TEST(math) { test_Matrix_AffineTransformation2D(); test_Matrix_Decompose(); + test_Matrix_Transformation2D(); test_D3DXVec_Array(); } diff --git a/include/d3dx9math.h b/include/d3dx9math.h index 9992919..83b8749 100644 --- a/include/d3dx9math.h +++ b/include/d3dx9math.h @@ -296,6 +296,7 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane); D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation); +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, CONST D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, CONST D3DXVECTOR2 *pscaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation); D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixAffineTransformation2D.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 4f1d5c26d1fc8bbb6dbd8a34699fb80a192ae4e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4f1d5c26d1fc8bbb6dbd8a346…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Wed Nov 12 18:54:50 2008 +0100 d3dx8: Implement D3DXMatrixAffineTransformation2D. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/math.c | 47 +++++++++++++ dlls/d3dx9_36/tests/math.c | 160 ++++++++++++++++++++++++++++++++++++++++++- include/d3dx9math.h | 1 + 4 files changed, 208 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 2e68ba2..9058dd7 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -197,7 +197,7 @@ @ stub D3DXLoadVolumeFromResourceW @ stub D3DXLoadVolumeFromVolume @ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) d3dx8.D3DXMatrixAffineTransformation -@ stub D3DXMatrixAffineTransformation2D +@ stdcall D3DXMatrixAffineTransformation2D(ptr long ptr long ptr) @ stdcall D3DXMatrixDecompose(ptr ptr ptr ptr) @ stdcall D3DXMatrixDeterminant(ptr) d3dx8.D3DXMatrixfDeterminant @ stdcall D3DXMatrixInverse(ptr ptr ptr) d3dx8.D3DXMatrixInverse diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c index cbfac84..b5cdde2 100644 --- a/dlls/d3dx9_36/math.c +++ b/dlls/d3dx9_36/math.c @@ -29,6 +29,53 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); /************************************************************************* + * D3DXMatrixAffineTransformation2D + */ +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D( + D3DXMATRIX *pout, FLOAT scaling, + CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, + CONST D3DXVECTOR2 *ptranslation) +{ + D3DXQUATERNION rot; + D3DXVECTOR3 rot_center, trans; + + rot.w=cos(rotation/2.0f); + rot.x=0.0f; + rot.y=0.0f; + rot.z=sin(rotation/2.0f); + + if ( protationcenter ) + { + rot_center.x=protationcenter->x; + rot_center.y=protationcenter->y; + rot_center.z=0.0f; + } + else + { + rot_center.x=0.0f; + rot_center.y=0.0f; + rot_center.z=0.0f; + } + + if ( ptranslation ) + { + trans.x=ptranslation->x; + trans.y=ptranslation->y; + trans.z=0.0f; + } + else + { + trans.x=0.0f; + trans.y=0.0f; + trans.z=0.0f; + } + + D3DXMatrixAffineTransformation(pout, scaling, &rot_center, &rot, &trans); + + return pout; +} + +/************************************************************************* * D3DXMatrixDecompose */ HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, D3DXMATRIX *pm) diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index ff5e110..2930d34 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -17,7 +17,7 @@ */ #include "wine/test.h" -#include "d3dx9math.h" +#include "d3dx9.h" #define ARRAY_SIZE 5 @@ -25,6 +25,38 @@ #define relative_error(exp, out) ((exp == out) ? 0.0f : (fabs(out - exp) / fabs(exp))) +static inline BOOL compare_matrix(const D3DXMATRIX *m1, const D3DXMATRIX *m2) +{ + int i, j; + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + if (fabs(U(*m1).m[i][j] - U(*m2).m[i][j]) > admitted_error) + return FALSE; + } + } + + return TRUE; +} + +#define expect_mat(expectedmat, gotmat) \ +do { \ + const D3DXMATRIX *__m1 = (expectedmat); \ + const D3DXMATRIX *__m2 = (gotmat); \ + ok(compare_matrix(__m1, __m2), "Expected matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n)\n\n" \ + "Got matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f)\n", \ + U(*__m1).m[0][0], U(*__m1).m[0][1], U(*__m1).m[0][2], U(*__m1).m[0][3], \ + U(*__m1).m[1][0], U(*__m1).m[1][1], U(*__m1).m[1][2], U(*__m1).m[1][3], \ + U(*__m1).m[2][0], U(*__m1).m[2][1], U(*__m1).m[2][2], U(*__m1).m[2][3], \ + U(*__m1).m[3][0], U(*__m1).m[3][1], U(*__m1).m[3][2], U(*__m1).m[3][3], \ + U(*__m2).m[0][0], U(*__m2).m[0][1], U(*__m2).m[0][2], U(*__m2).m[0][3], \ + U(*__m2).m[1][0], U(*__m2).m[1][1], U(*__m2).m[1][2], U(*__m2).m[1][3], \ + U(*__m2).m[2][0], U(*__m2).m[2][1], U(*__m2).m[2][2], U(*__m2).m[2][3], \ + U(*__m2).m[3][0], U(*__m2).m[3][1], U(*__m2).m[3][2], U(*__m2).m[3][3]); \ +} while(0) + #define compare_rotation(exp, got) \ ok(fabs(exp.w - got.w) < admitted_error && \ fabs(exp.x - got.x) < admitted_error && \ @@ -88,6 +120,131 @@ * says so too). */ +static void test_Matrix_AffineTransformation2D(void) +{ + D3DXMATRIX exp_mat, got_mat; + D3DXVECTOR2 center, position; + FLOAT angle, scale; + + center.x = 3.0f; + center.y = 4.0f; + + position.x = -6.0f; + position.y = 7.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + exp_mat.m[0][0] = 10.0f; + exp_mat.m[1][0] = -17.320507f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = -1.035898f; + exp_mat.m[0][1] = 17.320507f; + exp_mat.m[1][1] = 10.0f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = 6.401924f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = 20.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, &position); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + center.x = 3.0f; + center.y = 4.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + exp_mat.m[0][0] = 10.0f; + exp_mat.m[1][0] = -17.320507f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = 4.964102f; + exp_mat.m[0][1] = 17.320507f; + exp_mat.m[1][1] = 10.0f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = -0.598076f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = 20.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, NULL); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + position.x = -6.0f; + position.y = 7.0f; + + angle = D3DX_PI/3.0f; + + scale = 20.0f; + + exp_mat.m[0][0] = 10.0f; + exp_mat.m[1][0] = -17.320507f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = -6.0f; + exp_mat.m[0][1] = 17.320507f; + exp_mat.m[1][1] = 10.0f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = 7.0f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = 20.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, &position); + + expect_mat(&exp_mat, &got_mat); + +/*______________*/ + + angle = 5.0f * D3DX_PI/4.0f; + + scale = -20.0f; + + exp_mat.m[0][0] = 14.142133f; + exp_mat.m[1][0] = -14.142133f; + exp_mat.m[2][0] = 0.0f; + exp_mat.m[3][0] = 0.0f; + exp_mat.m[0][1] = 14.142133; + exp_mat.m[1][1] = 14.142133f; + exp_mat.m[2][1] = 0.0f; + exp_mat.m[3][1] = 0.0f; + exp_mat.m[0][2] = 0.0f; + exp_mat.m[1][2] = 0.0f; + exp_mat.m[2][2] = -20.0f; + exp_mat.m[3][2] = 0.0f; + exp_mat.m[0][3] = 0.0f; + exp_mat.m[1][3] = 0.0f; + exp_mat.m[2][3] = 0.0f; + exp_mat.m[3][3] = 1.0f; + + D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, NULL); + + expect_mat(&exp_mat, &got_mat); +} + static void test_Matrix_Decompose(void) { D3DXMATRIX pm; @@ -566,6 +723,7 @@ static void test_D3DXVec_Array(void) START_TEST(math) { + test_Matrix_AffineTransformation2D(); test_Matrix_Decompose(); test_D3DXVec_Array(); } diff --git a/include/d3dx9math.h b/include/d3dx9math.h index 54e7762..9992919 100644 --- a/include/d3dx9math.h +++ b/include/d3dx9math.h @@ -267,6 +267,7 @@ D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, float scaling, D3DXVECTOR3 *rotationcenter, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation); +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation); HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, D3DXMATRIX *pm); FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
1
0
0
0
Nikolay Sivov : gdiplus: Return some token value on startup.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 63e8294593c18a5027c772c39bc91cc28b5918fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63e8294593c18a5027c772c39…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Thu Nov 13 16:00:12 2008 +0300 gdiplus: Return some token value on startup. --- dlls/gdiplus/gdiplus.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 17e4d33..79b9ca0 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -93,6 +93,8 @@ Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput output->NotificationUnhook = NotificationUnhook; } + *token = 0xdeadbeef; + /* FIXME: DebugEventCallback ignored */ return Ok;
1
0
0
0
Alexandre Julliard : msvcrt/tests: Run time tests for the current year instead of 1970 and fix wrong DST assumptions .
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 64de27193998770c99b471b3266c5f0d4cbdfc8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64de27193998770c99b471b32…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 13 14:15:56 2008 +0100 msvcrt/tests: Run time tests for the current year instead of 1970 and fix wrong DST assumptions. --- dlls/msvcrt/tests/time.c | 79 +++++++++++++++++++++++++++++---------------- 1 files changed, 51 insertions(+), 28 deletions(-) diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 83bdc15..ac782ca 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -32,6 +32,19 @@ #define MINSPERHOUR 60 #define HOURSPERDAY 24 +static int get_test_year(time_t *start) +{ + time_t now = time(NULL); + struct tm *tm = localtime(&now); + + /* compute start of year in seconds */ + *start = SECSPERDAY * ((tm->tm_year - 70) * 365 + + (tm->tm_year - 69) / 4 - + (tm->tm_year - 1) / 100 + + (tm->tm_year + 299) / 400); + return tm->tm_year; +} + static void test_ctime(void) { time_t badtime = -1; @@ -65,14 +78,20 @@ static void test_mktime(void) time_t nulltime, local_time; char TZ_env[256]; char buffer[64]; - int secs; + int year; + time_t ref, secs; + + year = get_test_year( &ref ); + ref += SECSPERDAY; ok (res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n"); WideCharToMultiByte( CP_ACP, 0, tzinfo.StandardName, -1, buffer, sizeof(buffer), NULL, NULL ); trace( "bias %d std %d dst %d zone %s\n", tzinfo.Bias, tzinfo.StandardBias, tzinfo.DaylightBias, buffer ); /* Bias may be positive or negative, to use offset of one day */ - secs= SECSPERDAY - tzinfo.Bias * SECSPERMIN; + my_tm = *localtime(&ref); /* retrieve current dst flag */ + secs = SECSPERDAY - tzinfo.Bias * SECSPERMIN; + secs -= (my_tm.tm_isdst ? tzinfo.DaylightBias : tzinfo.StandardBias) * SECSPERMIN; my_tm.tm_mday = 1 + secs/SECSPERDAY; secs = secs % SECSPERDAY; my_tm.tm_hour = secs / SECSPERHOUR; @@ -81,22 +100,21 @@ static void test_mktime(void) secs = secs % SECSPERMIN; my_tm.tm_sec = secs; - my_tm.tm_year = 70; + my_tm.tm_year = year; my_tm.tm_mon = 0; - my_tm.tm_isdst= 0; sav_tm = my_tm; - + local_time = mktime(&my_tm); - ok(((DWORD)local_time == SECSPERDAY), "mktime returned %u, expected %u\n", - (DWORD)local_time, SECSPERDAY); + ok(local_time == ref, "mktime returned %u, expected %u\n", + (DWORD)local_time, (DWORD)ref); /* now test some unnormalized struct tm's */ my_tm = sav_tm; my_tm.tm_sec += 60; my_tm.tm_min -= 1; local_time = mktime(&my_tm); - ok(((DWORD)local_time == SECSPERDAY), "Unnormalized mktime returned %u, expected %u\n", - (DWORD)local_time, SECSPERDAY); + ok(local_time == ref, "Unnormalized mktime returned %u, expected %u\n", + (DWORD)local_time, (DWORD)ref); ok( my_tm.tm_year == sav_tm.tm_year && my_tm.tm_mon == sav_tm.tm_mon && my_tm.tm_mday == sav_tm.tm_mday && my_tm.tm_hour == sav_tm.tm_hour && my_tm.tm_sec == sav_tm.tm_sec, @@ -109,8 +127,8 @@ static void test_mktime(void) my_tm.tm_min -= 60; my_tm.tm_hour += 1; local_time = mktime(&my_tm); - ok(((DWORD)local_time == SECSPERDAY), "Unnormalized mktime returned %u, expected %u\n", - (DWORD)local_time, SECSPERDAY); + ok(local_time == ref, "Unnormalized mktime returned %u, expected %u\n", + (DWORD)local_time, (DWORD)ref); ok( my_tm.tm_year == sav_tm.tm_year && my_tm.tm_mon == sav_tm.tm_mon && my_tm.tm_mday == sav_tm.tm_mday && my_tm.tm_hour == sav_tm.tm_hour && my_tm.tm_sec == sav_tm.tm_sec, @@ -123,8 +141,8 @@ static void test_mktime(void) my_tm.tm_mon -= 12; my_tm.tm_year += 1; local_time = mktime(&my_tm); - ok(((DWORD)local_time == SECSPERDAY), "Unnormalized mktime returned %u, expected %u\n", - (DWORD)local_time, SECSPERDAY); + ok(local_time == ref, "Unnormalized mktime returned %u, expected %u\n", + (DWORD)local_time, (DWORD)ref); ok( my_tm.tm_year == sav_tm.tm_year && my_tm.tm_mon == sav_tm.tm_mon && my_tm.tm_mday == sav_tm.tm_mday && my_tm.tm_hour == sav_tm.tm_hour && my_tm.tm_sec == sav_tm.tm_sec, @@ -137,8 +155,8 @@ static void test_mktime(void) my_tm.tm_mon += 12; my_tm.tm_year -= 1; local_time = mktime(&my_tm); - ok(((DWORD)local_time == SECSPERDAY), "Unnormalized mktime returned %u, expected %u\n", - (DWORD)local_time, SECSPERDAY); + ok(local_time == ref, "Unnormalized mktime returned %u, expected %u\n", + (DWORD)local_time, (DWORD)ref); ok( my_tm.tm_year == sav_tm.tm_year && my_tm.tm_mon == sav_tm.tm_mon && my_tm.tm_mday == sav_tm.tm_mday && my_tm.tm_hour == sav_tm.tm_hour && my_tm.tm_sec == sav_tm.tm_sec, @@ -149,7 +167,7 @@ static void test_mktime(void) sav_tm.tm_hour,sav_tm.tm_sec); /* now a bad time example */ my_tm = sav_tm; - my_tm.tm_year -= 1; + my_tm.tm_year = 69; local_time = mktime(&my_tm); ok((local_time == -1), "(bad time) mktime returned %d, expected -1\n", (int)local_time); @@ -159,7 +177,7 @@ static void test_mktime(void) _snprintf(TZ_env,255,"TZ=%s",(getenv("TZ")?getenv("TZ"):"")); putenv("TZ=GMT"); nulltime = mktime(&my_tm); - ok(((DWORD)nulltime == SECSPERDAY),"mktime returned 0x%08x\n",(DWORD)nulltime); + ok(nulltime == ref,"mktime returned 0x%08x\n",(DWORD)nulltime); putenv(TZ_env); } @@ -167,16 +185,21 @@ static void test_localtime(void) { TIME_ZONE_INFORMATION tzinfo; DWORD res = GetTimeZoneInformation(&tzinfo); - time_t gmt = (time_t)(SECSPERDAY + tzinfo.Bias * SECSPERMIN); + time_t gmt, ref; char TZ_env[256]; struct tm* lt; - + int year = get_test_year( &ref ); + int is_leap = !(year % 4) && ((year % 100) || !((year + 300) % 400)); + + gmt = ref + SECSPERDAY + tzinfo.Bias * SECSPERMIN; ok (res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n"); lt = localtime(&gmt); - ok(((lt->tm_year == 70) && (lt->tm_mon == 0) && (lt->tm_yday == 1) && - (lt->tm_mday == 2) && (lt->tm_wday == 5) && (lt->tm_hour == 0) && - (lt->tm_min == 0) && (lt->tm_sec == 0) && (lt->tm_isdst == 0)), + gmt += (lt->tm_isdst ? tzinfo.DaylightBias : tzinfo.StandardBias) * SECSPERMIN; + lt = localtime(&gmt); + ok(((lt->tm_year == year) && (lt->tm_mon == 0) && (lt->tm_yday == 1) && + (lt->tm_mday == 2) && (lt->tm_hour == 0) && + (lt->tm_min == 0) && (lt->tm_sec == 0)), "Wrong date:Year %d mon %d yday %d mday %d wday %d hour %d min %d sec %d dst %d\n", lt->tm_year, lt->tm_mon, lt->tm_yday, lt->tm_mday, lt->tm_wday, lt->tm_hour, lt->tm_min, lt->tm_sec, lt->tm_isdst); @@ -184,21 +207,21 @@ static void test_localtime(void) _snprintf(TZ_env,255,"TZ=%s",(getenv("TZ")?getenv("TZ"):"")); putenv("TZ=GMT"); lt = localtime(&gmt); - ok(((lt->tm_year == 70) && (lt->tm_mon == 0) && (lt->tm_yday == 1) && - (lt->tm_mday == 2) && (lt->tm_wday == 5) && (lt->tm_hour == 0) && - (lt->tm_min == 0) && (lt->tm_sec == 0) && (lt->tm_isdst == 0)), + ok(((lt->tm_year == year) && (lt->tm_mon == 0) && (lt->tm_yday == 1) && + (lt->tm_mday == 2) && (lt->tm_hour == 0) && + (lt->tm_min == 0) && (lt->tm_sec == 0)), "Wrong date:Year %d mon %d yday %d mday %d wday %d hour %d min %d sec %d dst %d\n", lt->tm_year, lt->tm_mon, lt->tm_yday, lt->tm_mday, lt->tm_wday, lt->tm_hour, lt->tm_min, lt->tm_sec, lt->tm_isdst); putenv(TZ_env); /* June 22 */ - gmt += 201 * SECSPERDAY; + gmt = ref + 202 * SECSPERDAY + tzinfo.Bias * SECSPERMIN; lt = localtime(&gmt); gmt += (lt->tm_isdst ? tzinfo.DaylightBias : tzinfo.StandardBias) * SECSPERMIN; lt = localtime(&gmt); - ok(((lt->tm_year == 70) && (lt->tm_mon == 6) && (lt->tm_yday == 202) && - (lt->tm_mday == 22) && (lt->tm_wday == 3) && (lt->tm_hour == 0) && + ok(((lt->tm_year == year) && (lt->tm_mon == 6) && (lt->tm_yday == 202) && + (lt->tm_mday == 22 - is_leap) && (lt->tm_hour == 0) && (lt->tm_min == 0) && (lt->tm_sec == 0)), "Wrong date:Year %d mon %d yday %d mday %d wday %d hour %d min %d sec %d dst %d\n", lt->tm_year, lt->tm_mon, lt->tm_yday, lt->tm_mday, lt->tm_wday, lt->tm_hour,
1
0
0
0
Alistair Leslie-Hughes : shdocvw: Correct tests.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: 27685adaf1e70d604495e7bf4985a5873f4702db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27685adaf1e70d604495e7bf4…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Nov 13 20:55:59 2008 +1100 shdocvw: Correct tests. --- dlls/shdocvw/tests/webbrowser.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index 3aa4bdd..dad9527 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -1988,31 +1988,31 @@ static void test_QueryInterface(IUnknown *unk) hres = IUnknown_QueryInterface(unk, &IID_IQuickActivate, (void**)&qa); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qa == NULL, "qa=%p, ezpected NULL\n", qa); + ok(qa == NULL, "qa=%p, expected NULL\n", qa); hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&runnable); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(runnable == NULL, "runnable=%p, ezpected NULL\n", runnable); + ok(runnable == NULL, "runnable=%p, expected NULL\n", runnable); hres = IUnknown_QueryInterface(unk, &IID_IPerPropertyBrowsing, (void**)&propbrowse); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(propbrowse == NULL, "propbrowse=%p, ezpected NULL\n", runnable); + ok(propbrowse == NULL, "propbrowse=%p, expected NULL\n", propbrowse); hres = IUnknown_QueryInterface(unk, &IID_IOleCache, (void**)&cache); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(cache == NULL, "cache=%p, ezpected NULL\n", runnable); + ok(cache == NULL, "cache=%p, expected NULL\n", cache); hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceSite, (void**)&inplace); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(inplace == NULL, "inplace=%p, ezpected NULL\n", runnable); + ok(inplace == NULL, "inplace=%p, expected NULL\n", inplace); hres = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void**)&site); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(site == NULL, "inplace=%p, ezpected NULL\n", runnable); + ok(site == NULL, "site=%p, expected NULL\n", site); hres = IUnknown_QueryInterface(unk, &IID_IViewObjectEx, (void**)&viewex); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(viewex == NULL, "viewex=%p, ezpected NULL\n", runnable); + ok(viewex == NULL, "viewex=%p, expected NULL\n", viewex); }
1
0
0
0
Dylan Smith : richedit: Initial testing of ITextServices methods.
by Alexandre Julliard
13 Nov '08
13 Nov '08
Module: wine Branch: master Commit: e4ef9c5c15c99f03c81d508a0a1ebe169460e7de URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4ef9c5c15c99f03c81d508a0…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Wed Nov 12 14:47:24 2008 -0500 richedit: Initial testing of ITextServices methods. --- dlls/riched20/tests/txtsrv.c | 91 +++++++++++++++++++++++++++++++++++++++++- include/textserv.h | 19 --------- 2 files changed, 89 insertions(+), 21 deletions(-) diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index ffc52fd..3d47490 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -34,6 +34,35 @@ static HMODULE hmoduleRichEdit; +/* Define C Macros for ITextServices calls. */ + +/* Use a special table for x86 machines to convert the thiscall + * calling convention. This isn't needed on other platforms. */ +#ifdef __i386__ +#define TXTSERV_VTABLE(This) (&itextServicesStdcallVtbl) +#else /* __i386__ */ +#define TXTSERV_VTABLE(This) (This)->lpVtbl +#endif /* __i386__ */ + +#define ITextServices_TxSendMessage(This,a,b,c,d) TXTSERV_VTABLE(This)->TxSendMessage(This,a,b,c,d) +#define ITextServices_TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l) TXTSERV_VTABLE(This)->TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l) +#define ITextServices_TxGetHScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetHScroll(This,a,b,c,d,e) +#define ITextServices_TxGetVScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetVScroll(This,a,b,c,d,e) +#define ITextServices_OnTxSetCursor(This,a,b,c,d,e,f,g,h,i) TXTSERV_VTABLE(This)->OnTxSetCursor(This,a,b,c,d,e,f,g,h,i) +#define ITextServices_TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j) TXTSERV_VTABLE(This)->TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j) +#define ITextServices_OnTxInplaceActivate(This,a) TXTSERV_VTABLE(This)->OnTxInplaceActivate(This,a) +#define ITextServices_OnTxInplaceDeactivate(This) TXTSERV_VTABLE(This)->OnTxInplaceDeactivate(This) +#define ITextServices_OnTxUIActivate(This) TXTSERV_VTABLE(This)->OnTxUIActivate(This) +#define ITextServices_OnTxUIDeactivate(This) TXTSERV_VTABLE(This)->OnTxUIDeactivate(This) +#define ITextServices_TxGetText(This,a) TXTSERV_VTABLE(This)->TxGetText(This,a) +#define ITextServices_TxSetText(This,a) TXTSERV_VTABLE(This)->TxSetText(This,a) +#define ITextServices_TxGetCurrentTargetX(This,a) TXTSERV_VTABLE(This)->TxGetCurrentTargetX(This,a) +#define ITextServices_TxGetBaseLinePos(This,a) TXTSERV_VTABLE(This)->TxGetBaseLinePos(This,a) +#define ITextServices_TxGetNaturalSize(This,a,b,c,d,e,f,g,h) TXTSERV_VTABLE(This)->TxGetNaturalSize(This,a,b,c,d,e,f,g,h) +#define ITextServices_TxGetDropTarget(This,a) TXTSERV_VTABLE(This)->TxGetDropTarget(This,a) +#define ITextServices_OnTxPropertyBitsChange(This,a,b) TXTSERV_VTABLE(This)->OnTxPropertyBitsChange(This,a,b) +#define ITextServices_TxGetCachedSize(This,a,b) TXTSERV_VTABLE(This)->TxGetCachedSize(This,a,b) + /* Set the WINETEST_DEBUG environment variable to be greater than 1 for verbose * function call traces of ITextHost. */ #define TRACECALL if(winetest_debug > 1) trace @@ -412,6 +441,8 @@ static HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, return E_NOTIMPL; } +static ITextServicesVtbl itextServicesStdcallVtbl; + static ITextHostVtbl itextHostVtbl = { ITextHostImpl_QueryInterface, ITextHostImpl_AddRef, @@ -461,6 +492,8 @@ static ITextServices *txtserv = NULL; static ITextHostTestImpl *dummyTextHost; static void *wrapperCodeMem = NULL; +#include "pshpack1.h" + /* Code structure for x86 byte code */ typedef struct { @@ -471,6 +504,17 @@ typedef struct DWORD func; } THISCALL_TO_STDCALL_THUNK; +typedef struct +{ + BYTE pop_eax; /* popl %eax */ + BYTE pop_ecx; /* popl %ecx */ + BYTE push_eax; /* pushl %eax */ + BYTE mov_vtable_eax[2]; /* movl (%ecx), %eax */ + BYTE jmp_eax[2]; /* jmp *$vtablefunc_offset(%eax) */ + int vtablefunc_offset; +} STDCALL_TO_THISCALL_THUNK; + +#include "poppack.h" static void setup_thiscall_wrappers(void) { @@ -478,10 +522,13 @@ static void setup_thiscall_wrappers(void) void** pVtable; void** pVtableEnd; THISCALL_TO_STDCALL_THUNK *thunk; + STDCALL_TO_THISCALL_THUNK *thunk2; wrapperCodeMem = VirtualAlloc(NULL, (sizeof(ITextHostVtbl)/sizeof(void*) - 3) - * sizeof(THISCALL_TO_STDCALL_THUNK), + * sizeof(THISCALL_TO_STDCALL_THUNK) + +(sizeof(ITextServicesVtbl)/sizeof(void*) - 3) + * sizeof(STDCALL_TO_THISCALL_THUNK), MEM_COMMIT, PAGE_EXECUTE_READWRITE); thunk = wrapperCodeMem; @@ -498,7 +545,7 @@ static void setup_thiscall_wrappers(void) /* Skip QueryInterface, AddRef, and Release native actually * defined them with the stdcall calling convention. */ pVtable = (void**)&itextHostVtbl + 3; - pVtableEnd = (void**)((char*)&itextHostVtbl + sizeof(ITextHostVtbl)); + pVtableEnd = (void**)(&itextHostVtbl + 1); while (pVtable != pVtableEnd) { /* write byte code to executable memory */ thunk->pop_eax = 0x58; /* popl %eax */ @@ -511,6 +558,29 @@ static void setup_thiscall_wrappers(void) pVtable++; thunk++; } + + /* Setup an ITextServices standard call vtable that will call the + * native thiscall vtable when the methods are called. */ + + /* QueryInterface, AddRef, and Release should be called directly on the + * real vtable since they use the stdcall calling convention. */ + thunk2 = (STDCALL_TO_THISCALL_THUNK *)thunk; + pVtable = (void**)&itextServicesStdcallVtbl + 3; + pVtableEnd = (void**)(&itextServicesStdcallVtbl + 1); + while (pVtable != pVtableEnd) { + /* write byte code to executable memory */ + thunk2->pop_eax = 0x58; /* popl %eax */ + thunk2->pop_ecx = 0x59; /* popl %ecx */ + thunk2->push_eax = 0x50; /* pushl %eax */ + thunk2->mov_vtable_eax[0] = 0x8b; /* movl (%ecx), %eax */ + thunk2->mov_vtable_eax[1] = 0x01; + thunk2->jmp_eax[0] = 0xff; /* jmp *$vtablefunc_offset(%eax) */ + thunk2->jmp_eax[1] = 0xa0; + thunk2->vtablefunc_offset = (char*)pVtable - (char*)&itextServicesStdcallVtbl; + *pVtable = thunk2; + pVtable++; + thunk2++; + } #endif /* __i386__ */ } @@ -557,6 +627,21 @@ static BOOL init_texthost(void) return TRUE; } +static void test_TxGetText(void) +{ + HRESULT hres; + BSTR rettext; + + if (!init_texthost()) + return; + + hres = ITextServices_TxGetText(txtserv, &rettext); + todo_wine ok(hres == S_OK, "ITextServices_TxGetText failed\n"); + + IUnknown_Release(txtserv); + CoTaskMemFree(dummyTextHost); +} + START_TEST( txtsrv ) { setup_thiscall_wrappers(); @@ -570,6 +655,8 @@ START_TEST( txtsrv ) { IUnknown_Release(txtserv); CoTaskMemFree(dummyTextHost); + + test_TxGetText(); } if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE); } diff --git a/include/textserv.h b/include/textserv.h index 9b3cbf9..1c262ac 100644 --- a/include/textserv.h +++ b/include/textserv.h @@ -147,25 +147,6 @@ DECLARE_INTERFACE_(ITextServices,IUnknown) #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p) #define ITextServices_Release(p) (p)->lpVtbl->Release(p) -/*** ITextServices methods ***/ -#define ITextServices_TxSendMessage(p,a,b,c,d) (p)->lpVtbl->TxSendMessage(p,a,b,c,d) -#define ITextServices_TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l) (p)->lpVtbl->TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l) -#define ITextServices_TxGetHScroll(p,a,b,c,d,e) (p)->lpVtbl->TxGetHScroll(p,a,b,c,d,e) -#define ITextServices_TxGetVScroll(p,a,b,c,d,e) (p)->lpVtbl->TxGetVScroll(p,a,b,c,d,e) -#define ITextServices_OnTxSetCursor(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->OnTxSetCursor(p,a,b,c,d,e,f,g,h,i) -#define ITextServices_TxQueryHitPoint(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->TxQueryHitPoint(p,a,b,c,d,e,f,g,h,i,j) -#define ITextServices_OnTxInplaceActivate(p,a) (p)->lpVtbl->OnTxInplaceActivate(p,a) -#define ITextServices_OnTxInplaceDeactivate(p) (p)->lpVtbl->OnTxInplaceDeactivate(p) -#define ITextServices_OnTxUIActivate(p) (p)->lpVtbl->OnTxUIActivate(p) -#define ITextServices_OnTxUIDeactivate(p) (p)->lpVtbl->OnTxUIDeactivate(p) -#define ITextServices_TxGetText(p,a) (p)->lpVtbl->TxGetText(p,a) -#define ITextServices_TxSetText(p,a) (p)->lpVtbl->TxSetText(p,a) -#define ITextServices_TxGetCurrentTargetX(p,a) (p)->lpVtbl->TxGetCurrentTargetX(p,a) -#define ITextServices_TxGetBaseLinePos(p,a) (p)->lpVtbl->TxGetBaseLinePos(p,a) -#define ITextServices_TxGetNaturalSize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->TxGetNaturalSize(p,a,b,c,d,e,f,g,h) -#define ITextServices_TxGetDropTarget(p,a) (p)->lpVtbl->TxGetDropTarget(p,a) -#define ITextServices_OnTxPropertyBitsChange(p,a,b) (p)->lpVtbl->OnTxPropertyBitsChange(p,a,b) -#define ITextServices_TxGetCachedSize(p,a,b) (p)->lpVtbl->TxGetCachedSize(p,a,b) #endif #undef INTERFACE
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
74
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
Results per page:
10
25
50
100
200