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
March 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
3 participants
919 discussions
Start a n
N
ew thread
Hans Leidekker : msi: Initialize a couple of variables.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 353035fadd7f4098a22ee40d91d23b3882fe4531 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=353035fadd7f4098a22ee40d9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 4 09:17:50 2010 +0100 msi: Initialize a couple of variables. Found by Valgrind. --- dlls/msi/action.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 08cf975..9b44de0 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -4285,8 +4285,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) { MSIFEATURE *feature; UINT rc; - HKEY hkey; - HKEY userdata = NULL; + HKEY hkey = NULL, userdata = NULL; if (!msi_check_publish(package)) return ERROR_SUCCESS; @@ -4853,7 +4852,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) MSIPACKAGE *package = param; LPCWSTR compgroupid, component, feature, qualifier, text; LPWSTR advertise = NULL, output = NULL; - HKEY hkey; + HKEY hkey = NULL; UINT rc; MSICOMPONENT *comp; MSIFEATURE *feat; @@ -5933,7 +5932,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) LPWSTR data = NULL, newval = NULL, deformatted = NULL, ptr; DWORD flags, type, size; UINT res; - HKEY env; + HKEY env = NULL; MSICOMPONENT *comp; MSIRECORD *uirow; int action = 0;
1
0
0
0
Paul Vriens : shell32/tests: Prevent crash on W2K and below.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: f370ab7e9b074ac668075af71be41ff535a7fbbd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f370ab7e9b074ac668075af71…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Thu Mar 4 08:49:34 2010 +0100 shell32/tests: Prevent crash on W2K and below. --- dlls/shell32/tests/shlfolder.c | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 9b19471..85f04a9 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -104,17 +104,23 @@ static void test_ParseDisplayName(void) hr = SHGetDesktopFolder(&IDesktopFolder); if(hr != S_OK) return; - /* null name and pidl */ - hr = IShellFolder_ParseDisplayName(IDesktopFolder, - NULL, NULL, NULL, NULL, NULL, 0); - ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); - - /* null name */ - newPIDL = (ITEMIDLIST*)0xdeadbeef; - hr = IShellFolder_ParseDisplayName(IDesktopFolder, - NULL, NULL, NULL, NULL, &newPIDL, 0); - ok(newPIDL == 0, "expected null, got %p\n", newPIDL); - ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */ + if (pSHCreateShellItem) + { + /* null name and pidl */ + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, NULL, NULL, NULL, 0); + ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + + /* null name */ + newPIDL = (ITEMIDLIST*)0xdeadbeef; + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, NULL, NULL, &newPIDL, 0); + ok(newPIDL == 0, "expected null, got %p\n", newPIDL); + ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + } + else + win_skip("Tests would crash on W2K and below\n"); MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH); hr = IShellFolder_ParseDisplayName(IDesktopFolder,
1
0
0
0
Christian Costa : d3dx9_36: Avoid dereferencing null pointers in trace ( spotted by Paul Vriens).
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 6dfe16fc480d73d272cf1fb1731b487238a4be42 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6dfe16fc480d73d272cf1fb17…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Thu Mar 4 08:20:44 2010 +0100 d3dx9_36: Avoid dereferencing null pointers in trace (spotted by Paul Vriens). --- dlls/d3dx9_36/shader.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 9acad32..e4de6b3 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -154,11 +154,13 @@ HRESULT WINAPI D3DXFindShaderComment(CONST DWORD* byte_code, DWORD fourcc, LPCVO /* Check if this is the comment we are looking for */ if (*(ptr + 1) == fourcc) { + UINT ctab_size = (comment_size - 1) * sizeof(DWORD); + LPCVOID ctab_data = ptr + 2; if (size) - *size = (comment_size - 1) * sizeof(DWORD); + *size = ctab_size; if (data) - *data = ptr + 2; - TRACE("Returning comment data at %p with size %d\n", *data, *size); + *data = ctab_data; + TRACE("Returning comment data at %p with size %d\n", ctab_data, ctab_size); return D3D_OK; } ptr += comment_size;
1
0
0
0
Justin Chevrier : gdiplus: Implement GdipSetImageAttributesRemapTable with updated test.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 78f9177d9d3cce66b3bfe65dfa6652e1c5d6d457 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=78f9177d9d3cce66b3bfe65df…
Author: Justin Chevrier <jchevrier(a)gmail.com> Date: Wed Mar 3 20:06:33 2010 -0500 gdiplus: Implement GdipSetImageAttributesRemapTable with updated test. --- dlls/gdiplus/gdiplus_private.h | 7 +++++++ dlls/gdiplus/imageattributes.c | 19 ++++++++++++++----- dlls/gdiplus/tests/image.c | 14 +++++++------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 8e26eb1..ca1cba6 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -264,10 +264,17 @@ struct color_matrix{ ColorMatrix graymatrix; }; +struct color_remap_table{ + BOOL enabled; + INT mapsize; + GDIPCONST ColorMap *colormap; +}; + struct GpImageAttributes{ WrapMode wrap; struct color_key colorkeys[ColorAdjustTypeCount]; struct color_matrix colormatrices[ColorAdjustTypeCount]; + struct color_remap_table colorremaptables[ColorAdjustTypeCount]; BOOL gamma_enabled[ColorAdjustTypeCount]; REAL gamma[ColorAdjustTypeCount]; }; diff --git a/dlls/gdiplus/imageattributes.c b/dlls/gdiplus/imageattributes.c index c9c3bcc..1a7118d 100644 --- a/dlls/gdiplus/imageattributes.c +++ b/dlls/gdiplus/imageattributes.c @@ -204,14 +204,23 @@ GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAtt ColorAdjustType type, BOOL enableFlag, UINT mapSize, GDIPCONST ColorMap *map) { - static int calls; - TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map); - if(!(calls++)) - FIXME("not implemented\n"); + if(!imageAttr || type >= ColorAdjustTypeCount) + return InvalidParameter; - return NotImplemented; + if (enableFlag) + { + if(!map || !mapSize) + return InvalidParameter; + + imageAttr->colorremaptables[type].mapsize = mapSize; + imageAttr->colorremaptables[type].colormap = map; + } + + imageAttr->colorremaptables[type].enabled = enableFlag; + + return Ok; } GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr, diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 2e3bd74..9085ef2 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1760,28 +1760,28 @@ static void test_remaptable(void) map->newColor.Argb = 0xffff00ff; stat = GdipSetImageAttributesRemapTable(NULL, ColorAdjustTypeDefault, TRUE, 1, map); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipCreateImageAttributes(&imageattr); expect(Ok, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, NULL); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeCount, TRUE, 1, map); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeAny, TRUE, 1, map); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 0, map); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, FALSE, 0, NULL); - todo_wine expect(Ok, stat); + expect(Ok, stat); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, map); - todo_wine expect(Ok, stat); + expect(Ok, stat); stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); expect(Ok, stat);
1
0
0
0
Justin Chevrier : gdiplus/test: Add GdipSetImageAttributesRemapTable test and fix typo.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 74a3945b0095b7613d210b9c33ff201d8bebee82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74a3945b0095b7613d210b9c3…
Author: Justin Chevrier <jchevrier(a)gmail.com> Date: Wed Mar 3 20:06:32 2010 -0500 gdiplus/test: Add GdipSetImageAttributesRemapTable test and fix typo. --- dlls/gdiplus/tests/image.c | 66 ++++++++++++++++++++++++++++++++++++++++++ include/gdipluscolormatrix.h | 2 +- 2 files changed, 67 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 9d5c051..2e3bd74 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1745,6 +1745,71 @@ static void test_rotateflip(void) GdipDisposeImage(bitmap); } +static void test_remaptable(void) +{ + GpStatus stat; + GpImageAttributes *imageattr; + GpBitmap *bitmap1, *bitmap2; + GpGraphics *graphics; + ARGB color; + ColorMap *map; + + map = GdipAlloc(sizeof(ColorMap)); + + map->oldColor.Argb = 0xff00ff00; + map->newColor.Argb = 0xffff00ff; + + stat = GdipSetImageAttributesRemapTable(NULL, ColorAdjustTypeDefault, TRUE, 1, map); + todo_wine expect(InvalidParameter, stat); + + stat = GdipCreateImageAttributes(&imageattr); + expect(Ok, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, NULL); + todo_wine expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeCount, TRUE, 1, map); + todo_wine expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeAny, TRUE, 1, map); + todo_wine expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 0, map); + todo_wine expect(InvalidParameter, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, FALSE, 0, NULL); + todo_wine expect(Ok, stat); + + stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, map); + todo_wine expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); + expect(Ok, stat); + + stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap2); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap1, 0, 0, 0xff00ff00); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap2, &graphics); + expect(Ok, stat); + + stat = GdipDrawImageRectRectI(graphics, (GpImage*)bitmap1, 0,0,1,1, 0,0,1,1, + UnitPixel, imageattr, NULL, NULL); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); + expect(Ok, stat); + todo_wine ok(color_match(0xffff00ff, color, 1), "Expected ffff00ff, got %.8x\n", color); + + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)bitmap1); + GdipDisposeImage((GpImage*)bitmap2); + GdipDisposeImageAttributes(imageattr); + GdipFree(map); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1780,6 +1845,7 @@ START_TEST(image) test_gamma(); test_multiframegif(); test_rotateflip(); + test_remaptable(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdipluscolormatrix.h b/include/gdipluscolormatrix.h index 532e8f4..fbf1b2a 100644 --- a/include/gdipluscolormatrix.h +++ b/include/gdipluscolormatrix.h @@ -45,7 +45,7 @@ enum ColorAdjustType struct ColorMap { Color oldColor; - Color newCOlor; + Color newColor; }; #ifndef __cplusplus
1
0
0
0
Juan Lang : rpcrt4: Implement UuidCreateSequential using the machine' s MAC address, when available.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 86292d1dbacfd626452f79eccf04c0f0929c6450 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=86292d1dbacfd626452f79ecc…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Mar 3 14:37:40 2010 -0800 rpcrt4: Implement UuidCreateSequential using the machine's MAC address, when available. --- dlls/rpcrt4/Makefile.in | 2 +- dlls/rpcrt4/rpcrt4_main.c | 132 ++++++++++++++++++++++++++++++++++++++++++++- dlls/rpcrt4/tests/rpc.c | 2 - 3 files changed, 132 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/Makefile.in b/dlls/rpcrt4/Makefile.in index fda374c..ce50b36 100644 --- a/dlls/rpcrt4/Makefile.in +++ b/dlls/rpcrt4/Makefile.in @@ -6,7 +6,7 @@ VPATH = @srcdir@ MODULE = rpcrt4.dll IMPORTLIB = rpcrt4 IMPORTS = uuid advapi32 kernel32 ntdll -DELAYIMPORTS = wininet secur32 user32 +DELAYIMPORTS = iphlpapi wininet secur32 user32 EXTRALIBS = @SOCKETLIBS@ C_SRCS = \ diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index a790ccb..344b6d0 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -44,6 +44,8 @@ #include "winnt.h" #include "winternl.h" #include "ntsecapi.h" +#include "iptypes.h" +#include "iphlpapi.h" #include "wine/unicode.h" #include "rpc.h" @@ -60,6 +62,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc); static UUID uuid_nil; +static CRITICAL_SECTION uuid_cs; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &uuid_cs, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": uuid_cs") } +}; +static CRITICAL_SECTION uuid_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; + static CRITICAL_SECTION threaddata_cs; static CRITICAL_SECTION_DEBUG threaddata_cs_debug = { @@ -305,6 +316,58 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid) return RPC_S_OK; } +/* Number of 100ns ticks per clock tick. To be safe, assume that the clock + resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */ +#define TICKS_PER_CLOCK_TICK 1000 +#define SECSPERDAY 86400 +#define TICKSPERSEC 10000000 +/* UUID system time starts at October 15, 1582 */ +#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY) +#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC) + +static void RPC_UuidGetSystemTime(ULONGLONG *time) +{ + FILETIME ft; + + GetSystemTimeAsFileTime(&ft); + + *time = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime; + *time += TICKS_15_OCT_1582_TO_1601; +} + +/* Assume that a hardware address is at least 6 bytes long */ +#define ADDRESS_BYTES_NEEDED 6 + +static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) +{ + int i; + DWORD status = RPC_S_OK; + + ULONG buflen = sizeof(IP_ADAPTER_INFO); + PIP_ADAPTER_INFO adapter = HeapAlloc(GetProcessHeap(), 0, buflen); + + if (GetAdaptersInfo(adapter, &buflen) == ERROR_BUFFER_OVERFLOW) { + HeapFree(GetProcessHeap(), 0, adapter); + adapter = HeapAlloc(GetProcessHeap(), 0, buflen); + } + + if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) { + for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { + address[i] = adapter->Address[i]; + } + } + /* We can't get a hardware address, just use random numbers. + Set the multicast bit to prevent conflicts with real cards. */ + else { + RtlGenRandom(address, ADDRESS_BYTES_NEEDED); + address[0] |= 0x01; + status = RPC_S_UUID_LOCAL_ONLY; + } + + HeapFree(GetProcessHeap(), 0, adapter); + return status; +} + /************************************************************************* * UuidCreateSequential [RPCRT4.@] * @@ -315,10 +378,77 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid) * RPC_S_OK if successful. * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. * + * FIXME: No compensation for changes across reloading + * this dll or across reboots (e.g. clock going + * backwards and swapped network cards). The RFC + * suggests using NVRAM for storing persistent + * values. */ RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid) { - return UuidCreate(Uuid); + static int initialised, count; + + ULONGLONG time; + static ULONGLONG timelast; + static WORD sequence; + + static DWORD status; + static BYTE address[MAX_ADAPTER_ADDRESS_LENGTH]; + + EnterCriticalSection(&uuid_cs); + + if (!initialised) { + RPC_UuidGetSystemTime(&timelast); + count = TICKS_PER_CLOCK_TICK; + + sequence = ((rand() & 0xff) << 8) + (rand() & 0xff); + sequence &= 0x1fff; + + status = RPC_UuidGetNodeAddress(address); + initialised = 1; + } + + /* Generate time element of the UUID. Account for going faster + than our clock as well as the clock going backwards. */ + while (1) { + RPC_UuidGetSystemTime(&time); + if (time > timelast) { + count = 0; + break; + } + if (time < timelast) { + sequence = (sequence + 1) & 0x1fff; + count = 0; + break; + } + if (count < TICKS_PER_CLOCK_TICK) { + count++; + break; + } + } + + timelast = time; + time += count; + + /* Pack the information into the UUID structure. */ + + Uuid->Data1 = (unsigned long)(time & 0xffffffff); + Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff); + Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff); + + /* This is a version 1 UUID */ + Uuid->Data3 |= (1 << 12); + + Uuid->Data4[0] = sequence & 0xff; + Uuid->Data4[1] = (sequence & 0x3f00) >> 8; + Uuid->Data4[1] |= 0x80; + memcpy(&Uuid->Data4[2], address, ADDRESS_BYTES_NEEDED); + + LeaveCriticalSection(&uuid_cs); + + TRACE("%s\n", debugstr_guid(Uuid)); + + return status; } diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c index 7bd78ba..bb480e1 100644 --- a/dlls/rpcrt4/tests/rpc.c +++ b/dlls/rpcrt4/tests/rpc.c @@ -820,7 +820,6 @@ static void test_UuidCreateSequential(void) ok(!ret || ret == RPC_S_UUID_LOCAL_ONLY, "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret); version = (guid1.Data3 & 0xf000) >> 12; - todo_wine ok(version == 1, "unexpected version %d\n", version); if (version == 1) { @@ -849,7 +848,6 @@ static void test_UuidCreateSequential(void) ok(!ret || ret == RPC_S_UUID_LOCAL_ONLY, "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret); version = (guid2.Data3 & 0xf000) >> 12; - todo_wine ok(version == 1, "unexpected version %d\n", version); ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)), "unexpected value in MAC address\n");
1
0
0
0
Juan Lang : rpcrt4: Add tests for UuidCreateSequential.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: b61c8f8b53ed9b138f86605225da51a5d7a2ad57 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b61c8f8b53ed9b138f8660522…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Mar 3 14:36:32 2010 -0800 rpcrt4: Add tests for UuidCreateSequential. --- dlls/rpcrt4/tests/rpc.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c index 3acb46e..7bd78ba 100644 --- a/dlls/rpcrt4/tests/rpc.c +++ b/dlls/rpcrt4/tests/rpc.c @@ -804,6 +804,58 @@ static void test_UuidCreate(void) } } +static void test_UuidCreateSequential(void) +{ + UUID guid1; + BYTE version; + RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "UuidCreateSequential"); + RPC_STATUS ret; + + if (!pUuidCreateSequential) + { + skip("UuidCreateSequential not exported\n"); + return; + } + ret = pUuidCreateSequential(&guid1); + ok(!ret || ret == RPC_S_UUID_LOCAL_ONLY, + "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret); + version = (guid1.Data3 & 0xf000) >> 12; + todo_wine + ok(version == 1, "unexpected version %d\n", version); + if (version == 1) + { + UUID guid2; + + if (!ret) + { + /* If the call succeeded, there's a valid (non-multicast) MAC + * address in the uuid: + */ + ok(!(guid1.Data4[2] & 0x01), + "GUID does not appear to contain a MAC address\n"); + } + else + { + /* Otherwise, there's a randomly generated multicast MAC address + * address in the uuid: + */ + ok((guid1.Data4[2] & 0x01), + "GUID does not appear to contain a multicast MAC address\n"); + } + /* Generate another GUID, and make sure its MAC address matches the + * first. + */ + ret = pUuidCreateSequential(&guid2); + ok(!ret || ret == RPC_S_UUID_LOCAL_ONLY, + "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret); + version = (guid2.Data3 & 0xf000) >> 12; + todo_wine + ok(version == 1, "unexpected version %d\n", version); + ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)), + "unexpected value in MAC address\n"); + } +} + static void test_RpcBindingFree(void) { RPC_BINDING_HANDLE binding = NULL; @@ -826,5 +878,6 @@ START_TEST( rpc ) test_I_RpcExceptionFilter(); test_RpcStringBindingFromBinding(); test_UuidCreate(); + test_UuidCreateSequential(); test_RpcBindingFree(); }
1
0
0
0
Vincent Povirk : ole32: Add tests for CopyTo in recursive situations.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: 3733789aa9b819102b90c88934c0d6ce2c8e2240 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3733789aa9b819102b90c8893…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Mar 3 16:04:55 2010 -0600 ole32: Add tests for CopyTo in recursive situations. --- dlls/ole32/tests/storage32.c | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index 7cbfd49..7568a0c 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -2771,6 +2771,57 @@ static void test_copyto_locking(void) ok( r == TRUE, "deleted file\n"); } +static void test_copyto_recursive(void) +{ + IStorage *stg, *stg2, *stg3, *stg4; + HRESULT r; + static const WCHAR stgname[] = { 'S','T','G','1',0 }; + static const WCHAR stgname2[] = { 'S','T','G','2',0 }; + + DeleteFileA(filenameA); + + /* create the file */ + r = StgCreateDocfile( filename, STGM_CREATE | STGM_SHARE_EXCLUSIVE | + STGM_READWRITE, 0, &stg); + ok(r==S_OK, "StgCreateDocfile failed\n"); + + /* create a substorage */ + r = IStorage_CreateStorage(stg, stgname, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stg2); + ok(r==S_OK, "IStorage->CreateStorage failed, hr=%08x\n", r); + + /* copy the parent to the child */ + r = IStorage_CopyTo(stg, 0, NULL, NULL, stg2); + ok(r==STG_E_ACCESSDENIED, "IStorage->CopyTo failed, hr=%08x\n", r); + + /* create a transacted substorage */ + r = IStorage_CreateStorage(stg, stgname2, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, 0, 0, &stg3); + ok(r==S_OK, "IStorage->CreateStorage failed, hr=%08x\n", r); + + /* copy the parent to the transacted child */ + r = IStorage_CopyTo(stg, 0, NULL, NULL, stg2); + ok(r==STG_E_ACCESSDENIED, "IStorage->CopyTo failed, hr=%08x\n", r); + + /* create a transacted subsubstorage */ + r = IStorage_CreateStorage(stg3, stgname2, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, 0, 0, &stg4); + ok(r==S_OK, "IStorage->CreateStorage failed, hr=%08x\n", r); + + /* copy the parent to the transacted child of the transacted child */ + r = IStorage_CopyTo(stg, 0, NULL, NULL, stg4); + ok(r==STG_E_ACCESSDENIED, "IStorage->CopyTo failed, hr=%08x\n", r); + + /* copy the parent but exclude storage objects */ + r = IStorage_CopyTo(stg, 1, &IID_IStorage, NULL, stg4); + ok(r==S_OK, "IStorage->CopyTo failed, hr=%08x\n", r); + + IStorage_Release(stg4); + IStorage_Release(stg3); + IStorage_Release(stg2); + IStorage_Release(stg); + + r = DeleteFileA(filenameA); + ok( r == TRUE, "deleted file\n"); +} + START_TEST(storage32) { CHAR temp[MAX_PATH]; @@ -2811,4 +2862,5 @@ START_TEST(storage32) test_toplevel_stat(); test_substorage_enum(); test_copyto_locking(); + test_copyto_recursive(); }
1
0
0
0
André Hentschel : oleaut32: Fix FormatString (valgrind ).
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: f73c8c4d42c03a886675c8824f16678522ed17a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f73c8c4d42c03a886675c8824…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Mar 3 20:39:45 2010 +0100 oleaut32: Fix FormatString (valgrind). --- dlls/oleaut32/varformat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c index 52ea37a..10f5038 100644 --- a/dlls/oleaut32/varformat.c +++ b/dlls/oleaut32/varformat.c @@ -1963,7 +1963,7 @@ static HRESULT VARIANT_FormatString(LPVARIANT pVarIn, LPOLESTR lpszFormat, if (FAILED(hRes)) return hRes; - if (V_BSTR(pVarIn)[0] == '\0') + if (V_BSTR(&vStr)[0] == '\0') strHeader = (FMT_STRING_HEADER*)(rgbTok + FmtGetNegative(header)); else strHeader = (FMT_STRING_HEADER*)(rgbTok + FmtGetPositive(header));
1
0
0
0
André Hentschel : oleaut32: Fix localized date and time parsing.
by Alexandre Julliard
04 Mar '10
04 Mar '10
Module: wine Branch: master Commit: a360c98187856039b0c5365997d6994f95eb4d42 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a360c98187856039b0c536599…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Mar 3 19:59:16 2010 +0100 oleaut32: Fix localized date and time parsing. --- dlls/oleaut32/tests/vartype.c | 2 +- dlls/oleaut32/vartype.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index 6742fce..79b6b93 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -3439,7 +3439,7 @@ static void test_VarDateFromStr(void) DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH; lcid = MAKELCID(MAKELANGID(LANG_GERMAN,SUBLANG_GERMAN),SORT_DEFAULT); DFS("02.01.1970"); EXPECT_DBL(25570.0); - DFS("02.01.1970 00:00:00"); todo_wine EXPECT_DBL(25570.0); + DFS("02.01.1970 00:00:00"); EXPECT_DBL(25570.0); } static void test_VarDateCopy(void) diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c index 580209b..da1288d 100644 --- a/dlls/oleaut32/vartype.c +++ b/dlls/oleaut32/vartype.c @@ -7707,6 +7707,13 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd dp.dwCount -= 3; break; + case 0x1B: /* localized DDDTTT */ + if (!iDate) + { + hRet = DISP_E_TYPEMISMATCH; + break; + } + /* .. fall through .. */ case 0x18: /* DDDTTT */ if ((dp.dwFlags[0] & (DP_AM|DP_PM)) || (dp.dwFlags[1] & (DP_AM|DP_PM)) || (dp.dwFlags[2] & (DP_AM|DP_PM)))
1
0
0
0
← Newer
1
...
76
77
78
79
80
81
82
...
92
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
87
88
89
90
91
92
Results per page:
10
25
50
100
200