winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 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
3 participants
1085 discussions
Start a n
N
ew thread
Stefan Leichter : mlang: Remove 'recursive registry key delete' function.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: e8ce143fe4ce38cacabc66738cd2f6e2a3fc06d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8ce143fe4ce38cacabc66738…
Author: Stefan Leichter <Stefan.Leichter(a)camline.com> Date: Mon Aug 27 18:03:19 2007 +0200 mlang: Remove 'recursive registry key delete' function. --- dlls/mlang/regsvr.c | 79 +++++--------------------------------------------- 1 files changed, 8 insertions(+), 71 deletions(-) diff --git a/dlls/mlang/regsvr.c b/dlls/mlang/regsvr.c index 35a80a9..f5292bf 100644 --- a/dlls/mlang/regsvr.c +++ b/dlls/mlang/regsvr.c @@ -121,9 +121,6 @@ static LONG register_key_defvalueA(HKEY base, WCHAR const *name, static LONG register_progid(WCHAR const *clsid, char const *progid, char const *curver_progid, char const *name, char const *extra); -static LONG recursive_delete_key(HKEY key); -static LONG recursive_delete_keyA(HKEY base, char const *name); -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name); /*********************************************************************** * register_interfaces @@ -212,7 +209,8 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list) WCHAR buf[39]; StringFromGUID2(list->iid, buf, 39); - res = recursive_delete_keyW(interface_key, buf); + res = RegDeleteTreeW(interface_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } RegCloseKey(interface_key); @@ -319,16 +317,19 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = recursive_delete_keyW(coclass_key, buf); + res = RegDeleteTreeW(coclass_key, buf); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid); + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } if (list->viprogid) { - res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid); + res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); + if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } } @@ -441,70 +442,6 @@ error_close_progid_key: } /*********************************************************************** - * recursive_delete_key - */ -static LONG recursive_delete_key(HKEY key) -{ - LONG res; - WCHAR subkey_name[MAX_PATH]; - DWORD cName; - HKEY subkey; - - for (;;) { - cName = sizeof(subkey_name) / sizeof(WCHAR); - res = RegEnumKeyExW(key, 0, subkey_name, &cName, - NULL, NULL, NULL, NULL); - if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) { - res = ERROR_SUCCESS; /* presumably we're done enumerating */ - break; - } - res = RegOpenKeyExW(key, subkey_name, 0, - KEY_READ | KEY_WRITE, &subkey); - if (res == ERROR_FILE_NOT_FOUND) continue; - if (res != ERROR_SUCCESS) break; - - res = recursive_delete_key(subkey); - RegCloseKey(subkey); - if (res != ERROR_SUCCESS) break; - } - - if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0); - return res; -} - -/*********************************************************************** - * recursive_delete_keyA - */ -static LONG recursive_delete_keyA(HKEY base, char const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - -/*********************************************************************** - * recursive_delete_keyW - */ -static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) -{ - LONG res; - HKEY key; - - res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key); - if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS; - if (res != ERROR_SUCCESS) return res; - res = recursive_delete_key(key); - RegCloseKey(key); - return res; -} - -/*********************************************************************** * coclass list */ static struct regsvr_coclass const coclass_list[] = {
1
0
0
0
Maarten Lankhorst : dsound: Update DSOUND_PrimarySetFormat to follow flags and return values more precisely .
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 5d0b1fabd325650d3e2c9fffddc4e4787febc695 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d0b1fabd325650d3e2c9fffd…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Aug 27 17:20:38 2007 +0200 dsound: Update DSOUND_PrimarySetFormat to follow flags and return values more precisely. --- dlls/dsound/dsound_private.h | 2 +- dlls/dsound/duplex.c | 2 +- dlls/dsound/primary.c | 46 +++++++++++++++++++++++++++++++---------- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index db73f77..dc21a62 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -425,7 +425,7 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device); HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device); HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device); HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos); -HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex); +HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex, BOOL forced); HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave); /* duplex.c */ diff --git a/dlls/dsound/duplex.c b/dlls/dsound/duplex.c index c61432d..32002a8 100644 --- a/dlls/dsound/duplex.c +++ b/dlls/dsound/duplex.c @@ -702,7 +702,7 @@ IDirectSoundFullDuplexImpl_Initialize( } This->renderer_device->priolevel = dwLevel; - hr = DSOUND_PrimarySetFormat(This->renderer_device, lpDsBufferDesc->lpwfxFormat); + hr = DSOUND_PrimarySetFormat(This->renderer_device, lpDsBufferDesc->lpwfxFormat, dwLevel == DSSCL_EXCLUSIVE); if (hr != DS_OK) { WARN("DSOUND_PrimarySetFormat() failed\n"); *lplpDirectSoundCaptureBuffer8 = NULL; diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 69c1734..c3b9d91 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -397,9 +397,9 @@ HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LP return DS_OK; } -HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) +HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex, BOOL forced) { - HRESULT err = DS_OK; + HRESULT err = DSERR_BUFFERLOST; int i, alloc_size, cp_size; DWORD nSamplesPerSec, bpp, chans; TRACE("(%p,%p)\n", device, wfex); @@ -440,29 +440,51 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) if (!(device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) && device->hwbuf) { err = IDsDriverBuffer_SetFormat(device->hwbuf, device->pwfx); + + /* On bad format, try to re-create, big chance it will work then, only do this if we <HAVE> to */ + if (forced && (device->pwfx->nSamplesPerSec/100 != wfex->nSamplesPerSec/100 || err == DSERR_BADFORMAT)) + { + err = DSERR_BUFFERLOST; + CopyMemory(device->pwfx, wfex, cp_size); + } + if (err != DSERR_BUFFERLOST && FAILED(err)) { WARN("IDsDriverBuffer_SetFormat failed\n"); + if (!forced) + err = DS_OK; goto done; } - else DSOUND_RecalcPrimary(device); + if (err == S_FALSE) + { + /* ALSA specific: S_FALSE tells that recreation was succesful, + * but size and location may be changed, and buffer has to be restarted + * I put it here, so if frequency doesn't match error will be changed to DSERR_BUFFERLOST + * and the entire re-initialization will occur anyway + */ + IDsDriverBuffer_Lock(device->hwbuf, (LPVOID *)&device->buffer, &device->buflen, NULL, NULL, 0, 0, DSBLOCK_ENTIREBUFFER); + IDsDriverBuffer_Unlock(device->hwbuf, device->buffer, 0, NULL, 0); + + if (device->state == STATE_PLAYING) device->state = STATE_STARTING; + else if (device->state == STATE_STOPPING) device->state = STATE_STOPPED; + device->pwplay = device->pwqueue = device->playpos = device->mixpos = 0; + err = DS_OK; + } + DSOUND_RecalcPrimary(device); } - if (err == DSERR_BUFFERLOST || device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) + if (err == DSERR_BUFFERLOST) { DSOUND_PrimaryClose(device); - if (!device->driver) + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) { - waveOutClose(device->hwo); - device->hwo = 0; - err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, CALLBACK_FUNCTION)); + err = DSOUND_ReopenDevice(device, FALSE); if (FAILED(err)) { - WARN("waveOutOpen failed\n"); + WARN("DSOUND_ReopenDevice failed: %08x\n", err); goto done; } } - err = DSOUND_PrimaryOpen(device); if (err != DS_OK) { WARN("DSOUND_PrimaryOpen failed\n"); @@ -479,6 +501,7 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) (*dsb)->freqAdjust = ((DWORD64)(*dsb)->freq << DSOUND_FREQSHIFT) / device->pwfx->nSamplesPerSec; DSOUND_RecalcFormat((*dsb)); DSOUND_MixToTemporary((*dsb), 0, (*dsb)->buflen); + (*dsb)->primary_mixpos = 0; RtlReleaseResource(&(*dsb)->lock); /* **** */ @@ -502,8 +525,9 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat( LPDIRECTSOUNDBUFFER iface, LPCWAVEFORMATEX wfex) { + DirectSoundDevice *device = ((PrimaryBufferImpl *)iface)->device; TRACE("(%p,%p)\n", iface, wfex); - return DSOUND_PrimarySetFormat(((PrimaryBufferImpl *)iface)->device, wfex); + return DSOUND_PrimarySetFormat(device, wfex, device->priolevel == DSSCL_WRITEPRIMARY); } static HRESULT WINAPI PrimaryBufferImpl_SetVolume(
1
0
0
0
Maarten Lankhorst : dsound: Add a function to (re) open sound device to avoid code duplication.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 7519326d03568b57b57dfde93ca59e7174182a70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7519326d03568b57b57dfde93…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Mon Aug 27 17:07:14 2007 +0200 dsound: Add a function to (re)open sound device to avoid code duplication. --- dlls/dsound/dsound.c | 45 ++-------------------- dlls/dsound/dsound_private.h | 1 + dlls/dsound/primary.c | 84 +++++++++++++++++++++++++++++++++++------ 3 files changed, 76 insertions(+), 54 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index bbbbd0d..7d6dc93 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -1413,52 +1413,15 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG device->guid = devGUID; device->driver = NULL; - /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ - if (ds_hw_accel != DS_HW_ACCEL_EMULATION) - waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); - - /* Get driver description */ - if (device->driver) { - hr = IDsDriver_GetDriverDesc(device->driver,&(device->drvdesc)); - if (hr != DS_OK) { - WARN("IDsDriver_GetDriverDesc failed\n"); - return hr; - } - } else { - /* if no DirectSound interface available, use WINMM API instead */ - device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT; - } - device->drvdesc.dnDevNode = wod; - - /* If the driver requests being opened through MMSYSTEM - * (which is recommended by the DDK), it is supposed to happen - * before the DirectSound interface is opened */ - if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + hr = DSOUND_ReopenDevice(device, FALSE); + if (FAILED(hr)) { - DWORD flags = CALLBACK_FUNCTION; - - /* disable direct sound if requested */ - if (device->driver) - flags |= WAVE_DIRECTSOUND; - - hr = mmErr(waveOutOpen(&(device->hwo), - device->drvdesc.dnDevNode, device->pwfx, - (DWORD_PTR)DSOUND_callback, (DWORD)device, - flags)); - if (hr != DS_OK) { - WARN("waveOutOpen failed\n"); - return hr; - } + WARN("DSOUND_ReopenDevice failed: %08x\n", hr); + return hr; } if (device->driver) { - hr = IDsDriver_Open(device->driver); - if (hr != DS_OK) { - WARN("IDsDriver_Open failed\n"); - return hr; - } - /* the driver is now open, so it's now allowed to call GetCaps */ hr = IDsDriver_GetCaps(device->driver,&(device->drvcaps)); if (hr != DS_OK) { diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index f3032e8..db73f77 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -426,6 +426,7 @@ HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device); HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device); HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos); HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex); +HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave); /* duplex.c */ diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 44b453a..69c1734 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -68,6 +68,67 @@ static void DSOUND_RecalcPrimary(DirectSoundDevice *device) device->writelead = (device->pwfx->nSamplesPerSec / 100) * nBlockAlign; } +HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) +{ + HRESULT hres = DS_OK; + if (device->driver) + { + IDsDriver_Close(device->driver); + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + waveOutClose(device->hwo); + IDsDriver_Release(device->driver); + device->driver = NULL; + device->buffer = NULL; + device->hwo = 0; + } + else if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + waveOutClose(device->hwo); + + /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ + if (ds_hw_accel != DS_HW_ACCEL_EMULATION && !forcewave) + waveOutMessage((HWAVEOUT)device->drvdesc.dnDevNode, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); + + /* Get driver description */ + if (device->driver) { + DWORD wod = device->drvdesc.dnDevNode; + hres = IDsDriver_GetDriverDesc(device->driver,&(device->drvdesc)); + device->drvdesc.dnDevNode = wod; + if (FAILED(hres)) { + WARN("IDsDriver_GetDriverDesc failed: %08x\n", hres); + IDsDriver_Release(device->driver); + device->driver = NULL; + } + } + + /* if no DirectSound interface available, use WINMM API instead */ + if (!device->driver) + device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT; + + if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) + { + DWORD flags = CALLBACK_FUNCTION; + + if (device->driver) + flags |= WAVE_DIRECTSOUND; + + hres = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, flags)); + if (FAILED(hres)) { + WARN("waveOutOpen failed\n"); + if (device->driver) + { + IDsDriver_Release(device->driver); + device->driver = NULL; + } + return hres; + } + } + + if (device->driver) + hres = IDsDriver_Open(device->driver); + + return hres; +} + static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) { HRESULT err = DS_OK; @@ -82,17 +143,8 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) if (err != DS_OK) { WARN("IDsDriver_CreateSoundBuffer failed (%08x), falling back to waveout\n", err); - /* Wine-only: close wine directsound driver, then reopen without WAVE_DIRECTSOUND */ - IDsDriver_Close(device->driver); - if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN) - waveOutClose(device->hwo); - IDsDriver_Release(device->driver); - device->driver = NULL; - device->buffer = NULL; - device->hwo = 0; - device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT; - err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, CALLBACK_FUNCTION)); - if (err != DS_OK) + err = DSOUND_ReopenDevice(device, TRUE); + if (FAILED(err)) { WARN("Falling back to waveout failed too! Giving up\n"); return err; @@ -284,9 +336,15 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) err = IDsDriverBuffer_Stop(device->hwbuf); if (err == DSERR_BUFFERLOST) { DSOUND_PrimaryClose(device); - err = DSOUND_PrimaryOpen(device); + err = DSOUND_ReopenDevice(device, !device->driver); if (FAILED(err)) - WARN("DSOUND_PrimaryOpen failed\n"); + ERR("DSOUND_ReopenDevice failed\n"); + else + { + err = DSOUND_PrimaryOpen(device); + if (FAILED(err)) + WARN("DSOUND_PrimaryOpen failed\n"); + } } else if (err != DS_OK) { WARN("IDsDriverBuffer_Stop failed\n"); }
1
0
0
0
Andrew Talbot : setupapi: Constify some variables.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 3bf6315af2fe961365da3844a04bbe2d0c7ac2f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bf6315af2fe961365da3844a…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Mon Aug 27 16:09:06 2007 +0100 setupapi: Constify some variables. --- dlls/setupapi/parser.c | 16 ++++++++-------- dlls/setupapi/setupapi_private.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index d5b7643..f7a9bd4 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -175,7 +175,7 @@ static void *grow_array( void *array, unsigned int *count, size_t elem ) /* get the directory of the inf file (as counted string, not null-terminated) */ -static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len ) +static const WCHAR *get_inf_dir( const struct inf_file *file, unsigned int *len ) { const WCHAR *p = strrchrW( file->filename, '\\' ); *len = p ? (p + 1 - file->filename) : 0; @@ -184,7 +184,7 @@ static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len ) /* find a section by name */ -static int find_section( struct inf_file *file, const WCHAR *name ) +static int find_section( const struct inf_file *file, const WCHAR *name ) { unsigned int i; @@ -303,7 +303,7 @@ static struct field *add_field( struct inf_file *file, const WCHAR *text ) /* retrieve the string substitution for a directory id */ -static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned int *len ) +static const WCHAR *get_dirid_subst( const struct inf_file *file, int dirid, unsigned int *len ) { const WCHAR *ret; @@ -316,7 +316,7 @@ static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned /* retrieve the string substitution for a given string, or NULL if not found */ /* if found, len is set to the substitution length */ -static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, unsigned int *len, +static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR *str, unsigned int *len, BOOL no_trailing_slash ) { static const WCHAR percent = '%'; @@ -365,7 +365,7 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u /* do string substitutions on the specified text */ /* the buffer is assumed to be large enough */ /* returns necessary length not including terminating null */ -unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCHAR *buffer, +unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text, WCHAR *buffer, unsigned int size ) { const WCHAR *start, *subst, *p; @@ -418,7 +418,7 @@ unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCH /* do string substitutions on the specified text */ /* the buffer is assumed to be large enough */ /* returns necessary length not including terminating null */ -unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text, char *buffer, +unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text, char *buffer, unsigned int size ) { WCHAR buffW[MAX_STRING_LEN+1]; @@ -471,14 +471,14 @@ static inline enum parser_state set_state( struct parser *parser, enum parser_st /* check if the pointer points to an end of file */ -static inline int is_eof( struct parser *parser, const WCHAR *ptr ) +static inline int is_eof( const struct parser *parser, const WCHAR *ptr ) { return (ptr >= parser->end || *ptr == CONTROL_Z); } /* check if the pointer points to an end of line */ -static inline int is_eol( struct parser *parser, const WCHAR *ptr ) +static inline int is_eol( const struct parser *parser, const WCHAR *ptr ) { return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == '\n'); } diff --git a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h index 32f1661..a3fe223 100644 --- a/dlls/setupapi/setupapi_private.h +++ b/dlls/setupapi/setupapi_private.h @@ -45,9 +45,9 @@ static inline WCHAR *strdupAtoW( const char *str ) struct inf_file; extern const WCHAR *DIRID_get_string( int dirid ); -extern unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text, +extern unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text, char *buffer, unsigned int size ); -extern unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, +extern unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text, WCHAR *buffer, unsigned int size ); extern const WCHAR *PARSER_get_inf_filename( HINF hinf ); extern WCHAR *PARSER_get_src_root( HINF hinf );
1
0
0
0
Stefan Dösinger : wined3d: Texture transform flag test .
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 4438b3be06880706c813f25507e9be4f86ee855a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4438b3be06880706c813f2550…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Aug 19 19:47:38 2007 +0200 wined3d: Texture transform flag test. --- dlls/d3d9/tests/visual.c | 504 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 504 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4438b3be06880706c813f…
1
0
0
0
Stefan Dösinger : wined3d: Some texture transform fixes.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: fe0f0eb48a12e29af6a9e7407d4eec8bc500a057 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe0f0eb48a12e29af6a9e7407…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Aug 27 14:33:46 2007 +0200 wined3d: Some texture transform fixes. --- dlls/wined3d/drawprim.c | 1 + dlls/wined3d/state.c | 17 ++++++++-- dlls/wined3d/utils.c | 61 +++++++++++++++++++++++++++++++++------ dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 66 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 2dcaa5d..4eb6786 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -414,6 +414,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData ptrToCoords = (float *)(texCoords[coordIdx] + (SkipnStrides * sd->u.s.texCoords[coordIdx].dwStride)); if (texCoords[coordIdx] == NULL) { TRACE("tex: %d - Skipping tex coords, as no data supplied\n", textureNo); + glTexCoord4f(0, 0, 0, 1); continue; } else { int texture_idx = This->texUnitMap[textureNo]; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 4526151..900e366 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1859,6 +1859,13 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W DWORD texUnit = state - STATE_TRANSFORM(WINED3DTS_TEXTURE0); DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[texUnit]; + /* Ignore this when a vertex shader is used, or if the streams aren't sorted out yet */ + if(stateblock->vertexShader || + isStateDirty(context, STATE_VDECL)) { + TRACE("Using a vertex shader, or stream sources not sorted out yet, skipping\n"); + return; + } + if (mapped_stage < 0) return; if (GL_SUPPORT(ARB_MULTITEXTURE)) { @@ -1876,7 +1883,10 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W set_texture_matrix((float *)&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0], stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS], (stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU, - context->last_was_rhw); + context->last_was_rhw, + stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwStride ? + stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwType: + WINED3DDECLTYPE_UNUSED); } @@ -3199,7 +3209,7 @@ static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, BOOL useVer } static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - BOOL useVertexShaderFunction = FALSE, updateFog = FALSE, updateTexMatrices = FALSE; + BOOL useVertexShaderFunction = FALSE, updateFog = FALSE; BOOL usePixelShaderFunction = stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && stateblock->pixelShader && ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; BOOL transformed; @@ -3228,7 +3238,6 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W if(transformed != context->last_was_rhw && !useVertexShaderFunction) { updateFog = TRUE; - updateTexMatrices = TRUE; } /* Reapply lighting if it is not scheduled for reapplication already */ @@ -3333,7 +3342,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W if(updateFog) { state_fog(STATE_RENDER(WINED3DRS_FOGENABLE), stateblock, context); } - if(updateTexMatrices) { + if(!useVertexShaderFunction) { int i; for(i = 0; i < MAX_TEXTURES; i++) { if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_TEXTURE0 + i))) { diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 3f9cdd5..9417055 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2418,14 +2418,14 @@ void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP #endif /* Setup this textures matrix according to the texture flags*/ -void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed) +void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed, DWORD coordtype) { float mat[16]; glMatrixMode(GL_TEXTURE); checkGLcall("glMatrixMode(GL_TEXTURE)"); - if (flags == WINED3DTTFF_DISABLE || transformed) { + if (flags == WINED3DTTFF_DISABLE || flags == WINED3DTTFF_COUNT1 || transformed) { glLoadIdentity(); checkGLcall("glLoadIdentity()"); return; @@ -2438,12 +2438,6 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, B memcpy(mat, smat, 16 * sizeof(float)); - switch (flags & ~WINED3DTTFF_PROJECTED) { - case WINED3DTTFF_COUNT1: mat[1] = mat[5] = mat[13] = 0; - case WINED3DTTFF_COUNT2: mat[2] = mat[6] = mat[10] = mat[14] = 0; - default: mat[3] = mat[7] = mat[11] = 0, mat[15] = 1; - } - if (flags & WINED3DTTFF_PROJECTED) { switch (flags & ~WINED3DTTFF_PROJECTED) { case WINED3DTTFF_COUNT2: @@ -2456,8 +2450,55 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, B break; } } else if(!calculatedCoords) { /* under directx the R/Z coord can be used for translation, under opengl we use the Q coord instead */ - mat[12] = mat[8]; - mat[13] = mat[9]; + switch(coordtype) { + case WINED3DDECLTYPE_FLOAT1: + /* Direct3D passes the default 1.0 in the 2nd coord, while gl passes it in the 4th. + * swap 2nd and 4th coord. No need to store the value of mat[12] in mat[4] because + * the input value to the transformation will be 0, so the matrix value is irrelevant + */ + mat[12] = mat[4]; + mat[13] = mat[5]; + mat[14] = mat[6]; + mat[15] = mat[7]; + break; + case WINED3DDECLTYPE_FLOAT2: + /* See above, just 3rd and 4th coord + */ + mat[12] = mat[8]; + mat[13] = mat[9]; + mat[14] = mat[10]; + mat[15] = mat[11]; + break; + case WINED3DDECLTYPE_FLOAT3: /* Opengl defaults match dx defaults */ + case WINED3DDECLTYPE_FLOAT4: /* No defaults apply, all app defined */ + + /* This is to prevent swaping the matrix lines and put the default 4th coord = 1.0 + * into a bad place. The division elimination below will apply to make sure the + * 1.0 doesn't do anything bad. The caller will set this value if the stride is 0 + */ + case WINED3DDECLTYPE_UNUSED: /* No texture coords, 0/0/0/1 defaults are passed */ + break; + default: + FIXME("Unexpected fixed function texture coord input\n"); + } + switch (flags & ~WINED3DTTFF_PROJECTED) { + /* case WINED3DTTFF_COUNT1: Won't ever get here */ + case WINED3DTTFF_COUNT2: mat[2] = mat[6] = mat[10] = mat[14] = 0; + /* OpenGL divides the first 3 vertex coord by the 4th by default, + * which is essentially the same as D3DTTFF_PROJECTED. Make sure that + * the 4th coord evaluates to 1.0 to eliminate that. + * + * If the fixed function pipeline is used, the 4th value remains unused, + * so there is no danger in doing this. With vertex shaders we have a + * problem. Should an app hit that problem, the code here would have to + * check for pixel shaders, and the shader has to undo the default gl divide. + * + * A more serious problem occurs if the app passes 4 coordinates in, and the + * 4th is != 1.0(opengl default). This would have to be fixed in drawStridedSlow + * or a replacement shader + */ + default: mat[3] = mat[7] = mat[11] = 0; mat[15] = 1; + } } glLoadMatrixf(mat); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 36185a1..e02aabb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1532,7 +1532,7 @@ GLenum StencilOp(DWORD op); GLenum CompareFunc(DWORD func); void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3); void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx); -void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed); +void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed, DWORD coordtype); void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height); GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain);
1
0
0
0
Stefan Dösinger : wined3d: Texture transforms are disabled when drawing rhw vertices.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: a8e21d06922c651500aa73aefef65d3fd8fe1dea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8e21d06922c651500aa73aef…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Aug 19 12:50:14 2007 +0200 wined3d: Texture transforms are disabled when drawing rhw vertices. --- dlls/wined3d/state.c | 14 ++++++++++++-- dlls/wined3d/utils.c | 4 ++-- dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 20a7fa5..4526151 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1875,7 +1875,8 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W set_texture_matrix((float *)&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0], stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS], - (stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU); + (stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU, + context->last_was_rhw); } @@ -3198,7 +3199,7 @@ static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, BOOL useVer } static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - BOOL useVertexShaderFunction = FALSE, updateFog = FALSE; + BOOL useVertexShaderFunction = FALSE, updateFog = FALSE, updateTexMatrices = FALSE; BOOL usePixelShaderFunction = stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && stateblock->pixelShader && ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; BOOL transformed; @@ -3227,6 +3228,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W if(transformed != context->last_was_rhw && !useVertexShaderFunction) { updateFog = TRUE; + updateTexMatrices = TRUE; } /* Reapply lighting if it is not scheduled for reapplication already */ @@ -3331,6 +3333,14 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W if(updateFog) { state_fog(STATE_RENDER(WINED3DRS_FOGENABLE), stateblock, context); } + if(updateTexMatrices) { + int i; + for(i = 0; i < MAX_TEXTURES; i++) { + if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_TEXTURE0 + i))) { + transform_texture(STATE_TRANSFORM(WINED3DTS_TEXTURE0 + i), stateblock, context); + } + } + } } static void viewport(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index abb5eb3..3f9cdd5 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2418,14 +2418,14 @@ void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP #endif /* Setup this textures matrix according to the texture flags*/ -void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords) +void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed) { float mat[16]; glMatrixMode(GL_TEXTURE); checkGLcall("glMatrixMode(GL_TEXTURE)"); - if (flags == WINED3DTTFF_DISABLE) { + if (flags == WINED3DTTFF_DISABLE || transformed) { glLoadIdentity(); checkGLcall("glLoadIdentity()"); return; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e12cebc..36185a1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -91,7 +91,7 @@ void hash_table_remove(hash_table_t *table, void *key); #define NUM_SAVEDPIXELSTATES_R 35 #define NUM_SAVEDPIXELSTATES_T 18 #define NUM_SAVEDPIXELSTATES_S 12 -#define NUM_SAVEDVERTEXSTATES_R 33 +#define NUM_SAVEDVERTEXSTATES_R 34 #define NUM_SAVEDVERTEXSTATES_T 2 #define NUM_SAVEDVERTEXSTATES_S 1 @@ -1532,7 +1532,7 @@ GLenum StencilOp(DWORD op); GLenum CompareFunc(DWORD func); void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3); void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx); -void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords); +void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed); void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height); GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain);
1
0
0
0
Stefan Dösinger : wined3d: Add some missing vertex state render states.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 2665a8bf792099c7fc7bd2375504d3a22f5b517b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2665a8bf792099c7fc7bd2375…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Aug 16 22:53:44 2007 +0200 wined3d: Add some missing vertex state render states. --- dlls/wined3d/device.c | 4 +++- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d83061d..21fbf25 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6956,7 +6956,9 @@ const DWORD SavedVertexStates_R[NUM_SAVEDVERTEXSTATES_R] = { WINED3DRS_RANGEFOGENABLE , WINED3DRS_SPECULARMATERIALSOURCE , WINED3DRS_TWEENFACTOR , - WINED3DRS_VERTEXBLEND + WINED3DRS_VERTEXBLEND , + WINED3DRS_CULLMODE , + WINED3DRS_FOGCOLOR }; const DWORD SavedVertexStates_T[NUM_SAVEDVERTEXSTATES_T] = { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 61a6385..e12cebc 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -91,7 +91,7 @@ void hash_table_remove(hash_table_t *table, void *key); #define NUM_SAVEDPIXELSTATES_R 35 #define NUM_SAVEDPIXELSTATES_T 18 #define NUM_SAVEDPIXELSTATES_S 12 -#define NUM_SAVEDVERTEXSTATES_R 31 +#define NUM_SAVEDVERTEXSTATES_R 33 #define NUM_SAVEDVERTEXSTATES_T 2 #define NUM_SAVEDVERTEXSTATES_S 1
1
0
0
0
Stefan Dösinger : wined3d: Non-primary stateblocks hold an internal reference on indexbuffers.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 9092f557d1412c855b4d4fe3d50c5b8e2b6c99ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9092f557d1412c855b4d4fe3d…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Aug 19 20:42:29 2007 +0200 wined3d: Non-primary stateblocks hold an internal reference on indexbuffers. --- dlls/wined3d/device.c | 7 +++++++ dlls/wined3d/stateblock.c | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6b53729..d83061d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -519,6 +519,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, IWineD3DVertexBuffer_AddRef(object->streamSource[i]); } } + if(object->pIndexData) { + IWineD3DIndexBuffer_AddRef(object->pIndexData); + } } else if (Type == WINED3DSBT_PIXELSTATE) { @@ -572,6 +575,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, for(i = 0; i < MAX_STREAMS; i++) { object->streamSource[i] = NULL; } + object->pIndexData = NULL; } else if (Type == WINED3DSBT_VERTEXSTATE) { @@ -632,6 +636,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, IWineD3DVertexBuffer_AddRef(object->streamSource[i]); } } + object->pIndexData = NULL; } else { FIXME("Unrecognized state block type %d\n", Type); } @@ -2821,6 +2826,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine /* Handle recording of state blocks */ if (This->isRecordingState) { TRACE("Recording... not performing anything\n"); + if(pIndexData) IWineD3DIndexBuffer_AddRef(pIndexData); + if(oldIdxs) IWineD3DIndexBuffer_Release(oldIdxs); return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 0362053..5b50e0f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -262,7 +262,6 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) { } } } - if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); } for (counter = 0; counter < MAX_STREAMS; counter++) { @@ -272,6 +271,7 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) { } } } + if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); for(counter = 0; counter < LIGHTMAP_SIZE; counter++) { struct list *e1, *e2; @@ -488,7 +488,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) if (This->changed.indices && ((This->pIndexData != targetStateBlock->pIndexData) || (This->baseVertexIndex != targetStateBlock->baseVertexIndex))) { TRACE("Updating pindexData to %p, baseVertexIndex to %d\n", - targetStateBlock->pIndexData, targetStateBlock->baseVertexIndex); + targetStateBlock->pIndexData, targetStateBlock->baseVertexIndex); + if(targetStateBlock->pIndexData) IWineD3DIndexBuffer_AddRef(targetStateBlock->pIndexData); + if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); This->pIndexData = targetStateBlock->pIndexData; This->baseVertexIndex = targetStateBlock->baseVertexIndex; } @@ -604,7 +606,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) memcpy(This->streamOffset, targetStateBlock->streamOffset, sizeof(This->streamOffset)); memcpy(This->streamFreq, targetStateBlock->streamFreq, sizeof(This->streamFreq)); memcpy(This->streamFlags, targetStateBlock->streamFlags, sizeof(This->streamFlags)); - This->pIndexData = targetStateBlock->pIndexData; This->baseVertexIndex = targetStateBlock->baseVertexIndex; memcpy(This->transforms, targetStateBlock->transforms, sizeof(This->transforms)); record_lights(This, targetStateBlock); @@ -623,6 +624,11 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) memcpy(This->samplerState, targetStateBlock->samplerState, sizeof(This->samplerState)); This->scissorRect = targetStateBlock->scissorRect; + if(targetStateBlock->pIndexData != This->pIndexData) { + if(targetStateBlock->pIndexData) IWineD3DIndexBuffer_AddRef(targetStateBlock->pIndexData); + if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); + This->pIndexData = targetStateBlock->pIndexData; + } for(i = 0; i < MAX_STREAMS; i++) { if(targetStateBlock->streamSource[i] != This->streamSource[i]) { if(targetStateBlock->streamSource[i]) IWineD3DVertexBuffer_AddRef(targetStateBlock->streamSource[i]);
1
0
0
0
Alexandre Julliard : secur32: Set the close on exec flag on the ntlm_auth pipes.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 4cda5ca96c0c6c51099db8d1da72eb7d1ba0169c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4cda5ca96c0c6c51099db8d1d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 27 18:27:59 2007 +0200 secur32: Set the close on exec flag on the ntlm_auth pipes. --- dlls/secur32/dispatcher.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/secur32/dispatcher.c b/dlls/secur32/dispatcher.c index 08b1b74..226de79 100644 --- a/dlls/secur32/dispatcher.c +++ b/dlls/secur32/dispatcher.c @@ -117,8 +117,10 @@ SECURITY_STATUS fork_helper(PNegoHelper *new_helper, const char *prog, helper->session_key = NULL; helper->neg_flags = 0; helper->pipe_in = pipe_in[0]; + fcntl( pipe_in[0], F_SETFD, 1 ); close(pipe_in[1]); helper->pipe_out = pipe_out[1]; + fcntl( pipe_out[1], F_SETFD, 1 ); close(pipe_out[0]); }
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
109
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200