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
April 2023
----- 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
1 participants
817 discussions
Start a n
N
ew thread
Piotr Caban : wineps: Reset current position on every page.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 818a144eb51c3cd45adfe42c462f8e3daba9f89a URL:
https://gitlab.winehq.org/wine/wine/-/commit/818a144eb51c3cd45adfe42c462f8e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Apr 26 19:11:15 2023 +0200 wineps: Reset current position on every page. --- dlls/wineps.drv/printproc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 914fc23f69e..9b96b2c1465 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -3040,6 +3040,7 @@ static BOOL print_metafile(struct pp_data *data, HANDLE hdata) return FALSE; AbortPath(data->pdev->dev.hdc); + MoveToEx(data->pdev->dev.hdc, 0, 0, NULL); SetBkColor(data->pdev->dev.hdc, RGB(255, 255, 255)); SetBkMode(data->pdev->dev.hdc, OPAQUE); SetMapMode(data->pdev->dev.hdc, MM_TEXT);
1
0
0
0
Piotr Caban : localspl: Validate datatype in StartDocPrinter.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: e930220b2adbcbbf4fdda2ab15db818dabc8855b URL:
https://gitlab.winehq.org/wine/wine/-/commit/e930220b2adbcbbf4fdda2ab15db81…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 27 11:25:40 2023 +0200 localspl: Validate datatype in StartDocPrinter. --- dlls/localspl/provider.c | 243 +++++++++++++++++++++++++---------------------- 1 file changed, 132 insertions(+), 111 deletions(-) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index 59f2b8c8cd0..56014461012 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -3290,11 +3290,124 @@ static BOOL WINAPI fpAddJob(HANDLE hprinter, DWORD level, BYTE *data, DWORD size return TRUE; } +typedef struct { + HMODULE hmod; + WCHAR *name; + BOOL (WINAPI *enum_datatypes)(WCHAR *, WCHAR *, DWORD, + BYTE *, DWORD, DWORD *, DWORD *); + HANDLE (WINAPI *open)(WCHAR *, PRINTPROCESSOROPENDATA *); + BOOL (WINAPI *print)(HANDLE, WCHAR *); + BOOL (WINAPI *close)(HANDLE); +} printproc_t; + +static printproc_t * print_proc_load(const WCHAR *name) +{ + WCHAR *reg_path, path[2 * MAX_PATH]; + printproc_t *ret; + DWORD size, len; + LSTATUS status; + HKEY hkey; + + size = sizeof(fmt_printprocessorsW) + + (wcslen(env_arch.envname) + wcslen(name)) * sizeof(WCHAR); + reg_path = malloc(size); + if (!reg_path) + return NULL; + swprintf(reg_path, size / sizeof(WCHAR), fmt_printprocessorsW, env_arch.envname); + wcscat(reg_path, name); + + status = RegOpenKeyW(HKEY_LOCAL_MACHINE, reg_path, &hkey); + free(reg_path); + if (status != ERROR_SUCCESS) + return NULL; + + if (!fpGetPrintProcessorDirectory(NULL, NULL, 1, (BYTE *)path, sizeof(path), &size)) + { + RegCloseKey(hkey); + return NULL; + } + len = size / sizeof(WCHAR); + path[len - 1] = '\\'; + + size = sizeof(path) - len * sizeof(WCHAR); + status = RegQueryValueExW(hkey, L"Driver", NULL, NULL, (BYTE *)(path + len), &size); + RegCloseKey(hkey); + if (status != ERROR_SUCCESS) + return NULL; + + ret = malloc(sizeof(*ret)); + if (!ret) + return NULL; + + TRACE("loading print processor: %s\n", debugstr_w(path)); + + ret->hmod = LoadLibraryW(path); + if (!ret->hmod) + { + free(ret); + return NULL; + } + + ret->enum_datatypes = (void *)GetProcAddress(ret->hmod, "EnumPrintProcessorDatatypesW"); + ret->open = (void *)GetProcAddress(ret->hmod, "OpenPrintProcessor"); + ret->print = (void *)GetProcAddress(ret->hmod, "PrintDocumentOnPrintProcessor"); + ret->close = (void *)GetProcAddress(ret->hmod, "ClosePrintProcessor"); + if (!ret->enum_datatypes || !ret->open || !ret->print || !ret->close) + { + FreeLibrary(ret->hmod); + free(ret); + return NULL; + } + + ret->name = wcsdup(name); + return ret; +} + +static BOOL print_proc_check_datatype(printproc_t *pp, const WCHAR *datatype) +{ + DATATYPES_INFO_1W *types; + DWORD size, no, i; + + if (!datatype) + return FALSE; + + pp->enum_datatypes(NULL, pp->name, 1, NULL, 0, &size, &no); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return FALSE; + + types = malloc(size); + if (!types) + return FALSE; + + if (!pp->enum_datatypes(NULL, pp->name, 1, (BYTE *)types, size, &size, &no)) + { + free(types); + return FALSE; + } + + for (i = 0; i < no; i++) + { + if (!wcscmp(types[i].pName, datatype)) + break; + } + free(types); + return i < no; +} + +static void print_proc_unload(printproc_t *pp) +{ + FreeLibrary(pp->hmod); + free(pp->name); + free(pp); +} + static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_info) { printer_t *printer = (printer_t *)hprinter; DOC_INFO_1W *info = (DOC_INFO_1W *)doc_info; + BOOL datatype_valid; WCHAR *datatype; + printproc_t *pp; TRACE("(%p %ld %p {pDocName = %s, pOutputFile = %s, pDatatype = %s})\n", hprinter, level, doc_info, debugstr_w(info->pDocName), @@ -3347,6 +3460,25 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in return 0; } + pp = print_proc_load(printer->info->print_proc); + if (!pp) + { + WARN("failed to load %s print processor\n", debugstr_w(printer->info->print_proc)); + pp = print_proc_load(L"winprint"); + } + if (!pp) + return 0; + + datatype_valid = print_proc_check_datatype(pp, datatype); + print_proc_unload(pp); + if (!datatype_valid) + { + TRACE("%s datatype not supported by %s\n", debugstr_w(datatype), + debugstr_w(printer->info->print_proc)); + SetLastError(ERROR_INVALID_DATATYPE); + return 0; + } + printer->doc = add_job(printer, info, TRUE); return printer->doc ? printer->doc->id : 0; } @@ -3586,117 +3718,6 @@ static BOOL WINAPI fpGetJob(HANDLE hprinter, DWORD job_id, DWORD level, return ret; } -typedef struct { - HMODULE hmod; - WCHAR *name; - BOOL (WINAPI *enum_datatypes)(WCHAR *, WCHAR *, DWORD, - BYTE *, DWORD, DWORD *, DWORD *); - HANDLE (WINAPI *open)(WCHAR *, PRINTPROCESSOROPENDATA *); - BOOL (WINAPI *print)(HANDLE, WCHAR *); - BOOL (WINAPI *close)(HANDLE); -} printproc_t; - -static printproc_t * print_proc_load(const WCHAR *name) -{ - WCHAR *reg_path, path[2 * MAX_PATH]; - printproc_t *ret; - DWORD size, len; - LSTATUS status; - HKEY hkey; - - size = sizeof(fmt_printprocessorsW) + - (wcslen(env_arch.envname) + wcslen(name)) * sizeof(WCHAR); - reg_path = malloc(size); - if (!reg_path) - return NULL; - swprintf(reg_path, size / sizeof(WCHAR), fmt_printprocessorsW, env_arch.envname); - wcscat(reg_path, name); - - status = RegOpenKeyW(HKEY_LOCAL_MACHINE, reg_path, &hkey); - free(reg_path); - if (status != ERROR_SUCCESS) - return NULL; - - if (!fpGetPrintProcessorDirectory(NULL, NULL, 1, (BYTE *)path, sizeof(path), &size)) - { - RegCloseKey(hkey); - return NULL; - } - len = size / sizeof(WCHAR); - path[len - 1] = '\\'; - - size = sizeof(path) - len * sizeof(WCHAR); - status = RegQueryValueExW(hkey, L"Driver", NULL, NULL, (BYTE *)(path + len), &size); - RegCloseKey(hkey); - if (status != ERROR_SUCCESS) - return NULL; - - ret = malloc(sizeof(*ret)); - if (!ret) - return NULL; - - TRACE("loading print processor: %s\n", debugstr_w(path)); - - ret->hmod = LoadLibraryW(path); - if (!ret->hmod) - { - free(ret); - return NULL; - } - - ret->enum_datatypes = (void *)GetProcAddress(ret->hmod, "EnumPrintProcessorDatatypesW"); - ret->open = (void *)GetProcAddress(ret->hmod, "OpenPrintProcessor"); - ret->print = (void *)GetProcAddress(ret->hmod, "PrintDocumentOnPrintProcessor"); - ret->close = (void *)GetProcAddress(ret->hmod, "ClosePrintProcessor"); - if (!ret->enum_datatypes || !ret->open || !ret->print || !ret->close) - { - FreeLibrary(ret->hmod); - free(ret); - return NULL; - } - - ret->name = wcsdup(name); - return ret; -} - -static BOOL print_proc_check_datatype(printproc_t *pp, const WCHAR *datatype) -{ - DATATYPES_INFO_1W *types; - DWORD size, no, i; - - if (!datatype) - return FALSE; - - pp->enum_datatypes(NULL, pp->name, 1, NULL, 0, &size, &no); - if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) - return FALSE; - - types = malloc(size); - if (!types) - return FALSE; - - if (!pp->enum_datatypes(NULL, pp->name, 1, (BYTE *)types, size, &size, &no)) - { - free(types); - return FALSE; - } - - for (i = 0; i < no; i++) - { - if (!wcscmp(types[i].pName, datatype)) - break; - } - free(types); - return i < no; -} - -static void print_proc_unload(printproc_t *pp) -{ - FreeLibrary(pp->hmod); - free(pp->name); - free(pp); -} - static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) { printer_t *printer = (printer_t *)hprinter;
1
0
0
0
Piotr Caban : localspl: Add support for PRINTER_ATTRIBUTE_RAW_ONLY printer attribute.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: dd4603d3ab77adf342c4efb5c5b110129fde8f8c URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd4603d3ab77adf342c4efb5c5b110…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Apr 27 11:24:50 2023 +0200 localspl: Add support for PRINTER_ATTRIBUTE_RAW_ONLY printer attribute. --- dlls/localspl/provider.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index d09ac4420c3..59f2b8c8cd0 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -237,6 +237,7 @@ typedef struct { WCHAR *port; WCHAR *print_proc; WCHAR *datatype; + DWORD attributes; CRITICAL_SECTION jobs_cs; struct list jobs; @@ -546,6 +547,17 @@ static WCHAR * reg_query_value(HKEY key, const WCHAR *name) return ret; } +static DWORD reg_query_dword(HKEY hkey, const WCHAR *name) +{ + DWORD type, val, size = sizeof(size); + + if (RegQueryValueExW(hkey, name, 0, &type, (BYTE*)&val, &size)) + return 0; + if (type != REG_DWORD) + return 0; + return val; +} + static printer_info_t* get_printer_info(const WCHAR *name) { HKEY hkey, hprinter = NULL; @@ -582,6 +594,7 @@ static printer_info_t* get_printer_info(const WCHAR *name) info->port = reg_query_value(hprinter, L"Port"); info->print_proc = reg_query_value(hprinter, L"Print Processor"); info->datatype = reg_query_value(hprinter, L"Datatype"); + info->attributes = reg_query_dword(hprinter, L"Attributes"); RegCloseKey(hprinter); if (!info->name || !info->port || !info->print_proc || !info->datatype) @@ -3281,6 +3294,7 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in { printer_t *printer = (printer_t *)hprinter; DOC_INFO_1W *info = (DOC_INFO_1W *)doc_info; + WCHAR *datatype; TRACE("(%p %ld %p {pDocName = %s, pOutputFile = %s, pDatatype = %s})\n", hprinter, level, doc_info, debugstr_w(info->pDocName), @@ -3318,6 +3332,21 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in return 0; } + if (info->pDatatype) + datatype = info->pDatatype; + else if (printer->datatype) + datatype = printer->datatype; + else + datatype = printer->info->datatype; + + if (!datatype || ((printer->info->attributes & PRINTER_ATTRIBUTE_RAW_ONLY) && + wcsicmp(datatype, L"RAW"))) + { + TRACE("non RAW datatype specified on RAW-only printer (%s)\n", debugstr_w(datatype)); + SetLastError(ERROR_INVALID_DATATYPE); + return 0; + } + printer->doc = add_job(printer, info, TRUE); return printer->doc ? printer->doc->id : 0; }
1
0
0
0
Anton Baskanov : dsound: Allocate big enough committedbuff up front.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 7e334a7a945c1c89f6a4b40d010b30a820176ee3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7e334a7a945c1c89f6a4b40d010b30…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Apr 23 18:05:43 2023 +0700 dsound: Allocate big enough committedbuff up front. --- dlls/dsound/buffer.c | 15 +++------------ dlls/dsound/dsound_private.h | 2 +- dlls/dsound/mixer.c | 1 + 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 403c88c2c95..7b830604a60 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -264,7 +264,6 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); DWORD oldFreq; - void *newcommitted; TRACE("(%p,%ld)\n",This,freq); @@ -290,17 +289,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i oldFreq = This->freq; This->freq = freq; - if (freq != oldFreq) { + if (freq != oldFreq) DSOUND_RecalcFormat(This); - newcommitted = realloc(This->committedbuff, This->writelead); - if(!newcommitted) { - ReleaseSRWLockExclusive(&This->lock); - return DSERR_OUTOFMEMORY; - } - This->committedbuff = newcommitted; - } - ReleaseSRWLockExclusive(&This->lock); return DS_OK; @@ -1112,7 +1103,7 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds /* calculate fragment size and write lead */ DSOUND_RecalcFormat(dsb); - dsb->committedbuff = malloc(dsb->writelead); + dsb->committedbuff = malloc(dsb->maxwritelead); if(!dsb->committedbuff) { IDirectSoundBuffer8_Release(&dsb->IDirectSoundBuffer8_iface); return DSERR_OUTOFMEMORY; @@ -1216,7 +1207,7 @@ HRESULT IDirectSoundBufferImpl_Duplicate( return DSERR_OUTOFMEMORY; } - committedbuff = malloc(pdsb->writelead); + committedbuff = malloc(pdsb->maxwritelead); if (committedbuff == NULL) { free(dsb); *ppdsb = NULL; diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 4d8cf84385d..d9f488c25b8 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -140,7 +140,7 @@ struct IDirectSoundBufferImpl PWAVEFORMATEX pwfx; BufferMemory* buffer; DWORD playflags,state,leadin; - DWORD writelead,buflen; + DWORD writelead,maxwritelead,buflen; DWORD freq; DSVOLUMEPAN volpan; DSBUFFERDESC dsbd; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 4d0c54735cf..bf05805221b 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -130,6 +130,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) /* calculate the 10ms write lead */ dsb->writelead = (dsb->freq / 100) * dsb->pwfx->nBlockAlign; + dsb->maxwritelead = (DSBFREQUENCY_MAX / 100) * dsb->pwfx->nBlockAlign; if (oldFreqAdjustDen) dsb->freqAccNum = (dsb->freqAccNum * dsb->freqAdjustDen + oldFreqAdjustDen / 2) / oldFreqAdjustDen;
1
0
0
0
Anton Baskanov : dsound: Acquire the lock when setting 3D buffer parameters.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 136726501cc0991f2c51ffbcf889d60e777e4dfd URL:
https://gitlab.winehq.org/wine/wine/-/commit/136726501cc0991f2c51ffbcf889d6…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Apr 17 10:30:06 2023 +0700 dsound: Acquire the lock when setting 3D buffer parameters. --- dlls/dsound/sound3d.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index 48febdeb307..939e0091815 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -363,11 +363,13 @@ static void DSOUND_ChangeListener(IDirectSoundBufferImpl *ds3dl) TRACE("(%p)\n",ds3dl); for (i = 0; i < ds3dl->device->nrofbuffers; i++) { + AcquireSRWLockExclusive(&ds3dl->device->buffers[i]->lock); /* check if this buffer is waiting for recalculation */ if (ds3dl->device->buffers[i]->ds3db_need_recalc) { DSOUND_Mix3DBuffer(ds3dl->device->buffers[i]); } + ReleaseSRWLockExclusive(&ds3dl->device->buffers[i]->lock); } } @@ -545,6 +547,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetAllParameters(IDirectSound3DBu } TRACE("setting: all parameters; dwApply = %ld\n", dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db = *lpcDs3dBuffer; if (dwApply == DS3D_IMMEDIATE) @@ -554,6 +559,8 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetAllParameters(IDirectSound3DBu This->ds3db_need_recalc = TRUE; status = DS_OK; + ReleaseSRWLockExclusive(&This->lock); + return status; } @@ -564,11 +571,17 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeAngles(IDirectSound3DBuffe TRACE("setting: Inside Cone Angle = %ld; Outside Cone Angle = %ld; dwApply = %ld\n", dwInsideConeAngle, dwOutsideConeAngle, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.dwInsideConeAngle = dwInsideConeAngle; This->ds3db_ds3db.dwOutsideConeAngle = dwOutsideConeAngle; if (dwApply == DS3D_IMMEDIATE) DSOUND_Mix3DBuffer(This); This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -578,6 +591,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOrientation(IDirectSound3D IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: Cone Orientation vector = (%f,%f,%f); dwApply = %ld\n", x, y, z, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.vConeOrientation.x = x; This->ds3db_ds3db.vConeOrientation.y = y; This->ds3db_ds3db.vConeOrientation.z = z; @@ -587,6 +603,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOrientation(IDirectSound3D DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -596,6 +615,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOutsideVolume(IDirectSound IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: ConeOutsideVolume = %ld; dwApply = %ld\n", lConeOutsideVolume, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.lConeOutsideVolume = lConeOutsideVolume; if (dwApply == DS3D_IMMEDIATE) { @@ -603,6 +625,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetConeOutsideVolume(IDirectSound DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -612,6 +637,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMaxDistance(IDirectSound3DBuff IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: MaxDistance = %f; dwApply = %ld\n", fMaxDistance, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.flMaxDistance = fMaxDistance; if (dwApply == DS3D_IMMEDIATE) { @@ -619,6 +647,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMaxDistance(IDirectSound3DBuff DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -628,6 +659,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMinDistance(IDirectSound3DBuff IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: MinDistance = %f; dwApply = %ld\n", fMinDistance, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.flMinDistance = fMinDistance; if (dwApply == DS3D_IMMEDIATE) { @@ -635,6 +669,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMinDistance(IDirectSound3DBuff DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -644,6 +681,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMode(IDirectSound3DBuffer *ifa IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: Mode = %ld; dwApply = %ld\n", dwMode, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.dwMode = dwMode; if (dwApply == DS3D_IMMEDIATE) { @@ -651,6 +691,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetMode(IDirectSound3DBuffer *ifa DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -660,6 +703,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetPosition(IDirectSound3DBuffer IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: Position vector = (%f,%f,%f); dwApply = %ld\n", x, y, z, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.vPosition.x = x; This->ds3db_ds3db.vPosition.y = y; This->ds3db_ds3db.vPosition.z = z; @@ -669,6 +715,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetPosition(IDirectSound3DBuffer DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; } @@ -678,6 +727,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetVelocity(IDirectSound3DBuffer IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); TRACE("setting: Velocity vector = (%f,%f,%f); dwApply = %ld\n", x, y, z, dwApply); + + AcquireSRWLockExclusive(&This->lock); + This->ds3db_ds3db.vVelocity.x = x; This->ds3db_ds3db.vVelocity.y = y; This->ds3db_ds3db.vVelocity.z = z; @@ -687,6 +739,9 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetVelocity(IDirectSound3DBuffer DSOUND_Mix3DBuffer(This); } This->ds3db_need_recalc = TRUE; + + ReleaseSRWLockExclusive(&This->lock); + return DS_OK; }
1
0
0
0
Anton Baskanov : dsound: Preserve freqAccNum value in DSOUND_RecalcFormat().
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 4871cd032f389383798c05178180c0aba8a2c537 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4871cd032f389383798c05178180c0…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Apr 26 11:59:30 2023 +0700 dsound: Preserve freqAccNum value in DSOUND_RecalcFormat(). Resetting it results in position discontinuity. With frequent SetFrequency() calls, this produces audible crackling. The issue affects pedestrian voices in GTA: San Andreas. --- dlls/dsound/mixer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index dbef1bc40fa..4d0c54735cf 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -96,6 +96,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) { DWORD ichannels = dsb->pwfx->nChannels; DWORD ochannels = dsb->device->pwfx->nChannels; + LONG64 oldFreqAdjustDen = dsb->freqAdjustDen; WAVEFORMATEXTENSIBLE *pwfxe; BOOL ieee = FALSE; @@ -130,7 +131,8 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) /* calculate the 10ms write lead */ dsb->writelead = (dsb->freq / 100) * dsb->pwfx->nBlockAlign; - dsb->freqAccNum = 0; + if (oldFreqAdjustDen) + dsb->freqAccNum = (dsb->freqAccNum * dsb->freqAdjustDen + oldFreqAdjustDen / 2) / oldFreqAdjustDen; dsb->get_aux = ieee ? getbpp[4] : getbpp[dsb->pwfx->wBitsPerSample/8 - 1]; dsb->put_aux = putieee32;
1
0
0
0
Anton Baskanov : dsound: Remove redundant assignments to freqAdjustNum and freqAdjustDen.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: c2563de512d8ce1aa2b42c33b56b2d26fd1d5bf3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c2563de512d8ce1aa2b42c33b56b2d…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Apr 26 12:15:19 2023 +0700 dsound: Remove redundant assignments to freqAdjustNum and freqAdjustDen. --- dlls/dsound/buffer.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 9f68752232f..403c88c2c95 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -291,8 +291,6 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i oldFreq = This->freq; This->freq = freq; if (freq != oldFreq) { - This->freqAdjustNum = This->freq; - This->freqAdjustDen = This->device->pwfx->nSamplesPerSec; DSOUND_RecalcFormat(This); newcommitted = realloc(This->committedbuff, This->writelead); @@ -1111,9 +1109,6 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds dsb->sec_mixpos = 0; dsb->state = STATE_STOPPED; - dsb->freqAdjustNum = dsb->freq; - dsb->freqAdjustDen = device->pwfx->nSamplesPerSec; - /* calculate fragment size and write lead */ DSOUND_RecalcFormat(dsb);
1
0
0
0
Anton Baskanov : dsound: Remove the unused nAvgBytesPerSec field.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 7bd2e99b66965473cce0b6e1b4779eae72d378ee URL:
https://gitlab.winehq.org/wine/wine/-/commit/7bd2e99b66965473cce0b6e1b4779e…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Apr 26 12:08:37 2023 +0700 dsound: Remove the unused nAvgBytesPerSec field. --- dlls/dsound/buffer.c | 3 --- dlls/dsound/dsound_private.h | 1 - 2 files changed, 4 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index b3238b8918e..9f68752232f 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -293,7 +293,6 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i if (freq != oldFreq) { This->freqAdjustNum = This->freq; This->freqAdjustDen = This->device->pwfx->nSamplesPerSec; - This->nAvgBytesPerSec = freq * This->pwfx->nBlockAlign; DSOUND_RecalcFormat(This); newcommitted = realloc(This->committedbuff, This->writelead); @@ -1114,8 +1113,6 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds dsb->freqAdjustNum = dsb->freq; dsb->freqAdjustDen = device->pwfx->nSamplesPerSec; - dsb->nAvgBytesPerSec = dsb->freq * - dsbd->lpwfxFormat->nBlockAlign; /* calculate fragment size and write lead */ DSOUND_RecalcFormat(dsb); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index e12baadf650..4d8cf84385d 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -141,7 +141,6 @@ struct IDirectSoundBufferImpl BufferMemory* buffer; DWORD playflags,state,leadin; DWORD writelead,buflen; - DWORD nAvgBytesPerSec; DWORD freq; DSVOLUMEPAN volpan; DSBUFFERDESC dsbd;
1
0
0
0
André Zwing : ntdll: Print RPC_S_SERVER_UNAVAILABLE exceptions.
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 7a9679a717e4b1d8c4d9e30181d49e88cc1eb116 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7a9679a717e4b1d8c4d9e30181d49e…
Author: André Zwing <nerv(a)dawncrow.de> Date: Tue Apr 25 21:45:30 2023 +0200 ntdll: Print RPC_S_SERVER_UNAVAILABLE exceptions. --- dlls/ntdll/exception.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index fc3e8982a98..9c69eb0eabe 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -94,6 +94,7 @@ const char *debugstr_exception_code( DWORD code ) case EXCEPTION_WINE_CXX_EXCEPTION: return "EXCEPTION_WINE_CXX_EXCEPTION"; case EXCEPTION_WINE_NAME_THREAD: return "EXCEPTION_WINE_NAME_THREAD"; case EXCEPTION_WINE_STUB: return "EXCEPTION_WINE_STUB"; + case RPC_S_SERVER_UNAVAILABLE: return "RPC_S_SERVER_UNAVAILABLE"; } return "unknown"; }
1
0
0
0
Paul Gofman : mfplat: Fix returned buffer length in dxgi_surface_buffer_lock().
by Alexandre Julliard
27 Apr '23
27 Apr '23
Module: wine Branch: master Commit: 5a162f2c316a28ad45f7c0707ed16b194204227e URL:
https://gitlab.winehq.org/wine/wine/-/commit/5a162f2c316a28ad45f7c0707ed16b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Apr 4 16:07:19 2023 -0600 mfplat: Fix returned buffer length in dxgi_surface_buffer_lock(). --- dlls/mfplat/buffer.c | 2 +- dlls/mfplat/tests/mfplat.c | 52 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index d8de06fb23a..1b9ba24a408 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1063,7 +1063,7 @@ static HRESULT dxgi_surface_buffer_lock(struct buffer *buffer, MF2DBuffer_LockFl if (buffer_start) *buffer_start = *scanline0; if (buffer_length) - *buffer_length = buffer->dxgi_surface.map_desc.RowPitch * buffer->_2d.height; + *buffer_length = buffer->dxgi_surface.map_desc.DepthPitch; } return hr; diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 77b7b26ba9c..14a7beedacf 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -7255,6 +7255,7 @@ static ID3D12Device *create_d3d12_device(void) static void test_d3d11_surface_buffer(void) { DWORD max_length, cur_length, length, color; + BYTE *data, *data2, *buffer_start; IMFDXGIBuffer *dxgi_buffer; D3D11_TEXTURE2D_DESC desc; IMF2DBuffer2 *_2dbuffer2; @@ -7263,7 +7264,6 @@ static void test_d3d11_surface_buffer(void) IMFMediaBuffer *buffer; ID3D11Device *device; BYTE buff[64 * 64 * 4]; - BYTE *data, *data2; LONG pitch, pitch2; UINT index, size; IUnknown *obj; @@ -7575,7 +7575,54 @@ static void test_d3d11_surface_buffer(void) ID3D11Texture2D_Release(texture); - /* Subresource index 1. */ + memset(&desc, 0, sizeof(desc)); + desc.Width = 64; + desc.Height = 64; + desc.ArraySize = 1; + desc.MipLevels = 1; + desc.Format = DXGI_FORMAT_NV12; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + if (SUCCEEDED(hr)) + { + hr = pMFCreateDXGISurfaceBuffer(&IID_ID3D11Texture2D, (IUnknown *)texture, 0, FALSE, &buffer); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer2, (void **)&_2dbuffer2); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IMF2DBuffer2_Lock2DSize(_2dbuffer2, MF2DBuffer_LockFlags_Read, &data, &pitch, &buffer_start, &length); + ok(hr == S_OK, "got %#lx.\n", hr); + + ok(pitch >= desc.Width, "got %ld.\n", pitch); + ok(length == pitch * desc.Height * 3 / 2, "got %lu.\n", length); + + hr = IMF2DBuffer2_Unlock2D(_2dbuffer2); + ok(hr == S_OK, "got %#lx.\n", hr); + + IMF2DBuffer2_Release(_2dbuffer2); + IMFMediaBuffer_Release(buffer); + ID3D11Texture2D_Release(texture); + } + else + { + win_skip("Failed to create NV12 texture, hr %#lx, skipping test.\n", hr); + ID3D11Device_Release(device); + return; + } + + /* Subresource index 1. + * When WARP d3d11 device is used, this test leaves the device in a broken state, so it should + * be kept last. */ + memset(&desc, 0, sizeof(desc)); + desc.Width = 64; + desc.Height = 64; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); ok(hr == S_OK, "Failed to create a texture, hr %#lx.\n", hr); @@ -7600,7 +7647,6 @@ static void test_d3d11_surface_buffer(void) IMF2DBuffer_Release(_2d_buffer); IMFMediaBuffer_Release(buffer); - ID3D11Texture2D_Release(texture); ID3D11Device_Release(device);
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
82
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
Results per page:
10
25
50
100
200