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
January 2007
----- 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
4 participants
893 discussions
Start a n
N
ew thread
Andrew Talbot : ntdll: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 70bfd0f6c0810662876a2a8e520ee06044e6ebae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=70bfd0f6c0810662876a2a8e5…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Sat Dec 30 21:08:00 2006 +0000 ntdll: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL. --- dlls/ntdll/relay.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index fa7cc12..9872474 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -36,11 +36,12 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(relay); -WINE_DECLARE_DEBUG_CHANNEL(snoop); -WINE_DECLARE_DEBUG_CHANNEL(seh); #ifdef __i386__ +WINE_DECLARE_DEBUG_CHANNEL(snoop); +WINE_DECLARE_DEBUG_CHANNEL(seh); + struct relay_descr /* descriptor for a module */ { void *magic; /* signature */
1
0
0
0
Andrew Talbot : wnaspi32: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 2a6024504abab3238d91f3b59ccf4ea4d7e78721 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a6024504abab3238d91f3b59…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Sat Dec 30 20:59:30 2006 +0000 wnaspi32: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL. --- dlls/wnaspi32/winaspi16.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wnaspi32/winaspi16.c b/dlls/wnaspi32/winaspi16.c index c9adb51..ec451e4 100644 --- a/dlls/wnaspi32/winaspi16.c +++ b/dlls/wnaspi32/winaspi16.c @@ -41,8 +41,6 @@ #include "wine/winaspi.h" #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(aspi); - /* FIXME! * 1) Residual byte length reporting not handled @@ -55,6 +53,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(aspi); #define PTR_TO_LIN(ptr,mode) \ ((mode) == ASPI_DOS ? ((void*)(((unsigned int)SELECTOROF(ptr) << 4) + OFFSETOF(ptr))) : MapSL(ptr)) +WINE_DEFAULT_DEBUG_CHANNEL(aspi); + static ASPI_DEVICE_INFO *ASPI_open_devices = NULL; static FARPROC16 ASPIChainFunc = NULL;
1
0
0
0
Andrew Talbot : dmband: Remove unused file-static variable.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 6252ad28fe9ebb5016cf1a1a914125bef2ff9a74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6252ad28fe9ebb5016cf1a1a9…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Fri Dec 29 14:55:46 2006 +0000 dmband: Remove unused file-static variable. --- dlls/dmband/band.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c index 9b1dec3..b8c4d86 100644 --- a/dlls/dmband/band.c +++ b/dlls/dmband/band.c @@ -22,7 +22,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmband); WINE_DECLARE_DEBUG_CHANNEL(dmfile); -static const GUID IID_IDirectMusicBandPRIVATE = {0xda54db81,0x837d,0x11d1,{0x86,0xbc,0x00,0xc0,0x4f,0xbf,0x8f,0xef}}; /***************************************************************************** * IDirectMusicBandImpl implementation
1
0
0
0
Jeff Latimer : usp10: Implement ScriptStringOut.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: c2680edc33c69d33f471c278ab8c38ec73dc8b8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2680edc33c69d33f471c278a…
Author: Jeff Latimer <lats(a)yless4u.com.au> Date: Fri Dec 29 22:37:16 2006 +1100 usp10: Implement ScriptStringOut. --- dlls/usp10/tests/usp10.c | 2 +- dlls/usp10/usp10.c | 83 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 7a949dc..a4d6e6e 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -672,7 +672,7 @@ static void test_ScriptString(HDC hdc) if (hr == 0) { hr = ScriptStringOut(ssa, X, Y, Options, &rc, MinSel, MaxSel, Disabled); - todo_wine ok(hr == S_OK, "ScriptStringOut should return S_OK not %08x\n", hr); + ok(hr == S_OK, "ScriptStringOut should return S_OK not %08x\n", hr); hr = ScriptStringFree(&ssa); ok(hr == S_OK, "ScriptStringFree should return S_OK not %08x\n", hr); } diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 5c9208e..0334e93 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -582,23 +582,92 @@ HRESULT WINAPI ScriptStringAnalyse(HDC h /*********************************************************************** * ScriptStringOut (USP10.@) * + * This function takes the output of ScriptStringAnalyse and joins the segments + * of glyphs and passes the resulting string to ScriptTextOut. ScriptStringOut + * only processes glyphs. + * + * Parameters: + * ssa [I] buffer to hold the analysed string components + * iX [I] X axis displacement for output + * iY [I] Y axis displacement for output + * uOptions [I] flags controling output processing + * prc [I] rectangle coordinates + * iMinSel [I] starting pos for substringing output string + * iMaxSel [I] ending pos for substringing output string + * fDisabled [I] controls text highlighting + * + * RETURNS + * Success: S_OK + * Failure: is the value returned by ScriptTextOut */ -HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, - int iX, +HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, + int iX, int iY, UINT uOptions, const RECT *prc, int iMinSel, - int iMaxSel, + int iMaxSel, BOOL fDisabled) { - FIXME("(%p,%d,%d,0x%1x,%p,%d,%d,%d): stub\n", + StringAnalysis *analysis; + WORD *glyphs; + int item, cnt, x; + HRESULT hr; + SCRIPT_CACHE sc = 0; + + TRACE("(%p,%d,%d,0x%1x,%p,%d,%d,%d)\n", ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled); - if (!ssa) { - return E_INVALIDARG; + + analysis = ssa; /* map ptr to string_analysis struct */ + + /* + * Get storage for the output buffer for the consolidated strings + */ + cnt = 0; + for(item = 0; item < analysis->numItems; item++) + { + cnt += analysis->glyphs[item].numGlyphs; } + glyphs = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * cnt ); + + /* + * ScriptStringOut only processes glyphs hence set ETO_GLYPH_INDEX + */ + uOptions |= ETO_GLYPH_INDEX; + analysis->pItem[0].a.fNoGlyphIndex = FALSE; /* say that we have glyphs */ + + /* + * Copy the string items into the output buffer + */ + + TRACE("numItems %d\n", analysis->numItems); + + cnt = 0; + for (item = 0; item < analysis->numItems; item++) + { + memcpy(&glyphs[cnt], analysis->glyphs[item].glyphs, + sizeof(WCHAR) * analysis->glyphs[item].numGlyphs); + + TRACE("Item %d, Glyphs %d ", item, analysis->glyphs[item].numGlyphs); + for (x = cnt; x < analysis->glyphs[item].numGlyphs + cnt; x ++) + TRACE("%04x", glyphs[x]); + TRACE("\n"); + + cnt += analysis->glyphs[item].numGlyphs; /* point to the end of the copied text */ + } + + hr = ScriptTextOut(analysis->hdc, &sc, iX, iY, uOptions, prc, &analysis->pItem->a, + NULL, 0, glyphs, cnt, analysis->glyphs->piAdvance, NULL, + analysis->glyphs->pGoffset); + TRACE("ScriptTextOut hr=%08x\n", hr); + + /* + * Free the output buffer and script cache + */ + HeapFree(GetProcessHeap(), 0, glyphs); + ScriptFreeCache(&sc); - return E_NOTIMPL; + return hr; } /***********************************************************************
1
0
0
0
Mike McCormack : kernel32: Remove incorrect and incomplete implementation of BeginResourceUpdate.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 794dbe4f93be9008c3d7231d24b4e98663a6c0c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=794dbe4f93be9008c3d7231d2…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Thu Dec 28 19:58:35 2006 +0900 kernel32: Remove incorrect and incomplete implementation of BeginResourceUpdate. --- dlls/kernel32/resource.c | 315 +++++++++++++++++----------------------- dlls/kernel32/tests/resource.c | 8 +- 2 files changed, 135 insertions(+), 188 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=794dbe4f93be9008c3d72…
1
0
0
0
Mike McCormack : kernel32: Add a short test for Begin/EndUpdateResource.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 1cd16ed7f3830f953ce2045de8923ac45d033591 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1cd16ed7f3830f953ce2045de…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Thu Dec 28 19:57:43 2006 +0900 kernel32: Add a short test for Begin/EndUpdateResource. --- dlls/kernel32/tests/Makefile.in | 1 + dlls/kernel32/tests/resource.c | 296 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 297 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/tests/Makefile.in b/dlls/kernel32/tests/Makefile.in index 948ac28..c71bf4f 100644 --- a/dlls/kernel32/tests/Makefile.in +++ b/dlls/kernel32/tests/Makefile.in @@ -27,6 +27,7 @@ CTESTS = \ pipe.c \ process.c \ profile.c \ + resource.c \ sync.c \ thread.c \ time.c \ diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c new file mode 100644 index 0000000..d5f3707 --- /dev/null +++ b/dlls/kernel32/tests/resource.c @@ -0,0 +1,296 @@ +/* + * Unit test suite for environment functions. + * + * Copyright 2006 Mike McCormack + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include <stdio.h> + +#include "wine/test.h" + +static const char filename[] = "test_.exe"; + +static int build_exe( void ) +{ + IMAGE_DOS_HEADER *dos; + IMAGE_NT_HEADERS *nt; + IMAGE_SECTION_HEADER *sec; + IMAGE_OPTIONAL_HEADER *opt; + HANDLE file; + DWORD written; + BYTE page[0x1000]; + const int page_size = 0x1000; + + memset( page, 0, sizeof page ); + + dos = (void*) page; + dos->e_magic = IMAGE_DOS_SIGNATURE; + dos->e_lfanew = sizeof *dos; + + nt = (void*) &dos[1]; + + nt->Signature = IMAGE_NT_SIGNATURE; + nt->FileHeader.Machine = IMAGE_FILE_MACHINE_I386; + nt->FileHeader.NumberOfSections = 2; + nt->FileHeader.SizeOfOptionalHeader = sizeof nt->OptionalHeader; + nt->FileHeader.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_DLL; + + opt = &nt->OptionalHeader; + + opt->Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC; + opt->MajorLinkerVersion = 1; + opt->BaseOfCode = 0x10; + opt->ImageBase = 0x10000000; + opt->MajorOperatingSystemVersion = 4; + opt->MajorImageVersion = 1; + opt->MajorSubsystemVersion = 4; + opt->SizeOfHeaders = sizeof *dos + sizeof *nt + sizeof *sec * 2; + opt->SizeOfImage = page_size*3; + opt->Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; + + /* if SectionAlignment and File alignment are not specified */ + /* UpdateResource fails trying to create a huge temporary file */ + opt->SectionAlignment = page_size; + opt->FileAlignment = page_size; + + sec = (void*) &nt[1]; + + memcpy( sec[0].Name, ".rodata", 8 ); + sec[0].Misc.VirtualSize = page_size; + sec[0].PointerToRawData = page_size; + sec[0].SizeOfRawData = page_size; + sec[0].VirtualAddress = page_size; + sec[0].Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ; + + memcpy( sec[1].Name, ".rsrc", 6 ); + sec[1].Misc.VirtualSize = page_size; + sec[1].SizeOfRawData = page_size; + sec[1].PointerToRawData = page_size*2; + sec[1].VirtualAddress = page_size*2; + sec[1].Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ; + + file = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok (file != INVALID_HANDLE_VALUE, "failed to create file\n"); + + /* write out the header */ + WriteFile( file, page, sizeof page, &written, NULL ); + + /* write out an empty page for rodata */ + memset( page, 0, sizeof page ); + WriteFile( file, page, sizeof page, &written, NULL ); + + /* write out an empty page for the resources */ + memset( page, 0, sizeof page ); + WriteFile( file, page, sizeof page, &written, NULL ); + + CloseHandle( file ); + + return 0; +} + +static void update_missing_exe( void ) +{ + HANDLE res; + + res = BeginUpdateResource( filename, TRUE ); + ok( res == NULL, "BeginUpdateResource should fail\n"); +} + +static void update_empty_exe( void ) +{ + HANDLE file, res, test; + BOOL r; + + file = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok (file != INVALID_HANDLE_VALUE, "failed to create file\n"); + + CloseHandle( file ); + + res = BeginUpdateResource( filename, TRUE ); + todo_wine ok( res != NULL, "BeginUpdateResource failed\n"); + + /* check if it's possible to open the file now */ + test = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + ok (test != INVALID_HANDLE_VALUE, "failed to create file\n"); + + CloseHandle( test ); + + r = EndUpdateResource( res, FALSE ); + ok( r == FALSE, "EndUpdateResouce failed\n"); + + res = BeginUpdateResource( filename, FALSE ); + ok( res == NULL, "BeginUpdateResource failed\n"); +} + +static void update_resources_none( void ) +{ + HMODULE res; + BOOL r; + + res = BeginUpdateResource( filename, FALSE ); + todo_wine ok( res != NULL, "BeginUpdateResource failed\n"); + + r = EndUpdateResource( res, FALSE ); + todo_wine ok( r, "EndUpdateResouce failed\n"); +} + +static void update_resources_delete( void ) +{ + HMODULE res; + BOOL r; + + res = BeginUpdateResource( filename, TRUE ); + todo_wine ok( res != NULL, "BeginUpdateResource failed\n"); + + r = EndUpdateResource( res, FALSE ); + todo_wine ok( r, "EndUpdateResouce failed\n"); +} + +struct verhdr { + WORD wLength; + WORD wValueLength; + WORD wType; + WCHAR key[1]; +}; + +void update_resources_version(void) +{ + HANDLE res = NULL; + BOOL r; + struct verhdr hdr; + char foo[] = "red and white"; + + todo_wine { + res = BeginUpdateResource( filename, TRUE ); + ok( res != NULL, "BeginUpdateResource failed\n"); + + memset( &hdr, 0, sizeof hdr ); + r = UpdateResource( res, + RT_VERSION, + MAKEINTRESOURCE(VS_VERSION_INFO), + MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL), + &hdr, sizeof hdr ); + ok( r, "UpdateResouce failed\n"); + } + + r = UpdateResource( res, + MAKEINTRESOURCE(0x1230), + MAKEINTRESOURCE(0x4567), + 0xabcd, + NULL, 0 ); + ok( r == FALSE, "UpdateResouce failed\n"); + + todo_wine { + r = UpdateResource( res, + MAKEINTRESOURCE(0x1230), + MAKEINTRESOURCE(0x4567), + 0xabcd, + foo, sizeof foo ); + ok( r == TRUE, "UpdateResouce failed\n"); + + r = EndUpdateResource( res, FALSE ); + ok( r, "EndUpdateResouce failed\n"); + } +} + + +typedef void (*res_check_func)( IMAGE_RESOURCE_DIRECTORY* ); + +void check_empty( IMAGE_RESOURCE_DIRECTORY *dir ) +{ + char *pad; + + ok( dir->NumberOfNamedEntries == 0, "NumberOfNamedEntries wrong\n"); + ok( dir->NumberOfIdEntries == 0, "NumberOfIdEntries wrong\n"); + + pad = (char*) &dir[1]; + + todo_wine ok( !memcmp( pad, "PADDINGXXPADDING", 16), "padding wrong\n"); +} + +void check_version( IMAGE_RESOURCE_DIRECTORY *dir ) +{ + ok( dir->NumberOfNamedEntries == 0, "NumberOfNamedEntries wrong\n"); + todo_wine ok( dir->NumberOfIdEntries == 2, "NumberOfIdEntries wrong\n"); +} + +void check_exe( res_check_func fn ) +{ + IMAGE_DOS_HEADER *dos; + IMAGE_NT_HEADERS *nt; + IMAGE_SECTION_HEADER *sec; + IMAGE_RESOURCE_DIRECTORY *dir; + HANDLE file, mapping; + DWORD length; + + file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError()); + + length = GetFileSize( file, NULL ); + ok( length == 0x3000, "file size wrong\n"); + + mapping = CreateFileMapping( file, NULL, PAGE_READONLY, 0, 0, NULL ); + ok (mapping != NULL, "failed to create file\n"); + + dos = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length ); + ok( dos != NULL, "failed to map file\n"); + + if (!dos) + goto end; + + nt = (void*) ((BYTE*) dos + dos->e_lfanew); + ok( nt->FileHeader.NumberOfSections == 2, "number of sections wrong\n" ); + + if (nt->FileHeader.NumberOfSections < 2) + goto end; + + sec = (void*) &nt[1]; + + ok( !memcmp(sec[1].Name, ".rsrc", 6), "resource section name wrong\n"); + + dir = (void*) ((BYTE*) dos + sec[1].VirtualAddress); + + ok( dir->Characteristics == 0, "Characteristics wrong\n"); + ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong\n"); + todo_wine ok( dir->MajorVersion == 4, "MajorVersion wrong\n"); + ok( dir->MinorVersion == 0, "MinorVersion wrong\n"); + + fn( dir ); + +end: + UnmapViewOfFile( dos ); + + CloseHandle( mapping ); + + CloseHandle( file ); +} + +START_TEST(resource) +{ + DeleteFile( filename ); + update_missing_exe(); + update_empty_exe(); + build_exe(); + update_resources_none(); + check_exe( check_empty ); + update_resources_delete(); + check_exe( check_empty ); + update_resources_version(); + check_exe( check_version ); + DeleteFile( filename ); +}
1
0
0
0
Stefan Dösinger : wined3d: Add emtpy vertex declaration and related states to the state table.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: ef1ebb6e4d8aeb711e639363e815ebd189f54a93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef1ebb6e4d8aeb711e639363e…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Tue Jan 2 00:35:07 2007 +0100 wined3d: Add emtpy vertex declaration and related states to the state table. --- dlls/wined3d/device.c | 22 +++++++++++++++++----- dlls/wined3d/state.c | 9 +++++++++ dlls/wined3d/wined3d_private.h | 11 ++++++++++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 0c2a180..cfb3354 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2146,7 +2146,6 @@ static UINT WINAPI IWineD3DDeviceImpl_Ge *****/ static HRESULT WINAPI IWineD3DDeviceImpl_SetFVF(IWineD3DDevice *iface, DWORD fvf) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - HRESULT hr = WINED3D_OK; /* Update the current state block */ This->updateStateBlock->fvf = fvf; @@ -2154,7 +2153,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->set.fvf = TRUE; TRACE("(%p) : FVF Shader FVF set to %x\n", This, fvf); - return hr; + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); + return WINED3D_OK; } @@ -2238,6 +2238,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl IWineD3DVertexBuffer_Release(oldSrc); } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC); + return WINED3D_OK; } @@ -3228,6 +3230,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl if (NULL != oldDecl) { IWineD3DVertexDeclaration_Release(oldDecl); } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); return WINED3D_OK; } @@ -3261,9 +3264,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl } TRACE("(%p) : setting pShader(%p)\n", This, pShader); - /** - * TODO: merge HAL shaders context switching from prototype - */ + + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VSHADER); + return WINED3D_OK; } @@ -4718,6 +4721,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->stateBlock->streamStride[0] = VertexStreamZeroStride; This->stateBlock->streamIsUP = TRUE; + /* Mark the state dirty until we have nicer tracking */ + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); + drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0 /* start vertex */, 0 /* NumVertices */, 0 /* indxStart*/, 0 /* indxSize*/, NULL /* indxData */, 0 /* indxMin */, NULL); @@ -4761,6 +4767,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->stateBlock->streamIsUP = TRUE; This->stateBlock->streamStride[0] = VertexStreamZeroStride; + /* Mark the state dirty until we have nicer tracking */ + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); + drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0 /* vertexStart */, NumVertices, 0 /* indxStart */, idxStride, pIndexData, MinVertexIndex, NULL); /* MSDN specifies stream zero settings and index buffer must be set to NULL */ @@ -4772,7 +4781,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl } static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided (IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) { + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; + /* Mark the state dirty until we have nicer tracking */ + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0, 0, 0, 0, NULL, 0, DrawPrimStrideData); return WINED3D_OK; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 28ec973..fae9d6b 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1847,6 +1847,10 @@ static void transform_worldex(DWORD stat WARN("World matrix 1 - 255 not supported yet\n"); } +static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateBlock) { + TRACE("To be filled later\n"); +} + const struct StateEntry StateTable[] = { /* State name representative, apply function */ @@ -2860,4 +2864,9 @@ const struct StateEntry StateTable[] = { /*509, WINED3DTS_WORLDMATRIX(253) */ STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(253)), transform_worldex }, { /*510, WINED3DTS_WORLDMATRIX(254) */ STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(254)), transform_worldex }, { /*511, WINED3DTS_WORLDMATRIX(255) */ STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(255)), transform_worldex }, + /* Various Vertex states follow */ + { /* , STATE_STREAMSRC */ STATE_VDECL, vertexdeclaration }, + { /* , STATE_VDECL */ STATE_VDECL, vertexdeclaration }, + { /* , STATE_VSHADER */ STATE_VDECL, vertexdeclaration }, + }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 74655d2..a6fe6c5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -426,7 +426,16 @@ typedef void (*APPLYSTATEFUNC)(DWORD sta #define STATE_TRANSFORM(a) (STATE_PIXELSHADER + (a)) #define STATE_IS_TRANSFORM(a) ((a) >= STATE_TRANSFORM(1) && (a) <= STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(255))) -#define STATE_HIGHEST (STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(255))) +#define STATE_STREAMSRC (STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(255)) + 1) +#define STATE_IS_STREAMSRC(a) ((a) == STATE_STREAMSRC) + +#define STATE_VDECL (STATE_STREAMSRC + 1) +#define STATE_IS_VDECL(a) ((a) == STATE_VDECL) + +#define STATE_VSHADER (STATE_VDECL + 1) +#define STATE_IS_VSHADER(a) ((a) == STATE_VSHADER) + +#define STATE_HIGHEST (STATE_VSHADER) struct StateEntry {
1
0
0
0
Stefan Dösinger : wined3d: Add stub handlers for world matrices 1-255.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: a710f721c330edd1b535ac61347e865f87e87735 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a710f721c330edd1b535ac613…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Tue Jan 2 00:25:51 2007 +0100 wined3d: Add stub handlers for world matrices 1-255. --- dlls/wined3d/state.c | 514 +++++++++++++++++++++++++------------------------- 1 files changed, 259 insertions(+), 255 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a710f721c330edd1b535a…
1
0
0
0
Stefan Dösinger : wined3d: Put the decoded strided data structure into the device.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: 091f9c28e4410039c36b0a7e40ed86dc18aaad70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=091f9c28e4410039c36b0a7e4…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Tue Jan 2 00:21:26 2007 +0100 wined3d: Put the decoded strided data structure into the device. --- dlls/wined3d/drawprim.c | 35 ++++++++++++----------------------- dlls/wined3d/wined3d_private.h | 3 +++ 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 7e897f1..63e1cae 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -1947,7 +1947,6 @@ void drawPrimitive(IWineD3DDevice *iface IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; BOOL useVertexShaderFunction = FALSE; BOOL usePixelShaderFunction = FALSE; - WineDirect3DVertexStridedData *dataLocations; IWineD3DSwapChainImpl *swapchain; int i; BOOL fixup = FALSE; @@ -2002,8 +2001,8 @@ void drawPrimitive(IWineD3DDevice *iface /* Note: this is a ddraw fixed-function code path */ TRACE("================ Strided Input ===================\n"); - dataLocations = DrawPrimStrideData; - drawPrimitiveTraceDataLocations(dataLocations); + memcpy(&This->strided_streams, DrawPrimStrideData, sizeof(This->strided_streams)); + drawPrimitiveTraceDataLocations(&This->strided_streams); fixup = FALSE; } @@ -2015,17 +2014,13 @@ void drawPrimitive(IWineD3DDevice *iface * don't set any declaration at all */ TRACE("================ Vertex Declaration ===================\n"); - dataLocations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dataLocations)); - if(!dataLocations) { - ERR("Out of memory!\n"); - return; - } + memset(&This->strided_streams, 0, sizeof(This->strided_streams)); if (This->stateBlock->vertexDecl != NULL || - ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->vertexDeclaration != NULL) + ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->vertexDeclaration != NULL) - primitiveDeclarationConvertToStridedData(iface, useVertexShaderFunction, - dataLocations, StartVertexIndex, &fixup); + primitiveDeclarationConvertToStridedData(iface, useVertexShaderFunction, + &This->strided_streams, StartVertexIndex, &fixup); } else { @@ -2034,20 +2029,16 @@ void drawPrimitive(IWineD3DDevice *iface * It will not work properly for shaders. */ TRACE("================ FVF ===================\n"); - dataLocations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dataLocations)); - if(!dataLocations) { - ERR("Out of memory!\n"); - return; - } - primitiveConvertToStridedData(iface, dataLocations, StartVertexIndex, &fixup); - drawPrimitiveTraceDataLocations(dataLocations); + memset(&This->strided_streams, 0, sizeof(This->strided_streams)); + primitiveConvertToStridedData(iface, &This->strided_streams, StartVertexIndex, &fixup); + drawPrimitiveTraceDataLocations(&This->strided_streams); } /* Setup transform matrices and sort out */ - primitiveInitState(iface, dataLocations, useVertexShaderFunction, &lighting_changed, &lighting_original); + primitiveInitState(iface, &This->strided_streams, useVertexShaderFunction, &lighting_changed, &lighting_original); /* Now initialize the materials state */ - init_materials(iface, (dataLocations->u.s.diffuse.lpData != NULL || dataLocations->u.s.diffuse.VBO != 0)); + init_materials(iface, (This->strided_streams.u.s.diffuse.lpData != NULL || This->strided_streams.u.s.diffuse.VBO != 0)); { GLenum glPrimType; @@ -2058,12 +2049,10 @@ void drawPrimitive(IWineD3DDevice *iface numberOfVertices = calculatedNumberOfindices; drawPrimitiveDrawStrided(iface, useVertexShaderFunction, usePixelShaderFunction, - dataLocations, numberOfVertices, calculatedNumberOfindices, glPrimType, + &This->strided_streams, numberOfVertices, calculatedNumberOfindices, glPrimType, idxData, idxSize, minIndex, StartIdx, fixup); } - if(!DrawPrimStrideData) HeapFree(GetProcessHeap(), 0, dataLocations); - /* If vertex shaders or no normals, restore previous lighting state */ if (lighting_changed) { if (lighting_original) glEnable(GL_LIGHTING); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dce5e08..74655d2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -659,6 +659,9 @@ typedef struct IWineD3DDeviceImpl DWORD texUnitMap[MAX_SAMPLERS]; BOOL oneToOneTexUnitMap; + /* Stream source management */ + WineDirect3DVertexStridedData strided_streams; + } IWineD3DDeviceImpl; extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl;
1
0
0
0
Stefan Dösinger : wined3d: Move WINED3DTS_MODELVIEW to the state table.
by Alexandre Julliard
02 Jan '07
02 Jan '07
Module: wine Branch: master Commit: f5fafab663f8cb28a70a8f35d3f5c353f5378c16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f5fafab663f8cb28a70a8f35d…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Tue Jan 2 00:48:58 2007 +0100 wined3d: Move WINED3DTS_MODELVIEW to the state table. --- dlls/wined3d/device.c | 41 ++--------------------------------------- dlls/wined3d/state.c | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 38afc4f..0c2a180 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2372,53 +2372,16 @@ static HRESULT WINAPI IWineD3DDeviceIm return WINED3D_OK; } - /* Now we really are going to have to change a matrix */ - ENTER_GL(); - if (d3dts >= WINED3DTS_TEXTURE0 && d3dts <= WINED3DTS_TEXTURE7) { /* handle texture matrices */ /* This is now set with the texture unit states, it may be a good idea to flag the change though! */ } else if (d3dts == WINED3DTS_VIEW) { /* handle the VIEW matrice */ - unsigned int k; - - /* If we are changing the View matrix, reset the light and clipping planes to the new view - * NOTE: We have to reset the positions even if the light/plane is not currently - * enabled, since the call to enable it will not reset the position. - * NOTE2: Apparently texture transforms do NOT need reapplying - */ - - PLIGHTINFOEL *lightChain = NULL; - This->modelview_valid = FALSE; This->view_ident = !memcmp(lpmatrix, identity, 16 * sizeof(float)); - - glMatrixMode(GL_MODELVIEW); - checkGLcall("glMatrixMode(GL_MODELVIEW)"); - glPushMatrix(); - glLoadMatrixf((const float *)lpmatrix); - checkGLcall("glLoadMatrixf(...)"); - - /* Reset lights */ - lightChain = This->stateBlock->lights; - while (lightChain && lightChain->glIndex != -1) { - glLightfv(GL_LIGHT0 + lightChain->glIndex, GL_POSITION, lightChain->lightPosn); - checkGLcall("glLightfv posn"); - glLightfv(GL_LIGHT0 + lightChain->glIndex, GL_SPOT_DIRECTION, lightChain->lightDirn); - checkGLcall("glLightfv dirn"); - lightChain = lightChain->next; - } - - /* Reset Clipping Planes if clipping is enabled */ - for (k = 0; k < GL_LIMITS(clipplanes); k++) { - glClipPlane(GL_CLIP_PLANE0 + k, This->stateBlock->clipplane[k]); - checkGLcall("glClipPlane"); - } - glPopMatrix(); - + /* Handled by the state manager */ } else { /* What was requested!?? */ WARN("invalid matrix specified: %i\n", d3dts); } - /* Release lock, all done */ - LEAVE_GL(); + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_TRANSFORM(d3dts)); return WINED3D_OK; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 5a79d22..ed50a87 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1805,6 +1805,44 @@ static void pixelshader(DWORD state, IWi } } +static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock) { + unsigned int k; + + /* If we are changing the View matrix, reset the light and clipping planes to the new view + * NOTE: We have to reset the positions even if the light/plane is not currently + * enabled, since the call to enable it will not reset the position. + * NOTE2: Apparently texture transforms do NOT need reapplying + */ + + PLIGHTINFOEL *lightChain = NULL; + stateblock->wineD3DDevice->modelview_valid = FALSE; + + glMatrixMode(GL_MODELVIEW); + checkGLcall("glMatrixMode(GL_MODELVIEW)"); + glPushMatrix(); + checkGLcall("glPushMatrix()"); + glLoadMatrixf((float *)(float *) &stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); + checkGLcall("glLoadMatrixf(...)"); + + /* Reset lights. TODO: Call light apply func */ + lightChain = stateblock->lights; + while (lightChain && lightChain->glIndex != -1) { + glLightfv(GL_LIGHT0 + lightChain->glIndex, GL_POSITION, lightChain->lightPosn); + checkGLcall("glLightfv posn"); + glLightfv(GL_LIGHT0 + lightChain->glIndex, GL_SPOT_DIRECTION, lightChain->lightDirn); + checkGLcall("glLightfv dirn"); + lightChain = lightChain->next; + } + + /* Reset Clipping Planes if clipping is enabled. TODO: Call clipplane apply func */ + for (k = 0; k < GL_LIMITS(clipplanes); k++) { + glClipPlane(GL_CLIP_PLANE0 + k, stateblock->clipplane[k]); + checkGLcall("glClipPlane"); + } + glPopMatrix(); + checkGLcall("glPopMatrix()"); +} + const struct StateEntry StateTable[] = { /* State name representative, apply function */ @@ -2306,7 +2344,7 @@ const struct StateEntry StateTable[] = { /* , Pixel Shader */ STATE_PIXELSHADER, pixelshader }, /* Transform states follow */ { /* 1, undefined */ 0, state_undefined }, - { /* 2, WINED3DTS_VIEW */ STATE_TRANSFORM(WINED3DTS_VIEW), state_undefined }, + { /* 2, WINED3DTS_VIEW */ STATE_TRANSFORM(WINED3DTS_VIEW), transform_view }, { /* 3, WINED3DTS_PROJECTION */ STATE_TRANSFORM(WINED3DTS_PROJECTION), state_undefined }, { /* 4, undefined */ 0, state_undefined }, { /* 5, undefined */ 0, state_undefined },
1
0
0
0
← Newer
1
...
84
85
86
87
88
89
90
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
Results per page:
10
25
50
100
200