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
September 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
920 discussions
Start a n
N
ew thread
Alex Henrie : msvfw32: Use CRT allocation functions.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: 45c6da6508c312fd8f7ac368664c9b0248da747a URL:
https://gitlab.winehq.org/wine/wine/-/commit/45c6da6508c312fd8f7ac368664c9b…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Sep 19 23:16:19 2023 -0600 msvfw32: Use CRT allocation functions. --- dlls/msvfw32/drawdib.c | 22 +++++++++---------- dlls/msvfw32/mciwnd.c | 28 +++++++++++------------- dlls/msvfw32/msvideo_main.c | 53 ++++++++++++++++++++++----------------------- 3 files changed, 50 insertions(+), 53 deletions(-)
1
0
0
0
Alex Henrie : mciwave: Use CRT allocation functions.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: 90a5dc72d365788dc8f3121da4dd40ca71dc35f1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/90a5dc72d365788dc8f3121da4dd40…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Sep 19 23:05:37 2023 -0600 mciwave: Use CRT allocation functions. --- dlls/mciwave/mciwave.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index b2582a56123..b17c347258f 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -89,7 +89,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) ret = sca->cmd(sca->wDevID, sca->dwParam1 | MCI_WAIT, sca->dwParam2, sca->evt); TRACE("In thread after async command (%08x,%08Ix,%08Ix)\n", sca->wDevID, sca->dwParam1, sca->dwParam2); - HeapFree(GetProcessHeap(), 0, sca); + free(sca); return ret; } @@ -100,7 +100,7 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, async_cmd cmd, DWORD_PTR dwParam1 DWORD_PTR dwParam2, UINT size) { HANDLE handles[2]; - struct SCA* sca = HeapAlloc(GetProcessHeap(), 0, sizeof(struct SCA) + size); + struct SCA* sca = malloc(sizeof(struct SCA) + size); if (sca == 0) return MCIERR_OUT_OF_MEMORY; @@ -182,7 +182,7 @@ static LRESULT WAVE_drvClose(MCIDEVICEID dwDevID) WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)mciGetDriverData(dwDevID); if (wmw) { - HeapFree(GetProcessHeap(), 0, wmw); + free(wmw); mciSetDriverData(dwDevID, 0); return 1; } @@ -287,12 +287,12 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, const MMCKINFO* pckMainRIFF) TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); - pwfx = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize); + pwfx = malloc(mmckInfo.cksize); if (!pwfx) return MCIERR_OUT_OF_MEMORY; r = mmioRead(wmw->hFile, (HPSTR)pwfx, mmckInfo.cksize); if (r < 0 || r < sizeof(PCMWAVEFORMAT)) { - HeapFree(GetProcessHeap(), 0, pwfx); + free(pwfx); return MCIERR_INVALID_FILE; } TRACE("wFormatTag=%04X !\n", pwfx->wFormatTag); @@ -305,7 +305,7 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, const MMCKINFO* pckMainRIFF) TRACE("cbSize=%u !\n", pwfx->cbSize); if ((pwfx->wFormatTag != WAVE_FORMAT_PCM) && (r < sizeof(WAVEFORMATEX) || (r < sizeof(WAVEFORMATEX) + pwfx->cbSize))) { - HeapFree(GetProcessHeap(), 0, pwfx); + free(pwfx); return MCIERR_INVALID_FILE; } wmw->lpWaveFormat = pwfx; @@ -437,7 +437,7 @@ static DWORD create_tmp_file(HMMIO* hFile, LPWSTR* pszTmpFileName) MAX_PATH * sizeof(WCHAR)); if (!GetTempFileNameW(szTmpPath, szPrefix, 0, *pszTmpFileName)) { WARN("can't retrieve temp file name!\n"); - HeapFree(GetProcessHeap(), 0, *pszTmpFileName); + free(*pszTmpFileName); return MCIERR_FILE_NOT_FOUND; } @@ -451,7 +451,7 @@ static DWORD create_tmp_file(HMMIO* hFile, LPWSTR* pszTmpFileName) if (*hFile == 0) { WARN("can't create file=%s!\n", debugstr_w(*pszTmpFileName)); /* temporary file could not be created. clean filename. */ - HeapFree(GetProcessHeap(), 0, *pszTmpFileName); + free(*pszTmpFileName); dwRet = MCIERR_FILE_NOT_FOUND; } } @@ -463,10 +463,9 @@ static LRESULT WAVE_mciOpenFile(WINE_MCIWAVE* wmw, LPCWSTR filename) LRESULT dwRet = MMSYSERR_NOERROR; LPWSTR fn; - fn = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(filename) + 1) * sizeof(WCHAR)); + fn = wcsdup(filename); if (!fn) return MCIERR_OUT_OF_MEMORY; - lstrcpyW(fn, filename); - HeapFree(GetProcessHeap(), 0, wmw->lpFileName); + free(wmw->lpFileName); wmw->lpFileName = fn; if (filename[0]) { @@ -569,7 +568,7 @@ static LRESULT WAVE_mciOpen(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_P if (wmw->hFile != 0) mmioClose(wmw->hFile, 0); wmw->hFile = 0; - HeapFree(GetProcessHeap(), 0, wmw->lpFileName); + free(wmw->lpFileName); wmw->lpFileName = NULL; } return dwRet; @@ -681,9 +680,9 @@ static DWORD WAVE_mciClose(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_GENERIC_PARM } if (wmw->lpWaveFormat != &wmw->wfxRef) - HeapFree(GetProcessHeap(), 0, wmw->lpWaveFormat); + free(wmw->lpWaveFormat); wmw->lpWaveFormat = &wmw->wfxRef; - HeapFree(GetProcessHeap(), 0, wmw->lpFileName); + free(wmw->lpFileName); wmw->lpFileName = NULL; if ((dwFlags & MCI_NOTIFY) && lpParms) { @@ -854,7 +853,7 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, /* make it so that 3 buffers per second are needed */ bufsize = WAVE_ALIGN_ON_BLOCK(wmw, wmw->lpWaveFormat->nAvgBytesPerSec / 3); - waveHdr = HeapAlloc(GetProcessHeap(), 0, 2 * sizeof(WAVEHDR) + 2 * bufsize); + waveHdr = malloc(2 * sizeof(WAVEHDR) + 2 * bufsize); waveHdr[0].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR); waveHdr[1].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR) + bufsize; waveHdr[0].dwUser = waveHdr[1].dwUser = 0L; @@ -917,7 +916,7 @@ cleanUp: if (dwFlags & MCI_NOTIFY) oldcb = InterlockedExchangePointer(&wmw->hCallback, NULL); - HeapFree(GetProcessHeap(), 0, waveHdr); + free(waveHdr); if (wmw->hWave) { waveOutClose(wmw->hWave); @@ -1038,7 +1037,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt * we don't modify the wave part of an existing file (ie. we always erase an * existing content, we don't overwrite) */ - HeapFree(GetProcessHeap(), 0, wmw->lpFileName); + free(wmw->lpFileName); dwRet = create_tmp_file(&wmw->hFile, (WCHAR**)&wmw->lpFileName); if (dwRet != 0) return dwRet; @@ -1092,7 +1091,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt /* make it so that 3 buffers per second are needed */ bufsize = WAVE_ALIGN_ON_BLOCK(wmw, wmw->lpWaveFormat->nAvgBytesPerSec / 3); - waveHdr = HeapAlloc(GetProcessHeap(), 0, 2 * sizeof(WAVEHDR) + 2 * bufsize); + waveHdr = malloc(2 * sizeof(WAVEHDR) + 2 * bufsize); waveHdr[0].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR); waveHdr[1].lpData = (char*)waveHdr + 2 * sizeof(WAVEHDR) + bufsize; waveHdr[0].dwUser = waveHdr[1].dwUser = 0L; @@ -1143,7 +1142,7 @@ cleanUp: if (dwFlags & MCI_NOTIFY) oldcb = InterlockedExchangePointer(&wmw->hCallback, NULL); - HeapFree(GetProcessHeap(), 0, waveHdr); + free(waveHdr); if (wmw->hWave) { waveInClose(wmw->hWave);
1
0
0
0
Alex Henrie : gameux: Use CRT allocation functions.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: 7dc45bd84656289846f0f1dfab79d46a4258bd14 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7dc45bd84656289846f0f1dfab79d4…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Sep 19 22:57:34 2023 -0600 gameux: Use CRT allocation functions. --- dlls/gameux/gameexplorer.c | 49 ++++++++++++++++++++------------------------ dlls/gameux/gamestatistics.c | 12 +++++------ dlls/gameux/gameux_private.h | 2 +- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/dlls/gameux/gameexplorer.c b/dlls/gameux/gameexplorer.c index a356a693ee3..b352d7344bc 100644 --- a/dlls/gameux/gameexplorer.c +++ b/dlls/gameux/gameexplorer.c @@ -66,8 +66,8 @@ static void GAMEUX_initGameData(struct GAMEUX_GAME_DATA *GameData) */ static void GAMEUX_uninitGameData(struct GAMEUX_GAME_DATA *GameData) { - HeapFree(GetProcessHeap(), 0, GameData->sGDFBinaryPath); - HeapFree(GetProcessHeap(), 0, GameData->sGameInstallDirectory); + free(GameData->sGDFBinaryPath); + free(GameData->sGameInstallDirectory); SysFreeString(GameData->bstrName); SysFreeString(GameData->bstrDescription); } @@ -109,7 +109,7 @@ HRESULT GAMEUX_buildGameRegistryPath(GAME_INSTALL_SCOPE installScope, if(SUCCEEDED(hr)) { - pTokenUser = HeapAlloc(GetProcessHeap(), 0, dwLength); + pTokenUser = malloc(dwLength); if(!pTokenUser) hr = E_OUTOFMEMORY; } @@ -128,7 +128,7 @@ HRESULT GAMEUX_buildGameRegistryPath(GAME_INSTALL_SCOPE installScope, LocalFree(lpSID); } - HeapFree(GetProcessHeap(), 0, pTokenUser); + free(pTokenUser); CloseHandle(hToken); } } @@ -153,14 +153,11 @@ HRESULT GAMEUX_buildGameRegistryPath(GAME_INSTALL_SCOPE installScope, if(SUCCEEDED(hr)) { - *lpRegistryPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(sRegistryPath)+1)*sizeof(WCHAR)); + *lpRegistryPath = wcsdup(sRegistryPath); if(!*lpRegistryPath) hr = E_OUTOFMEMORY; } - if(SUCCEEDED(hr)) - lstrcpyW(*lpRegistryPath, sRegistryPath); - TRACE("result: 0x%lx, path: %s\n", hr, debugstr_w(*lpRegistryPath)); return hr; } @@ -246,7 +243,7 @@ static HRESULT GAMEUX_WriteRegistryRecord(struct GAMEUX_GAME_DATA *GameData) } } - HeapFree(GetProcessHeap(), 0, lpRegistryKey); + free(lpRegistryKey); TRACE("returning 0x%lx\n", hr); return hr; } @@ -464,7 +461,7 @@ static HRESULT GAMEUX_RemoveRegistryRecord(GUID* pInstanceID) if(SUCCEEDED(hr)) hr = HRESULT_FROM_WIN32(RegDeleteKeyExW(HKEY_LOCAL_MACHINE, lpRegistryPath, KEY_WOW64_64KEY, 0)); - HeapFree(GetProcessHeap(), 0, lpRegistryPath); + free(lpRegistryPath); /* if not, check current user */ if(FAILED(hr)) @@ -473,7 +470,7 @@ static HRESULT GAMEUX_RemoveRegistryRecord(GUID* pInstanceID) if(SUCCEEDED(hr)) hr = HRESULT_FROM_WIN32(RegDeleteKeyExW(HKEY_LOCAL_MACHINE, lpRegistryPath, KEY_WOW64_64KEY, 0)); - HeapFree(GetProcessHeap(), 0, lpRegistryPath); + free(lpRegistryPath); } return hr; @@ -506,10 +503,8 @@ static HRESULT GAMEUX_RegisterGame(LPCWSTR sGDFBinaryPath, TRACE("(%s, %s, 0x%x, %s)\n", debugstr_w(sGDFBinaryPath), debugstr_w(sGameInstallDirectory), installScope, debugstr_guid(pInstanceID)); GAMEUX_initGameData(&GameData); - GameData.sGDFBinaryPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(sGDFBinaryPath)+1)*sizeof(WCHAR)); - lstrcpyW(GameData.sGDFBinaryPath, sGDFBinaryPath); - GameData.sGameInstallDirectory = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(sGameInstallDirectory)+1)*sizeof(WCHAR)); - lstrcpyW(GameData.sGameInstallDirectory, sGameInstallDirectory); + GameData.sGDFBinaryPath = wcsdup(sGDFBinaryPath); + GameData.sGameInstallDirectory = wcsdup(sGameInstallDirectory); GameData.installScope = installScope; /* generate GUID if it was not provided by user */ @@ -562,7 +557,7 @@ done: * InstanceID [I] game instance identifier * lpRegistryPath [O] place to store address of registry path to * the game. It is filled only if key exists. - * It must be freed by HeapFree(GetProcessHeap(), 0, ...) + * It must be freed by free(...) * * Returns: * S_OK key was found properly @@ -590,7 +585,7 @@ static HRESULT GAMEUX_IsGameKeyExist(GAME_INSTALL_SCOPE installScope, else { /* if the key does not exist or another error occurred, do not return the path */ - HeapFree(GetProcessHeap(), 0, *lpRegistryPath); + free(*lpRegistryPath); *lpRegistryPath = NULL; } @@ -616,7 +611,7 @@ static HRESULT GAMEUX_LoadRegistryString(HKEY hRootKey, if(SUCCEEDED(hr)) { - *lpValue = HeapAlloc(GetProcessHeap(), 0, dwSize); + *lpValue = malloc(dwSize); if(!*lpValue) hr = E_OUTOFMEMORY; } @@ -680,11 +675,11 @@ static HRESULT GAMEUX_UpdateGame(LPGUID InstanceID) { hr = GAMEUX_RegisterGame(lpGDFBinaryPath, lpGameInstallDirectory, installScope, InstanceID); - HeapFree(GetProcessHeap(), 0, lpGDFBinaryPath); - HeapFree(GetProcessHeap(), 0, lpGameInstallDirectory); + free(lpGDFBinaryPath); + free(lpGameInstallDirectory); } - HeapFree(GetProcessHeap(), 0, lpRegistryPath); + free(lpRegistryPath); TRACE("returning 0x%lx\n", hr); return hr; } @@ -720,7 +715,7 @@ HRESULT GAMEUX_FindGameInstanceId( if(SUCCEEDED(hr)) { ++dwMaxSubKeyLen; /* for string terminator */ - lpName = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen*sizeof(WCHAR)); + lpName = malloc(dwMaxSubKeyLen * sizeof(WCHAR)); if(!lpName) hr = E_OUTOFMEMORY; } @@ -744,16 +739,16 @@ HRESULT GAMEUX_FindGameInstanceId( hr = CLSIDFromString(lpName, pInstanceId); found = TRUE; } - HeapFree(GetProcessHeap(), 0, lpValue); + free(lpValue); } } } - HeapFree(GetProcessHeap(), 0, lpName); + free(lpName); RegCloseKey(hRootKey); } - HeapFree(GetProcessHeap(), 0, lpRegistryPath); + free(lpRegistryPath); if((SUCCEEDED(hr) && !found) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) hr = S_FALSE; @@ -833,7 +828,7 @@ static ULONG WINAPI GameExplorerImpl_Release(IGameExplorer *iface) if(ref == 0) { TRACE("freeing GameExplorer object\n"); - HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; @@ -1003,7 +998,7 @@ HRESULT GameExplorer_create( TRACE("(%p, %p)\n", pUnkOuter, ppObj); - pGameExplorer = HeapAlloc(GetProcessHeap(), 0, sizeof(*pGameExplorer)); + pGameExplorer = malloc(sizeof(*pGameExplorer)); if(!pGameExplorer) return E_OUTOFMEMORY; diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index 6d62b67e36f..984dfc4ee9f 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -382,7 +382,7 @@ static HRESULT GAMEUX_getAppIdFromGDFPath( } } - HeapFree(GetProcessHeap(), 0, lpRegistryPath); + free(lpRegistryPath); TRACE("found app id: %s, return: %#lx\n", debugstr_w(lpApplicationId), hr); return hr; @@ -687,7 +687,7 @@ static ULONG WINAPI GameStatisticsImpl_Release(IGameStatistics *iface) if ( ref == 0 ) { TRACE("freeing IGameStatistics\n"); - HeapFree( GetProcessHeap(), 0, This ); + free( This ); } return ref; @@ -969,7 +969,7 @@ static HRESULT create_IGameStatistics(GameStatisticsImpl** ppStats) { TRACE("(%p)\n", ppStats); - *ppStats = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**ppStats)); + *ppStats = calloc(1, sizeof(**ppStats)); if(!(*ppStats)) return E_OUTOFMEMORY; @@ -1043,7 +1043,7 @@ static ULONG WINAPI GameStatisticsMgrImpl_Release(IGameStatisticsMgr *iface) if ( ref == 0 ) { TRACE("freeing GameStatistics object\n"); - HeapFree( GetProcessHeap(), 0, This); + free(This); } return ref; @@ -1081,7 +1081,7 @@ static HRESULT STDMETHODCALLTYPE GameStatisticsMgrImpl_GetGameStatistics( *ppiStats = output_iface; else { - HeapFree(GetProcessHeap(), 0, statisticsImpl); + free(statisticsImpl); *ppiStats = NULL; } @@ -1126,7 +1126,7 @@ HRESULT GameStatistics_create( TRACE("(%p, %p)\n", pUnkOuter, ppObj); - pGameStatistics = HeapAlloc( GetProcessHeap(), 0, sizeof (*pGameStatistics) ); + pGameStatistics = malloc(sizeof(*pGameStatistics)); if( !pGameStatistics ) return E_OUTOFMEMORY; diff --git a/dlls/gameux/gameux_private.h b/dlls/gameux/gameux_private.h index 64ccec83118..81109d33b97 100644 --- a/dlls/gameux/gameux_private.h +++ b/dlls/gameux/gameux_private.h @@ -78,7 +78,7 @@ HRESULT GAMEUX_FindGameInstanceId( * lpRegistryPath [O] pointer which will receive address to string * containing expected registry path. Path * is relative to HKLM registry key. It - * must be freed by calling HeapFree(GetProcessHeap(), 0, ...) + * must be freed by calling free(...) * * Name of game's registry key always follows patterns below: * When game is installed for current user only (installScope is GIS_CURRENT_USER):
1
0
0
0
Alex Henrie : advpack: Use CRT allocation functions.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: 9d6a38450835d9b58c5fd47a4b072215a6cb259d URL:
https://gitlab.winehq.org/wine/wine/-/commit/9d6a38450835d9b58c5fd47a4b0722…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Sep 19 22:39:39 2023 -0600 advpack: Use CRT allocation functions. --- dlls/advpack/advpack.c | 31 +++++++++++------------ dlls/advpack/advpack_private.h | 6 ++--- dlls/advpack/files.c | 56 +++++++++++++++++------------------------- dlls/advpack/install.c | 53 +++++++++++++-------------------------- dlls/advpack/reg.c | 16 ++++++------ 5 files changed, 63 insertions(+), 99 deletions(-)
1
0
0
0
Alex Henrie : oleaut32: Use CRT allocation functions in typelib.c.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: 6129ea6be8afce23a9cc7d543ab2d03ec6cbbdd3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6129ea6be8afce23a9cc7d543ab2d0…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sat Sep 16 11:57:23 2023 -0600 oleaut32: Use CRT allocation functions in typelib.c. --- dlls/oleaut32/typelib.c | 387 ++++++++++++++++++++++-------------------------- 1 file changed, 181 insertions(+), 206 deletions(-)
1
0
0
0
Alex Henrie : oleaut32: Use CRT allocation functions in olepicture.c.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: b9468c636fbc717fe0a4ea68cbaa8b186849479e URL:
https://gitlab.winehq.org/wine/wine/-/commit/b9468c636fbc717fe0a4ea68cbaa8b…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sat Sep 16 11:57:23 2023 -0600 oleaut32: Use CRT allocation functions in olepicture.c. --- dlls/oleaut32/olepicture.c | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index b11493d5739..b2ad6cb473a 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -276,7 +276,7 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu /* * Allocate space for the object. */ - newObject = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OLEPictureImpl)); + newObject = calloc(1, sizeof(OLEPictureImpl)); if (!newObject) return E_OUTOFMEMORY; @@ -293,7 +293,7 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu &newObject->pCP); if (hr != S_OK) { - HeapFree(GetProcessHeap(), 0, newObject); + free(newObject); return hr; } @@ -395,8 +395,8 @@ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj) break; } } - HeapFree(GetProcessHeap(), 0, Obj->data); - HeapFree(GetProcessHeap(), 0, Obj); + free(Obj->data); + free(Obj); } static ULONG WINAPI OLEPictureImpl_AddRef( @@ -1042,7 +1042,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour stride = 4 * width; buffersize = stride * height; - bits = HeapAlloc(GetProcessHeap(), 0, buffersize); + bits = malloc(buffersize); if (!bits) { hr = E_OUTOFMEMORY; @@ -1129,7 +1129,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour ReleaseDC(0, hdcref); end: - HeapFree(GetProcessHeap(), 0, bits); + free(bits); IWICBitmapSource_Release(real_source); return hr; } @@ -1240,7 +1240,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x } if (cifd->idType == 2) { - LPBYTE buf = HeapAlloc(GetProcessHeap(), 0, cifd->idEntries[i].dwDIBSize + 4); + BYTE *buf = malloc(cifd->idEntries[i].dwDIBSize + 4); memcpy(buf, &cifd->idEntries[i].xHotspot, 4); memcpy(buf + 4, xbuf+cifd->idEntries[i].dwDIBOffset, cifd->idEntries[i].dwDIBSize); hicon = CreateIconFromResourceEx( @@ -1252,7 +1252,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x cifd->idEntries[i].bHeight, 0 ); - HeapFree(GetProcessHeap(), 0, buf); + free(buf); } else { @@ -1430,7 +1430,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm) ULONG nread = 42; TRACE("Reading all data from stream.\n"); - xbuf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, origsize); + xbuf = calloc(1, origsize); if (headerisdata) memcpy (xbuf, header, 8); while (1) { @@ -1443,9 +1443,10 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm) if (!nread || hr != S_OK) /* done, or error */ break; if (xread == origsize) { - origsize += sizeinc; sizeinc = 2*sizeinc; /* exponential increase */ - xbuf = HeapReAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, xbuf, origsize); + xbuf = realloc(xbuf, origsize + sizeinc); + memset(xbuf + origsize, 0, sizeinc); + origsize += sizeinc; } } if (hr != S_OK) @@ -1455,7 +1456,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm) This->data = xbuf; } else { This->datalen = toread+(headerisdata?8:0); - xbuf = This->data = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, This->datalen); + xbuf = This->data = calloc(1, This->datalen); if (!xbuf) return E_OUTOFMEMORY; @@ -1542,8 +1543,7 @@ static BOOL serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLeng BITMAPFILEHEADER * pFileHeader; BITMAPINFO * pInfoHeader; - pInfoBitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); + pInfoBitmap = calloc(1, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); /* Find out bitmap size and padded length */ hDC = GetDC(0); @@ -1552,7 +1552,7 @@ static BOOL serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLeng /* Fetch bitmap palette & pixel data */ - pPixelData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pInfoBitmap->bmiHeader.biSizeImage); + pPixelData = calloc(1, pInfoBitmap->bmiHeader.biSizeImage); GetDIBits(hDC, hBitmap, 0, pInfoBitmap->bmiHeader.biHeight, pPixelData, pInfoBitmap, DIB_RGB_COLORS); /* Calculate the total length required for the BMP data */ @@ -1570,7 +1570,7 @@ static BOOL serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLeng sizeof(BITMAPINFOHEADER) + iNumPaletteEntries * sizeof(RGBQUAD) + pInfoBitmap->bmiHeader.biSizeImage; - *ppBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *pLength); + *ppBuffer = calloc(1, *pLength); /* Fill the BITMAPFILEHEADER */ pFileHeader = *ppBuffer; @@ -1592,8 +1592,8 @@ static BOOL serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLeng pPixelData, pInfoBitmap->bmiHeader.biSizeImage); success = TRUE; - HeapFree(GetProcessHeap(), 0, pPixelData); - HeapFree(GetProcessHeap(), 0, pInfoBitmap); + free(pPixelData); + free(pInfoBitmap); return success; } @@ -1609,7 +1609,7 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) unsigned char * pIconData = NULL; unsigned int iDataSize = 0; - pInfoBitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); + pInfoBitmap = calloc(1, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); /* Find out icon size */ hDC = GetDC(0); @@ -1641,7 +1641,7 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) */ /* Let's start with one CURSORICONFILEDIR and one CURSORICONFILEDIRENTRY */ iDataSize += 3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY) + sizeof(BITMAPINFOHEADER); - pIconData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iDataSize); + pIconData = calloc(1, iDataSize); /* Fill out the CURSORICONFILEDIR */ pIconDir = (CURSORICONFILEDIR *)pIconData; @@ -1690,7 +1690,7 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) iDataSize += pIconBitmapHeader->biHeight * iLengthScanLineMask; pIconBitmapHeader->biSizeImage += pIconBitmapHeader->biHeight * iLengthScanLineMask; pIconBitmapHeader->biHeight *= 2; - pIconData = HeapReAlloc(GetProcessHeap(), 0, pIconData, iDataSize); + pIconData = realloc(pIconData, iDataSize); pIconEntry = (CURSORICONFILEDIRENTRY *)(pIconData + 3 * sizeof(WORD)); pIconBitmapHeader = (BITMAPINFOHEADER *)(pIconData + 3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY)); pIconEntry->dwDIBSize = iDataSize - (3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY)); @@ -1740,7 +1740,7 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) if (hDC) ReleaseDC(0, hDC); DeleteObject(infoIcon.hbmMask); if (infoIcon.hbmColor) DeleteObject(infoIcon.hbmColor); - HeapFree(GetProcessHeap(), 0, pInfoBitmap); + free(pInfoBitmap); } else { ERR("Unable to get icon information (error %lu)\n", GetLastError()); } @@ -1774,7 +1774,7 @@ static HRESULT WINAPI OLEPictureImpl_Save( hResult = E_FAIL; break; } - HeapFree(GetProcessHeap(), 0, This->data); + free(This->data); This->data = pIconData; This->datalen = iDataSize; } @@ -1811,7 +1811,7 @@ static HRESULT WINAPI OLEPictureImpl_Save( break; } - HeapFree(GetProcessHeap(), 0, This->data); + free(This->data); This->data = pIconData; This->datalen = iDataSize; }
1
0
0
0
Alex Henrie : oleaut32: Use CRT allocation functions in hash.c.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: b07c46fb0b66d8e283161423a898f362c9368655 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b07c46fb0b66d8e283161423a898f3…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sat Sep 16 11:57:23 2023 -0600 oleaut32: Use CRT allocation functions in hash.c. --- dlls/oleaut32/hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/hash.c b/dlls/oleaut32/hash.c index 896e0ec5d37..e3aababb241 100644 --- a/dlls/oleaut32/hash.c +++ b/dlls/oleaut32/hash.c @@ -605,9 +605,9 @@ ULONG WINAPI LHashValOfNameSys(SYSKIND skind, LCID lcid, LPCOLESTR str) if (!str) return 0; len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); - strA = HeapAlloc( GetProcessHeap(), 0, len ); + strA = malloc(len); WideCharToMultiByte( CP_ACP, 0, str, -1, strA, len, NULL, NULL ); res = LHashValOfNameSysA(skind, lcid, strA); - HeapFree(GetProcessHeap(), 0, strA); + free(strA); return res; }
1
0
0
0
Alex Henrie : oleaut32: Use CRT allocation functions in connpt.c.
by Alexandre Julliard
20 Sep '23
20 Sep '23
Module: wine Branch: master Commit: fd40997c9fbe31d77eda6628f37493b294a4b59c URL:
https://gitlab.winehq.org/wine/wine/-/commit/fd40997c9fbe31d77eda6628f37493…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sat Sep 16 11:57:23 2023 -0600 oleaut32: Use CRT allocation functions in connpt.c. --- dlls/oleaut32/connpt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/oleaut32/connpt.c b/dlls/oleaut32/connpt.c index 993f2d9cf08..9275b7306d6 100644 --- a/dlls/oleaut32/connpt.c +++ b/dlls/oleaut32/connpt.c @@ -110,8 +110,8 @@ static void ConnectionPointImpl_Destroy(ConnectionPointImpl *Obj) Obj->sinks[i] = NULL; } } - HeapFree(GetProcessHeap(), 0, Obj->sinks); - HeapFree(GetProcessHeap(), 0, Obj); + free(Obj->sinks); + free(Obj); return; } @@ -213,9 +213,9 @@ static HRESULT WINAPI ConnectionPointImpl_Advise(IConnectionPoint *iface, break; } if(i == This->maxSinks) { + This->sinks = realloc(This->sinks, (This->maxSinks + MAXSINKS) * sizeof(IUnknown*)); + memset(This->sinks + This->maxSinks, 0, MAXSINKS * sizeof(IUnknown*)); This->maxSinks += MAXSINKS; - This->sinks = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->sinks, - This->maxSinks * sizeof(IUnknown *)); } This->sinks[i] = lpSink; This->nSinks++; @@ -254,7 +254,7 @@ static HRESULT WINAPI ConnectionPointImpl_EnumConnections(IConnectionPoint *ifac if(This->nSinks == 0) return OLE_E_NOCONNECTION; - pCD = HeapAlloc(GetProcessHeap(), 0, sizeof(CONNECTDATA) * This->nSinks); + pCD = malloc(sizeof(CONNECTDATA) * This->nSinks); for(i = 0, nextslot = 0; i < This->maxSinks; i++) { if(This->sinks[i] != NULL) { @@ -274,7 +274,7 @@ static HRESULT WINAPI ConnectionPointImpl_EnumConnections(IConnectionPoint *ifac &IID_IEnumConnections, (void**)ppEnum); IEnumConnections_Release(&EnumObj->IEnumConnections_iface); - HeapFree(GetProcessHeap(), 0, pCD); + free(pCD); return hr; } @@ -297,13 +297,13 @@ static EnumConnectionsImpl *EnumConnectionsImpl_Construct(IUnknown *pUnk, DWORD nSinks, CONNECTDATA *pCD) { - EnumConnectionsImpl *Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj)); + EnumConnectionsImpl *Obj = malloc(sizeof(*Obj)); DWORD i; Obj->IEnumConnections_iface.lpVtbl = &EnumConnectionsImpl_VTable; Obj->ref = 1; Obj->pUnk = pUnk; - Obj->pCD = HeapAlloc(GetProcessHeap(), 0, nSinks * sizeof(CONNECTDATA)); + Obj->pCD = malloc(nSinks * sizeof(CONNECTDATA)); Obj->nConns = nSinks; Obj->nCur = 0; @@ -321,8 +321,8 @@ static void EnumConnectionsImpl_Destroy(EnumConnectionsImpl *Obj) for(i = 0; i < Obj->nConns; i++) IUnknown_Release(Obj->pCD[i].pUnk); - HeapFree(GetProcessHeap(), 0, Obj->pCD); - HeapFree(GetProcessHeap(), 0, Obj); + free(Obj->pCD); + free(Obj); return; } @@ -487,7 +487,7 @@ HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, TRACE("(%p %s %p)\n", pUnk, debugstr_guid(riid), pCP); *pCP = NULL; - Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj)); + Obj = malloc(sizeof(*Obj)); if (!Obj) return E_OUTOFMEMORY; @@ -496,7 +496,7 @@ HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, Obj->ref = 1; Obj->iid = *riid; Obj->maxSinks = MAXSINKS; - Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IUnknown*) * MAXSINKS); + Obj->sinks = calloc(MAXSINKS, sizeof(IUnknown*)); Obj->nSinks = 0; *pCP = &Obj->IConnectionPoint_iface;
1
0
0
0
Eric Pouech : ntdll: Allow empty application nodes in actctx.
by Alexandre Julliard
19 Sep '23
19 Sep '23
Module: wine Branch: master Commit: 6558611fa2d24447297cb62d168b924c33839c43 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6558611fa2d24447297cb62d168b92…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Sep 19 15:21:25 2023 +0200 ntdll: Allow empty application nodes in actctx. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/kernel32/tests/actctx.c | 34 ++++++++++++++++++++++++++++++++++ dlls/ntdll/actctx.c | 9 +++++++++ 2 files changed, 43 insertions(+) diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index d468777ac2f..fb035567c6e 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -511,6 +511,23 @@ static const char settings_manifest3[] = " </asmv3:application>" "</assembly>"; +static const char settings_manifest4[] = +"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">" +" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>" +" <application/>" +" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">" +" <windowsSettings>" +" <dpiAware xmlns=\"
http://schemas.microsoft.com/SMI/2005/WindowsSettings\
">true</dpiAware>" +" </windowsSettings>" +" </application>" +" <application/>" +" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">" +" <windowsSettings>" +" <dpiAwareness xmlns=\"
http://schemas.microsoft.com/SMI/2016/WindowsSettings\
">true</dpiAwareness>" +" </windowsSettings>" +" </application>" +"</assembly>"; + static const char two_dll_manifest_dll[] = "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v3\" manifestVersion=\"1.0\">" " <assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\" processorArchitecture=\"x86\" publicKeyToken=\"0000000000000000\"/>" @@ -3405,6 +3422,23 @@ static void test_settings(void) ok( !ret, "QueryActCtxSettingsW succeeded\n" ); ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ReleaseActCtx(handle); + + /* lookup occurs in first non empty node */ + create_manifest_file( "manifest_settings4.manifest", settings_manifest4, -1, NULL, NULL ); + handle = test_create("manifest_settings4.manifest"); + ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() ); + DeleteFileA( "manifest_settings3.manifest" ); + SetLastError( 0xdeadbeef ); + size = 0xdead; + memset( buffer, 0xcc, sizeof(buffer) ); + ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size ); + ok( ret, "QueryActCtxSettingsW failed\n" ); + SetLastError( 0xdeadbeef ); + size = 0xdead; + memset( buffer, 0xcc, sizeof(buffer) ); + ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwarenessW, buffer, 80, &size ); + ok( !ret, "QueryActCtxSettingsW succeeded\n" ); + ReleaseActCtx(handle); } typedef struct diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 9f2c1d54720..d08519b83b8 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2564,6 +2564,15 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent ) { struct xml_elem elem; + struct xml_attr attr; + BOOL end = FALSE; + + while (next_xml_attr(xmlbuf, &attr, &end)) + { + if (!is_xmlns_attr( &attr )) WARN( "unknown attr %s\n", debugstr_xml_attr(&attr) ); + } + + if (end) return; while (next_xml_elem( xmlbuf, &elem, parent )) {
1
0
0
0
Piotr Caban : msvcp140_atomic_wait: Add __std_acquire_shared_mutex_for_instance implementation.
by Alexandre Julliard
19 Sep '23
19 Sep '23
Module: wine Branch: master Commit: 1155a1914b379f819e4a1be9e092e10bf27a7a2c URL:
https://gitlab.winehq.org/wine/wine/-/commit/1155a1914b379f819e4a1be9e092e1…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Sep 19 15:28:24 2023 +0200 msvcp140_atomic_wait: Add __std_acquire_shared_mutex_for_instance implementation. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55184
--- dlls/msvcp140_atomic_wait/main.c | 84 ++++++++++++++++++++++ .../msvcp140_atomic_wait/msvcp140_atomic_wait.spec | 4 +- .../tests/msvcp140_atomic_wait.c | 33 +++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140_atomic_wait/main.c b/dlls/msvcp140_atomic_wait/main.c index bee7164e09f..b7aa30200ff 100644 --- a/dlls/msvcp140_atomic_wait/main.c +++ b/dlls/msvcp140_atomic_wait/main.c @@ -20,6 +20,7 @@ #include "windef.h" #include "winbase.h" #include "wine/debug.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp); @@ -81,3 +82,86 @@ BOOL __stdcall __std_atomic_wait_direct(volatile void *addr, void *cmp, TRACE("(%p %p %Id %ld)\n", addr, cmp, size, timeout); return WaitOnAddress(addr, cmp, size, timeout); } + +typedef struct +{ + SRWLOCK srwlock; +} shared_mutex; + +struct shared_mutex_elem +{ + struct list entry; + int ref; + void *ptr; + shared_mutex mutex; +}; + +static CRITICAL_SECTION shared_mutex_cs; +static CRITICAL_SECTION_DEBUG shared_mutex_cs_debug = +{ + 0, 0, &shared_mutex_cs, + { &shared_mutex_cs_debug.ProcessLocksList, &shared_mutex_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": shared_mutex_cs") } +}; +static CRITICAL_SECTION shared_mutex_cs = { &shared_mutex_cs_debug, -1, 0, 0, 0, 0 }; +static struct list shared_mutex_list = LIST_INIT(shared_mutex_list); + +/* shared_mutex_cs must be held by caller */ +static struct shared_mutex_elem* find_shared_mutex(void *ptr) +{ + struct shared_mutex_elem *sme; + + LIST_FOR_EACH_ENTRY(sme, &shared_mutex_list, struct shared_mutex_elem, entry) + { + if (sme->ptr == ptr) + return sme; + } + return NULL; +} + +shared_mutex* __stdcall __std_acquire_shared_mutex_for_instance(void *ptr) +{ + struct shared_mutex_elem *sme; + + TRACE("(%p)\n", ptr); + + EnterCriticalSection(&shared_mutex_cs); + sme = find_shared_mutex(ptr); + if (sme) + { + sme->ref++; + LeaveCriticalSection(&shared_mutex_cs); + return &sme->mutex; + } + + sme = malloc(sizeof(*sme)); + sme->ref = 1; + sme->ptr = ptr; + InitializeSRWLock(&sme->mutex.srwlock); + list_add_head(&shared_mutex_list, &sme->entry); + LeaveCriticalSection(&shared_mutex_cs); + return &sme->mutex; +} + +void __stdcall __std_release_shared_mutex_for_instance(void *ptr) +{ + struct shared_mutex_elem *sme; + + TRACE("(%p)\n", ptr); + + EnterCriticalSection(&shared_mutex_cs); + sme = find_shared_mutex(ptr); + if (!sme) + { + LeaveCriticalSection(&shared_mutex_cs); + return; + } + + sme->ref--; + if (!sme->ref) + { + list_remove(&sme->entry); + free(sme); + } + LeaveCriticalSection(&shared_mutex_cs); +} diff --git a/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec b/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec index 04b5bf2c7f9..5d9dd5c1a74 100644 --- a/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec +++ b/dlls/msvcp140_atomic_wait/msvcp140_atomic_wait.spec @@ -1,4 +1,4 @@ -@ stub __std_acquire_shared_mutex_for_instance +@ stdcall __std_acquire_shared_mutex_for_instance(ptr) @ stub __std_atomic_compare_exchange_128 @ stub __std_atomic_get_mutex @ stub __std_atomic_has_cmpxchg16b @@ -19,7 +19,7 @@ @ stub __std_execution_wake_by_address_all @ stub __std_free_crt @ stdcall __std_parallel_algorithms_hw_threads() -@ stub __std_release_shared_mutex_for_instance +@ stdcall __std_release_shared_mutex_for_instance(ptr) @ stdcall __std_submit_threadpool_work(ptr) @ stub __std_tzdb_delete_current_zone @ stub __std_tzdb_delete_leap_seconds diff --git a/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c b/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c index c10217cf34f..882e07c48db 100644 --- a/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c +++ b/dlls/msvcp140_atomic_wait/tests/msvcp140_atomic_wait.c @@ -23,6 +23,11 @@ #include "winbase.h" #include "wine/test.h" +typedef struct +{ + SRWLOCK srwlock; +} shared_mutex; + static unsigned int (__stdcall *p___std_parallel_algorithms_hw_threads)(void); static void (__stdcall *p___std_bulk_submit_threadpool_work)(PTP_WORK, size_t); @@ -32,6 +37,8 @@ static void (__stdcall *p___std_submit_threadpool_work)(PTP_WORK); static void (__stdcall *p___std_wait_for_threadpool_work_callbacks)(PTP_WORK, BOOL); static BOOL (__stdcall *p___std_atomic_wait_direct)(volatile void*, void*, size_t, DWORD); static void (__stdcall *p___std_atomic_notify_one_direct)(void*); +static shared_mutex* (__stdcall *p___std_acquire_shared_mutex_for_instance)(void*); +static void (__stdcall *p___std_release_shared_mutex_for_instance)(void*); #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) @@ -51,6 +58,8 @@ static HMODULE init(void) SET(p___std_wait_for_threadpool_work_callbacks, "__std_wait_for_threadpool_work_callbacks"); SET(p___std_atomic_wait_direct, "__std_atomic_wait_direct"); SET(p___std_atomic_notify_one_direct, "__std_atomic_notify_one_direct"); + SET(p___std_acquire_shared_mutex_for_instance, "__std_acquire_shared_mutex_for_instance"); + SET(p___std_release_shared_mutex_for_instance, "__std_release_shared_mutex_for_instance"); return msvcp; } @@ -237,6 +246,29 @@ static void test___std_atomic_wait_direct(void) CloseHandle(thread); } +static void test___std_acquire_shared_mutex_for_instance(void) +{ + shared_mutex *ret1, *ret2; + + ret1 = p___std_acquire_shared_mutex_for_instance(NULL); + ok(ret1 != NULL, "got %p\n", ret1); + ret2 = p___std_acquire_shared_mutex_for_instance(NULL); + ok(ret2 != NULL, "got %p\n", ret2); + ok(ret1 == ret2, "got different instances of shared mutex\n"); + + ret2 = p___std_acquire_shared_mutex_for_instance((void *)1); + ok(ret2 != NULL, "got %p\n", ret2); + ok(ret1 != ret2, "got the same instance of shared mutex\n"); + + p___std_release_shared_mutex_for_instance(NULL); + p___std_release_shared_mutex_for_instance((void *)1); + + AcquireSRWLockExclusive(&ret1->srwlock); + ReleaseSRWLockExclusive(&ret1->srwlock); + p___std_release_shared_mutex_for_instance(NULL); + p___std_release_shared_mutex_for_instance(NULL); +} + START_TEST(msvcp140_atomic_wait) { HMODULE msvcp; @@ -248,5 +280,6 @@ START_TEST(msvcp140_atomic_wait) test___std_parallel_algorithms_hw_threads(); test_threadpool_work(); test___std_atomic_wait_direct(); + test___std_acquire_shared_mutex_for_instance(); FreeLibrary(msvcp); }
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200